Advertisement
Guest User

Untitled

a guest
Oct 27th, 2018
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 40.22 KB | None | 0 0
  1. def in_PING(self, client, reply=None):
  2. PONG
  3. client.Send('PONG %s'%reply)
  4. client.Send('PONG')
  5.  
  6. def in_PORTTEST(self, client, port):
  7. (no response)
  8. sock.sendto('Port testing...', (host, port))
  9.  
  10. def in_REGISTER(self, client, username, password, email = ""):
  11. REGISTRATIONACCEPTED REGISTRATIONDENIED
  12. client.Send("REGISTRATIONDENIED %s" % ("verification failed: " + reason))
  13. client.Send("REGISTRATIONDENIED %s" % (reason))
  14. client.Send("REGISTRATIONDENIED invalid nickname")
  15. client.Send('REGISTRATIONACCEPTED')
  16. client.Send('REGISTRATIONDENIED %s' % reason)
  17.  
  18. def in_LOGIN(self, client, username, password='', cpu='0', local_ip='', sentence_args=''):
  19. ACCEPTED AGREEMENT AGREEMENTEND CLIENTSTATUS DENIED JOINEDBATTLE LOGIN LOGININFOEND MOTD SAYPRIVATE SERVERMSG UPDATEBATTLEINFO
  20. client.RealSend("MOTD Your client didn't use tls for logging in, please upgrade it!")
  21. client.RealSend("MOTD Your client doesn't support the 'cl' compatibility flag, please upgrade it!")
  22. client.RealSend("MOTD Your client doesn't support the 'p' compatibility flag, please upgrade it!")
  23. client.RealSend("MOTD Your client doesn't support the 'sp' compatibility flag, please upgrade it!")
  24. client.RealSend("MOTD see htpp://springrts.com/dl/LobbyProtocol/ProtocolDescription.html#0.37")
  25. client.RealSend("MOTD see https://springrts.com/dl/LobbyProtocol/ProtocolDescription.html#0.36")
  26. client.RealSend("MOTD see https://springrts.com/dl/LobbyProtocol/ProtocolDescription.html#0.37")
  27. client.RealSend('ACCEPTED %s' % client.username)
  28. client.RealSend('CLIENTSTATUS %s %d' % (addclient.username, addclient.status))
  29. client.RealSend('JOINEDBATTLE %s %s' % (battle.battle_id, battleclient.username))
  30. client.RealSend('LOGININFOEND')
  31. client.RealSend('MOTD %s' % line)
  32. client.RealSend('UPDATEBATTLEINFO %s %i %i %s %s' % (battle.battle_id, battle.spectators, battle.locked, battle.maphash, battle.map))
  33. client.RealSend(self.client_AddBattle(client, battle))
  34. client.RealSend(self.client_AddUser(client, addclient))
  35. client.Send("AGREEMENT ")
  36. client.Send("AGREEMENT %s" %(line))
  37. client.Send("AGREEMENT A verification code has been sent to your email address. Please read our terms of service and then enter your four digit code below.")
  38. client.Send("DENIED %s" %(reason))
  39. client.Send("SAYPRIVATE ChanServ The autoupdater of SpringLobby 0.188 is broken, please manually update: https://springrts.com/phpbb/viewtopic.php?f=64&t=31224")
  40. client.Send("SAYPRIVATE ChanServ Your username is on the nasty word list. Please rename to a username which is not. If you think this is wrong, please create an issue on https://github.com/spring/uberserver/issues with the username which triggers this error.")
  41. client.Send('AGREEMENTEND')
  42. client.Send('SERVERMSG %s' %(message))
  43. receiver.Send(self.client_AddUser(receiver, client))
  44. self._root.broadcast('CLIENTSTATUS %s %d'%(client.username, client.status)) # broadcast current client status
  45. self._root.broadcast(message, self.name, ignore, None, flag)
  46. self.out_DENIED(client, client.username, 'Already logged in.', False)
  47. self.out_DENIED(client, username, "Too many failed logins.")
  48. self.out_DENIED(client, username, "invalid lobby_id")
  49. self.out_DENIED(client, username, "invalid nickname")
  50. self.out_DENIED(client, username, "lobby_id is to long (max=64 chars)")
  51. self.out_DENIED(client, username, 'Already logged in.', False)
  52. self.out_DENIED(client, username, reason)
  53. self.out_SERVERMSG(client, "invalid status: %s: %s, decoded: %s" %(_status,rank, status), True)
  54. self.out_SERVERMSG(client, 'Invalid userID specified: %s' % (user_id), True)
  55. self.out_SERVERMSG(client, 'Unsupported/unknown compatibility flag(s) in LOGIN: %s' % (unsupported), True)
  56.  
  57. def in_CONFIRMAGREEMENT(self, client, verification_code = ""):
  58. ACCEPTED CLIENTSTATUS DENIED JOINEDBATTLE LOGININFOEND MOTD SAYPRIVATE SERVERMSG UPDATEBATTLEINFO
  59. client.RealSend("MOTD Your client didn't use tls for logging in, please upgrade it!")
  60. client.RealSend("MOTD Your client doesn't support the 'cl' compatibility flag, please upgrade it!")
  61. client.RealSend("MOTD Your client doesn't support the 'p' compatibility flag, please upgrade it!")
  62. client.RealSend("MOTD Your client doesn't support the 'sp' compatibility flag, please upgrade it!")
  63. client.RealSend("MOTD see htpp://springrts.com/dl/LobbyProtocol/ProtocolDescription.html#0.37")
  64. client.RealSend("MOTD see https://springrts.com/dl/LobbyProtocol/ProtocolDescription.html#0.36")
  65. client.RealSend("MOTD see https://springrts.com/dl/LobbyProtocol/ProtocolDescription.html#0.37")
  66. client.RealSend('ACCEPTED %s' % client.username)
  67. client.RealSend('CLIENTSTATUS %s %d' % (addclient.username, addclient.status))
  68. client.RealSend('JOINEDBATTLE %s %s' % (battle.battle_id, battleclient.username))
  69. client.RealSend('LOGININFOEND')
  70. client.RealSend('MOTD %s' % line)
  71. client.RealSend('UPDATEBATTLEINFO %s %i %i %s %s' % (battle.battle_id, battle.spectators, battle.locked, battle.maphash, battle.map))
  72. client.RealSend(self.client_AddBattle(client, battle))
  73. client.RealSend(self.client_AddUser(client, addclient))
  74. client.Send("DENIED %s" %(reason))
  75. client.Send("SAYPRIVATE ChanServ The autoupdater of SpringLobby 0.188 is broken, please manually update: https://springrts.com/phpbb/viewtopic.php?f=64&t=31224")
  76. client.Send("SAYPRIVATE ChanServ Your username is on the nasty word list. Please rename to a username which is not. If you think this is wrong, please create an issue on https://github.com/spring/uberserver/issues with the username which triggers this error.")
  77. client.Send('SERVERMSG %s' %(message))
  78. receiver.Send(self.client_AddUser(receiver, client))
  79. self._root.broadcast('CLIENTSTATUS %s %d'%(client.username, client.status)) # broadcast current client status
  80. self._root.broadcast(message, self.name, ignore, None, flag)
  81. self.out_DENIED(client, client.username, reason)
  82. self.out_SERVERMSG(client, "invalid status: %s: %s, decoded: %s" %(_status,rank, status), True)
  83.  
  84. def in_SAY(self, client, chan, msg):
  85. CHANNELMESSAGE SAID SAIDBATTLE SAY
  86. client.Send('CHANNELMESSAGE %s You are %s.' % (chan, channel.getMuteMessage(client)))
  87. client.Send('FAILED ' + self._dictToTags({'msg':message, 'cmd':cmd}))
  88. self._root.broadcast('SAID %s %s %s' % (chan, client.username, msg), chan, set([]), client)
  89. self._root.broadcast(message, self.name, ignore, None, flag)
  90. self.broadcast_SendBattle(battle, 'SAIDBATTLE %s %s' % (client.username, msg), client)
  91. self.out_FAILED(client, "SAY", "Not present in channel", True)
  92. self.out_FAILED(sourceClient, "SAY", "You are muted in this battle until %s!" %(enddate))
  93.  
  94. def in_SAYEX(self, client, chan, msg):
  95. CHANNELMESSAGE SAIDBATTLEEX SAIDEX SAY SAYEX
  96. client.Send('CHANNELMESSAGE %s You are %s.' % (chan, channel.getMuteMessage(client)))
  97. client.Send('FAILED ' + self._dictToTags({'msg':message, 'cmd':cmd}))
  98. self._root.broadcast('SAIDEX %s %s %s' % (chan, client.username, msg), chan, set([]), client)
  99. self._root.broadcast(message, self.name, ignore, None, flag)
  100. self.broadcast_SendBattle(battle, 'SAIDBATTLEEX %s %s' % (client.username, msg), client)
  101. self.out_FAILED("SAYEX", "use SAY action=yes")
  102. self.out_FAILED(sourceClient, "SAY", "You are muted in this battle until %s!" %(enddate))
  103.  
  104. def in_SAYPRIVATE(self, client, user, msg):
  105. SAIDPRIVATE SAYPRIVATE
  106. client.Send('SAYPRIVATE %s %s' % (user, msg))
  107. receiver.Send('SAIDPRIVATE %s %s' % (client.username, msg))
  108.  
  109. def in_SAYPRIVATEEX(self, client, user, msg):
  110. SAIDPRIVATEEX SAYPRIVATEEX
  111. client.Send('SAYPRIVATEEX %s %s' % (user, msg))
  112. receiver.Send('SAIDPRIVATEEX %s %s' % (client.username, msg))
  113.  
  114. def in_BRIDGECLIENTFROM(self, client, location, external_id, external_username):
  115. BRIDGECLIENTFROM BRIDGEDCLIENTFROM SERVERMSG
  116. client.Send("BRIDGEDCLIENTFROM %s %s %s" % (bridgedClient.location, bridgedClient.external_id, bridgedClient.external_username))
  117. client.Send('FAILED ' + self._dictToTags({'msg':message, 'cmd':cmd}))
  118. client.Send('SERVERMSG %s' %(message))
  119. self.out_FAILED(client, "BRIDGECLIENTFROM", "Invalid syntax: %s", True)
  120. self.out_FAILED(client, "BRIDGECLIENTFROM", "Only bot users can bridge clients", True)
  121. self.out_FAILED(client, "BRIDGECLIENTFROM", "The location '%s' is already in use by bridge bot %s" % existing_bridge.username, True)
  122. self.out_FAILED(client, "BRIDGECLIENTFROM", "This client already exists on the bridge (external_id=%s)" % response.external_id, True)
  123. self.out_FAILED(client, "BRIDGECLIENTFROM", "You cannot bridge a location named after another bot user", True)
  124. self.out_FAILED(client, "BRIDGECLIENTFROM", "You need the 'u' compatibility flag to bridge clients", True)
  125. self.out_FAILED(client, "BRIDGECLIENTFROM", response, True)
  126. self.out_SERVERMSG(client, "You are now the bridge bot for location '%s'" % location)
  127.  
  128. def in_UNBRIDGECLIENTFROM(self, client, location, external_id):
  129. UNBRIDGECLIENTFROM UNBRIDGEDCLIENTFROM
  130. client.Send("UNBRIDGEDCLIENTFROM %s %s" % (bridgedClient.location, bridgedClient.external_id))
  131. client.Send('FAILED ' + self._dictToTags({'msg':message, 'cmd':cmd}))
  132. self.out_FAILED(client, "UNBRIDGECLIENTFROM", "Bridged client is on a different bridge (got %i, expected %i)" % (bridgedClient.bridge_user_id, client.user_id), True)
  133. self.out_FAILED(client, "UNBRIDGECLIENTFROM", "Bridged client not found", True)
  134.  
  135. def in_JOINFROM(self, client, chan, location, external_id):
  136. JOINEDFROM JOINFROM UNBRIDGECLIENTFROM
  137. client.Send('FAILED ' + self._dictToTags({'msg':message, 'cmd':cmd}))
  138. self._root.broadcast(message, self.name, ignore, None, flag)
  139. self.broadcast('JOINEDFROM %s %s' % (self.name, bridgedClient.username), set(), 'u')
  140. self.out_FAILED(client, "JOINFROM", "Bridged user is banned from channel", True)
  141. self.out_FAILED(client, "JOINFROM", "Bridged user not found", True)
  142. self.out_FAILED(client, "JOINFROM", "Channel '%s' not found" % chan, True)
  143. self.out_FAILED(client, "UNBRIDGECLIENTFROM", "Bridged client is on a different bridge (got %i, expected %i)" % (bridgedClient.bridge_user_id, client.user_id), True)
  144.  
  145. def in_LEAVEFROM(self, client, chan, location, external_id):
  146. JOINFROM LEAVEFROM LEFTFROM UNBRIDGECLIENTFROM
  147. client.Send('FAILED ' + self._dictToTags({'msg':message, 'cmd':cmd}))
  148. self._root.broadcast(message, self.name, ignore, None, flag)
  149. self.broadcast('LEFTFROM %s %s %s' % (self.name, bridgedClient.username, reason), set(), 'u')
  150. self.out_FAILED(client, "JOINFROM", "Bridged user not found", True)
  151. self.out_FAILED(client, "LEAVEFROM", "Channel '%s' not found" % chan, True)
  152. self.out_FAILED(client, "UNBRIDGECLIENTFROM", "Bridged client is on a different bridge (got %i, expected %i)" % (bridgedClient.bridge_user_id, client.user_id), True)
  153.  
  154. def in_SAYFROM(self, client, chan, location, external_id, msg):
  155. SAIDFROM SAYFROM
  156. client.Send('FAILED ' + self._dictToTags({'msg':message, 'cmd':cmd}))
  157. self._root.broadcast('SAIDFROM %s %s %s' % (chan, bridgedClient.username, msg), chan, set([]), client)
  158. self._root.broadcast(message, self.name, ignore, None, flag)
  159. self.out_FAILED(client, "SAYFROM", "Bridged user not present in channel", True)
  160.  
  161. def in_IGNORE(self, client, tags):
  162. IGNORE SERVERMSG
  163. client.Send('IGNORE userName=%s' % (username))
  164. client.Send('IGNORE userName=%s\treason=%s' % (username, reason))
  165. client.Send('SERVERMSG %s' %(message))
  166. self.out_SERVERMSG(client, "Can't ignore a moderator.")
  167. self.out_SERVERMSG(client, "Can't ignore self.")
  168. self.out_SERVERMSG(client, "Ignore list full (50 users).")
  169. self.out_SERVERMSG(client, "Invalid userName format.")
  170. self.out_SERVERMSG(client, "Missing userName argument.")
  171. self.out_SERVERMSG(client, "No such user.")
  172. self.out_SERVERMSG(client, "User is already ignored.")
  173.  
  174. def in_UNIGNORE(self, client, tags):
  175. SERVERMSG UNIGNORE
  176. client.Send('SERVERMSG %s' %(message))
  177. client.Send('UNIGNORE userName=%s' % (username))
  178. self.out_SERVERMSG(client, "Invalid userName format.")
  179. self.out_SERVERMSG(client, "Missing userName argument.")
  180. self.out_SERVERMSG(client, "No such user.")
  181. self.out_SERVERMSG(client, "User is not ignored.")
  182.  
  183. def in_IGNORELIST(self, client):
  184. IGNORELIST IGNORELISTBEGIN IGNORELISTEND
  185. client.Send('IGNORELIST userName=%s' % (username))
  186. client.Send('IGNORELIST userName=%s\treason=%s' % (username, reason))
  187. client.Send('IGNORELISTBEGIN')
  188. client.Send('IGNORELISTEND')
  189.  
  190. def in_FRIENDREQUEST(self, client, tags):
  191. FRIENDREQUEST SERVERMSG
  192. client.Send('SERVERMSG %s' %(message))
  193. friendRequestClient.Send('FRIENDREQUEST userName=%s' % client.username)
  194. friendRequestClient.Send('FRIENDREQUEST userName=%s\tmsg=%s' % (client.username, msg))
  195. self.out_SERVERMSG(client, "Already friends with user.")
  196. self.out_SERVERMSG(client, "Can't send friend request to self. Sorry :(")
  197. self.out_SERVERMSG(client, "Invalid userName format.")
  198. self.out_SERVERMSG(client, "Missing userName argument.")
  199. self.out_SERVERMSG(client, "No such user.")
  200.  
  201. def in_ACCEPTFRIENDREQUEST(self, client, tags):
  202. FRIEND SERVERMSG
  203. client.Send('FRIEND userName=%s' % username)
  204. client.Send('SERVERMSG %s' %(message))
  205. friendRequestClient.Send('FRIEND userName=%s' % client.username)
  206. self.out_SERVERMSG(client, "Invalid userName format.")
  207. self.out_SERVERMSG(client, "Missing userName argument.")
  208. self.out_SERVERMSG(client, "No such friend request.")
  209.  
  210. def in_DECLINEFRIENDREQUEST(self, client, tags):
  211. SERVERMSG
  212. client.Send('SERVERMSG %s' %(message))
  213. self.out_SERVERMSG(client, "Invalid userName format.")
  214. self.out_SERVERMSG(client, "Missing userName argument.")
  215. self.out_SERVERMSG(client, "No such friend request.")
  216.  
  217. def in_UNFRIEND(self, client, tags):
  218. SERVERMSG UNFRIEND
  219. client.Send('SERVERMSG %s' %(message))
  220. client.Send('UNFRIEND userName=%s' % username)
  221. friendRequestClient.Send('UNFRIEND userName=%s' % client.username)
  222. self.out_SERVERMSG(client, "Invalid userName format.")
  223. self.out_SERVERMSG(client, "Missing userName argument.")
  224.  
  225. def in_FRIENDREQUESTLIST(self, client):
  226. FRIENDREQUESTLIST FRIENDREQUESTLISTBEGIN FRIENDREQUESTLISTEND
  227. client.Send('FRIENDREQUESTLIST userName=%s' % (username))
  228. client.Send('FRIENDREQUESTLIST userName=%s\tmsg=%s' % (username, msg))
  229. client.Send('FRIENDREQUESTLISTBEGIN')
  230. client.Send('FRIENDREQUESTLISTEND')
  231.  
  232. def in_FRIENDLIST(self, client):
  233. FRIENDLIST FRIENDLISTBEGIN FRIENDLISTEND
  234. client.Send('FRIENDLIST userName=%s' % (username))
  235. client.Send('FRIENDLISTBEGIN')
  236. client.Send('FRIENDLISTEND')
  237.  
  238. def in_JOIN(self, client, chan, key=None):
  239. CHANNELTOPIC CLIENTS CLIENTSFROM JOIN JOINBATTLE JOINED JOINFAILED NOCHANNELTOPIC
  240. client.Send('CHANNELTOPIC %s %s %s %s'%(self.name, topic['user'], topictime, top))
  241. client.Send('CLIENTS %s %s' % (self.name, clientlist))
  242. client.Send('CLIENTSFROM %s %s' % (self.name, bridgedClientList))
  243. client.Send('FAILED ' + self._dictToTags({'msg':message, 'cmd':cmd}))
  244. client.Send('JOIN %s' % self.name) #superfluous, could deprecate
  245. client.Send('JOINFAILED %s Invalid key' % chan)
  246. client.Send('JOINFAILED %s You are banned from the channel (%s)' % (chan, channel.ban[client.user_id].reason))
  247. client.Send('JOINFAILED %s Your ip is banned from the channel (%s)' % (chan, channel.ban[client.user_id].reason))
  248. client.Send('JOINFAILED %s is a battle, please use JOINBATTLE to access it' % chan)
  249. client.Send('JOINFAILED %s' % reason)
  250. client.Send('NOCHANNELTOPIC %s' % self.name)
  251. self._root.broadcast(message, self.name, ignore, None, flag)
  252. self.broadcast('JOINED %s %s' % (self.name, client.username))
  253. self.out_FAILED(client, "JOIN", "Only moderators allowed in this channel! access=%s" %(client.access), True)
  254. self.out_FAILED(client, 'JOIN', 'Invalid channel: %s' %(chan), True)
  255. self.out_FAILED(client, 'JOIN', 'cannot create channel %s with prefix __battle__, these names are reserved for battles' % chan, True)
  256.  
  257. def in_LEAVE(self, client, chan, reason=None):
  258. LEAVE LEAVEBATTLE LEFT
  259. client.Send('FAILED ' + self._dictToTags({'msg':message, 'cmd':cmd}))
  260. client.Send('LEFT %s %s' % (self.name, client.username))
  261. self._root.broadcast(message, self.name, ignore, None, flag)
  262. self.broadcast('LEFT %s %s %s' % (self.name, client.username, reason))
  263. self.broadcast('LEFT %s %s' % (self.name, client.username))
  264. self.out_FAILED(client, 'LEAVE', '%s is a battle, use LEAVEBATTLE to leave it' % chan, True)
  265. self.out_FAILED(client, 'LEAVE', 'not in channel %s' % chan, True)
  266.  
  267. def in_OPENBATTLE(self, client, type, natType, key, port, maxplayers, hashcode, rank, maphash, sentence_args):
  268. JOINBATTLE OPENBATTLE OPENBATTLEFAILED REQUESTBATTLESTATUS SERVERMSG
  269. client.Send('JOINBATTLE %s %s' % (battle.battle_id, hashcode))
  270. client.Send('OPENBATTLE %s' % battle.battle_id)
  271. client.Send('OPENBATTLEFAILED %s' % (reason))
  272. client.Send('REQUESTBATTLESTATUS')
  273. client.Send('SERVERMSG %s' %(message))
  274. client.Send(self.client_AddBattle(client, battle))
  275. self.out_OPENBATTLEFAILED(client, "Engine version specified is invalid: Spring %s or later is required!" % self._root.min_spring_version)
  276. self.out_OPENBATTLEFAILED(client, 'Invalid argument type, send this to your lobby dev: id=%s type=%s natType=%s key=%s port=%s maphash=%s gamehash=%s - %s' %
  277. self.out_OPENBATTLEFAILED(client, 'Invalid game hash 0')
  278. self.out_OPENBATTLEFAILED(client, 'Port is out of range: 1-65535: %d' % port)
  279. self.out_OPENBATTLEFAILED(client, 'To few arguments: %d' %(argcount))
  280. self.out_OPENBATTLEFAILED(client, error)
  281. self.out_SERVERMSG(client, "A botflag is required to host battles with > %i players. Your battle was restricted to %i players" % (noflag_limit, noflag_limit))
  282.  
  283. def in_JOINBATTLE(self, client, battle_id, key=None, scriptPassword=None):
  284. JOINBATTLEFAILED
  285. client.Send('JOINBATTLEFAILED Battle does not exist')
  286. client.Send('JOINBATTLEFAILED Battle is locked')
  287. client.Send('JOINBATTLEFAILED Client is already in battle')
  288. client.Send('JOINBATTLEFAILED Incorrect password')
  289. client.Send('JOINBATTLEFAILED Invalid battle id: %s.' %(str(battle_id)))
  290. client.Send('JOINBATTLEFAILED You are already in a battle')
  291. client.Send('JOINBATTLEFAILED You are banned from the battle')
  292.  
  293. def in_SETSCRIPTTAGS(self, client, scripttags):
  294. SETSCRIPTTAGS
  295. client.Send('FAILED ' + self._dictToTags({'msg':message, 'cmd':cmd}))
  296. self._root.broadcast_battle('SETSCRIPTTAGS %s'%'\t'.join(scripttags), client.current_battle)
  297. self.out_FAILED(client, "SETSCRIPTTAGS", "You are not allowed to change settings in this battle", True)
  298.  
  299. def in_REMOVESCRIPTTAGS(self, client, tags):
  300. REMOVESCRIPTTAGS
  301. client.Send('FAILED ' + self._dictToTags({'msg':message, 'cmd':cmd}))
  302. self._root.broadcast_battle('REMOVESCRIPTTAGS %s'%' '.join(rem), client.current_battle)
  303. self.out_FAILED(client, "REMOVESCRIPTTAGS", "You are not allowed to change settings in this battle", True)
  304.  
  305. def in_LEAVEBATTLE(self, client):
  306. BATTLECLOSED LEAVEBATTLE
  307. client.Send('BATTLECLOSED %s' % battle.battle_id)
  308. client.Send('FAILED ' + self._dictToTags({'msg':message, 'cmd':cmd}))
  309. self.out_FAILED(client, "LEAVEBATTLE", "couldn't find battle")
  310. self.out_FAILED(client, "LEAVEBATTLE", "not in battle")
  311.  
  312. def in_MYBATTLESTATUS(self, client, _battlestatus, _myteamcolor):
  313. MYBATTLESTATUS UPDATEBATTLEINFO
  314. client.Send('FAILED ' + self._dictToTags({'msg':message, 'cmd':cmd}))
  315. client.Send(statuscmd)
  316. self._root.broadcast('UPDATEBATTLEINFO %s %i %i %s %s' % (battle.battle_id, battle.spectators, battle.locked, battle.maphash, battle.map))
  317. self._root.broadcast(message, self.name, ignore, None, flag)
  318. self._root.broadcast_battle(statuscmd, battle.battle_id)
  319. self.out_FAILED(client, "MYBATTLESTATUS", "not inside a battle", True)
  320. self.out_FAILED(client, 'MYBATTLESTATUS', 'invalid status is below 0: %s. Please update your lobby!' % (_battlestatus), True)
  321. self.out_FAILED(client, 'MYBATTLESTATUS', 'invalid teamcolor: %s.' % (myteamcolor), True)
  322. self.out_FAILED(client, 'MYBATTLESTATUS','invalid status: %s.' % (_battlestatus), True)
  323.  
  324. def in_UPDATEBATTLEINFO(self, client, SpectatorCount, locked, maphash, mapname):
  325. SERVERMSG UPDATEBATTLEINFO
  326. client.Send('SERVERMSG %s' %(message))
  327. self._root.broadcast(message, self.name, ignore, None, flag)
  328. self._root.broadcast(newstr)
  329. self.out_SERVERMSG(client, "UPDATEBATTLEINFO failed - Invalid map hash send: %s %s " %(str(mapname),str(maphash)), True)
  330. self.out_SERVERMSG(client, "UPDATEBATTLEINFO failed - invalid mapname send: %s" %(str(mapname)), True)
  331.  
  332. def in_MYSTATUS(self, client, _status):
  333. CLIENTSTATUS HOSTPORT MYSTATUS SERVERMSG
  334. client.Send('FAILED ' + self._dictToTags({'msg':message, 'cmd':cmd}))
  335. client.Send('SERVERMSG %s' %(message))
  336. self._root.broadcast('CLIENTSTATUS %s %d'%(client.username, client.status))
  337. self._root.broadcast(message, self.name, ignore, None, flag)
  338. self._root.broadcast_battle('HOSTPORT %i' % client.hostport, battle.battle_id, host)
  339. self.out_FAILED(client, 'MYSTATUS', 'ingame but no battleid set', True)
  340. self.out_FAILED(client, 'MYSTATUS', 'invalid status %s'%(_status), True)
  341. self.out_SERVERMSG(client, "invalid status: %s: %s, decoded: %s" %(_status,rank, status), True)
  342.  
  343. def in_CHANNELS(self, client):
  344. CHANNEL ENDOFCHANNELS
  345. client.Send('CHANNEL %s %d %s'% (channel.name, len(channel.users), top))
  346. client.Send('ENDOFCHANNELS')
  347.  
  348. def in_CHANNELTOPIC(self, client, chan, topic):
  349. CHANNELMESSAGE CHANNELTOPIC
  350. self._root.broadcast(message, self.name, ignore, None, flag)
  351. self.broadcast('CHANNELMESSAGE %s %s' % (self.name, message))
  352. self.broadcast('CHANNELMESSAGE %s %s' % (self.name, message), set(), 'u')
  353. self.broadcast('CHANNELTOPIC %s %s %s %s'%(self.name, client.username, topicdict['time'], topic), set())
  354. self.broadcast('CHANNELTOPIC %s %s %s %s'%(self.name, client.username, topicdict['time'], topic), set(), 'u')
  355. self.channelMessage('Topic changed.')
  356. self.channelMessage('Topic disabled.')
  357.  
  358. def in_GETCHANNELMESSAGES(self, client, chan, lastid):
  359. GETCHANNELMESSAGES SAID
  360. client.Send('FAILED ' + self._dictToTags({'msg':message, 'cmd':cmd}))
  361. client.Send('JSON ' + json.dumps({cmd: dict}, separators=(',', ':')))
  362. self.out_FAILED(client, "GETCHANNELMESSAGES", "Can't get channel messages when not joined", True)
  363. self.out_FAILED(client, "GETCHANNELMESSAGES", "Invalid id", True)
  364. self.out_JSON(client, 'SAID', {"chanName": chan, "time": str(datetime_totimestamp(msg[0])), "userName": msg[1], "msg": msg[2], "id": msg[3]})
  365.  
  366. def in_RING(self, client, username):
  367. RING
  368. user.Send('RING %s' % (client.username))
  369.  
  370. def in_ADDSTARTRECT(self, client, allyno, left, top, right, bottom):
  371. ADDSTARTRECT SERVERMSG
  372. client.Send('SERVERMSG %s' %(message))
  373. self._root.broadcast_battle('ADDSTARTRECT %s' % (allyno)+' %(left)s %(top)s %(right)s %(bottom)s' %(rect), client.current_battle)
  374. self.out_SERVERMSG(client, "invalid ADDSTARTRECT received")
  375.  
  376. def in_REMOVESTARTRECT(self, client, allyno):
  377. REMOVESTARTRECT SERVERMSG
  378. client.Send('SERVERMSG %s' %(message))
  379. self._root.broadcast_battle('REMOVESTARTRECT %s' % allyno, client.current_battle)
  380. self.out_SERVERMSG(client, 'invalid rect removed: %d' % (allyno), True)
  381.  
  382. def in_DISABLEUNITS(self, client, units):
  383. DISABLEUNITS
  384. self._root.broadcast_battle('DISABLEUNITS %s'%disabled_units, client.current_battle)
  385.  
  386. def in_ENABLEUNITS(self, client, units):
  387. ENABLEUNITS
  388. self._root.broadcast_battle('ENABLEUNITS %s'%enabled_units, battle_id, client.username)
  389.  
  390. def in_ENABLEALLUNITS(self, client):
  391. ENABLEALLUNITS
  392. self._root.broadcast_battle('ENABLEALLUNITS', client.current_battle)
  393.  
  394. def in_HANDICAP(self, client, username, value):
  395. CLIENTBATTLESTATUS
  396. self._root.broadcast_battle('CLIENTBATTLESTATUS %s %s %s'%(username, battle.calc_battlestatus(user), user.teamcolor), user.current_battle)
  397.  
  398. def in_KICKFROMBATTLE(self, client, username):
  399. FORCEQUITBATTLE
  400. user.Send('FORCEQUITBATTLE %s' %(client.username))
  401.  
  402. def in_FORCETEAMNO(self, client, username, teamno):
  403. CLIENTBATTLESTATUS
  404. self._root.broadcast_battle('CLIENTBATTLESTATUS %s %s %s'%(username, battle.calc_battlestatus(user), user.teamcolor), user.current_battle)
  405.  
  406. def in_FORCEALLYNO(self, client, username, allyno):
  407. CLIENTBATTLESTATUS
  408. self._root.broadcast_battle('CLIENTBATTLESTATUS %s %s %s'%(username, battle.calc_battlestatus(user), user.teamcolor), user.current_battle)
  409.  
  410. def in_FORCETEAMCOLOR(self, client, username, teamcolor):
  411. CLIENTBATTLESTATUS
  412. self._root.broadcast_battle('CLIENTBATTLESTATUS %s %s %s'%(username, battle.calc_battlestatus(user), user.teamcolor), user.current_battle)
  413.  
  414. def in_FORCESPECTATORMODE(self, client, username):
  415. CLIENTBATTLESTATUS UPDATEBATTLEINFO
  416. self._root.broadcast('UPDATEBATTLEINFO %s %i %i %s %s' %(battle.battle_id, battle.spectators, battle.locked, battle.maphash, battle.map))
  417. self._root.broadcast(message, self.name, ignore, None, flag)
  418. self._root.broadcast_battle('CLIENTBATTLESTATUS %s %s %s'%(username, battle.calc_battlestatus(user), user.teamcolor), user.current_battle)
  419.  
  420. def in_ADDBOT(self, client, name, battlestatus, teamcolor, AIDLL):
  421. ADDBOT AIDLL
  422. client.Send('FAILED ' + self._dictToTags({'msg':message, 'cmd':cmd}))
  423. self._root.broadcast_battle('ADDBOT %s %s %s %s %s %s'%(battle.battle_id, name, client.username, battlestatus, teamcolor, AIDLL), battle.battle_id)
  424. self.out_FAILED(client, "ADDBOT", "Bot already exists!", True)
  425. self.out_FAILED(client, "ADDBOT", "Couldn't find battle", True)
  426.  
  427. def in_UPDATEBOT(self, client, name, battlestatus, teamcolor):
  428. UPDATEBOT
  429. client.Send('FAILED ' + self._dictToTags({'msg':message, 'cmd':cmd}))
  430. self._root.broadcast_battle('UPDATEBOT %s %s %s %s'%(battle.battle_id, name, battlestatus, teamcolor), battle.battle_id)
  431. self.out_FAILED(client, "UPDATEBOT", "Couldn't find battle", True)
  432.  
  433. def in_REMOVEBOT(self, client, name):
  434. REMOVEBOT
  435. client.Send('FAILED ' + self._dictToTags({'msg':message, 'cmd':cmd}))
  436. self._root.broadcast_battle('REMOVEBOT %s %s'%(battle.battle_id, name), battle.battle_id)
  437. self.out_FAILED(client, "REMOVEBOT", "Couldn't find battle", True)
  438.  
  439. def in_GETINGAMETIME(self, client, username=None):
  440. GETINGAMETIME SERVERMSG
  441. client.Send('FAILED ' + self._dictToTags({'msg':message, 'cmd':cmd}))
  442. client.Send('SERVERMSG %s' %(message))
  443. self.out_FAILED(client,'GETINGAMETIME', 'access denied')
  444. self.out_FAILED(client,'GETINGAMETIME', 'user not found / offline')
  445. self.out_SERVERMSG(client, '<%s> has an ingame time of %d minutes (%d hours).'%(username, ingame_time, ingame_time / 60))
  446. self.out_SERVERMSG(client,'Your ingame time is %d minutes (%d hours).'%(ingame_time, ingame_time / 60))
  447.  
  448. def in_GETLASTLOGINTIME(self, client, username):
  449. SERVERMSG
  450. client.Send('SERVERMSG %s' %(message))
  451. else: self.out_SERVERMSG(client, 'Database returned error when retrieving last login time for <%s> (%s)' % (username, data))
  452. if good: self.out_SERVERMSG(client, '<%s> last logged in on %s.' % (username, data.isoformat()))
  453.  
  454. def in_GETREGISTRATIONDATE(self, client, username=None):
  455. GETREGISTRATIONDATE SERVERMSG
  456. client.Send('FAILED ' + self._dictToTags({'msg':message, 'cmd':cmd}))
  457. client.Send('SERVERMSG %s' %(message))
  458. self.out_FAILED(client, "GETREGISTRATIONDATE", "permission denied")
  459. self.out_FAILED(client, "GETREGISTRATIONDATE", "user not found / offline")
  460. self.out_SERVERMSG(client, '<%s> registered on %s.' % (username, client.register_date.isoformat()))
  461. self.out_SERVERMSG(client, '<%s> registered on %s.' % (username, regdate.isoformat()))
  462.  
  463. def in_GETUSERID(self, client, username):
  464. SERVERMSG
  465. client.Send('SERVERMSG %s' %(message))
  466. self.out_SERVERMSG(client, 'The ID for <%s> is %s' % (username, user.last_id))
  467. self.out_SERVERMSG(client, 'User not found.')
  468.  
  469. def in_GETACCOUNTACCESS(self, client, username):
  470. SERVERMSG
  471. client.Send('SERVERMSG %s' %(message))
  472. self.out_SERVERMSG(client, 'Account access for <%s>: %s' % (username, data))
  473. self.out_SERVERMSG(client, 'Database returned error when retrieving account access for <%s> (%s)' % (username, data))
  474.  
  475. def in_FINDIP(self, client, address):
  476. SERVERMSG
  477. client.Send('SERVERMSG %s' %(message))
  478. self.out_SERVERMSG(client, '<%s> is currently bound to %s.' % (entry.username, address))
  479. self.out_SERVERMSG(client, '<%s> was recently bound to %s at %s' % (entry.username, address, lastlogin))
  480.  
  481. def in_GETIP(self, client, username):
  482. SERVERMSG
  483. client.Send('SERVERMSG %s' %(message))
  484. self.out_SERVERMSG(client, '<%s> is currently bound to %s' % (username, ip))
  485. self.out_SERVERMSG(client, '<%s> was recently bound to %s' % (username, ip))
  486.  
  487. def in_RENAMEACCOUNT(self, client, newname):
  488. RENAMEACCOUNT SERVERMSG
  489. client.Send('FAILED ' + self._dictToTags({'msg':message, 'cmd':cmd}))
  490. client.Send('SERVERMSG %s' %(message))
  491. self.out_FAILED(client, "RENAMEACCOUNT", "invalid nickname: %s" %(newname), True)
  492. self.out_SERVERMSG(client, '%s' %(reason))
  493. self.out_SERVERMSG(client, 'Failed to rename to <%s>: %s' % (newname, reason))
  494. self.out_SERVERMSG(client, 'You already have that username.')
  495. self.out_SERVERMSG(client, 'Your account has been renamed to <%s>. Reconnect with the new username (you will now be automatically disconnected).' % newname)
  496.  
  497. def in_CHANGEPASSWORD(self, client, cur_password, new_password):
  498. SERVERMSG
  499. client.Send('SERVERMSG %s' %(message))
  500. self.out_SERVERMSG(client, '%s' % reason)
  501. self.out_SERVERMSG(client, 'Incorrect old password.')
  502. self.out_SERVERMSG(client, 'Password changed successfully! It will be used at the next login!')
  503.  
  504. def in_GETLOBBYVERSION(self, client, username):
  505. SERVERMSG
  506. client.Send('SERVERMSG %s' %(message))
  507. self.out_SERVERMSG(client, '<%s> is using %s'%(user.username, user.lobby_id))
  508.  
  509. def in_SETBOTMODE(self, client, username, mode):
  510. CLIENTSTATUS SERVERMSG
  511. client.Send('SERVERMSG %s' %(message))
  512. self._root.broadcast('CLIENTSTATUS %s %d'%(client.username, client.status))
  513. self._root.broadcast(message, self.name, ignore, None, flag)
  514. self.out_SERVERMSG(client, "invalid status: %s: %s, decoded: %s" %(_status,rank, status), True)
  515. self.out_SERVERMSG(client, 'Botmode for <%s> successfully changed to %s' % (username, bot))
  516.  
  517. def in_CHANGEACCOUNTPASS(self, client, username, newpass):
  518. SERVERMSG
  519. client.Send('SERVERMSG %s' %(message))
  520. self.out_SERVERMSG(client, "Password for user %s can not be changed." % username)
  521. self.out_SERVERMSG(client, "invalid password specified: %s" %(reason))
  522. self.out_SERVERMSG(client, 'Password for <%s> successfully changed to %s' % (username, newpass))
  523. self.out_SERVERMSG(client, 'You have insufficient access to change moderator passwords.')
  524.  
  525. def in_BROADCAST(self, client, msg):
  526. BROADCAST
  527. self._root.broadcast('BROADCAST %s'%msg)
  528. self._root.broadcast(message, self.name, ignore, None, flag)
  529.  
  530. def in_BROADCASTEX(self, client, msg):
  531. SERVERMSGBOX
  532. self._root.broadcast('SERVERMSGBOX %s'%msg)
  533. self._root.broadcast(message, self.name, ignore, None, flag)
  534.  
  535. def in_ADMINBROADCAST(self, client, msg):
  536. (no response)
  537. self._root.admin_broadcast(msg)
  538.  
  539. def in_SETMINSPRINGVERSION(self, client, version):
  540. BATTLECLOSED SAIDBATTLEEX SAY
  541. client.Send('BATTLECLOSED %s' % battle.battle_id)
  542. client.Send('FAILED ' + self._dictToTags({'msg':message, 'cmd':cmd}))
  543. self.broadcast_SendBattle(battle, 'SAIDBATTLEEX %s -- This battle will close -- %s %s or later is now required by the server. Please join a battle with the new Spring version!' % (host.username, 'Spring', version))
  544. self.out_FAILED(sourceClient, "SAY", "You are muted in this battle until %s!" %(enddate))
  545.  
  546. def in_KICK(self, client, username, reason=''):
  547. SERVERMSG
  548. client.Send('SERVERMSG %s' %(message))
  549. self.out_SERVERMSG(client, 'Kicked <%s> from the server' % username)
  550. self.out_SERVERMSG(client, 'User <%s> was not online' % username)
  551. self.out_SERVERMSG(kickeduser, 'You were kicked from the server (%s)' % (reason))
  552.  
  553. def in_EXIT(self, client, reason=('Exiting')):
  554. (no response)
  555.  
  556. def in_LISTCOMPFLAGS(self, client):
  557. COMPFLAGS
  558. client.Send("COMPFLAGS %s" %(flags))
  559.  
  560. def in_BAN(self, client, username, duration, reason):
  561. SERVERMSG
  562. client.Send('SERVERMSG %s' %(message))
  563. if response: self.out_SERVERMSG(client, '%s' % response)
  564.  
  565. def in_BANSPECIFIC(self, client, arg, duration, reason):
  566. SERVERMSG
  567. client.Send('SERVERMSG %s' %(message))
  568. if response: self.out_SERVERMSG(client, '%s' % response)
  569.  
  570. def in_UNBAN(self, client, arg):
  571. SERVERMSG
  572. client.Send('SERVERMSG %s' %(message))
  573. if response: self.out_SERVERMSG(client, '%s' % response)
  574.  
  575. def in_BLACKLIST(self, client, domain, reason=""):
  576. SERVERMSG
  577. client.Send('SERVERMSG %s' %(message))
  578. if response: self.out_SERVERMSG(client, '%s' % response)
  579.  
  580. def in_UNBLACKLIST(self, client, domain):
  581. SERVERMSG
  582. client.Send('SERVERMSG %s' %(message))
  583. if response: self.out_SERVERMSG(client, '%s' % response)
  584.  
  585. def in_LISTBANS(self, client):
  586. SERVERMSG
  587. client.Send('SERVERMSG %s' %(message))
  588. self.out_SERVERMSG(client, "%s, %s, %s :: '%s' :: ends %s (%s)" % (entry['username'], entry['ip'], entry['email'], entry['reason'], entry['end_date'], entry['issuer']))
  589. self.out_SERVERMSG(client, '-- Banlist --')
  590. self.out_SERVERMSG(client, '-- End Banlist --')
  591. self.out_SERVERMSG(client, 'Banlist is empty')
  592.  
  593. def in_LISTBLACKLIST(self, client):
  594. SERVERMSG
  595. client.Send('SERVERMSG %s' %(message))
  596. self.out_SERVERMSG(client, "%s :: '%s' (%s)" % (entry['domain'], entry['reason'], entry['issuer']))
  597. self.out_SERVERMSG(client, '-- Blacklist --')
  598. self.out_SERVERMSG(client, '-- End Blacklist--')
  599. self.out_SERVERMSG(client, 'Blacklist is empty')
  600.  
  601. def in_SETACCESS(self, client, username, access):
  602. CLIENTSTATUS SERVERMSG SETACCESS UNIGNORE
  603. client.Send('OK ' + self._dictToTags({'cmd': cmd}))
  604. client.Send('SERVERMSG %s' %(message))
  605. self._root.broadcast('CLIENTSTATUS %s %d' % (username, user.status))
  606. self._root.broadcast(message, self.name, ignore, None, flag)
  607. self.out_OK(client, "SETACCESS")
  608. self.out_SERVERMSG(client, "Invalid access mode, only user, mod, admin is valid.")
  609. self.out_SERVERMSG(client, "User not found.")
  610. self.out_SERVERMSG(client, "invalid status: %s: %s, decoded: %s" %(_status,rank, status), True)
  611. userThatIgnored.Send('UNIGNORE userName=%s' % (username))
  612.  
  613. def in_RELOAD(self, client):
  614. SERVERMSG
  615. client.Send('SERVERMSG %s' %(message))
  616. self.out_SERVERMSG(client, 'Reload failed!')
  617. self.out_SERVERMSG(client, 'Reload successful')
  618.  
  619. def in_CLEANUP(self, client):
  620. (no response)
  621. self._root.admin_broadcast('Cleanup initiated by %s (deleting old users, zombie channels / users)...' %(client.username))
  622.  
  623. def in_CHANGEEMAILREQUEST(self, client, newmail):
  624. CHANGEEMAILREQUESTACCEPTED CHANGEEMAILREQUESTDENIED SERVERMSG
  625. client.Send("CHANGEEMAILREQUESTACCEPTED")
  626. client.Send("CHANGEEMAILREQUESTDENIED " + reason)
  627. client.Send("CHANGEEMAILREQUESTDENIED email verification is currently turned off, a blank verification code will be accepted!")
  628. client.Send('SERVERMSG %s' %(message))
  629. self.out_SERVERMSG(client, "compatibility flag cl needed")
  630.  
  631. def in_CHANGEEMAIL(self, client, newmail, verification_code=""):
  632. CHANGEEMAILACCEPTED CHANGEEMAILDENIED SERVERMSG
  633. client.Send("CHANGEEMAILACCEPTED " + newmail)
  634. client.Send("CHANGEEMAILDENIED " + reason)
  635. client.Send('SERVERMSG %s' %(message))
  636. self.out_SERVERMSG(client, "Your email address has been changed to " + client.email)
  637. self.out_SERVERMSG(client, "compatibility flag cl needed")
  638.  
  639. def in_CHANGEACCOUNTEMAIL(self, client, username, newmail):
  640. SERVERMSG
  641. client.Send('SERVERMSG %s' %(message))
  642. self.out_SERVERMSG(client,"access denied")
  643. self.out_SERVERMSG(client,"changed <%s> email to %s"%(username, user.email))
  644. self.out_SERVERMSG(client,"user not found")
  645.  
  646. def in_RESENDVERIFICATION(self, client, newmail):
  647. RESENDVERIFICATIONACCEPTED RESENDVERIFICATIONDENIED
  648. client.Send("RESENDVERIFICATIONACCEPTED")
  649. client.Send("RESENDVERIFICATIONDENIED %s" % reason)
  650. client.Send("RESENDVERIFICATIONDENIED email verification is currently turned off, you do not need a verification code!")
  651.  
  652. def in_STLS(self, client):
  653. STLS
  654. client.Send(' '.join((self._root.server, str(self._root.server_version), self._root.min_spring_version, str(self._root.natport), '0')))
  655. client.Send('OK ' + self._dictToTags({'cmd': cmd}))
  656. self.out_OK(client, "STLS")
  657.  
  658. def in_JSON(self, client, rawcmd):
  659. (no response)
  660. client.Send('JSON ' + json.dumps({cmd: dict}, separators=(',', ':')))
  661. self._root.broadcast('JSON ' + json.dumps(data, separators=(',', ':')))
  662. self._root.broadcast(message, self.name, ignore, None, flag)
  663. self.out_JSON(client, "FAILED", {"msg": "Unknown command: %s" %(rawcmd)})
  664. self.out_JSON(client, "FAILED", {"msg": str(e)})
  665.  
  666. def in_MUTE(self, client, chan, user, duration=0):
  667. SERVERMSG
  668. client.Send('SERVERMSG %s' %(message))
  669. self.Send('SERVERMSG No flooding (over %s per second for %s seconds)' % (bytespersecond, seconds))
  670. self.Send('SERVERMSG message-length limit (%d) exceeded: command \"%s...\" dropped.' % (msg_length_limit, command[0: 8]))
  671. self.out_SERVERMSG(client, '%s failed. Incorrect arguments.' % command)
  672. self.out_SERVERMSG(client, '%s failed. Insufficient rights.' % command, True)
  673. self.out_SERVERMSG(client, '%s failed. Unknown command.' % command, True)
  674.  
  675. def in_UNMUTE(self, client, chan, user):
  676. SERVERMSG
  677. client.Send('SERVERMSG %s' %(message))
  678. self.Send('SERVERMSG No flooding (over %s per second for %s seconds)' % (bytespersecond, seconds))
  679. self.Send('SERVERMSG message-length limit (%d) exceeded: command \"%s...\" dropped.' % (msg_length_limit, command[0: 8]))
  680. self.out_SERVERMSG(client, '%s failed. Incorrect arguments.' % command)
  681. self.out_SERVERMSG(client, '%s failed. Insufficient rights.' % command, True)
  682. self.out_SERVERMSG(client, '%s failed. Unknown command.' % command, True)
  683.  
  684. def in_MUTELIST(self, client, chan):
  685. SERVERMSG
  686. client.Send('SERVERMSG %s' %(message))
  687. self.Send('SERVERMSG No flooding (over %s per second for %s seconds)' % (bytespersecond, seconds))
  688. self.Send('SERVERMSG message-length limit (%d) exceeded: command \"%s...\" dropped.' % (msg_length_limit, command[0: 8]))
  689. self.out_SERVERMSG(client, '%s failed. Incorrect arguments.' % command)
  690. self.out_SERVERMSG(client, '%s failed. Insufficient rights.' % command, True)
  691. self.out_SERVERMSG(client, '%s failed. Unknown command.' % command, True)
  692.  
  693. def in_FORCELEAVECHANNEL(self, client, chan, user, reason=''):
  694. SERVERMSG
  695. client.Send('SERVERMSG %s' %(message))
  696. self.Send('SERVERMSG No flooding (over %s per second for %s seconds)' % (bytespersecond, seconds))
  697. self.Send('SERVERMSG message-length limit (%d) exceeded: command \"%s...\" dropped.' % (msg_length_limit, command[0: 8]))
  698. self.out_SERVERMSG(client, '%s failed. Incorrect arguments.' % command)
  699. self.out_SERVERMSG(client, '%s failed. Insufficient rights.' % command, True)
  700. self.out_SERVERMSG(client, '%s failed. Unknown command.' % command, True)
  701.  
  702. def in_SETCHANNELKEY(self, client, chan, key='*'):
  703. SERVERMSG
  704. client.Send('SERVERMSG %s' %(message))
  705. self.Send('SERVERMSG No flooding (over %s per second for %s seconds)' % (bytespersecond, seconds))
  706. self.Send('SERVERMSG message-length limit (%d) exceeded: command \"%s...\" dropped.' % (msg_length_limit, command[0: 8]))
  707. self.out_SERVERMSG(client, '%s failed. Incorrect arguments.' % command)
  708. self.out_SERVERMSG(client, '%s failed. Insufficient rights.' % command, True)
  709. self.out_SERVERMSG(client, '%s failed. Unknown command.' % command, True)
  710.  
  711. def in_STARTTLS(self, client):
  712. (no response)
  713. client.Send(' '.join((self._root.server, str(self._root.server_version), self._root.min_spring_version, str(self._root.natport), '0')))
  714.  
  715. def in_SAYBATTLE(self, client, msg):
  716. (no response)
  717.  
  718. def in_SAYBATTLEEX(self, client, msg):
  719. (no response)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement