- Timestamp:
- Apr 8, 2009, 12:58:47 AM (16 years ago)
- Location:
- code/branches/questsystem5
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/questsystem5
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/orxonox/gamestates/GSDedicated.cc
r2907 r2908 30 30 #include "GSDedicated.h" 31 31 32 #include "core/Clock.h"33 32 #include "core/CommandLine.h" 34 #include "core/Game.h" 35 #include "core/GameMode.h" 33 #include "core/Core.h" 36 34 #include "core/Iterator.h" 37 35 #include "network/Server.h" … … 41 39 namespace orxonox 42 40 { 43 AddGameState(GSDedicated, "dedicated"); 44 45 GSDedicated::GSDedicated(const std::string& name) 46 : GameState(name) 41 GSDedicated::GSDedicated() 42 : GameState<GSRoot>("dedicated") 47 43 , server_(0) 48 44 , timeSinceLastUpdate_(0) … … 54 50 } 55 51 56 void GSDedicated:: activate()52 void GSDedicated::enter() 57 53 { 58 GameMode::setHasServer(true);54 Core::setHasServer(true); 59 55 60 56 this->server_ = new Server(CommandLine::getValue("port")); 61 57 COUT(0) << "Loading scene in server mode" << std::endl; 62 58 59 GSLevel::enter(0); 60 63 61 server_->open(); 64 62 } 65 63 66 void GSDedicated:: deactivate()64 void GSDedicated::leave() 67 65 { 66 GSLevel::leave(); 67 68 68 this->server_->close(); 69 69 delete this->server_; 70 70 71 GameMode::setHasServer(false);71 Core::setHasServer(false); 72 72 } 73 73 74 void GSDedicated:: update(const Clock& time)74 void GSDedicated::ticked(const Clock& time) 75 75 { 76 76 // static float startTime = time.getSecondsPrecise(); … … 82 82 // COUT(0) << "estimated ticks/sec: " << nrOfTicks/(time.getSecondsPrecise()-startTime) << endl; 83 83 timeSinceLastUpdate_ -= static_cast<unsigned int>(timeSinceLastUpdate_ / NETWORK_PERIOD) * NETWORK_PERIOD; 84 server_->update(time); 84 GSLevel::ticked(time); 85 server_->tick(time.getDeltaTime()); 86 this->tickChild(time); 85 87 } 86 88 else
Note: See TracChangeset
for help on using the changeset viewer.