Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 23, 2006, 2:43:50 PM (18 years ago)
Author:
patrick
Message:

network: debug function for NetworkStream and connection

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/lib/network/synchronizeable.cc

    r6424 r6658  
    1818
    1919#include "synchronizeable.h"
     20
    2021#include "netdefs.h"
    2122#include "network_manager.h"
     23#include "network_game_manager.h"
    2224#include "network_stream.h"
     25
     26#include "assert.h"
    2327
    2428
     
    2933{
    3034  this->setClassID(CL_SYNCHRONIZEABLE, "Synchronizeable");
    31   owner = 0;
    32   state = 0;
    33   hostID = NetworkManager::getInstance()->getHostID();
     35  this->owner = 0;
     36  this->state = 0;
     37  this->hostID = NetworkManager::getInstance()->getHostID();
    3438  this->setIsServer(this->hostID == 0);
    35   uniqueID = -1;
     39  this->uniqueID = -1;
    3640  this->networkStream = NULL;
    3741  this->setRequestedSync( false );
    3842  this->setIsOutOfSync( !(this->isServer()) );
     43
     44  this->bSynchronize = false;
     45  NetworkStream* nd;
     46  if( this->isA(CL_NETWORK_GAME_MANAGER))
     47  {
     48    nd = NetworkGameManager::getInstance()->getNetworkStream();
     49    assert(nd != NULL);
     50    nd->connectSynchronizeable(*this);
     51  }
    3952}
    4053
     
    5063}
    5164
     65
    5266/**
    5367 *  write data to NetworkStream
     
    5771  PRINTF(5)("Synchronizeable::writeBytes was called\n");
    5872}
     73
    5974
    6075/**
     
    87102}
    88103
     104
    89105/**
    90106 * Sets the outofsync flag to a given value
     
    100116}
    101117
     118
    102119/**
    103120 * Determines if the server flag is set
     
    108125  return (this->state & STATE_SERVER) >0;
    109126}
     127
    110128
    111129/**
     
    118136}
    119137
     138
    120139/**
    121140 * Determines if the requestedSync flag is set
     
    126145  return (this->state & STATE_REQUESTEDSYNC) >0;
    127146}
     147
    128148
    129149/**
Note: See TracChangeset for help on using the changeset viewer.