mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-03-26 15:29:09 +00:00
Merge branch 'favorites'
This commit is contained in:
commit
ba5583e583
4 changed files with 130 additions and 2 deletions
|
|
@ -1081,6 +1081,52 @@ class GamePacketTest extends Specification {
|
|||
}
|
||||
}
|
||||
|
||||
"FavoritesMessage" should {
|
||||
val stringVehicles = hex"60 5C 84 02 20 5300 6B00 7900 6700 7500 6100 7200 6400"
|
||||
val stringInfantry = hex"60 2C 03 82 34 4100 6700 6900 6C00 6500 2000 2800 6200 6100 7300 6900 6300 2900 20"
|
||||
|
||||
"decode (for infantry)" in {
|
||||
PacketCoding.DecodePacket(stringInfantry).require match {
|
||||
case FavoritesMessage(list, player_guid, line, label, armor) =>
|
||||
list mustEqual 0
|
||||
player_guid mustEqual PlanetSideGUID(3760)
|
||||
line mustEqual 0
|
||||
label mustEqual "Agile (basic)"
|
||||
armor.isDefined mustEqual true
|
||||
armor.get mustEqual 1
|
||||
case default =>
|
||||
ko
|
||||
}
|
||||
}
|
||||
|
||||
"encode (for infantry)" in {
|
||||
val msg = FavoritesMessage(0, PlanetSideGUID(3760), 0, "Agile (basic)", Option(1))
|
||||
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
|
||||
|
||||
pkt mustEqual stringInfantry
|
||||
}
|
||||
|
||||
"decode (for vehicles)" in {
|
||||
PacketCoding.DecodePacket(stringVehicles).require match {
|
||||
case FavoritesMessage(list, player_guid, line, label, armor) =>
|
||||
list mustEqual 1
|
||||
player_guid mustEqual PlanetSideGUID(4210)
|
||||
line mustEqual 0
|
||||
label mustEqual "Skyguard"
|
||||
armor.isDefined mustEqual false
|
||||
case default =>
|
||||
ko
|
||||
}
|
||||
}
|
||||
|
||||
"encode (for vehicles)" in {
|
||||
val msg = FavoritesMessage(1, PlanetSideGUID(4210), 0, "Skyguard")
|
||||
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
|
||||
|
||||
pkt mustEqual stringVehicles
|
||||
}
|
||||
}
|
||||
|
||||
"WeaponJammedMessage" should {
|
||||
val string = hex"66 4C00"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue