Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 22, 2006, 11:45:21 PM (18 years ago)
Author:
bensch
Message:

new_class_id: adapted Network

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/new_class_id/src/lib/network/network_stream.cc

    r9690 r9691  
    4545
    4646#include "debug.h"
    47 #include "class_list.h"
    48 #include <algorithm>
    49 
    5047
    5148#include "network_stream.h"
     
    118115{
    119116  /* set the class id for the base object */
    120   this->setClassID(CL_NETWORK_STREAM, "NetworkStream");
     117  this->registerObject(this, NetworkStream::_objectList);
    121118  this->clientSocket = NULL;
    122119  this->clientSoftSocket = NULL;
     
    970967
    971968      // if handshake not finished only sync handshake
    972       if ( peer->second.handshake && sync.getLeafClassID() != CL_HANDSHAKE )
     969      if ( peer->second.handshake && Handshake::classID() != sync.getLeafClassID())
    973970        continue;
    974971
     
    976973      if ( ( SharedNetworkData::getInstance()->isMasterServer() ||
    977974             SharedNetworkData::getInstance()->isProxyServerActive() &&  peer->second.isClient())
    978              && sync.getLeafClassID() == CL_HANDSHAKE && sync.getUniqueID() != peer->second.userId )
     975             && Handshake::classID() == sync.getLeafClassID() && sync.getUniqueID() != peer->second.userId )
    979976        continue;
    980977
    981978      /* list of synchronizeables that will never be synchronized over the network: */
    982979      // do not sync null parent
    983       if ( sync.getLeafClassID() == CL_NULL_PARENT )
     980      if ( NullParent::classID() == sync.getLeafClassID())
    984981        continue;
    985982
     
    11901187          /* These are some small exeptions in creation: Not all objects can/should be created via Factory */
    11911188          /* Exception 1: NullParent */
    1192           if( leafClassId == CL_NULL_PARENT || leafClassId == CL_SYNCHRONIZEABLE || leafClassId == CL_NETWORK_GAME_MANAGER )
     1189          if( NullParent::classID() == leafClassId || Synchronizeable::classID() == leafClassId || NetworkGameManager::classID() == leafClassId)
    11931190          {
    11941191            PRINTF(1)("Don't create Object with ID %x, ignored!\n", (int)leafClassId);
     
    11971194          }
    11981195          else
    1199             b = Factory::fabricate( (ClassID)leafClassId );
     1196            b = Factory::fabricate( leafClassId );
    12001197
    12011198          if ( !b )
     
    12061203          }
    12071204
    1208           if ( b->isA(CL_SYNCHRONIZEABLE) )
     1205          if ( b->isA(Synchronizeable::classID()) )
    12091206          {
    12101207            sync = dynamic_cast<Synchronizeable*>(b);
Note: See TracChangeset for help on using the changeset viewer.