Subversion Repositories eoserv

Compare Revisions

Ignore whitespace Rev 391 → Rev 392

/trunk/src/handlers/Login.cpp
22,7 → 22,7
namespace Handlers
{
 
// Check if a character exists
// Log in to an account
void Login_Request(EOClient *client, PacketReader &reader)
{
std::string username = reader.GetBreakString();
81,6 → 81,14
PacketBuilder reply(PACKET_LOGIN, PACKET_REPLY, 2);
reply.AddShort(login_reply);
client->Send(reply);
 
int max_login_attempts = int(client->server()->world->config["MaxLoginAttempts"]);
 
if (max_login_attempts != 0 && ++client->login_attempts >= max_login_attempts)
{
client->Close();
}
 
return;
}
 
/trunk/src/eoserv_config.cpp
33,6 → 33,7
eoserv_config_default(config, "MaxConnectionsPerIP", 3);
eoserv_config_default(config, "IPReconnectLimit" , 10);
eoserv_config_default(config, "MaxConnectionsPerPC", 1);
eoserv_config_default(config, "MaxLoginAttempts" , 3);
eoserv_config_default(config, "CheckVersion" , true);
eoserv_config_default(config, "MinVersion" , 0);
eoserv_config_default(config, "MaxVersion" , 0);
/trunk/src/eoclient.hpp
97,6 → 97,7
bool needpong;
int hdid;
ClientState state;
int login_attempts;
 
ActionQueue queue;
 
/trunk/src/eoclient.cpp
45,6 → 45,7
this->player = 0;
this->version = 0;
this->needpong = false;
this->login_attempts = 0;
}
 
bool EOClient::NeedTick()
171,6 → 172,9
if (data.length() < 2)
return;
 
if (!this->Connected())
return;
 
PacketReader reader(processor.Decode(data));
 
if (reader.Family() == PACKET_INTERNAL)
/trunk/config/server.ini
39,6 → 39,11
# 0 for unlimited
MaxConnectionsPerPC = 1
 
## MaxLoginAttempts (number)
# Maximum number of login attempts before disconnecting
# 0 for unlimited
MaxLoginAttempts = 3
 
## PasswordSalt (string)
# Enter any large amount of random characters here
# WARNING: Changing this will break any existing users' passwords.