mirror of
https://github.com/psforever/PSF-LoginServer.git
synced 2026-07-14 07:55:33 +00:00
Fix merge
Fix tests
This commit is contained in:
parent
6551de6f53
commit
3df302f313
3 changed files with 16 additions and 16 deletions
|
|
@ -56,7 +56,7 @@ import net.psforever.objects.vital.interaction.{DamageInteraction, DamageResult}
|
||||||
import net.psforever.objects.vital.prop.DamageWithPosition
|
import net.psforever.objects.vital.prop.DamageWithPosition
|
||||||
import net.psforever.objects.vital.Vitality
|
import net.psforever.objects.vital.Vitality
|
||||||
import net.psforever.objects.zones.blockmap.{BlockMap, SectorPopulation}
|
import net.psforever.objects.zones.blockmap.{BlockMap, SectorPopulation}
|
||||||
import net.psforever.packet.game.EmpireBenefitsMessage.{ZoneBenefits, ZoneLocks}
|
import net.psforever.packet.game.EmpireBenefitsMessage.{ZoneBenefit, ZoneLock, ZoneLockBenefit, ZoneLockZone}
|
||||||
import net.psforever.packet.game.{EmpireBenefitsMessage, PropertyOverrideMessage}
|
import net.psforever.packet.game.{EmpireBenefitsMessage, PropertyOverrideMessage}
|
||||||
import net.psforever.services.Service
|
import net.psforever.services.Service
|
||||||
import net.psforever.zones.Zones
|
import net.psforever.zones.Zones
|
||||||
|
|
@ -690,7 +690,7 @@ class Zone(val id: String, val map: ZoneMap, zoneNumber: Int) {
|
||||||
building.Actor ! BuildingActor.HomeLockBenefits(overrideMsg)
|
building.Actor ! BuildingActor.HomeLockBenefits(overrideMsg)
|
||||||
}
|
}
|
||||||
val benefitMsg = BuildEmpireBenefits()
|
val benefitMsg = BuildEmpireBenefits()
|
||||||
if (benefitMsg.entriesA.nonEmpty) {
|
if (benefitMsg.zoneLocks.nonEmpty) {
|
||||||
building.Actor ! BuildingActor.HomeLockBenefits(benefitMsg)
|
building.Actor ! BuildingActor.HomeLockBenefits(benefitMsg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -729,14 +729,14 @@ class Zone(val id: String, val map: ZoneMap, zoneNumber: Int) {
|
||||||
}
|
}
|
||||||
|
|
||||||
val benefitMsg = BuildEmpireBenefits()
|
val benefitMsg = BuildEmpireBenefits()
|
||||||
if (benefitMsg.entriesA.nonEmpty) {
|
if (benefitMsg.zoneLocks.nonEmpty) {
|
||||||
PlayerControl.sendResponse(player.Zone, player.Name, benefitMsg)
|
PlayerControl.sendResponse(player.Zone, player.Name, benefitMsg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def BuildEmpireBenefits(): EmpireBenefitsMessage = {
|
def BuildEmpireBenefits(): EmpireBenefitsMessage = {
|
||||||
val locks = scala.collection.mutable.ArrayBuffer[ZoneLocks]()
|
val locks = scala.collection.mutable.ArrayBuffer[ZoneLock]()
|
||||||
val benefits = scala.collection.mutable.ArrayBuffer[ZoneBenefits]()
|
val benefits = scala.collection.mutable.ArrayBuffer[ZoneBenefit]()
|
||||||
val homeSets: Map[PlanetSideEmpire.Value, Set[Int]] = Map(
|
val homeSets: Map[PlanetSideEmpire.Value, Set[Int]] = Map(
|
||||||
PlanetSideEmpire.TR -> Set(1, 2),
|
PlanetSideEmpire.TR -> Set(1, 2),
|
||||||
PlanetSideEmpire.VS -> Set(5, 6),
|
PlanetSideEmpire.VS -> Set(5, 6),
|
||||||
|
|
@ -759,8 +759,8 @@ class Zone(val id: String, val map: ZoneMap, zoneNumber: Int) {
|
||||||
homeSets.foreach { case (owner, set) =>
|
homeSets.foreach { case (owner, set) =>
|
||||||
PlanetSideEmpire.values.filterNot(_ == PlanetSideEmpire.NEUTRAL).foreach { empire =>
|
PlanetSideEmpire.values.filterNot(_ == PlanetSideEmpire.NEUTRAL).foreach { empire =>
|
||||||
if (owner != empire && isLockedBy(set, empire)) {
|
if (owner != empire && isLockedBy(set, empire)) {
|
||||||
locks += ZoneLocks(empire.id, s"lock-${owner.toString.toLowerCase}-homes")
|
locks += ZoneLock(empire, s"lock-${owner.toString.toLowerCase}-homes")
|
||||||
benefits += ZoneBenefits(empire.id, homePerkBenefits(owner))
|
benefits += ZoneBenefit(empire, ZoneLockBenefit(homePerkBenefits(owner)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -771,8 +771,8 @@ class Zone(val id: String, val map: ZoneMap, zoneNumber: Int) {
|
||||||
case PlanetSideEmpire.NEUTRAL =>
|
case PlanetSideEmpire.NEUTRAL =>
|
||||||
//nothing
|
//nothing
|
||||||
case empire =>
|
case empire =>
|
||||||
locks += ZoneLocks(empire.id, s"lock-z$zoneNum")
|
locks += ZoneLock(empire, s"lock-z$zoneNum")
|
||||||
benefits += ZoneBenefits(empire.id, benefitId)
|
benefits += ZoneBenefit(empire, ZoneLockBenefit(benefitId))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -781,8 +781,8 @@ class Zone(val id: String, val map: ZoneMap, zoneNumber: Int) {
|
||||||
val islandBenefit: Int = 4
|
val islandBenefit: Int = 4
|
||||||
PlanetSideEmpire.values.filterNot(_ == PlanetSideEmpire.NEUTRAL).foreach { empire =>
|
PlanetSideEmpire.values.filterNot(_ == PlanetSideEmpire.NEUTRAL).foreach { empire =>
|
||||||
if (isLockedBy(islandZones, empire)) {
|
if (isLockedBy(islandZones, empire)) {
|
||||||
locks += ZoneLocks(empire.id, "lock-i1-i2-i3-i4")
|
locks += ZoneLock(empire, ZoneLockZone.i1_i2_i3_i4)
|
||||||
benefits += ZoneBenefits(empire.id, islandBenefit)
|
benefits += ZoneBenefit(empire, ZoneLockBenefit(islandBenefit))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EmpireBenefitsMessage(locks.toVector, benefits.toVector)
|
EmpireBenefitsMessage(locks.toVector, benefits.toVector)
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ class MountedVehiclesTest extends Specification {
|
||||||
vdata.no_mount_points mustEqual false
|
vdata.no_mount_points mustEqual false
|
||||||
vdata.driveState mustEqual DriveState.Mobile
|
vdata.driveState mustEqual DriveState.Mobile
|
||||||
vdata.cloak mustEqual false
|
vdata.cloak mustEqual false
|
||||||
vdata.unk3 mustEqual false
|
vdata.boostMaxHealth mustEqual false
|
||||||
vdata.unk4 mustEqual false
|
vdata.unk4 mustEqual false
|
||||||
vdata.unk5 mustEqual false
|
vdata.unk5 mustEqual false
|
||||||
vdata.unk6 mustEqual false
|
vdata.unk6 mustEqual false
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ class UtilityVehiclesTest extends Specification {
|
||||||
ant.driveState mustEqual DriveState.Mobile
|
ant.driveState mustEqual DriveState.Mobile
|
||||||
ant.health mustEqual 255
|
ant.health mustEqual 255
|
||||||
ant.cloak mustEqual false
|
ant.cloak mustEqual false
|
||||||
ant.unk3 mustEqual false
|
ant.boostMaxHealth mustEqual false
|
||||||
ant.unk4 mustEqual false
|
ant.unk4 mustEqual false
|
||||||
ant.unk5 mustEqual false
|
ant.unk5 mustEqual false
|
||||||
ant.unk6 mustEqual false
|
ant.unk6 mustEqual false
|
||||||
|
|
@ -67,7 +67,7 @@ class UtilityVehiclesTest extends Specification {
|
||||||
ams.vehicle_format_data mustEqual Some(UtilityVehicleData(60))
|
ams.vehicle_format_data mustEqual Some(UtilityVehicleData(60))
|
||||||
ams.health mustEqual 236
|
ams.health mustEqual 236
|
||||||
ams.cloak mustEqual true
|
ams.cloak mustEqual true
|
||||||
ams.unk3 mustEqual false
|
ams.boostMaxHealth mustEqual false
|
||||||
ams.unk4 mustEqual false
|
ams.unk4 mustEqual false
|
||||||
ams.unk5 mustEqual false
|
ams.unk5 mustEqual false
|
||||||
ams.unk6 mustEqual true
|
ams.unk6 mustEqual true
|
||||||
|
|
@ -120,7 +120,7 @@ class UtilityVehiclesTest extends Specification {
|
||||||
case _ =>
|
case _ =>
|
||||||
ko
|
ko
|
||||||
}
|
}
|
||||||
ams.unk3 mustEqual false
|
ams.boostMaxHealth mustEqual false
|
||||||
ams.health mustEqual 255
|
ams.health mustEqual 255
|
||||||
ams.unk4 mustEqual false
|
ams.unk4 mustEqual false
|
||||||
ams.no_mount_points mustEqual false
|
ams.no_mount_points mustEqual false
|
||||||
|
|
@ -320,7 +320,7 @@ class UtilityVehiclesTest extends Specification {
|
||||||
Some(Vector3(27.3375f, -0.78749996f, 0.1125f))
|
Some(Vector3(27.3375f, -0.78749996f, 0.1125f))
|
||||||
),
|
),
|
||||||
CommonFieldData(PlanetSideEmpire.TR, false, false, false, None, false, Some(false), None, PlanetSideGUID(3087)),
|
CommonFieldData(PlanetSideEmpire.TR, false, false, false, None, false, Some(false), None, PlanetSideGUID(3087)),
|
||||||
unk3 = false,
|
boostMaxHealth = false,
|
||||||
health = 255,
|
health = 255,
|
||||||
unk4 = false,
|
unk4 = false,
|
||||||
no_mount_points = false,
|
no_mount_points = false,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue