mirror of
https://github.com/psforever/PSF-LoginServer.git
synced 2026-03-26 15:49:14 +00:00
modified HandleGamePacket so that it should encode properly; modified CSA so that it attempt to detect packets that encode into ByteVectors that are 'too big' and will attempt to split them up separated the ControlPacket tests into invdividual files and wrote tests for RelatedA0, RelatedB0, and HandleGamePacket proof of concept MTU packet split in CSA; example in WSA @ character select modified session pipeline to accept n queued Actors rather than just two; special packet decoder in progress some effort separating useful sub-operations in encryption/decryption/encoding/decoding functions; introduced PacketCodingActor , devoted to encoding and decoding packets; simplified CSA so that it is devoted just to encrypting and decrypting
26 lines
595 B
Scala
26 lines
595 B
Scala
// Copyright (c) 2017 PSForever
|
|
package control
|
|
|
|
import org.specs2.mutable._
|
|
import net.psforever.packet._
|
|
import net.psforever.packet.control._
|
|
import scodec.bits._
|
|
|
|
class TeardownConnectionTest extends Specification {
|
|
val string = hex"00 05 02 4F 57 17 00 06"
|
|
|
|
"decode" in {
|
|
PacketCoding.DecodePacket(string).require match {
|
|
case TeardownConnection(nonce) =>
|
|
nonce mustEqual 391597826
|
|
case _ =>
|
|
ko
|
|
}
|
|
}
|
|
|
|
"encode" in {
|
|
val encoded = PacketCoding.EncodePacket(TeardownConnection(391597826)).require
|
|
|
|
encoded.toByteVector mustEqual string
|
|
}
|
|
}
|