~ubuntu-branches/ubuntu/trusty/hedgewars/trusty-proposed

« back to all changes in this revision

Viewing changes to gameServer/HWProtoLobbyState.hs

  • Committer: Package Import Robot
  • Author(s): Dmitry E. Oboukhov
  • Date: 2011-11-20 18:31:17 UTC
  • mfrom: (1.2.12)
  • Revision ID: package-import@ubuntu.com-20111120183117-pjhz1n2pvnmxa246
Tags: 0.9.17-1
* [Paul Wise]
 * Mention the homing bee in the package description (Closes: #577092)
 * Also install the hwengine desktop file (LP: #811770)
 * Depend on ttf-dejavu-core since it is smaller
 * Depend on ttf-wqy-zenhei instead of embedding a copy of it
* [Dmitry E. Oboukhov]
 * New upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
import Utils
13
13
import HandlerUtils
14
14
import RoomsAndClients
 
15
import EngineInteraction
15
16
 
16
17
 
17
18
answerAllTeams :: ClientInfo -> [TeamInfo] -> [Action]
34
35
    return [AnswerClients [sendChan cl] ("ROOMS" : roomsInfoList rooms)]
35
36
    where
36
37
        roomInfo irnc r = [
37
 
                showB $ gameinprogress r,
 
38
                showB $ isJust $ gameInfo r,
38
39
                name r,
39
40
                showB $ playersIn r,
40
41
                showB $ length $ teams r,
81
82
    let chans = map sendChan (cl : jRoomClients)
82
83
    return $
83
84
        if isNothing maybeRI || not sameProto then 
84
 
            [Warning "No such rooms"]
 
85
            [Warning "No such room"]
85
86
            else if isRestrictedJoins jRoom then
86
87
            [Warning "Joining restricted"]
87
88
            else if roomPassword /= password jRoom then
117
118
                 : ("SCHEME", pr Map.! "SCHEME")
118
119
                 : (filter (\(p, _) -> p /= "SCHEME") $ Map.toList pr)
119
120
 
120
 
        answerTeams cl jRoom = let f = if gameinprogress jRoom then teamsAtStart else teams in answerAllTeams cl $ f jRoom
 
121
        answerTeams cl jRoom = let f = if isJust $ gameInfo jRoom then teamsAtStart . fromJust . gameInfo else teams in answerAllTeams cl $ f jRoom
121
122
 
122
 
        watchRound cl jRoom = if not $ gameinprogress jRoom then
 
123
        watchRound cl jRoom = if isNothing $ gameInfo jRoom then
123
124
                    []
124
125
                else
125
126
                    [AnswerClients [sendChan cl]  ["RUN_GAME"],
126
 
                    AnswerClients [sendChan cl] $ "EM" : toEngineMsg "e$spectate 1" : Foldable.toList (roundMsgs jRoom)]
 
127
                    AnswerClients [sendChan cl] $ "EM" : toEngineMsg "e$spectate 1" : Foldable.toList (roundMsgs . fromJust . gameInfo $ jRoom)]
127
128
 
128
129
 
129
130
handleCmd_lobby ["JOIN_ROOM", roomName] =