# HG changeset patch # User unc0rr # Date 1301846825 -14400 # Node ID cb9cf41a208cf51a102f28b321607d020cde1452 # Parent 53e9d9451328f01ab878772aa1718d4cf3dcc1f8 Allow to rename room diff -r 53e9d9451328 -r cb9cf41a208c gameServer/HWProtoInRoomState.hs --- a/gameServer/HWProtoInRoomState.hs Sun Apr 03 19:27:48 2011 +0400 +++ b/gameServer/HWProtoInRoomState.hs Sun Apr 03 20:07:05 2011 +0400 @@ -242,6 +242,20 @@ [ModifyRoom (\r -> r{isRestrictedTeams = not $ isRestrictedTeams r})] +handleCmd_inRoom ["ROOM_NAME", newName] = do + cl <- thisClient + rs <- allRoomInfos + + return $ + if not $ isMaster cl then + [ProtocolError "Not room master"] + else + if isJust $ find (\r -> newName == name r) rs then + [Warning "Room with such name already exists"] + else + [ModifyRoom (\r -> r{name = newName})] + + handleCmd_inRoom ["KICK", kickNick] = do (thisClientId, rnc) <- ask maybeClientId <- clientByNick kickNick