diff -r 302835d554d8 -r 2a09f7f786a0 gameServer/Actions.hs --- a/gameServer/Actions.hs Thu Mar 26 16:20:01 2009 +0000 +++ b/gameServer/Actions.hs Thu Mar 26 16:54:16 2009 +0000 @@ -29,8 +29,8 @@ | ByeClient String | KickClient Int -- clID | KickRoomClient Int -- clID + | BanClient String -- nick | RemoveClientTeams Int -- clID - | BanClient String -- nick | ModifyClient (ClientInfo -> ClientInfo) | ModifyRoom (RoomInfo -> RoomInfo) | AddRoom String String @@ -252,7 +252,7 @@ processAction (clID, serverInfo, clients, rooms) (CheckRegistered) = do - writeChan (dbQueries serverInfo) $ CheckAccount clID (nick client) + writeChan (dbQueries serverInfo) $ CheckAccount client return (clID, serverInfo, clients, rooms) where client = clients ! clID @@ -272,6 +272,9 @@ Guest -> do infoM "Clients" $ show clID ++ " is guest" processAction (clID, serverInfo, adjust (\cl -> cl{logonPassed = True}) clID clients, rooms) MoveToLobby + Admin -> do + infoM "Clients" $ show clID ++ " is admin" + foldM processAction (clID, serverInfo, adjust (\cl -> cl{logonPassed = True, isAdministrator = True}) clID clients, rooms) [MoveToLobby, AnswerThisClient ["ADMIN_ACCESS"]] processAction (clID, serverInfo, clients, rooms) (MoveToLobby) = do @@ -290,6 +293,9 @@ processAction (clID, serverInfo, clients, rooms) (KickClient kickID) = do liftM2 replaceID (return clID) (processAction (kickID, serverInfo, clients, rooms) $ ByeClient "Kicked") +processAction (clID, serverInfo, clients, rooms) (BanClient banNick) = do + return (clID, serverInfo, clients, rooms) + processAction (clID, serverInfo, clients, rooms) (KickRoomClient kickID) = do writeChan (sendChan $ clients ! kickID) ["KICKED"]