Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 12, 2008, 12:15:30 PM (16 years ago)
Author:
scheusso
Message:

Lots of changes:
Some fixes/hacks in objects
Changes in Gamestates and bugfixes
Removed some asserts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network/src/network/Server.cc

    r1834 r1901  
    7272    connection = new ConnectionManager();
    7373    gamestates_ = new GamestateManager();
    74     isServer_ = true;
    7574  }
    7675
     
    7978    connection = new ConnectionManager(port);
    8079    gamestates_ = new GamestateManager();
    81     isServer_ = true;
    8280  }
    8381
     
    9189    connection = new ConnectionManager(port, bindAddress);
    9290    gamestates_ = new GamestateManager();
    93     isServer_ = true;
    9491  }
    9592
     
    103100    connection = new ConnectionManager(port, bindAddress);
    104101    gamestates_ = new GamestateManager();
    105     isServer_ = true;
     102  }
     103 
     104  /**
     105  * @brief Destructor
     106  */
     107  Server::~Server(){
     108    if(connection)
     109      delete connection;
     110    if(gamestates_)
     111      delete gamestates_;
    106112  }
    107113
     
    198204    //std::cout << "updated gamestate, sending it" << std::endl;
    199205    //if(clients->getGamestateID()!=GAMESTATEID_INITIAL)
     206    sendGameState();
    200207    sendObjectDeletes();
    201     sendGameState();
    202208    COUT(5) << "Server: one sendGameState turn complete, repeat in next tick" << std::endl;
    203209    //std::cout << "sent gamestate" << std::endl;
     
    254260    if(!del->fetchIDs())
    255261      return true;  //everything ok (no deletes this tick)
     262//     COUT(3) << "sending DeleteObjects" << std::endl;
    256263    while(temp != NULL){
    257264      if( !(temp->getSynched()) ){
     
    307314    packet::Welcome *w = new packet::Welcome(temp->getID(), temp->getShipID());
    308315    w->setClientID(temp->getID());
    309     assert(w->send());
     316    bool b = w->send();
     317    assert(b);
    310318    packet::Gamestate *g = new packet::Gamestate();
    311319    g->setClientID(temp->getID());
    312     assert(g->collectData(0));
    313     assert(g->compressData());
    314     assert(g->send());
     320    b = g->collectData(0);
     321    assert(b);
     322    b = g->compressData();
     323    assert(b);
     324    b = g->send();
     325    assert(b);
    315326    return true;
    316327  }
Note: See TracChangeset for help on using the changeset viewer.