Changeset 3107 for code/branches/ggz/src/orxonox/gamestates
- Timestamp:
- May 28, 2009, 11:47:22 PM (16 years ago)
- Location:
- code/branches/ggz/src/orxonox/gamestates
- Files:
-
- 2 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 -
code/branches/ggz/src/orxonox/gamestates/GSClient.h
r3106 r3107 30 30 #define _GSClient_H__ 31 31 32 #include "SpecialConfig.h"33 32 #include "OrxonoxPrereqs.h" 34 33 #include "network/NetworkPrereqs.h" … … 38 37 namespace orxonox 39 38 { 40 #ifdef GGZMOD_FOUND41 class _OrxonoxExport GGZClient;42 #endif /* GGZMOD_FOUND */43 44 39 class _OrxonoxExport GSClient : public GameState<GSGraphics>, public GSLevel 45 40 { … … 47 42 GSClient(); 48 43 ~GSClient(); 44 void connect(const std::string& address, int port); 49 45 50 46 private: … … 54 50 55 51 Client* client_; 56 #ifdef GGZMOD_FOUND57 52 GGZClient* ggzClient; 58 #endif /* GGZMOD_FOUND */59 53 }; 60 54 }
Note: See TracChangeset
for help on using the changeset viewer.