gameServer/HWProtoInRoomState.hs
changeset 13997 863604736cf5
parent 13996 4ae01eabf611
child 14122 d6915d15b6de
equal deleted inserted replaced
13996:4ae01eabf611 13997:863604736cf5
   511     if isJust $ gameInfo rm then
   511     if isJust $ gameInfo rm then
   512         startVote VotePause
   512         startVote VotePause
   513         else 
   513         else 
   514         return [AnswerClients [sendChan cl] ["CHAT", nickServer, loc "/callvote pause: No game in progress!"]]
   514         return [AnswerClients [sendChan cl] ["CHAT", nickServer, loc "/callvote pause: No game in progress!"]]
   515 
   515 
       
   516 handleCmd_inRoom ["CALLVOTE", "PAUSE", _] = handleCmd_inRoom ["CALLVOTE", "PAUSE"]
   516 
   517 
   517 handleCmd_inRoom ["CALLVOTE", "NEWSEED"] = do
   518 handleCmd_inRoom ["CALLVOTE", "NEWSEED"] = do
   518     startVote VoteNewSeed
   519     startVote VoteNewSeed
   519 
   520 
       
   521 handleCmd_inRoom ["CALLVOTE", "NEWSEED", _] = handleCmd_inRoom ["CALLVOTE", "NEWSEED"]
   520 
   522 
   521 handleCmd_inRoom ["CALLVOTE", "HEDGEHOGS"] = do
   523 handleCmd_inRoom ["CALLVOTE", "HEDGEHOGS"] = do
   522     cl <- thisClient
   524     cl <- thisClient
   523     return [AnswerClients [sendChan cl] ["CHAT", nickServer, loc "/callvote hedgehogs: Specify number from 1 to 8."]]
   525     return [AnswerClients [sendChan cl] ["CHAT", nickServer, loc "/callvote hedgehogs: Specify number from 1 to 8."]]
   524 
   526 
   530     if h > 0 && h <= cHogsPerTeam then
   532     if h > 0 && h <= cHogsPerTeam then
   531         startVote $ VoteHedgehogsPerTeam h
   533         startVote $ VoteHedgehogsPerTeam h
   532         else
   534         else
   533         return [AnswerClients [sendChan cl] ["CHAT", nickServer, loc "/callvote hedgehogs: Specify number from 1 to 8."]]
   535         return [AnswerClients [sendChan cl] ["CHAT", nickServer, loc "/callvote hedgehogs: Specify number from 1 to 8."]]
   534 
   536 
       
   537 handleCmd_inRoom ["CALLVOTE", _] = handleCmd_inRoom ["CALLVOTE"]
       
   538 handleCmd_inRoom ["CALLVOTE", _, _] = handleCmd_inRoom ["CALLVOTE"]
   535 
   539 
   536 handleCmd_inRoom ("VOTE" : m : p) = do
   540 handleCmd_inRoom ("VOTE" : m : p) = do
   537     cl <- thisClient
   541     cl <- thisClient
   538     let b = if m == "YES" then Just True else if m == "NO" then Just False else Nothing
   542     let b = if m == "YES" then Just True else if m == "NO" then Just False else Nothing
   539     if isJust b then
   543     if isJust b then