gameServer/HWProtoCore.hs
changeset 2706 935b7d618cf0
parent 2318 f3407513dc42
child 2867 9be6693c78cb
equal deleted inserted replaced
2705:2b5625c4ec16 2706:935b7d618cf0
    61 			if gameinprogress room
    61 			if gameinprogress room
    62 			then if teamsInGame client > 0 then "(playing)" else "(spectating)"
    62 			then if teamsInGame client > 0 then "(playing)" else "(spectating)"
    63 			else ""
    63 			else ""
    64 
    64 
    65 
    65 
       
    66 handleCmd_loggedin clID clients rooms ["FOLLOW", asknick] =
       
    67 	if inLobby || noSuchClient then
       
    68 		[]
       
    69 	else
       
    70 		handleCmd_lobby clID clients rooms ["JOIN_ROOM", roomname]
       
    71 	where
       
    72 		maybeClient = find (\cl -> asknick == nick cl) clients
       
    73 		noSuchClient = isNothing maybeClient
       
    74 		client = fromJust maybeClient
       
    75 		room = rooms IntMap.! roomID client
       
    76 		roomname = (name room)
       
    77 		inLobby = roomname == ""
       
    78 
       
    79 
    66 handleCmd_loggedin clID clients rooms cmd =
    80 handleCmd_loggedin clID clients rooms cmd =
    67 	if roomID client == 0 then
    81 	if roomID client == 0 then
    68 		handleCmd_lobby clID clients rooms cmd
    82 		handleCmd_lobby clID clients rooms cmd
    69 	else
    83 	else
    70 		handleCmd_inRoom clID clients rooms cmd
    84 		handleCmd_inRoom clID clients rooms cmd