gameServer/HWProtoInRoomState.hs
changeset 13812 1f15b0ee8e34
parent 13734 f4c8c6a174e8
child 13833 76a1d6275cd3
equal deleted inserted replaced
13811:54725a1d1db8 13812:1f15b0ee8e34
   365     thisRoomMasterId <- liftM masterID thisRoom
   365     thisRoomMasterId <- liftM masterID thisRoom
   366     let newAdminId = fromJust maybeClientId
   366     let newAdminId = fromJust maybeClientId
   367     let sameRoom = clientRoom rnc thisClientId == clientRoom rnc newAdminId
   367     let sameRoom = clientRoom rnc thisClientId == clientRoom rnc newAdminId
   368     return $
   368     return $
   369         if (not (master || serverAdmin)) then
   369         if (not (master || serverAdmin)) then
   370             [Warning $ loc "You not the room master or a server admin!"]
   370             [Warning $ loc "You're not the room master or a server admin!"]
   371         else if (isNothing maybeClientId) then
   371         else if (isNothing maybeClientId) then
   372             [Warning $ loc "Player is not online."]
   372             [Warning $ loc "Player is not online."]
   373         else if (Just newAdminId == thisRoomMasterId) then
   373         else if (Just newAdminId == thisRoomMasterId) then
   374             [Warning $ loc "You're already the room master."]
   374             [Warning $ loc "You're already the room master."]
   375         else if (not sameRoom) then
   375         else if (not sameRoom) then
   405     n <- clientNick
   405     n <- clientNick
   406     s <- roomClientsChans
   406     s <- roomClientsChans
   407     return [AnswerClients s ["CHAT", n, B.unwords $ "/rnd" : rs], Random s rs]
   407     return [AnswerClients s ["CHAT", n, B.unwords $ "/rnd" : rs], Random s rs]
   408 
   408 
   409 
   409 
   410 handleCmd_inRoom ["MAXTEAMS", n] = roomAdminOnly $ do
   410 handleCmd_inRoom ["MAXTEAMS", n] = do
   411     cl <- thisClient
   411     cl <- thisClient
   412     let m = readInt_ n
   412     let m = readInt_ n
   413     if m < 2 || m > cMaxTeams then
   413     if not $ isMaster cl then
       
   414         return [Warning $ loc "You're not the room master!"]
       
   415     else if m < 2 || m > cMaxTeams then
   414         return [AnswerClients [sendChan cl] ["CHAT", nickServer, loc "/maxteams: specify number from 2 to 8"]]
   416         return [AnswerClients [sendChan cl] ["CHAT", nickServer, loc "/maxteams: specify number from 2 to 8"]]
   415     else
   417     else
   416         return [ModifyRoom (\r -> r{teamsNumberLimit = m})]
   418         return [ModifyRoom (\r -> r{teamsNumberLimit = m})]
   417 
   419 
   418 handleCmd_inRoom ["FIX"] = serverAdminOnly $
   420 handleCmd_inRoom ["FIX"] = serverAdminOnly $