Mercurial > traipse_dev
diff orpg/main.py @ 118:217fb049bd00 alpha
Traipse Alpha 'OpenRPG' {091028-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 Bookmarks (Alpha) with cool Smiley Star and Plus Symbol images!
Changes made to the map for increased portability. SnowDog has changes planned in
Core, though.
Added an initial push to the BCG. Not much to see, just shows off how it is
re-writing Main code.
Fix to remote admin commands
Minor fix to texted based server, works in /System/ folder
Some Core changes to gametree to correctly disply Pretty Print, thanks David!
Fix to Splitter Nodes not being created.
Added images to Plugin Control panel for Autostart feature
Fix to massive amounts of images loading; from Core
fix to gsclient so with_statement imports
Added 'boot' command to remote admin
Prep work in Pass tool for remote admin rankings and different passwords, ei,
Server, Admin, Moderator, etc.
Remote Admin Commands more organized, more prep work.
Added Confirmation window for sent nodes.
Minor changes to allow for portability to an OpenSUSE linux OS (hopefully without
breaking)
{091028}
00:
Made changes to gametree to start working with Element Tree, mostly from Core
Minor changes to Map to start working with Element Tree, from Core
Preliminary changes to map efficiency, from FlexiRPG
Miniatures Layer pop up box allows users to turn off Mini labels, from FlexiRPG
Changes to main.py to start working with Element Tree
author | sirebral |
---|---|
date | Wed, 28 Oct 2009 14:24:54 -0500 |
parents | 0f18d16f3fe7 |
children | 9314d63c0941 |
line wrap: on
line diff
--- a/orpg/main.py Mon Oct 12 23:24:10 2009 -0500 +++ b/orpg/main.py Wed Oct 28 14:24:54 2009 -0500 @@ -62,8 +62,8 @@ from orpg.tools.decorators import debugging from orpg.tools.metamenus import MenuBarEx -#from xml.etree.ElementTree import ElementTree, Element -#from xml.etree.ElementTree import fromstring, tostring +from xml.etree.ElementTree import ElementTree, Element, iselement +from xml.etree.ElementTree import fromstring, tostring from orpg.orpg_xml import xml #to be replaced by etree @@ -972,73 +972,46 @@ # ok we are not ignoring this message #recvSound = "RecvSound" # this will be the default sound. Whisper will change this below - if player: display_name = self.chat.chat_display_name(player) - else: display_name = "Server Administrator" - - if data[:5] == "<tree": - ### Alpha ### Allows users to decide if they want the node or not. - dlg = wx.MessageDialog(None, display_name + 'is trying to send you a tree node. Accept?', 'Question', - wx.YES_NO | wx.NO_DEFAULT | wx.ICON_QUESTION) - if dlg.ShowModal() == wx.ID_YES: - dlg.Destroy() - self.tree.on_receive_data(data,player) - self.chat.InfoPost(display_name + " has sent you a tree node...") - - elif data[:4] == "<map": self.map.new_data(data) - - elif data[:5] == "<chat": - msg = orpg.chat.chat_msg.chat_msg(data) - self.chat.post_incoming_msg(msg,player) + ### Alpha ### + etreeEl = Element('msg') + try: etreeEl.append(fromstring(data)) + except: etreeEl.text = data + ### Remove after Element Tree is integrated further ### + if player: + display_name = self.chat.chat_display_name(player) else: - """ - all this below code is for comptiablity with older clients and can - be removed after a bit - """ - import warnings - warnings.warn("Getting here is bad, find out how and fix it", - DeprecationWarning, 2) - if data[:3] == "/me": - """ - This fixes the emote coloring to comply with what has been - asked for by the user population, not to mention, what I - committed to many moons ago. In doing so, Woody's scheme has - been tossed out. I'm sure Woody won't be happy but I'm - invoking developer priveledge to satisfy user request, not to - mention, this scheme actually makes more sense. In Woody's - scheme, a user could over-ride another users emote color. This - doesn't make sense, rather, people dictate their OWN colors... - which is as it should be in the first place and is as it has - been with normal text. In short, this makes sense and is - consistent. - """ - data = data.replace( "/me", "" ) - """ - Check to see if we find the closing '>' for the font within the - first 22 values - """ - index = data[:22].find( ">" ) - if index == -1: - data = "** " + self.chat.colorize( self.chat.infocolor, display_name + data ) + " **" + display_name = "Server Administrator" + + if etreeEl.text: + self.chat.Post(etreeEl.text) - else: - """ - This means that we found a valid font string, so we can - simply plug the name into the string between the start and - stop font delimiter - """ - print "pre data = " + data - data = data[:22] + "** " + display_name + " " + data[22:] + " **" - print "post data = " + data + for child in etreeEl.getchildren(): + if child.tag == 'tree': + ### Alpha ### Allows users to decide if they want the node or not. + dlg = wx.MessageDialog(None, display_name + 'is trying to send you a tree node. Accept?', 'Question', + wx.YES_NO | wx.NO_DEFAULT | wx.ICON_QUESTION) + if dlg.ShowModal() == wx.ID_YES: + dlg.Destroy() + self.tree.on_receive_data(data,player) + self.chat.InfoPost(display_name + " has sent you a tree node...") + ### Core ### to be milked in later. + #TODO: Fix game tree to accepts elements + #self.tree.on_receive_data(child, player) + #self.chat.InfoPost(display_name + " has sent you a tree node...") - elif data[:2] == "/w": - data = data.replace("/w","") - data = "<b>" + display_name + "</b> (whispering): " + data + elif child.tag == 'map': + ### Core ### Adapted from, remove tostring later + #TODO: Fix map to accepts elements + self.map.new_data(tostring(child)) - else: - # Normal text - if player: data = "<b>" + display_name + "</b>: " + data - else: data = "<b><i><u>" + display_name + "</u>-></i></b> " + data - self.chat.Post(data) + elif child.tag == 'chat': + msg = orpg.chat.chat_msg.chat_msg(data) + self.chat.post_incoming_msg(msg,player) + ### Core ### to be milked in later + #msg = orpg.chat.chat_msg.chat_msg() + #msg.takedom(child) + #self.chat.post_incoming_msg(msg, player) + @debugging def on_mplay_event(self, evt):