Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9600 in orxonox.OLD


Ignore:
Timestamp:
Jul 29, 2006, 9:59:20 AM (18 years ago)
Author:
patrick
Message:

reconnection command deep structure

Location:
branches/proxy/src/lib/network
Files:
6 edited

Legend:

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

    r9538 r9600  
    179179
    180180/**
     181 * reconnects this client to another server
     182 * @param address new server address
     183 */
     184void NetworkManager::reconnectToServer(IP address)
     185{
     186  PRINTF(0)("Rec. reconnection command\n");
     187  this->networkStream->reconnectToServer(address);
     188}
     189
     190
     191/**
    181192 * connects a synchronizeable to the network stream
    182193 * @param sync: synchronizeable to connect
  • branches/proxy/src/lib/network/network_manager.h

    r9494 r9600  
    3939    int createProxyServer( unsigned int port);
    4040
     41    void reconnectToServer(IP address);
     42
    4143    void connectSynchronizeable(Synchronizeable& sync);
    4244    void synchronize(float dtS);
  • branches/proxy/src/lib/network/network_stream.cc

    r9598 r9600  
    741741
    742742
     743
     744/**
     745 * reconnects to another server, with full handshake
     746 * @param address of the new server
     747 */
     748void NetworkStream::reconnectToServer(IP address)
     749{
     750
     751}
     752
     753
     754
     755/**
     756 * softly reconnecting to another server
     757 * @param address  of the new server
     758 */
     759void NetworkStream::softReconnectToServer(IP address)
     760{
     761
     762}
     763
     764
    743765/**
    744766 * handles the disconnect event
  • branches/proxy/src/lib/network/network_stream.h

    r9494 r9600  
    4141    void init();
    4242
     43    /* network interface controls */
    4344    void connectToMasterServer(std::string host, int port);
    4445    void connectToProxyServer(int proxyId, std::string host, int port);
     
    4748    void createNetworkGameManager();
    4849    void startHandshake(int userId = NET_ID_MASTER_SERVER);
     50
     51    void reconnectToServer(IP address);
     52    void softReconnectToServer(IP address);
     53
    4954
    5055    /* synchronizeable interface */
  • branches/proxy/src/lib/network/proxy/proxy_control.cc

    r9599 r9600  
    1616
    1717#include "class_list.h"
    18 
     18#include "shell_command.h"
    1919
    2020#include "state.h"
    2121#include "shared_network_data.h"
     22#include "network_manager.h"
    2223#include "network_game_manager.h"
    2324#include "ip.h"
     
    3536ProxyControl* ProxyControl::singletonRef = NULL;
    3637
     38
     39SHELL_COMMAND(forceReconnect, ProxyControl, forceReconnectionShell);
    3740
    3841/**
     
    227230
    228231
     232/**
     233 * a shell command wrapper
     234 * @param userId the userId of the client/user :D
     235 * @param serverId the userId of the server to connect to
     236 */
     237void ProxyControl::forceReconnectionShell(int userId, int serverId)
     238{
     239  this->forceReconnection(userId, serverId);
     240}
     241
    229242
    230243/**
     
    332345
    333346      // handle it
    334       if( SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServerActive())
     347      if( SharedNetworkData::getInstance()->getHostID() == userId &&
     348         (SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServerActive()))
    335349      {
     350        NetworkManager::getInstance()->reconnectToServer(IP(ipHost, 9999));
    336351      }
    337352      break;
  • branches/proxy/src/lib/network/proxy/proxy_control.h

    r9599 r9600  
    4343
    4444    /* proxy server network control */
     45    void forceReconnectionShell(int userId, int serverId);
    4546    void forceReconnection(int userId, int serverId);
    4647    void forceReconnection(int userId, IP newAddress);
Note: See TracChangeset for help on using the changeset viewer.