-
Notifications
You must be signed in to change notification settings - Fork 2
/
server.js
38 lines (33 loc) · 1.18 KB
/
server.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
var keys = require('./keys');
var util = require('./apputils');
var al = require('./adminlistener');
var moment = require('moment');
var start = function() {
util.log("-------");
util.log("Starting up...");
util.log("Rcon Host: " + keys.rconHost + ":" + keys.rconPort);
util.log("Rcon Pass: " + keys.rconPass);
util.log("Interval: " + util.getInterval()/1000/60 + " Minutes");
util.debug("Twitter consumer key: " + keys.twitter["consumer_key"]);
util.debug("Twitter consumer secret: " + keys.twitter["consumer_secret"]);
util.debug("Twitter token key: " + keys.twitter["access_token_key"]);
util.debug("Twitter token secret: " + keys.twitter["access_token_secret"]);
util.log("Authenticating with twitter...");
util.verifyCredentials(function (err, data) {
if (err) {
util.log("Could not authenticate with twitter!", "fatal");
util.log(err, "fatal");
util.log("Shutting down!", "fatal");
process.exit(1);
} else {
util.log("Authenticated with username: @" + data["screen_name"]);
al.start();
util.startTwitter();
util.startPing();
}
});
}
exports.getStatus = function () {
return al.getStatus();
};
start();