- Timestamp:
- Mar 30, 2006, 11:11:16 AM (19 years ago)
- Location:
- branches/preferences/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/preferences/src/lib/network/network_manager.cc
r6695 r7255 88 88 * @param hostName: the name of the destination host 89 89 */ 90 int NetworkManager::establishConnection(const char*name, unsigned int port)90 int NetworkManager::establishConnection(const std::string & name, unsigned int port) 91 91 { 92 92 IPaddress ipAddress; 93 int error = SDLNet_ResolveHost(&ipAddress, name , port);93 int error = SDLNet_ResolveHost(&ipAddress, name.c_str(), port); 94 94 if( error == -1) { 95 95 printf("\n\nerror on address resolution, program inconsistency\n\n"); -
branches/preferences/src/lib/network/network_manager.h
r6981 r7255 36 36 void shutdown(); 37 37 38 int establishConnection( const char*name, unsigned int port);38 int establishConnection( const std::string & name, unsigned int port); 39 39 int createServer(unsigned int port); 40 40 -
branches/preferences/src/orxonox.cc
r7254 r7255 89 89 90 90 /* this way, there is no network enabled: */ 91 this->serverName = NULL;91 this->serverName = ""; 92 92 this->port = -1; 93 93 … … 185 185 * initialize Orxonox with command line 186 186 */ 187 int Orxonox::init (int argc, char** argv, const char*name, int port)187 int Orxonox::init (int argc, char** argv, const std::string & name, int port) 188 188 { 189 189 this->argc = argc; … … 277 277 PRINT(3)("> Initializing networking\n"); 278 278 279 if( this->serverName != NULL) // we are a client279 if( this->serverName != "") // we are a client 280 280 { 281 281 State::setOnline(true); … … 424 424 return startNetworkOrxonox(argc, argv); 425 425 426 return startOrxonox(argc, argv, NULL, -1);426 return startOrxonox(argc, argv, "", -1); 427 427 return 0; 428 428 } … … 461 461 printf("Starting Orxonox as server: listening on port %i\n", port); 462 462 463 startOrxonox(argc, argv, NULL, port);463 startOrxonox(argc, argv, "", port); 464 464 } 465 465 } … … 472 472 * @param argv parameters given to orxonox 473 473 */ 474 int startOrxonox(int argc, char** argv, const char*name, int port)474 int startOrxonox(int argc, char** argv, const std::string & name, int port) 475 475 { 476 476 // checking for existence of the configuration-files, or if the lock file is still used -
branches/preferences/src/orxonox.h
r7254 r7255 22 22 inline static Orxonox* getInstance() { if (!singletonRef) singletonRef = new Orxonox(); return singletonRef; }; 23 23 24 int init(int argc, char** argv, const char*name, int port);24 int init(int argc, char** argv, const std::string & name, int port); 25 25 26 26 void restart(); … … 49 49 char** argv; //!< Values of th Arguments of orxonox. 50 50 51 const char* serverName; //!< Name of the Orxonox client if == NULL-> server51 std::string serverName; //!< Name of the Orxonox client if == "" -> server 52 52 int port; //!< number of the network port of the server/client if == -1 no network 53 53 }; … … 59 59 60 60 int startNetworkOrxonox(int argc, char** argv); 61 int startOrxonox(int argc, char** argv, const char*clientName, int port);61 int startOrxonox(int argc, char** argv, const std::string & clientName, int port); 62 62 63 63 #endif /* _ORXONOX_H */
Note: See TracChangeset
for help on using the changeset viewer.