Changeset 3107 for code/branches/ggz/src/orxonox/gamestates/GSClient.cc
- Timestamp:
- May 28, 2009, 11:47:22 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/ggz/src/orxonox/gamestates/GSClient.cc
r3106 r3107 30 30 #include "OrxonoxStableHeaders.h" 31 31 #include "GSClient.h" 32 #include "SpecialConfig.h" 32 33 33 34 #include "core/input/InputManager.h" … … 44 45 45 46 GSClient::GSClient() 46 : GameState<GSGraphics>("client") 47 , client_(0) 47 : GameState<GSGraphics>("client"), 48 client_(0), 49 ggzClient(0) 48 50 { 49 51 } … … 58 60 59 61 #ifdef GGZMOD_FOUND 60 ggzClient = NULL;61 if (GGZClient::isActive()){62 COUT(3) << "Initializing GGZ\n";63 ggzClient = new GGZClient;62 if (GGZClient::isActive()) 63 { 64 this->ggzClient = new GGZClient(this); 65 return; 64 66 } 65 else {66 COUT(3) << "Not using GGZ\n";67 }68 #else /* GGZMOD_FOUND */69 COUT(3) << "GGZ support disabled\n";70 67 #endif /* GGZMOD_FOUND */ 71 68 72 this->client_ = new Client(CommandLine::getValue("ip").getString(), CommandLine::getValue("port")); 69 this->connect(CommandLine::getValue("ip").getString(), CommandLine::getValue("port")); 70 } 71 72 void GSClient::connect(const std::string& address, int port) 73 { 74 this->client_ = new Client(address, port); 73 75 74 76 if(!client_->establishConnection()) … … 86 88 client_->closeConnection(); 87 89 88 #ifdef GGZMOD_FOUND89 90 if (ggzClient) 90 91 { 91 92 delete ggzClient; 92 93 } 93 #endif /* GGZMOD_FOUND */94 94 95 95 // destroy client
Note: See TracChangeset
for help on using the changeset viewer.