Mercurial > traipse_dev
diff orpg/networking/mplay_messaging.py @ 119:9314d63c0941 alpha
Traipse Alpha 'OpenRPG' {091029-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
{091029}
00:
Changes made to server to start working with Element Tree.
Changes made to Meta Server Lib. Prepping test work for a multi meta network
page.
Minor bug fixed with mini to gametree
Zoom Mouse plugin added.
Known Issue: Disconnecting causes an server side error. XML data is not being
passed correctly.
author | sirebral |
---|---|
date | Thu, 29 Oct 2009 20:35:28 -0500 |
parents | 65c1604e7949 |
children | 06f10429eedc |
line wrap: on
line diff
--- a/orpg/networking/mplay_messaging.py Wed Oct 28 14:24:54 2009 -0500 +++ b/orpg/networking/mplay_messaging.py Thu Oct 29 20:35:28 2009 -0500 @@ -67,7 +67,8 @@ self.port = int(component.get("settings").get_setting("port")) ##used even? self.ip = socket.gethostbyname(socket.gethostname()) self.lensize = calcsize('i') - self.mplay_type = ('disconnected', 'connected', 'disconnecting', 'group change', 'group change failed') + self.mplay_type = ('disconnected', 'connected', + 'disconnecting', 'group change', 'group change failed') self.status = self.mplay_type[0] self.alive = False self.sock = None @@ -93,26 +94,31 @@ self.groups = {} #Setup Stuff from the Server - if kwargs.has_key('inbox'): - self.inbox = kwargs['inbox'] - if kwargs.has_key('sock'): - self.sock = kwargs['sock'] - if kwargs.has_key('ip'): - self.ip = kwargs['ip'] - if kwargs.has_key('role'): - self.role = kwargs['role'] - if kwargs.has_key('id'): - self.id = kwargs['id'] - if kwargs.has_key('group_id'): - self.group_id = kwargs['group_id'] - if kwargs.has_key('name'): - self.name = kwargs['name'] - if kwargs.has_key('version'): - self.version = kwargs['version'] - if kwargs.has_key('protocol_version'): - self.protocol_version = kwargs['protocol_version'] - if kwargs.has_key('client_string'): - self.client_string = kwargs['client_string'] + """ + if kwargs.has_key('inbox'): self.inbox = kwargs['inbox'] + if kwargs.has_key('sock'): self.sock = kwargs['sock'] + if kwargs.has_key('ip'): self.ip = kwargs['ip'] + if kwargs.has_key('role'): self.role = kwargs['role'] + if kwargs.has_key('id'): self.id = kwargs['id'] + if kwargs.has_key('group_id'): self.group_id = kwargs['group_id'] + if kwargs.has_key('name'): self.name = kwargs['name'] + if kwargs.has_key('version'): self.version = kwargs['version'] + if kwargs.has_key('protocol_version'): self.protocol_version = kwargs['protocol_version'] + if kwargs.has_key('client_string'): self.client_string = kwargs['client_string'] + """ + + ### Alpha ### + self.inbox = kwargs['inbox'] or pass + self.sock = kwargs['sock'] or pass + self.ip = kwargs['ip'] or pass + self.role = kwargs['role'] or pass + self.id = kwargs['id'] or pass + self.group_id = kwargs['group_id'] or pass + self.name = kwargs['name'] or pass + self.version = kwargs['version'] or pass + self.protocol_version = kwargs['protocol_version'] or pass + self.client_string = kwargs['client_string'] or pass + def build_message(self, *args, **kwargs): #print args @@ -159,7 +165,8 @@ def update_self_from_player(self, player): try: - (self.name, self.ip, self.id, self.text_status, self.version, self.protocol_version, self.client_string,role) = player + (self.name, self.ip, self.id, self.text_status, + self.version, self.protocol_version, self.client_string,role) = player except: logger.general("Exception: messenger->update_self_from_player():\n" + traceback.format_exc()) @@ -218,12 +225,9 @@ idletime = self.idle_time() idlemins = idletime / 60 status = "Unknown" - if idlemins < 3: - status = "Active" - elif idlemins < 10: - status = "Idle ("+str(int(idlemins))+" mins)" - else: - status = "Inactive ("+str(int(idlemins))+" mins)" + if idlemins < 3: status = "Active" + elif idlemins < 10: status = "Idle ("+str(int(idlemins))+" mins)" + else: status = "Inactive ("+str(int(idlemins))+" mins)" return status def connected_time(self): @@ -245,18 +249,14 @@ self.timeout_time = None def check_time_out(self): - if self.timeout_time==None: - self.timeout_time = time.time() + if self.timeout_time == None: self.timeout_time = time.time() curtime = time.time() diff = curtime - self.timeout_time - if diff > 1800: - return 1 - else: - return 0 + if diff > 1800: return 1 + else: return 0 def send(self, msg): - if self.get_status() == 'connected': - self.outbox.put(msg) + if self.get_status() == 'connected': self.outbox.put(msg) def change_group(self, group_id, groups): old_group_id = str(self.group_id) @@ -275,17 +275,13 @@ def add_msg_handler(self, tag, function, core=False): if not self.msg_handlers.has_key(tag): self.msg_handlers[tag] = function - if core: - self.core_msg_handlers.append(tag) - else: - print 'XML Messages ' + tag + ' already has a handler' + if core: self.core_msg_handlers.append(tag) + else: print 'XML Messages ' + tag + ' already has a handler' def remove_msg_handler(self, tag): if self.msg_handlers.has_key(tag) and not tag in self.core_msg_handlers: del self.msg_handlers[tag] - else: - print 'XML Messages ' + tag + ' already deleted' - + else: print 'XML Messages ' + tag + ' already deleted' #Message Handaling def message_handler(self, arg):