mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-07-14 07:55:07 +00:00
ignoring the inventory, character stream decoding is functional
This commit is contained in:
parent
b0b5a7005b
commit
7cd9b8f5f1
2 changed files with 77 additions and 56 deletions
|
|
@ -91,28 +91,28 @@ case class CharacterData(pos : Vector3,
|
||||||
unk3 : Int, //2
|
unk3 : Int, //2
|
||||||
viewPitch : Int,
|
viewPitch : Int,
|
||||||
viewYaw : Int,
|
viewYaw : Int,
|
||||||
upperMerit : Int, //0xFFFF means no merit (for all ...)
|
upperMerit : Long, //0xFFFFFFFF means no merit (for all ...)
|
||||||
middleMerit : Int,
|
middleMerit : Long,
|
||||||
lowerMerit : Int,
|
lowerMerit : Long,
|
||||||
termOfServiceMerit : Int,
|
termOfServiceMerit : Long,
|
||||||
// healthMax : Int,
|
healthMax : Int,
|
||||||
// health : Int,
|
health : Int,
|
||||||
// armor : Int,
|
armor : Int,
|
||||||
// unk4 : Int, //1
|
unk4 : Int, //1
|
||||||
// unk5 : Int, //7
|
unk5 : Int, //7
|
||||||
// unk6 : Int, //7
|
unk6 : Int, //7
|
||||||
// staminaMax : Int,
|
staminaMax : Int,
|
||||||
// stamina : Int,
|
stamina : Int,
|
||||||
// unk7 : Int, // 192
|
unk7 : Int, // 28
|
||||||
// unk8 : Int, //66
|
unk8 : Int, //4
|
||||||
// unk9 : Int, //197
|
unk9 : Int, //44
|
||||||
// unk10 : Int, //70
|
unk10 : Int, //84
|
||||||
// unk11 : Int, //134
|
unk11 : Int, //104
|
||||||
// unk12 : Int, //199
|
unk12 : Int, //1900
|
||||||
// firstTimeEvent_length : Long,
|
firstTimeEvent_length : Long,
|
||||||
// firstEntry : Option[String],
|
firstEntry : Option[String],
|
||||||
// firstTimeEvent_list : List[String],
|
firstTimeEvent_list : List[String],
|
||||||
// tutorial_list : List[String],
|
tutorial_list : List[String],
|
||||||
inventory : BitVector
|
inventory : BitVector
|
||||||
) extends ConstructorData
|
) extends ConstructorData
|
||||||
|
|
||||||
|
|
@ -149,37 +149,37 @@ object CharacterData extends Marshallable[CharacterData] {
|
||||||
("viewPitch" | uint8L) ::
|
("viewPitch" | uint8L) ::
|
||||||
("viewYaw" | uint8L) ::
|
("viewYaw" | uint8L) ::
|
||||||
ignore(10) ::
|
ignore(10) ::
|
||||||
("upperMerit" | uint16L) ::
|
("upperMerit" | uint32L) ::
|
||||||
("middleMerit" | uint16L) ::
|
("middleMerit" | uint32L) ::
|
||||||
("lowerMerit" | uint16L) ::
|
("lowerMerit" | uint32L) ::
|
||||||
("termOfServiceMerit" | uint16L) ::
|
("termOfServiceMerit" | uint32L) ::
|
||||||
// ignore(160) ::
|
ignore(160) ::
|
||||||
// ("healthMax" | uint16L) ::
|
("healthMax" | uint16L) ::
|
||||||
// ("health" | uint16L) ::
|
("health" | uint16L) ::
|
||||||
// ignore(1) ::
|
ignore(1) ::
|
||||||
// ("armor" | uint16L) ::
|
("armor" | uint16L) ::
|
||||||
// ignore(9) ::
|
ignore(9) ::
|
||||||
// ("unk4" | uint8L) ::
|
("unk4" | uint8L) ::
|
||||||
// ignore(8) ::
|
ignore(8) ::
|
||||||
// ("unk5" | uint4L) ::
|
("unk5" | uint4L) ::
|
||||||
// ("unk6" | uintL(3)) ::
|
("unk6" | uintL(3)) ::
|
||||||
// ("staminaMax" | uint16L) ::
|
("staminaMax" | uint16L) ::
|
||||||
// ("stamina" | uint16L) ::
|
("stamina" | uint16L) ::
|
||||||
// ignore(152) ::
|
ignore(149) ::
|
||||||
// ("unk7" | uint16L) ::
|
("unk7" | uint16L) ::
|
||||||
// ("unk8" | uint8L) ::
|
("unk8" | uint8L) ::
|
||||||
// ("unk9" | uint8L) ::
|
("unk9" | uint8L) ::
|
||||||
// ("unk10" | uint8L) ::
|
("unk10" | uint8L) ::
|
||||||
// ("unk11" | uint8L) ::
|
("unk11" | uint8L) ::
|
||||||
// ("unk12" | uintL(12)) ::
|
("unk12" | uintL(12)) ::
|
||||||
// ignore(3) ::
|
ignore(19) ::
|
||||||
// (("firstTimeEvent_length" | uint32L) >>:~ { len =>
|
(("firstTimeEvent_length" | uint32L) >>:~ { len =>
|
||||||
// conditional(len > 0, "firstEntry" | PacketHelpers.encodedStringAligned(5)) ::
|
conditional(len > 0, "firstEntry" | PacketHelpers.encodedStringAligned(5)) ::
|
||||||
// ("firstTimeEvent_list" | PacketHelpers.listOfNSized(len - 1, PacketHelpers.encodedString)) ::
|
("firstTimeEvent_list" | PacketHelpers.listOfNSized(len - 1, PacketHelpers.encodedString)) ::
|
||||||
// ("tutorial_list" | PacketHelpers.listOfNAligned(uint32L, 0, PacketHelpers.encodedString)) ::
|
("tutorial_list" | PacketHelpers.listOfNAligned(uint32L, 0, PacketHelpers.encodedString)) ::
|
||||||
// ignore(207) ::
|
ignore(207) ::
|
||||||
("inventory" | bits)
|
("inventory" | bits)
|
||||||
// })
|
})
|
||||||
).as[CharacterData]
|
).as[CharacterData]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -193,10 +193,31 @@ class GamePacketTest extends Specification {
|
||||||
char.unk3 mustEqual 2
|
char.unk3 mustEqual 2
|
||||||
char.viewPitch mustEqual 0xFF
|
char.viewPitch mustEqual 0xFF
|
||||||
char.viewYaw mustEqual 0x6A
|
char.viewYaw mustEqual 0x6A
|
||||||
char.upperMerit mustEqual 0xFFFF //none
|
char.upperMerit mustEqual 0xFFFFFFFFL //none
|
||||||
char.middleMerit mustEqual 0xFFFF //none
|
char.middleMerit mustEqual 0xFFFFFFFFL //none
|
||||||
char.lowerMerit mustEqual 0xFFFF //none
|
char.lowerMerit mustEqual 0xFFFFFFFFL //none
|
||||||
char.termOfServiceMerit mustEqual 0xFFFF //none
|
char.termOfServiceMerit mustEqual 0xFFFFFFFFL //none
|
||||||
|
char.healthMax mustEqual 100
|
||||||
|
char.health mustEqual 100
|
||||||
|
char.armor mustEqual 50 //standard exosuit value
|
||||||
|
char.unk4 mustEqual 1
|
||||||
|
char.unk5 mustEqual 7
|
||||||
|
char.unk6 mustEqual 7
|
||||||
|
char.staminaMax mustEqual 100
|
||||||
|
char.stamina mustEqual 100
|
||||||
|
char.unk7 mustEqual 28
|
||||||
|
char.unk8 mustEqual 4
|
||||||
|
char.unk9 mustEqual 44
|
||||||
|
char.unk10 mustEqual 84
|
||||||
|
char.unk11 mustEqual 104
|
||||||
|
char.unk12 mustEqual 1900
|
||||||
|
char.firstTimeEvent_length mustEqual 4
|
||||||
|
char.firstEntry mustEqual Some("xpe_sanctuary_help")
|
||||||
|
char.firstTimeEvent_list.size mustEqual 3
|
||||||
|
char.firstTimeEvent_list.head mustEqual "xpe_th_firemodes"
|
||||||
|
char.firstTimeEvent_list(1) mustEqual "used_beamer"
|
||||||
|
char.firstTimeEvent_list(2) mustEqual "map13"
|
||||||
|
char.tutorial_list.size mustEqual 0
|
||||||
case default =>
|
case default =>
|
||||||
ko
|
ko
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue