# HG changeset patch # User sirebral # Date 1272835828 18000 # Node ID bb7b9648792cd817ac50651ed7616886c81b56e6 # Parent c719a07cd28da8d6577d8e3342d164f678c02703 Traipse Beta 'OpenRPG' {100502-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 (Patch-2) New Features: New Namespace method with two new syntaxes New Namespace Internal is context sensitive, always! New Namespace External is 'as narrow as you make it' New Namespace FutureCheck helps ensure you don't receive an incorrect node New PluginDB access for URL2Link plugin New to Forms, they now show their content in Design Mode New to Update Manager, checks Repo for updates on software start New to Mini Lin node, change title in design mode New to Game Tree, never lose a node, appends a number to the end of corrupted trees New to Server GUI, Traipse Suite's Debug Console New Namespace plugin, Allows Traipse users to use the Standard syntax !@ :: @! Updates: Update to White Board layer, uses a pencil image for color button Update to Grid Layer, uses a grid image for color button Update to Chat Window, size of drop down menus Update to default lobby message Update to template Text node Update to 4e PC Sheet node Fixes: Fix to Server GUI startup errors Fix to Server GUI Rooms tab updating Fix to Chat and Settings if non existant die roller is picked Fix to Dieroller and .open() used with .vs(). Successes are correctly calculated Fix to Alias Lib's Export to Tree, Open, Save features Fix to alias node, now works properly Fix to Splitter node, minor GUI cleanup Fix to Backgrounds not loading through remote loader Fix to Node name errors Fix to rolling dice in chat Whispers Fix to Splitters Sizing issues Fix to URL2Link plugin, modified regex compilation should remove memory leak Fix to mapy.py, a roll back due to zoomed grid issues Fix to whiteboard_handler, Circles work by you clicking the center of the circle Fix to Servers parse_incoming_dom which was outdated and did not respect XML Fix to a broken link in the server welcome message Fix to InterParse and logger requiring traceback Fix to Update Manager Status Bar Fix to failed image and erroneous pop up Fix to Mini Lib node that was preventing use Fix to plugins that parce dice but did not call InterParse Fix to nodes for name changing by double click Fix to Game Tree, node ordering on drag and drop corrected Fix to Game Tree, corrupted error message was not showing Fix to Update Manager, checks for internet connection Fix to Update Manager, Auto Update corrections diff -r c719a07cd28d -r bb7b9648792c orpg/chat/chatwnd.py --- a/orpg/chat/chatwnd.py Fri Apr 30 05:44:05 2010 -0500 +++ b/orpg/chat/chatwnd.py Sun May 02 16:30:28 2010 -0500 @@ -502,7 +502,7 @@ wx.WXK_F9: 'event.GetKeyCode() == wx.WXK_F9', wx.WXK_F10: 'event.GetKeyCode() == wx.WXK_F10', wx.WXK_F11: 'event.GetKeyCode() == wx.WXK_F11', wx.WXK_F12: 'event.GetKeyCode() == wx.WXK_F12'} #Alias Lib stuff - self.defaultAliasName = 'Use Real Name' + self.defaultAliasName = 'Real Name' self.defaultFilterName = 'No Filter' self.advancedFilter = False self.lastSend = 0 # this is used to help implement the player typing indicator @@ -827,7 +827,7 @@ def build_alias(self): self.aliasSizer = wx.BoxSizer(wx.HORIZONTAL) - self.aliasList = wx.Choice(self, wx.ID_ANY, size=(100, 25), choices=[self.defaultAliasName]) + self.aliasList = wx.Choice(self, wx.ID_ANY, size=(120, 25), choices=[self.defaultAliasName]) self.aliasButton = createMaskedButton( self, dir_struct["icon"] + 'player.gif', 'Refresh list of aliases from Game Tree', wx.ID_ANY, '#bdbdbd' ) diff -r c719a07cd28d -r bb7b9648792c orpg/gametree/gametree.py --- a/orpg/gametree/gametree.py Fri Apr 30 05:44:05 2010 -0500 +++ b/orpg/gametree/gametree.py Sun May 02 16:30:28 2010 -0500 @@ -45,6 +45,7 @@ from orpg.dirpath import dir_struct from nodehandlers import core import string, urllib, time, os +from shutil import copytree, copystat, copy, copyfile from orpg.orpg_xml import xml from orpg.tools.validate import validate @@ -60,6 +61,12 @@ from xml.etree.ElementTree import fromstring, tostring, XML, iselement from xml.parsers.expat import ExpatError +def exists(path): + try: + os.stat(path) + return True + except: return False + STD_MENU_DELETE = wx.NewId() STD_MENU_DESIGN = wx.NewId() STD_MENU_USE = wx.NewId() @@ -206,9 +213,9 @@ self.EditLabel(curSelection) evt.Skip() - def locate_valid_tree(self, error, msg): ## --Snowdog 3/05 + def locate_valid_tree(self, error, msg, filename): ## --Snowdog 3/05 """prompts the user to locate a new tree file or create a new one""" - response = wx.MessageDialog(self, msg, error, wx.YES|wx.NO|wx.ICON_ERROR) + response = wx.MessageBox(msg, error, wx.YES|wx.NO|wx.ICON_ERROR) if response == wx.YES: file = None dlg = wx.FileDialog(self, "Locate Gametree file", dir_struct["user"], @@ -221,6 +228,7 @@ else: self.load_tree(file) return else: + copyfile(dir_struct['template']+'default_tree.xml', filename) validate.config_file("tree.xml","default_tree.xml") self.load_tree(error=1) return @@ -234,24 +242,25 @@ self.locate_valid_tree("Gametree Error", emsg) return try: + self.xml_root = False tree = parse(filename) self.xml_root = tree.getroot() - except: - self.xml_root = None - + except: self.xml_root = False if not self.xml_root: - os.rename(filename,filename+".corrupt") + count = 1 + while exists(filename[:len(filename)-4]+'-'+str(count)+'.xml'): count += 1 + corrupt_tree = filename[:len(filename)-4]+'-'+str(count)+'.xml' + copyfile(filename, corrupt_tree) emsg = "Your gametree is being regenerated.\n\n"\ "To salvage a recent version of your gametree\n"\ - "exit OpenRPG and copy the lastgood.xml file in\n"\ + "exit OpenRPG and copy the one of the tree-# files in\n"\ "your myfiles directory to "+filename+ "\n"\ "in your myfiles directory.\n\n"\ "lastgood.xml WILL BE OVERWRITTEN NEXT TIME YOU RUN OPENRPG.\n\n"\ "Would you like to select a different gametree file to use?\n"\ "(Selecting 'No' will cause a new default gametree to be generated)" - self.locate_valid_tree("Corrupt Gametree!", emsg) + self.locate_valid_tree("Corrupt Gametree!", emsg, filename) return - if self.xml_root.tag != "gametree": emsg = filename+" does not appear to be a valid gametree file.\n\n"\ "Would you like to select a different gametree file to use?\n"\ @@ -286,8 +295,22 @@ except Exception, e: logger.exception(traceback.format_exc()) - wx.MessageBox("Corrupt Tree!\nYour game tree is being regenerated. To\nsalvage a recent version of your gametree\nexit OpenRPG and copy the lastgood.xml\nfile in your myfiles directory\nto "+filename+ "\nin your myfiles directory.\nlastgood.xml WILL BE OVERWRITTEN NEXT TIME YOU RUN OPENRPG.") - os.rename(filename,filename+".corrupt") + + count = 1 + while exists(filename[:len(filename)-4]+'-'+str(count)+'.xml'): count += 1 + corrupt_tree = filename[:len(filename)-4]+'-'+str(count)+'.xml' + copyfile(filename, corrupt_tree) + wx.MessageBox("Your gametree is being regenerated.\n\n"\ + "To salvage a recent version of your gametree\n"\ + "exit OpenRPG and copy the one of the tree-# files in\n"\ + "your myfiles directory to "+filename+ "\n"\ + "in your myfiles directory.\n\n"\ + "lastgood.xml WILL BE OVERWRITTEN NEXT TIME YOU RUN OPENRPG.\n\n") + + count = 1 + while exists(filename[:len(filename)-4]+'-'+str(count)+'.xml'): count += 1 + corrupt_tree = filename[:len(filename)-4]+'-'+str(count)+'.xml' + copyfile(filename, corrupt_tree) validate.config_file("tree.xml","default_tree.xml") self.load_tree(error=1) diff -r c719a07cd28d -r bb7b9648792c orpg/mapper/grid_handler.py --- a/orpg/mapper/grid_handler.py Fri Apr 30 05:44:05 2010 -0500 +++ b/orpg/mapper/grid_handler.py Sun May 02 16:30:28 2010 -0500 @@ -40,7 +40,10 @@ self.grid_snap = wx.CheckBox(self, wx.ID_ANY, " Snap") self.grid_size = wx.TextCtrl(self, wx.ID_ANY, size=(32,-1) ) self.grid_ratio = wx.TextCtrl(self, wx.ID_ANY, size=(32,-1) ) - self.color_button = wx.Button(self, wx.ID_ANY, "Color", style=wx.BU_EXACTFIT) + #self.color_button = wx.Button(self, wx.ID_ANY, "Color", style=wx.BU_EXACTFIT) + self.color_button = createMaskedButton(self, dir_struct["icon"]+'grid.gif', + 'Grid Color', wx.ID_ANY, '#bdbdbd', + wx.BITMAP_TYPE_GIF) self.apply_button = wx.Button(self, wx.ID_OK, "Apply", style=wx.BU_EXACTFIT) self.color_button.SetBackgroundColour(wx.BLACK) self.color_button.SetForegroundColour(wx.WHITE) diff -r c719a07cd28d -r bb7b9648792c orpg/mapper/whiteboard_handler.py --- a/orpg/mapper/whiteboard_handler.py Fri Apr 30 05:44:05 2010 -0500 +++ b/orpg/mapper/whiteboard_handler.py Sun May 02 16:30:28 2010 -0500 @@ -57,14 +57,16 @@ def build_ctrls(self): base_layer_handler.build_ctrls(self) - self.color_button = wx.Button(self, wx.ID_ANY, "Pen Color", style=wx.BU_EXACTFIT) + self.color_button = createMaskedButton(self, dir_struct["icon"]+'draw.gif', + 'Pen Color', wx.ID_ANY, '#bdbdbd', + wx.BITMAP_TYPE_GIF) self.color_button.SetBackgroundColour(wx.BLACK) self.color_button.SetForegroundColour(wx.WHITE) self.drawmode_ctrl = wx.Choice(self, wx.ID_ANY, choices = ["Freeform", "Polyline","Text", "Cone", "Circle"]) self.drawmode_ctrl.SetSelection(0) #always start showing "Freeform" self.radius = wx.TextCtrl(self, wx.ID_ANY, size=(32,-1) ) self.radius.SetValue("15") - self.live_refresh = wx.CheckBox(self, wx.ID_ANY, " Live Refresh") + self.live_refresh = wx.CheckBox(self, wx.ID_ANY, " Dynamic") self.live_refresh.SetValue(True) self.widthList= wx.Choice(self, wx.ID_ANY, size= wx.Size(40, 20), choices=['1','2','3','4','5','6','7','8','9','10']) @@ -78,7 +80,7 @@ self.sizer.Add(self.radius, 0, wx.EXPAND|wx.ALL, 2) self.sizer.Add(wx.Size(10,25)) self.sizer.Add(self.live_refresh, 0, wx.EXPAND) - self.sizer.Add(wx.Size(20,25)) + self.sizer.Add(wx.Size(10,25)) self.sizer.Add(self.color_button, 0, wx.EXPAND) self.sizer.Add(wx.Size(20,25)) self.Bind(wx.EVT_MOTION, self.on_motion) diff -r c719a07cd28d -r bb7b9648792c orpg/networking/mplay_server.py --- a/orpg/networking/mplay_server.py Fri Apr 30 05:44:05 2010 -0500 +++ b/orpg/networking/mplay_server.py Sun May 02 16:30:28 2010 -0500 @@ -325,6 +325,7 @@ self.saveBanList() except Exception, e: self.log_msg("Exception in initBanList() " + str(e)) + self.log_msg( ('exception', str(e)) ) # This method writes out the server's ban list added by Darren def saveBanList( self ): @@ -343,6 +344,7 @@ file.close() except Exception, e: self.log_msg("Exception in saveBanList() " + str(e)) + self.log_msg( ('exception', str(e)) ) # This method reads in the server's configuration file and reconfigs the server # as needed, over-riding any default values as requested. @@ -526,6 +528,7 @@ except Exception, e: traceback.print_exc() self.log_msg("Exception in initServerConfig() " + str(e)) + self.log_msg( ('exception', str(e)) ) def makePersistentRooms(self): 'Creates rooms on the server as defined in the server config file.' @@ -571,6 +574,7 @@ return pr except: self.log_msg("Exception occured in isPersistentRoom(self,id)") + self.log_msg( ('exception', str(e)) ) return 0 #----------------------------------------------------- @@ -775,8 +779,8 @@ try: sentl = sock.send( lp ) # Send the encoded length sentm = sock.send( msg ) # Now, send the message the the length was describing - except socket.error, e: self.log_msg( e ) - except Exception, e: self.log_msg( e ) + except socket.error, e: self.log_msg( ('exception', str(e)) ); self.log_msg( e ) + except Exception, e: self.log_msg( e ); self.log_msg( ('exception', str(e)) ) def recvData( self, sock, readSize ): @@ -818,7 +822,7 @@ try: if useCompression and cmpType != None: msgData = cmpType.decompress(msgData) except: traceback.print_exc() - except Exception, e: self.log_msg( "Exception: recvMsg(): " + str(e) ) + except Exception, e: self.log_msg( "Exception: recvMsg(): " + str(e) ); self.log_msg( ('exception', str(e)) ) return msgData def kill_server(self): @@ -910,6 +914,7 @@ print except Exception, e: self.log_msg(str(e)) + self.log_msg( ('exception', str(e)) ) self.p_lock.release() """ @@ -996,6 +1001,7 @@ print except Exception, e: self.log_msg(str(e)) + self.log_msg( ('exception', str(e)) ) self.p_lock.release() """ @@ -1028,6 +1034,7 @@ print "\nStatistics: groups: " + str(len(self.groups)) + " players: " + str(len(self.players)) except Exception, e: self.log_msg(str(e)) + self.log_msg( ('exception', str(e)) ) self.p_lock.release() @@ -1045,6 +1052,7 @@ print "Bad Player Ref (#" + id + ") in group" except Exception, e: self.log_msg(str(e)) + self.log_msg( ('exception', str(e)) ) self.p_lock.release() def update_request(self,newsock, xml_dom): @@ -1110,7 +1118,7 @@ bad_xml_string += "Please report this bug to the development team at:
" bad_xml_string += "Traipse-Dev " bad_xml_string += "(http://www.assembla.com/spaces/traipse_dev/tickets/)
" - self.sendMsg( newsock, "" + bad_xml_string, + self.sendMsg( newsock, "" +bad_xml_string, new_stub.useCompression, new_stub.compressionType) time.sleep(2) @@ -1118,6 +1126,7 @@ print "Error in parse found from " + str(remote_host) + ". Disconnected." print " Offending data(" + str(len(data)) + "bytes)=" + data print "Exception=" + str(e) + self.log_msg( ('exception', str(e)) ) #if xml_dom: xml_dom.unlink() return @@ -1277,6 +1286,7 @@ except Exception, e: self.log_msg(("Error binding request socket!", e)) + self.log_msg( ('exception', str(e)) ) self.alive = 0 while self.alive: @@ -1293,9 +1303,10 @@ """ thread.start_new_thread(self.acceptedNewConnectionThread, ( newsock, addr )) - except: + except Exception, e: print "The following exception caught accepting new connection:" traceback.print_exc() + self.log_msg( ('exception', str(e)) ) # At this point, we're done and cleaning up. self.log_msg("server socket listening thread exiting...") @@ -1316,6 +1327,7 @@ try: newsock.close() except Exception, e: self.log_msg( str(e) ) + self.log_msg( ('exception', str(e)) ) print str(e) return #returning causes connection thread instance to terminate if data == "": @@ -1337,10 +1349,11 @@ except: try: newsock.close() - except: pass + except Exception, e: pass self.log_msg( "Error in parse found from " + str(addr) + ". Disconnected.") self.log_msg(" Offending data(" + str(len(data)) + "bytes)=" + data) self.log_msg( "Exception:") + self.log_msg( ('exception', str(e)) ) traceback.print_exc() return #returning causes connection thread instance to terminate @@ -1358,6 +1371,7 @@ print "The following message: " + str(data) print "from " + str(addr) + " created the following exception: " traceback.print_exc() + self.log_msg( ('exception', str(e)) ) return #returning causes connection thread instance to terminate """ @@ -1392,6 +1406,7 @@ data = None except Exception, e: self.log_msg(str(e)) + self.log_msg( ('exception', str(e)) ) self.log_msg("message handler thread exiting...") self.incoming_event.set() @@ -1410,11 +1425,14 @@ print "Error in parse of inbound message. Ignoring message." print " Offending data(" + str(len(data)) + "bytes)=" + data print "Exception=" + str(e) + self.log_msg( ('exception', str(e)) ) def message_action(self, xml_dom, data): tag_name = xml_dom.tag if self.svrcmds.has_key(tag_name): self.svrcmds[tag_name]['function'](xml_dom, data) - else: raise Exception, "Not a valid header!" + else: + raise Exception, "Not a valid header!" + self.log_msg( ('exception', 'Not a valid header!') ) #Message Action thread expires and closes here. return @@ -1518,6 +1536,7 @@ print "Bad input: " + data except Exception,e: self.log_msg(str(e)) + self.log_msg( ('exception', str(e)) ) def join_group(self, xml_dom, data): try: @@ -1551,6 +1570,7 @@ self.move_player(from_id, group_id) except Exception, e: self.log_msg(str(e)) + self.log_msg( ('exception', str(e)) ) """ # move_player function -- added by Snowdog 4/03 @@ -1568,6 +1588,7 @@ else: self.players[from_id].role = "Lurker" except Exception, e: print "exception in move_player() " + self.log_msg( ('exception', str(e)) ) traceback.print_exc() old_group_id = self.players[from_id].change_group(group_id, self.groups) @@ -1596,6 +1617,7 @@ except Exception, e: roomMsg = "" self.log_msg(str(e)) + self.log_msg( ('exception', str(e)) ) # Spit that darn message out now! self.players[from_id].outbox.put("" + roomMsg) @@ -1613,6 +1635,7 @@ self.handle_role("set", from_id, self.players[from_id].role, self.groups[group_id].boot_pwd, group_id) except Exception, e: self.log_msg(str(e)) + self.log_msg( ('exception', str(e)) ) thread.start_new_thread(self.registerRooms,(0,)) def return_room_roles(self, from_id, group_id): @@ -1771,7 +1794,7 @@ else: self.send_to_all("0",self.groups[group_id].toxml('update')) #The register Rooms thread thread.start_new_thread(self.registerRooms,(0,)) - except Exception, e: self.log_msg(str(e)) + except Exception, e: self.log_msg( ('exception', str(e)) ) def del_player(self, id, group_id): try: @@ -1789,7 +1812,7 @@ """ if self.be_registered: self.register() - except Exception, e: self.log_msg(str(e)) + except Exception, e: self.log_msg( ('exception', str(e)) ) self.log_msg("Explicit garbage collection shows %s undeletable items." % str(gc.collect())) def incoming_player_handler(self, xml_dom, data): @@ -1804,7 +1827,7 @@ try: self.send_player_list(id,group_id) self.send_group_list(id) - except Exception, e: traceback.print_exc() + except Exception, e: self.log_msg( ('exception', str(e)) ); traceback.print_exc() elif act=="del": self.del_player(id,group_id) self.check_group(id, group_id) @@ -1846,8 +1869,11 @@ to_id = xml_dom.get("to") from_id = xml_dom.get("from") group_id = xml_dom.get("group_id") + ## Backwards compatibility with older clients end = data.find(">") msg = data[end+1:] + if msg[-6:] == '': msg = msg[:-6] + data = msg if from_id == "0" or len(from_id) == 0: print "WARNING!! Message received with an invalid from_id. Message dropped." @@ -1872,7 +1898,7 @@ elif to_id.lower() == 'all': #valid map for all players that is not the lobby. self.send_to_group(from_id,group_id,data) - self.groups[group_id].game_map.init_from_xml(msg) + self.groups[group_id].game_map.init_from_xml(data) else: #attempting to send map to specific individuals which is not supported. self.players[from_id].self_message('Invalid map message. Message not sent to others.') @@ -1943,6 +1969,7 @@ print "due to the following exception:" traceback.print_exc() print "Ignoring boot message" + self.log_msg( ('exception', str(e)) ) def handle_boot(self,from_id,to_id,group_id,msg): xml_dom = None @@ -1952,10 +1979,11 @@ xml_dom = XML(msg) given_boot_pwd = xml_dom.get("boot_pwd") - except: + except Exception, e: print "Error in parse of boot message, Ignoring." print "Exception: " traceback.print_exc() + self.log_msg( ('exception', str(e)) ) try: actual_boot_pwd = self.groups[group_id].boot_pwd @@ -2008,6 +2036,7 @@ except Exception, e: traceback.print_exc() self.log_msg('Exception in handle_boot() ' + str(e)) + self.log_msg( ('exception', str(e)) ) finally: try: @@ -2015,6 +2044,7 @@ except Exception, e: traceback.print_exc() self.log_msg('Exception in xml_dom.unlink() ' + str(e)) + self.log_msg( ('exception', str(e)) ) """ # admin_kick function -- by Snowdog 4/03 @@ -2045,6 +2075,7 @@ except Exception, e: traceback.print_exc() self.log_msg('Exception in admin_kick() ' + str(e)) + self.log_msg( ('exception', str(e)) ) ### Alpha ### Addition added to assist in Un Banning users. def admin_build_banlist(self): @@ -2071,6 +2102,7 @@ except Exception, e: traceback.print_exc() self.log_msg('Exception in admin_banip() ' + str(e)) + self.log_msg( ('exception', str(e)) ) def admin_ban(self, id, message="", silent = 0): "Ban a player from a server from the console" @@ -2102,6 +2134,7 @@ except Exception, e: traceback.print_exc() self.log_msg('Exception in admin_ban() ' + str(e)) + self.log_msg( ('exception', str(e)) ) def admin_unban(self, ip): self.admin_build_banlist() @@ -2112,6 +2145,7 @@ except Exception, e: traceback.print_exc() self.log_msg('Exception in admin_unban() ' + str(e)) + self.log_msg( ('exception', str(e)) ) def admin_banlist(self): msg = [] @@ -2163,6 +2197,7 @@ except Exception, e: traceback.print_exc() self.log_msg("Exception: send_to_all(): " + str(e)) + self.log_msg( ('exception', str(e)) ) def send_to_group(self, from_id, group_id, data): #data = ("" + data + "") @@ -2176,6 +2211,7 @@ except Exception, e: traceback.print_exc() self.log_msg("Exception: send_to_group(): " + str(e)) + self.log_msg( ('exception', str(e)) ) def send_player_list(self,to_id,group_id): try: @@ -2187,6 +2223,7 @@ except Exception, e: traceback.print_exc() self.log_msg("Exception: send_player_list(): " + str(e)) + self.log_msg( ('exception', str(e)) ) def send_group_list(self, to_id, action="new"): try: @@ -2196,6 +2233,7 @@ except Exception, e: self.log_msg("Exception: send_group_list(): (client #"+to_id+") : " + str(e)) traceback.print_exc() + self.log_msg( ('exception', str(e)) ) """ # KICK_ALL_CLIENTS() @@ -2213,6 +2251,7 @@ except Exception, e: traceback.print_exc() self.log_msg("Exception: kick_all_clients(): " + str(e)) + self.log_msg( ('exception', str(e)) ) """ # This really has little value as it will only catch people that are hung @@ -2238,6 +2277,7 @@ self.admin_kick(k,"Removing dead client", self.silent_auto_kick) except Exception, e: self.log_msg("Exception: check_group_members(): " + str(e)) + self.log_msg( ('exception', str(e)) ) def remote_admin_handler(self,xml_dom,data): @@ -2387,6 +2427,7 @@ except Exception, e: self.log_msg("Exception: Remote Admin Handler Error: " + str(e)) traceback.print_exc() + self.log_msg( ('exception', str(e)) ) def toggleRemoteKill(self): if self.allowRemoteKill: self.allowRemoteKill = False @@ -2554,7 +2595,7 @@ pl += "" pl += "Statistics: groups: " + str(len(self.groups)) + " " pl += "players: " + str(len(self.players)) + "" - except Exception, e: self.log_msg(str(e)) + except Exception, e: self.log_msg(str(e)); self.log_msg( ('exception', str(e)) ) self.p_lock.release() return pl diff -r c719a07cd28d -r bb7b9648792c orpg/networking/mplay_server_gui.py --- a/orpg/networking/mplay_server_gui.py Fri Apr 30 05:44:05 2010 -0500 +++ b/orpg/networking/mplay_server_gui.py Sun May 02 16:30:28 2010 -0500 @@ -21,7 +21,7 @@ from xml.dom import minidom from orpg.orpgCore import component -from orpg.tools.orpg_log import debug +from orpg.tools.orpg_log import debug, DebugConsole from orpg.tools.orpg_settings import settings from xml.etree.ElementTree import ElementTree, Element, iselement @@ -384,6 +384,7 @@ cb["delete_group"] = self.OnDeleteGroup cb["join_group"] = self.OnJoinGroup cb['update_group'] = self.OnUpdateGroup + cb['exception'] = self.OnException cb["role"] = self.OnSetRole self.callbacks = cb @@ -439,6 +440,17 @@ self.Bind(wx.EVT_MENU, self.ConfigPingInterval, id=9) self.Bind(wx.EVT_MENU, self.LogToggle, id=10) self.mainMenu.Append( menu, '&Configuration') + + # Traipse Suite of Additions. + self.traipseSuite = wx.Menu() + self.debugger = DebugConsole(self) + self.mainMenu.Insert(3, self.traipseSuite, "&Traipse Suite") + + #Debugger Console + self.debugConsole = wx.MenuItem(self.traipseSuite, -1, "Debug Console", "Debug Console") + self.Bind(wx.EVT_MENU, self.OnMB_DebugConsole, self.debugConsole) + self.traipseSuite.AppendItem(self.debugConsole) + self.SetMenuBar(self.mainMenu) self.mainMenu.Enable(2, False) @@ -457,6 +469,40 @@ self.mainMenu.Enable(13, False) self.mainMenu.Enable(15, False) + def OnException(self, error): + self.TraipseSuiteWarn('debug') + self.debugger.console.AppendText(".. " + str(error) +'\n') + + def OnMB_DebugConsole(self, evt): + self.TraipseSuiteWarnCleanup('debug') + if self.debugger.IsShown() == True: self.debugger.Hide() + else: self.debugger.Show() + + def TraipseSuiteWarn(self, menuitem): + print 'traipse warn' #logger.debug('traipse warn') + ### Allows for the reuse of the 'Attention' menu. + ### component.get('frame').TraipseSuiteWarn('item') ### Portable + self.mainMenu.Remove(3) + self.mainMenu.Insert(3, self.traipseSuite, "&Traipse Suite!") + if menuitem == 'debug': + if self.debugger.IsShown() == True: + self.mainMenu.Remove(3) + self.mainMenu.Insert(3, self.traipseSuite, "&Traipse Suite") + else: + self.debugConsole.SetBitmap(wx.Bitmap(dir_struct["icon"] + 'spotlight.png')) + self.traipseSuite.RemoveItem(self.debugConsole) + self.traipseSuite.AppendItem(self.debugConsole) + + def TraipseSuiteWarnCleanup(self, menuitem): + ### Allows for portable cleanup of the 'Attention' menu. + ### component.get('frame').TraipseSuiteWarnCleanup('item') ### Portable + self.mainMenu.Remove(3) + self.mainMenu.Insert(3, self.traipseSuite, "&Traipse Suite") + if menuitem == 'debug': + self.traipseSuite.RemoveItem(self.debugConsole) + self.debugConsole.SetBitmap(wx.Bitmap(dir_struct["icon"] + 'clear.gif')) + self.traipseSuite.AppendItem(self.debugConsole) + def build_body(self): """ Create the ViewNotebook and logger. """ splitter = wx.SplitterWindow(self, -1, style=wx.NO_3D | wx.SP_3D) diff -r c719a07cd28d -r bb7b9648792c orpg/orpg_version.py --- a/orpg/orpg_version.py Fri Apr 30 05:44:05 2010 -0500 +++ b/orpg/orpg_version.py Sun May 02 16:30:28 2010 -0500 @@ -4,7 +4,7 @@ #BUILD NUMBER FORMAT: "YYMMDD-##" where ## is the incremental daily build index (if needed) DISTRO = "Traipse Beta" DIS_VER = "Ornery Orc" -BUILD = "100430-01" +BUILD = "100502-00" # This version is for network capability. PROTOCOL_VERSION = "1.2" diff -r c719a07cd28d -r bb7b9648792c orpg/templates/default_LobbyMessage.html --- a/orpg/templates/default_LobbyMessage.html Fri Apr 30 05:44:05 2010 -0500 +++ b/orpg/templates/default_LobbyMessage.html Sun May 02 16:30:28 2010 -0500 @@ -1,40 +1,38 @@ - - - - - - - - -
-
-
- - - - - - - -
- Many thanks goes to all of those who contributed! -
- The developers in alphabetical order are: -
- Thomas Baleno, Andrew Bennett, Lex Berezhny, Ted Berg, - Bernhard Bergbauer, Chris Blocher ,Ben Collins-Sussman, Robin Cook, Greg Copeland, - Chris Davis, Michael Edwards, Andrew Ettinger, Dj Gilcrease, Todd Faris, - Christopher Hickman, Paul Hosking, Scott Mackay, Brian Manning, - Jesse McConnell, Brian Osman, Rome Reginelli, Christopher Rouse, Dave Sanders, Mark Tarrabain, - David Byron, David, Vrabel, and Tyler Starke. -
- This product is licensed under the GNU GPL License. -
-
- - + + + + + + + + + +
+ Welcome to an OpenRPG Server +
+ Add a message here. +
+ The OpenRPG Project +
+ Who is this force? +
+ Here is an example Room Message that can be easily modified to fit the needs of your server. + The room message has two rows and two cells. One row is for headers, and one row is for cells. + The main area here can be an introduction, and the side area to the right can contain a game schedule. +

If you have created a Wiki or forums, be sure and put links to those as well.

+
+ Thomas Baleno, Andrew Bennett, Lex Berezhny, Ted Berg, + Bernhard Bergbauer, Chris Blocher, Ben Collins-Sussman, Robin Cook, Greg Copeland, + Chris Davis, Michael Edwards, Andrew Ettinger, Dj Gilcrease, Todd Faris, + Christopher Hickman, Paul Hosking, Scott Mackay, Brian Manning, + Jesse McConnell, Brian Osman, Rome Reginelli, Christopher Rouse, Dave Sanders, Mark Tarrabain, + David Byron, David Vrabel, and Tyler Starke. +

And of course, the Community!

+

Many thanks to all who contributed!

+
+ diff -r c719a07cd28d -r bb7b9648792c orpg/templates/feature.xml --- a/orpg/templates/feature.xml Fri Apr 30 05:44:05 2010 -0500 +++ b/orpg/templates/feature.xml Sun May 02 16:30:28 2010 -0500 @@ -1,6 +1,7 @@ - - Welcome to Traipse OpenRPG. + + + Welcome to Traipse OpenRPG. This small user manual should help users learn about the details of OpenRPG that are often times obscure. @@ -17,14 +18,19 @@ Adding to the Manual: Do you see something that could be explained eaiser? Report the problem as a bug and it will be added to the manual. - - The Chat window is a basic HTML Parser. It understands all basic HTML tags including table, td, tr, span, font, to name a few. + + + + The Chat window is a basic HTML Parser. It understands all basic HTML tags including table, td, tr, span, font, to name a few. The chat includes a set of commands. You can learn about the commands by entering /help The chat also has Settings in the Chat menu that allow you see a Chat Time Index, Images, or strip the HTML and see raw text. - - The Tabs: + + + + + The Tabs: The Map is divided into 7 tabs. They are Background, Grid, Miniatures, Whiteboard, Fog, and General. There are 6 layers to the map, one tab for each layer except General. When you select one of the tabs you may access that map layer and it's settings. You may only select tabs based on your role. @@ -56,8 +62,54 @@ Fog: The fog layer hides the entire map from the prying eyes of players. - - Quick Help: + + + + + Persistant users who wanted the stability of Traipse and the ease of Namespace have described to me how they envision Namespace should work. When I heard this I immediately realized that my method provided the aspects users wanted, but not simplicity in design this method would provide. The Traipse Namespace is a little different than Standard but it offers more stability in it's approach + + There are two methods provided with the Traipse Namespace, and these two allow you to a great deal of control when you choose to use Namespace to reference your nodes. + +There is only one difference in how these two methods work, so once you get the hang of Namespace, you will always know how it works. The difference is, External starts looking from the Game Tree and gets more narrow where as Internal starts from the node it is inside and searchs backwards getting more broad. + + + Namespace Internal: +(Syntax) !=Node=! + +Usage: When you use Namespace Internal the software finds the tree map of the node and searches for the top node. Once that node is found it will iterate through the node and look for the reference you have assigned. If it cannot find it in that node, then it will iterate through the map, finding all successive nodes and searching them + + Namespace Internal is completely context sensitive. You can assign a reference using the Namespace Internal method and it will always find the correct PC Sheet to search in. + +Namespace Internal must be used from within a node. + +Namespace External: +(Syntax) !&Top Node::Node&! + +Usage: Namespace External is a different approach to Namespace. With Namespace External you can use the syntax in chat or in other nodes to cross reference nodes. Instead of External being context sensitive, External uses a broadscope that you can narrow down. + + It is really easy to narrow down External. External doesn't work like a string, it works like a lightning bolt. To get a good example open up the 4e PC Sheet node that comes with Traipse and try some different commands in chat. + +<b>1:</b> !&4e PC Sheet::Slot 1&! +<b>2:</b> !&4e PC Sheet::Belt:: Slot 1&! +<b>3:</b> !&4e PC Sheet::Inventory&! +<b>4:</b> !&4e PC Sheet::Inventory::Slot 1&! + + Did you see what happened with the last two? Thankfully there is more than one way to get a node! + +(Create a 4e PC Sheet node from the Templates and press Send ---v to try it) + + + Grids can now be called from by adding a Row, Column to the end of the grid reference. + +Example: !&Abilities::2,2&! + + + Quick Help: + +Designer Note: +=== +For the life span of Ornery Orc the new Child, Parent, Root reference will exist, but in Pious the reference system will not transfer. This is because of the way the new Namespace works. Namespace will become the exclusive referencing system +=== The referencing system is an update to the Core of how the Game Tree works. In it's current state I understand the syntax is difficult to pick up. Here are some tips to help you grasp the syntax further @@ -114,86 +166,69 @@ In the OpenRPG Core model your Game Tree has a lot more freedom, but only if you grant it, which I always felt was a design flaw. Comparably, with Traipse you can access any data on the Game Tree, no matter where the location. This freedom will help with future design and I feel it also frees up the hands of the GM who does not need to Index, un-Index, Namespace, un-Namspace the various creatures he or she may have in a Game Tree. - - <b>Root Reference</b> + + + <b>Root Reference</b> Works at the tree level. Must be exact. <b>Root Reference 1:</b> !@Reference Examples::Group::Child@! -<b>Root Reference 2:</b> !@Reference Examples::Grid::(2,1)@! - - <b>Grid Reference</b> +<b>Root Reference 2:</b> !@Reference Examples::Grid::2,1@! + + + <b>Grid Reference</b> Works by looking at the (Row, Column) of a Grid. -<b>Grid Reference 1:</b> !@Reference Examples::Grid::(1,1)@! -<b>Grid Reference 2:</b> !!Grid::(1,1)!! - - <b>Child Reference</b> +<b>Grid Reference 1:</b> !@Reference Examples::Grid::1,1@! +<b>Grid Reference 2:</b> !!Grid::1,1!! + + + <b>Child Reference</b> Works at the current tree location. <b>Child Reference 1:</b> !!Group::Child!! <b>Child Reference 2:</b> !!Group::Group_2::Child_2!! - - <b>Parent Reference</b> + + + <b>Parent Reference</b> Works by indexing the tree map of the node with the Reference. Allows you to start from a 'Parent'. <b>Parent Reference 1:</b> !!Group::Group_2::Child_2!! <b>Parent Reference 2:</b> !#Bonus Nodes::Deck::Draw#! - - - - !#Group::Child#! - - - !#Group::Child#! - - Child Node Data - - - - 0 - 0 - - - !!Group::Child!! - 0 - - - - - - With the new additions to the Game Tree using nodes has never been easier nor has it ever been more fluid. Included here is a list of the additions to the Game Tree referencing model as well as some tips on how to make the Game Tree work the way it was intended. - -Grid Nodes: - Grid nodes are now reference-able with the coordinates of the grid. Example: !@Grid::(1,1)@! -The example will return the top left most cell data. The grid understands coordinates like this (Row, Column) - - Grid nodes can reference node data just like any other node can. With a new added feature grids are even more useful. By using a new die rolling syntax you can draw just the number of the modified roll. While this will not pass during game play, you can use it with the grid node to create a random chart. The new die roll syntax is [#XdY]. # works just like q, yet it returns only the modified die result. - - Here is an example with a 3 x 3 Grid -Example: !@Grid::([#1d3], [#1d3])@! - -The result will be a random event from the grid. - -Bonus Node Included: A 52 Card Deck with 4 columns and 13 rows. (4 * 13 = 52) - -List Nodes: - List nodes now have a check box that allows users to send the content as a macro. List nodes are a prime reference holder because users can place a lot of references into one small node. - - For the best results from a list node my tip to users would be to create a list node and place it next to the character sheet they are using, inside a the PC Sheet. The list will then use the Child Referencing syntax, but the PC Sheet can go anywhere in the tree and the player will have easy access to all the references. - -(List Nodes inside a Tool created PC sheet vanish when moved, or I would recommend the list be placed inside these sheets also.) - - Here is an example of a Fortitude save inside the recommended list node: !!Fort::Check!! - -Text Nodes: - Text nodes remain little changed. I agree with all the 1.7.1 users who tell me, if it's not broke don't fix it. With that in mind I have some good tips for text nodes. - - Text nodes can be used in conjunction with the new grid features to create random encounters. A GM could place a list of text nodes into a folder and the grid could reference the nodes. - - Text nodes also work great when you need to have story text at hand that you don't want to type out during play. Create chapters with folder nodes and add the adventure text to different nodes. You can then use a List Node or a Grid Node to reference the different chapters. - -Bonus Node Included: A small book node with 1 Chapter and 3 Parts. Traipse node referencing is unlike other distributions of OpenRPG. The Game Tree mapping is a fluid map that changes with the location of your nodes. This allows you to create a reference node that will stay with your character sheet, and if you change the location of your character sheet the reference will still work. + + + + + !#Group::Child#! + + + + !#Group::Child#! + + + + + Child Node Data + + + + + + 0 + 0 + + + !!Group::Child!! + 0 + + + + + + + + + Traipse node referencing is unlike other distributions of OpenRPG. The Game Tree mapping is a fluid map that changes with the location of your nodes. This allows you to create a reference node that will stay with your character sheet, and if you change the location of your character sheet the reference will still work. (Note: Renaming your node causes problems with the tree mapping until you restart the software. You can just move the node and the software will reset the Game Tree map) @@ -245,8 +280,46 @@ Examples: !@Kammen-Pai::Cast::Ray of Frost@! -!@Kammen-Pai::Feat::Ability Focus@! - In Traipse starting a server has never been easier. The setup is as easy as 1., 2., 3 +!@Kammen-Pai::Feat::Ability Focus@! + + + With the new additions to the Game Tree using nodes has never been easier nor has it ever been more fluid. Included here is a list of the additions to the Game Tree referencing model as well as some tips on how to make the Game Tree work the way it was intended. + +Grid Nodes: + Grid nodes are now reference-able with the coordinates of the grid. Example: !@Grid::(1,1)@! +The example will return the top left most cell data. The grid understands coordinates like this (Row, Column) + + Grid nodes can reference node data just like any other node can. With a new added feature grids are even more useful. By using a new die rolling syntax you can draw just the number of the modified roll. While this will not pass during game play, you can use it with the grid node to create a random chart. The new die roll syntax is [#XdY]. # works just like q, yet it returns only the modified die result. + + Here is an example with a 3 x 3 Grid +Example: !@Grid::([#1d3], [#1d3])@! + +The result will be a random event from the grid. + +Bonus Node Included: A 52 Card Deck with 4 columns and 13 rows. (4 * 13 = 52) + +List Nodes: + List nodes now have a check box that allows users to send the content as a macro. List nodes are a prime reference holder because users can place a lot of references into one small node. + + For the best results from a list node my tip to users would be to create a list node and place it next to the character sheet they are using, inside a the PC Sheet. The list will then use the Child Referencing syntax, but the PC Sheet can go anywhere in the tree and the player will have easy access to all the references. + +(List Nodes inside a Tool created PC sheet vanish when moved, or I would recommend the list be placed inside these sheets also.) + + Here is an example of a Fortitude save inside the recommended list node: !!Fort::Check!! + +Text Nodes: + Text nodes remain little changed. I agree with all the 1.7.1 users who tell me, if it's not broke don't fix it. With that in mind I have some good tips for text nodes. + + Text nodes can be used in conjunction with the new grid features to create random encounters. A GM could place a list of text nodes into a folder and the grid could reference the nodes. + + Text nodes also work great when you need to have story text at hand that you don't want to type out during play. Create chapters with folder nodes and add the adventure text to different nodes. You can then use a List Node or a Grid Node to reference the different chapters. + +Bonus Node Included: A small book node with 1 Chapter and 3 Parts. + + + + + In Traipse starting a server has never been easier. The setup is as easy as 1., 2., 3 1. You will need to first start the Server GUI or the basic text based Server at least once so your software creates the server_ini.xml files in your myfiles directory. You can start it once and quit. @@ -257,174 +330,282 @@ 3. This is the hardest step. You need to make sure your selected port is forwarded by your router and open to your firewall. That's it! You can now start the server and register it to the meta for all users to enjoy! - - - - - - - - - - - - - - - - <br /> + + + + + + + + + + + + + + + + + + + + + + + <br /> <b>Chapter 1 Part 1</b> <br /><br /> An introduction to your adventure module can be placed here. - - <br /> + + + <br /> <b>Chapter 1 Part 2</b> <br /><br /> The adventurers have come this far. - - <br /> + + + <br /> <b>Chapter 1 Part 3</b> <br /><br /> Is this the end already? - - - - - AS - AD - ACAH - - KS - KD - KCKH - QSQDQCQHJSJDJCJH10S10D10C10H9S9D9C9H8S8D8C8H7S7D7C7H6S6D6C6H5S5D5C5H4S4D4C4H3S3D3C3H2S2D2C2H - - - - - !!52 Card Deck::([#1d13], [#1d4])!! - - - - - - - - - - !!Set 1::Enc 1!! - !!Set 2::Enc 1!! - - !!Set 1::Enc 2!! - !!Set 2::Enc 2!! - !!Set 1::Enc 3!! - - - - - - Hoot Hoot. It's an owl. - - Set 2 Random Encounter. - - - Dark Elves. Watch out! - - Kobolds a plenty. - - A Wandering Minotaur - - - - - - - - - - - + + + + + + + + AS + AD + AC + AH + + + KS + KD + KC + KH + + + QS + QD + QC + QH + + + JS + JD + JC + JH + + + 10S + 10D + 10C + 10H + + + 9S + 9D + 9C + 9H + + + 8S + 8D + 8C + 8H + + + 7S + 7D + 7C + 7H + + + 6S + 6D + 6C + 6H + + + 5S + 5D + 5C + 5H + + + 4S + 4D + 4C + 4H + + + 3S + 3D + 3C + 3H + + + 2S + 2D + 2C + 2H + + + + + + + + !=52 Card Deck::([#1d13], [#1d4])=! + + + + + + + + + + + + + !=Set 1::Enc 1=! + !=Set 2::Enc 1=! + + + !=Set 1::Enc 2=! + !=Set 2::Enc 2=! + + + !=Set 1::Enc 3=! + + + + + + + + + + Hoot Hoot. It's an owl. + + + Set 2 Random Encounter. + + + + + Dark Elves. Watch out! + + + Kobolds a plenty. + + + A Wandering Minotaur + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + - - - - - - - - - - - - - - - + + - - - - + + - - - - - + + - - + + - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + \ No newline at end of file diff -r c719a07cd28d -r bb7b9648792c orpg/templates/nodes/4e_char_sheet.xml --- a/orpg/templates/nodes/4e_char_sheet.xml Fri Apr 30 05:44:05 2010 -0500 +++ b/orpg/templates/nodes/4e_char_sheet.xml Sun May 02 16:30:28 2010 -0500 @@ -1,4 +1,4 @@ -This node is designed to be as generic as possible. It should contain the core basics for users to fill out with game information that is specific to their character. +This node is designed to be as generic as possible. It should contain the core basics for users to fill out with game information that is specific to their character. The node is also designed to be organized with speed of use in mind. Since the majority of nodes are inside Tabbers you can easily use the top node and find all of your data inside. In fact, that is how I am writing this. @@ -13,7 +13,7 @@ Combat: This contains grids so you can reference your weapon dice, armor bonuses, feat bonuses .. and they too can use references so if you change a number the software does the math. -Inventory: You guess it. It comes with a Back Pack text node that you can clone to make bags and other containers.Inside the Rollers tab you will find 5 lists. You can use these lists to add new references to nodes. The Rollers tab is also a Tabber node itself, so you can just double click the Rollers node to get all of your rollers in one window. You can also edit all of your rollers in one window when you enter into the Design mode of the Rollers tabber.This form contains a some text nodes that hold basic information about your character. In some Powers the Level and Tier are used to calculate bonuses. You can reference those nodes to make the math easierThe Abilities Grid contains the 6 abilities all set at values of 8. The third column is the math calculation for the modifier. You can reference that grid column to assist in your math calculations.The Combat Tabber contains a number of Grid nodes to assist in your combat calculations. Some grids contain a grid cell called Total. +Inventory: You guess it. It comes with a Back Pack text node that you can clone to make bags and other containers.Inside the Rollers tab you will find 5 lists. You can use these lists to add new references to nodes. The Rollers tab is also a Tabber node itself, so you can just double click the Rollers node to get all of your rollers in one window. You can also edit all of your rollers in one window when you enter into the Design mode of the Rollers tabber.This form contains a some text nodes that hold basic information about your character. In some Powers the Level and Tier are used to calculate bonuses. You can reference those nodes to make the math easierThe Abilities Grid contains the 6 abilities all set at values of 8. The third column is the math calculation for the modifier. You can reference that grid column to assist in your math calculations.The Combat Tabber contains a number of Grid nodes to assist in your combat calculations. Some grids contain a grid cell called Total. To Hit: The To Hit Bonus. This Grid contains a cell called Total. You can add new rows to the grid when you are granted bonuses and then add those references to the total. @@ -23,50 +23,50 @@ AC Bonus: This Grid contains a cell called Total. You can add new rows to the grid when you are granted bonuses and then add those references to the total. -Feats: Some feats add bonusus to hit or damage. When these bonuses are calculated you can add them here and the math easier for you.This Tabber contains a Tabber for At Will, Encounter and Daily. Each tabber contains a node for levels 0 and 1. You can add new tabbers when you reach higher levels. +Feats: Some feats add bonusus to hit or damage. When these bonuses are calculated you can add them here and the math easier for you.This Tabber contains a Tabber for At Will, Encounter and Daily. Each tabber contains a node for levels 0 and 1. You can add new tabbers when you reach higher levels. Inside the 0 Level tabber for each Utility there is a text node that contains a an attack roll and a damage roll. -** I went with this format so users could create their Utility nodes and share with others. The nodes can contain Role Play information as well as attack and damage rolls. Also, the nodes can be completely genric, referencing the Name Text node and still look specific **It's just a node to hold your Inventory +** I went with this format so users could create their Utility nodes and share with others. The nodes can contain Role Play information as well as attack and damage rolls. Also, the nodes can be completely genric, referencing the Name Text node and still look specific **It's just a node to hold your Inventory This bears repeating: -It comes with a Back Pack text node that you can clone to make bags and other containers. +It comes with a Back Pack text node that you can clone to make bags and other containers. - - - + + + - + - - + + - - + + - - + + - - + + - - - + + + text - + text - + text - + text - + 1 - + 1 - + Weapon @@ -80,7 +80,7 @@ - + Armor @@ -88,13 +88,13 @@ Total - !!To Hit::(3,2)!! + !!To Hit::(4,2)!! + !=To Hit::(3,2)=! + !=To Hit::(4,2)=! - BAB15Str Mod!#Abilities::(1,3)#! + BAB15Str Mod!=Abilities::(1,3)=! - + Armor @@ -102,13 +102,13 @@ Total - !!AC Bonus::(3,2)!!+!!AC Bonus::(4,2)!! + !=AC Bonus::(3,2)=!+!=AC Bonus::(4,2)=! - Armor!!Armor::(2,2)!! + Armor!!Armor::(2,2)!!Misc0 - + Armor @@ -116,74 +116,74 @@ Total - !!Armor::(3,2)!! + !=Armor::(3,2)=! Base10ArmorShield - + Armor - Bonus + Bonus Descripton Total - !!Feats::(3,2)!! + !=Feats::(3,2)=! Feat0 - + Str 12 - (!!Abilities::(1,2)!!-10)/2 + (!=Abilities::(1,2)=!-10)/2 Dex 8 - (!!Abilities::(2,2)!!-10)/2 + (!=Abilities::(2,2)=!-10)/2 Con 14 - (!!Abilities::(3,2)!!-10)/2 + (!=Abilities::(3,2)=!-10)/2 Int 18 - (!!Abilities::(4,2)!!-10)/2 + (!=Abilities::(4,2)=!-10)/2 Wis 8 - (!!Abilities::(5,2)!!-10)/2 + (!=Abilities::(5,2)=!-10)/2 Cha 8 - (!!Abilities::(6,2)!!-10)/2 + (!=Abilities::(6,2)=!-10)/2 - + /me uses an At Will <b>Attack:</b> [1d20+2+!#Abilities::(2,3)#!] <b>Damage:</b> [2!#Combat::Weapons::(2,2)#!] - + /me uses an Encounter <b>Attack:</b> [1d20+2+!#Abilities::(2,3)#!] <b>Damage:</b> [2!#Combat::Weapons::(2,2)#!] - + /me uses an Daily <b>Attack:</b> [1d20+2+!#Abilities::(2,3)#!] <b>Damage:</b> [2!#Combat::Weapons::(2,2)#!] - + Nothing - + Nothing - + Nothing - + Nothing \ No newline at end of file diff -r c719a07cd28d -r bb7b9648792c orpg/templates/nodes/textctrl.xml --- a/orpg/templates/nodes/textctrl.xml Fri Apr 30 05:44:05 2010 -0500 +++ b/orpg/templates/nodes/textctrl.xml Sun May 02 16:30:28 2010 -0500 @@ -1,4 +1,1 @@ - - - text - +Text \ No newline at end of file diff -r c719a07cd28d -r bb7b9648792c orpg/tools/InterParse.py --- a/orpg/tools/InterParse.py Fri Apr 30 05:44:05 2010 -0500 +++ b/orpg/tools/InterParse.py Sun May 02 16:30:28 2010 -0500 @@ -152,8 +152,13 @@ return False def NameSpaceI(self, s, node): - reg = re.compile("(!=(.*?)=!)") - matches = reg.findall(s) + reg1 = re.compile('(!"(.*?)"!)') ## Easter Egg! + """If you found this you found my first easter egg. I was tired of people telling me multiple + references syntax for the game tree is confusing, so I dropped this in there without telling + anyone. Using !" :: "! will allow you to use an internal namespace from within another internal + namespace -- TaS, Prof. Ebral""" + reg2 = re.compile("(!=(.*?)=!)") + matches = reg1.findall(s) + reg2.findall(s) tree_map = node.get('map') for i in xrange(0,len(matches)): ## Build the new tree_map @@ -163,6 +168,7 @@ node = self.get_node(new_map) newstr = self.LocationCheck(node, tree_map, new_map, find) s = s.replace(matches[i][0], newstr, 1) + s = self.ParseLogic(s, node) return s def NameSpaceE(self, s): diff -r c719a07cd28d -r bb7b9648792c plugins/xxstdnamespace.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/xxstdnamespace.py Sun May 02 16:30:28 2010 -0500 @@ -0,0 +1,101 @@ +import os, wx, re +import orpg.pluginhandler +from orpg.tools.InterParse import Parse +from orpg.orpgCore import component +from xml.etree.ElementTree import iselement + +class Plugin(orpg.pluginhandler.PluginHandler): + # Initialization subroutine. + # + # !self : instance of self + # !openrpg : instance of the the base openrpg control + def __init__(self, plugindb, parent): + orpg.pluginhandler.PluginHandler.__init__(self, plugindb, parent) + + # The Following code should be edited to contain the proper information + self.name = 'Standard Namespace' + self.author = 'Prof. Ebral' + self.help = 'The Standard Namespace plugin allows for users of Traipse to use ' + self.help += 'the Standard Namespace syntax of !@ :: @!\n\n' + self.help += 'This plugin modifies the External method, so context sensivity\n' + self.help += 'is not calculted when using the Standard syntax. References must\n' + self.help += 'a unique name.' + + self.parseMethods = {'Traipse': Parse.NameSpaceE, 'Standard': self.NameSpaceS} + + def NameSpaceS(self, s): ## Re define NameSpace External + reg1 = re.compile("(!@(.*?)@!)") ## Inlcude 'Standard' method + reg2 = re.compile("(!&(.*?)&!)") + matches = reg1.findall(s) + reg2.findall(s) + newstr = False + nodeable = ['rpg_grid_handler', 'container_handler', + 'group_handler', 'tabber_handler', + 'splitter_handler', 'form_handler', 'textctrl_handler'] + for i in xrange(0,len(matches)): + find = matches[i][1].split('::') + node = component.get('tree').xml_root + if not iselement(node): + s = s.replace(matches[i][0], 'Invalid Reference!', 1); + s = Parse.NameSpaceE(s) + return s + for x in xrange(0, len(find)): + namespace = node.getiterator('nodehandler') + for node in namespace: + if find[x] == node.get('name'): + if node.get('class') not in nodeable: continue + if node.get('class') == 'rpg_grid_handler': + try: newstr = self.NameSpaceGrid(find[x+1], node); break + except: newstr = 'Invalid Grid Reference!' + try: + if Parse.FutureCheck(node, find[x+1]): break + else: continue + except: + if x == len(find)-1: + if node.find('text') != None: newstr = str(node.find('text').text) + else: newstr = 'Invalid Reference!' + break + else: break + if not newstr: newstr = 'Invalid Reference!' + s = s.replace(matches[i][0], newstr, 1) + s = Parse.ParseLogic(s, node) + return s + + def plugin_menu(self): + ## This is a standardized Menu item. It connects to plugin_toggle where you can set events. + self.menu = wx.Menu() + self.toggle = self.menu.AppendCheckItem(wx.ID_ANY, 'On') + self.topframe.Bind(wx.EVT_MENU, self.plugin_toggle, self.toggle) + self.toggle.Check(True) + + def plugin_toggle(self, evt): + if self.toggle.IsChecked() == True: + Parse.NameSpaceI = self.parseMethods['Standard'] + self.plugindb.SetString('xxstdnamespace', 'Standard', 'True') + if self.toggle.IsChecked() == False: + Parse.NameSpaceI = self.parseMethods['Traipse'] + self.plugindb.SetString('xxstdnamespace', 'Standard', 'False') + pass + + def plugin_enabled(self): + self.onoroff = self.plugindb.GetString('xxstdnamespace', 'Standard', '') or 'False' + self.toggle.Check(True) if self.onoroff == 'True' else self.toggle.Check(False) + Parse.NameSpaceE = self.parseMethods['Standard'] if self.onoroff == 'True' else self.parseMethods['Traipse'] + pass + + def plugin_disabled(self): + Parse.NameSpaceE = self.parseMethods['Traipse'] + + def pre_parse(self, text): + return text + + def send_msg(self, text, send): + return text, send + + def plugin_incoming_msg(self, text, type, name, player): + return text, type, name + + def post_msg(self, text, myself): + return text + + def refresh_counter(self): + pass diff -r c719a07cd28d -r bb7b9648792c upmana/updatemana.py --- a/upmana/updatemana.py Fri Apr 30 05:44:05 2010 -0500 +++ b/upmana/updatemana.py Sun May 02 16:30:28 2010 -0500 @@ -83,26 +83,34 @@ self.Bind(wx.EVT_TIMER, self.OnTimer, self.timer) def OnTimer(self, event): + statbar.SetStatusText('Checking For Updates') self.count = self.count + 1 self.buttons['progress_bar'].SetValue(self.count) if self.count == 100: self.timer.Stop() - statbar.SetStatusText('Checking For Updates') + statbar.SetStatusText('No Updates Available') def UpdateCheck(self): self.timer.Start(100) self.count = 3 self.buttons['progress_bar'].SetValue(3) - doUpdate = commands.incoming(self.ui, self.repo, - manifest.GetString('default', 'repo', ''), force=True, bundle=False) - if doUpdate: - statbar.SetStatusText('No Updates Available') + try: + doUpdate = commands.incoming(self.ui, self.repo, + manifest.GetString('default', 'repo', ''), + force=True, bundle=False) + if doUpdate: + statbar.SetStatusText('No Updates Available') + self.buttons['progress_bar'].SetValue(100) + self.timer.Stop() + else: + statbar.SetStatusText('Refresh Repo For Updated Source') + self.buttons['progress_bar'].SetValue(100) + self.timer.Stop() + except: + statbar.SetStatusText('No Connection Found') self.buttons['progress_bar'].SetValue(100) self.timer.Stop() - else: - statbar.SetStatusText('Refresh Repo For Updated Source') - self.buttons['progress_bar'].SetValue(100) - self.timer.Stop() + def ToggleAutoUpdate(self, event): if self.buttons['auto_check'].GetValue() == True: @@ -149,11 +157,11 @@ os.removedirs(temp+dir1) def LoadDoc(self): - ignore = open(self.filename) + manifest = open(self.filename) self.ignorelist = [] - for i in ignore: self.ignorelist.append(str(i [:len(i)-1])) - manifest = ignore.readlines() - ignore.close() + ignore = manifest.readlines() + for i in ignore: print i; self.ignorelist.append(str(i[:len(i)-1])) + manifest.close() def Finish(self, evt=None): component.get('upmana-win').OnClose(None) @@ -611,11 +619,11 @@ dlg.Destroy(); pass def LoadDoc(self): - ignore = open(self.filename) + manifest = open(self.filename) self.ignorelist = [] - for i in ignore: self.ignorelist.append(str(i [:len(i)-1])) - manifest = ignore.readlines() - ignore.close() + ignore = manifest.readlines() + for i in ignore: print i; self.ignorelist.append(str(i[:len(i)-1])) + manifest.close() def get_packages(self, type=None): #Can be cleaner @@ -747,24 +755,24 @@ class updateApp(wx.App): def OnInit(self): - self.main = False - + self.main = False; self.autoUpdate = False; self.noUpdate = False logger._set_log_to_console(False) logger.note("Updater Start") component.add('validate', validate) self.updater = updaterFrame(self, "OpenRPG Update Manager 1.2", component, manifest, self.main) if manifest.GetString("updatemana", "auto_update", "") == 'on' and self.main == False: - self.AutoUpdate(); self.OnExit() + self.AutoUpdate(); self.OnExit(); self.autoUpdate = True else: pass if manifest.GetString('updatemana', 'no_update', '') == 'on' and self.main == False: - self.OnExit() + self.OnExit(); self.noUpdate = True else: pass - try: - self.updater.Show() - self.updater.Fit() - except: pass - if not self.main: self.updater.page1.UpdateCheck() + if not (self.autoUpdate or self.noUpdate): + try: + self.updater.Show() + self.updater.Fit() + if not self.main: self.updater.page1.UpdateCheck() + except: pass return True def AutoUpdate(self): @@ -773,13 +781,16 @@ self.c = self.repo.changectx('tip') self.current = self.repo.dirstate.branch() - capture = manifest.GetString('updaterepo', 'default', '') + capture = manifest.GetString('default', 'repo', '') if capture != '': - commands.pull(self.ui, self.repo, capture, rev='', update=False, force=True) + try: commands.pull(self.ui, self.repo, capture, rev='', update=False, force=True) + except: + wx.MessageBox('No Connection Found. Skipping Auto Update!', 'Info') + return filename = 'ignorelist.txt' self.filename = dir_struct["home"] + 'upmana' + os.sep + filename component.get('validate').config_file(filename, "default_ignorelist.txt") - self.mana = self.LoadDoc() + self.mana = self.LoadDoc(); ignored = [] temp = dir_struct["home"] + 'upmana' + os.sep + 'tmp' + os.sep for ignore in self.ignorelist: if len(ignore.split('/')) > 1: @@ -788,25 +799,27 @@ dir1 += ignore.split('/')[gets] + os.sep gets += 1 os.makedirs(temp+dir1) - shutil.copy(ignore, temp + dir1 + ignore.split('/')[len(ignore.split('/')) - 1]) + ignoredfile = temp + dir1 + ignore.split('/')[len(ignore.split('/')) - 1] + ignored.append(ignoredfile) + shutil.copy(ignore, ignoredfile) hg.clean(self.repo, self.current) for ignore in self.ignorelist: - shutil.copyfile(temp + ignore.split('/')[len(ignore.split('/')) - 1], ignore) - os.remove(temp + ignore.split('/')[len(ignore.split('/')) - 1]) + shutil.copyfile(ignored.index(ignore), ignore) + os.remove(ignored.index(ignore)) if len(ignore.split('/')) > 1: gets = 0; dir1 = '' while gets != len(ignore.split('/'))-1: dir1 += ignore.split('/')[gets] + os.sep gets += 1 os.removedirs(temp+dir1) - else: wx.MessageBox('No default Rpository set. Skipping Auto Update!', 'Info') + else: wx.MessageBox('Default Repo Not Found. Skipping Auto Update!', 'Info') def LoadDoc(self): - ignore = open(self.filename) + manifest = open(self.filename) self.ignorelist = [] - for i in ignore: self.ignorelist.append(str(i [:len(i)-1])) - manifest = ignore.readlines() - ignore.close() + ignore = manifest.readlines() + for i in ignore: print i; self.ignorelist.append(str(i[:len(i)-1])) + manifest.close() def OnExit(self): imported = ['manifest', 'orpg.dirpath', 'orpg.orpgCore', 'orpg.orpg_version',