updates for logging

This commit is contained in:
BrainFooLong committed 2017-01-05 17:29:50 +01:00
1 parent 8fbca5ba2f
commit 31245957d8
2 files changed
+4 -2

No files matched your search

+2 -2
View File
@@ -72,7 +72,7 @@ Socket.connect = function (callback) {
* @param error
*/
con.onerror = function (error) {
console.error(new Date(), 'WebSocket Error ' + error);
console.error('WebSocket Error ' + error);
};
/**
@@ -86,7 +86,7 @@ Socket.connect = function (callback) {
if (typeof data.callbackId != "undefined") {
var callbackId = data.callbackId;
if (Socket.callbacks[callbackId] === null) {
console.error(new Date(), "No socket callback for id " + callbackId + ", maybe dupe callback in backend?");
console.error("No socket callback for id " + callbackId + ", maybe dupe callback in backend?");
} else {
Socket.callbacks[callbackId](data.messageData);
Socket.callbacks[callbackId] = null;
+2
View File
@@ -125,6 +125,7 @@ function RconServer(id, serverData) {
this.con.connect(function (err) {
var serverName = serverData.host + ":" + serverData.rcon_port;
if (err) {
self.removeInstance();
console.error(new Date(), "RconServer [" + serverName + "]: Connection failed");
return;
}
@@ -133,6 +134,7 @@ function RconServer(id, serverData) {
self.con.send(self.serverData.rcon_password, null, true, function (success) {
self.injectServerMessage("Rcon authentication " + (success ? "successfull" : "invalid"));
if (!success) {
self.removeInstance();
console.error(new Date(), "Invalid rcon password for server " + self.serverData.name + ":" + self.serverData.rcon_port);
return;
}