mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-20 21:41:29 +00:00
Logging / initializers [skip ci]
This commit is contained in:
parent
6e550ecc75
commit
2a927c5c80
@ -1210,19 +1210,25 @@ bool Database::AddToNameFilter(const char* name) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param in_loginserver_id
|
||||||
|
* @param in_loginserver_account_id
|
||||||
|
* @param in_account_name
|
||||||
|
* @param in_status
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
uint32 Database::GetAccountIDFromLSID(
|
uint32 Database::GetAccountIDFromLSID(
|
||||||
const std::string &iLoginServer,
|
const std::string &in_loginserver_id,
|
||||||
uint32 iLSID, char *oAccountName,
|
uint32 in_loginserver_account_id,
|
||||||
int16 *oStatus
|
char *in_account_name,
|
||||||
|
int16 *in_status
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
uint32 account_id = 0;
|
uint32 account_id = 0;
|
||||||
//iLoginServer is set by config so don't need to worry about escaping it.
|
|
||||||
|
|
||||||
auto query = fmt::format(
|
auto query = fmt::format(
|
||||||
"SELECT id, name, status FROM account WHERE lsaccount_id = {0} AND ls_id = '{1}'",
|
"SELECT id, name, status FROM account WHERE lsaccount_id = {0} AND ls_id = '{1}'",
|
||||||
iLSID,
|
in_loginserver_account_id,
|
||||||
iLoginServer
|
in_loginserver_id
|
||||||
);
|
);
|
||||||
|
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
@ -1236,13 +1242,13 @@ uint32 Database::GetAccountIDFromLSID(
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||||
account_id = atoi(row[0]);
|
account_id = std::stoi(row[0]);
|
||||||
|
|
||||||
if (oAccountName) {
|
if (in_account_name) {
|
||||||
strcpy(oAccountName, row[1]);
|
strcpy(in_account_name, row[1]);
|
||||||
}
|
}
|
||||||
if (oStatus) {
|
if (in_status) {
|
||||||
*oStatus = atoi(row[2]);
|
*in_status = std::stoi(row[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -184,7 +184,7 @@ public:
|
|||||||
|
|
||||||
uint32 CheckLogin(const char* name, const char* password, const char *loginserver, int16* oStatus = 0);
|
uint32 CheckLogin(const char* name, const char* password, const char *loginserver, int16* oStatus = 0);
|
||||||
uint32 CreateAccount(const char* name, const char* password, int16 status, const char* loginserver, uint32 lsaccount_id);
|
uint32 CreateAccount(const char* name, const char* password, int16 status, const char* loginserver, uint32 lsaccount_id);
|
||||||
uint32 GetAccountIDFromLSID(const std::string& iLoginServer, uint32 iLSID, char* oAccountName = 0, int16* oStatus = 0);
|
uint32 GetAccountIDFromLSID(const std::string& in_loginserver_id, uint32 in_loginserver_account_id, char* in_account_name = 0, int16* in_status = 0);
|
||||||
uint8 GetAgreementFlag(uint32 acctid);
|
uint8 GetAgreementFlag(uint32 acctid);
|
||||||
|
|
||||||
void GetAccountFromID(uint32 id, char* oAccountName, int16* oStatus);
|
void GetAccountFromID(uint32 id, char* oAccountName, int16* oStatus);
|
||||||
|
|||||||
@ -394,35 +394,36 @@ void Client::SendPostEnterWorld() {
|
|||||||
safe_delete(outapp);
|
safe_delete(outapp);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app) {
|
bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app)
|
||||||
|
{
|
||||||
if (app->size != sizeof(LoginInfo_Struct)) {
|
if (app->size != sizeof(LoginInfo_Struct)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
LoginInfo_Struct *li=(LoginInfo_Struct *)app->pBuffer;
|
auto *login_info = (LoginInfo_Struct *) app->pBuffer;
|
||||||
|
|
||||||
// Quagmire - max len for name is 18, pass 15
|
// Quagmire - max len for name is 18, pass 15
|
||||||
char name[19] = {0};
|
char name[19] = {0};
|
||||||
char password[16] = {0};
|
char password[16] = {0};
|
||||||
strn0cpy(name, (char*)li->login_info,18);
|
strn0cpy(name, (char *) login_info->login_info, 18);
|
||||||
strn0cpy(password, (char*)&(li->login_info[strlen(name)+1]), 15);
|
strn0cpy(password, (char *) &(login_info->login_info[strlen(name) + 1]), 15);
|
||||||
|
|
||||||
|
LogDebug("Receiving Login Info Packet from Client | name [{0}] password [{1}]", name, password);
|
||||||
|
|
||||||
if (strlen(password) <= 1) {
|
if (strlen(password) <= 1) {
|
||||||
Log(Logs::Detail, Logs::World_Server, "Login without a password");
|
Log(Logs::Detail, Logs::World_Server, "Login without a password");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
is_player_zoning = (li->zoning == 1);
|
is_player_zoning = (login_info->zoning == 1);
|
||||||
|
|
||||||
LogDebug("Receiving Login Info Packet from Client | name [{0}] password [{1}]", name, password);
|
uint32 id = std::stoi(name);
|
||||||
|
|
||||||
uint32 id = atoi(name);
|
|
||||||
if (id == 0) {
|
if (id == 0) {
|
||||||
LogWarning("Receiving Login Info Packet from Client | account_id is 0 - disconnecting");
|
LogWarning("Receiving Login Info Packet from Client | account_id is 0 - disconnecting");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cle = client_list.CheckAuth(id, password)) {
|
if ((cle = client_list.CheckAuth(id, password))) {
|
||||||
if (!is_player_zoning) {
|
if (!is_player_zoning) {
|
||||||
// Track who is in and who is out of the game
|
// Track who is in and who is out of the game
|
||||||
char *inout= (char *) "";
|
char *inout= (char *) "";
|
||||||
|
|||||||
@ -80,10 +80,6 @@ ClientListEntry::ClientListEntry(
|
|||||||
pworldadmin = in_is_world_admin;
|
pworldadmin = in_is_world_admin;
|
||||||
plocal = (local == 1);
|
plocal = (local == 1);
|
||||||
|
|
||||||
pinstance = 0;
|
|
||||||
pLFGFromLevel = 0;
|
|
||||||
pLFGToLevel = 0;
|
|
||||||
pLFGMatchFilter = false;
|
|
||||||
memset(pLFGComments, 0, 64);
|
memset(pLFGComments, 0, 64);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -138,7 +138,7 @@ private:
|
|||||||
// Character info
|
// Character info
|
||||||
ZoneServer* pzoneserver{};
|
ZoneServer* pzoneserver{};
|
||||||
uint32 pzone{};
|
uint32 pzone{};
|
||||||
uint16 pinstance;
|
uint16 pinstance{};
|
||||||
uint32 pcharid{};
|
uint32 pcharid{};
|
||||||
char pname[64]{};
|
char pname[64]{};
|
||||||
uint8 plevel{};
|
uint8 plevel{};
|
||||||
@ -150,9 +150,9 @@ private:
|
|||||||
bool pLFG{};
|
bool pLFG{};
|
||||||
uint8 gm{};
|
uint8 gm{};
|
||||||
uint8 pClientVersion{};
|
uint8 pClientVersion{};
|
||||||
uint8 pLFGFromLevel;
|
uint8 pLFGFromLevel{};
|
||||||
uint8 pLFGToLevel;
|
uint8 pLFGToLevel{};
|
||||||
bool pLFGMatchFilter;
|
bool pLFGMatchFilter{};
|
||||||
char pLFGComments[64]{};
|
char pLFGComments[64]{};
|
||||||
|
|
||||||
// Tell Queue -- really a vector :D
|
// Tell Queue -- really a vector :D
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user