Changeset 346 for code/branches/FICN/src/network
- Timestamp:
- Nov 29, 2007, 4:21:30 PM (17 years ago)
- Location:
- code/branches/FICN
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN
-
Property
svn:ignore
set to
FICN.sln
FICN.ncb
FICN.vcproj
FICN.vcproj.RGRIEDERT60.rgrieder.user
FICN.suo
obj
-
Property
svn:ignore
set to
-
code/branches/FICN/src/network/ClientConnection.cc
r337 r346 12 12 #include "ClientConnection.h" 13 13 14 // workaround for usleep(int) under windows 15 #ifdef WIN32 16 #include "winbase.h" 17 #endif 18 14 19 namespace network{ 15 20 16 boost::thread_group network_threads;21 static boost::thread_group network_threads; 17 22 18 23 ClientConnection::ClientConnection(int port, std::string address){ … … 34 39 bool ClientConnection::waitEstablished(int milisec){ 35 40 for(int i=0; i<=milisec && !established; i++) 41 // under windows, use Sleep(milliseconds) instead of usleep(microseconds) 42 #ifdef WIN32 43 Sleep(1); 44 #else 36 45 usleep(1000); 46 #endif 37 47 return established; 38 48 } -
code/branches/FICN/src/network/GameStateManager.cc
r337 r346 106 106 } 107 107 108 108 return true; 109 109 } 110 110 … … 115 115 */ 116 116 // orxonox::Iterator<Synchronisable> removeObject(orxonox::Iterator<Synchronisable> it){ 117 void removeObject(orxonox::Iterator<Synchronisable> &it){117 void GameStateManager::removeObject(orxonox::Iterator<Synchronisable> &it){ 118 118 orxonox::Iterator<Synchronisable> temp=it; 119 119 ++it; -
code/branches/FICN/src/network/GameStateManager.h
r337 r346 44 44 bool loadSnapshot(GameState state); 45 45 private: 46 bool removeObject(orxonox::Iterator<Synchronisable>it);46 void removeObject(orxonox::Iterator<Synchronisable> &it); 47 47 48 48 }; -
code/branches/FICN/src/network/PacketBufferTest.cc
r337 r346 14 14 p.data=i*i; 15 15 std::cout << i << ": pushing " << p.data << std::endl; 16 test.push( p);16 test.push((ENetEvent*)&p); 17 17 } 18 18 std::cout << std::endl << "queue.print()" << std::endl; 19 19 test.print(); 20 20 while(!test.isEmpty()){ 21 int i =test.pop().data;21 int i = (int)test.pop()->data; 22 22 std::cout << "We popped the value " << i << std::endl; 23 23 } -
code/branches/FICN/src/network/PacketBufferTestExt.cc
r337 r346 7 7 8 8 using namespace network; 9 10 // workaround for usleep(int) under windows 11 #ifdef WIN32 12 #include "winbase.h" 13 #endif 9 14 10 15 … … 18 23 ENET_PACKET_FLAG_RELIABLE); 19 24 std::cout << i << ": pushing " << packet->data << std::endl; 20 test->push( packet);25 test->push((ENetEvent*)packet); 21 26 if(i==5) 27 // under windows, use Sleep(milliseconds) instead of usleep(microseconds) 28 #ifdef WIN32 29 Sleep(200); 30 #else 22 31 usleep(200000); 32 #endif 23 33 } 24 34 test->setClosed(true); -
code/branches/FICN/src/network/Synchronisable.cc
r337 r346 21 21 { 22 22 datasize=0; 23 registerAllVariables();23 //registerAllVariables(); 24 24 } 25 25 -
code/branches/FICN/src/network/Synchronisable.h
r337 r346 52 52 int getSize(); 53 53 bool updateData(syncData vars); 54 virtual void registerAllVariables() ;54 virtual void registerAllVariables() = 0; 55 55 56 56 private: -
code/branches/FICN/src/network/dummyclient.cc
r337 r346 8 8 #include <enet/enet.h> 9 9 #include "PacketManager.h" 10 11 // workaround for usleep(int) under windows 12 #ifdef WIN32 13 #include "winbase.h" 14 #endif 15 10 16 11 17 using namespace std; … … 67 73 cout << "failed sending" << endl; 68 74 } 75 // under windows, use Sleep(milliseconds) instead of usleep(microseconds) 76 #ifdef WIN32 77 Sleep(1000); 78 #else 69 79 usleep(1000000); 80 #endif 70 81 } 71 82 -
code/branches/FICN/src/network/dummyserver.cc
r341 r346 9 9 #include "ConnectionManager.h" 10 10 #include "PacketManager.h" 11 12 // workaround for usleep(int) under windows 13 #ifdef WIN32 14 #include "winbase.h" 15 #endif 16 11 17 12 18 using namespace network; … … 23 29 while(!quit){ 24 30 if(server.queueEmpty()) 31 // under windows, use Sleep(milliseconds) instead of usleep(microseconds) 32 // Warning: Sleep(1) is ten times longer than usleep(100)! 33 #ifdef WIN32 34 Sleep(1); 35 #else 25 36 usleep(100); 37 #endif 26 38 else{ 27 39 ENetAddress addr;
Note: See TracChangeset
for help on using the changeset viewer.