Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def in_PING(self, client, reply=None):
- PONG
- client.Send('PONG %s'%reply)
- client.Send('PONG')
- def in_PORTTEST(self, client, port):
- (no response)
- sock.sendto('Port testing...', (host, port))
- def in_REGISTER(self, client, username, password, email = ""):
- REGISTRATIONACCEPTED REGISTRATIONDENIED
- client.Send("REGISTRATIONDENIED %s" % ("verification failed: " + reason))
- client.Send("REGISTRATIONDENIED %s" % (reason))
- client.Send("REGISTRATIONDENIED invalid nickname")
- client.Send('REGISTRATIONACCEPTED')
- client.Send('REGISTRATIONDENIED %s' % reason)
- def in_LOGIN(self, client, username, password='', cpu='0', local_ip='', sentence_args=''):
- ACCEPTED AGREEMENT AGREEMENTEND CLIENTSTATUS DENIED JOINEDBATTLE LOGIN LOGININFOEND MOTD SAYPRIVATE SERVERMSG UPDATEBATTLEINFO
- client.RealSend("MOTD Your client didn't use tls for logging in, please upgrade it!")
- client.RealSend("MOTD Your client doesn't support the 'cl' compatibility flag, please upgrade it!")
- client.RealSend("MOTD Your client doesn't support the 'p' compatibility flag, please upgrade it!")
- client.RealSend("MOTD Your client doesn't support the 'sp' compatibility flag, please upgrade it!")
- client.RealSend("MOTD see htpp://springrts.com/dl/LobbyProtocol/ProtocolDescription.html#0.37")
- client.RealSend("MOTD see https://springrts.com/dl/LobbyProtocol/ProtocolDescription.html#0.36")
- client.RealSend("MOTD see https://springrts.com/dl/LobbyProtocol/ProtocolDescription.html#0.37")
- client.RealSend('ACCEPTED %s' % client.username)
- client.RealSend('CLIENTSTATUS %s %d' % (addclient.username, addclient.status))
- client.RealSend('JOINEDBATTLE %s %s' % (battle.battle_id, battleclient.username))
- client.RealSend('LOGININFOEND')
- client.RealSend('MOTD %s' % line)
- client.RealSend('UPDATEBATTLEINFO %s %i %i %s %s' % (battle.battle_id, battle.spectators, battle.locked, battle.maphash, battle.map))
- client.RealSend(self.client_AddBattle(client, battle))
- client.RealSend(self.client_AddUser(client, addclient))
- client.Send("AGREEMENT ")
- client.Send("AGREEMENT %s" %(line))
- 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.")
- client.Send("DENIED %s" %(reason))
- 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")
- 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.")
- client.Send('AGREEMENTEND')
- client.Send('SERVERMSG %s' %(message))
- receiver.Send(self.client_AddUser(receiver, client))
- self._root.broadcast('CLIENTSTATUS %s %d'%(client.username, client.status)) # broadcast current client status
- self._root.broadcast(message, self.name, ignore, None, flag)
- self.out_DENIED(client, client.username, 'Already logged in.', False)
- self.out_DENIED(client, username, "Too many failed logins.")
- self.out_DENIED(client, username, "invalid lobby_id")
- self.out_DENIED(client, username, "invalid nickname")
- self.out_DENIED(client, username, "lobby_id is to long (max=64 chars)")
- self.out_DENIED(client, username, 'Already logged in.', False)
- self.out_DENIED(client, username, reason)
- self.out_SERVERMSG(client, "invalid status: %s: %s, decoded: %s" %(_status,rank, status), True)
- self.out_SERVERMSG(client, 'Invalid userID specified: %s' % (user_id), True)
- self.out_SERVERMSG(client, 'Unsupported/unknown compatibility flag(s) in LOGIN: %s' % (unsupported), True)
- def in_CONFIRMAGREEMENT(self, client, verification_code = ""):
- ACCEPTED CLIENTSTATUS DENIED JOINEDBATTLE LOGININFOEND MOTD SAYPRIVATE SERVERMSG UPDATEBATTLEINFO
- client.RealSend("MOTD Your client didn't use tls for logging in, please upgrade it!")
- client.RealSend("MOTD Your client doesn't support the 'cl' compatibility flag, please upgrade it!")
- client.RealSend("MOTD Your client doesn't support the 'p' compatibility flag, please upgrade it!")
- client.RealSend("MOTD Your client doesn't support the 'sp' compatibility flag, please upgrade it!")
- client.RealSend("MOTD see htpp://springrts.com/dl/LobbyProtocol/ProtocolDescription.html#0.37")
- client.RealSend("MOTD see https://springrts.com/dl/LobbyProtocol/ProtocolDescription.html#0.36")
- client.RealSend("MOTD see https://springrts.com/dl/LobbyProtocol/ProtocolDescription.html#0.37")
- client.RealSend('ACCEPTED %s' % client.username)
- client.RealSend('CLIENTSTATUS %s %d' % (addclient.username, addclient.status))
- client.RealSend('JOINEDBATTLE %s %s' % (battle.battle_id, battleclient.username))
- client.RealSend('LOGININFOEND')
- client.RealSend('MOTD %s' % line)
- client.RealSend('UPDATEBATTLEINFO %s %i %i %s %s' % (battle.battle_id, battle.spectators, battle.locked, battle.maphash, battle.map))
- client.RealSend(self.client_AddBattle(client, battle))
- client.RealSend(self.client_AddUser(client, addclient))
- client.Send("DENIED %s" %(reason))
- 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")
- 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.")
- client.Send('SERVERMSG %s' %(message))
- receiver.Send(self.client_AddUser(receiver, client))
- self._root.broadcast('CLIENTSTATUS %s %d'%(client.username, client.status)) # broadcast current client status
- self._root.broadcast(message, self.name, ignore, None, flag)
- self.out_DENIED(client, client.username, reason)
- self.out_SERVERMSG(client, "invalid status: %s: %s, decoded: %s" %(_status,rank, status), True)
- def in_SAY(self, client, chan, msg):
- CHANNELMESSAGE SAID SAIDBATTLE SAY
- client.Send('CHANNELMESSAGE %s You are %s.' % (chan, channel.getMuteMessage(client)))
- client.Send('FAILED ' + self._dictToTags({'msg':message, 'cmd':cmd}))
- self._root.broadcast('SAID %s %s %s' % (chan, client.username, msg), chan, set([]), client)
- self._root.broadcast(message, self.name, ignore, None, flag)
- self.broadcast_SendBattle(battle, 'SAIDBATTLE %s %s' % (client.username, msg), client)
- self.out_FAILED(client, "SAY", "Not present in channel", True)
- self.out_FAILED(sourceClient, "SAY", "You are muted in this battle until %s!" %(enddate))
- def in_SAYEX(self, client, chan, msg):
- CHANNELMESSAGE SAIDBATTLEEX SAIDEX SAY SAYEX
- client.Send('CHANNELMESSAGE %s You are %s.' % (chan, channel.getMuteMessage(client)))
- client.Send('FAILED ' + self._dictToTags({'msg':message, 'cmd':cmd}))
- self._root.broadcast('SAIDEX %s %s %s' % (chan, client.username, msg), chan, set([]), client)
- self._root.broadcast(message, self.name, ignore, None, flag)
- self.broadcast_SendBattle(battle, 'SAIDBATTLEEX %s %s' % (client.username, msg), client)
- self.out_FAILED("SAYEX", "use SAY action=yes")
- self.out_FAILED(sourceClient, "SAY", "You are muted in this battle until %s!" %(enddate))
- def in_SAYPRIVATE(self, client, user, msg):
- SAIDPRIVATE SAYPRIVATE
- client.Send('SAYPRIVATE %s %s' % (user, msg))
- receiver.Send('SAIDPRIVATE %s %s' % (client.username, msg))
- def in_SAYPRIVATEEX(self, client, user, msg):
- SAIDPRIVATEEX SAYPRIVATEEX
- client.Send('SAYPRIVATEEX %s %s' % (user, msg))
- receiver.Send('SAIDPRIVATEEX %s %s' % (client.username, msg))
- def in_BRIDGECLIENTFROM(self, client, location, external_id, external_username):
- BRIDGECLIENTFROM BRIDGEDCLIENTFROM SERVERMSG
- client.Send("BRIDGEDCLIENTFROM %s %s %s" % (bridgedClient.location, bridgedClient.external_id, bridgedClient.external_username))
- client.Send('FAILED ' + self._dictToTags({'msg':message, 'cmd':cmd}))
- client.Send('SERVERMSG %s' %(message))
- self.out_FAILED(client, "BRIDGECLIENTFROM", "Invalid syntax: %s", True)
- self.out_FAILED(client, "BRIDGECLIENTFROM", "Only bot users can bridge clients", True)
- self.out_FAILED(client, "BRIDGECLIENTFROM", "The location '%s' is already in use by bridge bot %s" % existing_bridge.username, True)
- self.out_FAILED(client, "BRIDGECLIENTFROM", "This client already exists on the bridge (external_id=%s)" % response.external_id, True)
- self.out_FAILED(client, "BRIDGECLIENTFROM", "You cannot bridge a location named after another bot user", True)
- self.out_FAILED(client, "BRIDGECLIENTFROM", "You need the 'u' compatibility flag to bridge clients", True)
- self.out_FAILED(client, "BRIDGECLIENTFROM", response, True)
- self.out_SERVERMSG(client, "You are now the bridge bot for location '%s'" % location)
- def in_UNBRIDGECLIENTFROM(self, client, location, external_id):
- UNBRIDGECLIENTFROM UNBRIDGEDCLIENTFROM
- client.Send("UNBRIDGEDCLIENTFROM %s %s" % (bridgedClient.location, bridgedClient.external_id))
- client.Send('FAILED ' + self._dictToTags({'msg':message, 'cmd':cmd}))
- self.out_FAILED(client, "UNBRIDGECLIENTFROM", "Bridged client is on a different bridge (got %i, expected %i)" % (bridgedClient.bridge_user_id, client.user_id), True)
- self.out_FAILED(client, "UNBRIDGECLIENTFROM", "Bridged client not found", True)
- def in_JOINFROM(self, client, chan, location, external_id):
- JOINEDFROM JOINFROM UNBRIDGECLIENTFROM
- client.Send('FAILED ' + self._dictToTags({'msg':message, 'cmd':cmd}))
- self._root.broadcast(message, self.name, ignore, None, flag)
- self.broadcast('JOINEDFROM %s %s' % (self.name, bridgedClient.username), set(), 'u')
- self.out_FAILED(client, "JOINFROM", "Bridged user is banned from channel", True)
- self.out_FAILED(client, "JOINFROM", "Bridged user not found", True)
- self.out_FAILED(client, "JOINFROM", "Channel '%s' not found" % chan, True)
- self.out_FAILED(client, "UNBRIDGECLIENTFROM", "Bridged client is on a different bridge (got %i, expected %i)" % (bridgedClient.bridge_user_id, client.user_id), True)
- def in_LEAVEFROM(self, client, chan, location, external_id):
- JOINFROM LEAVEFROM LEFTFROM UNBRIDGECLIENTFROM
- client.Send('FAILED ' + self._dictToTags({'msg':message, 'cmd':cmd}))
- self._root.broadcast(message, self.name, ignore, None, flag)
- self.broadcast('LEFTFROM %s %s %s' % (self.name, bridgedClient.username, reason), set(), 'u')
- self.out_FAILED(client, "JOINFROM", "Bridged user not found", True)
- self.out_FAILED(client, "LEAVEFROM", "Channel '%s' not found" % chan, True)
- self.out_FAILED(client, "UNBRIDGECLIENTFROM", "Bridged client is on a different bridge (got %i, expected %i)" % (bridgedClient.bridge_user_id, client.user_id), True)
- def in_SAYFROM(self, client, chan, location, external_id, msg):
- SAIDFROM SAYFROM
- client.Send('FAILED ' + self._dictToTags({'msg':message, 'cmd':cmd}))
- self._root.broadcast('SAIDFROM %s %s %s' % (chan, bridgedClient.username, msg), chan, set([]), client)
- self._root.broadcast(message, self.name, ignore, None, flag)
- self.out_FAILED(client, "SAYFROM", "Bridged user not present in channel", True)
- def in_IGNORE(self, client, tags):
- IGNORE SERVERMSG
- client.Send('IGNORE userName=%s' % (username))
- client.Send('IGNORE userName=%s\treason=%s' % (username, reason))
- client.Send('SERVERMSG %s' %(message))
- self.out_SERVERMSG(client, "Can't ignore a moderator.")
- self.out_SERVERMSG(client, "Can't ignore self.")
- self.out_SERVERMSG(client, "Ignore list full (50 users).")
- self.out_SERVERMSG(client, "Invalid userName format.")
- self.out_SERVERMSG(client, "Missing userName argument.")
- self.out_SERVERMSG(client, "No such user.")
- self.out_SERVERMSG(client, "User is already ignored.")
- def in_UNIGNORE(self, client, tags):
- SERVERMSG UNIGNORE
- client.Send('SERVERMSG %s' %(message))
- client.Send('UNIGNORE userName=%s' % (username))
- self.out_SERVERMSG(client, "Invalid userName format.")
- self.out_SERVERMSG(client, "Missing userName argument.")
- self.out_SERVERMSG(client, "No such user.")
- self.out_SERVERMSG(client, "User is not ignored.")
- def in_IGNORELIST(self, client):
- IGNORELIST IGNORELISTBEGIN IGNORELISTEND
- client.Send('IGNORELIST userName=%s' % (username))
- client.Send('IGNORELIST userName=%s\treason=%s' % (username, reason))
- client.Send('IGNORELISTBEGIN')
- client.Send('IGNORELISTEND')
- def in_FRIENDREQUEST(self, client, tags):
- FRIENDREQUEST SERVERMSG
- client.Send('SERVERMSG %s' %(message))
- friendRequestClient.Send('FRIENDREQUEST userName=%s' % client.username)
- friendRequestClient.Send('FRIENDREQUEST userName=%s\tmsg=%s' % (client.username, msg))
- self.out_SERVERMSG(client, "Already friends with user.")
- self.out_SERVERMSG(client, "Can't send friend request to self. Sorry :(")
- self.out_SERVERMSG(client, "Invalid userName format.")
- self.out_SERVERMSG(client, "Missing userName argument.")
- self.out_SERVERMSG(client, "No such user.")
- def in_ACCEPTFRIENDREQUEST(self, client, tags):
- FRIEND SERVERMSG
- client.Send('FRIEND userName=%s' % username)
- client.Send('SERVERMSG %s' %(message))
- friendRequestClient.Send('FRIEND userName=%s' % client.username)
- self.out_SERVERMSG(client, "Invalid userName format.")
- self.out_SERVERMSG(client, "Missing userName argument.")
- self.out_SERVERMSG(client, "No such friend request.")
- def in_DECLINEFRIENDREQUEST(self, client, tags):
- SERVERMSG
- client.Send('SERVERMSG %s' %(message))
- self.out_SERVERMSG(client, "Invalid userName format.")
- self.out_SERVERMSG(client, "Missing userName argument.")
- self.out_SERVERMSG(client, "No such friend request.")
- def in_UNFRIEND(self, client, tags):
- SERVERMSG UNFRIEND
- client.Send('SERVERMSG %s' %(message))
- client.Send('UNFRIEND userName=%s' % username)
- friendRequestClient.Send('UNFRIEND userName=%s' % client.username)
- self.out_SERVERMSG(client, "Invalid userName format.")
- self.out_SERVERMSG(client, "Missing userName argument.")
- def in_FRIENDREQUESTLIST(self, client):
- FRIENDREQUESTLIST FRIENDREQUESTLISTBEGIN FRIENDREQUESTLISTEND
- client.Send('FRIENDREQUESTLIST userName=%s' % (username))
- client.Send('FRIENDREQUESTLIST userName=%s\tmsg=%s' % (username, msg))
- client.Send('FRIENDREQUESTLISTBEGIN')
- client.Send('FRIENDREQUESTLISTEND')
- def in_FRIENDLIST(self, client):
- FRIENDLIST FRIENDLISTBEGIN FRIENDLISTEND
- client.Send('FRIENDLIST userName=%s' % (username))
- client.Send('FRIENDLISTBEGIN')
- client.Send('FRIENDLISTEND')
- def in_JOIN(self, client, chan, key=None):
- CHANNELTOPIC CLIENTS CLIENTSFROM JOIN JOINBATTLE JOINED JOINFAILED NOCHANNELTOPIC
- client.Send('CHANNELTOPIC %s %s %s %s'%(self.name, topic['user'], topictime, top))
- client.Send('CLIENTS %s %s' % (self.name, clientlist))
- client.Send('CLIENTSFROM %s %s' % (self.name, bridgedClientList))
- client.Send('FAILED ' + self._dictToTags({'msg':message, 'cmd':cmd}))
- client.Send('JOIN %s' % self.name) #superfluous, could deprecate
- client.Send('JOINFAILED %s Invalid key' % chan)
- client.Send('JOINFAILED %s You are banned from the channel (%s)' % (chan, channel.ban[client.user_id].reason))
- client.Send('JOINFAILED %s Your ip is banned from the channel (%s)' % (chan, channel.ban[client.user_id].reason))
- client.Send('JOINFAILED %s is a battle, please use JOINBATTLE to access it' % chan)
- client.Send('JOINFAILED %s' % reason)
- client.Send('NOCHANNELTOPIC %s' % self.name)
- self._root.broadcast(message, self.name, ignore, None, flag)
- self.broadcast('JOINED %s %s' % (self.name, client.username))
- self.out_FAILED(client, "JOIN", "Only moderators allowed in this channel! access=%s" %(client.access), True)
- self.out_FAILED(client, 'JOIN', 'Invalid channel: %s' %(chan), True)
- self.out_FAILED(client, 'JOIN', 'cannot create channel %s with prefix __battle__, these names are reserved for battles' % chan, True)
- def in_LEAVE(self, client, chan, reason=None):
- LEAVE LEAVEBATTLE LEFT
- client.Send('FAILED ' + self._dictToTags({'msg':message, 'cmd':cmd}))
- client.Send('LEFT %s %s' % (self.name, client.username))
- self._root.broadcast(message, self.name, ignore, None, flag)
- self.broadcast('LEFT %s %s %s' % (self.name, client.username, reason))
- self.broadcast('LEFT %s %s' % (self.name, client.username))
- self.out_FAILED(client, 'LEAVE', '%s is a battle, use LEAVEBATTLE to leave it' % chan, True)
- self.out_FAILED(client, 'LEAVE', 'not in channel %s' % chan, True)
- def in_OPENBATTLE(self, client, type, natType, key, port, maxplayers, hashcode, rank, maphash, sentence_args):
- JOINBATTLE OPENBATTLE OPENBATTLEFAILED REQUESTBATTLESTATUS SERVERMSG
- client.Send('JOINBATTLE %s %s' % (battle.battle_id, hashcode))
- client.Send('OPENBATTLE %s' % battle.battle_id)
- client.Send('OPENBATTLEFAILED %s' % (reason))
- client.Send('REQUESTBATTLESTATUS')
- client.Send('SERVERMSG %s' %(message))
- client.Send(self.client_AddBattle(client, battle))
- self.out_OPENBATTLEFAILED(client, "Engine version specified is invalid: Spring %s or later is required!" % self._root.min_spring_version)
- 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' %
- self.out_OPENBATTLEFAILED(client, 'Invalid game hash 0')
- self.out_OPENBATTLEFAILED(client, 'Port is out of range: 1-65535: %d' % port)
- self.out_OPENBATTLEFAILED(client, 'To few arguments: %d' %(argcount))
- self.out_OPENBATTLEFAILED(client, error)
- 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))
- def in_JOINBATTLE(self, client, battle_id, key=None, scriptPassword=None):
- JOINBATTLEFAILED
- client.Send('JOINBATTLEFAILED Battle does not exist')
- client.Send('JOINBATTLEFAILED Battle is locked')
- client.Send('JOINBATTLEFAILED Client is already in battle')
- client.Send('JOINBATTLEFAILED Incorrect password')
- client.Send('JOINBATTLEFAILED Invalid battle id: %s.' %(str(battle_id)))
- client.Send('JOINBATTLEFAILED You are already in a battle')
- client.Send('JOINBATTLEFAILED You are banned from the battle')
- def in_SETSCRIPTTAGS(self, client, scripttags):
- SETSCRIPTTAGS
- client.Send('FAILED ' + self._dictToTags({'msg':message, 'cmd':cmd}))
- self._root.broadcast_battle('SETSCRIPTTAGS %s'%'\t'.join(scripttags), client.current_battle)
- self.out_FAILED(client, "SETSCRIPTTAGS", "You are not allowed to change settings in this battle", True)
- def in_REMOVESCRIPTTAGS(self, client, tags):
- REMOVESCRIPTTAGS
- client.Send('FAILED ' + self._dictToTags({'msg':message, 'cmd':cmd}))
- self._root.broadcast_battle('REMOVESCRIPTTAGS %s'%' '.join(rem), client.current_battle)
- self.out_FAILED(client, "REMOVESCRIPTTAGS", "You are not allowed to change settings in this battle", True)
- def in_LEAVEBATTLE(self, client):
- BATTLECLOSED LEAVEBATTLE
- client.Send('BATTLECLOSED %s' % battle.battle_id)
- client.Send('FAILED ' + self._dictToTags({'msg':message, 'cmd':cmd}))
- self.out_FAILED(client, "LEAVEBATTLE", "couldn't find battle")
- self.out_FAILED(client, "LEAVEBATTLE", "not in battle")
- def in_MYBATTLESTATUS(self, client, _battlestatus, _myteamcolor):
- MYBATTLESTATUS UPDATEBATTLEINFO
- client.Send('FAILED ' + self._dictToTags({'msg':message, 'cmd':cmd}))
- client.Send(statuscmd)
- self._root.broadcast('UPDATEBATTLEINFO %s %i %i %s %s' % (battle.battle_id, battle.spectators, battle.locked, battle.maphash, battle.map))
- self._root.broadcast(message, self.name, ignore, None, flag)
- self._root.broadcast_battle(statuscmd, battle.battle_id)
- self.out_FAILED(client, "MYBATTLESTATUS", "not inside a battle", True)
- self.out_FAILED(client, 'MYBATTLESTATUS', 'invalid status is below 0: %s. Please update your lobby!' % (_battlestatus), True)
- self.out_FAILED(client, 'MYBATTLESTATUS', 'invalid teamcolor: %s.' % (myteamcolor), True)
- self.out_FAILED(client, 'MYBATTLESTATUS','invalid status: %s.' % (_battlestatus), True)
- def in_UPDATEBATTLEINFO(self, client, SpectatorCount, locked, maphash, mapname):
- SERVERMSG UPDATEBATTLEINFO
- client.Send('SERVERMSG %s' %(message))
- self._root.broadcast(message, self.name, ignore, None, flag)
- self._root.broadcast(newstr)
- self.out_SERVERMSG(client, "UPDATEBATTLEINFO failed - Invalid map hash send: %s %s " %(str(mapname),str(maphash)), True)
- self.out_SERVERMSG(client, "UPDATEBATTLEINFO failed - invalid mapname send: %s" %(str(mapname)), True)
- def in_MYSTATUS(self, client, _status):
- CLIENTSTATUS HOSTPORT MYSTATUS SERVERMSG
- client.Send('FAILED ' + self._dictToTags({'msg':message, 'cmd':cmd}))
- client.Send('SERVERMSG %s' %(message))
- self._root.broadcast('CLIENTSTATUS %s %d'%(client.username, client.status))
- self._root.broadcast(message, self.name, ignore, None, flag)
- self._root.broadcast_battle('HOSTPORT %i' % client.hostport, battle.battle_id, host)
- self.out_FAILED(client, 'MYSTATUS', 'ingame but no battleid set', True)
- self.out_FAILED(client, 'MYSTATUS', 'invalid status %s'%(_status), True)
- self.out_SERVERMSG(client, "invalid status: %s: %s, decoded: %s" %(_status,rank, status), True)
- def in_CHANNELS(self, client):
- CHANNEL ENDOFCHANNELS
- client.Send('CHANNEL %s %d %s'% (channel.name, len(channel.users), top))
- client.Send('ENDOFCHANNELS')
- def in_CHANNELTOPIC(self, client, chan, topic):
- CHANNELMESSAGE CHANNELTOPIC
- self._root.broadcast(message, self.name, ignore, None, flag)
- self.broadcast('CHANNELMESSAGE %s %s' % (self.name, message))
- self.broadcast('CHANNELMESSAGE %s %s' % (self.name, message), set(), 'u')
- self.broadcast('CHANNELTOPIC %s %s %s %s'%(self.name, client.username, topicdict['time'], topic), set())
- self.broadcast('CHANNELTOPIC %s %s %s %s'%(self.name, client.username, topicdict['time'], topic), set(), 'u')
- self.channelMessage('Topic changed.')
- self.channelMessage('Topic disabled.')
- def in_GETCHANNELMESSAGES(self, client, chan, lastid):
- GETCHANNELMESSAGES SAID
- client.Send('FAILED ' + self._dictToTags({'msg':message, 'cmd':cmd}))
- client.Send('JSON ' + json.dumps({cmd: dict}, separators=(',', ':')))
- self.out_FAILED(client, "GETCHANNELMESSAGES", "Can't get channel messages when not joined", True)
- self.out_FAILED(client, "GETCHANNELMESSAGES", "Invalid id", True)
- self.out_JSON(client, 'SAID', {"chanName": chan, "time": str(datetime_totimestamp(msg[0])), "userName": msg[1], "msg": msg[2], "id": msg[3]})
- def in_RING(self, client, username):
- RING
- user.Send('RING %s' % (client.username))
- def in_ADDSTARTRECT(self, client, allyno, left, top, right, bottom):
- ADDSTARTRECT SERVERMSG
- client.Send('SERVERMSG %s' %(message))
- self._root.broadcast_battle('ADDSTARTRECT %s' % (allyno)+' %(left)s %(top)s %(right)s %(bottom)s' %(rect), client.current_battle)
- self.out_SERVERMSG(client, "invalid ADDSTARTRECT received")
- def in_REMOVESTARTRECT(self, client, allyno):
- REMOVESTARTRECT SERVERMSG
- client.Send('SERVERMSG %s' %(message))
- self._root.broadcast_battle('REMOVESTARTRECT %s' % allyno, client.current_battle)
- self.out_SERVERMSG(client, 'invalid rect removed: %d' % (allyno), True)
- def in_DISABLEUNITS(self, client, units):
- DISABLEUNITS
- self._root.broadcast_battle('DISABLEUNITS %s'%disabled_units, client.current_battle)
- def in_ENABLEUNITS(self, client, units):
- ENABLEUNITS
- self._root.broadcast_battle('ENABLEUNITS %s'%enabled_units, battle_id, client.username)
- def in_ENABLEALLUNITS(self, client):
- ENABLEALLUNITS
- self._root.broadcast_battle('ENABLEALLUNITS', client.current_battle)
- def in_HANDICAP(self, client, username, value):
- CLIENTBATTLESTATUS
- self._root.broadcast_battle('CLIENTBATTLESTATUS %s %s %s'%(username, battle.calc_battlestatus(user), user.teamcolor), user.current_battle)
- def in_KICKFROMBATTLE(self, client, username):
- FORCEQUITBATTLE
- user.Send('FORCEQUITBATTLE %s' %(client.username))
- def in_FORCETEAMNO(self, client, username, teamno):
- CLIENTBATTLESTATUS
- self._root.broadcast_battle('CLIENTBATTLESTATUS %s %s %s'%(username, battle.calc_battlestatus(user), user.teamcolor), user.current_battle)
- def in_FORCEALLYNO(self, client, username, allyno):
- CLIENTBATTLESTATUS
- self._root.broadcast_battle('CLIENTBATTLESTATUS %s %s %s'%(username, battle.calc_battlestatus(user), user.teamcolor), user.current_battle)
- def in_FORCETEAMCOLOR(self, client, username, teamcolor):
- CLIENTBATTLESTATUS
- self._root.broadcast_battle('CLIENTBATTLESTATUS %s %s %s'%(username, battle.calc_battlestatus(user), user.teamcolor), user.current_battle)
- def in_FORCESPECTATORMODE(self, client, username):
- CLIENTBATTLESTATUS UPDATEBATTLEINFO
- self._root.broadcast('UPDATEBATTLEINFO %s %i %i %s %s' %(battle.battle_id, battle.spectators, battle.locked, battle.maphash, battle.map))
- self._root.broadcast(message, self.name, ignore, None, flag)
- self._root.broadcast_battle('CLIENTBATTLESTATUS %s %s %s'%(username, battle.calc_battlestatus(user), user.teamcolor), user.current_battle)
- def in_ADDBOT(self, client, name, battlestatus, teamcolor, AIDLL):
- ADDBOT AIDLL
- client.Send('FAILED ' + self._dictToTags({'msg':message, 'cmd':cmd}))
- self._root.broadcast_battle('ADDBOT %s %s %s %s %s %s'%(battle.battle_id, name, client.username, battlestatus, teamcolor, AIDLL), battle.battle_id)
- self.out_FAILED(client, "ADDBOT", "Bot already exists!", True)
- self.out_FAILED(client, "ADDBOT", "Couldn't find battle", True)
- def in_UPDATEBOT(self, client, name, battlestatus, teamcolor):
- UPDATEBOT
- client.Send('FAILED ' + self._dictToTags({'msg':message, 'cmd':cmd}))
- self._root.broadcast_battle('UPDATEBOT %s %s %s %s'%(battle.battle_id, name, battlestatus, teamcolor), battle.battle_id)
- self.out_FAILED(client, "UPDATEBOT", "Couldn't find battle", True)
- def in_REMOVEBOT(self, client, name):
- REMOVEBOT
- client.Send('FAILED ' + self._dictToTags({'msg':message, 'cmd':cmd}))
- self._root.broadcast_battle('REMOVEBOT %s %s'%(battle.battle_id, name), battle.battle_id)
- self.out_FAILED(client, "REMOVEBOT", "Couldn't find battle", True)
- def in_GETINGAMETIME(self, client, username=None):
- GETINGAMETIME SERVERMSG
- client.Send('FAILED ' + self._dictToTags({'msg':message, 'cmd':cmd}))
- client.Send('SERVERMSG %s' %(message))
- self.out_FAILED(client,'GETINGAMETIME', 'access denied')
- self.out_FAILED(client,'GETINGAMETIME', 'user not found / offline')
- self.out_SERVERMSG(client, '<%s> has an ingame time of %d minutes (%d hours).'%(username, ingame_time, ingame_time / 60))
- self.out_SERVERMSG(client,'Your ingame time is %d minutes (%d hours).'%(ingame_time, ingame_time / 60))
- def in_GETLASTLOGINTIME(self, client, username):
- SERVERMSG
- client.Send('SERVERMSG %s' %(message))
- else: self.out_SERVERMSG(client, 'Database returned error when retrieving last login time for <%s> (%s)' % (username, data))
- if good: self.out_SERVERMSG(client, '<%s> last logged in on %s.' % (username, data.isoformat()))
- def in_GETREGISTRATIONDATE(self, client, username=None):
- GETREGISTRATIONDATE SERVERMSG
- client.Send('FAILED ' + self._dictToTags({'msg':message, 'cmd':cmd}))
- client.Send('SERVERMSG %s' %(message))
- self.out_FAILED(client, "GETREGISTRATIONDATE", "permission denied")
- self.out_FAILED(client, "GETREGISTRATIONDATE", "user not found / offline")
- self.out_SERVERMSG(client, '<%s> registered on %s.' % (username, client.register_date.isoformat()))
- self.out_SERVERMSG(client, '<%s> registered on %s.' % (username, regdate.isoformat()))
- def in_GETUSERID(self, client, username):
- SERVERMSG
- client.Send('SERVERMSG %s' %(message))
- self.out_SERVERMSG(client, 'The ID for <%s> is %s' % (username, user.last_id))
- self.out_SERVERMSG(client, 'User not found.')
- def in_GETACCOUNTACCESS(self, client, username):
- SERVERMSG
- client.Send('SERVERMSG %s' %(message))
- self.out_SERVERMSG(client, 'Account access for <%s>: %s' % (username, data))
- self.out_SERVERMSG(client, 'Database returned error when retrieving account access for <%s> (%s)' % (username, data))
- def in_FINDIP(self, client, address):
- SERVERMSG
- client.Send('SERVERMSG %s' %(message))
- self.out_SERVERMSG(client, '<%s> is currently bound to %s.' % (entry.username, address))
- self.out_SERVERMSG(client, '<%s> was recently bound to %s at %s' % (entry.username, address, lastlogin))
- def in_GETIP(self, client, username):
- SERVERMSG
- client.Send('SERVERMSG %s' %(message))
- self.out_SERVERMSG(client, '<%s> is currently bound to %s' % (username, ip))
- self.out_SERVERMSG(client, '<%s> was recently bound to %s' % (username, ip))
- def in_RENAMEACCOUNT(self, client, newname):
- RENAMEACCOUNT SERVERMSG
- client.Send('FAILED ' + self._dictToTags({'msg':message, 'cmd':cmd}))
- client.Send('SERVERMSG %s' %(message))
- self.out_FAILED(client, "RENAMEACCOUNT", "invalid nickname: %s" %(newname), True)
- self.out_SERVERMSG(client, '%s' %(reason))
- self.out_SERVERMSG(client, 'Failed to rename to <%s>: %s' % (newname, reason))
- self.out_SERVERMSG(client, 'You already have that username.')
- self.out_SERVERMSG(client, 'Your account has been renamed to <%s>. Reconnect with the new username (you will now be automatically disconnected).' % newname)
- def in_CHANGEPASSWORD(self, client, cur_password, new_password):
- SERVERMSG
- client.Send('SERVERMSG %s' %(message))
- self.out_SERVERMSG(client, '%s' % reason)
- self.out_SERVERMSG(client, 'Incorrect old password.')
- self.out_SERVERMSG(client, 'Password changed successfully! It will be used at the next login!')
- def in_GETLOBBYVERSION(self, client, username):
- SERVERMSG
- client.Send('SERVERMSG %s' %(message))
- self.out_SERVERMSG(client, '<%s> is using %s'%(user.username, user.lobby_id))
- def in_SETBOTMODE(self, client, username, mode):
- CLIENTSTATUS SERVERMSG
- client.Send('SERVERMSG %s' %(message))
- self._root.broadcast('CLIENTSTATUS %s %d'%(client.username, client.status))
- self._root.broadcast(message, self.name, ignore, None, flag)
- self.out_SERVERMSG(client, "invalid status: %s: %s, decoded: %s" %(_status,rank, status), True)
- self.out_SERVERMSG(client, 'Botmode for <%s> successfully changed to %s' % (username, bot))
- def in_CHANGEACCOUNTPASS(self, client, username, newpass):
- SERVERMSG
- client.Send('SERVERMSG %s' %(message))
- self.out_SERVERMSG(client, "Password for user %s can not be changed." % username)
- self.out_SERVERMSG(client, "invalid password specified: %s" %(reason))
- self.out_SERVERMSG(client, 'Password for <%s> successfully changed to %s' % (username, newpass))
- self.out_SERVERMSG(client, 'You have insufficient access to change moderator passwords.')
- def in_BROADCAST(self, client, msg):
- BROADCAST
- self._root.broadcast('BROADCAST %s'%msg)
- self._root.broadcast(message, self.name, ignore, None, flag)
- def in_BROADCASTEX(self, client, msg):
- SERVERMSGBOX
- self._root.broadcast('SERVERMSGBOX %s'%msg)
- self._root.broadcast(message, self.name, ignore, None, flag)
- def in_ADMINBROADCAST(self, client, msg):
- (no response)
- self._root.admin_broadcast(msg)
- def in_SETMINSPRINGVERSION(self, client, version):
- BATTLECLOSED SAIDBATTLEEX SAY
- client.Send('BATTLECLOSED %s' % battle.battle_id)
- client.Send('FAILED ' + self._dictToTags({'msg':message, 'cmd':cmd}))
- 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))
- self.out_FAILED(sourceClient, "SAY", "You are muted in this battle until %s!" %(enddate))
- def in_KICK(self, client, username, reason=''):
- SERVERMSG
- client.Send('SERVERMSG %s' %(message))
- self.out_SERVERMSG(client, 'Kicked <%s> from the server' % username)
- self.out_SERVERMSG(client, 'User <%s> was not online' % username)
- self.out_SERVERMSG(kickeduser, 'You were kicked from the server (%s)' % (reason))
- def in_EXIT(self, client, reason=('Exiting')):
- (no response)
- def in_LISTCOMPFLAGS(self, client):
- COMPFLAGS
- client.Send("COMPFLAGS %s" %(flags))
- def in_BAN(self, client, username, duration, reason):
- SERVERMSG
- client.Send('SERVERMSG %s' %(message))
- if response: self.out_SERVERMSG(client, '%s' % response)
- def in_BANSPECIFIC(self, client, arg, duration, reason):
- SERVERMSG
- client.Send('SERVERMSG %s' %(message))
- if response: self.out_SERVERMSG(client, '%s' % response)
- def in_UNBAN(self, client, arg):
- SERVERMSG
- client.Send('SERVERMSG %s' %(message))
- if response: self.out_SERVERMSG(client, '%s' % response)
- def in_BLACKLIST(self, client, domain, reason=""):
- SERVERMSG
- client.Send('SERVERMSG %s' %(message))
- if response: self.out_SERVERMSG(client, '%s' % response)
- def in_UNBLACKLIST(self, client, domain):
- SERVERMSG
- client.Send('SERVERMSG %s' %(message))
- if response: self.out_SERVERMSG(client, '%s' % response)
- def in_LISTBANS(self, client):
- SERVERMSG
- client.Send('SERVERMSG %s' %(message))
- self.out_SERVERMSG(client, "%s, %s, %s :: '%s' :: ends %s (%s)" % (entry['username'], entry['ip'], entry['email'], entry['reason'], entry['end_date'], entry['issuer']))
- self.out_SERVERMSG(client, '-- Banlist --')
- self.out_SERVERMSG(client, '-- End Banlist --')
- self.out_SERVERMSG(client, 'Banlist is empty')
- def in_LISTBLACKLIST(self, client):
- SERVERMSG
- client.Send('SERVERMSG %s' %(message))
- self.out_SERVERMSG(client, "%s :: '%s' (%s)" % (entry['domain'], entry['reason'], entry['issuer']))
- self.out_SERVERMSG(client, '-- Blacklist --')
- self.out_SERVERMSG(client, '-- End Blacklist--')
- self.out_SERVERMSG(client, 'Blacklist is empty')
- def in_SETACCESS(self, client, username, access):
- CLIENTSTATUS SERVERMSG SETACCESS UNIGNORE
- client.Send('OK ' + self._dictToTags({'cmd': cmd}))
- client.Send('SERVERMSG %s' %(message))
- self._root.broadcast('CLIENTSTATUS %s %d' % (username, user.status))
- self._root.broadcast(message, self.name, ignore, None, flag)
- self.out_OK(client, "SETACCESS")
- self.out_SERVERMSG(client, "Invalid access mode, only user, mod, admin is valid.")
- self.out_SERVERMSG(client, "User not found.")
- self.out_SERVERMSG(client, "invalid status: %s: %s, decoded: %s" %(_status,rank, status), True)
- userThatIgnored.Send('UNIGNORE userName=%s' % (username))
- def in_RELOAD(self, client):
- SERVERMSG
- client.Send('SERVERMSG %s' %(message))
- self.out_SERVERMSG(client, 'Reload failed!')
- self.out_SERVERMSG(client, 'Reload successful')
- def in_CLEANUP(self, client):
- (no response)
- self._root.admin_broadcast('Cleanup initiated by %s (deleting old users, zombie channels / users)...' %(client.username))
- def in_CHANGEEMAILREQUEST(self, client, newmail):
- CHANGEEMAILREQUESTACCEPTED CHANGEEMAILREQUESTDENIED SERVERMSG
- client.Send("CHANGEEMAILREQUESTACCEPTED")
- client.Send("CHANGEEMAILREQUESTDENIED " + reason)
- client.Send("CHANGEEMAILREQUESTDENIED email verification is currently turned off, a blank verification code will be accepted!")
- client.Send('SERVERMSG %s' %(message))
- self.out_SERVERMSG(client, "compatibility flag cl needed")
- def in_CHANGEEMAIL(self, client, newmail, verification_code=""):
- CHANGEEMAILACCEPTED CHANGEEMAILDENIED SERVERMSG
- client.Send("CHANGEEMAILACCEPTED " + newmail)
- client.Send("CHANGEEMAILDENIED " + reason)
- client.Send('SERVERMSG %s' %(message))
- self.out_SERVERMSG(client, "Your email address has been changed to " + client.email)
- self.out_SERVERMSG(client, "compatibility flag cl needed")
- def in_CHANGEACCOUNTEMAIL(self, client, username, newmail):
- SERVERMSG
- client.Send('SERVERMSG %s' %(message))
- self.out_SERVERMSG(client,"access denied")
- self.out_SERVERMSG(client,"changed <%s> email to %s"%(username, user.email))
- self.out_SERVERMSG(client,"user not found")
- def in_RESENDVERIFICATION(self, client, newmail):
- RESENDVERIFICATIONACCEPTED RESENDVERIFICATIONDENIED
- client.Send("RESENDVERIFICATIONACCEPTED")
- client.Send("RESENDVERIFICATIONDENIED %s" % reason)
- client.Send("RESENDVERIFICATIONDENIED email verification is currently turned off, you do not need a verification code!")
- def in_STLS(self, client):
- STLS
- client.Send(' '.join((self._root.server, str(self._root.server_version), self._root.min_spring_version, str(self._root.natport), '0')))
- client.Send('OK ' + self._dictToTags({'cmd': cmd}))
- self.out_OK(client, "STLS")
- def in_JSON(self, client, rawcmd):
- (no response)
- client.Send('JSON ' + json.dumps({cmd: dict}, separators=(',', ':')))
- self._root.broadcast('JSON ' + json.dumps(data, separators=(',', ':')))
- self._root.broadcast(message, self.name, ignore, None, flag)
- self.out_JSON(client, "FAILED", {"msg": "Unknown command: %s" %(rawcmd)})
- self.out_JSON(client, "FAILED", {"msg": str(e)})
- def in_MUTE(self, client, chan, user, duration=0):
- SERVERMSG
- client.Send('SERVERMSG %s' %(message))
- self.Send('SERVERMSG No flooding (over %s per second for %s seconds)' % (bytespersecond, seconds))
- self.Send('SERVERMSG message-length limit (%d) exceeded: command \"%s...\" dropped.' % (msg_length_limit, command[0: 8]))
- self.out_SERVERMSG(client, '%s failed. Incorrect arguments.' % command)
- self.out_SERVERMSG(client, '%s failed. Insufficient rights.' % command, True)
- self.out_SERVERMSG(client, '%s failed. Unknown command.' % command, True)
- def in_UNMUTE(self, client, chan, user):
- SERVERMSG
- client.Send('SERVERMSG %s' %(message))
- self.Send('SERVERMSG No flooding (over %s per second for %s seconds)' % (bytespersecond, seconds))
- self.Send('SERVERMSG message-length limit (%d) exceeded: command \"%s...\" dropped.' % (msg_length_limit, command[0: 8]))
- self.out_SERVERMSG(client, '%s failed. Incorrect arguments.' % command)
- self.out_SERVERMSG(client, '%s failed. Insufficient rights.' % command, True)
- self.out_SERVERMSG(client, '%s failed. Unknown command.' % command, True)
- def in_MUTELIST(self, client, chan):
- SERVERMSG
- client.Send('SERVERMSG %s' %(message))
- self.Send('SERVERMSG No flooding (over %s per second for %s seconds)' % (bytespersecond, seconds))
- self.Send('SERVERMSG message-length limit (%d) exceeded: command \"%s...\" dropped.' % (msg_length_limit, command[0: 8]))
- self.out_SERVERMSG(client, '%s failed. Incorrect arguments.' % command)
- self.out_SERVERMSG(client, '%s failed. Insufficient rights.' % command, True)
- self.out_SERVERMSG(client, '%s failed. Unknown command.' % command, True)
- def in_FORCELEAVECHANNEL(self, client, chan, user, reason=''):
- SERVERMSG
- client.Send('SERVERMSG %s' %(message))
- self.Send('SERVERMSG No flooding (over %s per second for %s seconds)' % (bytespersecond, seconds))
- self.Send('SERVERMSG message-length limit (%d) exceeded: command \"%s...\" dropped.' % (msg_length_limit, command[0: 8]))
- self.out_SERVERMSG(client, '%s failed. Incorrect arguments.' % command)
- self.out_SERVERMSG(client, '%s failed. Insufficient rights.' % command, True)
- self.out_SERVERMSG(client, '%s failed. Unknown command.' % command, True)
- def in_SETCHANNELKEY(self, client, chan, key='*'):
- SERVERMSG
- client.Send('SERVERMSG %s' %(message))
- self.Send('SERVERMSG No flooding (over %s per second for %s seconds)' % (bytespersecond, seconds))
- self.Send('SERVERMSG message-length limit (%d) exceeded: command \"%s...\" dropped.' % (msg_length_limit, command[0: 8]))
- self.out_SERVERMSG(client, '%s failed. Incorrect arguments.' % command)
- self.out_SERVERMSG(client, '%s failed. Insufficient rights.' % command, True)
- self.out_SERVERMSG(client, '%s failed. Unknown command.' % command, True)
- def in_STARTTLS(self, client):
- (no response)
- client.Send(' '.join((self._root.server, str(self._root.server_version), self._root.min_spring_version, str(self._root.natport), '0')))
- def in_SAYBATTLE(self, client, msg):
- (no response)
- def in_SAYBATTLEEX(self, client, msg):
- (no response)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement