changeset 567:6e5caf294011

correction to client_parse to account for server initiated old-style messages
author davidbyron
date Sun, 11 Apr 2010 18:58:38 -0500
parents cb68a426b486
children 067562373edc
files orpg/networking/mplay_messaging.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/orpg/networking/mplay_messaging.py	Sun Apr 11 16:40:00 2010 -0500
+++ b/orpg/networking/mplay_messaging.py	Sun Apr 11 18:58:38 2010 -0500
@@ -65,15 +65,16 @@
         return el
 
     def client_parse(self, raw_msg):
+        print 'client_parse"'+raw_msg
         try:
             el = fromstring(raw_msg)
         except ExpatError:
             #Backwards compatibility crap
             try:
-                end =raw_msg.rfind("<")
+                end =raw_msg.rfind("</")
                 el = fromstring(raw_msg[:end])
             except ExpatError:
-                logger.general("Bad Message: \n" + raw_msg)
+                return self.parse(raw_msg)
         return el
 
-messaging = MessageingClass()
\ No newline at end of file
+messaging = MessageingClass()