diff --git a/common/gamespy_message.go b/common/gamespy_message.go index c5355e1..d062b75 100644 --- a/common/gamespy_message.go +++ b/common/gamespy_message.go @@ -13,7 +13,7 @@ type GameSpyCommand struct { } var ( - InvalidGameSpyCommand = errors.New("invalid command received") + InvalidGameSpyCommand = errors.New("Invalid command received") ) func ParseGameSpyMessage(msg string) ([]GameSpyCommand, error) { diff --git a/gpsp/main.go b/gpsp/main.go index 76b495a..8772e3b 100644 --- a/gpsp/main.go +++ b/gpsp/main.go @@ -91,7 +91,8 @@ func handleRequest(conn net.Conn) { commands, err := common.ParseGameSpyMessage(string(buffer)) if err != nil { - panic(err) + logging.Error(moduleName, err) + return } for _, command := range commands { @@ -110,7 +111,8 @@ func handleRequest(conn net.Conn) { profileId, err := strconv.ParseUint(strProfileId, 10, 32) if err != nil { - panic(err) + logging.Error(moduleName, err) + return } if knownProfileId == 0 { @@ -158,7 +160,8 @@ func handleOthersList(moduleName string, profileId uint32, command common.GameSp numOpidsValue, err := strconv.Atoi(numopids) if err != nil { - panic(err) + logging.Error(moduleName, err) + return empty } opidsSplit := []string{} @@ -177,7 +180,8 @@ func handleOthersList(moduleName string, profileId uint32, command common.GameSp for _, strOtherId := range opidsSplit { otherId, err := strconv.ParseUint(strOtherId, 10, 32) if err != nil { - panic(err) + logging.Error(moduleName, err) + continue } // TODO: Perhaps this could be condensed into one database query