From 1697c55d0d6029276ac720da1d3a16d22cdd9fb1 Mon Sep 17 00:00:00 2001 From: Ethan Stubbs <37120476+tgpethan@users.noreply.github.com> Date: Fri, 5 Feb 2021 03:14:53 +0000 Subject: [PATCH] Make protocol version a global variable --- Binato.js | 2 ++ server/loginHandler.js | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Binato.js b/Binato.js index 8ebff04..09481a6 100644 --- a/Binato.js +++ b/Binato.js @@ -6,6 +6,8 @@ const app = require("express")(), const debugMode = true; +global.protocolVersion = 19; + global.consoleHelper = require("./consoleHelper.js"); const serverHandler = require("./server/serverHandler.js"); diff --git a/server/loginHandler.js b/server/loginHandler.js index 8e1798f..c767aa7 100644 --- a/server/loginHandler.js +++ b/server/loginHandler.js @@ -86,8 +86,8 @@ module.exports = function(req, res, loginInfo) { // The reply id is the user's id in any other case than an error in which case negative numbers are used osuPacketWriter.LoginReply(NewUser.id); - // Current bancho protocol version is 19 - osuPacketWriter.ProtocolNegotiation(19); + // Current bancho protocol version. Defined in Binato.js + osuPacketWriter.ProtocolNegotiation(global.protocolVersion); // Permission level 4 is osu!supporter osuPacketWriter.LoginPermissions(4);