diff orpg/networking/server_plugins.py @ 92:68c7bd272f27 beta

Traipse Beta 'OpenRPG' {090919-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 menu changes to draw attention to important updates, errors, or other events. (image info coming soon) Traipse URL is not included in the repos tab and is set as default. Fixes Copy for Windows and Linux (finally!!) users. Fixes incomplete update to Grid and List nodes. Fixes incomplete update to Chat Commands. Fixes problems with Remote Image Upload. Fixes Drop and Drag of Minis to Map. CherryPy can now use any image in the webfiles/ folder and sub-folders. CherryPy can now Drop and Drag Minis to the Map. Minor changes to Update Manager's GUI. Expert recommendation warning added to Revision Update. Step down compatibility with open_rpg & component added to orpgCore. Using majority of 'Grumpy' network folder to correct server lag.
author sirebral
date Sat, 19 Sep 2009 06:50:43 -0500
parents 449a8900f9ac
children 65c1604e7949
line wrap: on
line diff
--- a/orpg/networking/server_plugins.py	Wed Sep 09 17:12:59 2009 -0500
+++ b/orpg/networking/server_plugins.py	Sat Sep 19 06:50:43 2009 -0500
@@ -25,6 +25,7 @@
     def initBase(self):
         self._startPlugins()
 
+
     #Methods
     def _startPlugins(self):
         autoload = []
@@ -59,6 +60,7 @@
         self._load(pluginData)
 
         #Write to the autoload file for this plugin
+
         self.__plugins[pluginName].Activated = True
         self.__plugins[pluginName].start()
 
@@ -66,12 +68,13 @@
         if not self.__plugins.has_key(pluginName):
             #Print some error about invalid plugin
             return
+        pluginData = self.__plugins[pluginName]
 
-        pluginData = self.__plugins[pluginName]
         self.__plugins[pluginName].stop()
 
         #Unload it
         self._unload(pluginData)
+
         #Remove this plugin from the autoload file
 
     #Private Methods
@@ -81,10 +84,7 @@
         return ('plugins.' + self.__ptype + '.' + s2[0], s2[0])
 
     def _unload(self, pluginData):
-        self.__plugins[pluginData.Name] = PluginData(pluginData.Name, 
-                                                    pluginData.File, 
-                                                    pluginData.Author, 
-                                                    pluginData.Help)
+        self.__plugins[pluginData.Name] = PluginData(pluginData.Name, pluginData.File, pluginData.Author, pluginData.Help)
         unload = []
         mod = self._findModule(pluginData.File)[0]
         for key, module in sys.modules.iteritems():
@@ -115,6 +115,8 @@
 
     def _getType(self):
         return self.__ptype
+
+
     #Properties
     Plugins = property(_getPlugins, None)
     Type = property(_getType, None)
@@ -130,15 +132,18 @@
     def preParseIncoming(self, xml_dom, data):
         sent = True
         errmsg = ""
+
         for pluginName, pluginData in self.Plugins.iteritems():
             if pluginData.Activated:
                 xml_dom, data = pluginData.preParseIncoming(xml_dom, data)
+
         return xml_dom, data
 
     def postParseIncoming(self, data):
         for pluginName, pluginData in self.Plugins.iteritems():
             if pluginData.Activated:
                 data = pluginData.postParseIncoming(data)
+
         return data
 
     def getPlayer(self):
@@ -147,6 +152,7 @@
             if pluginData.Activated:
                 playerName = pluginData.addPlayer(data)
                 players.append(playerName)
+
         return players
 
     def setPlayer(self, playerData):
@@ -155,6 +161,7 @@
             if pluginData.Activated:
                 playerName = pluginData.addPlayer(data)
                 players.append(playerName)
+
         return
 
     def preParseOutgoing(self):
@@ -164,6 +171,7 @@
                 xml = pluginData.preParseOutgoing()
                 for msg in xml:
                     data.append(msg)
+
         return data
 
     def postParseOutgoing(self):
@@ -173,6 +181,7 @@
                 xml = pluginData.postParseOutgoing()
                 for msg in xml:
                     data.append(msg)
+
         return data
 
 __key = _SingletonKey()