Changeset 1278
- Timestamp:
- May 15, 2008, 10:09:02 AM (17 years ago)
- Location:
- code/branches/merge
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/merge/CMakeLists.txt
r1264 r1278 22 22 23 23 OPTION(NETWORK_TESTING_ENABLED "Do you want to build network testing tools: i.e. chatclient chatserver and alike") 24 OPTION(NETWORKTRAFFIC_TESTING_ENABLED "Do you want to build dummyserver4 and dummyclient4") 24 25 25 26 -
code/branches/merge/src/network/CMakeLists.txt
r1264 r1278 55 55 ##### end test for gamestate stuff ##### 56 56 ENDIF(NETWORK_TESTING_ENABLED) 57 # build this if you want dummyserver4 and dummyclient4 58 IF(NETWORKTRAFFIC_TESTING_ENABLED) 59 ##### test network traffic ##### 60 SET( DUMMYSERVER4_SRC_FILES 61 ConnectionManager.cc 62 GameStateManager.cc 63 PacketBuffer.cc 64 PacketDecoder.cc 65 PacketGenerator.cc 66 ClientConnection.cc 67 ClientInformation.cc 68 GameStateClient.cc 69 Server.cc 70 Client.cc 71 Synchronisable.cc 72 dummyserver4.cc 73 ) 74 75 SET( DUMMYCLIENT4_SRC_FILES 76 ConnectionManager.cc 77 GameStateManager.cc 78 PacketBuffer.cc 79 PacketDecoder.cc 80 PacketGenerator.cc 81 ClientConnection.cc 82 ClientInformation.cc 83 GameStateClient.cc 84 Server.cc 85 Client.cc 86 Synchronisable.cc 87 dummyclient4.cc 88 ) 89 90 ADD_EXECUTABLE(dummyserver4 ${DUMMYSERVER4_SRC_FILES}) 91 TARGET_LINK_LIBRARIES( dummyserver4 92 network 93 ${ENet_LIBRARY} 94 ${ZLIB_LIBRARY} 95 ${WINDOWS_ENET_DEPENDENCIES} 96 ${Boost_thread_LIBRARIES} 97 core 98 orxonoxs 99 audio 100 ) 101 102 ADD_EXECUTABLE(dummyclient4 ${DUMMYCLIENT4_SRC_FILES}) 103 TARGET_LINK_LIBRARIES( dummyclient4 104 network 105 ${ENet_LIBRARY} 106 ${ZLIB_LIBRARY} 107 ${WINDOWS_ENET_DEPENDENCIES} 108 ${Boost_thread_LIBRARIES} 109 core 110 orxonoxs 111 audio 112 ) 113 ENDIF(NETWORKTRAFFIC_TESTING_ENABLED) 114 57 115 IF(BLABLA) 58 116 SET( CHATCLIENT_SRC_FILES -
code/branches/merge/src/network/ConnectionManager.cc
r1264 r1278 40 40 #include <iostream> 41 41 // boost.thread library for multithreading support 42 #include <boost/thread/thread.hpp>43 42 #include <boost/bind.hpp> 44 43 … … 63 62 namespace network 64 63 { 65 boost::thread_group network_threads;66 67 ConnectionManager::ConnectionManager() {}68 69 ConnectionManager::ConnectionManager(ClientInformation *head) {64 //boost::thread_group network_threads; 65 66 ConnectionManager::ConnectionManager():receiverThread_(0){} 67 68 ConnectionManager::ConnectionManager(ClientInformation *head) : receiverThread_(0) { 70 69 quit=false; 71 70 bindAddress.host = ENET_HOST_ANY; … … 74 73 } 75 74 76 ConnectionManager::ConnectionManager(int port, std::string address, ClientInformation *head) {75 ConnectionManager::ConnectionManager(int port, std::string address, ClientInformation *head) :receiverThread_(0) { 77 76 quit=false; 78 77 enet_address_set_host (& bindAddress, address.c_str()); … … 81 80 } 82 81 83 ConnectionManager::ConnectionManager(int port, const char *address, ClientInformation *head) {82 ConnectionManager::ConnectionManager(int port, const char *address, ClientInformation *head) : receiverThread_(0) { 84 83 quit=false; 85 84 enet_address_set_host (& bindAddress, address); … … 111 110 112 111 void ConnectionManager::createListener() { 113 network_threads.create_thread(boost::bind(boost::mem_fn(&ConnectionManager::receiverThread), this)); 114 // boost::thread thr(boost::bind(boost::mem_fn(&ConnectionManager::receiverThread), this)); 112 receiverThread_ = new boost::thread(boost::bind(&ConnectionManager::receiverThread, this)); 113 //network_threads.create_thread(boost::bind(boost::mem_fn(&ConnectionManager::receiverThread), this)); 114 //boost::thread thr(boost::bind(boost::mem_fn(&ConnectionManager::receiverThread), this)); 115 115 return; 116 116 } … … 118 118 bool ConnectionManager::quitListener() { 119 119 quit=true; 120 network_threads.join_all(); 120 //network_threads.join_all(); 121 receiverThread_->join(); 121 122 return true; 122 123 } … … 202 203 } 203 204 // usleep(100); 204 //yield(); //TODO: find apropriate205 receiverThread_->yield(); //TODO: find apropriate 205 206 } 206 207 disconnectClients(); -
code/branches/merge/src/network/ConnectionManager.h
r1264 r1278 47 47 // enet library for networking support 48 48 #include <enet/enet.h> 49 #include <boost/thread/thread.hpp> 49 50 50 51 #include "PacketBuffer.h" … … 112 113 ClientInformation *head_; 113 114 114 115 boost::thread *receiverThread_; 115 116 // int getNumberOfClients(); 116 117 //functions to map what object every clients uses -
code/branches/merge/src/orxonox/CMakeLists.txt
r1264 r1278 43 43 ADD_EXECUTABLE( orxonox ${ORXONOX_SRC_FILES} ) 44 44 45 IF(NETWORKTRAFFIC_TESTING_ENABLED) 46 47 SET( ORXONOXS_SRC_FILES 48 GraphicsEngine.cc 49 objects/Ambient.cc 50 objects/Camera.cc 51 objects/CameraHandler.cc 52 objects/Explosion.cc 53 objects/Model.cc 54 objects/NPC.cc 55 objects/Projectile.cc 56 objects/Skybox.cc 57 objects/SpaceShip.cc 58 objects/WorldEntity.cc 59 ) 60 61 ADD_LIBRARY(orxonoxs SHARED ${ORXONOX_SRC_FILES}) 62 ENDIF(NETWORKTRAFFIC_TESTING_ENABLED) 63 45 64 TARGET_LINK_LIBRARIES( orxonox 46 65 ${OGRE_LIBRARIES} -
code/branches/merge/src/orxonox/GraphicsEngine.cc
r1270 r1278 9 9 * modify it under the terms of the GNU General Public License 10 10 * as published by the Free Software Foundation; either version 2 11 * of the License, or (at your option) any later version.12 * 11 * of the License, or (atl your option) any later version. 12 *lo 13 13 * This program is distributed in the hope that it will be useful, 14 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of … … 137 137 #endif 138 138 139 // create a logManager139 /* // create a logManager 140 140 // note: If there's already a logManager, Ogre will complain by a failed assertation. 141 141 // but that shouldn't happen, since this is the first time to create a logManager.. … … 148 148 myLog = logger->createLog("ogre.log", true, false, true); 149 149 else 150 myLog = logger->createLog(this->ogreLogfile_, true, false, false);150 myLog = logger->createLog(this->ogreLogfile_, true, false, false); 151 151 CCOUT(4) << "Ogre Log created" << std::endl; 152 152 153 153 myLog->setLogDetail(Ogre::LL_BOREME); 154 myLog->addListener(this); 154 myLog->addListener(this);*/ 155 155 156 156 // Root will detect that we've already created a Log
Note: See TracChangeset
for help on using the changeset viewer.