From b101f3809e509df16c71e1415e9ebb0c687601b8 Mon Sep 17 00:00:00 2001 From: fusion32 Date: Fri, 31 Oct 2025 00:53:55 -0300 Subject: [PATCH] avoid doing a login query if the account id is empty/zero --- src/connections.cc | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/connections.cc b/src/connections.cc index e640cb6..ef89f66 100644 --- a/src/connections.cc +++ b/src/connections.cc @@ -496,15 +496,6 @@ void ProcessLoginRequest(TConnection *Connection){ Connection->XTEA[2] = Buffer.Read32(); Connection->XTEA[3] = Buffer.Read32(); - if(TerminalType < 0 || TerminalType >= NARRAY(TERMINALVERSION) - || TERMINALVERSION[TerminalType] != TerminalVersion){ - SendLoginError(Connection, - "Your terminal version is too old.\n" - "Please get a new version at\n" - "http://www.tibia.com."); - return; - } - char Password[30]; int AccountID = Buffer.Read32(); Buffer.ReadString(Password, sizeof(Password)); @@ -514,6 +505,20 @@ void ProcessLoginRequest(TConnection *Connection){ return; } + if(AccountID <= 0){ + SendLoginError(Connection, "You must enter an account number."); + return; + } + + if(TerminalType < 0 || TerminalType >= NARRAY(TERMINALVERSION) + || TERMINALVERSION[TerminalType] != TerminalVersion){ + SendLoginError(Connection, + "Your terminal version is too old.\n" + "Please get a new version at\n" + "http://www.tibia.com."); + return; + } + int NumCharacters = 0; int PremiumDays = 0; TCharacterLoginData Characters[50];