fix(protbot,channelserver): fix sign protocol and entrance parsing, guard nil save data

The protbot sent "DSGN:\x00" as the sign request type, but the server
strips the last 3 characters as a version suffix. Send "DSGN:041"
(ZZ client mode 41) to match the real client format.

The entrance channel entry parser read 14 bytes for remaining fields
but the server writes 18 bytes (9 uint16, not 7), causing a panic
when parsing the server list.

The channel server panicked on disconnect when a session had no
decompressed save data (e.g. protbot or early client disconnect).
Guard Save() against nil decompSave.

Also fix docker-compose volume mount for Postgres 18 which changed
its data directory layout.
This commit is contained in:
Houmgaor
2026-02-20 14:17:40 +01:00
parent 0e84377e21
commit 486be65a38
4 changed files with 13 additions and 5 deletions

View File

@@ -27,10 +27,11 @@ func DoSign(addr, username, password string) (*SignResult, error) {
}
defer c.Close()
// Build DSGN request: "DSGN:\x00" + SJIS(user) + "\x00" + SJIS(pass) + "\x00" + "\x00"
// Build DSGN request: "DSGN:041" + \x00 + SJIS(user) + \x00 + SJIS(pass) + \x00 + \x00
// The server reads: null-terminated request type, null-terminated user, null-terminated pass, null-terminated unk.
// The request type has a 3-char version suffix (e.g. "041" for ZZ client mode 41) that the server strips.
bf := byteframe.NewByteFrame()
bf.WriteNullTerminatedBytes([]byte("DSGN:\x00")) // reqType (server strips last 3 chars to get "DSGN:")
bf.WriteNullTerminatedBytes([]byte("DSGN:041")) // reqType with version suffix (server strips last 3 chars to get "DSGN:")
bf.WriteNullTerminatedBytes(stringsupport.UTF8ToSJIS(username))
bf.WriteNullTerminatedBytes(stringsupport.UTF8ToSJIS(password))
bf.WriteUint8(0) // Unk null-terminated empty string