[sldev-commits] r996 - in projects/2008/pyogp: pyogp.interop/trunk/pyogp/interop/tests pyogp.lib.base/trunk/pyogp/lib/base/message pyogp.lib.base/trunk/pyogp/lib/base/network

locklainn.linden at svn.secondlife.com locklainn.linden at svn.secondlife.com
Thu Aug 7 13:19:45 PDT 2008


Author: locklainn.linden
Date: 2008-08-07 15:19:45 -0500 (Thu, 07 Aug 2008)
New Revision: 996

Modified:
   projects/2008/pyogp/pyogp.interop/trunk/pyogp/interop/tests/test_ogp_teleport.py
   projects/2008/pyogp/pyogp.lib.base/trunk/pyogp/lib/base/message/message_system.py
   projects/2008/pyogp/pyogp.lib.base/trunk/pyogp/lib/base/network/net.py
Trac: http://svn.secondlife.com/trac/linden/changeset/996
Log:
less clutter in prints

Modified: projects/2008/pyogp/pyogp.interop/trunk/pyogp/interop/tests/test_ogp_teleport.py
===================================================================
--- projects/2008/pyogp/pyogp.interop/trunk/pyogp/interop/tests/test_ogp_teleport.py	2008-08-07 20:02:45 UTC (rev 995)
+++ projects/2008/pyogp/pyogp.interop/trunk/pyogp/interop/tests/test_ogp_teleport.py	2008-08-07 20:19:45 UTC (rev 996)
@@ -68,21 +68,21 @@
         
         avatar = place(region)
 
-        print 'Circuit code: ' + str(avatar.region.details['circuit_code'])
-        circuit_code = avatar.region.details['circuit_code']
-        import struct
-        p_circuit = struct.pack("<L", circuit_code)
-        print 'Little Circuit code: ' + repr(p_circuit)
-        print 'Unpacked little to big: ' + str(struct.unpack(">L", p_circuit))
+        assert avatar.region.details['seed_capability'] != None or avatar.region.details['seed_capability'] != {}, "Rez_avatar/place returned no seed cap"
+        assert avatar.region.details['look_at'] != None or avatar.region.details['look_at'] != {}, "Rez_avatar/place returned no look_at"
+        assert avatar.region.details['sim_ip'] != None or avatar.region.details['sim_ip'] != {}, "Rez_avatar/place returned no sim_ip"
+        assert avatar.region.details['sim_port'] != None or avatar.region.details['sim_port'] != {}, "Rez_avatar/place returned no sim_port"
+        assert avatar.region.details['region_x'] != None or avatar.region.details['region_x'] != {}, "Rez_avatar/place returned no region_x"
+        assert avatar.region.details['region_y'] != None or avatar.region.details['region_y'] != {}, "Rez_avatar/place returned no region_y"
+        assert avatar.region.details['region_id'] != None or avatar.region.details['region_id'] != {}, "Rez_avatar/place returned no region_id"
+        assert avatar.region.details['sim_access'] != None or avatar.region.details['sim_access'] != {}, "Rez_avatar/place returned no sim_access"
+        assert avatar.region.details['connect'] != None or avatar.region.details['connect'] != {}, "Rez_avatar/place returned no connect"
+        assert avatar.region.details['position'] != None or avatar.region.details['position'] != {}, "Rez_avatar/place returned no position"
+        assert avatar.region.details['session_id'] != None or avatar.region.details['session_id'] != {}, "Rez_avatar/place returned no session_id"
+        assert avatar.region.details['secure_session_id'] != None or avatar.region.details['secure_session_id'] != {}, "Rez_avatar/place returned no secure_session_id" 
+        assert avatar.region.details['circuit_code'] != None or avatar.region.details['circuit_code'] != {}, "Rez_avatar/place returned no cicuit_code"
 
-        b_circuit = struct.pack(">L", circuit_code)
-        print 'Big Circuit code: ' + repr(b_circuit)
-        print 'Unpacked Big to little: ' + str(struct.unpack("<L", p_circuit))
-        
         agent_id = avatar.region.details['agent_id']
