mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-03-15 18:10:35 +00:00
Split Up GamePacketTest (#102)
* split up GamePacketTest into separate testing files * PR wants this file?
This commit is contained in:
parent
b00748727e
commit
6001446cd5
68 changed files with 4061 additions and 3597 deletions
|
|
@ -0,0 +1,30 @@
|
|||
// Copyright (c) 2016 PSForever.net to present
|
||||
package game
|
||||
|
||||
import org.specs2.mutable._
|
||||
import net.psforever.packet._
|
||||
import net.psforever.packet.game._
|
||||
import scodec.bits._
|
||||
|
||||
class AvatarFirstTimeEventMessageTest extends Specification {
|
||||
val string = hex"69 4b00 c000 01000000 9e 766973697465645f63657274696669636174696f6e5f7465726d696e616c"
|
||||
|
||||
"decode" in {
|
||||
PacketCoding.DecodePacket(string).require match {
|
||||
case AvatarFirstTimeEventMessage(avatar_guid, object_guid, unk1, event_name) =>
|
||||
avatar_guid mustEqual PlanetSideGUID(75)
|
||||
object_guid mustEqual PlanetSideGUID(192)
|
||||
unk1 mustEqual 1
|
||||
event_name mustEqual "visited_certification_terminal"
|
||||
case _ =>
|
||||
ko
|
||||
}
|
||||
}
|
||||
|
||||
"encode" in {
|
||||
val msg = AvatarFirstTimeEventMessage(PlanetSideGUID(75), PlanetSideGUID(192), 1, "visited_certification_terminal")
|
||||
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
|
||||
|
||||
pkt mustEqual string
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue