gameServer/HWProtoCore.hs
changeset 2311 977ee15c3c1f
parent 2126 cb249fa8e3da
child 2318 f3407513dc42
equal deleted inserted replaced
2310:581e59f123a2 2311:977ee15c3c1f
    46 		[AnswerThisClient
    46 		[AnswerThisClient
    47 			["INFO",
    47 			["INFO",
    48 			nick client,
    48 			nick client,
    49 			"[" ++ host client ++ "]",
    49 			"[" ++ host client ++ "]",
    50 			protoNumber2ver $ clientProto client,
    50 			protoNumber2ver $ clientProto client,
    51 			"[" ++ roomInfo ++ "]"]]
    51 			"[" ++ roomInfo ++ "]" ++ roomStatus]]
    52 	where
    52 	where
    53 		maybeClient = find (\cl -> asknick == nick cl) clients
    53 		maybeClient = find (\cl -> asknick == nick cl) clients
    54 		noSuchClient = isNothing maybeClient
    54 		noSuchClient = isNothing maybeClient
    55 		client = fromJust maybeClient
    55 		client = fromJust maybeClient
    56 		room = rooms IntMap.! roomID client
    56 		room = rooms IntMap.! roomID client
    57 		roomInfo = if roomID client /= 0 then roomMasterSign ++ "room " ++ (name room) else adminSign ++ "lobby"
    57 		roomInfo = if roomID client /= 0 then roomMasterSign ++ "room " ++ (name room) else adminSign ++ "lobby"
    58 		roomMasterSign = if isMaster client then "@" else ""
    58 		roomMasterSign = if isMaster client then "@" else ""
    59 		adminSign = if isAdministrator client then "@" else ""
    59 		adminSign = if isAdministrator client then "@" else ""
       
    60 		roomStatus =
       
    61 			if gameinprogress room
       
    62 			then if teamsInGame client > 0 then "(plays)" else "(spectates)"
       
    63 			else ""
    60 
    64 
    61 
    65 
    62 handleCmd_loggedin clID clients rooms cmd =
    66 handleCmd_loggedin clID clients rooms cmd =
    63 	if roomID client == 0 then
    67 	if roomID client == 0 then
    64 		handleCmd_lobby clID clients rooms cmd
    68 		handleCmd_lobby clID clients rooms cmd