-        print 'Agent_id: ' + repr(agent_id)
-        session_id = avatar.region.details['session_id']
-        print 'Session_d: ' + repr(session_id)
         
         #begin UDP communication
         self.host = Host(avatar.region.details['sim_ip'],
@@ -130,8 +130,6 @@
         self.messenger.add_data('CircuitCode', avatar.region.details['circuit_code'], \
                                 MsgType.MVT_U32)
         self.messenger.send_reliable(self.host, 0)
-        print 'Data: ' + repr(self.messenger.send_buffer)
-        print 'Length of data: ' + str(len(self.messenger.send_buffer))
         
         while True:
             recv_message = ''
@@ -148,22 +146,7 @@
         tp_region = Region(self.target_region_uri)
         place = IPlaceAvatar(agentdomain)
 
-        avatar = place(tp_region)
-
-        assert avatar.region.details['seed_capability'] != None or avatar.region.details['seed_capability'] != {}, "Rez_avatar/place returned no seed cap"
-        assert avatar.region.details['look_at'] != None or avatar.region.details['look_at'] != {}, "Rez_avatar/place returned no look_at"
-        assert avatar.region.details['sim_ip'] != None or avatar.region.details['sim_ip'] != {}, "Rez_avatar/place returned no sim_ip"
-        assert avatar.region.details['sim_port'] != None or avatar.region.details['sim_port'] != {}, "Rez_avatar/place returned no sim_port"
-        assert avatar.region.details['region_x'] != None or avatar.region.details['region_x'] != {}, "Rez_avatar/place returned no region_x"
-        assert avatar.region.details['region_y'] != None or avatar.region.details['region_y'] != {}, "Rez_avatar/place returned no region_y"
-        assert avatar.region.details['region_id'] != None or avatar.region.details['region_id'] != {}, "Rez_avatar/place returned no region_id"
-        assert avatar.region.details['sim_access'] != None or avatar.region.details['sim_access'] != {}, "Rez_avatar/place returned no sim_access"
-        assert avatar.region.details['connect'] != None or avatar.region.details['connect'] != {}, "Rez_avatar/place returned no connect"
-        assert avatar.region.details['position'] != None or avatar.region.details['position'] != {}, "Rez_avatar/place returned no position"
-        assert avatar.region.details['session_id'] != None or avatar.region.details['session_id'] != {}, "Rez_avatar/place returned no session_id"
-        assert avatar.region.details['secure_session_id'] != None or avatar.region.details['secure_session_id'] != {}, "Rez_avatar/place returned no secure_session_id" 
-        assert avatar.region.details['circuit_code'] != None or avatar.region.details['circuit_code'] != {}, "Rez_avatar/place returned no cicuit_code"
-        
+        avatar = place(tp_region)        
        
     def tearDown(self):
         # essentially logout by deleting presence... etc.

Modified: projects/2008/pyogp/pyogp.lib.base/trunk/pyogp/lib/base/message/message_system.py
===================================================================
--- projects/2008/pyogp/pyogp.lib.base/trunk/pyogp/lib/base/message/message_system.py	2008-08-07 20:02:45 UTC (rev 995)
+++ projects/2008/pyogp/pyogp.lib.base/trunk/pyogp/lib/base/message/message_system.py	2008-08-07 20:19:45 UTC (rev 996)
@@ -76,8 +76,6 @@
 
             #we have a message
             if msg_size > 0:
-                msg_buf = self.zero_code_expand(msg_buf, msg_size)
-    
                 #determine packet flags
                 flag = ord(msg_buf[0])
                 self.receive_packet_id = \
@@ -87,6 +85,10 @@
                 host = self.udp_client.get_sender()
                 circuit = self.find_circuit(host)
 
+                if flag & PackFlags.LL_ZERO_CODE_FLAG:
+                    msg_buf = self.zero_code_expand(msg_buf, msg_size)
+    
+
                 #ACK_FLAG - means the incoming packet is acking some old packets of ours
                 if flag & PackFlags.LL_ACK_FLAG:
                     #apparently, the number of acks is stored at the end
@@ -139,8 +141,8 @@
             #or we have no more messages to read
             #if valid_packet == True and msg_size > 0:
             #    break
-            if valid_packet == False or msg_size <= 0:
-                break
+            #if valid_packet == False or msg_size <= 0:
+            break
                 
         #now determine if the packet we got was valid (and therefore is stored
         #in the reader)

Modified: projects/2008/pyogp/pyogp.lib.base/trunk/pyogp/lib/base/network/net.py
===================================================================
--- projects/2008/pyogp/pyogp.lib.base/trunk/pyogp/lib/base/network/net.py	2008-08-07 20:02:45 UTC (rev 995)
+++ projects/2008/pyogp/pyogp.lib.base/trunk/pyogp/lib/base/network/net.py	2008-08-07 20:19:45 UTC (rev 996)
@@ -23,7 +23,7 @@
         buf = 10000
         try:
             data, addr = sock.recvfrom(buf)
-            print "Received data: " + repr(data)
+            #print "Received data: " + repr(data)
         except:
             return '', 0
         self.sender.ip = addr[0]



More information about the sldev-commits mailing list