Changeset 7634 for code/branches/masterserver/src/libraries
- Timestamp:
- Nov 10, 2010, 4:22:58 PM (14 years ago)
- Location:
- code/branches/masterserver/src/libraries/network
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/masterserver/src/libraries/network/Server.cc
r7633 r7634 101 101 102 102 /* TODO */ 103 void helper_ConnectToMasterserver() 104 { 105 /* TODO connect to master server here and say you're there */ 103 void Server::helper_ConnectToMasterserver() 104 { 105 /* initialize it and see if it worked */ 106 if( msc.initialize() ) 107 COUT(1) << "Error: could not initialize master server communications!\n"; 108 109 /* connect and see if it worked */ 110 if( msc.connect( MS_ADDRESS, 1234 ) ) 111 COUT(1) << "Error: could not connect to master server!\n"; 112 113 /* TODO */ 114 /* now send the master server some note we're here */ 106 115 } 107 116 … … 154 163 155 164 165 /* TODO */ 166 int replyhandler( char *addr, ENetEvent *ev ) 167 { 168 /* handle incoming data */ 169 170 /* done handling, return all ok code 0 */ 171 return 0; 172 } 173 174 void Server::helper_HandleMasterServerRequests() 175 { 176 this->msc.pollForReply( replyhandler ); 177 } 178 156 179 /** 157 180 * Run this function once every tick … … 167 190 LANDiscoverable::update(); 168 191 169 // TODO receive and process requests from master server 192 // receive and process requests from master server 193 helper_HandleMasterServerRequests(); 170 194 171 195 if ( ClientInformation::hasClients() ) -
code/branches/masterserver/src/libraries/network/Server.h
r7163 r7634 38 38 #include "ServerConnection.h" 39 39 #include "LANDiscoverable.h" 40 #include "MasterServerComm.h" 41 42 /* proto (move to central point soon) */ 43 #define MS_ADDRESS "localhost" 40 44 41 45 namespace orxonox … … 53 57 ~Server(); 54 58 59 void helper_ConnectToMasterserver(); 55 60 void open(); 56 61 void close(); … … 82 87 83 88 float timeSinceLastUpdate_; 89 MasterServerComm msc; 84 90 }; 85 91
Note: See TracChangeset
for help on using the changeset viewer.