Guest User

Untitled

a guest
Sep 13th, 2014
594
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function(module) {
  2. "use strict";
  3.  
  4.  
  5. var async = require('async');
  6. var Gamedig = require('gamedig');
  7.  
  8. var servers = [{
  9.     host: '91.121.7.73',
  10.     port: 28960,
  11.     gametype: 'codmw2'
  12. },{
  13.     host: '91.121.7.73',
  14.     port: 28961,
  15.     gametype: 'codmw2'
  16. }];
  17.  
  18. async.each(servers, function(server, callback) {
  19.     Gamedig.query({
  20.         type: server.gametype,
  21.         host: server.host,
  22.         port: server.port
  23.     }, function(state) {
  24.         if (state.error) {
  25.             return callback(state.error);
  26.         }
  27.         callback(state);
  28.     })
  29. }, function(errors, servers) {
  30.  if(errors)
  31.         console.log(errors);
  32.         console.log(servers);
  33. });
  34.  
  35. module.exports = Plugin;
  36. }(module));
RAW Paste Data