mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-03-21 21:10:41 +00:00
added a LockerContainer global definition; adjusted how the lockers inhabit the fifthtSlot on players and how they are accessed; fixed converter tests to account for contents and added a quick content test; Live players will now register and unregister the contents of their fifthslot
This commit is contained in:
parent
48e3f77d48
commit
85a6eb00fd
6 changed files with 79 additions and 25 deletions
|
|
@ -155,6 +155,7 @@ class ConverterTest extends Specification {
|
|||
tool.AmmoSlots.head.Box = box1
|
||||
val obj = Player(PlanetSideGUID(93), "Chord", PlanetSideEmpire.TR, CharacterGender.Male, 0, 5)
|
||||
obj.Slot(2).Equipment = tool
|
||||
obj.Slot(5).Equipment.get.GUID = PlanetSideGUID(94)
|
||||
obj.Inventory += 8 -> box2
|
||||
|
||||
obj.Definition.Packet.DetailedConstructorData(obj).isSuccess mustEqual true
|
||||
|
|
@ -163,11 +164,11 @@ class ConverterTest extends Specification {
|
|||
}
|
||||
|
||||
"LockerContainer" should {
|
||||
"convert to packet" in {
|
||||
"convert to packet (empty)" in {
|
||||
val obj = LockerContainer()
|
||||
obj.Definition.Packet.DetailedConstructorData(obj) match {
|
||||
case Success(pkt) =>
|
||||
pkt mustEqual DetailedLockerContainerData(8)
|
||||
pkt mustEqual DetailedLockerContainerData(8, None)
|
||||
case _ =>
|
||||
ko
|
||||
}
|
||||
|
|
@ -178,6 +179,27 @@ class ConverterTest extends Specification {
|
|||
ko
|
||||
}
|
||||
}
|
||||
|
||||
"convert to packet (occupied)" in {
|
||||
import GlobalDefinitions._
|
||||
val obj = LockerContainer()
|
||||
val rek = SimpleItem(remote_electronics_kit)
|
||||
rek.GUID = PlanetSideGUID(1)
|
||||
obj.Inventory += 0 -> rek
|
||||
|
||||
obj.Definition.Packet.DetailedConstructorData(obj) match {
|
||||
case Success(pkt) =>
|
||||
pkt mustEqual DetailedLockerContainerData(8, InternalSlot(remote_electronics_kit.ObjectId, PlanetSideGUID(1), 0, DetailedREKData(8)) :: Nil)
|
||||
case _ =>
|
||||
ko
|
||||
}
|
||||
obj.Definition.Packet.ConstructorData(obj) match {
|
||||
case Success(pkt) =>
|
||||
pkt mustEqual LockerContainerData(InventoryData(InternalSlot(remote_electronics_kit.ObjectId, PlanetSideGUID(1), 0, REKData(8,0)) :: Nil))
|
||||
case _ =>
|
||||
ko
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
"Vehicle" should {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue