Changeset 2773 for code/trunk/src/network/packet
- Timestamp:
- Mar 11, 2009, 4:06:31 PM (16 years ago)
- Location:
- code/trunk/src/network/packet
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/network/packet/Chat.cc
r2171 r2773 28 28 29 29 #include "Chat.h" 30 #include <assert.h> 30 31 #include <enet/enet.h> 32 #include <cassert> 31 33 #include "network/Host.h" 32 34 -
code/trunk/src/network/packet/ClassID.cc
r2759 r2773 30 30 31 31 #include "ClassID.h" 32 #include <enet/enet.h> 32 33 #include "core/CoreIncludes.h" 33 34 #include "core/Factory.h" 34 35 #include <cstring> 35 36 #include <string> 36 #include < assert.h>37 #include <cassert> 37 38 #include <map> 38 39 #include <queue> -
code/trunk/src/network/packet/DeleteObjects.cc
r2756 r2773 29 29 30 30 #include "DeleteObjects.h" 31 #ifndef WIN32_LEAN_AND_MEAN32 # define WIN32_LEAN_AND_MEAN33 #endif34 #define NOMINMAX // required to stop windows.h screwing up std::min definition35 31 #include <enet/enet.h> 36 32 #include "network/synchronisable/Synchronisable.h" 37 33 #include "core/CoreIncludes.h" 38 #include < assert.h>34 #include <cassert> 39 35 40 36 namespace orxonox { -
code/trunk/src/network/packet/Gamestate.cc
r2759 r2773 28 28 29 29 #include "Gamestate.h" 30 #include <enet/enet.h> 31 #include <zlib.h> 32 #include <cassert> 30 33 #include "../GamestateHandler.h" 31 34 #include "../synchronisable/Synchronisable.h" … … 35 38 #include "core/Iterator.h" 36 39 37 #include <zlib.h>38 #include <cassert>39 40 40 41 -
code/trunk/src/network/packet/Packet.cc
r2756 r2773 31 31 32 32 #include <cassert> 33 #ifndef WIN32_LEAN_AND_MEAN34 # define WIN32_LEAN_AND_MEAN35 #endif36 #define NOMINMAX // required to stop windows.h screwing up std::min definition37 33 #include <enet/enet.h> 38 34 #include <boost/bind.hpp> 35 #include <boost/thread/recursive_mutex.hpp> 39 36 40 37 #include "network/ConnectionManager.h" … … 58 55 59 56 std::map<size_t, Packet *> Packet::packetMap_; 60 boost::recursive_mutex Packet::packetMap_mutex; 57 //! Static mutex for any packetMap_ access 58 static boost::recursive_mutex packetMap_mutex_g; 61 59 62 60 Packet::Packet(){ … … 142 140 // Assures we don't create a packet and destroy it right after in another thread 143 141 // without having a reference in the packetMap_ 144 boost::recursive_mutex::scoped_lock lock( Packet::packetMap_mutex);142 boost::recursive_mutex::scoped_lock lock(packetMap_mutex_g); 145 143 packetMap_[(size_t)(void*)enetPacket_] = this; 146 144 } … … 217 215 */ 218 216 void Packet::deletePacket(ENetPacket *enetPacket){ 219 boost::recursive_mutex::scoped_lock lock( Packet::packetMap_mutex);217 boost::recursive_mutex::scoped_lock lock(packetMap_mutex_g); 220 218 // Get our Packet from a gloabal map with all Packets created in the send() method of Packet. 221 219 std::map<size_t, Packet*>::iterator it = packetMap_.find((size_t)enetPacket); -
code/trunk/src/network/packet/Packet.h
r2756 r2773 32 32 33 33 #include <map> 34 #ifndef WIN32_LEAN_AND_MEAN35 # define WIN32_LEAN_AND_MEAN36 #endif37 #define NOMINMAX // required to stop windows.h screwing up std::min definition38 #include <enet/enet.h>39 #include <boost/thread/recursive_mutex.hpp>40 34 41 35 namespace orxonox { … … 72 66 virtual unsigned int getSize() const =0; 73 67 virtual bool process()=0; 74 enet_uint32getFlags()68 uint32_t getFlags() 75 69 { return flags_; } 76 70 int getClientID() … … 84 78 Packet(uint8_t *data, unsigned int clientID); 85 79 // Packet(ENetPacket *packet, ENetPeer *peer); 86 enet_uint32flags_;80 uint32_t flags_; 87 81 unsigned int clientID_; 88 82 ENUM::Direction packetDirection_; … … 96 90 private: 97 91 static std::map<size_t, Packet *> packetMap_; 98 //! Static mutex for any packetMap_ access99 static boost::recursive_mutex packetMap_mutex;100 92 ENetPacket *enetPacket_; 101 93 }; -
code/trunk/src/network/packet/Welcome.cc
r2662 r2773 31 31 32 32 #include "Welcome.h" 33 #include <enet/enet.h> 34 #include <cassert> 33 35 #include "network/Host.h" 34 36 #include "network/synchronisable/Synchronisable.h" 35 37 #include "core/CoreIncludes.h" 36 #include <assert.h>37 38 38 39 namespace orxonox {
Note: See TracChangeset
for help on using the changeset viewer.