# HG changeset patch # User Wuzzy # Date 1531878902 -7200 # Node ID da59012fbd7ae57947a7074f186ebe45162365c0 # Parent 7e188a28f078e31af15d6db94c9b00f2148c18e5 Add /help command for lobby and rooms too Server admin commands are still missing diff -r 7e188a28f078 -r da59012fbd7a gameServer/HWProtoCore.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 diff -r 7e188a28f078 -r da59012fbd7a gameServer/HWProtoInRoomState.hs --- 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 : Surrender room control to player"], + AnswerClients [sendChan cl] ["CHAT", "[server]", loc " /maxteams : 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 : Vote 'yes' or 'no' for active vote"], + AnswerClients [sendChan cl] ["CHAT", "[server]", loc " /info : Show info about player"], + AnswerClients [sendChan cl] ["CHAT", "[server]", loc " /me : 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 diff -r 7e188a28f078 -r da59012fbd7a gameServer/HWProtoLobbyState.hs --- 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 : Show info about player"], + AnswerClients [sendChan cl] ["CHAT", "[server]", loc " /me : 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 --