mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-01-19 18:14:44 +00:00
* added initial AvatarImplantMessage packet * rebased AvatarImplantMessage and working test * converting implant types * changing format of Enum from axx_bxx to AxxBxx
31 lines
792 B
Scala
31 lines
792 B
Scala
// 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 AvatarImplantMessageTest extends Specification {
|
|
val string = hex"58 630C 68 80"
|
|
|
|
"decode" in {
|
|
PacketCoding.DecodePacket(string).require match {
|
|
case AvatarImplantMessage(player_guid, unk1, unk2, implant) =>
|
|
player_guid mustEqual PlanetSideGUID(3171)
|
|
unk1 mustEqual 3
|
|
unk2 mustEqual 1
|
|
implant mustEqual ImplantType.Targeting
|
|
case _ =>
|
|
ko
|
|
}
|
|
}
|
|
|
|
"encode" in {
|
|
val msg = AvatarImplantMessage(PlanetSideGUID(3171), 3, 1, ImplantType.Targeting)
|
|
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
|
|
|
|
pkt mustEqual string
|
|
}
|
|
}
|