Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1379


Ignore:
Timestamp:
May 22, 2008, 4:35:11 PM (16 years ago)
Author:
scheusso
Message:

added command line argument —port

Location:
code/branches/network
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network/bin/keybindings.ini

    r1364 r1379  
    11[KeyBinder]
    22KeyUNASSIGNED=
    3 KeyESCAPE= exit
     3KeyESCAPE=exit
    44Key1=
    55Key2=
  • code/branches/network/src/network/ConnectionManager.cc

    r1378 r1379  
    7070    bindAddress.host = ENET_HOST_ANY;
    7171    bindAddress.port = NETWORK_PORT;
     72    head_ = head;
     73  }
     74 
     75  ConnectionManager::ConnectionManager(ClientInformation *head, int port){
     76    quit=false;
     77    bindAddress.host = ENET_HOST_ANY;
     78    bindAddress.port = port;
    7279    head_ = head;
    7380  }
  • code/branches/network/src/network/ConnectionManager.h

    r1378 r1379  
    7474    ConnectionManager();
    7575    ConnectionManager(ClientInformation *head);
     76    ConnectionManager(ClientInformation *head, int port);
    7677    ConnectionManager(int port, const char *address, ClientInformation *head);
    7778    ConnectionManager(int port, std::string address, ClientInformation *head);
  • code/branches/network/src/network/Server.cc

    r1360 r1379  
    6666    clients = new ClientInformation(true);
    6767    connection = new ConnectionManager(clients);
     68    gamestates = new GameStateManager(clients);
     69  }
     70 
     71  Server::Server(int port){
     72    packet_gen = PacketGenerator();
     73    clients = new ClientInformation(true);
     74    connection = new ConnectionManager(clients, port);
    6875    gamestates = new GameStateManager(clients);
    6976  }
  • code/branches/network/src/network/Server.h

    r1293 r1379  
    6060  public:
    6161    Server();
     62    Server(int port);
    6263    Server(int port, std::string bindAddress);
    6364    Server(int port, const char *bindAddress);
  • code/branches/network/src/orxonox/Orxonox.cc

    r1362 r1379  
    170170    timefactor_(1.0f),
    171171    mode_(STANDALONE),
    172     serverIp_("")
     172    serverIp_(""),
     173    serverPort_(NETWORK_PORT)
    173174  {
    174175  }
     
    244245    ar.checkArgument("data", dataPath, false);
    245246    ar.checkArgument("ip", serverIp_, false);
     247    ar.checkArgument("port", serverPort_, false);
    246248    if(ar.errorHandling())
    247249      return false;
     
    357359    ib->registerListener(console, &Testconsole::execute, '\r', false);
    358360    ib->registerListener(console, &Testconsole::hintandcomplete, '\t', true);
    359     ib->registerListener(console, &Testconsole::clear, '§', true);
     361    ib->registerListener(console, &Testconsole::clear, '', true);
    360362    ib->registerListener(console, &Testconsole::removeLast, '\b', true);
    361363    ib->registerListener(console, &Testconsole::exit, (char)0x1B, true);
     
    365367    ib->registerListener(orxonoxConsole_, &InGameConsole::execute, '\r', false);
    366368    ib->registerListener(orxonoxConsole_, &InGameConsole::hintandcomplete, '\t', true);
    367     ib->registerListener(orxonoxConsole_, &InGameConsole::clear, '§', true);
     369    ib->registerListener(orxonoxConsole_, &InGameConsole::clear, '', true);
    368370    ib->registerListener(orxonoxConsole_, &InGameConsole::removeLast, '\b', true);
    369371    ib->registerListener(orxonoxConsole_, &InGameConsole::exit, (char)0x1B, true);
     
    379381    COUT(2) << "Loading level in server mode" << std::endl;
    380382
    381     server_g = new network::Server();
     383    server_g = new network::Server(serverPort_);
    382384
    383385    if (!loadScene())
     
    399401      client_g = network::Client::createSingleton();
    400402    else
    401       client_g = network::Client::createSingleton(serverIp_, NETWORK_PORT);
     403     
     404      client_g = network::Client::createSingleton(serverIp_, serverPort_);
    402405
    403406    client_g->establishConnection();
  • code/branches/network/src/orxonox/Orxonox.h

    r1293 r1379  
    105105      gameMode              mode_;
    106106      std::string           serverIp_;
     107      int                   serverPort_;
    107108
    108109      static Orxonox *singletonRef_s;
Note: See TracChangeset for help on using the changeset viewer.