Update of /cvsroot/openrpg/openrpg1/orpg/networking
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23869/orpg/networking
Modified Files:
mplay_client.py mplay_server.py
Log Message:
Applied patch [ 1705262 ] Fix network message pack/unpack by David Vrabel
Index: mplay_server.py
===================================================================
RCS file: /cvsroot/openrpg/openrpg1/orpg/networking/mplay_server.py,v
retrieving revision 1.146
retrieving revision 1.147
diff -C2 -d -r1.146 -r1.147
*** mplay_server.py 6 May 2007 16:42:59 -0000 1.146
--- mplay_server.py 12 May 2007 20:41:54 -0000 1.147
***************
*** 823,827 ****
if useCompression and cmpType != None:
mpacket = cmpType.compress(msg)
! lpacket = pack('i', socket.htonl(len(mpacket)))
sock.send(lpacket)
--- 823,827 ----
if useCompression and cmpType != None:
mpacket = cmpType.compress(msg)
! lpacket = pack('!i', len(mpacket))
sock.send(lpacket)
***************
*** 837,841 ****
# Encode the message length into network byte order
! lp = pack( 'i', socket.htonl( length ) )
try:
--- 837,841 ----
# Encode the message length into network byte order
! lp = pack('!i', length)
try:
***************
*** 898,903 ****
# Now, convert to a usable form
! (length,) = unpack( 'i', lenData )
! length = socket.ntohl( length )
# Read exactly the remaining amount of data
--- 898,902 ----
# Now, convert to a usable form
! (length,) = unpack('!i', lenData)
# Read exactly the remaining amount of data
Index: mplay_client.py
===================================================================
RCS file: /cvsroot/openrpg/openrpg1/orpg/networking/mplay_client.py,v
retrieving revision 1.70
retrieving revision 1.71
diff -C2 -d -r1.70 -r1.71
*** mplay_client.py 15 Feb 2007 15:26:47 -0000 1.70
--- mplay_client.py 12 May 2007 20:41:54 -0000 1.71
***************
*** 224,228 ****
if self.useCompression and self.compressionType != None:
mpacket = self.compressionType.compress(msg)
! lpacket = pack('i', socket.htonl(len(mpacket)))
sock.send(lpacket)
--- 224,228 ----
if self.useCompression and self.compressionType != None:
mpacket = self.compressionType.compress(msg)
! lpacket = pack('!i', len(mpacket))
sock.send(lpacket)
***************
*** 235,242 ****
else:
# Calculate our message length
! length = len( msg )
# Encode the message length into network byte order
! lp = pack( 'i', socket.htonl( length ) )
try:
--- 235,242 ----
else:
# Calculate our message length
! length = len(msg)
# Encode the message length into network byte order
! lp = pack('!i', length)
try:
***************
*** 304,309 ****
# Now, convert to a usable form
! (length,) = unpack( 'i', lenData )
! length = socket.ntohl( length )
# Read exactly the remaining amount of data
--- 304,308 ----
# Now, convert to a usable form
! (length,) = unpack('!i', lenData)
# Read exactly the remaining amount of data
|