Changeset 8858 for code/trunk/src/libraries/network/WANDiscovery.cc
- Timestamp:
- Aug 23, 2011, 12:45:53 AM (13 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:ignore
-
old new 1 1 build 2 2 codeblocks 3 vs 3 4 dependencies
-
- Property svn:mergeinfo changed
/code/branches/output (added) merged: 8739-8740,8765,8771-8772,8774-8780,8787-8789,8794-8799,8801,8803-8812,8814,8816-8817,8820,8822,8825-8837,8840,8844,8846,8848-8850,8853-8854
- Property svn:ignore
-
code/trunk/src/libraries/network/WANDiscovery.cc
r8351 r8858 21 21 * 22 22 * Author: 23 * Fabian 'x3n' Landau (original)23 * Sandro 'smerkli' Merkli 24 24 * Co-authors: 25 * Sandro 'smerkli' Merkli (adaptions to WAN) 26 * ... 25 * Oliver Scheuss (original) 27 26 * 28 27 */ … … 33 32 #include <cstring> 34 33 35 #include "util/ScopedSingletonManager.h"36 34 #include "core/CoreIncludes.h" 37 35 … … 39 37 namespace orxonox 40 38 { 41 ManageScopedSingleton(WANDiscovery, ScopeID::Graphics, true);42 43 44 39 WANDiscovery::WANDiscovery() 45 40 { 46 41 /* debugging output */ 47 COUT(4) << "Creating WANDiscovery.\n";42 orxout(verbose, context::master_server) << "Creating WANDiscovery." << endl; 48 43 49 44 /* register object in orxonox */ … … 55 50 /* initialize it and see if it worked */ 56 51 if( msc.initialize() ) 57 COUT(2) << "Error: could not initialize master server communications!\n";52 orxout(internal_error, context::master_server) << "Could not initialize master server communications!" << endl; 58 53 59 54 /* connect and see if it worked */ 60 55 if( msc.connect( this->msaddress.c_str(), ORX_MSERVER_PORT ) ) 61 COUT(2) << "Error: could not connect to master server at "62 << this->msaddress << std::endl;56 orxout(internal_error, context::master_server) << "Could not connect to master server at " 57 << this->msaddress << endl; 63 58 64 59 /* debugging output */ 65 COUT(4) << "Initialization of WANDiscovery complete.\n";60 orxout(verbose, context::master_server) << "Initialization of WANDiscovery complete." << endl; 66 61 } 67 62 … … 81 76 82 77 /* callback for the network reply poller */ 83 int rhandler( char *addr, ENetEvent *ev )78 int WANDiscovery::rhandler( char *addr, ENetEvent *ev ) 84 79 { 85 80 /* error recognition */ 86 81 if( !ev || !ev->packet || !ev->packet->data ) 87 { COUT(2) << "Bad arguments received in WANDiscovery's reply handler.\n";82 { orxout(internal_warning, context::master_server) << "Bad arguments received in WANDiscovery's reply handler." << endl; 88 83 return 0; 89 84 } … … 104 99 105 100 /* add to list */ 106 WANDiscovery::getInstance().servers_.push_back( toadd );101 this->servers_.push_back( toadd ); 107 102 } 108 103 else if( !strncmp( (char*)ev->packet->data, MSPROTO_SERVERLIST_END, … … 133 128 { 134 129 /* poll for reply and act according to what was received */ 135 switch( this->msc.pollForReply( rhandler, 500 ) )130 switch( this->msc.pollForReply( this, 500 ) ) 136 131 { case 0: /* no event occured, decrease timeout */ 137 132 --i; break;
Note: See TracChangeset
for help on using the changeset viewer.