mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-01-20 02:24:45 +00:00
Fix zipline path data being entirely missing
This commit is contained in:
parent
babd455753
commit
bf240295da
4811
src/main/resources/zonemaps/zpl_ugd01.json
Normal file
4811
src/main/resources/zonemaps/zpl_ugd01.json
Normal file
File diff suppressed because it is too large
Load diff
11692
src/main/resources/zonemaps/zpl_ugd02.json
Normal file
11692
src/main/resources/zonemaps/zpl_ugd02.json
Normal file
File diff suppressed because it is too large
Load diff
7396
src/main/resources/zonemaps/zpl_ugd03.json
Normal file
7396
src/main/resources/zonemaps/zpl_ugd03.json
Normal file
File diff suppressed because it is too large
Load diff
5659
src/main/resources/zonemaps/zpl_ugd04.json
Normal file
5659
src/main/resources/zonemaps/zpl_ugd04.json
Normal file
File diff suppressed because it is too large
Load diff
4343
src/main/resources/zonemaps/zpl_ugd05.json
Normal file
4343
src/main/resources/zonemaps/zpl_ugd05.json
Normal file
File diff suppressed because it is too large
Load diff
5995
src/main/resources/zonemaps/zpl_ugd06.json
Normal file
5995
src/main/resources/zonemaps/zpl_ugd06.json
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -2,7 +2,7 @@ package net.psforever.objects.serverobject.zipline
|
||||||
|
|
||||||
import net.psforever.types.Vector3
|
import net.psforever.types.Vector3
|
||||||
|
|
||||||
class ZipLinePath(
|
case class ZipLinePath(
|
||||||
private val pathId: Integer,
|
private val pathId: Integer,
|
||||||
private val isTeleporter: Boolean,
|
private val isTeleporter: Boolean,
|
||||||
private val zipLinePoints: List[Vector3]
|
private val zipLinePoints: List[Vector3]
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ import net.psforever.objects.serverobject.structures.{
|
||||||
}
|
}
|
||||||
import net.psforever.objects.serverobject.tube.SpawnTube
|
import net.psforever.objects.serverobject.tube.SpawnTube
|
||||||
import net.psforever.objects.serverobject.turret.{FacilityTurret, FacilityTurretDefinition}
|
import net.psforever.objects.serverobject.turret.{FacilityTurret, FacilityTurretDefinition}
|
||||||
|
import net.psforever.objects.serverobject.zipline.ZipLinePath
|
||||||
import net.psforever.objects.zones.{MapInfo, Zone, ZoneInfo, ZoneMap}
|
import net.psforever.objects.zones.{MapInfo, Zone, ZoneInfo, ZoneMap}
|
||||||
import net.psforever.types.{PlanetSideEmpire, Vector3}
|
import net.psforever.types.{PlanetSideEmpire, Vector3}
|
||||||
import net.psforever.util.DefinitionUtil
|
import net.psforever.util.DefinitionUtil
|
||||||
|
|
@ -78,6 +79,18 @@ object Zones {
|
||||||
"IsChildObject"
|
"IsChildObject"
|
||||||
)(ZoneMapEntity.apply)
|
)(ZoneMapEntity.apply)
|
||||||
|
|
||||||
|
private implicit val decodeVector3 : Decoder[Vector3] = Decoder.forProduct3(
|
||||||
|
"X",
|
||||||
|
"Y",
|
||||||
|
"Z"
|
||||||
|
)(Vector3.apply)
|
||||||
|
|
||||||
|
private implicit val decodeZipLinePath: Decoder[ZipLinePath] = Decoder.forProduct3(
|
||||||
|
"PathId",
|
||||||
|
"IsTeleporter",
|
||||||
|
"PathPoints"
|
||||||
|
)(ZipLinePath.apply)
|
||||||
|
|
||||||
// monolith, hst, warpgate are ignored for now as the scala code isn't ready to handle them.
|
// monolith, hst, warpgate are ignored for now as the scala code isn't ready to handle them.
|
||||||
// BFR terminals/doors are ignored as top level elements as sanctuaries have them with no associated building. (repair_silo also has this problem, but currently is ignored in the AmenityExtrator project)
|
// BFR terminals/doors are ignored as top level elements as sanctuaries have them with no associated building. (repair_silo also has this problem, but currently is ignored in the AmenityExtrator project)
|
||||||
// Force domes have GUIDs but are currently classed as separate entities. The dome is controlled by sending GOAM 44 / 48 / 52 to the building GUID
|
// Force domes have GUIDs but are currently classed as separate entities. The dome is controlled by sending GOAM 44 / 48 / 52 to the building GUID
|
||||||
|
|
@ -191,15 +204,27 @@ object Zones {
|
||||||
} catch {
|
} catch {
|
||||||
case _: FileNotFoundException => Seq()
|
case _: FileNotFoundException => Seq()
|
||||||
}
|
}
|
||||||
(info, data)
|
|
||||||
|
val zplData =
|
||||||
|
try {
|
||||||
|
val res = Source.fromResource(s"zonemaps/zpl_${info.value}.json")
|
||||||
|
val json = res.mkString
|
||||||
|
res.close()
|
||||||
|
decode[Seq[ZipLinePath]](json).toOption.get
|
||||||
|
} catch {
|
||||||
|
case _: FileNotFoundException => Seq()
|
||||||
|
}
|
||||||
|
(info, data, zplData)
|
||||||
}
|
}
|
||||||
.map {
|
.map {
|
||||||
case (info, data) =>
|
case (info, data, zplData) =>
|
||||||
val zoneMap = new ZoneMap(info.value)
|
val zoneMap = new ZoneMap(info.value)
|
||||||
|
|
||||||
zoneMap.checksum = info.checksum
|
zoneMap.checksum = info.checksum
|
||||||
zoneMap.scale = info.scale
|
zoneMap.scale = info.scale
|
||||||
|
|
||||||
|
zoneMap.zipLinePaths = zplData.toList
|
||||||
|
|
||||||
// This keeps track of the last used turret weapon guid, as they seem to be arbitrarily assigned at 5000+
|
// This keeps track of the last used turret weapon guid, as they seem to be arbitrarily assigned at 5000+
|
||||||
val turretWeaponGuid = new AtomicInteger(5000)
|
val turretWeaponGuid = new AtomicInteger(5000)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue