mirror of
https://github.com/psforever/PSF-LoginServer.git
synced 2026-03-23 22:29:10 +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
33
src/test/scala/game/SimDataChallengeRespTest.scala
Normal file
33
src/test/scala/game/SimDataChallengeRespTest.scala
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
// Copyright (c) 2020 PSForever
|
||||
package game
|
||||
|
||||
import org.specs2.mutable._
|
||||
import net.psforever.packet._
|
||||
import net.psforever.packet.game._
|
||||
import scodec.bits._
|
||||
|
||||
class SimDataChallengeRespTest extends Specification {
|
||||
val string = hex"97050067030000e9030000e1040000000100006502000005003b3388faa52df48fb27971e7c3a9d0c109d5b03f00"
|
||||
|
||||
"decode" in {
|
||||
PacketCoding.DecodePacket(string).require match {
|
||||
case SimDataChallengeResp(u1, u2, u3) =>
|
||||
u1 mustEqual List(871L, 1001L, 1249L, 256L, 613L)
|
||||
u2 mustEqual List(4203230011L, 2415144357L, 3882973618L, 3251677635L, 1068553481L)
|
||||
u3 mustEqual false
|
||||
case _ =>
|
||||
ko
|
||||
}
|
||||
}
|
||||
|
||||
"encode" in {
|
||||
val msg = SimDataChallengeResp(
|
||||
List(871L, 1001L, 1249L, 256L, 613L),
|
||||
List(4203230011L, 2415144357L, 3882973618L, 3251677635L, 1068553481L),
|
||||
false
|
||||
)
|
||||
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
|
||||
|
||||
pkt mustEqual string
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue