Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7800 in orxonox.OLD for branches/network


Ignore:
Timestamp:
May 24, 2006, 1:24:12 PM (19 years ago)
Author:
rennerc
Message:

dont send zero diffs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/lib/network/network_stream.cc

    r7792 r7800  
    197197  handleHandshakes();
    198198 
     199  // order of up/downstream is important!!!!
     200  // don't change it
    199201  handleDownstream();
    200202  handleUpstream();
     
    421423     
    422424      assert( Converter::intToByteArray( n, buf + offset - n - INTSIZE, INTSIZE ) == INTSIZE );
     425     
     426      //check if all bytes == 0 -> remove data
     427      bool allZero = true;
     428      for ( int i = offset - n; i < offset; i++ )
     429      {
     430        if ( buf[i] != 0 )
     431          allZero = false;
     432      }
     433     
     434      if ( allZero )
     435      {
     436        NETPRINTF(n)("REMOVE ZERO DIFF: %s (%d)\n", sync.getClassName(), sync.getUniqueID());
     437        offset = offset - n - 2*INTSIZE;
     438      }
     439     
    423440    }
    424441   
Note: See TracChangeset for help on using the changeset viewer.