Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 17, 2006, 8:28:23 AM (18 years ago)
Author:
rennerc
Message:

synchronisation should work now

File:
1 edited

Legend:

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

    r7614 r7631  
    6262  this->init();
    6363  this->peers[0].socket = new UdpSocket( host, port );
     64  this->peers[0].userId = 0;
     65  this->peers[0].isServer = true;
    6466  this->networkProtocol = new NetworkProtocol();
    6567  this->connectionMonitor = new ConnectionMonitor();
     
    357359      peers[clientId].handshake->setUniqueID(clientId);
    358360      peers[clientId].userId = clientId;
     361      peers[clientId].isServer = false;
    359362    } else
    360363    {
     
    369372      peers[clientId].handshake->setUniqueID(clientId);
    370373      peers[clientId].userId = clientId;
     374      peers[clientId].isServer = false;
    371375     
    372376      PRINTF(0)("num sync: %d\n", synchronizeables.size());
     
    400404        delete it->second.handshake;
    401405      it->second.handshake = NULL;
    402 
     406     
     407      for ( SynchronizeableList::iterator it2 = synchronizeables.begin(); it2 != synchronizeables.end(); it2++ )
     408      {
     409        (*it2)->cleanUpUser( it->second.userId );
     410      }
    403411
    404412      NetworkGameManager::getInstance()->signalLeftPlayer(it->second.userId);
     
    632640        int leafClassId;
    633641        if ( INTSIZE > length - offset )
    634           break;
     642        {
     643          offset += syncDataLength;
     644          continue;
     645        }
    635646       
    636647        Converter::byteArrayToInt( buf + offset, &leafClassId );
     
    639650        /* These are some small exeptions in creation: Not all objects can/should be created via Factory */
    640651        /* Exception 1: NullParent */
    641         if( leafClassId == CL_NULL_PARENT)
    642         {
    643           PRINTF(1)("Can not create Class with ID %x!", (int)leafClassId);
    644           break;
     652        if( leafClassId == CL_NULL_PARENT || leafClassId == CL_SYNCHRONIZEABLE )
     653        {
     654          PRINTF(1)("Can not create Class with ID %x!\n", (int)leafClassId);
     655          offset += syncDataLength;
     656          continue;
    645657        }
    646658        else
     
    650662        {
    651663          PRINTF(1)("Could not fabricate Object with classID %x\n", leafClassId);
    652           break;
     664          offset += syncDataLength;
     665          continue;
    653666        }
    654667       
     
    663676        else
    664677        {
    665           PRINTF(1)("Class with ID %x is not a synchronizeable!", (int)leafClassId);
     678          PRINTF(1)("Class with ID %x is not a synchronizeable!\n", (int)leafClassId);
    666679          delete b;
    667           break;
     680          offset += syncDataLength;
     681          continue;
    668682        }
    669683      }
Note: See TracChangeset for help on using the changeset viewer.