mirror of
https://github.com/psforever/PSF-LoginServer.git
synced 2026-03-25 15:19:13 +00:00
Restructure repository
* Move /common/src to /src * Move services to net.psforever package * Move /pslogin to /server
This commit is contained in:
parent
89a30ae6f6
commit
f4fd78fc5d
958 changed files with 527 additions and 725 deletions
49
src/test/scala/game/AvatarVehicleTimerMessageTest.scala
Normal file
49
src/test/scala/game/AvatarVehicleTimerMessageTest.scala
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
// Copyright (c) 2017 PSForever
|
||||
package game
|
||||
|
||||
import org.specs2.mutable._
|
||||
import net.psforever.packet._
|
||||
import net.psforever.packet.game._
|
||||
import net.psforever.types.PlanetSideGUID
|
||||
import scodec.bits._
|
||||
|
||||
class AvatarVehicleTimerMessageTest extends Specification {
|
||||
val string = hex"57bd16866d65646b69740500000000"
|
||||
val string2 = hex"57971b84667572794800000080"
|
||||
|
||||
"decode medkit" in {
|
||||
PacketCoding.DecodePacket(string).require match {
|
||||
case AvatarVehicleTimerMessage(player_guid, text, time, u1) =>
|
||||
player_guid mustEqual PlanetSideGUID(5821)
|
||||
text mustEqual "medkit"
|
||||
time mustEqual 5
|
||||
u1 mustEqual false
|
||||
case _ =>
|
||||
ko
|
||||
}
|
||||
}
|
||||
"decode fury" in {
|
||||
PacketCoding.DecodePacket(string2).require match {
|
||||
case AvatarVehicleTimerMessage(player_guid, text, time, u1) =>
|
||||
player_guid mustEqual PlanetSideGUID(7063)
|
||||
text mustEqual "fury"
|
||||
time mustEqual 72
|
||||
u1 mustEqual true
|
||||
case _ =>
|
||||
ko
|
||||
}
|
||||
}
|
||||
|
||||
"encode medkit" in {
|
||||
val msg = AvatarVehicleTimerMessage(PlanetSideGUID(5821), "medkit", 5, false)
|
||||
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
|
||||
|
||||
pkt mustEqual string
|
||||
}
|
||||
"encode fury" in {
|
||||
val msg = AvatarVehicleTimerMessage(PlanetSideGUID(7063), "fury", 72, true)
|
||||
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
|
||||
|
||||
pkt mustEqual string2
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue