mirror of
https://github.com/WiiLink24/wfc-server.git
synced 2026-04-24 07:27:31 -05:00
common: Fix sanity check on parsing gs messages
This commit is contained in:
parent
326b5f7227
commit
0d60d91459
|
|
@ -17,7 +17,7 @@ var (
|
|||
)
|
||||
|
||||
func ParseGameSpyMessage(msg string) ([]GameSpyCommand, error) {
|
||||
if !strings.Contains(msg, `\\`) || !strings.Contains(msg, `\final\`) {
|
||||
if !strings.Contains(msg, `\final\`) {
|
||||
return nil, InvalidGameSpyCommand
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -95,6 +95,8 @@ func handleRequest(conn net.Conn) {
|
|||
}
|
||||
}
|
||||
|
||||
logging.Notice("GPCM", "Raw data:", string(buffer))
|
||||
|
||||
commands, err := common.ParseGameSpyMessage(string(buffer))
|
||||
if err != nil {
|
||||
logging.Notice("GPCM", "Error parsing message:", err.Error())
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user