mirror of
https://github.com/psforever/PSF-LoginServer.git
synced 2026-02-21 15:43:40 +00:00
* Move /common/src to /src * Move services to net.psforever package * Move /pslogin to /server
30 lines
878 B
Scala
30 lines
878 B
Scala
// Copyright (c) 2017 PSForever
|
|
package game
|
|
|
|
import net.psforever.types.{MeritCommendation, PlanetSideGUID}
|
|
import org.specs2.mutable._
|
|
import net.psforever.packet._
|
|
import net.psforever.packet.game._
|
|
import scodec.bits._
|
|
|
|
class DisplayedAwardMessageTest extends Specification {
|
|
val string = hex"D1 9F06 A6010000 3 0"
|
|
|
|
"decode" in {
|
|
PacketCoding.DecodePacket(string).require match {
|
|
case DisplayedAwardMessage(player_guid, ribbon, bar) =>
|
|
player_guid mustEqual PlanetSideGUID(1695)
|
|
ribbon mustEqual MeritCommendation.TwoYearVS
|
|
bar mustEqual RibbonBarsSlot.TermOfService
|
|
case _ =>
|
|
ko
|
|
}
|
|
}
|
|
|
|
"encode" in {
|
|
val msg = DisplayedAwardMessage(PlanetSideGUID(1695), MeritCommendation.TwoYearVS, RibbonBarsSlot.TermOfService)
|
|
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
|
|
|
|
pkt mustEqual string
|
|
}
|
|
}
|