gameServer/HWProtoCore.hs
changeset 5030 42746c5d4a80
parent 4989 4771fed9272e
child 5060 7d0f6e5b1c1c
equal deleted inserted replaced
5028:3c43f00b0743 5030:42746c5d4a80
    48     let cl = rnc `client` fromJust maybeClientId
    48     let cl = rnc `client` fromJust maybeClientId
    49     let roomId = clientRoom rnc clientId
    49     let roomId = clientRoom rnc clientId
    50     let clRoom = room rnc roomId
    50     let clRoom = room rnc roomId
    51     let roomMasterSign = if isMaster cl then "@" else ""
    51     let roomMasterSign = if isMaster cl then "@" else ""
    52     let adminSign = if isAdministrator cl then "@" else ""
    52     let adminSign = if isAdministrator cl then "@" else ""
    53     let roomInfo = if roomId /= lobbyId then roomMasterSign `B.append` "room " `B.append` name clRoom else adminSign `B.append` "lobby"
    53     let roomInfo = if roomId /= lobbyId then B.concat [roomMasterSign, "room ", name clRoom] else adminSign `B.append` "lobby"
    54     let roomStatus = if gameinprogress clRoom then
    54     let roomStatus = if gameinprogress clRoom then
    55             if teamsInGame cl > 0 then "(playing)" else "(spectating)"
    55             if teamsInGame cl > 0 then "(playing)" else "(spectating)"
    56             else
    56             else
    57             ""
    57             ""
    58     if noSuchClient then
    58     if noSuchClient then
    59         return []
    59         return []
    60         else
    60         else
    61         answerClient [
    61         answerClient [
    62             "INFO",
    62             "INFO",
    63             nick cl,
    63             nick cl,
    64             "[" `B.append` host cl `B.append` "]",
    64             B.concat ["[", host cl, "]"],
    65             protoNumber2ver $ clientProto cl,
    65             protoNumber2ver $ clientProto cl,
    66             "[" `B.append` roomInfo `B.append` "]" `B.append` roomStatus
    66             B.concat ["[", roomInfo, "]", roomStatus]
    67             ]
    67             ]
    68 
    68 
    69 
    69 
    70 handleCmd_loggedin cmd = do
    70 handleCmd_loggedin cmd = do
    71     (ci, rnc) <- ask
    71     (ci, rnc) <- ask