Mercurial > traipse_dev
diff orpg/chat/commands.py @ 115:17b64e9133e9 alpha
Traipse Alpha 'OpenRPG' {091012-00}
Traipse is a distribution of OpenRPG that is designed to be easy to setup and go.
Traipse also makes it easy for developers to work on code without fear of sacrifice.
'Ornery-Orc' continues the trend of 'Grumpy' and adds fixes to the code.
'Ornery-Orc's main goal is to offer more advanced features and enhance the
productivity of the user.
Update Summary:
Adds Bookmarks (Alpha) with cool Smiley Star and Plus Symbol images!
Changes made to the map for increased portability. SnowDog has changes planned in
Core, though.
Added an initial push to the BCG. Not much to see, just shows off how it is
re-writing Main code.
Fix to remote admin commands
Minor fix to texted based server, works in /System/ folder
Some Core changes to gametree to correctly disply Pretty Print, thanks David!
Fix to Splitter Nodes not being created.
Added images to Plugin Control panel for Autostart feature
Fix to massive amounts of images loading; from Core
{091011}
fix to gsclient so with_statement imports
Added 'boot' command to remote admin
Prep work in Pass tool for remote admin rankings and different passwords, ei, Server,
Admin, Moderator, etc.
{091012}
00:
Remote Admin Commands more organized, more prep work.
Added Confirmation window for sent nodes.
author | sirebral |
---|---|
date | Mon, 12 Oct 2009 01:11:10 -0500 |
parents | bd6ca89e4cbb |
children | 9314d63c0941 |
line wrap: on
line diff
--- a/orpg/chat/commands.py Sun Oct 11 16:38:54 2009 -0500 +++ b/orpg/chat/commands.py Mon Oct 12 01:11:10 2009 -0500 @@ -645,6 +645,7 @@ return #######END mDuo13's Tab Initiator######### + @debugging def on_remote_admin(self, cmdargs): args = string.split(cmdargs,None,-1) @@ -670,7 +671,6 @@ self.chat.SystemPost("Command ignored. No remote administrator password set!!") return msgbase = "<admin id='"+self.session.id+"' group_id='"+self.session.group_id+"' pwd='"+pwd+"'" - if args[0] == "set": if len( args ) > 1: self.session.orpgFrame_callback.password_manager.server = str( args[1] ) @@ -679,16 +679,37 @@ pwd = self.session.orpgFrame_callback.password_manager.GetPassword("server") if pwd != None: self.chat.SystemPost( "Remote administration commands using password: "+pwd+"" ) + elif len(args) == 1: + admin_command = {'banlist': ' cmd="banlist" />', + 'help': " cmd='help' />", + 'roompasswords': " cmd='roompasswords' />", + 'uptime': " cmd='uptime' />", + 'list': " cmd='list' />", + 'killserver': " cmd='killserver' />", + 'savemaps': ' cmd="savemaps" />' + } + if admin_command.has_key(args[0]): + msg = msgbase + admin_command[args[0]] + self.session.outbox.put(msg) - elif args[0] == "ban": - #Ban a player from the server - msg = msgbase + ' cmd="ban" bid="' + str(args[1]) + '" />' - self.session.outbox.put(msg) - - elif args[0] == "boot": - #Ban a player from the server - msg = msgbase + ' cmd="boot" bid="' + str(args[1]) + '" />' - self.session.outbox.put(msg) + elif len(args) == 2: + admin_command = {'ban': ' cmd="ban" bid="' + str(args[1]) + '" />', + 'unban': ' cmd="unban" ip="' + str(args[1]) + '" />', + 'nameroom': " cmd='nameroom' rmid="+ str(args[1])+" name="+ string.join(args[2:])+" />", + 'broadcast': " cmd='broadcast' msg='"+ string.join(args[1:])+"' />", + 'killgroup': " cmd='killgroup' gid='"+ str(args[1])+"' />" + } + if admin_command.has_key(args[0]): + msg = msgbase + admin_command[args[0]] + self.session.outbox.put(msg) + + elif len(args) == 3: + admin_command = {'message':" cmd='message' to_id='"+ str(args[1])+"' msg='"+ string.join(args[2:])+"' />", + 'passwd': " cmd='passwd' gid='"+str(args[1])+"' pass='"+ str(args[2])+"' />" + } + if admin_command.has_key(args[0]): + msg = msgbase + admin_command[args[0]] + self.session.outbox.put(msg) elif args[0] == "banip": #Ban a player from the server @@ -697,51 +718,6 @@ msg = msgbase + ' cmd="banip" bip="' + str(args[1]) + '" bname="' + bname + '"/>' self.session.outbox.put(msg) - elif args[0] == "unban": - #remove a group from the server and drop all players within the group - msg = msgbase + ' cmd="unban" ip="' + str(args[1]) + '" />' - self.session.outbox.put(msg) - - elif args[0] == "banlist": - #remove a group from the server and drop all players within the group - msg = msgbase + ' cmd="banlist" />' - self.session.outbox.put(msg) - - elif args[0] == "help": - #request help from server - msg = msgbase + " cmd='help' />" - self.session.outbox.put(msg) - - elif args[0] == "nameroom": - #reqest room renaming on server - msg = msgbase + " cmd='nameroom' rmid="+ str(args[1])+" name="+ string.join(args[2:])+" />" - self.session.outbox.put(msg) - - elif args[0] == "roompasswords": - #reqest room renaming on server - msg = msgbase + " cmd='roompasswords' />" - self.session.outbox.put(msg) - - elif args[0] == "message": - #send message to a specific player on the server via the system administrator - msg = msgbase + " cmd='message' to_id='"+ str(args[1])+"' msg='"+ string.join(args[2:])+"' />" - self.session.outbox.put(msg) - - elif args[0] == "broadcast": - #send a message to all players on server from the system administrator - msg = msgbase + " cmd='broadcast' msg='"+ string.join(args[1:])+"' />" - self.session.outbox.put(msg) - - elif args[0] == "killgroup": - #remove a group from the server and drop all players within the group - msg = msgbase + " cmd='killgroup' gid='"+ str(args[1])+"' />" - self.session.outbox.put(msg) - - elif args[0] == "uptime": - #request uptime report from server - msg = msgbase + " cmd='uptime' />" - self.session.outbox.put(msg) - elif args[0] == "createroom": #request creation of a (temporary) persistant room if len(args) < 2: @@ -754,26 +730,11 @@ msg = msgbase + " cmd='createroom' name='"+str(args[1])+"' boot='"+ str(args[2])+"' pass='"+ str(args[3])+"' />" self.session.outbox.put(msg) - elif args[0] == "passwd": - #request boot password change on a room - msg = msgbase + " cmd='passwd' gid='"+str(args[1])+"' pass='"+ str(args[2])+"' />" - self.session.outbox.put(msg) - - elif args[0] == "list": - #request a list of rooms and players from server - msg = msgbase + " cmd='list' />" - self.session.outbox.put(msg) - - elif args[0] == "killserver": - #remotely kill the server - msg = msgbase + " cmd='killserver' />" - self.session.outbox.put(msg) - - elif args[0] == "savemaps": - msg = msgbase + ' cmd="savemaps" />' - self.session.outbox.put(msg) - else: self.chat.InfoPost("Unknown administrator command" ) + command_function = { + 'banip': self.admin.r_admin_banip, + 'createroom': self.r_admin_createroom, + } except: self.chat.InfoPost("An error has occured while processing a Remote Administrator command!") traceback.print_exc()