Changeset 2112 for code/branches/objecthierarchy/src/network/packet
- Timestamp:
- Nov 2, 2008, 12:54:17 PM (16 years ago)
- Location:
- code/branches/objecthierarchy/src/network/packet
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy/src/network/packet/Acknowledgement.cc
r1907 r2112 33 33 #include "core/CoreIncludes.h" 34 34 35 namespace network{35 namespace orxonox { 36 36 namespace packet { 37 37 38 38 #define PACKET_FLAGS_ACK 0 39 39 #define _PACKETID 0 40 #define _ACKID _PACKETID + sizeof( network::packet::ENUM::Type)40 #define _ACKID _PACKETID + sizeof(packet::ENUM::Type) 41 41 42 42 Acknowledgement::Acknowledgement( unsigned int id, unsigned int clientID ) … … 74 74 75 75 } //namespace packet 76 } //namespace network76 } //namespace orxonox -
code/branches/objecthierarchy/src/network/packet/Acknowledgement.h
r1916 r2112 33 33 34 34 35 namespace network{35 namespace orxonox { 36 36 namespace packet { 37 37 /** … … 53 53 54 54 } //namespace packet 55 } //namespace network55 } //namespace orxonox 56 56 57 57 #endif -
code/branches/objecthierarchy/src/network/packet/Chat.cc
r1907 r2112 31 31 #include "network/Host.h" 32 32 33 namespace network{33 namespace orxonox { 34 34 namespace packet { 35 35 … … 77 77 78 78 } //namespace packet 79 } //namespace network79 } //namespace orxonox -
code/branches/objecthierarchy/src/network/packet/Chat.h
r1916 r2112 10 10 #include "Packet.h" 11 11 12 namespace network{12 namespace orxonox { 13 13 namespace packet { 14 14 /** … … 33 33 34 34 } //namespace packet 35 } //namespace network35 } //namespace orxonox 36 36 37 37 #endif -
code/branches/objecthierarchy/src/network/packet/ClassID.cc
r1907 r2112 34 34 #include <assert.h> 35 35 36 namespace network{36 namespace orxonox { 37 37 namespace packet { 38 38 … … 68 68 69 69 unsigned int ClassID::getSize() const{ 70 return sizeof( network::packet::ENUM::Type) + 2*sizeof(uint32_t) + classNameLength_;70 return sizeof(packet::ENUM::Type) + 2*sizeof(uint32_t) + classNameLength_; 71 71 } 72 72 73 73 bool ClassID::process(){ 74 74 COUT(3) << "processing classid: " << getClassID() << " name: " << (const char*)(data_+_CLASSNAME) << std::endl; 75 orxonox::Identifier *id=ClassByID( std::string((const char*)(data_+_CLASSNAME) ));75 Identifier *id=ClassByID( std::string((const char*)(data_+_CLASSNAME) )); 76 76 if(id==NULL) 77 77 return false; … … 86 86 87 87 } //namespace packet 88 }//namespace network88 }//namespace orxonox -
code/branches/objecthierarchy/src/network/packet/ClassID.h
r1916 r2112 35 35 #include "Packet.h" 36 36 37 namespace network{37 namespace orxonox { 38 38 namespace packet { 39 39 … … 59 59 60 60 } //namespace packet 61 } //namespace network61 } //namespace orxonox 62 62 63 63 #endif -
code/branches/objecthierarchy/src/network/packet/DeleteObjects.cc
r1907 r2112 34 34 #include <assert.h> 35 35 36 namespace network{36 namespace orxonox { 37 37 namespace packet { 38 38 … … 95 95 96 96 } //namespace packet 97 } //namespace network97 } //namespace orxonox -
code/branches/objecthierarchy/src/network/packet/DeleteObjects.h
r1916 r2112 34 34 35 35 36 namespace network{36 namespace orxonox { 37 37 namespace packet { 38 38 /** … … 55 55 56 56 } //namespace packet 57 } //namespace network57 } //namespace orxonox 58 58 59 59 #endif -
code/branches/objecthierarchy/src/network/packet/Gamestate.cc
r2111 r2112 38 38 39 39 40 namespace network{40 namespace orxonox { 41 41 42 42 namespace packet { … … 93 93 uint8_t *mem=data_; 94 94 mem+=sizeof(GamestateHeader); 95 orxonox::ObjectList<Synchronisable>::iterator it;96 for(it = orxonox::ObjectList<Synchronisable>::begin(); it; ++it){95 ObjectList<Synchronisable>::iterator it; 96 for(it = ObjectList<Synchronisable>::begin(); it; ++it){ 97 97 tempsize=it->getSize(id, mode); 98 98 … … 100 100 // start allocate additional memory 101 101 COUT(3) << "G.St.Man: need additional memory" << std::endl; 102 orxonox::ObjectList<Synchronisable>::iterator temp = it;102 ObjectList<Synchronisable>::iterator temp = it; 103 103 int addsize=tempsize; 104 104 while(++temp) … … 147 147 uint8_t *mem=data_+sizeof(GamestateHeader); 148 148 // get the start of the Synchronisable list 149 // orxonox::ObjectList<Synchronisable>::iterator it=orxonox::ObjectList<Synchronisable>::begin();149 //ObjectList<Synchronisable>::iterator it=ObjectList<Synchronisable>::begin(); 150 150 Synchronisable *s; 151 151 … … 244 244 //copy and modify header 245 245 #ifndef NDEBUG 246 HEADER->crc32 = orxonox::calcCRC(data_+sizeof(GamestateHeader), HEADER->datasize);246 HEADER->crc32 = calcCRC(data_+sizeof(GamestateHeader), HEADER->datasize); 247 247 #endif 248 248 *GAMESTATE_HEADER(ndata) = *HEADER; … … 281 281 } 282 282 #ifndef NDEBUG 283 assert(HEADER->crc32== orxonox::calcCRC(ndata+sizeof(GamestateHeader), HEADER->datasize));283 assert(HEADER->crc32==calcCRC(ndata+sizeof(GamestateHeader), HEADER->datasize)); 284 284 #endif 285 285 … … 569 569 int size=0; 570 570 // get the start of the Synchronisable list 571 orxonox::ObjectList<Synchronisable>::iterator it;571 ObjectList<Synchronisable>::iterator it; 572 572 // get total size of gamestate 573 for(it = orxonox::ObjectList<Synchronisable>::begin(); it; ++it)573 for(it = ObjectList<Synchronisable>::begin(); it; ++it) 574 574 size+=it->getSize(id, mode); // size of the actual data of the synchronisable 575 575 // size+=sizeof(GamestateHeader); … … 582 582 * @return iterator pointing to the next object in the list 583 583 */ 584 void Gamestate::removeObject( orxonox::ObjectList<Synchronisable>::iterator &it) {585 orxonox::ObjectList<Synchronisable>::iterator temp=it;584 void Gamestate::removeObject(ObjectList<Synchronisable>::iterator &it) { 585 ObjectList<Synchronisable>::iterator temp=it; 586 586 ++it; 587 587 delete *temp; -
code/branches/objecthierarchy/src/network/packet/Gamestate.h
r1916 r2112 40 40 #endif 41 41 42 namespace network{42 namespace orxonox { 43 43 44 44 namespace packet { … … 91 91 private: 92 92 unsigned int calcGamestateSize(unsigned int id, int mode=0x0); 93 void removeObject( orxonox::ObjectListIterator<Synchronisable> &it);93 void removeObject(ObjectListIterator<Synchronisable> &it); 94 94 std::map<unsigned int, Synchronisable*> dataMap_; 95 95 }; -
code/branches/objecthierarchy/src/network/packet/Packet.cc
r2084 r2112 46 46 #include "core/CoreIncludes.h" 47 47 48 namespace network{48 namespace orxonox{ 49 49 50 50 namespace packet{ … … 153 153 // ENetPacket *temp = enetPacket_; 154 154 // enetPacket_ = 0; // otherwise we have a double free because enet already handles the deallocation of the packet 155 network::Host::addPacket( enetPacket_, clientID_);155 Host::addPacket( enetPacket_, clientID_); 156 156 return true; 157 157 } … … 219 219 } // namespace packet 220 220 221 } // namespace network222 221 } // namespace orxonox 222 -
code/branches/objecthierarchy/src/network/packet/Packet.h
r2070 r2112 36 36 #include "util/Integers.h" 37 37 38 namespace network{38 namespace orxonox { 39 39 40 40 namespace packet{ … … 98 98 } //namespace packet 99 99 100 } //namespace network100 } //namespace orxonox 101 101 102 102 #endif -
code/branches/objecthierarchy/src/network/packet/Welcome.cc
r1907 r2112 36 36 #include <assert.h> 37 37 38 namespace network{38 namespace orxonox { 39 39 namespace packet { 40 40 … … 70 70 71 71 unsigned int Welcome::getSize() const{ 72 return sizeof( network::packet::ENUM::Type) + 2*sizeof(uint32_t);72 return sizeof(packet::ENUM::Type) + 2*sizeof(uint32_t); 73 73 } 74 74 … … 87 87 88 88 } //namespace packet 89 }//namespace network89 }//namespace orxonox -
code/branches/objecthierarchy/src/network/packet/Welcome.h
r1916 r2112 33 33 #include "Packet.h" 34 34 35 namespace network{35 namespace orxonox { 36 36 namespace packet { 37 37 … … 54 54 55 55 } //namespace packet 56 } //namespace network56 } //namespace orxonox 57 57 58 58 #endif
Note: See TracChangeset
for help on using the changeset viewer.