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.h

    r6250 r6273  
    99#include "base_object.h"
    1010#include "netdefs.h"
     11#include "converter.h"
    1112
    1213
     
    1819#define STATE_SERVER 1
    1920#define STATE_OUTOFSYNC 2
     21#define STATE_REQUESTEDSYNC 4
     22
     23//macros to help writing data in byte buffer
     24#define SYNCHELP_WRITE_BEGIN() {  int __synchelp_write_i = 0; \
     25                                  bool __synchelp_write_err = false; \
     26                                  int __synchelp_write_n; }
     27#define SYNCHELP_WRITE_RESET() { __synchelp_write_i = 0; __synchelp_write_err = false; }
     28#define SYNCHELP_WRITE_INT(i) { __synchelp_write_n =  }
     29#define SYNCHELP_WIRTE_FLOAT()
     30#define SYNCHELP_WRITE_BYTE()
     31#define SYNCHELP_WRITE_STRING()
    2032
    2133class NetworkStream;
     
    3547    void setIsServer( bool isServer );
    3648    void setIsOutOfSync( bool outOfSync );
     49    void setRequestedSync( bool requestedSync );
    3750    bool isServer();
    3851    bool isOutOfSync();
    39     void setUniqueID( int id ){ uniqueID = id; }
    40     int  getUniqueID() const { return uniqueID; };
    41     void requestSync( int hostID ){ this->synchronizeRequests.push_back( hostID ); }
     52    bool requestedSync();
     53    inline void setUniqueID( int id ){ uniqueID = id; }
     54    inline int  getUniqueID() const { return uniqueID; };
     55    inline void requestSync( int hostID ){ this->synchronizeRequests.push_back( hostID ); }
     56    inline int getRequestSync( void ){ if ( this->synchronizeRequests.size()>0 ){ int n = *(synchronizeRequests.begin()); synchronizeRequests.pop_front(); return n; } else { return -1; } };
     57    inline int getHostID() { return this->hostID; }
    4258
    4359    inline int getOwner(){ return owner; }
     
    5571    int owner;
    5672    int hostID;
    57     int state;
     73
    5874    std::list<int> synchronizeRequests;
    5975
    6076  protected:
    6177    NetworkStream* networkStream;
     78    int state;
    6279
    6380  };
Note: See TracChangeset for help on using the changeset viewer.