Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9654 in orxonox.OLD for branches


Ignore:
Timestamp:
Aug 1, 2006, 1:05:56 AM (18 years ago)
Author:
patrick
Message:

some connection movement work

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

Legend:

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

    r9653 r9654  
    240240  this->networkStream->setRedirectionTest();
    241241}
     242
  • branches/proxy/src/lib/network/network_stream.cc

    r9653 r9654  
    859859  this->peers[serverUserId].socket = newSocket;
    860860
     861  this->bSoftRedirect = false;
    861862  return;
    862863
     
    873874  this->networkMonitor->removeNode(&this->peers[serverUserId]);
    874875
    875   this->bSoftRedirect = false;
    876 }
     876}
     877
     878
     879
     880/**
     881 * prepares a soft connection for a client to connect to
     882 * @param userId that will connect to this server
     883 */
     884void NetworkStream::prepareSoftConnection(int userId)
     885{
     886  PRINTF(0)("prepare soft connection for userId %i\n");
     887}
     888
    877889
    878890
  • branches/proxy/src/lib/network/network_stream.h

    r9653 r9654  
    5151    void reconnectToServer(IP address);
    5252    void softReconnectToServer(int serverUserId, IP address);
     53    void prepareSoftConnection(int userId);
    5354
    5455
  • branches/proxy/src/lib/network/proxy/proxy_control.cc

    r9638 r9654  
    2424#include "ip.h"
    2525#include "peer_info.h"
     26#include "network_stream.h"
    2627
    2728#include "converter.h"
     
    278279
    279280
    280   this->forceReconnection(userId, serverInfo->ip);
     281  this->forceReconnection(userId, serverId, serverInfo->ip);
    281282}
    282283
     
    287288 * @param newAddress the addresss the client should connect to
    288289 */
    289 void ProxyControl::forceReconnection(int userId, IP newAddress)
     290void ProxyControl::forceReconnection(int userId, int serverId, IP newAddress)
    290291{
    291292  PRINTF(0)("forcing reconnection: userId %i to %s\n", userId, newAddress.ipString().c_str());
     
    321322
    322323  PRINTF(0)("Sending reconnection command to: %i\n", userId);
     324  // send the reconnection signal to the client who must reconnect
    323325  MessageManager::getInstance()->sendMessage( MSGID_PROXY_COMMAND, data, 3*INTSIZE, RT_USER, userId, MP_HIGHBANDWIDTH );
     326  // and to the server who needs to accept the new client
     327  MessageManager::getInstance()->sendMessage( MSGID_PROXY_COMMAND, data, 3*INTSIZE, RT_USER, serverId, MP_HIGHBANDWIDTH );
    324328}
    325329
     
    366370      if( SharedNetworkData::getInstance()->getHostID() == userId)
    367371      {
    368         NetworkManager::getInstance()->reconnectToServer(IP(ipHost, 9999));
     372        if( SharedNetworkData::getInstance()->isClient())
     373          SharedNetworkData::getInstance()->getDefaultSyncStream()->softReconnectToServer(userId, IP(ipHost, 9999));
     374        else
     375          SharedNetworkData::getInstance()->getDefaultSyncStream()->prepareSoftConnection(userId);
    369376      }
    370377      break;
  • branches/proxy/src/lib/network/proxy/proxy_control.h

    r9625 r9654  
    4949    void forceReconnectionShell(int userId, int serverId);
    5050    void forceReconnection(int userId, int serverId);
    51     void forceReconnection(int userId, IP newAddress);
     51    void forceReconnection(int userId, int serverId, IP newAddress);
    5252    void forceReconnection(int userId, const std::string& newAddress);
    5353    static bool messageHandlerCommand( MessageType messageType, byte * data, int dataLength, void * someData, int senderId, int destinationId  );
Note: See TracChangeset for help on using the changeset viewer.