Changeset 5740 for code/branches/ggz2/src/modules/gamestates
- Timestamp:
- Sep 1, 2009, 5:35:16 PM (15 years ago)
- Location:
- code/branches/ggz2
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/ggz2
- Property svn:mergeinfo changed
/code/branches/ggz (added) merged: 2803,2810,2888-2889,2997,3000,3002,3009,3106-3107,3109
- Property svn:mergeinfo changed
-
code/branches/ggz2/src/modules/gamestates/GSClient.cc
r5738 r5740 24 24 * Co-authors: 25 25 * Fabian 'x3n' Landau 26 * Adrian Friedli 26 27 * 27 28 */ 28 29 29 30 #include "GSClient.h" 31 #include "SpecialConfig.h" 30 32 31 33 #include "util/Exception.h" … … 35 37 #include "core/GameMode.h" 36 38 #include "network/Client.h" 39 #ifdef GGZMOD_FOUND 40 #include "GGZClient.h" 41 #endif /* GGZMOD_FOUND */ 37 42 38 43 namespace orxonox … … 45 50 : GameState(info) 46 51 , client_(0) 52 , ggzClient(0) 47 53 { 48 54 } … … 56 62 GameMode::setIsClient(true); 57 63 58 this->client_ = new Client(CommandLine::getValue("ip").getString(), CommandLine::getValue("port")); 64 #ifdef GGZMOD_FOUND 65 if (GGZClient::isActive()) 66 { 67 this->ggzClient = new GGZClient(this); 68 return; 69 } 70 #endif /* GGZMOD_FOUND */ 71 72 this->connect(CommandLine::getValue("ip").getString(), CommandLine::getValue("port")); 73 } 74 75 void GSClient::connect(const std::string& address, int port) 76 { 77 this->client_ = new Client(address, port); 59 78 60 79 if(!client_->establishConnection()) … … 68 87 client_->closeConnection(); 69 88 89 #ifdef GGZMOD_FOUND 90 if (ggzClient) 91 { 92 delete ggzClient; 93 } 94 #endif /* GGZMOD_FOUND */ 95 70 96 // destroy client 71 97 delete this->client_; … … 76 102 void GSClient::update(const Clock& time) 77 103 { 78 client_->update(time); 104 if (client_) 105 { 106 client_->update(time); 107 } 79 108 } 80 109 } -
code/branches/ggz2/src/modules/gamestates/GSClient.h
r5738 r5740 23 23 * Reto Grieder 24 24 * Co-authors: 25 * ...25 * Adrian Friedli 26 26 * 27 27 */ … … 42 42 GSClient(const GameStateInfo& info); 43 43 ~GSClient(); 44 void connect(const std::string& address, int port); 44 45 45 46 void activate(); … … 49 50 private: 50 51 Client* client_; 52 GGZClient* ggzClient; 51 53 }; 52 54 }
Note: See TracChangeset
for help on using the changeset viewer.