diff orpg/networking/mplay_server_gui.py @ 122:36919b8a3ef9 alpha

Traipse Alpha 'OpenRPG' {091031-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 (Cleaning up for Beta) Added Bookmarks Fix to Remote Admin Commands Minor fix to text based Server Fix to Pretty Print, from Core Fix to Splitter Nodes not being created Fix to massive amounts of images loading, from Core Added 'boot' command to remote admin Added confirmation window for sent nodes Minor changes to allow for portability to an OpenSUSE linux OS Miniatures Layer pop up box allows users to turn off Mini labels, from FlexiRPG Zoom Mouse plugin added Images added to Plugin UI Switching to Element Tree Map efficiency, from FlexiRPG Added Status Bar to Update Manager default_manifest.xml renamed to default_upmana.xml Cleaner clode for saved repositories New TrueDebug Class in orpg_log Mercurial's hgweb folder is ported to upmana Happy Halloween!
author sirebral
date Sat, 31 Oct 2009 22:07:55 -0500
parents 9314d63c0941
children 8827271fbe1b
line wrap: on
line diff
--- a/orpg/networking/mplay_server_gui.py	Fri Oct 30 22:21:40 2009 -0500
+++ b/orpg/networking/mplay_server_gui.py	Sat Oct 31 22:07:55 2009 -0500
@@ -9,10 +9,8 @@
 __cvsinfo__='$Id: mplay_server_gui.py,v 1.26 2007/11/06 00:32:39 digitalxero Exp $'[5:-2]
 __doc__="""OpenRPG Server Graphical Interface"""
 
-import os
-import sys
-import time
-import types
+import os, sys, time, types
+
 from orpg.dirpath import dir_struct
 #import orpg.systempath looks old
 from orpg.tools.validate import validate
@@ -23,6 +21,10 @@
 from mplay_server import mplay_server, server
 from xml.dom import minidom
 from orpg.orpgCore import component
+from orpg.tools.orpg_log import debug
+
+from xml.etree.ElementTree import ElementTree, Element, iselement
+from xml.etree.ElementTree import fromstring, tostring, parse
 
 # Constants ######################################
 SERVER_RUNNING = 1
@@ -91,6 +93,7 @@
 
 # ServerConfig Object ############################
 class ServerConfig:
+    debug()
     """ This class contains configuration
         setting used to control the server."""
 
@@ -115,6 +118,7 @@
 # Server Monitor #################################
 
 class ServerMonitor(Thread):
+    debug()
     """ Monitor thread for GameServer. """
     def __init__(self, cb, conf, name, pwd):
         """ Setup the server. """
@@ -125,6 +129,7 @@
         self.bootPwd = pwd
 
     def log(self, mesg):
+        debug()
         if type(mesg) == types.TupleType:
             func, msg = mesg
             event = MessageFunctionEvent( func, msg )
@@ -133,6 +138,7 @@
         del event
 
     def run(self):
+        debug()
         """ Start the server. """
         self.server = mplay_server(self.log, self.serverName )
         self.server.initServer(bootPassword=self.bootPwd, reg="No")
@@ -140,6 +146,7 @@
         while self.alive: time.sleep(3)
 
     def stop(self):
+        debug()
         """ Stop the server. """
         self.server.kill_server()
         self.alive = 0
@@ -204,6 +211,7 @@
         self.SetStringItem(i, 2, "NEW")
         self.SetStringItem(i, 3, self.roomList[0])
         self.SetStringItem(i, 4, self.stripHtml(player["version"]))
+        print self.stripHtml(player["role"])
         self.SetStringItem(i, 5, 'Lurker' if self.stripHtml(player["role"]) == '' else self.stripHtml(player["role"]))
         self.SetStringItem(i, 6, self.stripHtml(player["ip"]))
         self.SetStringItem(i, 7, "PING")
@@ -231,6 +239,7 @@
         if i > -1:
             self.SetStringItem(i, 1, self.stripHtml(player["name"]))
             self.SetStringItem(i, 2, self.stripHtml(player["status"]))
+            print self.stripHtml(player["role"])
             self.SetStringItem(i, 5, 'Lurker' if self.stripHtml(player["role"]) == '' else self.stripHtml(player["role"]))
             self.AutoAjust()
         else: self.add(player)
@@ -458,7 +467,8 @@
         self.Log( event.message )
 
     # Event handler for out logging event
-    def OnFunctionMessage( self, event ):
+    def OnFunctionMessage(self, event):
+        debug()
         self.callbacks[event.func]( event.message )
 
     ### Server Callbacks #####################################