This commit is contained in:
Aphedox 2016-08-13 19:12:21 -05:00
parent f145fd49f2
commit e326f454e5
3 changed files with 25 additions and 4 deletions

View file

@ -796,6 +796,27 @@ class GamePacketTest extends Specification {
}
}
"SetEmpireMessage" should {
val string = hex"24 02 00 80"
"decode" in {
PacketCoding.DecodePacket(string).require match {
case SetEmpireMessage(building_guid, empire) =>
building_guid mustEqual PlanetSideGUID(2)
empire mustEqual PlanetSideEmpire.VS
case default =>
ko
}
}
"encode" in {
val msg = SetEmpireMessage(PlanetSideGUID(2), PlanetSideEmpire.VS)
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
pkt mustEqual string
}
}
"PingMsg" should {
val packet = hex"1a 00000000 b0360000"