Allow LIST command while in room to not annoy old frontends (0.9.17 or less) with warnings
authorunc0rr
Sun, 22 Apr 2012 21:23:32 +0400
changeset 6912 831416764d2d
parent 6911 1cda333286e0
child 6913 73984ea24ff5
Allow LIST command while in room to not annoy old frontends (0.9.17 or less) with warnings
gameServer/CoreTypes.hs
gameServer/HWProtoInRoomState.hs
gameServer/HWProtoLobbyState.hs
--- a/gameServer/CoreTypes.hs	Sun Apr 22 18:38:34 2012 +0200
+++ b/gameServer/CoreTypes.hs	Sun Apr 22 21:23:32 2012 +0400
@@ -192,6 +192,7 @@
 data Notice =
     NickAlreadyInUse
     | AdminLeft
+    | WrongPassword
     deriving Enum
 
 data ShutdownException =
--- a/gameServer/HWProtoInRoomState.hs	Sun Apr 22 18:38:34 2012 +0200
+++ b/gameServer/HWProtoInRoomState.hs	Sun Apr 22 21:23:32 2012 +0400
@@ -278,6 +278,8 @@
     where
         engineMsg cl = toEngineMsg $ B.concat ["b", nick cl, "(team): ", msg, "\x20\x20"]
 
+handleCmd_inRoom ["LIST"] = return [] -- for old clients (<= 0.9.17)
+
 handleCmd_inRoom (s:_) = return [ProtocolError $ "Incorrect command '" `B.append` s `B.append` "' (state: in room)"]
 
 handleCmd_inRoom [] = return [ProtocolError "Empty command (state: in room)"]
--- a/gameServer/HWProtoLobbyState.hs	Sun Apr 22 18:38:34 2012 +0200
+++ b/gameServer/HWProtoLobbyState.hs	Sun Apr 22 21:23:32 2012 +0400
@@ -76,7 +76,7 @@
             else if isRestrictedJoins jRoom then
             [Warning "Joining restricted"]
             else if roomPassword /= password jRoom then
-            [Warning "Wrong password"]
+            [NoticeMessage WrongPassword]
             else
             [
                 MoveToRoom jRI,