Logging / initializers [skip ci]

This commit is contained in:
Akkadius
2019-07-10 00:11:17 -05:00
parent 6e550ecc75
commit 2a927c5c80
5 changed files with 36 additions and 33 deletions
+13 -12
View File
@@ -394,35 +394,36 @@ void Client::SendPostEnterWorld() {
safe_delete(outapp);
}
bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app) {
bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app)
{
if (app->size != sizeof(LoginInfo_Struct)) {
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
char name[19] = {0};
char name[19] = {0};
char password[16] = {0};
strn0cpy(name, (char*)li->login_info,18);
strn0cpy(password, (char*)&(li->login_info[strlen(name)+1]), 15);
strn0cpy(name, (char *) login_info->login_info, 18);
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) {
Log(Logs::Detail, Logs::World_Server, "Login without a password");
return false;
}
is_player_zoning = (li->zoning == 1);
LogDebug("Receiving Login Info Packet from Client | name [{0}] password [{1}]", name, password);
uint32 id = atoi(name);
is_player_zoning = (login_info->zoning == 1);
uint32 id = std::stoi(name);
if (id == 0) {
LogWarning("Receiving Login Info Packet from Client | account_id is 0 - disconnecting");
return false;
}
if (cle = client_list.CheckAuth(id, password)) {
if ((cle = client_list.CheckAuth(id, password))) {
if (!is_player_zoning) {
// Track who is in and who is out of the game
char *inout= (char *) "";
-4
View File
@@ -80,10 +80,6 @@ ClientListEntry::ClientListEntry(
pworldadmin = in_is_world_admin;
plocal = (local == 1);
pinstance = 0;
pLFGFromLevel = 0;
pLFGToLevel = 0;
pLFGMatchFilter = false;
memset(pLFGComments, 0, 64);
}
+4 -4
View File
@@ -138,7 +138,7 @@ private:
// Character info
ZoneServer* pzoneserver{};
uint32 pzone{};
uint16 pinstance;
uint16 pinstance{};
uint32 pcharid{};
char pname[64]{};
uint8 plevel{};
@@ -150,9 +150,9 @@ private:
bool pLFG{};
uint8 gm{};
uint8 pClientVersion{};
uint8 pLFGFromLevel;
uint8 pLFGToLevel;
bool pLFGMatchFilter;
uint8 pLFGFromLevel{};
uint8 pLFGToLevel{};
bool pLFGMatchFilter{};
char pLFGComments[64]{};
// Tell Queue -- really a vector :D