mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 23:01:30 +00:00
Remove old DB connector
This commit is contained in:
parent
8ad4ef503b
commit
d5eb015533
@ -590,7 +590,6 @@ void Client::DoSuccessfulLogin(const std::string &user, int db_account_id, const
|
|||||||
in.s_addr = connection->GetRemoteIP();
|
in.s_addr = connection->GetRemoteIP();
|
||||||
|
|
||||||
server.db->UpdateLSAccountData(db_account_id, std::string(inet_ntoa(in)));
|
server.db->UpdateLSAccountData(db_account_id, std::string(inet_ntoa(in)));
|
||||||
|
|
||||||
GenerateKey();
|
GenerateKey();
|
||||||
|
|
||||||
account_id = db_account_id;
|
account_id = db_account_id;
|
||||||
|
|||||||
@ -50,25 +50,6 @@ Database::Database(
|
|||||||
this->host = host;
|
this->host = host;
|
||||||
this->name = name;
|
this->name = name;
|
||||||
|
|
||||||
database = mysql_init(nullptr);
|
|
||||||
if (database) {
|
|
||||||
char r = 1;
|
|
||||||
mysql_options(database, MYSQL_OPT_RECONNECT, &r);
|
|
||||||
if (!mysql_real_connect(
|
|
||||||
database,
|
|
||||||
host.c_str(),
|
|
||||||
user.c_str(),
|
|
||||||
pass.c_str(),
|
|
||||||
name.c_str(),
|
|
||||||
atoi(port.c_str()),
|
|
||||||
nullptr,
|
|
||||||
0
|
|
||||||
)) {
|
|
||||||
mysql_close(database);
|
|
||||||
Log(Logs::General, Logs::Error, "Failed to connect to MySQL database. Error: %s", mysql_error(database));
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32 errnum = 0;
|
uint32 errnum = 0;
|
||||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||||
if (!Open(
|
if (!Open(
|
||||||
@ -87,11 +68,6 @@ Database::Database(
|
|||||||
else {
|
else {
|
||||||
Log(Logs::General, Logs::Status, "Using database '%s' at %s:%d", database, host, port);
|
Log(Logs::General, Logs::Status, "Using database '%s' at %s:%d", database, host, port);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
Log(Logs::General, Logs::Error, "Failed to create db object in MySQL database.");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -438,7 +414,7 @@ bool Database::GetWorldRegistration(
|
|||||||
void Database::UpdateLSAccountData(unsigned int id, std::string ip_address)
|
void Database::UpdateLSAccountData(unsigned int id, std::string ip_address)
|
||||||
{
|
{
|
||||||
auto query = fmt::format(
|
auto query = fmt::format(
|
||||||
"UPDATE {0} SET LastIPAddress = '{2}', LastLoginDate = now() where LoginServerId = {3}",
|
"UPDATE {0} SET LastIPAddress = '{1}', LastLoginDate = NOW() where LoginServerId = {2}",
|
||||||
server.options.GetAccountTable(),
|
server.options.GetAccountTable(),
|
||||||
ip_address,
|
ip_address,
|
||||||
id
|
id
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user