Merge pull request #97 from Fate-JH/generic-action-new

Packet: GenericActionMessage (new)
This commit is contained in:
Fate-JH 2017-03-02 07:57:10 -05:00 committed by GitHub
commit aa67cd63c0
3 changed files with 75 additions and 1 deletions

View file

@ -1471,6 +1471,26 @@ class GamePacketTest extends Specification {
}
}
"GenericActionMessage" should {
val string = hex"A7 94"
"decode" in {
PacketCoding.DecodePacket(string).require match {
case GenericActionMessage(action) =>
action mustEqual 37
case default =>
ko
}
}
"encode" in {
val msg = GenericActionMessage(37)
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
pkt mustEqual string
}
}
"ContinentalLockUpdateMessage" should {
val string = hex"A8 16 00 40"