Skip to content

Commit

Permalink
Fixed issue related to a GMod breaking change (util.TableToJSON)
Browse files Browse the repository at this point in the history
  • Loading branch information
_FR_Starfox64 committed Jan 29, 2016
1 parent 6acded7 commit 127cfa6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions foxedbot.js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,10 @@ app.server.on("connection", function (sock) {
}

if (isNaN(sock.serverID)) { // Checks if the socket is authenticated
if (data[1] === "AUTH") {
if (data[2] === Config.serverKey) {
if (Config.servers[data[3]]) { // Checks if the provided serverID exists
sock.serverID = data[3];
if (data[0] === "AUTH") {
if (data[1] === Config.serverKey) {
if (Config.servers[data[2]]) { // Checks if the provided serverID exists
sock.serverID = data[2];
app.Socks[sock.serverID] = sock;
app.logger.info("Server " + sock.serverID + " has been authenticated!");
func.sendToSocket(sock, JSON.stringify(["SYS", "AUTHED"]));
Expand All @@ -257,14 +257,14 @@ app.server.on("connection", function (sock) {

func.sendToSocket(sock, JSON.stringify(["SYS", "DENIED"]));
} else {
if (data[1] === "Event") {
if (app.eventEmitter.listeners(data[2]).length > 0) {
app.eventEmitter.emit(data[2], sock.serverID, data[3])
if (data[0] === "Event") {
if (app.eventEmitter.listeners(data[1]).length > 0) {
app.eventEmitter.emit(data[1], sock.serverID, data[2])
} else {
app.logger.warn(sock.remoteAddress + " tried to trigger an unknown event! (" + data[2] + ")");
app.logger.warn(sock.remoteAddress + " tried to trigger an unknown event! (" + data[1] + ")");
}
} else {
app.sendMessage(data[3], data[4]);
app.sendMessage(data[2], data[3]);
}
}
});
Expand Down
2 changes: 1 addition & 1 deletion foxedbot.js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "foxedbot",
"version": "2.0.1",
"version": "3.0.0",
"description": "A SteamBot for Garry's Mod.",
"main": "./app.js",
"repository": {
Expand Down

0 comments on commit 127cfa6

Please sign in to comment.