mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-02-26 09:43:37 +00:00
Fix LoginMessage and ConnectToWorldReqMsg token
The decoding was wrong. ASCII was the wrong choice. We needed a cstring and to add padding instead of assuming a fixed size. Fixes and closes #2
This commit is contained in:
parent
f1fae83548
commit
5ed40e73b3
3 changed files with 6 additions and 4 deletions
|
|
@ -15,8 +15,9 @@ class GamePacketTest extends Specification {
|
|||
|
||||
"decode" in {
|
||||
PacketCoding.DecodePacket(string).require match {
|
||||
case ConnectToWorldRequestMessage(serverName, majorVersion, minorVersion, revision, buildDate, unk) =>
|
||||
case ConnectToWorldRequestMessage(serverName, token, majorVersion, minorVersion, revision, buildDate, unk) =>
|
||||
serverName mustEqual "gemini"
|
||||
token mustEqual ""
|
||||
majorVersion mustEqual 0
|
||||
minorVersion mustEqual 0
|
||||
revision mustEqual 0
|
||||
|
|
@ -28,7 +29,7 @@ class GamePacketTest extends Specification {
|
|||
}
|
||||
|
||||
"encode" in {
|
||||
val msg = ConnectToWorldRequestMessage("gemini", 0, 0, 0, "", 0)
|
||||
val msg = ConnectToWorldRequestMessage("gemini", "", 0, 0, 0, "", 0)
|
||||
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
|
||||
|
||||
pkt mustEqual string
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue