Mercurial > openrpg
changeset 565:7e109dc95f24
some imports were missing, plugin messaging system fixed to work with current server (still fails against 1.8.0 servers or older), error in plugindb fixed
author | davidbyron |
---|---|
date | Sun, 11 Apr 2010 11:32:26 -0500 |
parents | 5c7a3bb1572f |
children | cb68a426b486 |
files | orpg/main.py orpg/networking/mplay_server_gui.py orpg/plugindb.py plugins/xxblank.py plugins/xxinit2.py |
diffstat | 5 files changed, 11 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/orpg/main.py Sat Apr 10 19:47:34 2010 -0500 +++ b/orpg/main.py Sun Apr 11 11:32:26 2010 -0500 @@ -32,6 +32,8 @@ from xml.parsers.expat import ExpatError import time import wx +import os +import sys import wx.py import webbrowser try:
--- a/orpg/networking/mplay_server_gui.py Sat Apr 10 19:47:34 2010 -0500 +++ b/orpg/networking/mplay_server_gui.py Sun Apr 11 11:32:26 2010 -0500 @@ -19,6 +19,7 @@ from threading import Thread import wx +import wx.html from orpg.dirpath import dir_struct from orpg.tools.validate import validate
--- a/orpg/plugindb.py Sat Apr 10 19:47:34 2010 -0500 +++ b/orpg/plugindb.py Sun Apr 11 11:32:26 2010 -0500 @@ -184,7 +184,7 @@ dict_el.set('type', 'dict') plugin.append(dict_el) else: - dict_el.remove(list_el.find('dict')) + dict_el.remove(dict_el.find('dict')) dict_el.append(self.BuildDict(val))
--- a/plugins/xxblank.py Sat Apr 10 19:47:34 2010 -0500 +++ b/plugins/xxblank.py Sun Apr 11 11:32:26 2010 -0500 @@ -3,6 +3,7 @@ from orpg.mapper.miniatures_handler import * from orpg.orpgCore import * from wx import MessageDialog, OK, ICON_EXCLAMATION +from orpg.external.etree.ElementTree import tostring class Plugin(orpg.pluginhandler.PluginHandler): # Initialization subroutine. @@ -88,12 +89,12 @@ m.set_mini_rclick_menu_item("Pirate", None) def on_test(self, cmdargs): - #this is just an example function for a command you create. + # this is just an example function for a command you create. # cmdargs contains everything you typed after the command # so if you typed /test this is a test, cmdargs = this is a test # args are the individual arguments split. For the above example # args[0] = this , args[1] = is , args[2] = a , args[3] = test - self.plugin_send_msg(cmdargs, '<xxblank>' + cmdargs + '</xxblank>') + self.plugin_send_msg('all', '<xxblank>' + cmdargs + '</xxblank>') args = cmdargs.split(None,-1) msg = 'cmdargs = %s' % (cmdargs) self.chat.InfoPost(msg) @@ -117,7 +118,8 @@ dlg.ShowModal() dlg.Destroy() - def on_xml_recive(self,id, data,xml_dom): + def on_xml_recive(self,id, xml_dom): + data = tostring(xml_dom) self.chat.InfoPost(self.name + ":: Message recived<br />" + data.replace("<","<").replace(">",">") +'<br />From id:' + str(id)) def pre_parse(self, text):
--- a/plugins/xxinit2.py Sat Apr 10 19:47:34 2010 -0500 +++ b/plugins/xxinit2.py Sun Apr 11 11:32:26 2010 -0500 @@ -202,12 +202,12 @@ pass # Just received a query from another player; returning a "yes, I have xxinit2 loaded" message - def received_checkifloaded(self, playerid, data, xml_dom): #VEG 2.2.6 + def received_checkifloaded(self, playerid, xml_dom): #VEG 2.2.6 #print "receive_checkifloaded called: id=" + str(playerid) + "... data = " + str(data) self.plugin_send_msg(playerid, "<xxinit2_returnloaded/>") # Just received the "yes, I have xxinit2 loaded" message; printing a warning message - def received_returnloaded(self, playerid, data, xml_dom): #VEG 2.2.6 + def received_returnloaded(self, playerid, xml_dom): #VEG 2.2.6 if self.msghand_warning: self.post_syserror("Warning: xxinit2 plugin detected on " + str(self.session.get_player_by_player_id(playerid)[0]) + "'s system. \