gameServer: Always report command name if getting an incorrect command
authorWuzzy <Wuzzy2@mail.ru>
Thu, 04 Oct 2018 14:36:42 +0200
changeset 13831 07b3dacd00f8
parent 13830 5d58fce48b1d
child 13832 28a86816dc01
gameServer: Always report command name if getting an incorrect command
gameServer/HWProtoLobbyState.hs
gameServer/HWProtoNEState.hs
--- a/gameServer/HWProtoLobbyState.hs	Thu Oct 04 14:18:38 2018 +0200
+++ b/gameServer/HWProtoLobbyState.hs	Thu Oct 04 14:36:42 2018 +0200
@@ -226,4 +226,4 @@
 handleCmd_lobby ["STATS"] = serverAdminOnly $
     return [Stats]
 
-handleCmd_lobby _ = return [ProtocolError "Incorrect command (state: in lobby)"]
+handleCmd_lobby (s:_) = return [ProtocolError $ "Incorrect command '" `B.append` s `B.append` "' (state: in lobby)"]
--- a/gameServer/HWProtoNEState.hs	Thu Oct 04 14:18:38 2018 +0200
+++ b/gameServer/HWProtoNEState.hs	Thu Oct 04 14:36:42 2018 +0200
@@ -101,4 +101,4 @@
         parsedProto = readInt_ protoNum
 #endif
 
-handleCmd_NotEntered _ = return [ProtocolError "Incorrect command (state: not entered)"]
+handleCmd_NotEntered (s:_) = return [ProtocolError $ "Incorrect command '" `B.append` s `B.append` "' (state: not entered)"]