equal
deleted
inserted
replaced
69 let sameProto = clientProto cl == roomProto jRoom |
69 let sameProto = clientProto cl == roomProto jRoom |
70 let jRoomClients = map (client irnc) $ roomClients irnc jRI |
70 let jRoomClients = map (client irnc) $ roomClients irnc jRI |
71 let nicks = map nick jRoomClients |
71 let nicks = map nick jRoomClients |
72 let chans = map sendChan (cl : jRoomClients) |
72 let chans = map sendChan (cl : jRoomClients) |
73 return $ |
73 return $ |
74 if isNothing maybeRI || not sameProto then |
74 if isNothing maybeRI || not sameProto then |
75 [Warning "No such room"] |
75 [Warning "No such room"] |
76 else if isRestrictedJoins jRoom then |
76 else if isRestrictedJoins jRoom then |
77 [Warning "Joining restricted"] |
77 [Warning "Joining restricted"] |
78 else if roomPassword /= password jRoom then |
78 else if roomPassword /= password jRoom then |
79 [NoticeMessage WrongPassword] |
79 [NoticeMessage WrongPassword] |
145 handleCmd_lobby ["BAN", banNick, reason] = do |
145 handleCmd_lobby ["BAN", banNick, reason] = do |
146 (ci, _) <- ask |
146 (ci, _) <- ask |
147 cl <- thisClient |
147 cl <- thisClient |
148 banId <- clientByNick banNick |
148 banId <- clientByNick banNick |
149 return [BanClient 60 reason (fromJust banId) | isAdministrator cl && isJust banId && fromJust banId /= ci] |
149 return [BanClient 60 reason (fromJust banId) | isAdministrator cl && isJust banId && fromJust banId /= ci] |
150 |
150 |
151 handleCmd_lobby ["BANIP", ip, reason, duration] = do |
151 handleCmd_lobby ["BANIP", ip, reason, duration] = do |
152 (ci, _) <- ask |
152 (ci, _) <- ask |
153 cl <- thisClient |
153 cl <- thisClient |
154 return [BanIP ip (readInt_ duration) reason | isAdministrator cl] |
154 return [BanIP ip (readInt_ duration) reason | isAdministrator cl] |
155 |
155 |
156 handleCmd_lobby ["BANLIST"] = do |
156 handleCmd_lobby ["BANLIST"] = do |
157 (ci, _) <- ask |
157 (ci, _) <- ask |
158 cl <- thisClient |
158 cl <- thisClient |
159 return [BanList | isAdministrator cl] |
159 return [BanList | isAdministrator cl] |
160 |
160 |
170 handleCmd_lobby ["SET_SERVER_VAR", "LATEST_PROTO", protoNum] = do |
170 handleCmd_lobby ["SET_SERVER_VAR", "LATEST_PROTO", protoNum] = do |
171 cl <- thisClient |
171 cl <- thisClient |
172 return [ModifyServerInfo (\si -> si{latestReleaseVersion = readNum}) | isAdministrator cl && readNum > 0] |
172 return [ModifyServerInfo (\si -> si{latestReleaseVersion = readNum}) | isAdministrator cl && readNum > 0] |
173 where |
173 where |
174 readNum = readInt_ protoNum |
174 readNum = readInt_ protoNum |
175 |
175 |
176 handleCmd_lobby ["GET_SERVER_VAR"] = do |
176 handleCmd_lobby ["GET_SERVER_VAR"] = do |
177 cl <- thisClient |
177 cl <- thisClient |
178 return [SendServerVars | isAdministrator cl] |
178 return [SendServerVars | isAdministrator cl] |
179 |
179 |
180 handleCmd_lobby ["CLEAR_ACCOUNTS_CACHE"] = do |
180 handleCmd_lobby ["CLEAR_ACCOUNTS_CACHE"] = do |