#1936: Incorrect bytes sent in netplay log
 Reporter:  Safety0ff           |              Owner:                  
     Type:  bug                 |             Status:  new             
 Priority:  minor               |          Milestone:  3.0             
Component:  Engine: Networking  |            Version:  unspecified     
 Keywords:                      |   Operating_system:  All/Non-Specific
Blockedby:                      |           Blocking:                  
 Netplay log statistics claim that there was hundreds of megabytes sent.

 Suspected cause of the problem:[[BR]]
 When NETrecv(uint8_t *type) calls NETlogPacket, the byte order of
 NetMsg->size might be in network byte order.

  * NETlogPacket assumes the size field has host byte order.
  * I'm not sure, but it looks like NETrecv doesn't count some packets
 towards the bytes/packets received count, I don't know whether this is
 intentional or not (NETlogPacket packet is only called when returning true
 e.g. when we've received a "high level" packet).
  * ntohs calls in NETrecv should be htons.
  * Magic number "8" in NETrecv might need to be changed to MAX_PLAYERS for
 I might try fixing this myself once I've stepped through that function a
 few times with a debugger ( currently I'm unsure about the
 design/structure of that function.)

Ticket URL: <http://developer.wz2100.net/ticket/1936>
Warzone 2100 Trac <http://developer.wz2100.net/>
The Warzone 2100 Project
Warzone-dev mailing list

Reply via email to