Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 29, 2010, 11:41:51 PM (14 years ago)
Author:
scheusso
Message:

-enabling client-side gamestate diffing
-added some optimisations

Location:
code/branches/network6/src/libraries/network
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network6/src/libraries/network/ClientConnection.cc

    r7823 r7825  
    4242
    4343  ClientConnection::ClientConnection():
     44    Connection(NETWORK_PEER_ID_SERVER),
    4445    established_(false),
    4546    server_(NULL)
  • code/branches/network6/src/libraries/network/Connection.cc

    r7824 r7825  
    4343  const boost::posix_time::millisec NETWORK_COMMUNICATION_THREAD_WAIT_TIME(20);
    4444
    45   Connection::Connection():
    46     host_(0), bCommunicationThreadRunning_(false), nextPeerID_(NETWORK_PEER_ID_SERVER+1)
     45  Connection::Connection(uint32_t firstPeerID):
     46    host_(0), bCommunicationThreadRunning_(false), nextPeerID_(firstPeerID)
    4747  {
    4848    enet_initialize();
  • code/branches/network6/src/libraries/network/Connection.h

    r7823 r7825  
    105105
    106106  protected:
    107     Connection();
     107    Connection(uint32_t firstPeerID = NETWORK_PEER_ID_SERVER+1);
    108108   
    109109    void startCommunicationThread();
  • code/branches/network6/src/libraries/network/GamestateManager.cc

    r7801 r7825  
    149149      newID = ++id_;
    150150    else
     151    {
     152      assert(peerMap_.size()!=0);
    151153      newID = peerMap_[NETWORK_PEER_ID_SERVER].lastProcessedGamestateID;
     154    }
    152155   
    153156    if(!currentGamestate_->collectData(newID, gsMode)){ //we have no data to send
     
    172175        continue;
    173176      }
    174       COUT(4) << "client id: " << peerIt->first << std::endl;
     177      COUT(5) << "client id: " << peerIt->first << std::endl;
    175178      COUT(5) << "Server: doing gamestate gamestate preparation" << std::endl;
    176179      int peerID = peerIt->first; //get client id
     
    244247//     assert(b);
    245248    clock.capture();
    246     COUT(4) << "diff and compress time: " << clock.getDeltaTime() << endl;
     249    COUT(5) << "diff and compress time: " << clock.getDeltaTime() << endl;
    247250//     COUT(5) << "sending gamestate with id " << gs->getID();
    248251//     if(gamestate->isDiffed())
  • code/branches/network6/src/libraries/network/packet/Gamestate.cc

    r7801 r7825  
    107107  uint32_t size = calcGamestateSize(id, mode);
    108108
    109   COUT(4) << "G.ST.Man: producing gamestate with id: " << id << std::endl;
     109  COUT(5) << "G.ST.Man: producing gamestate with id: " << id << std::endl;
    110110  if(size==0)
    111111    return false;
  • code/branches/network6/src/libraries/network/synchronisable/Synchronisable.cc

    r7801 r7825  
    295295   * @param mem pointer to the bytestream
    296296   * @param mode same as in getData
    297    * @param forceCallback FIXME - add doc!
     297   * @param forceCallback this makes updateData call each callback
    298298   * @return true/false
    299299   */
     
    372372   * This function determines, wheter the object should be saved to the bytestream (according to its syncmode/direction)
    373373   * @param id gamestate id
    374    * @param mode FIXME - add doc!
     374   * @param mode Synchronisation mode (toclient, toserver or bidirectional)
    375375   * @return true/false
    376376   */
    377377  bool Synchronisable::doSync(int32_t id, uint8_t mode)
    378378  {
    379     if(mode==0x0)
    380       mode=state_;
     379//     if(mode==0x0)
     380//       mode=state_;
     381    assert(mode!=0x0);
    381382    return ( (this->objectMode_ & mode)!=0 && (!syncList_.empty() ) );
    382383  }
Note: See TracChangeset for help on using the changeset viewer.