Allow messages containing word separators in server's additional console commands
authorunc0rr
Wed, 22 May 2013 00:12:15 +0400
changeset 9034 279168729cc3
parent 9033 b0ed8608303f
child 9035 e84d42a4311c
child 9036 1ae1b6017b27
Allow messages containing word separators in server's additional console commands
gameServer/HWProtoCore.hs
--- a/gameServer/HWProtoCore.hs	Tue May 21 23:54:28 2013 +0400
+++ b/gameServer/HWProtoCore.hs	Wed May 22 00:12:15 2013 +0400
@@ -43,12 +43,12 @@
     where
         h ["DELEGATE", n] = handleCmd ["DELEGATE", n]
         h ["STATS"] = handleCmd ["STATS"]
-        h ["PART", msg] = handleCmd ["PART", msg]
-        h ["QUIT", msg] = handleCmd ["QUIT", msg]
-        h ["GLOBAL", msg] = do
+        h ("PART":m:ms) = handleCmd ["PART", B.unwords $ m:ms]
+        h ("QUIT":m:ms) = handleCmd ["QUIT", B.unwords $ m:ms]
+        h ("GLOBAL":m:ms) = do
             rnc <- liftM snd ask
             let chans = map (sendChan . client rnc) $ allClients rnc
-            return [AnswerClients chans ["CHAT", "[global notice]", msg]]
+            return [AnswerClients chans ["CHAT", "[global notice]", B.unwords $ m:ms]]
         h c = return [Warning . B.concat . L.intersperse " " $ "Unknown cmd" : c]
 
 handleCmd cmd = do