gameServer/HWProtoInRoomState.hs
changeset 8484 99c14f14f788
parent 8477 330b0b8846cf
child 8513 cd85ab23f38b
--- a/gameServer/HWProtoInRoomState.hs	Sat Feb 09 00:11:14 2013 +0400
+++ b/gameServer/HWProtoInRoomState.hs	Sun Feb 10 01:27:32 2013 +0400
@@ -216,13 +216,13 @@
     rm <- thisRoom
     chans <- roomOthersChans
 
-    if teamsInGame cl > 0 && (isJust $ gameInfo rm) && isLegal then
-        return $ AnswerClients chans ["EM", msg]
-            : [ModifyRoom (\r -> r{gameInfo = liftM (\g -> g{roundMsgs = msg : roundMsgs g}) $ gameInfo r}) | not isKeepAlive]
+    if teamsInGame cl > 0 && (isJust $ gameInfo rm) && (not $ B.null legalMsgs) then
+        return $ AnswerClients chans ["EM", legalMsgs]
+            : [ModifyRoom (\r -> r{gameInfo = liftM (\g -> g{roundMsgs = nonEmptyMsgs : roundMsgs g}) $ gameInfo r}) | not $ B.null nonEmptyMsgs]
         else
         return []
     where
-        (isLegal, isKeepAlive) = checkNetCmd msg
+        (legalMsgs, nonEmptyMsgs) = checkNetCmd msg
 
 
 handleCmd_inRoom ["ROUNDFINISHED", correctly] = do
@@ -273,6 +273,7 @@
         else
             [ModifyRoom (\r -> r{isRegisteredOnly = not $ isRegisteredOnly r})]
 
+
 handleCmd_inRoom ["ROOM_NAME", newName] = do
     cl <- thisClient
     rs <- allRoomInfos
@@ -324,6 +325,7 @@
     where
         engineMsg cl = toEngineMsg $ B.concat ["b", nick cl, "(team): ", msg, "\x20\x20"]
 
+
 handleCmd_inRoom ["BAN", banNick] = do
     (thisClientId, rnc) <- ask
     maybeClientId <- clientByNick banNick