Changeset 6060 in orxonox.OLD for branches/network/src/lib
- Timestamp:
- Dec 12, 2005, 1:42:57 PM (19 years ago)
- Location:
- branches/network/src/lib/network
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/lib/network/network_protocol.cc
r6043 r6060 115 115 h.version = data[1]; 116 116 /* unique ID */ 117 h. uniqueID = data[2];117 h.synchronizeableID = data[2]; 118 118 /* data length*/ 119 119 h.length = data[3]; -
branches/network/src/lib/network/network_protocol.h
r6043 r6060 17 17 byte protocol; 18 18 byte version; 19 byte uniqueID;19 byte synchronizeableID; 20 20 byte length; 21 21 }; -
branches/network/src/lib/network/network_stream.cc
r6059 r6060 127 127 } 128 128 129 void NetworkStream::disconnectSynchronizeable(Synchronizeable& sync) 130 { 131 this->synchronizeables.remove(&sync); 132 133 if( this->networkSockets.size()<=0 ) 134 this->bActive = false; 135 } 136 129 137 130 138 void NetworkStream::processData() … … 241 249 for (SynchronizeableList::iterator it = synchronizeables.begin(); it!=synchronizeables.end(); it++) 242 250 { 243 if ( *it && (*it)->getUniqueID()==header. uniqueID )251 if ( *it && (*it)->getUniqueID()==header.synchronizeableID ) 244 252 (*it)->writeBytes(upBuffer+sizeof(header), dataLength); 245 253 } -
branches/network/src/lib/network/network_stream.h
r6043 r6060 38 38 39 39 void connectSynchronizeable(Synchronizeable& sync); 40 void disconnectSynchronizeable(Synchronizeable& sync); 40 41 41 42 inline bool isServer() const { return (this->type == NET_SERVER)? true:false; } -
branches/network/src/lib/network/synchronizeable.cc
r6053 r6060 20 20 #include "netdefs.h" 21 21 #include "network_manager.h" 22 #include "network_stream.h" 22 23 23 24 … … 28 29 { 29 30 30 //owner = ?;31 owner = 0; 31 32 hostID = NetworkManager::getInstance()->getHostID(); 32 33 //state = ?; … … 47 48 */ 48 49 Synchronizeable::~Synchronizeable() 49 {} 50 { 51 if ( this->networkStream ) 52 this->networkStream->disconnectSynchronizeable(*this); 53 } 50 54 51 55 /** -
branches/network/src/lib/network/synchronizeable.h
r6053 r6060 18 18 #define STATE_SERVER 1 19 19 #define STATE_OUTOFSYNC 2 20 21 class NetworkStream; 20 22 21 23 … … 43 45 inline int getOwner(){ return owner; } 44 46 inline void setOwner(int owner){ this->owner = owner; } 47 48 inline void setNetworkStream(NetworkStream* stream) { this->networkStream = stream; } 45 49 46 50 private: … … 55 59 int state; 56 60 std::list<int> synchronizeRequests; 61 62 NetworkStream* networkStream; 57 63 58 64 };
Note: See TracChangeset
for help on using the changeset viewer.