Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9334 in orxonox.OLD for branches/proxy/src/lib/network/monitor


Ignore:
Timestamp:
Jul 19, 2006, 10:29:14 PM (18 years ago)
Author:
patrick
Message:

work of the day in one commit:D

  • switched whole network framework to ip sturcture
  • extended ip structrue a little bit
  • reimplemented the disconnection/reconnection algorithm
  • synchronizeable ip bug discovered and solved
Location:
branches/proxy/src/lib/network/monitor
Files:
3 edited

Legend:

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

    r9308 r9334  
    117117 * @param ip ip of the new node
    118118 */
    119 void NetworkMonitor::addNode(IPaddress ip, int nodeType)
     119void NetworkMonitor::addNode(IP ip, int nodeType)
    120120{
    121121  PeerInfo* pInfo = new PeerInfo();
  • branches/proxy/src/lib/network/monitor/network_monitor.h

    r9327 r9334  
    1010#include "synchronizeable.h"
    1111#include "shared_network_data.h"
     12#include "ip.h"
    1213
    1314#include "network_node.h"
     
    3637
    3738    void addNode(PeerInfo* pInfo);
    38     void addNode(IPaddress ip, int nodeType);
     39    void addNode(IP ip, int nodeType);
    3940    void addNode(NetworkNode* node) { this->nodeList.push_back(node); }
    4041    void addNode(NetworkNode* node, PeerInfo* pInfo);
     
    6566    PeerInfo* getSecondChoiceProxy();
    6667    /** @returns true if the next client should be reconnected to some other proxy server with more connections */
    67     inline bool reconnectNextClient() { return (this->localNode->getPlayerNumber() >= SharedNetworkData::getInstance()->getMaxPlayer())?true:false; }
     68    inline bool isReconnectNextClient() { return (this->localNode->getPlayerNumber() >= SharedNetworkData::getInstance()->getMaxPlayer())?true:false; }
    6869
    6970
  • branches/proxy/src/lib/network/monitor/network_node.cc

    r9308 r9334  
    239239  for(; it != this->masterServerList.end(); it++)
    240240  {
    241     int ip = (*it)->ip.host;
    242     PRINT(0)("     - ms, id: %i (%d.%d.%d.%d:9999)\n", (*it)->userId, (ip & 0x000000FF), (ip & 0x0000FF00) >> 8, (ip & 0x00FF0000) >> 16, (ip & 0xFF000000)>>24);
     241    IP* ip = &(*it)->ip;
     242    PRINT(0)("     - ms, id: %i (%s:9999)\n", (*it)->userId, ip->ipString().c_str());
    243243  }
    244244
     
    247247  for(; it != this->activeProxyServerList.end(); it++)
    248248  {
    249     int ip = (*it)->ip.host;
    250     PRINT(0)("     - ps-a, id: %i (%d.%d.%d.%d:9999)\n", (*it)->userId, (ip & 0x000000FF), (ip & 0x0000FF00) >> 8, (ip & 0x00FF0000) >> 16, (ip & 0xFF000000)>>24);
     249    IP* ip = &(*it)->ip;
     250    PRINT(0)("     - ps-a, id: %i (%s:9999)\n", (*it)->userId, ip->ipString().c_str());
    251251  }
    252252
     
    255255  for(; it != this->passiveProxyServerList.end(); it++)
    256256  {
    257     int ip = (*it)->ip.host;
    258     PRINT(0)("     - ps-p, id: %i (%d.%d.%d.%d:9999)\n", (*it)->userId, (ip & 0x000000FF), (ip & 0x0000FF00) >> 8, (ip & 0x00FF0000) >> 16, (ip & 0xFF000000)>>24);
     257    IP* ip = &(*it)->ip;
     258    PRINT(0)("     - ps-p, id: %i (%s:9999)\n", (*it)->userId, ip->ipString().c_str());
    259259  }
    260260
     
    263263  for(; it != this->clientList.end(); it++)
    264264  {
    265     int ip = (*it)->ip.host;
    266     PRINT(0)("     - client, id: %i (%d.%d.%d.%d:9999)\n", (*it)->userId, (ip & 0x000000FF), (ip & 0x0000FF00) >> 8, (ip & 0x00FF0000) >> 16, (ip & 0xFF000000)>>24);
    267   }
    268 }
    269 
     265    IP* ip = &(*it)->ip;
     266    PRINT(0)("     - client, id: %i (%s:9999)\n", (*it)->userId, ip->ipString().c_str());
     267  }
     268}
     269
Note: See TracChangeset for help on using the changeset viewer.