Slight change to use receiver's IP address instead of manufactured packet info

This commit is contained in:
Mark Vejvoda
2010-04-03 02:21:04 +00:00
parent 02d0781b40
commit c8019116c5
2 changed files with 42 additions and 23 deletions

View File

@@ -976,13 +976,19 @@ void BroadCastClientSocketThread::execute() {
//exit(-1);
}
else {
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"broadcast message received: [%s] from: [%s]\n", buff,inet_ntoa(bcSender.sin_addr) );
string fromIP = inet_ntoa(bcSender.sin_addr);
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"broadcast message received: [%s] from: [%s]\n", buff,fromIP.c_str() );
vector<string> tokens;
Tokenize(buff,tokens,":");
for(int idx = 1; idx < tokens.size(); idx++) {
foundServers.push_back(tokens[idx]);
//vector<string> tokens;
//Tokenize(buff,tokens,":");
//for(int idx = 1; idx < tokens.size(); idx++) {
// foundServers.push_back(tokens[idx]);
//}
if(std::find(foundServers.begin(),foundServers.end(),fromIP) == foundServers.end()) {
foundServers.push_back(fromIP);
}
// For now break as soon as we find a server
break;
}