diff orpg/chat/commands.py @ 133:37d26a98883f alpha

Traipse Alpha 'OpenRPG' {091010-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 (See documentation for usage) Mercurial's hgweb folder is ported to upmana **Pretty important update that can help remove thousands of dead children from your gametree. **Children, <forms />, <group_atts />, <horizontal />, <cols />, <rows />, <height />, etc... are all tags now. Check your gametree and look for dead children!! **New Gamtree Recusion method, mapping, and context sensitivity. !!Alpha - Watch out for infinite loops!! Dead Node Children, now that's a O O -v-v- Happy Halloween!
author sirebral
date Tue, 10 Nov 2009 12:11:13 -0600
parents fba298d65cf8
children bf799efe7a8a
line wrap: on
line diff
--- a/orpg/chat/commands.py	Thu Nov 05 12:15:19 2009 -0600
+++ b/orpg/chat/commands.py	Tue Nov 10 12:11:13 2009 -0600
@@ -8,15 +8,13 @@
 #
 
 
-import string
-import time
+import string, time
 import orpg.orpg_version
 import orpg.orpg_windows
 import traceback
 
 from orpg.orpgCore import component
 from orpg.tools.orpg_log import logger
-from orpg.tools.decorators import debugging
 
 ##--------------------------------------------------------------
 ## dynamically loading module for extended developer commands
@@ -40,7 +38,7 @@
     #
     # !self : instance of self
     # !chat : instance of the chat window to write to
-    @debugging
+    
     def __init__(self,chat):
         self.post = chat.Post
         self.colorize = chat.colorize
@@ -61,7 +59,7 @@
         #
         # !self : instance of self
         # !text : string of text matching an implemented emotion
-    @debugging
+    
     def addcommand(self, cmd, function, helpmsg):
         if not self.cmdlist.has_key(cmd) and not self.shortcmdlist.has_key(cmd):
             self.cmdlist[cmd] = {}
@@ -69,12 +67,12 @@
             self.cmdlist[cmd]['help'] = helpmsg
             #print 'Command Added: ' + cmd
 
-    @debugging
+    
     def addshortcmd(self, shortcmd, longcmd):
         if not self.shortcmdlist.has_key(shortcmd) and not self.cmdlist.has_key(shortcmd):
             self.shortcmdlist[shortcmd] = longcmd
 
-    @debugging
+    
     def removecmd(self, cmd):
         if self.cmdlist.has_key(cmd):
             del self.cmdlist[cmd]
@@ -84,7 +82,7 @@
         #print 'Command Removed: ' + cmd
 
 
-    @debugging
+    
     def defaultcmds(self):
         self.addcommand('/help', self.on_help, '- Displays this help message')
         self.addcommand('/version', self.on_version, ' - Displays current version of OpenRPG.')
@@ -114,7 +112,7 @@
         self.addcommand('/purge', self.on_purge, 'This will clear the entire chat window')
         self.addcommand('/advfilter', self.on_filter, 'This will toggle the Advanced Filter')
 
-    @debugging
+    
     def defaultcmdalias(self):
         self.addshortcmd('/?', '/help')
         self.addshortcmd('/he', '/me')
@@ -129,7 +127,7 @@
         #This is just an example or a differant way the shorcmd can be used
         self.addshortcmd('/sleep', '/me falls asleep')
 
-    @debugging
+    
     def docmd(self,text):
         cmdsearch = string.split(text,None,1)
         cmd = string.lower(cmdsearch[0])
@@ -145,7 +143,7 @@
             msg = "Sorry I don't know what %s is!" % (cmd)
             self.chat.InfoPost(msg)
 
-    @debugging
+    
     def on_filter(self, cmdargs):
         #print self.chat.advancedFilter
         test = not self.chat.advancedFilter
@@ -170,12 +168,12 @@
         else:
             self.chat.InfoPost("Advanced Filtering has been turned Off")
 
-    @debugging
+    
     def on_purge(self, cmdargs):
         self.chat.PurgeChat()
         self.chat.InfoPost('Chat Buffer has been Purged!')
 
-    @debugging
+    
     def on_sound(self, cmdargs):
         if len(cmdargs) < 8:
             self.chat.InfoPost("You must provide a URL for the file name, it does not work for just local sound files")
@@ -209,11 +207,11 @@
         else:
             self.chat.InfoPost("Something dun fuckered up Frank!")
 
-    @debugging
+    
     def on_version(self, cmdargs=""):
         self.chat.InfoPost("Version is OpenRPG " + self.chat.version)
 
-    @debugging
+    
     def on_load(self, cmdargs):
         args = string.split(cmdargs,None,-1)
         try:
@@ -224,14 +222,14 @@
             print e
             self.chat.InfoPost("ERROR Loading settings")
 
-    @debugging
+    
     def on_font(self, cmdargs):
         try:
             fontsettings = self.chat.set_default_font(fontname=cmdargs, fontsize=None)
         except:
             self.chat.InfoPost("ERROR setting default font")
 
-    @debugging
+    
     def on_fontsize(self, cmdargs):
         args = string.split(cmdargs,None,-1)
         try:
@@ -240,7 +238,7 @@
             print e
             self.chat.InfoPost("ERROR setting default font size")
 
-    @debugging
+    
     def on_close(self, cmdargs):
         try:
             chatpanel = self.chat
@@ -252,7 +250,7 @@
         except:
             self.chat.InfoPost("Error:  cannot close private chat tab.")
 
-    @debugging
+    
     def on_time(self, cmdargs):
         local_time = time.localtime()
         gmt_time = time.gmtime()
@@ -260,7 +258,7 @@
         self.chat.InfoPost("<br />Local: " + time.strftime(format_string)+\
                            "<br />GMT: "+time.strftime(format_string,gmt_time))
 
-    @debugging
+    
     def on_dieroller(self, cmdargs):
         args = string.split(cmdargs,None,-1)
         rm = component.get('DiceManager')
@@ -273,13 +271,13 @@
             self.chat.InfoPost("Available die rollers: " + str(rm.listRollers()))
             self.chat.InfoPost("You are using the <b>\"" + rm.getRoller() + "\"</b> die roller.")
 
-    @debugging
+    
     def on_ping(self, cmdargs):
         ct = time.clock()
         msg = "<ping player='"+self.session.id+"' time='"+str(ct)+"' />"
         self.session.outbox.put(msg)
 
-    @debugging
+    
     def on_log(self,cmdargs):
         args = string.split(cmdargs,None,-1)
         logfile = self.settings.get_setting( 'GameLogPrefix' )
@@ -311,7 +309,7 @@
         else:
             self.chat.InfoPost("Unknown logging command, use 'on' or 'off'"  )
 
-    @debugging
+    
     def postLoggingState( self ):
         logfile = self.settings.get_setting( 'GameLogPrefix' )
         try:
@@ -325,7 +323,7 @@
         #
         #!self : instance of self
 
-    @debugging
+    
     def on_name(self, cmdargs):
         #only 20 chars no more! :)
         if cmdargs == "":
@@ -339,7 +337,7 @@
         # This subroutine will set the players netork status.
         #
         # !self : instance of self
-    @debugging
+    
     def on_status(self, cmdargs):
         if cmdargs ==  "":
             self.chat.InfoPost("Incorrect synatx for status.")
@@ -349,7 +347,7 @@
             self.session.set_text_status(str(txt))
     # def on_status - end
 
-    @debugging
+    
     def on_set(self, cmdargs):
         args = string.split(cmdargs,None,-1)
         keys = self.settings.get_setting_keys()
@@ -384,7 +382,7 @@
         #
         #!self : instance of self
 
-    @debugging
+    
     def on_help(self, cmdargs=""):
         cmds = self.cmdlist.keys()
         cmds.sort()
@@ -406,7 +404,7 @@
         # !self : instance of self
         # !text : string that is comprised of a list of users to toggle the ignore flag
 
-    @debugging
+    
     def on_ignore(self, cmdargs):
         args = string.split(cmdargs,None,-1)
         (ignore_list, ignore_name) = self.session.get_ignore_list()
@@ -433,7 +431,7 @@
                     self.chat.InfoPost(m + " was ignored because it is an invalid player ID")
                     traceback.print_exc()
 
-    @debugging
+    
     def on_role(self, cmdargs):
         if cmdargs == "":
             self.session.display_roles()
@@ -464,7 +462,7 @@
         # !text : string that is comprised of a list of users and the message to
         #whisper.
 
-    @debugging
+    
     def on_whisper(self, cmdargs):
         delim = cmdargs.find("=")
 
@@ -481,7 +479,7 @@
 #---------------------------------------------------------
 # [START] Digitalxero Multi Whisper Group 1/1/05
 #---------------------------------------------------------
-    @debugging
+    
     def on_groupwhisper(self, cmdargs):
         args = string.split(cmdargs,None,-1)
         delim = cmdargs.find("=")
@@ -539,7 +537,7 @@
 # [END] Digitalxero Multi Whisper Group 1/1/05
 #---------------------------------------------------------
 
-    @debugging
+    
     def on_gmwhisper(self, cmdargs):
         if cmdargs == "":
             self.chat.InfoPost("**Incorrect syntax for GM Whisper.")
@@ -553,7 +551,7 @@
                 self.on_whisper(gmstring + "=" + cmdargs)
             else: self.chat.InfoPost("**No GMs to Whisper to.")
 
-    @debugging
+    
     def on_moderate(self, cmdargs):
         if cmdargs != "":
             pos = cmdargs.find("=")
@@ -586,11 +584,11 @@
             self.session.outbox.put(msg)
         self.session.update()
 
-    @debugging
+    
     def on_update(self, cmdargs):
         self.chat.InfoPost("This command is no longer valid")
 
-    @debugging
+    
     def on_description(self, cmdargs):
         if len(cmdargs) <= 0:
             self.chat.InfoPost("**No description text to display." + str(delim))
@@ -601,7 +599,7 @@
         self.chat.Post(mesg)
         self.chat.send_chat_message(mesg)
 
-    @debugging
+    
     def invoke_tab(self, cmdargs):
         ######START mDuo13's Tab Initiator########
         try:
@@ -627,7 +625,7 @@
         #######END mDuo13's Tab Initiator#########
 
 
-    @debugging
+    
     def on_remote_admin(self, cmdargs):
         args = string.split(cmdargs,None,-1)
         #handles remote administration commands
@@ -675,7 +673,6 @@
             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])+"' />"
                                 }
@@ -684,7 +681,8 @@
                     self.session.outbox.put(msg)
 
             elif len(args) == 3:
-                admin_command = {'message':" cmd='message' to_id='"+ str(args[1])+"' msg='"+ string.join(args[2:])+"' />",
+                admin_command = {'message':" cmd='message' to_id='"+ str(args[1])+"' msg='"+ string.join(args[2:])+"' />",
+                                'nameroom': " cmd='nameroom' rmid='"+ str(args[1])+"' name='"+ string.join(args[2:])+"' />",
                                 'passwd': " cmd='passwd' gid='"+str(args[1])+"' pass='"+ str(args[2])+"' />"
                                  }
                 if admin_command.has_key(args[0]):