Changeset 6695 in orxonox.OLD for trunk/src/lib/network/synchronizeable.cc
- Timestamp:
- Jan 25, 2006, 2:39:53 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/network/synchronizeable.cc
r6424 r6695 17 17 #define DEBUG_MODULE_NETWORK 18 18 19 #include "shared_network_data.h" 20 #include "network_stream.h" 21 #include "netdefs.h" 22 23 #include "state.h" 24 25 #include "assert.h" 26 19 27 #include "synchronizeable.h" 20 #include "netdefs.h" 21 #include "network_manager.h" 22 #include "network_stream.h" 28 23 29 24 30 … … 29 35 { 30 36 this->setClassID(CL_SYNCHRONIZEABLE, "Synchronizeable"); 31 owner = 0;32 state = 0;33 hostID = NetworkManager::getInstance()->getHostID();37 this->owner = 0; 38 this->state = 0; 39 this->hostID = SharedNetworkData::getInstance()->getHostID(); 34 40 this->setIsServer(this->hostID == 0); 35 uniqueID = -1;41 this->uniqueID = NET_UID_UNASSIGNED; 36 42 this->networkStream = NULL; 37 43 this->setRequestedSync( false ); 38 44 this->setIsOutOfSync( !(this->isServer()) ); 45 this->bSynchronize = false; 46 47 if( State::isOnline()) 48 { 49 NetworkStream* nd = SharedNetworkData::getInstance()->getDefaultSyncStream(); 50 assert(nd != NULL); 51 nd->connectSynchronizeable(*this); 52 this->setUniqueID(SharedNetworkData::getInstance()->getNewUniqueID()); 53 } 39 54 } 40 55 … … 50 65 } 51 66 67 52 68 /** 53 69 * write data to NetworkStream … … 57 73 PRINTF(5)("Synchronizeable::writeBytes was called\n"); 58 74 } 75 59 76 60 77 /** … … 87 104 } 88 105 106 89 107 /** 90 108 * Sets the outofsync flag to a given value … … 100 118 } 101 119 120 102 121 /** 103 122 * Determines if the server flag is set … … 108 127 return (this->state & STATE_SERVER) >0; 109 128 } 129 110 130 111 131 /** … … 118 138 } 119 139 140 120 141 /** 121 142 * Determines if the requestedSync flag is set … … 126 147 return (this->state & STATE_REQUESTEDSYNC) >0; 127 148 } 149 128 150 129 151 /**
Note: See TracChangeset
for help on using the changeset viewer.