Check for CMD message a bit further down the control flow
authorunc0rr
Thu, 27 Aug 2015 22:03:57 +0300
changeset 11054 6e575b29881c
parent 11053 a009cc19a639
child 11055 c1c3f86af19e
Check for CMD message a bit further down the control flow
gameServer/HWProtoCore.hs
--- a/gameServer/HWProtoCore.hs	Thu Aug 27 14:47:38 2015 +0300
+++ b/gameServer/HWProtoCore.hs	Thu Aug 27 22:03:57 2015 +0300
@@ -50,7 +50,19 @@
         else
         return [ModifyClient (\c -> c{pingsQueue = pingsQueue c - 1})]
 
-handleCmd ["CMD", parameters] = uncurry h $ extractParameters parameters
+handleCmd cmd = do
+    (ci, irnc) <- ask
+    let cl = irnc `client` ci
+    if logonPassed cl then
+        if isChecker cl then
+            handleCmd_checker cmd
+            else
+            handleCmd_loggedin cmd
+        else
+        handleCmd_NotEntered cmd
+
+
+handleCmd_loggedin ["CMD", parameters] = uncurry h $ extractParameters parameters
     where
         h "DELEGATE" n | not $ B.null n = handleCmd ["DELEGATE", n]
         h "SAVEROOM" n | not $ B.null n = handleCmd ["SAVEROOM", n]
@@ -84,19 +96,6 @@
 
         extractParameters p = let (a, b) = B.break (== ' ') p in (upperCase a, B.dropWhile (== ' ') b)
 
-
-handleCmd cmd = do
-    (ci, irnc) <- ask
-    let cl = irnc `client` ci
-    if logonPassed cl then
-        if isChecker cl then
-            handleCmd_checker cmd
-            else
-            handleCmd_loggedin cmd
-        else
-        handleCmd_NotEntered cmd
-
-
 handleCmd_loggedin ["INFO", asknick] = do
     (_, rnc) <- ask
     maybeClientId <- clientByNick asknick