Changeset 2844 for code/branches/gui/src/orxonox/gamestates/GSDedicated.cc
- Timestamp:
- Mar 25, 2009, 5:23:00 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gui/src/orxonox/gamestates/GSDedicated.cc
r2817 r2844 37 37 #include "objects/Tickable.h" 38 38 #include "util/Sleep.h" 39 #include "core/Game.h" 39 40 40 41 namespace orxonox 41 42 { 42 GSDedicated::GSDedicated() 43 : GameState("dedicated") 43 AddGameState(GSDedicated, "dedicated"); 44 45 GSDedicated::GSDedicated(const std::string& name) 46 : GameState(name) 44 47 , server_(0) 45 48 , timeSinceLastUpdate_(0) … … 51 54 } 52 55 53 void GSDedicated:: enter()56 void GSDedicated::activate() 54 57 { 55 58 Core::setHasServer(true); … … 58 61 COUT(0) << "Loading scene in server mode" << std::endl; 59 62 60 GSLevel::enter();61 62 63 server_->open(); 63 64 } 64 65 65 void GSDedicated:: leave()66 void GSDedicated::deactivate() 66 67 { 67 GSLevel::leave();68 69 68 this->server_->close(); 70 69 delete this->server_; … … 73 72 } 74 73 75 void GSDedicated:: ticked(const Clock& time)74 void GSDedicated::update(const Clock& time) 76 75 { 77 76 // static float startTime = time.getSecondsPrecise(); … … 83 82 // COUT(0) << "estimated ticks/sec: " << nrOfTicks/(time.getSecondsPrecise()-startTime) << endl; 84 83 timeSinceLastUpdate_ -= static_cast<unsigned int>(timeSinceLastUpdate_ / NETWORK_PERIOD) * NETWORK_PERIOD; 85 GSLevel::ticked(time);86 84 server_->update(time); 87 this->tickChild(time);88 85 } 89 86 else
Note: See TracChangeset
for help on using the changeset viewer.