# HG changeset patch
# User unc0rr
# Date 1361560873 -14400
# Node ID 6898be8aa2617a161b582003bc2699ba55098811
# Parent  1385ab7219d980851453a7b35f8347d88fddb3e8
Global notice with /global command. Can now warn users when doing server restart.

diff -r 1385ab7219d9 -r 6898be8aa261 gameServer/HWProtoCore.hs
--- a/gameServer/HWProtoCore.hs	Fri Feb 22 11:35:54 2013 +0400
+++ b/gameServer/HWProtoCore.hs	Fri Feb 22 23:21:13 2013 +0400
@@ -34,8 +34,8 @@
         else
         return [ModifyClient (\c -> c{pingsQueue = pingsQueue c - 1})]
 
-handleCmd ("CMD" : params) =
-    let c = concatMap B.words params in
+handleCmd ("CMD" : parameters) =
+    let c = concatMap B.words parameters in
         if not $ null c then
             h $ (upperCase . head $ c) : tail c
             else
@@ -45,6 +45,10 @@
         h ["STATS"] = handleCmd ["STATS"]
         h ["PART", msg] = handleCmd ["PART", msg]
         h ["QUIT", msg] = handleCmd ["QUIT", msg]
+        h ["GLOBAL", msg] = do
+            rnc <- liftM snd ask
+            let chans = map (sendChan . client rnc) $ allClients rnc
+            return [AnswerClients chans ["CHAT", "[global notice]", msg]]
         h c = return [Warning . B.concat . L.intersperse " " $ "Unknown cmd" : c]
 
 handleCmd cmd = do