aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/connections.cc23
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];