Global notice with /global command. Can now warn users when doing server restart.
--- 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