gameServer/HWProtoCore.hs
changeset 2961 3e057dfa601f
parent 2867 9be6693c78cb
child 3435 4e4f88a7bdf2
equal deleted inserted replaced
2960:b467a681c5e0 2961:3e057dfa601f
    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 
       
    80 handleCmd_loggedin clID clients rooms cmd =
    66 handleCmd_loggedin clID clients rooms cmd =
    81     if roomID client == 0 then
    67     if roomID client == 0 then
    82         handleCmd_lobby clID clients rooms cmd
    68         handleCmd_lobby clID clients rooms cmd
    83     else
    69     else
    84         handleCmd_inRoom clID clients rooms cmd
    70         handleCmd_inRoom clID clients rooms cmd