ls tweaks

This commit is contained in:
Akkadius 2019-07-05 21:22:35 -05:00
parent 3eb102a006
commit a9969e500b
4 changed files with 19 additions and 10 deletions

View File

@ -249,7 +249,6 @@ void ParseAccountString(const std::string &s, std::string &account, std::string
account = split[1];
}
else if(split.size() == 1) {
loginserver = "eqemu";
account = split[0];
}
}

View File

@ -198,9 +198,14 @@ void Client::Handle_Login(const char *data, unsigned int size)
char *login_packet_buffer = nullptr;
unsigned int db_account_id = 0;
std::string db_loginserver = "eqemu";
std::string db_account_password_hash;
unsigned int db_account_id = 0;
std::string db_loginserver = "local";
if (server.options.CanAutoLinkAccounts()) {
db_loginserver = "eqemu";
}
std::string db_account_password_hash;
std::string outbuffer;
outbuffer.resize(size - 12);
@ -310,7 +315,12 @@ void Client::Handle_Play(const char *data)
auto sequence_in = (unsigned int) play->Sequence;
if (server.options.IsTraceOn()) {
LogInfo("Play received from client, server number {0} sequence {1}", server_id_in, sequence_in);
LogInfo(
"Play received from client [{0}] server number {1} sequence {2}",
GetAccountName(),
server_id_in,
sequence_in
);
}
this->play_server_id = (unsigned int) play->ServerNumber;
@ -373,9 +383,9 @@ void Client::AttemptLoginAccountCreation(
const std::string &loginserver
)
{
if (loginserver == "eqemu") {
LogInfo("Attempting login account creation via '{0}'", loginserver);
LogInfo("Attempting login account creation via '{0}'", loginserver);
if (loginserver == "eqemu") {
if (!server.options.CanAutoLinkAccounts()) {
LogInfo("CanAutoLinkAccounts disabled - sending failed login");

View File

@ -192,7 +192,7 @@ bool Database::GetLoginTokenDataFromToken(
unsigned int Database::GetFreeID(const std::string &loginserver)
{
auto query = fmt::format(
"SELECT MAX(LoginServerID) + 1 FROM {0} WHERE AccountLoginServer='{1}'",
"SELECT IFNULL(MAX(LoginServerID), 0) + 1 FROM {0} WHERE AccountLoginServer='{1}'",
server.options.GetAccountTable(),
EscapeString(loginserver)
);
@ -204,7 +204,7 @@ unsigned int Database::GetFreeID(const std::string &loginserver)
auto row = results.begin();
return atol(row[0]);
return std::stoi(row[0]);
}
/**

View File

@ -798,7 +798,7 @@ void WorldServer::SendClientAuth(
LogInfo(
"Sending Client Authentication Response ls_account_id [{0}] ls_name [{1}] name [{2}] key [{3}] ls_admin [{4}] "
" world_admin [{5}] ip [{6}] local [{7}]",
"world_admin [{5}] ip [{6}] local [{7}]",
client_auth.lsaccount_id,
client_auth.lsname,
client_auth.name,