mirror of
https://github.com/psforever/PSF-LoginServer.git
synced 2026-02-26 10:03:41 +00:00
Revert "Let's Move Item, Together (#429)"
This reverts commit 3f2240947b.
This commit is contained in:
parent
4fa2be151b
commit
896fa7bf07
41 changed files with 1730 additions and 3096 deletions
|
|
@ -389,10 +389,7 @@ class AvatarTest extends Specification {
|
|||
|
||||
"the fifth slot is the locker wrapped in an EquipmentSlot" in {
|
||||
val (_, avatar) = CreatePlayer()
|
||||
avatar.FifthSlot.Equipment match {
|
||||
case Some(slot : LockerEquipment) => slot.Inventory mustEqual avatar.Locker.Inventory
|
||||
case _ => ko
|
||||
}
|
||||
avatar.FifthSlot.Equipment.contains(avatar.Locker)
|
||||
}
|
||||
|
||||
"toString" in {
|
||||
|
|
|
|||
|
|
@ -631,7 +631,7 @@ class ConverterTest extends Specification {
|
|||
|
||||
"LockerContainer" should {
|
||||
"convert to packet (empty)" in {
|
||||
val obj = new LockerEquipment(LockerContainer())
|
||||
val obj = LockerContainer()
|
||||
obj.Definition.Packet.DetailedConstructorData(obj) match {
|
||||
case Success(pkt) =>
|
||||
pkt mustEqual DetailedLockerContainerData(CommonFieldData(PlanetSideEmpire.NEUTRAL, false, false, true, None, false, None, None, PlanetSideGUID(0)), None)
|
||||
|
|
@ -648,7 +648,7 @@ class ConverterTest extends Specification {
|
|||
|
||||
"convert to packet (occupied)" in {
|
||||
import GlobalDefinitions._
|
||||
val obj = new LockerEquipment(LockerContainer())
|
||||
val obj = LockerContainer()
|
||||
val rek = SimpleItem(remote_electronics_kit)
|
||||
rek.GUID = PlanetSideGUID(1)
|
||||
obj.Inventory += 0 -> rek
|
||||
|
|
|
|||
|
|
@ -525,136 +525,4 @@ class InventoryTest extends Specification {
|
|||
ok
|
||||
}
|
||||
}
|
||||
|
||||
"InventoryEquiupmentSlot" should {
|
||||
"insert, collide, insert" in {
|
||||
val obj : GridInventory = GridInventory(7, 7)
|
||||
obj.Slot(16).Equipment = bullet9mmBox1
|
||||
//confirm all squares
|
||||
obj.Slot( 8).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot( 9).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot( 10).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot( 11).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot( 12).Equipment.nonEmpty mustEqual false
|
||||
//
|
||||
obj.Slot(15).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot(16).Equipment.nonEmpty mustEqual true
|
||||
obj.Slot(17).Equipment.nonEmpty mustEqual true
|
||||
obj.Slot(18).Equipment.nonEmpty mustEqual true
|
||||
obj.Slot(19).Equipment.nonEmpty mustEqual false
|
||||
//
|
||||
obj.Slot(22).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot(23).Equipment.nonEmpty mustEqual true
|
||||
obj.Slot(24).Equipment.nonEmpty mustEqual true
|
||||
obj.Slot(25).Equipment.nonEmpty mustEqual true
|
||||
obj.Slot(26).Equipment.nonEmpty mustEqual false
|
||||
//
|
||||
obj.Slot(29).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot(30).Equipment.nonEmpty mustEqual true
|
||||
obj.Slot(31).Equipment.nonEmpty mustEqual true
|
||||
obj.Slot(32).Equipment.nonEmpty mustEqual true
|
||||
obj.Slot(33).Equipment.nonEmpty mustEqual false
|
||||
//
|
||||
obj.Slot(36).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot(37).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot(38).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot(39).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot(40).Equipment.nonEmpty mustEqual false
|
||||
//
|
||||
//remove
|
||||
obj.Slot(16).Equipment = None
|
||||
obj.Slot( 8).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot( 9).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot( 10).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot( 11).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot( 12).Equipment.nonEmpty mustEqual false
|
||||
//
|
||||
obj.Slot(15).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot(16).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot(17).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot(18).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot(19).Equipment.nonEmpty mustEqual false
|
||||
//
|
||||
obj.Slot(22).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot(23).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot(24).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot(25).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot(26).Equipment.nonEmpty mustEqual false
|
||||
//
|
||||
obj.Slot(29).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot(30).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot(31).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot(32).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot(33).Equipment.nonEmpty mustEqual false
|
||||
//
|
||||
obj.Slot(36).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot(37).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot(38).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot(39).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot(40).Equipment.nonEmpty mustEqual false
|
||||
//insert again
|
||||
obj.Slot(16).Equipment = bullet9mmBox2
|
||||
obj.Slot( 8).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot( 9).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot( 10).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot( 11).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot( 12).Equipment.nonEmpty mustEqual false
|
||||
//
|
||||
obj.Slot(15).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot(16).Equipment.nonEmpty mustEqual true
|
||||
obj.Slot(17).Equipment.nonEmpty mustEqual true
|
||||
obj.Slot(18).Equipment.nonEmpty mustEqual true
|
||||
obj.Slot(19).Equipment.nonEmpty mustEqual false
|
||||
//
|
||||
obj.Slot(22).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot(23).Equipment.nonEmpty mustEqual true
|
||||
obj.Slot(24).Equipment.nonEmpty mustEqual true
|
||||
obj.Slot(25).Equipment.nonEmpty mustEqual true
|
||||
obj.Slot(26).Equipment.nonEmpty mustEqual false
|
||||
//
|
||||
obj.Slot(29).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot(30).Equipment.nonEmpty mustEqual true
|
||||
obj.Slot(31).Equipment.nonEmpty mustEqual true
|
||||
obj.Slot(32).Equipment.nonEmpty mustEqual true
|
||||
obj.Slot(33).Equipment.nonEmpty mustEqual false
|
||||
//
|
||||
obj.Slot(36).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot(37).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot(38).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot(39).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot(40).Equipment.nonEmpty mustEqual false
|
||||
//
|
||||
//remove
|
||||
obj.Slot(16).Equipment = None
|
||||
obj.Slot( 8).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot( 9).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot( 10).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot( 11).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot( 12).Equipment.nonEmpty mustEqual false
|
||||
//
|
||||
obj.Slot(15).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot(16).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot(17).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot(18).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot(19).Equipment.nonEmpty mustEqual false
|
||||
//
|
||||
obj.Slot(22).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot(23).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot(24).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot(25).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot(26).Equipment.nonEmpty mustEqual false
|
||||
//
|
||||
obj.Slot(29).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot(30).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot(31).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot(32).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot(33).Equipment.nonEmpty mustEqual false
|
||||
//
|
||||
obj.Slot(36).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot(37).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot(38).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot(39).Equipment.nonEmpty mustEqual false
|
||||
obj.Slot(40).Equipment.nonEmpty mustEqual false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,12 +32,10 @@ class PlayerControlHealTest extends ActorTest {
|
|||
player1.Zone = zone
|
||||
player1.Spawn
|
||||
player1.Position = Vector3(2, 0, 0)
|
||||
guid.register(player1.Locker, 5)
|
||||
player1.Actor = system.actorOf(Props(classOf[PlayerControl], player1), "player1-control")
|
||||
val player2 = Player(Avatar("TestCharacter2", PlanetSideEmpire.TR, CharacterGender.Male, 0, CharacterVoice.Mute)) //guid=2
|
||||
player2.Zone = zone
|
||||
player2.Spawn
|
||||
guid.register(player2.Locker, 6)
|
||||
player2.Actor = system.actorOf(Props(classOf[PlayerControl], player2), "player2-control")
|
||||
|
||||
val tool = Tool(GlobalDefinitions.medicalapplicator) //guid=3 & 4
|
||||
|
|
@ -104,7 +102,6 @@ class PlayerControlHealSelfTest extends ActorTest {
|
|||
player1.Zone = zone
|
||||
player1.Spawn
|
||||
player1.Position = Vector3(2, 0, 0)
|
||||
guid.register(player1.Locker, 5)
|
||||
player1.Actor = system.actorOf(Props(classOf[PlayerControl], player1), "player1-control")
|
||||
|
||||
val tool = Tool(GlobalDefinitions.medicalapplicator) //guid=3 & 4
|
||||
|
|
@ -170,12 +167,10 @@ class PlayerControlRepairTest extends ActorTest {
|
|||
player1.Zone = zone
|
||||
player1.Spawn
|
||||
player1.Position = Vector3(2, 0, 0)
|
||||
guid.register(player1.Locker, 5)
|
||||
player1.Actor = system.actorOf(Props(classOf[PlayerControl], player1), "player1-control")
|
||||
val player2 = Player(Avatar("TestCharacter2", PlanetSideEmpire.TR, CharacterGender.Male, 0, CharacterVoice.Mute)) //guid=2
|
||||
player2.Zone = zone
|
||||
player2.Spawn
|
||||
guid.register(player2.Locker, 6)
|
||||
player2.Actor = system.actorOf(Props(classOf[PlayerControl], player2), "player2-control")
|
||||
|
||||
val tool = Tool(GlobalDefinitions.bank) //guid=3 & 4
|
||||
|
|
@ -248,7 +243,6 @@ class PlayerControlRepairSelfTest extends ActorTest {
|
|||
player1.Zone = zone
|
||||
player1.Spawn
|
||||
player1.Position = Vector3(2, 0, 0)
|
||||
guid.register(player1.Locker, 5)
|
||||
player1.Actor = system.actorOf(Props(classOf[PlayerControl], player1), "player1-control")
|
||||
|
||||
val tool = Tool(GlobalDefinitions.bank) //guid=3 & 4
|
||||
|
|
@ -315,12 +309,10 @@ class PlayerControlDamageTest extends ActorTest {
|
|||
player1.Zone = zone
|
||||
player1.Spawn
|
||||
player1.Position = Vector3(2, 0, 0)
|
||||
guid.register(player1.Locker, 5)
|
||||
player1.Actor = system.actorOf(Props(classOf[PlayerControl], player1), "player1-control")
|
||||
val player2 = Player(Avatar("TestCharacter2", PlanetSideEmpire.NC, CharacterGender.Male, 0, CharacterVoice.Mute)) //guid=2
|
||||
player2.Zone = zone
|
||||
player2.Spawn
|
||||
guid.register(player2.Locker, 6)
|
||||
player2.Actor = system.actorOf(Props(classOf[PlayerControl], player2), "player2-control")
|
||||
val tool = Tool(GlobalDefinitions.suppressor) //guid 3 & 4
|
||||
val projectile = tool.Projectile
|
||||
|
|
@ -393,12 +385,10 @@ class PlayerControlDeathStandingTest extends ActorTest {
|
|||
player1.Zone = zone
|
||||
player1.Spawn
|
||||
player1.Position = Vector3(2,0,0)
|
||||
guid.register(player1.Locker, 5)
|
||||
player1.Actor = system.actorOf(Props(classOf[PlayerControl], player1), "player1-control")
|
||||
val player2 = Player(Avatar("TestCharacter2", PlanetSideEmpire.NC, CharacterGender.Male, 0, CharacterVoice.Mute)) //guid=2
|
||||
player2.Zone = zone
|
||||
player2.Spawn
|
||||
guid.register(player2.Locker, 6)
|
||||
player2.Actor = system.actorOf(Props(classOf[PlayerControl], player2), "player2-control")
|
||||
|
||||
val tool = Tool(GlobalDefinitions.suppressor) //guid 3 & 4
|
||||
|
|
@ -503,12 +493,10 @@ class PlayerControlDeathSeatedTest extends ActorTest {
|
|||
player1.Zone = zone
|
||||
player1.Spawn
|
||||
player1.Position = Vector3(2,0,0)
|
||||
guid.register(player1.Locker, 6)
|
||||
player1.Actor = system.actorOf(Props(classOf[PlayerControl], player1), "player1-control")
|
||||
val player2 = Player(Avatar("TestCharacter2", PlanetSideEmpire.NC, CharacterGender.Male, 0, CharacterVoice.Mute)) //guid=2
|
||||
player2.Zone = zone
|
||||
player2.Spawn
|
||||
guid.register(player2.Locker, 7)
|
||||
player2.Actor = system.actorOf(Props(classOf[PlayerControl], player2), "player2-control")
|
||||
|
||||
val vehicle = Vehicle(GlobalDefinitions.quadstealth) //guid=5
|
||||
|
|
@ -607,4 +595,5 @@ class PlayerControlDeathSeatedTest extends ActorTest {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
object PlayerControlTest { }
|
||||
|
|
|
|||
|
|
@ -279,7 +279,7 @@ class PlayerTest extends Specification {
|
|||
|
||||
"can access the player's locker-space" in {
|
||||
val obj = TestPlayer("Chord", PlanetSideEmpire.TR, CharacterGender.Male, 0, CharacterVoice.Voice5)
|
||||
obj.Slot(5).Equipment.get.isInstanceOf[LockerEquipment] mustEqual true
|
||||
obj.Slot(5).Equipment.get.isInstanceOf[LockerContainer] mustEqual true
|
||||
}
|
||||
|
||||
"can find equipment" in {
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ class GUIDTaskRegisterAvatarTest extends ActorTest {
|
|||
obj.Slot(6).Equipment = obj_inv_ammo
|
||||
val obj_locker = obj.Slot(5).Equipment.get
|
||||
val obj_locker_ammo = AmmoBox(GlobalDefinitions.energy_cell)
|
||||
obj_locker.asInstanceOf[LockerEquipment].Inventory += 0 -> obj_locker_ammo
|
||||
obj_locker.asInstanceOf[LockerContainer].Inventory += 0 -> obj_locker_ammo
|
||||
|
||||
assert(!obj.HasGUID)
|
||||
assert(!obj_wep.HasGUID)
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ class GUIDTaskRegisterPlayerTest extends ActorTest {
|
|||
obj.Slot(6).Equipment = obj_inv_ammo
|
||||
val obj_locker = obj.Slot(5).Equipment.get
|
||||
val obj_locker_ammo = AmmoBox(GlobalDefinitions.energy_cell)
|
||||
obj_locker.asInstanceOf[LockerEquipment].Inventory += 0 -> obj_locker_ammo
|
||||
obj_locker.asInstanceOf[LockerContainer].Inventory += 0 -> obj_locker_ammo
|
||||
|
||||
assert(!obj.HasGUID)
|
||||
assert(!obj_wep.HasGUID)
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ class GUIDTaskUnregisterAvatarTest extends ActorTest {
|
|||
obj.Slot(6).Equipment = obj_inv_ammo
|
||||
val obj_locker = obj.Slot(5).Equipment.get
|
||||
val obj_locker_ammo = AmmoBox(GlobalDefinitions.energy_cell)
|
||||
obj_locker.asInstanceOf[LockerEquipment].Inventory += 0 -> obj_locker_ammo
|
||||
obj_locker.asInstanceOf[LockerContainer].Inventory += 0 -> obj_locker_ammo
|
||||
guid.register(obj, "dynamic")
|
||||
guid.register(obj_wep, "dynamic")
|
||||
guid.register(obj_wep_ammo, "dynamic")
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ class GUIDTaskUnregisterPlayerTest extends ActorTest {
|
|||
obj.Slot(6).Equipment = obj_inv_ammo
|
||||
val obj_locker = obj.Slot(5).Equipment.get
|
||||
val obj_locker_ammo = AmmoBox(GlobalDefinitions.energy_cell)
|
||||
obj_locker.asInstanceOf[LockerEquipment].Inventory += 0 -> obj_locker_ammo
|
||||
obj_locker.asInstanceOf[LockerContainer].Inventory += 0 -> obj_locker_ammo
|
||||
guid.register(obj, "dynamic")
|
||||
guid.register(obj_wep, "dynamic")
|
||||
guid.register(obj_wep_ammo, "dynamic")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue