Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 23, 2005, 5:30:22 PM (18 years ago)
Author:
rennerc
Message:

converter: added functions for strings
network_protocol: length and id are now int
network_game_manager: fixed some more bugs :D
skybox: is loaded on client corectly now :)

File:
1 edited

Legend:

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

    r6252 r6273  
    3030  this->setClassID(CL_SYNCHRONIZEABLE, "Synchronizeable");
    3131  owner = 0;
     32  state = 0;
    3233  hostID = NetworkManager::getInstance()->getHostID();
    3334  this->setIsServer(this->hostID == 0);
    3435  uniqueID = -1;
    3536  this->networkStream = NULL;
     37  this->setRequestedSync( false );
    3638}
    3739
     
    9496  else
    9597    this->state = this->state & (~STATE_OUTOFSYNC);
     98  //PRINTF(0)("isoutofsync %s %d\n", this->getClassName(), state);
    9699}
    97100
     
    102105bool Synchronizeable::isServer()
    103106{
    104   return this->state & STATE_SERVER == STATE_SERVER;
     107  return (this->state & STATE_SERVER) >0;
    105108}
    106109
     
    111114bool Synchronizeable::isOutOfSync()
    112115{
    113   return this->state & STATE_OUTOFSYNC == STATE_OUTOFSYNC;
     116  return (this->state & STATE_OUTOFSYNC) >0;
     117}
     118
     119/**
     120 * Determines if the requestedSync flag is set
     121 * @return true, if the requestedSync flag is true, false else
     122 */
     123bool Synchronizeable::requestedSync()
     124{
     125  return (this->state & STATE_REQUESTEDSYNC) >0;
     126}
     127
     128/**
     129 * Sets the requestedsync flag to a given value
     130 * @param requestedSync: the boolean value which the requestedsync flag is to set to
     131 */
     132void Synchronizeable::setRequestedSync( bool requestedSync )
     133{
     134  if( requestedSync )
     135    this->state = this->state | STATE_REQUESTEDSYNC;
     136  else
     137    this->state = this->state & (~STATE_REQUESTEDSYNC);
    114138}
    115139
Note: See TracChangeset for help on using the changeset viewer.