Changeset 7801 for code/trunk/src/libraries/network/packet/Packet.h
- Timestamp:
- Dec 22, 2010, 7:24:24 PM (13 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/libraries/network/packet/Packet.h
r7490 r7801 68 68 virtual unsigned char *getData(){ return data_; }; 69 69 virtual unsigned int getSize() const =0; 70 virtual bool process( )=0;70 virtual bool process(orxonox::Host* host)=0; 71 71 inline uint32_t getFlags() 72 72 { return flags_; } 73 inline int getClientID() 74 { return clientID_; } 75 inline void setClientID( int id ) 76 { clientID_ = id; } 73 inline int getPeerID() 74 { return peerID_; } 75 inline void setPeerID( int id ) 76 { peerID_ = id; } 77 inline bool isReliable() 78 { return this->flags_ & PacketFlag::Reliable; } 79 inline uint32_t getRequiredGamestateID() 80 { return this->requiredGamestateID_; } 77 81 78 virtual bool send( );82 virtual bool send(orxonox::Host* host); 79 83 protected: 80 84 Packet(); 81 Packet(uint8_t *data, unsigned int clientID);85 Packet(uint8_t *data, unsigned int peerID); 82 86 // Packet(ENetPacket *packet, ENetPeer *peer); 83 87 inline bool isDataENetAllocated() const … … 85 89 86 90 uint32_t flags_; 87 unsigned int clientID_; 91 unsigned int peerID_; 92 uint32_t requiredGamestateID_; 88 93 Direction::Value packetDirection_; 89 94 /** Pointer to the data. Be careful when deleting it because it might … … 96 101 private: 97 102 static std::map<size_t, Packet *> packetMap_; 103 static boost::mutex packetMapMutex_; 98 104 ENetPacket *enetPacket_; 99 105 };
Note: See TracChangeset
for help on using the changeset viewer.