changeset 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 d078a8cdc1e4
files orpg/chat/commands.py orpg/main.py orpg/orpg_version.py
diffstat 3 files changed, 69 insertions(+), 100 deletions(-) [+]
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()
--- a/orpg/main.py	Sun Oct 11 16:38:54 2009 -0500
+++ b/orpg/main.py	Mon Oct 12 01:11:10 2009 -0500
@@ -49,8 +49,9 @@
 import orpg.mapper.map
 import orpg.mapper.images
 
-import upmana.updatemana
-import upmana.manifest as manifest
+#Update Manager# Un remark if you have Mercurial installed
+#import upmana.updatemana
+#import upmana.manifest as manifest
 
 from orpg.dirpath import dir_struct
 from orpg.dieroller.utils import DiceManager
@@ -132,12 +133,12 @@
         logger.debug("plugins reloaded and startup plugins launched")
         self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
 
-        #Load Update Manager
-        component.add('updatemana', self.updateMana)
-        logger.debug("update manager reloaded")
-        self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
+        #Load Update Manager# Un remark if you have Mercurial installed
+        #component.add('updatemana', self.updateMana)
+        #logger.debug("update manager reloaded")
+        #self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
 
-        #Load Update Manager
+        #Load Debug Console
         component.add('debugconsole', self.debugger)
         logger.debug("debugger window")
         self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
@@ -264,9 +265,10 @@
         self.traipseSuite = wx.Menu()
         self.mainmenu.Insert(5, self.traipseSuite, "&Traipse Suite")
 
-        mana = wx.MenuItem(self.traipseSuite, wx.ID_ANY, "Update Manager", "Update Manager")
-        self.Bind(wx.EVT_MENU, self.OnMB_UpdateManagerPanel, mana)
-        self.traipseSuite.AppendItem(mana)
+	#Update Manager# Un remark if you have Mercurial installed
+        #mana = wx.MenuItem(self.traipseSuite, wx.ID_ANY, "Update Manager", "Update Manager")
+        #self.Bind(wx.EVT_MENU, self.OnMB_UpdateManagerPanel, mana)
+        #self.traipseSuite.AppendItem(mana)
 
         self.debugConsole = wx.MenuItem(self.traipseSuite, -1, "Debug Console", "Debug Console")
         self.Bind(wx.EVT_MENU, self.OnMB_DebugConsole, self.debugConsole)
@@ -638,18 +640,18 @@
         self.SetDimensions(posx, posy, w, h)
         logger.debug("Dimensions Set")
 
-        # Update Manager
-        self.manifest = manifest.ManifestChanges()
-        self.updateMana = upmana.updatemana.updaterFrame(self, 
-            "OpenRPG Update Manager Beta 0.8", component, self.manifest, True)
-        logger.debug("Menu Created")
-        h = int(xml_dom.getAttribute("height"))
-        w = int(xml_dom.getAttribute("width"))
-        posx = int(xml_dom.getAttribute("posx"))
-        posy = int(xml_dom.getAttribute("posy"))
-        maximized = int(xml_dom.getAttribute("maximized"))
-        self.SetDimensions(posx, posy, w, h)
-        logger.debug("Dimensions Set")
+        # Update Manager # Un remark if you have Mercurial installed
+        #self.manifest = manifest.ManifestChanges()
+        #self.updateMana = upmana.updatemana.updaterFrame(self, 
+        #    "OpenRPG Update Manager Beta 0.8", component, self.manifest, True)
+        #logger.debug("Menu Created")
+        #h = int(xml_dom.getAttribute("height"))
+        #w = int(xml_dom.getAttribute("width"))
+        #posx = int(xml_dom.getAttribute("posx"))
+        #posy = int(xml_dom.getAttribute("posy"))
+        #maximized = int(xml_dom.getAttribute("maximized"))
+        #self.SetDimensions(posx, posy, w, h)
+        #logger.debug("Dimensions Set")
 
         # Debug Console
         self.debugger = orpg.tools.orpg_log.DebugConsole(self)
@@ -974,8 +976,13 @@
         else: display_name = "Server Administrator"
 
         if data[:5] == "<tree":
-            self.tree.on_receive_data(data,player)
-            self.chat.InfoPost(display_name + " has sent you a tree node...")
+            ### Alpha ### Allows users to decide if they want the node or not.
+            dlg = wx.MessageDialog(None, display_name + 'is trying to send you a tree node. Accept?', 'Question', 
+                wx.YES_NO | wx.NO_DEFAULT | wx.ICON_QUESTION)
+            if dlg.ShowModal() == wx.ID_YES:
+              dlg.Destroy()
+              self.tree.on_receive_data(data,player)
+              self.chat.InfoPost(display_name + " has sent you a tree node...")
 
         elif data[:4] == "<map": self.map.new_data(data)
 
@@ -1223,7 +1230,8 @@
         logger._set_log_level = int(settings.get_setting('LoggingLevel'))
         logger._set_log_to_console(False)
 
-        self.manifest = manifest.ManifestChanges()
+	#Update Manager# Un remark if you have Mercurial installed
+        #self.manifest = manifest.ManifestChanges()
 
         self.called = False
         wx.InitAllImageHandlers()
--- a/orpg/orpg_version.py	Sun Oct 11 16:38:54 2009 -0500
+++ b/orpg/orpg_version.py	Mon Oct 12 01:11:10 2009 -0500
@@ -4,7 +4,7 @@
 #BUILD NUMBER FORMAT: "YYMMDD-##" where ## is the incremental daily build index (if needed)
 DISTRO = "Traipse Alpha"
 DIS_VER = "Ornery Orc"
-BUILD = "091011-00"
+BUILD = "091012-00"
 
 # This version is for network capability.
 PROTOCOL_VERSION = "1.2"