Way to auto reconnect to TF2 GC? Will it auto reconnect, or is there a method to reconnect? (Assuming it will auto reconnect although I want to make sure)
Some code that isnt 100%, got lazy =P; but you should still understand the concept!
var Steam = require('steam'),
TeamFortress2 = require('tf2'),
SteamUser = require('steam-user');
var client = new SteamUser(),
tf2 = new TeamFortress2(client),
reconnectInterval;
client.gamesPlayed([440]);
tf2.on('connectedToGC', function(){
console.log("Connected to TF2 Game Co-ordinator!");
if(["undefined", null].indexOf(reconnectInterval) !== -1) clearInterval(reconnectInterval);
});
tf2.on('disconnectedFromGC', function(){
console.log("Disconnected from TF2 Game Co-ordinator, retrying in 10 seconds.");
reconnectInterval = setInterval(function(){
tf2.connect();
}, 10000);
});
Way to auto reconnect to TF2 GC? Will it auto reconnect, or is there a method to reconnect? (Assuming it will auto reconnect although I want to make sure)
Some code that isnt 100%, got lazy =P; but you should still understand the concept!