Show player's room status (plays/spectates)
authorunc0rr
Thu, 13 Aug 2009 12:45:24 +0000
changeset 2311 977ee15c3c1f
parent 2310 581e59f123a2
child 2312 3b59f1251ead
Show player's room status (plays/spectates)
gameServer/HWProtoCore.hs
--- a/gameServer/HWProtoCore.hs	Thu Aug 13 08:54:20 2009 +0000
+++ b/gameServer/HWProtoCore.hs	Thu Aug 13 12:45:24 2009 +0000
@@ -48,7 +48,7 @@
 			nick client,
 			"[" ++ host client ++ "]",
 			protoNumber2ver $ clientProto client,
-			"[" ++ roomInfo ++ "]"]]
+			"[" ++ roomInfo ++ "]" ++ roomStatus]]
 	where
 		maybeClient = find (\cl -> asknick == nick cl) clients
 		noSuchClient = isNothing maybeClient
@@ -57,6 +57,10 @@
 		roomInfo = if roomID client /= 0 then roomMasterSign ++ "room " ++ (name room) else adminSign ++ "lobby"
 		roomMasterSign = if isMaster client then "@" else ""
 		adminSign = if isAdministrator client then "@" else ""
+		roomStatus =
+			if gameinprogress room
+			then if teamsInGame client > 0 then "(plays)" else "(spectates)"
+			else ""
 
 
 handleCmd_loggedin clID clients rooms cmd =