mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-03-13 17:10:33 +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
28
src/test/scala/game/DataChallengeMessageRespTest.scala
Normal file
28
src/test/scala/game/DataChallengeMessageRespTest.scala
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright (c) 2020 PSForever
|
||||
package game
|
||||
|
||||
import org.specs2.mutable._
|
||||
import net.psforever.packet._
|
||||
import net.psforever.packet.game._
|
||||
import scodec.bits._
|
||||
|
||||
class DataChallengeMessageRespTest extends Specification {
|
||||
val string = hex"948673616d706c6501000000"
|
||||
|
||||
"decode" in {
|
||||
PacketCoding.DecodePacket(string).require match {
|
||||
case DataChallengeMessageResp(attribute, value) =>
|
||||
attribute mustEqual "sample"
|
||||
value mustEqual 1L
|
||||
case _ =>
|
||||
ko
|
||||
}
|
||||
}
|
||||
|
||||
"encode" in {
|
||||
val msg = DataChallengeMessageResp("sample", 1L)
|
||||
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
|
||||
|
||||
pkt mustEqual string
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue