mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-03-12 00:20:31 +00:00
26 lines
550 B
Scala
26 lines
550 B
Scala
// Copyright (c) 2017 PSForever
|
|
package game
|
|
|
|
import org.specs2.mutable._
|
|
import net.psforever.packet._
|
|
import net.psforever.packet.game._
|
|
import scodec.bits._
|
|
|
|
class PingMsgTest extends Specification {
|
|
val packet = hex"1a 00000000 b0360000"
|
|
|
|
"decode" in {
|
|
PacketCoding.DecodePacket(packet).require match {
|
|
case PingMsg(unk1, unk2) =>
|
|
unk1 === 0
|
|
unk2 === 14000
|
|
case _ =>
|
|
ko
|
|
}
|
|
}
|
|
|
|
"encode" in {
|
|
val msg = PingMsg(0, 14000)
|
|
PacketCoding.EncodePacket(msg).require.toByteVector === packet
|
|
}
|
|
}
|