Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9255 in orxonox.OLD


Ignore:
Timestamp:
Jul 12, 2006, 2:05:42 PM (18 years ago)
Author:
patrick
Message:

saver state handling and first proxy clause

Location:
branches/proxy/src/lib/network
Files:
2 edited

Legend:

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

    r9254 r9255  
    9292  this->init();
    9393  this->serverSocket = new UdpServerSocket(port);
    94 //   this->bActive = true;
    9594}
    9695
     
    103102  /* set the class id for the base object */
    104103  this->setClassID(CL_NETWORK_STREAM, "NetworkStream");
    105 //   this->bActive = false;
    106104  this->serverSocket = NULL;
    107105  this->networkGameManager = NULL;
     
    223221  int tick = SDL_GetTicks();
    224222
    225   currentState++;
     223  this->currentState++;
     224  // there was a wrap around
     225  if( this->currentState < 0)
     226  {
     227    PRINTF(1)("A wrap around in the state variable as occured. The server was running so long? Pls restart server or write a mail to the supporters!\n");
     228  }
    226229
    227230  if ( this->type == NET_MASTER_SERVER )
    228231  {
     232    // execute everytthing the master server shoudl do
    229233    if ( serverSocket )
    230234      serverSocket->update();
    231235
    232236    this->updateConnectionList();
     237  }
     238  else if( this->type == NET_PROXY_SERVER)
     239  {
     240    // execute everything the proxy server should do
    233241  }
    234242  else
     
    643651      assert( Converter::byteArrayToInt( buf + 2*INTSIZE, &fromState ) == INTSIZE );
    644652      assert( Converter::byteArrayToInt( buf + 3*INTSIZE, &ackedState ) == INTSIZE );
    645       //NETPRINTF(n)("ackedstate: %d\n", ackedState);
    646653      offset = 4*INTSIZE;
    647654
    648655      peer->second.connectionMonitor->processUnzippedIncomingPacket( tick, buf, packetLength, state, ackedState );
    649656
    650       //NETPRINTF(n)("got packet: %d, %d\n", length, packetLength);
    651 
    652     //if this is an old state drop it
     657
     658      //if this is an old state drop it
    653659      if ( state <= peer->second.lastRecvedState )
    654660        continue;
  • branches/proxy/src/lib/network/network_stream.h

    r9254 r9255  
    8787    int                        type;                        //!< the type of this host (NET_CLIENT, NET_MASTER_SERVER,...)
    8888    int                        myHostId;                    //!< the host id of the localhost
    89 /*    bool                       bActive;  */                   //!< true if this host is active
    9089
    9190    std::list<int>             freeSocketSlots;             //!< list of free sockets (to ensure not to resycle sockets)
Note: See TracChangeset for help on using the changeset viewer.