# HG changeset patch # User sirebral # Date 1272869078 18000 # Node ID 29cf1a17ca161b359a23611e69a7582eca4bca6b # Parent d5ff505a2a16e7a9f95da3a6c014682e177482cf Traipse Alpha 'OpenRPG' {100503-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) Finalizing!!! 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 Update to how display names are acquired Update to Server, added some 'Pious' technology 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 Fix to Server GUI's broadcast, room, player messaging diff -r d5ff505a2a16 -r 29cf1a17ca16 orpg/chat/chatwnd.py --- a/orpg/chat/chatwnd.py Sun May 02 19:17:35 2010 -0500 +++ b/orpg/chat/chatwnd.py Mon May 03 01:44:38 2010 -0500 @@ -1371,8 +1371,7 @@ alias = msg.get_alias() # who sent us the message? if alias: display_name = self.chat_display_name([alias, player[1], player[2]]) - elif player: display_name = self.chat_display_name(player) - else: display_name = "Server Administrator" + else: display_name = self.chat_display_name(player) ######### START plugin_incoming_msg() ########### for plugin_fname in self.activeplugins.keys(): @@ -1595,10 +1594,10 @@ # This subroutine builds a chat display name. # def chat_display_name(self, player): - if self.settings.get_setting("ShowIDInChat") == "0": - display_name = player[0] - else: - display_name = "("+player[2]+") " + player[0] + if player == None: + player = ['Server Administrator-> ', '127.0.0.1', '0'] + if self.settings.get_setting("ShowIDInChat") == "0": display_name = player[0] + else: display_name = "("+player[2]+") " + player[0] return display_name # This subroutine will get a hex color and return it, or return nothing diff -r d5ff505a2a16 -r 29cf1a17ca16 orpg/main.py --- a/orpg/main.py Sun May 02 19:17:35 2010 -0500 +++ b/orpg/main.py Mon May 03 01:44:38 2010 -0500 @@ -929,10 +929,9 @@ etreeEl = Element('msg') try: etreeEl.append(fromstring(data)) except: etreeEl.text = data - if player: display_name = self.chat.chat_display_name(player) - else: display_name = "Server Administrator" - if etreeEl.text: self.chat.Post(etreeEl.text) + display_name = self.chat.chat_display_name(player) + if etreeEl.text:self.chat.Post(display_name+etreeEl.text) for child in etreeEl.getchildren(): if child.tag == 'tree': diff -r d5ff505a2a16 -r 29cf1a17ca16 orpg/networking/mplay_server.py --- a/orpg/networking/mplay_server.py Sun May 02 19:17:35 2010 -0500 +++ b/orpg/networking/mplay_server.py Mon May 03 01:44:38 2010 -0500 @@ -890,8 +890,14 @@ print "'help' or '?' or 'h' - for this help message" print - def broadcast(self,msg): - self.send_to_all("0","" + msg + "") + def broadcast(self, msg): + broadcast = '' +msg+ '' + chat = Element('chat') + chat.set('type', '1') + chat.set('version', '1.0') + chat.text = broadcast + msg = self.buildMsg('all', '0', '1', tostring(chat)) + self.send_to_all('0', msg) def console_log(self): if self.log_to_console == 1: @@ -1118,8 +1124,8 @@ 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, - new_stub.useCompression, new_stub.compressionType) + msg = self.buildMsg(props['id'], props['id'], '0', bad_xml_string) + self.sendMsg( newsock, msg, new_stub.useCompression, new_stub.compressionType) time.sleep(2) newsock.close() @@ -1224,7 +1230,6 @@ newsock.close() # Display the lobby message - print 'lobby message' self.SendLobbyMessage(newsock, props['id']) def checkClientVersion(self, clientversion): @@ -1869,14 +1874,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(">") - head = data[:end+1] msg = data[end+1:] if msg[-6:] == '': msg = msg[:-6] - if head[end-1:] == '/>': head = head[:end-2]+'>' - data = head+msg+'' + data = msg if from_id == "0" or len(from_id) == 0: print "WARNING!! Message received with an invalid from_id. Message dropped." @@ -1900,21 +1902,27 @@ self.players[from_id].self_message('The lobby map may not be altered.') 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(data) + msg = self.buildMsg('all', from_id, group_id, data) + self.send_to_group(from_id,group_id,msg) + self.groups[group_id].game_map.init_from_xml(msg) 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.') elif msg[:6] == '' + msg = self.buildMsg('all', '0', group_id, msg) self.log_msg("ban_msg:" + ban_msg) if (silent == 0): self.send_to_group("0", group_id, ban_msg) time.sleep( .1 ) @@ -2282,6 +2291,10 @@ self.log_msg("Exception: check_group_members(): " + str(e)) self.log_msg( ('exception', str(e)) ) + def buildMsg(self, toId, fromId, roomId, data): + msg = '' + msg += data+ '' + return msg def remote_admin_handler(self,xml_dom,data): """ @@ -2330,102 +2343,107 @@ #determine action to take based on command (cmd) if cmd == "list": #return player list to this user. - msg ="" + self.player_list_remote() + msg = self.buildMsg(pid, '0', gid, self.player_list_remote()) self.players[pid].outbox.put(msg) elif cmd == "banip": ip = xml_dom.get("bip") name = xml_dom.get("bname") - msg = " Banned: " + str(ip) + msg = self.buildMsg(pid, '0', gid, str(ip)) self.admin_banip(ip, name) elif cmd == "ban": id = xml_dom.get("bid") - msg = " Banned!" + msg = self.buildMsg(id, '0', gid, 'Banned!') self.players[pid].outbox.put(msg) self.admin_ban(id, "") ### Alpha ### and untested elif cmd == "boot": id = xml_dom.get("bid") - msg = " Booted!" + msg = self.buildMsg(id, '0', gid, 'Booted!!') self.players[pid].outbox.put(msg) self.admin_kick(id, "") ############# elif cmd == "unban": ip = xml_dom.get("ip") self.admin_unban(ip) - msg = " Unbaned: " + str(ip) + msg = self.buildMsg(pid, '0', gid, str(ip)) self.players[pid].outbox.put(msg) elif cmd == "banlist": - msg = "" + self.admin_banlist() + msg = self.buildMsg(pid, '0', gid, self.admin_banlist()) self.players[pid].outbox.put(msg) elif cmd == "killgroup": ugid = xml_dom.get("gid") if ugid == "0": - m = "" - m += "Cannot Remove Lobby! Remote administrator request denied!" - self.players[pid].outbox.put(m) + m + "Cannot Remove Lobby! Remote administrator request denied!" + msg = self.buildMsg(pid, '0', gid, m) + self.players[pid].outbox.put(msg) else: result = self.prune_room(ugid) - msg = "" + str(result) + msg = self.buildMsg(pid, '0', gid, str(result)) self.players[pid].outbox.put(msg) elif cmd == "message": tuid = xml_dom.get("to_id") msg = xml_dom.get("msg") - pmsg = "" + msg + pmsg = self.buildMsg(tuid, '0', self.players[tuid].group_id, msg) try: self.players[tuid].outbox.put(pmsg) except: - msg = "" + self.uptime(1) + msg = self.uptime(1) + msg = self.buildMsg(pid, '0', gid, msg) self.players[pid].outbox.put(msg) elif cmd == "help": - msg = "" - msg += self.AdminHelpMessage() + msg = self.AdminHelpMessage() + msg = self.buildMsg(pid, '0', gid, msg) self.players[pid].outbox.put( msg) elif cmd == "roompasswords": # Toggle if room passwords are allowed on this server - msg = "" - msg += self.RoomPasswords() + msg = self.RoomPasswords() + msg = self.buildMsg(pid, '0', gid, msg) self.players[pid].outbox.put( msg) elif cmd == "createroom": rm_name = xml_dom.get("name") rm_pass = xml_dom.get("pass") rm_boot = xml_dom.get("boot") result = self.create_temporary_persistant_room(rm_name, rm_boot, rm_pass) - msg = "" + result + msg = self.buildMsg(pid, '0', gid, result) self.players[pid].outbox.put(msg) elif cmd == "nameroom": rm_id = xml_dom.get("rmid") rm_name = xml_dom.get("name") result = self.change_group_name(rm_id,rm_name,pid) - msg ="" + result + msg = self.buildMsg(pid, '0', gid, result) self.players[pid].outbox.put(msg) elif cmd == "passwd": tgid = xml_dom.get("gid") npwd = xml_dom.get("pass") if tgid == "0": - msg ="" - msg += "Server password may not be changed remotely!" + msg = "Server password may not be changed remotely!" + msg = self.buildMsg(pid, '0', gid, msg) self.players[pid].outbox.put(msg) else: try: self.groups[tgid].boot_pwd = npwd - msg ="Password changed for room " + tgid + msg = "Password changed for room " + tgid + msg = self.buildMsg(pid, '0', gid, msg) self.players[pid].outbox.put(msg) except: pass elif cmd == "savemaps": for g in self.groups.itervalues(): g.save_map() - msg ="Persistent room maps saved" + msg = "Persistent room maps saved" + msg = self.buildMsg(pid, '0', gid, msg) self.players[pid].outbox.put(msg) else: - msg ="[Unknown Remote Administration Command]" + msg = "[Unknown Remote Administration Command]" + msg = self.buildMsg(pid, '0', gid, msg) self.players[pid].outbox.put(msg) except Exception, e: self.log_msg("Exception: Remote Admin Handler Error: " + str(e)) @@ -2602,4 +2620,4 @@ self.p_lock.release() return pl -server = mplay_server() +server = mplay_server() diff -r d5ff505a2a16 -r 29cf1a17ca16 orpg/networking/mplay_server_gui.py --- a/orpg/networking/mplay_server_gui.py Sun May 02 19:17:35 2010 -0500 +++ b/orpg/networking/mplay_server_gui.py Mon May 03 01:44:38 2010 -0500 @@ -321,7 +321,7 @@ BanMsg = wx.TextEntryDialog( self, "Enter A Message To Send:", "Ban Message", message, wx.OK|wx.CANCEL|wx.CENTRE ) if BanMsg.ShowModal() == wx.ID_OK: message = BanMsg.GetValue() - else: message = '' + else: return Silent = wx.MessageDialog(None, 'Silent Ban?', 'Question', wx.YES_NO | wx.NO_DEFAULT | wx.ICON_QUESTION) if Silent.ShowModal() == wx.ID_YES: silent = 1 @@ -330,14 +330,30 @@ self.remove( playerID ) elif menuItem == 4: msg = self.GetMessageInput( "Send a message to player" ) - if len(msg): self.main.server.server.send( msg, playerID, str(groupID) ) + + broadcast = '' +msg+ '' + chat = Element('chat') + chat.set('type', '1') + chat.set('version', '1.0') + chat.text = broadcast + msg = self.main.server.server.buildMsg(str(playerID), '0', '1', msg) + + if len(msg): self.main.server.server.players[playerID].outbox.put(msg) #Leave this in for now. elif menuItem == 5: msg = self.GetMessageInput( "Send message to room of this player") + + broadcast = '' +msg+ '' + chat = Element('chat') + chat.set('type', '1') + chat.set('version', '1.0') + chat.text = broadcast + msg = self.main.server.server.buildMsg('all', '0', '1', tostring(chat)) + if len(msg): self.main.server.server.send_to_group('0', str(groupID), msg ) elif menuItem == 6: msg = self.GetMessageInput( "Broadcast Server Message" ) - if len(msg): self.main.server.server.broadcast( msg ) + if len(msg): self.main.server.server.broadcast(msg ) elif menuItem == 3: version_string = self.main.server.server.obtain_by_id(playerID, 'client_string') if version_string: wx.MessageBox("Running client version " + version_string,"Version") @@ -479,7 +495,6 @@ 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) @@ -595,7 +610,7 @@ self.conns.updateRoom(data) def OnUpdateGroup(self, data): - (room, room_id, players) = data; print 'update group', data + (room, room_id, players) = data self.groups.UpdateGroup(data) def OnSetRole( self, data ): diff -r d5ff505a2a16 -r 29cf1a17ca16 orpg/orpg_version.py --- a/orpg/orpg_version.py Sun May 02 19:17:35 2010 -0500 +++ b/orpg/orpg_version.py Mon May 03 01:44:38 2010 -0500 @@ -4,7 +4,7 @@ #BUILD NUMBER FORMAT: "YYMMDD-##" where ## is the incremental daily build index (if needed) DISTRO = "Traipse Alpha" DIS_VER = "Ornery Orc" -BUILD = "100502-01" +BUILD = "100503-00" # This version is for network capability. PROTOCOL_VERSION = "1.2"