diff options
| author | fusion32 <marcopuzziello@gmail.com> | 2025-10-31 00:53:55 -0300 |
|---|---|---|
| committer | fusion32 <marcopuzziello@gmail.com> | 2025-10-31 00:53:55 -0300 |
| commit | b101f3809e509df16c71e1415e9ebb0c687601b8 (patch) | |
| tree | 3a3a398d37c83827c1add4f68a3ccd8118d22936 /src | |
| parent | a8a6a140186f97bb01e2f5e9e5cd746850d36684 (diff) | |
| download | login-b101f3809e509df16c71e1415e9ebb0c687601b8.tar.gz login-b101f3809e509df16c71e1415e9ebb0c687601b8.zip | |
avoid doing a login query if the account id is empty/zero
Diffstat (limited to 'src')
| -rw-r--r-- | src/connections.cc | 23 |
1 files 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]; |
