mirror of
https://github.com/tribufu/node-gamedig
synced 2026-06-01 09:42:41 +00:00
bunches of updates:
find bots in source engine add altaddress pass address to query object output
This commit is contained in:
parent
f543b301dd
commit
0d1577fa35
3 changed files with 27 additions and 2 deletions
10
index.js
10
index.js
|
|
@ -9,16 +9,20 @@ var udpSocket = dgram.createSocket('udp4');
|
|||
udpSocket.unref();
|
||||
udpSocket.bind(21943);
|
||||
udpSocket.on('message', function(buffer, rinfo) {
|
||||
if(Gamedig.debug) console.log("Received",buffer,rinfo.address,rinfo.port);
|
||||
for(var i = 0; i < activeQueries.length; i++) {
|
||||
var query = activeQueries[i];
|
||||
if(query.options.address != rinfo.address) continue;
|
||||
if(
|
||||
query.options.address != rinfo.address
|
||||
&& query.options.altaddress != rinfo.address
|
||||
) continue;
|
||||
if(query.options.port != rinfo.port) continue;
|
||||
query._udpResponse(buffer);
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = {
|
||||
Gamedig = {
|
||||
|
||||
query: function(options,callback) {
|
||||
if(callback) options.callback = callback;
|
||||
|
|
@ -48,3 +52,5 @@ module.exports = {
|
|||
}
|
||||
|
||||
};
|
||||
|
||||
module.exports = Gamedig;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue