gameServer/HWProtoLobbyState.hs
changeset 3435 4e4f88a7bdf2
parent 3425 ead2ed20dfd4
child 3500 af8390d807d6
--- a/gameServer/HWProtoLobbyState.hs	Thu May 06 15:26:14 2010 +0000
+++ b/gameServer/HWProtoLobbyState.hs	Thu May 06 17:39:08 2010 +0000
@@ -11,16 +11,18 @@
 import CoreTypes
 import Actions
 import Utils
+import HandlerUtils
 
-answerAllTeams protocol teams = concatMap toAnswer teams
+{-answerAllTeams protocol teams = concatMap toAnswer teams
     where
         toAnswer team =
             [AnswerThisClient $ teamToNet protocol team,
             AnswerThisClient ["TEAM_COLOR", teamname team, teamcolor team],
             AnswerThisClient ["HH_NUM", teamname team, show $ hhnum team]]
-
+-}
 handleCmd_lobby :: CmdHandler
 
+{-
 handleCmd_lobby clID clients rooms ["LIST"] =
     [AnswerThisClient ("ROOMS" : roomsInfoList)]
     where
@@ -45,13 +47,14 @@
                 head (Map.findWithDefault ["Default"] "SCHEME" (params room)),
                 head (Map.findWithDefault ["Default"] "AMMO" (params room))
                 ]
+-}
 
-handleCmd_lobby clID clients _ ["CHAT", msg] =
-    [AnswerOthersInRoom ["CHAT", clientNick, msg]]
-    where
-        clientNick = nick $ clients IntMap.! clID
+handleCmd_lobby ["CHAT", msg] = do
+    n <- clientNick
+    s <- roomOthersChans
+    return [AnswerClients s ["CHAT", n, msg]]
 
-
+{-
 handleCmd_lobby clID clients rooms ["CREATE_ROOM", newRoom, roomPassword]
     | haveSameRoom = [Warning "Room exists"]
     | illegalName newRoom = [Warning "Illegal room name"]
@@ -183,3 +186,4 @@
 
 
 handleCmd_lobby clID _ _ _ = [ProtocolError "Incorrect command (state: in lobby)"]
+-}