gameServer/HWProtoInRoomState.hs
changeset 13514 9ba5e4594322
parent 13513 da59012fbd7a
child 13515 60bcc20e6ab0
--- a/gameServer/HWProtoInRoomState.hs	Wed Jul 18 03:55:02 2018 +0200
+++ b/gameServer/HWProtoInRoomState.hs	Wed Jul 18 15:35:54 2018 +0200
@@ -33,6 +33,7 @@
 import RoomsAndClients
 import EngineInteraction
 import Votes
+import CommandHelp
 
 startGame :: Reader (ClientIndex, IRnC) [Action]
 startGame = do
@@ -407,18 +408,10 @@
 
 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"] ]
+    if isAdministrator cl then
+        return (cmdHelpActionList [sendChan cl] cmdHelpRoomAdmin)
+    else
+        return (cmdHelpActionList [sendChan cl] cmdHelpRoomPlayer)
 
 handleCmd_inRoom ["GREETING", msg] = do
     cl <- thisClient