author | unc0rr |
Fri, 16 Sep 2011 19:55:11 +0400 | |
changeset 5931 | 184057074257 |
parent 5573 | cc409ee3ad2e |
child 5996 | 2c72fe81dd37 |
permissions | -rw-r--r-- |
4295
1f5604cd99be
This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents:
4242
diff
changeset
|
1 |
{-# LANGUAGE OverloadedStrings #-} |
1804 | 2 |
module HWProtoLobbyState where |
3 |
||
4 |
import qualified Data.Map as Map |
|
1813 | 5 |
import qualified Data.Foldable as Foldable |
4295
1f5604cd99be
This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents:
4242
diff
changeset
|
6 |
import Data.Maybe |
1804 | 7 |
import Data.List |
4295
1f5604cd99be
This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents:
4242
diff
changeset
|
8 |
import Control.Monad.Reader |
1804 | 9 |
-------------------------------------- |
10 |
import CoreTypes |
|
11 |
import Actions |
|
12 |
import Utils |
|
4295
1f5604cd99be
This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents:
4242
diff
changeset
|
13 |
import HandlerUtils |
1f5604cd99be
This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents:
4242
diff
changeset
|
14 |
import RoomsAndClients |
1804 | 15 |
|
4932 | 16 |
|
4989 | 17 |
answerAllTeams :: ClientInfo -> [TeamInfo] -> [Action] |
4591 | 18 |
answerAllTeams cl = concatMap toAnswer |
2867
9be6693c78cb
- Unbreak support for client versions prior to 0.9.13-dev
unc0rr
parents:
2408
diff
changeset
|
19 |
where |
4591 | 20 |
clChan = sendChan cl |
2867
9be6693c78cb
- Unbreak support for client versions prior to 0.9.13-dev
unc0rr
parents:
2408
diff
changeset
|
21 |
toAnswer team = |
4591 | 22 |
[AnswerClients [clChan] $ teamToNet team, |
23 |
AnswerClients [clChan] ["TEAM_COLOR", teamname team, teamcolor team], |
|
5030
42746c5d4a80
Changed the standard show function to Text.Show.ByteString, and misc.
EJ <eivind.jahren@gmail.com>
parents:
4989
diff
changeset
|
24 |
AnswerClients [clChan] ["HH_NUM", teamname team, showB $ hhnum team]] |
4568 | 25 |
|
4989 | 26 |
handleCmd_lobby :: CmdHandler |
1804 | 27 |
|
4295
1f5604cd99be
This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents:
4242
diff
changeset
|
28 |
|
1f5604cd99be
This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents:
4242
diff
changeset
|
29 |
handleCmd_lobby ["LIST"] = do |
1f5604cd99be
This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents:
4242
diff
changeset
|
30 |
(ci, irnc) <- ask |
1f5604cd99be
This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents:
4242
diff
changeset
|
31 |
let cl = irnc `client` ci |
1f5604cd99be
This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents:
4242
diff
changeset
|
32 |
rooms <- allRoomInfos |
1f5604cd99be
This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents:
4242
diff
changeset
|
33 |
let roomsInfoList = concatMap (roomInfo irnc) . filter (\r -> (roomProto r == clientProto cl) && not (isRestrictedJoins r)) |
1f5604cd99be
This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents:
4242
diff
changeset
|
34 |
return [AnswerClients [sendChan cl] ("ROOMS" : roomsInfoList rooms)] |
2867
9be6693c78cb
- Unbreak support for client versions prior to 0.9.13-dev
unc0rr
parents:
2408
diff
changeset
|
35 |
where |
4932 | 36 |
roomInfo irnc r = [ |
37 |
showB $ gameinprogress r, |
|
38 |
name r, |
|
39 |
showB $ playersIn r, |
|
40 |
showB $ length $ teams r, |
|
41 |
nick $ irnc `client` masterID r, |
|
4942
1c85a8e6e11c
Okay, a compatibility layer for clients of 0.9.15 version (not sure about old versions, as I removed all compatibility hacks for older versions previously)
unc0rr
parents:
4941
diff
changeset
|
42 |
Map.findWithDefault "+rnd+" "MAP" (mapParams r), |
4932 | 43 |
head (Map.findWithDefault ["Default"] "SCHEME" (params r)), |
4941 | 44 |
head (Map.findWithDefault ["Default"] "AMMO" (params r)) |
2867
9be6693c78cb
- Unbreak support for client versions prior to 0.9.13-dev
unc0rr
parents:
2408
diff
changeset
|
45 |
] |
3501 | 46 |
|
4295
1f5604cd99be
This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents:
4242
diff
changeset
|
47 |
|
1f5604cd99be
This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents:
4242
diff
changeset
|
48 |
handleCmd_lobby ["CHAT", msg] = do |
1f5604cd99be
This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents:
4242
diff
changeset
|
49 |
n <- clientNick |
1f5604cd99be
This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents:
4242
diff
changeset
|
50 |
s <- roomOthersChans |
1f5604cd99be
This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents:
4242
diff
changeset
|
51 |
return [AnswerClients s ["CHAT", n, msg]] |
1f5604cd99be
This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents:
4242
diff
changeset
|
52 |
|
4932 | 53 |
handleCmd_lobby ["CREATE_ROOM", rName, roomPassword] |
54 |
| illegalName rName = return [Warning "Illegal room name"] |
|
4295
1f5604cd99be
This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents:
4242
diff
changeset
|
55 |
| otherwise = do |
1f5604cd99be
This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents:
4242
diff
changeset
|
56 |
rs <- allRoomInfos |
1f5604cd99be
This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents:
4242
diff
changeset
|
57 |
cl <- thisClient |
4932 | 58 |
return $ if isJust $ find (\r -> rName == name r) rs then |
4295
1f5604cd99be
This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents:
4242
diff
changeset
|
59 |
[Warning "Room exists"] |
1f5604cd99be
This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents:
4242
diff
changeset
|
60 |
else |
1f5604cd99be
This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents:
4242
diff
changeset
|
61 |
[ |
4932 | 62 |
AddRoom rName roomPassword, |
4917
8ff92bdc9f98
Convert READY and NOT_READY messages to CLIENT_FLAGS message
unc0rr
parents:
4914
diff
changeset
|
63 |
AnswerClients [sendChan cl] ["CLIENT_FLAGS", "-r", nick cl] |
4295
1f5604cd99be
This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents:
4242
diff
changeset
|
64 |
] |
1804 | 65 |
|
3536 | 66 |
|
4932 | 67 |
handleCmd_lobby ["CREATE_ROOM", rName] = |
68 |
handleCmd_lobby ["CREATE_ROOM", rName, ""] |
|
3536 | 69 |
|
1862 | 70 |
|
4295
1f5604cd99be
This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents:
4242
diff
changeset
|
71 |
handleCmd_lobby ["JOIN_ROOM", roomName, roomPassword] = do |
4932 | 72 |
(_, irnc) <- ask |
4295
1f5604cd99be
This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents:
4242
diff
changeset
|
73 |
let ris = allRooms irnc |
1f5604cd99be
This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents:
4242
diff
changeset
|
74 |
cl <- thisClient |
1f5604cd99be
This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents:
4242
diff
changeset
|
75 |
let maybeRI = find (\ri -> roomName == name (irnc `room` ri)) ris |
1f5604cd99be
This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents:
4242
diff
changeset
|
76 |
let jRI = fromJust maybeRI |
1f5604cd99be
This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents:
4242
diff
changeset
|
77 |
let jRoom = irnc `room` jRI |
5931 | 78 |
let sameProto = clientProto cl == roomProto jRoom |
4597
31e042ab870c
Finally a solution for excess lazyness when working with unsafeThaw'ed arrays
unc0rr
parents:
4595
diff
changeset
|
79 |
let jRoomClients = map (client irnc) $ roomClients irnc jRI |
31e042ab870c
Finally a solution for excess lazyness when working with unsafeThaw'ed arrays
unc0rr
parents:
4595
diff
changeset
|
80 |
let nicks = map nick jRoomClients |
31e042ab870c
Finally a solution for excess lazyness when working with unsafeThaw'ed arrays
unc0rr
parents:
4595
diff
changeset
|
81 |
let chans = map sendChan (cl : jRoomClients) |
4295
1f5604cd99be
This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents:
4242
diff
changeset
|
82 |
return $ |
5931 | 83 |
if isNothing maybeRI || not sameProto then |
4295
1f5604cd99be
This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents:
4242
diff
changeset
|
84 |
[Warning "No such rooms"] |
1f5604cd99be
This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents:
4242
diff
changeset
|
85 |
else if isRestrictedJoins jRoom then |
1f5604cd99be
This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents:
4242
diff
changeset
|
86 |
[Warning "Joining restricted"] |
1f5604cd99be
This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents:
4242
diff
changeset
|
87 |
else if roomPassword /= password jRoom then |
1f5604cd99be
This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents:
4242
diff
changeset
|
88 |
[Warning "Wrong password"] |
1f5604cd99be
This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents:
4242
diff
changeset
|
89 |
else |
1f5604cd99be
This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents:
4242
diff
changeset
|
90 |
[ |
1f5604cd99be
This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents:
4242
diff
changeset
|
91 |
MoveToRoom jRI, |
4597
31e042ab870c
Finally a solution for excess lazyness when working with unsafeThaw'ed arrays
unc0rr
parents:
4595
diff
changeset
|
92 |
AnswerClients [sendChan cl] $ "JOINED" : nicks, |
4917
8ff92bdc9f98
Convert READY and NOT_READY messages to CLIENT_FLAGS message
unc0rr
parents:
4914
diff
changeset
|
93 |
AnswerClients chans ["CLIENT_FLAGS", "-r", nick cl] |
4295
1f5604cd99be
This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents:
4242
diff
changeset
|
94 |
] |
4932 | 95 |
++ map (readynessMessage cl) jRoomClients |
4941 | 96 |
++ answerFullConfig cl (mapParams jRoom) (params jRoom) |
4932 | 97 |
++ answerTeams cl jRoom |
98 |
++ watchRound cl jRoom |
|
1804 | 99 |
|
4587 | 100 |
where |
4942
1c85a8e6e11c
Okay, a compatibility layer for clients of 0.9.15 version (not sure about old versions, as I removed all compatibility hacks for older versions previously)
unc0rr
parents:
4941
diff
changeset
|
101 |
readynessMessage cl c = AnswerClients [sendChan cl] $ |
1c85a8e6e11c
Okay, a compatibility layer for clients of 0.9.15 version (not sure about old versions, as I removed all compatibility hacks for older versions previously)
unc0rr
parents:
4941
diff
changeset
|
102 |
if clientProto cl < 38 then |
1c85a8e6e11c
Okay, a compatibility layer for clients of 0.9.15 version (not sure about old versions, as I removed all compatibility hacks for older versions previously)
unc0rr
parents:
4941
diff
changeset
|
103 |
[if isReady c then "READY" else "NOT_READY", nick c] |
1c85a8e6e11c
Okay, a compatibility layer for clients of 0.9.15 version (not sure about old versions, as I removed all compatibility hacks for older versions previously)
unc0rr
parents:
4941
diff
changeset
|
104 |
else |
1c85a8e6e11c
Okay, a compatibility layer for clients of 0.9.15 version (not sure about old versions, as I removed all compatibility hacks for older versions previously)
unc0rr
parents:
4941
diff
changeset
|
105 |
["CLIENT_FLAGS", if isReady c then "+r" else "-r", nick c] |
3536 | 106 |
|
4587 | 107 |
toAnswer cl (paramName, paramStrs) = AnswerClients [sendChan cl] $ "CFG" : paramName : paramStrs |
1813 | 108 |
|
4942
1c85a8e6e11c
Okay, a compatibility layer for clients of 0.9.15 version (not sure about old versions, as I removed all compatibility hacks for older versions previously)
unc0rr
parents:
4941
diff
changeset
|
109 |
answerFullConfig cl mpr pr |
1c85a8e6e11c
Okay, a compatibility layer for clients of 0.9.15 version (not sure about old versions, as I removed all compatibility hacks for older versions previously)
unc0rr
parents:
4941
diff
changeset
|
110 |
| clientProto cl < 38 = map (toAnswer cl) $ |
4984 | 111 |
(reverse . map (\(a, b) -> (a, [b])) $ Map.toList mpr) |
4942
1c85a8e6e11c
Okay, a compatibility layer for clients of 0.9.15 version (not sure about old versions, as I removed all compatibility hacks for older versions previously)
unc0rr
parents:
4941
diff
changeset
|
112 |
++ (("SCHEME", pr Map.! "SCHEME") |
4984 | 113 |
: (filter (\(p, _) -> p /= "SCHEME") $ Map.toList pr)) |
4942
1c85a8e6e11c
Okay, a compatibility layer for clients of 0.9.15 version (not sure about old versions, as I removed all compatibility hacks for older versions previously)
unc0rr
parents:
4941
diff
changeset
|
114 |
|
1c85a8e6e11c
Okay, a compatibility layer for clients of 0.9.15 version (not sure about old versions, as I removed all compatibility hacks for older versions previously)
unc0rr
parents:
4941
diff
changeset
|
115 |
| otherwise = map (toAnswer cl) $ |
4941 | 116 |
("FULLMAPCONFIG", Map.elems mpr) |
4936
d65d438acd23
Merge MAP, MAPGEN and SEED params into one on room join, so engine isn't spawned three times for a preview. Not tested as I'm unable to see my rooms (why?)
unc0rr
parents:
4932
diff
changeset
|
117 |
: ("SCHEME", pr Map.! "SCHEME") |
4941 | 118 |
: (filter (\(p, _) -> p /= "SCHEME") $ Map.toList pr) |
4587 | 119 |
|
4591 | 120 |
answerTeams cl jRoom = let f = if gameinprogress jRoom then teamsAtStart else teams in answerAllTeams cl $ f jRoom |
121 |
||
4595 | 122 |
watchRound cl jRoom = if not $ gameinprogress jRoom then |
2867
9be6693c78cb
- Unbreak support for client versions prior to 0.9.13-dev
unc0rr
parents:
2408
diff
changeset
|
123 |
[] |
9be6693c78cb
- Unbreak support for client versions prior to 0.9.13-dev
unc0rr
parents:
2408
diff
changeset
|
124 |
else |
4595 | 125 |
[AnswerClients [sendChan cl] ["RUN_GAME"], |
126 |
AnswerClients [sendChan cl] $ "EM" : toEngineMsg "e$spectate 1" : Foldable.toList (roundMsgs jRoom)] |
|
1813 | 127 |
|
3536 | 128 |
|
4295
1f5604cd99be
This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents:
4242
diff
changeset
|
129 |
handleCmd_lobby ["JOIN_ROOM", roomName] = |
1f5604cd99be
This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents:
4242
diff
changeset
|
130 |
handleCmd_lobby ["JOIN_ROOM", roomName, ""] |
4568 | 131 |
|
1804 | 132 |
|
4616 | 133 |
handleCmd_lobby ["FOLLOW", asknick] = do |
134 |
(_, rnc) <- ask |
|
135 |
ci <- clientByNick asknick |
|
5573
cc409ee3ad2e
Don't allow to join other protocol room using FOLLOW command (not tested)
unc0rr
parents:
5426
diff
changeset
|
136 |
cl <- thisClient |
4616 | 137 |
let ri = clientRoom rnc $ fromJust ci |
138 |
let clRoom = room rnc ri |
|
5931 | 139 |
if isNothing ci || ri == lobbyId then |
4616 | 140 |
return [] |
141 |
else |
|
142 |
handleCmd_lobby ["JOIN_ROOM", name clRoom] |
|
1862 | 143 |
|
2867
9be6693c78cb
- Unbreak support for client versions prior to 0.9.13-dev
unc0rr
parents:
2408
diff
changeset
|
144 |
--------------------------- |
9be6693c78cb
- Unbreak support for client versions prior to 0.9.13-dev
unc0rr
parents:
2408
diff
changeset
|
145 |
-- Administrator's stuff -- |
1862 | 146 |
|
4618 | 147 |
handleCmd_lobby ["KICK", kickNick] = do |
148 |
(ci, _) <- ask |
|
149 |
cl <- thisClient |
|
150 |
kickId <- clientByNick kickNick |
|
151 |
return [KickClient $ fromJust kickId | isAdministrator cl && isJust kickId && fromJust kickId /= ci] |
|
1866 | 152 |
|
4909 | 153 |
|
154 |
handleCmd_lobby ["BAN", banNick, reason] = do |
|
155 |
(ci, _) <- ask |
|
156 |
cl <- thisClient |
|
157 |
banId <- clientByNick banNick |
|
158 |
return [BanClient 60 reason (fromJust banId) | isAdministrator cl && isJust banId && fromJust banId /= ci] |
|
5426
109e9b5761c2
Implement command for banning by ip and a command for bans list
unc0rr
parents:
5209
diff
changeset
|
159 |
|
109e9b5761c2
Implement command for banning by ip and a command for bans list
unc0rr
parents:
5209
diff
changeset
|
160 |
handleCmd_lobby ["BANIP", ip, reason, duration] = do |
109e9b5761c2
Implement command for banning by ip and a command for bans list
unc0rr
parents:
5209
diff
changeset
|
161 |
(ci, _) <- ask |
109e9b5761c2
Implement command for banning by ip and a command for bans list
unc0rr
parents:
5209
diff
changeset
|
162 |
cl <- thisClient |
109e9b5761c2
Implement command for banning by ip and a command for bans list
unc0rr
parents:
5209
diff
changeset
|
163 |
return [BanIP ip (readInt_ duration) reason | isAdministrator cl] |
109e9b5761c2
Implement command for banning by ip and a command for bans list
unc0rr
parents:
5209
diff
changeset
|
164 |
|
109e9b5761c2
Implement command for banning by ip and a command for bans list
unc0rr
parents:
5209
diff
changeset
|
165 |
handleCmd_lobby ["BANLIST"] = do |
109e9b5761c2
Implement command for banning by ip and a command for bans list
unc0rr
parents:
5209
diff
changeset
|
166 |
(ci, _) <- ask |
109e9b5761c2
Implement command for banning by ip and a command for bans list
unc0rr
parents:
5209
diff
changeset
|
167 |
cl <- thisClient |
109e9b5761c2
Implement command for banning by ip and a command for bans list
unc0rr
parents:
5209
diff
changeset
|
168 |
return [BanList | isAdministrator cl] |
1804 | 169 |
|
3283 | 170 |
|
4620 | 171 |
handleCmd_lobby ["SET_SERVER_VAR", "MOTD_NEW", newMessage] = do |
172 |
cl <- thisClient |
|
173 |
return [ModifyServerInfo (\si -> si{serverMessage = newMessage}) | isAdministrator cl] |
|
1925 | 174 |
|
4620 | 175 |
handleCmd_lobby ["SET_SERVER_VAR", "MOTD_OLD", newMessage] = do |
176 |
cl <- thisClient |
|
177 |
return [ModifyServerInfo (\si -> si{serverMessageForOldVersions = newMessage}) | isAdministrator cl] |
|
3260
b44b88908758
Allow to set motd for old client versions (not used yet, as server needs some refactoring)
unc0rr
parents:
2961
diff
changeset
|
178 |
|
4620 | 179 |
handleCmd_lobby ["SET_SERVER_VAR", "LATEST_PROTO", protoNum] = do |
180 |
cl <- thisClient |
|
181 |
return [ModifyServerInfo (\si -> si{latestReleaseVersion = readNum}) | isAdministrator cl && readNum > 0] |
|
3260
b44b88908758
Allow to set motd for old client versions (not used yet, as server needs some refactoring)
unc0rr
parents:
2961
diff
changeset
|
182 |
where |
5030
42746c5d4a80
Changed the standard show function to Text.Show.ByteString, and misc.
EJ <eivind.jahren@gmail.com>
parents:
4989
diff
changeset
|
183 |
readNum = readInt_ protoNum |
42746c5d4a80
Changed the standard show function to Text.Show.ByteString, and misc.
EJ <eivind.jahren@gmail.com>
parents:
4989
diff
changeset
|
184 |
|
4620 | 185 |
handleCmd_lobby ["GET_SERVER_VAR"] = do |
186 |
cl <- thisClient |
|
187 |
return [SendServerVars | isAdministrator cl] |
|
3283 | 188 |
|
4620 | 189 |
handleCmd_lobby ["CLEAR_ACCOUNTS_CACHE"] = do |
190 |
cl <- thisClient |
|
191 |
return [ClearAccountsCache | isAdministrator cl] |
|
3283 | 192 |
|
5209
f7a610e2ef5f
On restart command close server socket and spawn new server, keep running until last client quits
unc0rr
parents:
5093
diff
changeset
|
193 |
handleCmd_lobby ["RESTART_SERVER"] = do |
4914 | 194 |
cl <- thisClient |
5209
f7a610e2ef5f
On restart command close server socket and spawn new server, keep running until last client quits
unc0rr
parents:
5093
diff
changeset
|
195 |
return [RestartServer] |
4914 | 196 |
|
3283 | 197 |
|
4295
1f5604cd99be
This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents:
4242
diff
changeset
|
198 |
handleCmd_lobby _ = return [ProtocolError "Incorrect command (state: in lobby)"] |