diff orpg/networking/server_plugins.py @ 90:d1aff41c031b alpha

Traipse Alpha '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: 00: 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. 01: Fixes Copy for Windows and Linux (finally!!) users. Fixes incomplete update to Grid and List nodes. Fixes incomplete update to Chat Commands. 02: 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. 03: Minor changes to Update Manager's GUI. Expert recommendation warning added to Revision Update. Step down compatibility with open_rpg & component added to orpgCore. 19-00: Better backwards compatibility in orpgCore. Using majority of 'Grumpy' network folder to correct server lag.
author sirebral
date Sat, 19 Sep 2009 06:45:21 -0500
parents 449a8900f9ac
children 65c1604e7949
line wrap: on
line diff
--- a/orpg/networking/server_plugins.py	Thu Sep 17 06:29:32 2009 -0500
+++ b/orpg/networking/server_plugins.py	Sat Sep 19 06:45:21 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()