Add /help command for lobby and rooms too
authorWuzzy <Wuzzy2@mail.ru>
Wed, 18 Jul 2018 03:55:02 +0200
changeset 13508 da59012fbd7a
parent 13507 7e188a28f078
child 13509 9ba5e4594322
Add /help command for lobby and rooms too Server admin commands are still missing
gameServer/HWProtoCore.hs
gameServer/HWProtoInRoomState.hs
gameServer/HWProtoLobbyState.hs
--- a/gameServer/HWProtoCore.hs	Wed Jul 18 02:05:05 2018 +0200
+++ b/gameServer/HWProtoCore.hs	Wed Jul 18 03:55:02 2018 +0200
@@ -90,6 +90,7 @@
         h "FORCE" msg | not $ B.null msg = handleCmd ["VOTE", upperCase msg, "FORCE"]
         h "MAXTEAMS" n | not $ B.null n = handleCmd ["MAXTEAMS", n]
         h "INFO" n | not $ B.null n = handleCmd ["INFO", n]
+        h "HELP" _ = handleCmd ["HELP"]
         h "RESTART_SERVER" "YES" = handleCmd ["RESTART_SERVER"]
         h "REGISTERED_ONLY" _ = serverAdminOnly $ do
             cl <- thisClient
--- a/gameServer/HWProtoInRoomState.hs	Wed Jul 18 02:05:05 2018 +0200
+++ b/gameServer/HWProtoInRoomState.hs	Wed Jul 18 03:55:02 2018 +0200
@@ -405,6 +405,21 @@
 handleCmd_inRoom ["UNFIX"] = serverAdminOnly $
     return [ModifyRoom (\r -> r{isSpecial = False})]
 
+handleCmd_inRoom ["HELP"] = do
+    cl <- thisClient
+    return [
+        AnswerClients [sendChan cl] ["CHAT", "[server]", loc "List of chat command for rooms:"],
+        AnswerClients [sendChan cl] ["CHAT", "[server]", loc " /greeting: Set greeting message to be shown to players who join the room"],
+        AnswerClients [sendChan cl] ["CHAT", "[server]", loc " /delegate <player>: Surrender room control to player"],
+        AnswerClients [sendChan cl] ["CHAT", "[server]", loc " /maxteams <N>: Limit maximum number of teams to N"],
+        AnswerClients [sendChan cl] ["CHAT", "[server]", loc " /callvote [arguments]: Start a vote"],
+        AnswerClients [sendChan cl] ["CHAT", "[server]", loc " /vote <yes/no>: Vote 'yes' or 'no' for active vote"],
+        AnswerClients [sendChan cl] ["CHAT", "[server]", loc " /info <player>: Show info about player"],
+        AnswerClients [sendChan cl] ["CHAT", "[server]", loc " /me <message>: Chat action, e.g. '/me eats piza' becomes '* Player eats pizza'"],
+        AnswerClients [sendChan cl] ["CHAT", "[server]", loc " /rnd: Flip a virtual coin and write 'heads' or 'tails' in chat"],
+        AnswerClients [sendChan cl] ["CHAT", "[server]", loc " /rnd [A] [B] [C] [...]: Randomly select a word and write it in chat"],
+        AnswerClients [sendChan cl] ["CHAT", "[server]", loc " /help: Show command help"] ]
+
 handleCmd_inRoom ["GREETING", msg] = do
     cl <- thisClient
     rm <- thisRoom
--- a/gameServer/HWProtoLobbyState.hs	Wed Jul 18 02:05:05 2018 +0200
+++ b/gameServer/HWProtoLobbyState.hs	Wed Jul 18 03:55:02 2018 +0200
@@ -166,6 +166,16 @@
     c <- liftM sendChan thisClient
     return [Random [c] rs]
 
+handleCmd_lobby ["HELP"] = do
+    cl <- thisClient
+    return [
+        AnswerClients [sendChan cl] ["CHAT", "[server]", loc "List of chat commands for lobby:" ],
+        AnswerClients [sendChan cl] ["CHAT", "[server]", loc " /info <player>: Show info about player"],
+        AnswerClients [sendChan cl] ["CHAT", "[server]", loc " /me <message>: Chat action, e.g. '/me eats piza' becomes '* Player eats pizza'"],
+        AnswerClients [sendChan cl] ["CHAT", "[server]", loc " /rnd: Flip a virtual coin and write 'heads' or 'tails' in chat"],
+        AnswerClients [sendChan cl] ["CHAT", "[server]", loc " /rnd [A] [B] [C] [...]: Randomly select a word and write it in chat"],
+        AnswerClients [sendChan cl] ["CHAT", "[server]", loc " /help: Show command help"] ]
+
     ---------------------------
     -- Administrator's stuff --