Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9582 in orxonox.OLD


Ignore:
Timestamp:
Jul 28, 2006, 9:56:44 PM (18 years ago)
Author:
patrick
Message:

extending networknode interface, removed some compiler warnings and some old network stuff

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

Legend:

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

    r9494 r9582  
    148148
    149149
     150
     151/**
     152 *  gets the peer info by user id
     153 * @param userId  the user id of the node to look up
     154 * @return the peer info of this node NULL if nothing found
     155 */
     156PeerInfo* NetworkNode::getNodeByUserId( int userId)
     157{
     158  // look through the master server lists
     159  std::list<PeerInfo*>::const_iterator it = this->masterServerList.begin();
     160  for( ;it != this->masterServerList.end(); it++)
     161  {
     162    if( (*it)->userId == userId)
     163      return (*it);
     164  }
     165
     166  // look through the active proxy server list
     167  it = this->activeProxyServerList.begin();
     168  for( ; it != this->activeProxyServerList.end(); it++)
     169  {
     170    if( (*it)->userId == userId)
     171      return (*it);
     172  }
     173
     174  // look through the passive server list
     175  it = this->passiveProxyServerList.begin();
     176  for( ; it != this->passiveProxyServerList.end(); it++)
     177  {
     178    if( (*it)->userId == userId)
     179      return (*it);
     180  }
     181
     182  // look through the client list
     183  it = this->clientList.begin();
     184  for( ; it != this->clientList.end(); it++)
     185  {
     186    if( (*it)->userId == userId)
     187      return (*it);
     188  }
     189
     190  return NULL;
     191}
     192
     193
    150194/**
    151195 * @param index index to the client
     
    154198PeerInfo* NetworkNode::getClient(int index) const
    155199{
    156   if( this->clientList.size() < index)
     200  if( (int)this->clientList.size() < index)
    157201    return NULL;
    158202
     
    174218PeerInfo* NetworkNode::getActiveProxyServer(int index) const
    175219{
    176   if( this->activeProxyServerList.size() < index)
     220  if( (int)this->activeProxyServerList.size() < index)
    177221    return NULL;
    178222
     
    194238PeerInfo* NetworkNode::getPassiveProxyServer(int index) const
    195239{
    196   if( this->passiveProxyServerList.size() < index)
     240  if( (int)this->passiveProxyServerList.size() < index)
    197241    return NULL;
    198242
     
    214258PeerInfo* NetworkNode::getMasterServer(int index) const
    215259{
    216   if( this->masterServerList.size() < index)
     260  if( (int)this->masterServerList.size() < index)
    217261    return NULL;
    218262
  • branches/proxy/src/lib/network/monitor/network_node.h

    r9494 r9582  
    4646    inline std::list<PeerInfo*> getClient() const { return this->clientList; }
    4747
     48    PeerInfo* getNodeByUserId( int userId);
    4849
    4950    /** @returns the number of players */
  • branches/proxy/src/lib/network/network_game_manager.h

    r9521 r9582  
    1919class PNode;
    2020
    21 typedef enum NetworkGameManagerProtocol {
    22   NET_CREATE_ENTITY = 0,
    23   NET_REMOVE_ENTITY,
    24   NET_CREATE_ENTITY_LIST,
    25   NET_REMOVE_ENTITY_LIST,
    26   NET_REQUEST_CREATE,
    27   NET_REQUEST_REMOVE,
    28   NET_YOU_ARE_ENTITY,
    29   NET_REQUEST_ENTITY_LIST,
    3021
    31   NET_NUMBER
    32 };
    3322
    3423struct clientBuffer
  • branches/proxy/src/lib/network/proxy/proxy_control.cc

    r9572 r9582  
    2929#include "debug.h"
    3030
    31 
     31#include "monitor/network_monitor.h"
    3232
    3333
     
    8585  assert(SharedNetworkData::getInstance()->isProxyServerActive());
    8686
    87   byte data[INTSIZE];
     87  byte data[2 * INTSIZE];
     88  // write the userId in the message
     89  assert( Converter::intToByteArray( userId, data, INTSIZE ) == INTSIZE );
     90  // and the ip as an int
    8891
    8992  assert( Converter::intToByteArray( userId, data, INTSIZE ) == INTSIZE );
Note: See TracChangeset for help on using the changeset viewer.