Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6301 in orxonox.OLD for branches/network/src


Ignore:
Timestamp:
Dec 26, 2005, 12:47:14 PM (19 years ago)
Author:
rennerc
Message:
 
Location:
branches/network/src/lib/network
Files:
4 edited

Legend:

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

    r6275 r6301  
    5050
    5151  newUniqueID = MAX_CONNECTIONS + 2;
     52
     53  hasRequestedWorld = false;
    5254}
    5355
     
    7375  byte b;
    7476
    75   while ( i<length-1 )
     77  while ( i<length )
    7678  {
    7779    b = data[i++];
     
    135137    }
    136138
     139    if ( b == REQUEST_ENTITY_LIST )
     140    {
     141      PRINTF(0)("sending THE list\n");
     142      sendEntityList( sender );
     143      continue;
     144    }
     145
    137146    //if we get her something with data is wrong
    138147    PRINTF(1)("Data is not in the right format! i=%d\n", i);
     
    143152int NetworkGameManager::readBytes(byte* data, int maxLength, int * reciever)
    144153{
     154  if ( !isServer() && !hasRequestedWorld )
     155  {
     156    SYNCHELP_WRITE_BEGIN();
     157    byte b = REQUEST_ENTITY_LIST;
     158    SYNCHELP_WRITE_BYTE( b );
     159    hasRequestedWorld = true;
     160    return SYNCHELP_WRITE_N;
     161  }
    145162  for ( int i = 0; i<outBuffer.size(); i++ )
    146163  {
  • branches/network/src/lib/network/network_game_manager.h

    r6273 r6301  
    3131 *  //REQUEST_CREATE_LIST: NUMBER, [UNIQUE_ID][0..NUMBER]
    3232 *
     33 *  REQUEST_ENTITY_LIST: //request the whole world :D
    3334 *  REQUEST_SYNC:        UNIQUE_ID
    3435 *  //REQUEST_SYNC_LIST:   NUMBER, [UNIQUE_ID][0..NUMBER]
     
    4647  REQUEST_REMOVE,
    4748  REQUEST_SYNC,
    48   YOU_ARE_ENTITY
     49  YOU_ARE_ENTITY,
     50  REQUEST_ENTITY_LIST
    4951};
    5052
     
    122124
    123125    int                           newUniqueID;
     126    bool                          hasRequestedWorld;
    124127};
    125128
  • branches/network/src/lib/network/network_protocol.cc

    r6298 r6301  
    9797  PRINTF(5)("extract Header\n");
    9898  //Test if received data can contain a header
    99   if (length < headerLength)
     99  if (length < 2*INTSIZE)
    100100  {
    101101    PRINTF(1)("Received data is to short; it can't contain a header!\n");
  • branches/network/src/lib/network/network_stream.cc

    r6297 r6301  
    187187          else
    188188          {
    189             this->networkGameManager->sendEntityList( i );
     189            //this->networkGameManager->sendEntityList( i );
    190190          }
    191191          PRINT(0)("handshake finished id=%d\n", handshakes[i]->getNetworkGameManagerId());
     
    232232        if ( header->synchronizeableID < this->maxConnections+2 )
    233233        {
    234           PRINTF(0)("RESET UNIQUEID TO 0\n");
     234          if ( !isServer() ) PRINTF(0)("RESET UNIQUEID TO 0\n");
    235235          header->synchronizeableID = 0;
    236236        }
    237237        else
    238238        {
    239           PRINTF(0)("UNIQUEID=%d\n", header->synchronizeableID);
     239          if ( !isServer() ) PRINTF(0)("UNIQUEID=%d\n", header->synchronizeableID);
    240240        }
    241241
Note: See TracChangeset for help on using the changeset viewer.