Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7255 in orxonox.OLD


Ignore:
Timestamp:
Mar 30, 2006, 11:11:16 AM (18 years ago)
Author:
rennerc
Message:

one char* removed

Location:
branches/preferences/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/preferences/src/lib/network/network_manager.cc

    r6695 r7255  
    8888 * @param hostName: the name of the destination host
    8989 */
    90 int NetworkManager::establishConnection(const char* name, unsigned int port)
     90int NetworkManager::establishConnection(const std::string & name, unsigned int port)
    9191{
    9292  IPaddress ipAddress;
    93   int error = SDLNet_ResolveHost(&ipAddress, name, port);
     93  int error = SDLNet_ResolveHost(&ipAddress, name.c_str(), port);
    9494  if( error == -1) {
    9595    printf("\n\nerror on address resolution, program inconsistency\n\n");
  • branches/preferences/src/lib/network/network_manager.h

    r6981 r7255  
    3636    void shutdown();
    3737
    38     int establishConnection(const char* name, unsigned int port);
     38    int establishConnection( const std::string & name, unsigned int port);
    3939    int createServer(unsigned int port);
    4040
  • branches/preferences/src/orxonox.cc

    r7254 r7255  
    8989
    9090  /* this way, there is no network enabled: */
    91   this->serverName = NULL;
     91  this->serverName = "";
    9292  this->port = -1;
    9393
     
    185185 * initialize Orxonox with command line
    186186 */
    187 int Orxonox::init (int argc, char** argv, const char* name, int port)
     187int Orxonox::init (int argc, char** argv, const std::string & name, int port)
    188188{
    189189  this->argc = argc;
     
    277277  PRINT(3)("> Initializing networking\n");
    278278
    279   if( this->serverName != NULL) // we are a client
     279  if( this->serverName != "") // we are a client
    280280  {
    281281    State::setOnline(true);
     
    424424    return startNetworkOrxonox(argc, argv);
    425425 
    426   return startOrxonox(argc, argv, NULL, -1);
     426  return startOrxonox(argc, argv, "", -1);
    427427  return 0;
    428428}
     
    461461    printf("Starting Orxonox as server: listening on port %i\n", port);
    462462   
    463     startOrxonox(argc, argv, NULL, port);
     463    startOrxonox(argc, argv, "", port);
    464464  }
    465465}
     
    472472 * @param argv parameters given to orxonox
    473473 */
    474 int startOrxonox(int argc, char** argv, const char* name, int port)
     474int startOrxonox(int argc, char** argv, const std::string & name, int port)
    475475{
    476476  // checking for existence of the configuration-files, or if the lock file is still used
  • branches/preferences/src/orxonox.h

    r7254 r7255  
    2222  inline static Orxonox* getInstance() { if (!singletonRef) singletonRef = new Orxonox();  return singletonRef; };
    2323
    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);
    2525
    2626  void restart();
     
    4949  char**            argv;                    //!< Values of th Arguments of orxonox.
    5050
    51   const char*       serverName;              //!< Name of the Orxonox client if == NULL -> server
     51  std::string       serverName;              //!< Name of the Orxonox client if == "" -> server
    5252  int               port;                    //!< number of the network port of the server/client if == -1 no network
    5353};
     
    5959
    6060int startNetworkOrxonox(int argc, char** argv);
    61 int startOrxonox(int argc, char** argv, const char* clientName, int port);
     61int startOrxonox(int argc, char** argv, const std::string & clientName, int port);
    6262
    6363#endif /* _ORXONOX_H */
Note: See TracChangeset for help on using the changeset viewer.