netserver/HWProto.hs
changeset 1338 758c39a3dcfe
parent 1336 4e88eccbe7f6
child 1344 4004e597f1bf
--- a/netserver/HWProto.hs	Thu Oct 09 17:15:04 2008 +0000
+++ b/netserver/HWProto.hs	Thu Oct 09 17:28:22 2008 +0000
@@ -48,6 +48,7 @@
 			(clientOnly, ["TEAM_COLOR", teamname team, teamcolor team]),
 			(clientOnly, ["HH_NUM", teamname team, show $ hhnum team])]
 answerMap mapName = [(othersInRoom, ["MAP", mapName])]
+answerRunGame = [(sameRoom, ["RUN_GAME"])]
 
 -- Main state-independent cmd handler
 handleCmd :: CmdHandler
@@ -211,4 +212,13 @@
 		findTeam = find (\t -> teamName == teamname t) $ teams clRoom
 		clRoom = roomByName (room client) rooms
 
+handleCmd_inRoom client _ _ ["READY"] =
+	if not $ isMaster client then
+		(noChangeClients, noChangeRooms, answerNotMaster)
+	else
+		(noChangeClients, noChangeRooms, answerRunGame)
+
+handleCmd_inRoom client _ _ ["GAMEMSG", msg] =
+	(noChangeClients, noChangeRooms, [(othersInRoom, ["GAMEMSG", msg])])
+
 handleCmd_inRoom _ _ _ _ = (noChangeClients, noChangeRooms, answerBadCmd)