Changeset 6658 in orxonox.OLD for branches/network/src/lib/network/synchronizeable.cc
- Timestamp:
- Jan 23, 2006, 2:43:50 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/lib/network/synchronizeable.cc
r6424 r6658 18 18 19 19 #include "synchronizeable.h" 20 20 21 #include "netdefs.h" 21 22 #include "network_manager.h" 23 #include "network_game_manager.h" 22 24 #include "network_stream.h" 25 26 #include "assert.h" 23 27 24 28 … … 29 33 { 30 34 this->setClassID(CL_SYNCHRONIZEABLE, "Synchronizeable"); 31 owner = 0;32 state = 0;33 hostID = NetworkManager::getInstance()->getHostID();35 this->owner = 0; 36 this->state = 0; 37 this->hostID = NetworkManager::getInstance()->getHostID(); 34 38 this->setIsServer(this->hostID == 0); 35 uniqueID = -1;39 this->uniqueID = -1; 36 40 this->networkStream = NULL; 37 41 this->setRequestedSync( false ); 38 42 this->setIsOutOfSync( !(this->isServer()) ); 43 44 this->bSynchronize = false; 45 NetworkStream* nd; 46 if( this->isA(CL_NETWORK_GAME_MANAGER)) 47 { 48 nd = NetworkGameManager::getInstance()->getNetworkStream(); 49 assert(nd != NULL); 50 nd->connectSynchronizeable(*this); 51 } 39 52 } 40 53 … … 50 63 } 51 64 65 52 66 /** 53 67 * write data to NetworkStream … … 57 71 PRINTF(5)("Synchronizeable::writeBytes was called\n"); 58 72 } 73 59 74 60 75 /** … … 87 102 } 88 103 104 89 105 /** 90 106 * Sets the outofsync flag to a given value … … 100 116 } 101 117 118 102 119 /** 103 120 * Determines if the server flag is set … … 108 125 return (this->state & STATE_SERVER) >0; 109 126 } 127 110 128 111 129 /** … … 118 136 } 119 137 138 120 139 /** 121 140 * Determines if the requestedSync flag is set … … 126 145 return (this->state & STATE_REQUESTEDSYNC) >0; 127 146 } 147 128 148 129 149 /**
Note: See TracChangeset
for help on using the changeset viewer.