Advertisement
Guest User

Untitled

a guest
Feb 25th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var rpc = gbxremote.createClient(5000, '127.0.0.1');
  2. rpc.on('connect', function() {
  3.     Async.parallel([
  4.         function(callback) {
  5.             rpc.query('GetServerOptions').then(function (res) {
  6.                 callback(null, res["CurrentMaxPlayers"], res["CurrentMaxSpectators"]);
  7.             });
  8.         },
  9.         function(maxPlayers, maxSpectators, callback) {
  10.             rpc.query('GetCurrentMapInfo').then(function (res) {
  11.                 callback(null, maxPlayers, maxSpectators, res["Name"]);
  12.             });
  13.         },
  14.         function(maxPlayers, maxSpectators, currentMap, callback) {
  15.             rpc.query('GetNextMapInfo').then(function (res) {
  16.                 callback(null, maxPlayers, maxSpectators, currentMap, nextMap);
  17.             });
  18.         },
  19.         function(callback) {
  20.             rpc.query('GetCurrentGameInfo').then(function (res) {
  21.                 callback(null, maxPlayers, maxSpectators, currentMap, nextMap, res["NbChallenge"]);
  22.             });
  23.         }
  24.     ], (maxPlayers, maxSpectators, currentMap, nextMap, NbChallenge) => {
  25.         // mach deinen schice hier :)
  26.     });
  27. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement