gameServer/RoomsAndClients.hs
changeset 3741 73246d25dfe1
parent 3656 c74a4a407146
child 3747 76a197793b62
--- a/gameServer/RoomsAndClients.hs	Sat Aug 14 02:10:27 2010 +0200
+++ b/gameServer/RoomsAndClients.hs	Mon Aug 16 18:43:32 2010 +0400
@@ -15,6 +15,7 @@
     moveClientToRoom,
     clientRoom,
     clientRoomM,
+    clientExists,
     client,
     room,
     client'sM,
@@ -139,6 +140,9 @@
 moveClientToRoom rnc ri ci = moveClientInRooms rnc lobbyId ri ci
 
 
+clientExists :: MRoomsAndClients r c -> ClientIndex -> IO Bool
+clientExists (MRoomsAndClients (_, clients)) (ClientIndex ci) = elemExists clients ci
+
 clientRoomM :: MRoomsAndClients r c -> ClientIndex -> IO RoomIndex
 clientRoomM (MRoomsAndClients (_, clients)) (ClientIndex ci) = liftM clientRoom' (clients `readElem` ci)