Changeset 9261 in orxonox.OLD for branches/proxy/src/lib
- Timestamp:
- Jul 12, 2006, 6:07:36 PM (18 years ago)
- Location:
- branches/proxy/src/lib/network
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/proxy/src/lib/network/handshake.cc
r9235 r9261 33 33 this->setIsServer(server); 34 34 35 // register all variable handlers 35 36 orxId_handler = registerVarId( new SynchronizeableInt( &localState.orxId, &remoteState.orxId, "orxonoxId", PERMISSION_ALL ) ); 36 37 version_handler = registerVarId( new SynchronizeableInt( &localState.version, &remoteState.version, "version", PERMISSION_ALL ) ); … … 43 44 44 45 candel_id = registerVarId( new SynchronizeableInt( &localState.canDel, &remoteState.canDel, "canDel", PERMISSION_ALL ) ); 45 46 46 47 registerVar( new SynchronizeableString( &localState.preferedNickName, &remoteState.preferedNickName, "preferedNickName", PERMISSION_ALL ) ); 47 48 49 // init the local state 48 50 localState.completed = 0; 49 51 localState.error = 0; … … 66 68 remoteState.canDel = 0; 67 69 70 // activate the synchronization process 68 71 this->setSynchronized(true); 69 72 PRINTF(0)("Handshake created clientId = %d\n", clientId); -
branches/proxy/src/lib/network/synchronizeable.cc
r9249 r9261 222 222 { 223 223 hasPermission = ( 224 this->isServer() && (*it)->checkPermission( PERMISSION_ SERVER ) ||224 this->isServer() && (*it)->checkPermission( PERMISSION_MASTER_SERVER ) || 225 225 this->owner == SharedNetworkData::getInstance()->getHostID() && (*it)->checkPermission( PERMISSION_OWNER ) || 226 226 this->isServer() && this->owner != userId && (*it)->checkPermission( PERMISSION_OWNER ) || … … 344 344 { 345 345 if ( 346 (*it)->checkPermission( PERMISSION_ SERVER ) && networkStream->isUserMasterServer( userId ) ||346 (*it)->checkPermission( PERMISSION_MASTER_SERVER ) && networkStream->isUserMasterServer( userId ) || 347 347 (*it)->checkPermission( PERMISSION_OWNER ) && this->owner == userId || 348 348 networkStream->isUserMasterServer( userId ) && this->owner != SharedNetworkData::getInstance()->getHostID() && (*it)->checkPermission( PERMISSION_OWNER ) || … … 361 361 else 362 362 { 363 // PRINTF(0)("DONT SET VAR BECAUSE OF PERMISSION: %s %d %d %d %d %d %d\n", (*it)->getName().c_str(), (*it)->checkPermission( PERMISSION_ SERVER ), (*it)->checkPermission( PERMISSION_OWNER ), (*it)->checkPermission( PERMISSION_ALL ), networkStream->isUserServer( userId ), this->owner, userId );363 // PRINTF(0)("DONT SET VAR BECAUSE OF PERMISSION: %s %d %d %d %d %d %d\n", (*it)->getName().c_str(), (*it)->checkPermission( PERMISSION_MASTER_SERVER ), (*it)->checkPermission( PERMISSION_OWNER ), (*it)->checkPermission( PERMISSION_ALL ), networkStream->isUserServer( userId ), this->owner, userId ); 364 364 n = (*it)->getSizeFromBuf( stateTo->data + i, stateTo->dataLength - i ); 365 365 //NETPRINTF(0)("%s::setvar %s %d\n", getClassName(), (*it)->getName().c_str(), n); -
branches/proxy/src/lib/network/synchronizeable_var/synchronizeable_bool.h
r7954 r9261 12 12 13 13 public: 14 SynchronizeableBool( bool * ptrIn, bool * ptrOut, std::string name, int permission = PERMISSION_ SERVER, int priority = 0 );14 SynchronizeableBool( bool * ptrIn, bool * ptrOut, std::string name, int permission = PERMISSION_MASTER_SERVER, int priority = 0 ); 15 15 virtual ~SynchronizeableBool(); 16 16 -
branches/proxy/src/lib/network/synchronizeable_var/synchronizeable_float.h
r7954 r9261 12 12 13 13 public: 14 SynchronizeableFloat( float * ptrIn, float * ptrOut, std::string name, int permission = PERMISSION_ SERVER, int priority = 0 );14 SynchronizeableFloat( float * ptrIn, float * ptrOut, std::string name, int permission = PERMISSION_MASTER_SERVER, int priority = 0 ); 15 15 virtual ~SynchronizeableFloat(); 16 16 -
branches/proxy/src/lib/network/synchronizeable_var/synchronizeable_int.h
r7954 r9261 12 12 13 13 public: 14 SynchronizeableInt( int * ptrIn, int * ptrOut, std::string name, int permission = PERMISSION_ SERVER, int priority = 0 );14 SynchronizeableInt( int * ptrIn, int * ptrOut, std::string name, int permission = PERMISSION_MASTER_SERVER, int priority = 0 ); 15 15 virtual ~SynchronizeableInt(); 16 16 -
branches/proxy/src/lib/network/synchronizeable_var/synchronizeable_quaternion.h
r7954 r9261 14 14 15 15 public: 16 SynchronizeableQuaternion( Quaternion * ptrIn, Quaternion * ptrOut, std::string name, int permission = PERMISSION_ SERVER, int priority = 0 );16 SynchronizeableQuaternion( Quaternion * ptrIn, Quaternion * ptrOut, std::string name, int permission = PERMISSION_MASTER_SERVER, int priority = 0 ); 17 17 virtual ~SynchronizeableQuaternion(); 18 18 -
branches/proxy/src/lib/network/synchronizeable_var/synchronizeable_string.h
r7954 r9261 15 15 16 16 public: 17 SynchronizeableString( std::string * ptrIn, std::string * ptrOut, std::string name, int permission = PERMISSION_ SERVER, int priority = 0 );17 SynchronizeableString( std::string * ptrIn, std::string * ptrOut, std::string name, int permission = PERMISSION_MASTER_SERVER, int priority = 0 ); 18 18 virtual ~SynchronizeableString(); 19 19 -
branches/proxy/src/lib/network/synchronizeable_var/synchronizeable_uint.h
r7954 r9261 12 12 13 13 public: 14 SynchronizeableUInt( unsigned int * ptrIn, unsigned int * ptrOut, std::string name, int permission = PERMISSION_ SERVER, int priority = 0 );14 SynchronizeableUInt( unsigned int * ptrIn, unsigned int * ptrOut, std::string name, int permission = PERMISSION_MASTER_SERVER, int priority = 0 ); 15 15 virtual ~SynchronizeableUInt(); 16 16 -
branches/proxy/src/lib/network/synchronizeable_var/synchronizeable_var.h
r7954 r9261 12 12 13 13 enum { 14 PERMISSION_SERVER = 1, 15 PERMISSION_OWNER = 2, 16 PERMISSION_ALL = 4 14 PERMISSION_MASTER_SERVER = 1, 15 PERMISSION_PROXY_SERVER = 2, 16 PERMISSION_OWNER = 4, 17 PERMISSION_ALL = 8 17 18 }; 18 19 … … 20 21 21 22 public: 22 SynchronizeableVar( void * ptrIn, void * ptrOut, std::string name, int length, int permission = PERMISSION_ SERVER, int priority = 0 );23 SynchronizeableVar( void * ptrIn, void * ptrOut, std::string name, int length, int permission = PERMISSION_MASTER_SERVER, int priority = 0 ); 23 24 virtual ~SynchronizeableVar(); 24 25 … … 28 29 */ 29 30 inline bool beWatched(){ return this->bWatched; } 30 31 /** 31 32 /** 32 33 * set flag if synchronizeable wants to be informed on changes 33 34 */ … … 96 97 */ 97 98 inline void resetPriority() { this->priority = this->realPriority; } 98 99 99 100 /** 100 101 * reads actual size from buffer. this is used when size is not constant … … 104 105 */ 105 106 virtual inline int getSizeFromBuf( byte * buf, int maxLength ){ return this->getSize(); } 106 107 107 108 /** 108 109 * set variable id … … 110 111 */ 111 112 inline void setVarId( int id ){ this->varId = id; } 112 113 /** 113 114 /** 114 115 * get variable id 115 116 * @return variable id 116 117 */ 117 118 inline int getVarId(){ return varId; } 118 119 119 120 /** 120 121 * set hasChanged … … 122 123 */ 123 124 inline void setHasChanged( bool changed ){ this->changed = changed; } 124 125 /** 125 126 /** 126 127 * get hasChanged 127 128 * @return variable id 128 129 */ 129 130 inline bool getHasChanged(){ return changed; } 130 131 131 132 /** 132 133 * print out variable value … … 137 138 private: 138 139 bool bWatched; //!< true if synchronizeable wants to be informed on changes 139 140 140 141 int permission; //!< who is allowed to change this var 141 142 int priority; //!< priority assigned to var 142 143 int realPriority; //!< priority assigned to var, increased every time not sent 143 144 int varId; //!< id to identify varables 144 145 145 146 bool changed; //!< true if last readFromBuf changed anything 146 147 -
branches/proxy/src/lib/network/synchronizeable_var/synchronizeable_vector.h
r7954 r9261 14 14 15 15 public: 16 SynchronizeableVector( Vector * ptrIn, Vector * ptrOut, std::string name, int permission = PERMISSION_ SERVER, int priority = 0 );16 SynchronizeableVector( Vector * ptrIn, Vector * ptrOut, std::string name, int permission = PERMISSION_MASTER_SERVER, int priority = 0 ); 17 17 virtual ~SynchronizeableVector(); 18 18
Note: See TracChangeset
for help on using the changeset viewer.