mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 06:21:28 +00:00
[Code Cleanup] More login <-> world code cleanup (#4724)
* More cleanup * More cleanup
This commit is contained in:
parent
cb634cf57d
commit
eb6ac25540
@ -245,7 +245,7 @@ uint32 Database::CreateAccount(
|
|||||||
e.password = password;
|
e.password = password;
|
||||||
}
|
}
|
||||||
|
|
||||||
LogInfo("Account Attempting to be created: [{}:{}] status: {}", loginserver, name, status);
|
LogInfo("Account attempting to be created loginserver [{}] name [{}] status [{}]", loginserver, name, status);
|
||||||
|
|
||||||
e = AccountRepository::InsertOne(*this, e);
|
e = AccountRepository::InsertOne(*this, e);
|
||||||
|
|
||||||
|
|||||||
@ -47,7 +47,7 @@ static const uint32 ADVANCED_LORE_LENGTH = 8192;
|
|||||||
*/
|
*/
|
||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
|
|
||||||
struct LoginInfo_Struct {
|
struct LoginInfo {
|
||||||
/*000*/ char login_info[64];
|
/*000*/ char login_info[64];
|
||||||
/*064*/ uint8 unknown064[124];
|
/*064*/ uint8 unknown064[124];
|
||||||
/*188*/ uint8 zoning; // 01 if zoning, 00 if not
|
/*188*/ uint8 zoning; // 01 if zoning, 00 if not
|
||||||
|
|||||||
@ -25,7 +25,7 @@ void EQ::Net::ServertalkServerConnection::Send(uint16_t opcode, EQ::Net::Packet
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (opcode == ServerOP_UsertoWorldReq) {
|
if (opcode == ServerOP_UsertoWorldReq) {
|
||||||
auto req_in = (UsertoWorldRequest_Struct*)p.Data();
|
auto req_in = (UsertoWorldRequest*)p.Data();
|
||||||
|
|
||||||
EQ::Net::DynamicPacket req;
|
EQ::Net::DynamicPacket req;
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
@ -45,7 +45,7 @@ void EQ::Net::ServertalkServerConnection::Send(uint16_t opcode, EQ::Net::Packet
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (opcode == ServerOP_LSClientAuth) {
|
if (opcode == ServerOP_LSClientAuth) {
|
||||||
auto req_in = (ClientAuth_Struct*)p.Data();
|
auto req_in = (ClientAuth*)p.Data();
|
||||||
|
|
||||||
EQ::Net::DynamicPacket req;
|
EQ::Net::DynamicPacket req;
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
@ -54,7 +54,7 @@ void EQ::Net::ServertalkServerConnection::Send(uint16_t opcode, EQ::Net::Packet
|
|||||||
req.PutData(i, req_in->key, 30); i += 30;
|
req.PutData(i, req_in->key, 30); i += 30;
|
||||||
req.PutUInt8(i, req_in->lsadmin); i += 1;
|
req.PutUInt8(i, req_in->lsadmin); i += 1;
|
||||||
req.PutUInt16(i, req_in->is_world_admin); i += 2;
|
req.PutUInt16(i, req_in->is_world_admin); i += 2;
|
||||||
req.PutUInt32(i, req_in->ip); i += 4;
|
req.PutUInt32(i, req_in->ip_address); i += 4;
|
||||||
req.PutUInt8(i, req_in->is_client_from_local_network); i += 1;
|
req.PutUInt8(i, req_in->is_client_from_local_network); i += 1;
|
||||||
|
|
||||||
EQ::Net::DynamicPacket out;
|
EQ::Net::DynamicPacket out;
|
||||||
|
|||||||
@ -677,36 +677,53 @@ struct ServerLSPlayerZoneChange_Struct {
|
|||||||
uint32 to; // 0 = world
|
uint32 to; // 0 = world
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ClientAuth_Struct {
|
struct ClientAuth {
|
||||||
uint32 loginserver_account_id; // ID# in login server's db
|
uint32 loginserver_account_id; // ID# in login server's db
|
||||||
char loginserver_name[64];
|
char loginserver_name[64];
|
||||||
char account_name[30]; // username in login server's db
|
char account_name[30]; // username in login server's db
|
||||||
char key[30]; // the Key the client will present
|
char key[30]; // the key the client will present
|
||||||
uint8 lsadmin; // login server admin level
|
uint8 lsadmin; // login server admin level
|
||||||
int16 is_world_admin; // login's suggested worldadmin level setting for this user, up to the world if they want to obey it
|
int16 is_world_admin; // login's suggested worldadmin level setting for this user, up to the world if they want to obey it
|
||||||
uint32 ip;
|
uint32 ip_address;
|
||||||
uint8 is_client_from_local_network; // 1 if the client is from the local network
|
uint8 is_client_from_local_network; // 1 if the client is from the local network
|
||||||
|
|
||||||
template <class Archive>
|
template<class Archive>
|
||||||
void serialize(Archive &ar)
|
void serialize(Archive &ar)
|
||||||
{
|
{
|
||||||
ar(loginserver_account_id, loginserver_name, account_name, key, lsadmin, is_world_admin, ip, is_client_from_local_network);
|
ar(
|
||||||
|
loginserver_account_id,
|
||||||
|
loginserver_name,
|
||||||
|
account_name,
|
||||||
|
key,
|
||||||
|
lsadmin,
|
||||||
|
is_world_admin,
|
||||||
|
ip_address,
|
||||||
|
is_client_from_local_network
|
||||||
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ClientAuthLegacy_Struct {
|
struct ClientAuthLegacy {
|
||||||
uint32 loginserver_account_id; // ID# in login server's db
|
uint32 loginserver_account_id; // ID# in login server's db
|
||||||
char loginserver_account_name[30]; // username in login server's db
|
char loginserver_account_name[30]; // username in login server's db
|
||||||
char key[30]; // the Key the client will present
|
char key[30]; // the key the client will present
|
||||||
uint8 loginserver_admin_level; // login server admin level
|
uint8 loginserver_admin_level; // login server admin level
|
||||||
int16 is_world_admin; // login's suggested worldadmin level setting for this user, up to the world if they want to obey it
|
int16 is_world_admin; // login's suggested worldadmin level setting for this user, up to the world if they want to obey it
|
||||||
uint32 ip;
|
uint32 ip_address;
|
||||||
uint8 is_client_from_local_network; // 1 if the client is from the local network
|
uint8 is_client_from_local_network; // 1 if the client is from the local network
|
||||||
|
|
||||||
template <class Archive>
|
template<class Archive>
|
||||||
void serialize(Archive &ar)
|
void serialize(Archive &ar)
|
||||||
{
|
{
|
||||||
ar(loginserver_account_id, loginserver_account_name, key, loginserver_admin_level, is_world_admin, ip, is_client_from_local_network);
|
ar(
|
||||||
|
loginserver_account_id,
|
||||||
|
loginserver_account_name,
|
||||||
|
key,
|
||||||
|
loginserver_admin_level,
|
||||||
|
is_world_admin,
|
||||||
|
ip_address,
|
||||||
|
is_client_from_local_network
|
||||||
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -834,38 +851,38 @@ struct ServerSyncWorldList_Struct {
|
|||||||
bool placeholder;
|
bool placeholder;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct UsertoWorldRequestLegacy_Struct {
|
struct UsertoWorldRequestLegacy {
|
||||||
uint32 lsaccountid;
|
|
||||||
uint32 worldid;
|
|
||||||
uint32 FromID;
|
|
||||||
uint32 ToID;
|
|
||||||
char IPAddr[64];
|
|
||||||
};
|
|
||||||
|
|
||||||
struct UsertoWorldRequest_Struct {
|
|
||||||
uint32 lsaccountid;
|
|
||||||
uint32 worldid;
|
|
||||||
uint32 FromID;
|
|
||||||
uint32 ToID;
|
|
||||||
char IPAddr[64];
|
|
||||||
char login[64];
|
|
||||||
};
|
|
||||||
|
|
||||||
struct UsertoWorldResponseLegacy_Struct {
|
|
||||||
uint32 lsaccountid;
|
uint32 lsaccountid;
|
||||||
uint32 worldid;
|
uint32 worldid;
|
||||||
int8 response; // -3) World Full, -2) Banned, -1) Suspended, 0) Denied, 1) Allowed
|
uint32 FromID;
|
||||||
|
uint32 ToID;
|
||||||
|
char IPAddr[64];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct UsertoWorldRequest {
|
||||||
|
uint32 lsaccountid;
|
||||||
|
uint32 worldid;
|
||||||
|
uint32 FromID; // appears to be unused today
|
||||||
|
uint32 ToID; // appears to be unused today
|
||||||
|
char IPAddr[64];
|
||||||
|
char login[64];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct UsertoWorldResponseLegacy {
|
||||||
|
uint32 lsaccountid;
|
||||||
|
uint32 worldid;
|
||||||
|
int8 response; // -3) World Full, -2) Banned, -1) Suspended, 0) Denied, 1) Allowed
|
||||||
uint32 FromID;
|
uint32 FromID;
|
||||||
uint32 ToID;
|
uint32 ToID;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct UsertoWorldResponse_Struct {
|
struct UsertoWorldResponse {
|
||||||
uint32 lsaccountid;
|
uint32 lsaccountid;
|
||||||
uint32 worldid;
|
uint32 worldid;
|
||||||
int8 response; // -3) World Full, -2) Banned, -1) Suspended, 0) Denied, 1) Allowed
|
int8 response; // -3) World Full, -2) Banned, -1) Suspended, 0) Denied, 1) Allowed
|
||||||
uint32 FromID;
|
uint32 FromID; // appears to be unused today
|
||||||
uint32 ToID;
|
uint32 ToID; // appears to be unused today
|
||||||
char login[64];
|
char login[64];
|
||||||
};
|
};
|
||||||
|
|
||||||
// generic struct to be used for alot of simple zone->world questions
|
// generic struct to be used for alot of simple zone->world questions
|
||||||
|
|||||||
@ -143,7 +143,7 @@ void WorldServer::ProcessUserToWorldResponseLegacy(uint16_t opcode, const EQ::Ne
|
|||||||
packet.ToString()
|
packet.ToString()
|
||||||
);
|
);
|
||||||
|
|
||||||
if (packet.Length() < sizeof(UsertoWorldResponseLegacy_Struct)) {
|
if (packet.Length() < sizeof(UsertoWorldResponseLegacy)) {
|
||||||
LogError(
|
LogError(
|
||||||
"Received application packet from server that had opcode ServerOP_UsertoWorldResp, "
|
"Received application packet from server that had opcode ServerOP_UsertoWorldResp, "
|
||||||
"but was too small. Discarded to avoid buffer overrun"
|
"but was too small. Discarded to avoid buffer overrun"
|
||||||
@ -152,7 +152,7 @@ void WorldServer::ProcessUserToWorldResponseLegacy(uint16_t opcode, const EQ::Ne
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto *res = (UsertoWorldResponseLegacy_Struct *) packet.Data();
|
auto *res = (UsertoWorldResponseLegacy *) packet.Data();
|
||||||
|
|
||||||
LogDebug("Trying to find client with user id of [{}]", res->lsaccountid);
|
LogDebug("Trying to find client with user id of [{}]", res->lsaccountid);
|
||||||
Client *c = server.client_manager->GetClient(res->lsaccountid, "eqemu");
|
Client *c = server.client_manager->GetClient(res->lsaccountid, "eqemu");
|
||||||
@ -229,7 +229,7 @@ void WorldServer::ProcessUserToWorldResponse(uint16_t opcode, const EQ::Net::Pac
|
|||||||
packet.ToString()
|
packet.ToString()
|
||||||
);
|
);
|
||||||
|
|
||||||
if (packet.Length() < sizeof(UsertoWorldResponse_Struct)) {
|
if (packet.Length() < sizeof(UsertoWorldResponse)) {
|
||||||
LogError(
|
LogError(
|
||||||
"Received application packet from server that had opcode ServerOP_UsertoWorldResp, "
|
"Received application packet from server that had opcode ServerOP_UsertoWorldResp, "
|
||||||
"but was too small. Discarded to avoid buffer overrun"
|
"but was too small. Discarded to avoid buffer overrun"
|
||||||
@ -238,7 +238,7 @@ void WorldServer::ProcessUserToWorldResponse(uint16_t opcode, const EQ::Net::Pac
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto res = (UsertoWorldResponse_Struct *) packet.Data();
|
auto res = (UsertoWorldResponse *) packet.Data();
|
||||||
LogDebug("Trying to find client with user id of [{}]", res->lsaccountid);
|
LogDebug("Trying to find client with user id of [{}]", res->lsaccountid);
|
||||||
|
|
||||||
Client *c = server.client_manager->GetClient(
|
Client *c = server.client_manager->GetClient(
|
||||||
@ -494,7 +494,7 @@ void WorldServer::HandleWorldserverStatusUpdate(LoginserverWorldStatusUpdate *u)
|
|||||||
void WorldServer::SendClientAuthToWorld(Client *c)
|
void WorldServer::SendClientAuthToWorld(Client *c)
|
||||||
{
|
{
|
||||||
EQ::Net::DynamicPacket outapp;
|
EQ::Net::DynamicPacket outapp;
|
||||||
ClientAuth_Struct a{};
|
ClientAuth a{};
|
||||||
|
|
||||||
a.loginserver_account_id = c->GetAccountID();
|
a.loginserver_account_id = c->GetAccountID();
|
||||||
|
|
||||||
@ -503,7 +503,7 @@ void WorldServer::SendClientAuthToWorld(Client *c)
|
|||||||
|
|
||||||
a.lsadmin = 0;
|
a.lsadmin = 0;
|
||||||
a.is_world_admin = 0;
|
a.is_world_admin = 0;
|
||||||
a.ip = inet_addr(c->GetConnection()->GetRemoteAddr().c_str());
|
a.ip_address = inet_addr(c->GetConnection()->GetRemoteAddr().c_str());
|
||||||
strncpy(a.loginserver_name, &c->GetLoginServerName()[0], 64);
|
strncpy(a.loginserver_name, &c->GetLoginServerName()[0], 64);
|
||||||
|
|
||||||
const std::string &client_address(c->GetConnection()->GetRemoteAddr());
|
const std::string &client_address(c->GetConnection()->GetRemoteAddr());
|
||||||
@ -521,7 +521,7 @@ void WorldServer::SendClientAuthToWorld(Client *c)
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct in_addr ip_addr{};
|
struct in_addr ip_addr{};
|
||||||
ip_addr.s_addr = a.ip;
|
ip_addr.s_addr = a.ip_address;
|
||||||
|
|
||||||
LogInfo(
|
LogInfo(
|
||||||
"Client authentication response: world_address [{}] client_address [{}]",
|
"Client authentication response: world_address [{}] client_address [{}]",
|
||||||
|
|||||||
@ -154,9 +154,9 @@ void WorldServerManager::SendUserLoginToWorldRequest(
|
|||||||
|
|
||||||
if (iter != m_world_servers.end()) {
|
if (iter != m_world_servers.end()) {
|
||||||
EQ::Net::DynamicPacket outapp;
|
EQ::Net::DynamicPacket outapp;
|
||||||
outapp.Resize(sizeof(UsertoWorldRequest_Struct));
|
outapp.Resize(sizeof(UsertoWorldRequest));
|
||||||
|
|
||||||
auto *r = reinterpret_cast<UsertoWorldRequest_Struct *>(outapp.Data());
|
auto *r = reinterpret_cast<UsertoWorldRequest *>(outapp.Data());
|
||||||
r->worldid = server_id;
|
r->worldid = server_id;
|
||||||
r->lsaccountid = client_account_id;
|
r->lsaccountid = client_account_id;
|
||||||
strncpy(r->login, client_loginserver.c_str(), 64);
|
strncpy(r->login, client_loginserver.c_str(), 64);
|
||||||
|
|||||||
@ -447,30 +447,30 @@ void Client::SendPostEnterWorld() {
|
|||||||
|
|
||||||
bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app)
|
bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app)
|
||||||
{
|
{
|
||||||
if (app->size != sizeof(LoginInfo_Struct)) {
|
if (app->size != sizeof(LoginInfo)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto *login_info = (LoginInfo_Struct *) app->pBuffer;
|
auto *r = (LoginInfo *) 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 *) login_info->login_info, 18);
|
strn0cpy(name, (char *) r->login_info, 18);
|
||||||
strn0cpy(password, (char *) &(login_info->login_info[strlen(name) + 1]), 15);
|
strn0cpy(password, (char *) &(r->login_info[strlen(name) + 1]), 15);
|
||||||
|
|
||||||
LogDebug("Receiving Login Info Packet from Client | name [{0}] password [{1}]", name, password);
|
LogDebug("Receiving login info packet from client | name [{}] password [{}]", name, password);
|
||||||
|
|
||||||
if (strlen(password) <= 1) {
|
if (strlen(password) <= 1) {
|
||||||
LogInfo("Login without a password");
|
LogInfo("Login without a password");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
is_player_zoning = (login_info->zoning == 1);
|
is_player_zoning = (r->zoning == 1);
|
||||||
|
|
||||||
uint32 id = Strings::ToInt(name);
|
uint32 id = Strings::ToInt(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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -480,15 +480,15 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app)
|
|||||||
LogClientLogin("Checking authentication id [{}] passed", id);
|
LogClientLogin("Checking authentication id [{}] passed", id);
|
||||||
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 *) "";
|
std::string in_out;
|
||||||
|
|
||||||
if (cle->GetOnline() == CLE_Status::Never){
|
if (cle->GetOnline() == CLE_Status::Never) {
|
||||||
// Desktop -> Char Select
|
// Desktop -> Char Select
|
||||||
inout = (char *) "In";
|
in_out = "in";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Game -> Char Select
|
// Game -> Char Select
|
||||||
inout=(char *) "Out";
|
in_out = "out";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Always at Char select at this point.
|
// Always at Char select at this point.
|
||||||
@ -497,7 +497,7 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app)
|
|||||||
// Could use a Logging Out Completely message somewhere.
|
// Could use a Logging Out Completely message somewhere.
|
||||||
cle->SetOnline(CLE_Status::CharSelect);
|
cle->SetOnline(CLE_Status::CharSelect);
|
||||||
|
|
||||||
LogInfo("Account ({}) Logging({}) to character select :: LSID [{}] ", cle->AccountName(), inout, cle->LSID());
|
LogInfo("Account ({}) Logging ({}) to character select :: LSID [{}] ", cle->AccountName(), in_out, cle->LSID());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
cle->SetOnline();
|
cle->SetOnline();
|
||||||
@ -545,7 +545,7 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app)
|
|||||||
if (!skip_char_info && !custom_files_key.empty() && cle->Admin() < RuleI(World, CustomFilesAdminLevel)) {
|
if (!skip_char_info && !custom_files_key.empty() && cle->Admin() < RuleI(World, CustomFilesAdminLevel)) {
|
||||||
// Modified clients can utilize this unused block in login_info to send custom payloads on login
|
// Modified clients can utilize this unused block in login_info to send custom payloads on login
|
||||||
// which indicates they are using custom client files with the correct version, based on key payload.
|
// which indicates they are using custom client files with the correct version, based on key payload.
|
||||||
const auto client_key = std::string(reinterpret_cast<char*>(login_info->unknown064));
|
const auto client_key = std::string(reinterpret_cast<char*>(r->unknown064));
|
||||||
if (custom_files_key != client_key) {
|
if (custom_files_key != client_key) {
|
||||||
std::string message = fmt::format("Missing Files [{}]", RuleS(World, CustomFilesUrl) );
|
std::string message = fmt::format("Missing Files [{}]", RuleS(World, CustomFilesUrl) );
|
||||||
SendUnsupportedClientPacket(message);
|
SendUnsupportedClientPacket(message);
|
||||||
@ -1434,7 +1434,7 @@ void Client::EnterWorld(bool TryBootup) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (TryBootup) {
|
if (TryBootup) {
|
||||||
LogInfo("Attempting autobootup of [{}] ([{}]:[{}])", zone_name, zone_id, instance_id);
|
LogInfo("Attempting autobootup of [{}] [{}] [{}]", zone_name, zone_id, instance_id);
|
||||||
autobootup_timeout.Start();
|
autobootup_timeout.Start();
|
||||||
zone_waiting_for_bootup = zoneserver_list.TriggerBootup(zone_id, instance_id);
|
zone_waiting_for_bootup = zoneserver_list.TriggerBootup(zone_id, instance_id);
|
||||||
if (zone_waiting_for_bootup == 0) {
|
if (zone_waiting_for_bootup == 0) {
|
||||||
|
|||||||
@ -1,20 +1,3 @@
|
|||||||
/* EQEMu: Everquest Server Emulator
|
|
||||||
Copyright (C) 2001-2005 EQEMu Development Team (http://eqemulator.net)
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation; version 2 of the License.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY except by those people which sell it, which
|
|
||||||
are required to give you total support for your newly bought product;
|
|
||||||
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
*/
|
|
||||||
#include "../common/global_define.h"
|
#include "../common/global_define.h"
|
||||||
#include "cliententry.h"
|
#include "cliententry.h"
|
||||||
#include "clientlist.h"
|
#include "clientlist.h"
|
||||||
@ -24,93 +7,86 @@
|
|||||||
#include "worlddb.h"
|
#include "worlddb.h"
|
||||||
#include "zoneserver.h"
|
#include "zoneserver.h"
|
||||||
#include "world_config.h"
|
#include "world_config.h"
|
||||||
#include "../common/guilds.h"
|
|
||||||
#include "../common/strings.h"
|
|
||||||
|
|
||||||
extern uint32 numplayers;
|
extern uint32 numplayers;
|
||||||
extern LoginServerList loginserverlist;
|
extern LoginServerList loginserverlist;
|
||||||
extern ClientList client_list;
|
extern ClientList client_list;
|
||||||
extern volatile bool RunLoops;
|
extern volatile bool RunLoops;
|
||||||
extern SharedTaskManager shared_task_manager;
|
extern SharedTaskManager shared_task_manager;
|
||||||
|
|
||||||
/**
|
|
||||||
* @param in_id
|
|
||||||
* @param in_loginserver_id
|
|
||||||
* @param in_loginserver_name
|
|
||||||
* @param in_login_name
|
|
||||||
* @param in_login_key
|
|
||||||
* @param in_is_world_admin
|
|
||||||
* @param ip
|
|
||||||
* @param local
|
|
||||||
*/
|
|
||||||
ClientListEntry::ClientListEntry(
|
ClientListEntry::ClientListEntry(
|
||||||
uint32 in_id,
|
uint32 id,
|
||||||
uint32 in_loginserver_id,
|
uint32 login_server_id,
|
||||||
const char *in_loginserver_name,
|
const char *login_server_name,
|
||||||
const char *in_login_name,
|
const char *account_name,
|
||||||
const char *in_login_key,
|
const char *login_key,
|
||||||
int16 in_is_world_admin,
|
int16 is_world_admin,
|
||||||
uint32 ip,
|
uint32 ip_address,
|
||||||
uint8 local
|
uint8 local
|
||||||
)
|
)
|
||||||
: id(in_id)
|
: m_id(id)
|
||||||
{
|
{
|
||||||
ClearVars(true);
|
ClearVars(true);
|
||||||
|
|
||||||
LogDebug(
|
LogDebug(
|
||||||
"in_id [{0}] in_loginserver_id [{1}] in_loginserver_name [{2}] in_login_name [{3}] in_login_key [{4}] "
|
"id [{}] loginserver_id [{}] loginserver_name [{}] login_name [{}] login_key [{}] is_world_admin [{}] ip [{}] local [{}]",
|
||||||
" in_is_world_admin [{5}] ip [{6}] local [{7}]",
|
id,
|
||||||
in_id,
|
login_server_id,
|
||||||
in_loginserver_id,
|
login_server_name,
|
||||||
in_loginserver_name,
|
account_name,
|
||||||
in_login_name,
|
login_key,
|
||||||
in_login_key,
|
is_world_admin,
|
||||||
in_is_world_admin,
|
ip_address,
|
||||||
ip,
|
|
||||||
local
|
local
|
||||||
);
|
);
|
||||||
|
|
||||||
pIP = ip;
|
m_ip_address = ip_address;
|
||||||
pLSID = in_loginserver_id;
|
m_login_server_id = login_server_id;
|
||||||
if (in_loginserver_id > 0) {
|
if (login_server_id > 0) {
|
||||||
paccountid = database.GetAccountIDFromLSID(in_loginserver_name, in_loginserver_id, paccountname, &padmin);
|
m_account_id = database.GetAccountIDFromLSID(
|
||||||
|
login_server_name,
|
||||||
|
login_server_id,
|
||||||
|
m_account_name,
|
||||||
|
&m_admin
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
strn0cpy(loginserver_account_name, in_login_name, sizeof(loginserver_account_name));
|
strn0cpy(m_login_account_name, account_name, sizeof(m_login_account_name));
|
||||||
strn0cpy(plskey, in_login_key, sizeof(plskey));
|
strn0cpy(m_key, login_key, sizeof(m_key));
|
||||||
strn0cpy(source_loginserver, in_loginserver_name, sizeof(source_loginserver));
|
strn0cpy(m_source_loginserver, login_server_name, sizeof(m_source_loginserver));
|
||||||
pworldadmin = in_is_world_admin;
|
|
||||||
plocal = (local == 1);
|
|
||||||
|
|
||||||
memset(pLFGComments, 0, 64);
|
m_world_admin = is_world_admin;
|
||||||
|
m_is_local = (local == 1);
|
||||||
|
|
||||||
|
memset(m_lfg_comments, 0, 64);
|
||||||
}
|
}
|
||||||
|
|
||||||
ClientListEntry::ClientListEntry(uint32 in_id, ZoneServer *iZS, ServerClientList_Struct *scl, CLE_Status iOnline)
|
ClientListEntry::ClientListEntry(uint32 in_id, ZoneServer *z, ServerClientList_Struct *scl, CLE_Status online)
|
||||||
: id(in_id)
|
: m_id(in_id)
|
||||||
{
|
{
|
||||||
ClearVars(true);
|
ClearVars(true);
|
||||||
|
|
||||||
pIP = 0;
|
m_ip_address = 0;
|
||||||
pLSID = scl->LSAccountID;
|
m_login_server_id = scl->LSAccountID;
|
||||||
strn0cpy(loginserver_account_name, scl->name, sizeof(loginserver_account_name));
|
strn0cpy(m_login_account_name, scl->name, sizeof(m_login_account_name));
|
||||||
strn0cpy(plskey, scl->lskey, sizeof(plskey));
|
strn0cpy(m_key, scl->lskey, sizeof(m_key));
|
||||||
pworldadmin = 0;
|
m_world_admin = 0;
|
||||||
|
|
||||||
paccountid = scl->AccountID;
|
m_account_id = scl->AccountID;
|
||||||
strn0cpy(paccountname, scl->AccountName, sizeof(paccountname));
|
strn0cpy(m_account_name, scl->AccountName, sizeof(m_account_name));
|
||||||
padmin = scl->Admin;
|
m_admin = scl->Admin;
|
||||||
|
|
||||||
pinstance = 0;
|
m_instance = 0;
|
||||||
pLFGFromLevel = 0;
|
m_lfg_from_level = 0;
|
||||||
pLFGToLevel = 0;
|
m_lfg_to_level = 0;
|
||||||
pLFGMatchFilter = false;
|
m_lfg_match_filter = false;
|
||||||
memset(pLFGComments, 0, 64);
|
memset(m_lfg_comments, 0, 64);
|
||||||
|
|
||||||
if (iOnline >= CLE_Status::Zoning) {
|
if (online >= CLE_Status::Zoning) {
|
||||||
Update(iZS, scl, iOnline);
|
Update(z, scl, online);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
SetOnline(iOnline);
|
SetOnline(online);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -120,16 +96,16 @@ ClientListEntry::~ClientListEntry()
|
|||||||
Camp(); // updates zoneserver's numplayers
|
Camp(); // updates zoneserver's numplayers
|
||||||
client_list.RemoveCLEReferances(this);
|
client_list.RemoveCLEReferances(this);
|
||||||
}
|
}
|
||||||
for (auto& elem : tell_queue) {
|
for (auto &elem: m_tell_queue) {
|
||||||
safe_delete_array(elem);
|
safe_delete_array(elem);
|
||||||
}
|
}
|
||||||
tell_queue.clear();
|
m_tell_queue.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClientListEntry::SetChar(uint32 iCharID, const char *iCharName)
|
void ClientListEntry::SetChar(uint32 iCharID, const char *iCharName)
|
||||||
{
|
{
|
||||||
pcharid = iCharID;
|
m_char_id = iCharID;
|
||||||
strn0cpy(pname, iCharName, sizeof(pname));
|
strn0cpy(m_char_name, iCharName, sizeof(m_char_name));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClientListEntry::SetOnline(CLE_Status iOnline)
|
void ClientListEntry::SetOnline(CLE_Status iOnline)
|
||||||
@ -142,20 +118,20 @@ void ClientListEntry::SetOnline(CLE_Status iOnline)
|
|||||||
static_cast<int>(iOnline)
|
static_cast<int>(iOnline)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (iOnline >= CLE_Status::Online && pOnline < CLE_Status::Online) {
|
if (iOnline >= CLE_Status::Online && m_online < CLE_Status::Online) {
|
||||||
numplayers++;
|
numplayers++;
|
||||||
}
|
}
|
||||||
else if (iOnline < CLE_Status::Online && pOnline >= CLE_Status::Online) {
|
else if (iOnline < CLE_Status::Online && m_online >= CLE_Status::Online) {
|
||||||
numplayers--;
|
numplayers--;
|
||||||
}
|
}
|
||||||
if (iOnline != CLE_Status::Online || pOnline < CLE_Status::Online) {
|
if (iOnline != CLE_Status::Online || m_online < CLE_Status::Online) {
|
||||||
pOnline = iOnline;
|
m_online = iOnline;
|
||||||
}
|
}
|
||||||
if (iOnline < CLE_Status::Zoning) {
|
if (iOnline < CLE_Status::Zoning) {
|
||||||
Camp();
|
Camp();
|
||||||
}
|
}
|
||||||
if (pOnline >= CLE_Status::Online) {
|
if (m_online >= CLE_Status::Online) {
|
||||||
stale = 0;
|
m_stale = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -193,49 +169,49 @@ void ClientListEntry::LSZoneChange(ZoneToZone_Struct *ztz)
|
|||||||
|
|
||||||
void ClientListEntry::Update(ZoneServer *iZS, ServerClientList_Struct *scl, CLE_Status iOnline)
|
void ClientListEntry::Update(ZoneServer *iZS, ServerClientList_Struct *scl, CLE_Status iOnline)
|
||||||
{
|
{
|
||||||
if (pzoneserver != iZS) {
|
if (m_zone_server != iZS) {
|
||||||
if (pzoneserver) {
|
if (m_zone_server) {
|
||||||
pzoneserver->RemovePlayer();
|
m_zone_server->RemovePlayer();
|
||||||
LSUpdate(pzoneserver);
|
LSUpdate(m_zone_server);
|
||||||
}
|
}
|
||||||
if (iZS) {
|
if (iZS) {
|
||||||
iZS->AddPlayer();
|
iZS->AddPlayer();
|
||||||
LSUpdate(iZS);
|
LSUpdate(iZS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pzoneserver = iZS;
|
m_zone_server = iZS;
|
||||||
pzone = scl->zone;
|
m_zone = scl->zone;
|
||||||
pinstance = scl->instance_id;
|
m_instance = scl->instance_id;
|
||||||
pcharid = scl->charid;
|
m_char_id = scl->charid;
|
||||||
|
|
||||||
strcpy(pname, scl->name);
|
strcpy(m_char_name, scl->name);
|
||||||
if (paccountid == 0) {
|
if (m_account_id == 0) {
|
||||||
paccountid = scl->AccountID;
|
m_account_id = scl->AccountID;
|
||||||
strcpy(paccountname, scl->AccountName);
|
strcpy(m_account_name, scl->AccountName);
|
||||||
strcpy(loginserver_account_name, scl->AccountName);
|
strcpy(m_login_account_name, scl->AccountName);
|
||||||
pIP = scl->IP;
|
m_ip_address = scl->IP;
|
||||||
pLSID = scl->LSAccountID;
|
m_login_server_id = scl->LSAccountID;
|
||||||
strn0cpy(plskey, scl->lskey, sizeof(plskey));
|
strn0cpy(m_key, scl->lskey, sizeof(m_key));
|
||||||
}
|
}
|
||||||
padmin = scl->Admin;
|
m_admin = scl->Admin;
|
||||||
plevel = scl->level;
|
m_level = scl->level;
|
||||||
pclass_ = scl->class_;
|
m_class_ = scl->class_;
|
||||||
prace = scl->race;
|
m_race = scl->race;
|
||||||
panon = scl->anon;
|
m_anon = scl->anon;
|
||||||
ptellsoff = scl->tellsoff;
|
m_tells_off = scl->tellsoff;
|
||||||
pguild_id = scl->guild_id;
|
m_guild_id = scl->guild_id;
|
||||||
pguild_rank = scl->guild_rank;
|
m_guild_rank = scl->guild_rank;
|
||||||
pguild_tribute_opt_in = scl->guild_tribute_opt_in;
|
m_guild_tribute_opt_in = scl->guild_tribute_opt_in;
|
||||||
pLFG = scl->LFG;
|
m_lfg = scl->LFG;
|
||||||
gm = scl->gm;
|
m_gm = scl->gm;
|
||||||
pClientVersion = scl->ClientVersion;
|
m_client_version = scl->ClientVersion;
|
||||||
|
|
||||||
// Fields from the LFG Window
|
// Fields from the LFG Window
|
||||||
if ((scl->LFGFromLevel != 0) && (scl->LFGToLevel != 0)) {
|
if ((scl->LFGFromLevel != 0) && (scl->LFGToLevel != 0)) {
|
||||||
pLFGFromLevel = scl->LFGFromLevel;
|
m_lfg_from_level = scl->LFGFromLevel;
|
||||||
pLFGToLevel = scl->LFGToLevel;
|
m_lfg_to_level = scl->LFGToLevel;
|
||||||
pLFGMatchFilter = scl->LFGMatchFilter;
|
m_lfg_match_filter = scl->LFGMatchFilter;
|
||||||
memcpy(pLFGComments, scl->LFGComments, sizeof(pLFGComments));
|
memcpy(m_lfg_comments, scl->LFGComments, sizeof(m_lfg_comments));
|
||||||
}
|
}
|
||||||
|
|
||||||
SetOnline(iOnline);
|
SetOnline(iOnline);
|
||||||
@ -243,76 +219,76 @@ void ClientListEntry::Update(ZoneServer *iZS, ServerClientList_Struct *scl, CLE_
|
|||||||
|
|
||||||
void ClientListEntry::LeavingZone(ZoneServer *iZS, CLE_Status iOnline)
|
void ClientListEntry::LeavingZone(ZoneServer *iZS, CLE_Status iOnline)
|
||||||
{
|
{
|
||||||
if (iZS != 0 && iZS != pzoneserver) {
|
if (iZS != 0 && iZS != m_zone_server) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
SetOnline(iOnline);
|
SetOnline(iOnline);
|
||||||
|
|
||||||
shared_task_manager.RemoveActiveInvitationByCharacterID(CharID());
|
shared_task_manager.RemoveActiveInvitationByCharacterID(CharID());
|
||||||
|
|
||||||
if (pzoneserver) {
|
if (m_zone_server) {
|
||||||
pzoneserver->RemovePlayer();
|
m_zone_server->RemovePlayer();
|
||||||
LSUpdate(pzoneserver);
|
LSUpdate(m_zone_server);
|
||||||
}
|
}
|
||||||
pzoneserver = 0;
|
m_zone_server = 0;
|
||||||
pzone = 0;
|
m_zone = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClientListEntry::ClearVars(bool iAll)
|
void ClientListEntry::ClearVars(bool iAll)
|
||||||
{
|
{
|
||||||
if (iAll) {
|
if (iAll) {
|
||||||
pOnline = CLE_Status::Never;
|
m_online = CLE_Status::Never;
|
||||||
stale = 0;
|
m_stale = 0;
|
||||||
|
|
||||||
pLSID = 0;
|
m_login_server_id = 0;
|
||||||
memset(loginserver_account_name, 0, sizeof(loginserver_account_name));
|
memset(m_login_account_name, 0, sizeof(m_login_account_name));
|
||||||
memset(plskey, 0, sizeof(plskey));
|
memset(m_key, 0, sizeof(m_key));
|
||||||
pworldadmin = 0;
|
m_world_admin = 0;
|
||||||
|
|
||||||
paccountid = 0;
|
m_account_id = 0;
|
||||||
memset(paccountname, 0, sizeof(paccountname));
|
memset(m_account_name, 0, sizeof(m_account_name));
|
||||||
padmin = AccountStatus::Player;
|
m_admin = AccountStatus::Player;
|
||||||
}
|
}
|
||||||
pzoneserver = 0;
|
m_zone_server = 0;
|
||||||
pzone = 0;
|
m_zone = 0;
|
||||||
pcharid = 0;
|
m_char_id = 0;
|
||||||
memset(pname, 0, sizeof(pname));
|
memset(m_char_name, 0, sizeof(m_char_name));
|
||||||
plevel = 0;
|
m_level = 0;
|
||||||
pclass_ = 0;
|
m_class_ = 0;
|
||||||
prace = 0;
|
m_race = 0;
|
||||||
panon = 0;
|
m_anon = 0;
|
||||||
ptellsoff = 0;
|
m_tells_off = 0;
|
||||||
pguild_id = GUILD_NONE;
|
m_guild_id = GUILD_NONE;
|
||||||
pguild_rank = 0;
|
m_guild_rank = 0;
|
||||||
pLFG = 0;
|
m_lfg = 0;
|
||||||
gm = 0;
|
m_gm = 0;
|
||||||
pClientVersion = 0;
|
m_client_version = 0;
|
||||||
for (auto& elem : tell_queue) {
|
for (auto &elem: m_tell_queue) {
|
||||||
safe_delete_array(elem);
|
safe_delete_array(elem);
|
||||||
}
|
}
|
||||||
tell_queue.clear();
|
m_tell_queue.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClientListEntry::Camp(ZoneServer *iZS)
|
void ClientListEntry::Camp(ZoneServer *iZS)
|
||||||
{
|
{
|
||||||
if (iZS != 0 && iZS != pzoneserver) {
|
if (iZS != 0 && iZS != m_zone_server) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (pzoneserver) {
|
if (m_zone_server) {
|
||||||
pzoneserver->RemovePlayer();
|
m_zone_server->RemovePlayer();
|
||||||
LSUpdate(pzoneserver);
|
LSUpdate(m_zone_server);
|
||||||
}
|
}
|
||||||
|
|
||||||
ClearVars();
|
ClearVars();
|
||||||
|
|
||||||
stale = 0;
|
m_stale = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ClientListEntry::CheckStale()
|
bool ClientListEntry::CheckStale()
|
||||||
{
|
{
|
||||||
stale++;
|
m_stale++;
|
||||||
if (stale > 20) {
|
if (m_stale > 20) {
|
||||||
if (pOnline > CLE_Status::Offline) {
|
if (m_online > CLE_Status::Offline) {
|
||||||
SetOnline(CLE_Status::Offline);
|
SetOnline(CLE_Status::Offline);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -324,48 +300,50 @@ bool ClientListEntry::CheckStale()
|
|||||||
bool ClientListEntry::CheckAuth(uint32 loginserver_account_id, const char *key_password)
|
bool ClientListEntry::CheckAuth(uint32 loginserver_account_id, const char *key_password)
|
||||||
{
|
{
|
||||||
LogDebug(
|
LogDebug(
|
||||||
"ls_account_id [{0}] key_password [{1}] plskey [{2}]",
|
"ls_account_id [{}] key_password [{}] key [{}]",
|
||||||
loginserver_account_id,
|
loginserver_account_id,
|
||||||
key_password,
|
key_password,
|
||||||
plskey
|
m_key
|
||||||
);
|
);
|
||||||
if (pLSID == loginserver_account_id && strncmp(plskey, key_password, 10) == 0) {
|
|
||||||
|
|
||||||
|
if (m_login_server_id == loginserver_account_id && strncmp(m_key, key_password, 10) == 0) {
|
||||||
LogDebug(
|
LogDebug(
|
||||||
"ls_account_id [{0}] key_password [{1}] plskey [{2}] lsid [{3}] paccountid [{4}]",
|
"ls_account_id [{}] key_password [{}] m_key [{}] lsid [{}] m_account_id [{}]",
|
||||||
loginserver_account_id,
|
loginserver_account_id,
|
||||||
key_password,
|
key_password,
|
||||||
plskey,
|
m_key,
|
||||||
LSID(),
|
LSID(),
|
||||||
paccountid
|
m_account_id
|
||||||
);
|
);
|
||||||
|
|
||||||
if (paccountid == 0 && LSID() > 0) {
|
// create account if it doesn't exist
|
||||||
|
if (m_account_id == 0 && LSID() > 0) {
|
||||||
int16 default_account_status = WorldConfig::get()->DefaultStatus;
|
int16 default_account_status = WorldConfig::get()->DefaultStatus;
|
||||||
|
|
||||||
paccountid = database.CreateAccount(
|
m_account_id = database.CreateAccount(
|
||||||
loginserver_account_name,
|
m_login_account_name,
|
||||||
std::string(),
|
std::string(),
|
||||||
default_account_status,
|
default_account_status,
|
||||||
source_loginserver,
|
m_source_loginserver,
|
||||||
LSID()
|
LSID()
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!paccountid) {
|
if (!m_account_id) {
|
||||||
LogInfo(
|
LogError(
|
||||||
"Error adding local account for LS login: [{0}:{1}], duplicate name",
|
"Error adding local account for LS login [{}] [{}], duplicate name",
|
||||||
source_loginserver,
|
m_source_loginserver,
|
||||||
loginserver_account_name
|
m_login_account_name
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
strn0cpy(paccountname, loginserver_account_name, sizeof(paccountname));
|
strn0cpy(m_account_name, m_login_account_name, sizeof(m_account_name));
|
||||||
padmin = default_account_status;
|
m_admin = default_account_status;
|
||||||
}
|
}
|
||||||
std::string lsworldadmin;
|
std::string lsworldadmin;
|
||||||
if (database.GetVariable("honorlsworldadmin", lsworldadmin)) {
|
if (database.GetVariable("honorlsworldadmin", lsworldadmin)) {
|
||||||
if (Strings::ToInt(lsworldadmin) == 1 && pworldadmin != 0 && (padmin < pworldadmin || padmin == AccountStatus::Player)) {
|
if (Strings::ToInt(lsworldadmin) == 1 && m_world_admin != 0 &&
|
||||||
padmin = pworldadmin;
|
(m_admin < m_world_admin || m_admin == AccountStatus::Player)) {
|
||||||
|
m_admin = m_world_admin;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -380,8 +358,8 @@ void ClientListEntry::ProcessTellQueue()
|
|||||||
}
|
}
|
||||||
|
|
||||||
ServerPacket *pack;
|
ServerPacket *pack;
|
||||||
auto it = tell_queue.begin();
|
auto it = m_tell_queue.begin();
|
||||||
while (it != tell_queue.end()) {
|
while (it != m_tell_queue.end()) {
|
||||||
pack = new ServerPacket(
|
pack = new ServerPacket(
|
||||||
ServerOP_ChannelMessage,
|
ServerOP_ChannelMessage,
|
||||||
sizeof(ServerChannelMessage_Struct) + strlen((*it)->message) + 1
|
sizeof(ServerChannelMessage_Struct) + strlen((*it)->message) + 1
|
||||||
@ -390,8 +368,7 @@ void ClientListEntry::ProcessTellQueue()
|
|||||||
Server()->SendPacket(pack);
|
Server()->SendPacket(pack);
|
||||||
safe_delete(pack);
|
safe_delete(pack);
|
||||||
safe_delete_array(*it);
|
safe_delete_array(*it);
|
||||||
it = tell_queue.erase(it);
|
it = m_tell_queue.erase(it);
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -8,8 +8,7 @@
|
|||||||
#include "../common/rulesys.h"
|
#include "../common/rulesys.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
Never,
|
Never,
|
||||||
Offline,
|
Offline,
|
||||||
Online,
|
Online,
|
||||||
@ -18,7 +17,7 @@ typedef enum
|
|||||||
InZone
|
InZone
|
||||||
} CLE_Status;
|
} CLE_Status;
|
||||||
|
|
||||||
static const char * CLEStatusString[] = {
|
static const char *CLEStatusString[] = {
|
||||||
"Never",
|
"Never",
|
||||||
"Offline",
|
"Offline",
|
||||||
"Online",
|
"Online",
|
||||||
@ -33,148 +32,131 @@ struct ServerClientList_Struct;
|
|||||||
class ClientListEntry {
|
class ClientListEntry {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/**
|
|
||||||
* @param id
|
|
||||||
* @param in_loginserver_id
|
|
||||||
* @param in_loginserver_name
|
|
||||||
* @param in_login_name
|
|
||||||
* @param in_login_key
|
|
||||||
* @param in_is_world_admin
|
|
||||||
* @param ip
|
|
||||||
* @param local
|
|
||||||
*/
|
|
||||||
ClientListEntry(
|
ClientListEntry(
|
||||||
uint32 id,
|
uint32 id,
|
||||||
uint32 in_loginserver_id,
|
uint32 login_server_id,
|
||||||
const char *in_loginserver_name,
|
const char *login_server_name,
|
||||||
const char *in_login_name,
|
const char *account_name,
|
||||||
const char *in_login_key,
|
const char *login_key,
|
||||||
int16 in_is_world_admin = 0,
|
int16 is_world_admin = 0,
|
||||||
uint32 ip = 0,
|
uint32 ip_address = 0,
|
||||||
uint8 local = 0
|
uint8 local = 0
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
ClientListEntry(uint32 id, ZoneServer *z, ServerClientList_Struct *scl, CLE_Status online);
|
||||||
* @param id
|
|
||||||
* @param iZS
|
|
||||||
* @param scl
|
|
||||||
* @param iOnline
|
|
||||||
*/
|
|
||||||
ClientListEntry(uint32 id, uint32 iAccID, const char* iAccName, MD5& iMD5Pass, int16 iAdmin = AccountStatus::Player);
|
|
||||||
ClientListEntry(uint32 id, ZoneServer* iZS, ServerClientList_Struct* scl, CLE_Status iOnline);
|
|
||||||
~ClientListEntry();
|
~ClientListEntry();
|
||||||
bool CheckStale();
|
bool CheckStale();
|
||||||
void Update(ZoneServer* zoneserver, ServerClientList_Struct* scl, CLE_Status iOnline = CLE_Status::InZone);
|
void Update(ZoneServer *zoneserver, ServerClientList_Struct *scl, CLE_Status iOnline = CLE_Status::InZone);
|
||||||
void LSUpdate(ZoneServer* zoneserver);
|
void LSUpdate(ZoneServer *zoneserver);
|
||||||
void LSZoneChange(ZoneToZone_Struct* ztz);
|
void LSZoneChange(ZoneToZone_Struct *ztz);
|
||||||
bool CheckAuth(uint32 loginserver_account_id, const char* key_password);
|
bool CheckAuth(uint32 loginserver_account_id, const char *key_password);
|
||||||
void SetOnline(CLE_Status iOnline = CLE_Status::Online);
|
void SetOnline(CLE_Status iOnline = CLE_Status::Online);
|
||||||
void SetChar(uint32 iCharID, const char* iCharName);
|
void SetChar(uint32 iCharID, const char *iCharName);
|
||||||
inline CLE_Status Online() { return pOnline; }
|
inline CLE_Status Online() { return m_online; }
|
||||||
inline const uint32 GetID() const { return id; }
|
inline const uint32 GetID() const { return m_id; }
|
||||||
inline const uint32 GetIP() const { return pIP; }
|
inline const uint32 GetIP() const { return m_ip_address; }
|
||||||
inline void SetIP(const uint32& iIP) { pIP = iIP; }
|
inline void SetIP(const uint32 &iIP) { m_ip_address = iIP; }
|
||||||
inline void KeepAlive() { stale = 0; }
|
inline void KeepAlive() { m_stale = 0; }
|
||||||
inline uint8 GetStaleCounter() const { return stale; }
|
inline uint8 GetStaleCounter() const { return m_stale; }
|
||||||
void LeavingZone(ZoneServer* iZS = 0, CLE_Status iOnline = CLE_Status::Offline);
|
void LeavingZone(ZoneServer *iZS = 0, CLE_Status iOnline = CLE_Status::Offline);
|
||||||
void Camp(ZoneServer* iZS = 0);
|
void Camp(ZoneServer *iZS = 0);
|
||||||
|
|
||||||
// Login Server stuff
|
// Login Server stuff
|
||||||
inline const char* LoginServer() const { return source_loginserver; }
|
inline const char *LoginServer() const { return m_source_loginserver; }
|
||||||
inline uint32 LSID() const { return pLSID; }
|
inline uint32 LSID() const { return m_login_server_id; }
|
||||||
inline uint32 LSAccountID() const { return pLSID; }
|
inline uint32 LSAccountID() const { return m_login_server_id; }
|
||||||
inline const char* LSName() const { return loginserver_account_name; }
|
inline const char *LSName() const { return m_login_account_name; }
|
||||||
inline int16 WorldAdmin() const { return pworldadmin; }
|
inline int16 WorldAdmin() const { return m_world_admin; }
|
||||||
inline const char* GetLSKey() const { return plskey; }
|
inline const char *GetLSKey() const { return m_key; }
|
||||||
inline const CLE_Status GetOnline() const { return pOnline; }
|
inline const CLE_Status GetOnline() const { return m_online; }
|
||||||
|
|
||||||
// Account stuff
|
// Account stuff
|
||||||
inline uint32 AccountID() const { return paccountid; }
|
inline uint32 AccountID() const { return m_account_id; }
|
||||||
inline const char* AccountName() const { return paccountname; }
|
inline const char *AccountName() const { return m_account_name; }
|
||||||
inline int16 Admin() const { return padmin; }
|
inline int16 Admin() const { return m_admin; }
|
||||||
inline void SetAdmin(uint16 iAdmin) { padmin = iAdmin; }
|
inline void SetAdmin(uint16 iAdmin) { m_admin = iAdmin; }
|
||||||
|
|
||||||
// Character info
|
// Character info
|
||||||
inline ZoneServer *Server() const { return pzoneserver; }
|
inline ZoneServer *Server() const { return m_zone_server; }
|
||||||
inline void ClearServer() { pzoneserver = 0; }
|
inline void ClearServer() { m_zone_server = 0; }
|
||||||
inline uint32 CharID() const { return pcharid; }
|
inline uint32 CharID() const { return m_char_id; }
|
||||||
inline const char *name() const { return pname; }
|
inline const char *name() const { return m_char_name; }
|
||||||
inline uint32 zone() const { return pzone; }
|
inline uint32 zone() const { return m_zone; }
|
||||||
inline uint16 instance() const { return pinstance; }
|
inline uint16 instance() const { return m_instance; }
|
||||||
inline uint8 level() const { return plevel; }
|
inline uint8 level() const { return m_level; }
|
||||||
inline uint8 class_() const { return pclass_; }
|
inline uint8 class_() const { return m_class_; }
|
||||||
inline uint16 race() const { return prace; }
|
inline uint16 race() const { return m_race; }
|
||||||
inline uint8 Anon() { return panon; }
|
inline uint8 Anon() { return m_anon; }
|
||||||
inline uint8 TellsOff() const { return ptellsoff; }
|
inline uint8 TellsOff() const { return m_tells_off; }
|
||||||
inline uint32 GuildID() const { return pguild_id; }
|
inline uint32 GuildID() const { return m_guild_id; }
|
||||||
inline uint32 GuildRank() const { return pguild_rank; }
|
inline uint32 GuildRank() const { return m_guild_rank; }
|
||||||
inline bool GuildTributeOptIn() const { return pguild_tribute_opt_in; }
|
inline bool GuildTributeOptIn() const { return m_guild_tribute_opt_in; }
|
||||||
inline void SetGuild(uint32 guild_id) { pguild_id = guild_id; }
|
inline void SetGuild(uint32 guild_id) { m_guild_id = guild_id; }
|
||||||
inline void SetGuildTributeOptIn(bool opt) { pguild_tribute_opt_in = opt; }
|
inline void SetGuildTributeOptIn(bool opt) { m_guild_tribute_opt_in = opt; }
|
||||||
inline bool LFG() const { return pLFG; }
|
inline bool LFG() const { return m_lfg; }
|
||||||
inline uint8 GetGM() const { return gm; }
|
inline uint8 GetGM() const { return m_gm; }
|
||||||
inline void SetGM(uint8 igm) { gm = igm; }
|
inline void SetGM(uint8 igm) { m_gm = igm; }
|
||||||
inline void SetZone(uint32 zone) { pzone = zone; }
|
inline void SetZone(uint32 zone) { m_zone = zone; }
|
||||||
inline bool IsLocalClient() const { return plocal; }
|
inline bool IsLocalClient() const { return m_is_local; }
|
||||||
inline uint8 GetLFGFromLevel() const { return pLFGFromLevel; }
|
inline uint8 GetLFGFromLevel() const { return m_lfg_from_level; }
|
||||||
inline uint8 GetLFGToLevel() const { return pLFGToLevel; }
|
inline uint8 GetLFGToLevel() const { return m_lfg_to_level; }
|
||||||
inline bool GetLFGMatchFilter() const { return pLFGMatchFilter; }
|
inline bool GetLFGMatchFilter() const { return m_lfg_match_filter; }
|
||||||
inline const char *GetLFGComments() const { return pLFGComments; }
|
inline const char *GetLFGComments() const { return m_lfg_comments; }
|
||||||
inline uint8 GetClientVersion() { return pClientVersion; }
|
inline uint8 GetClientVersion() { return m_client_version; }
|
||||||
|
|
||||||
inline bool TellQueueFull() const { return tell_queue.size() >= RuleI(World, TellQueueSize); }
|
inline bool TellQueueFull() const { return m_tell_queue.size() >= RuleI(World, TellQueueSize); }
|
||||||
inline bool TellQueueEmpty() const { return tell_queue.empty(); }
|
inline bool TellQueueEmpty() const { return m_tell_queue.empty(); }
|
||||||
inline void PushToTellQueue(ServerChannelMessage_Struct *scm) { tell_queue.push_back(scm); }
|
inline void PushToTellQueue(ServerChannelMessage_Struct *scm) { m_tell_queue.push_back(scm); }
|
||||||
void ProcessTellQueue();
|
void ProcessTellQueue();
|
||||||
|
|
||||||
void SetPendingDzInvite(ServerPacket* pack) { m_dz_invite.reset(pack->Copy()); };
|
void SetPendingDzInvite(ServerPacket *pack) { m_dz_invite.reset(pack->Copy()); };
|
||||||
std::unique_ptr<ServerPacket> GetPendingDzInvite() { return std::move(m_dz_invite); }
|
std::unique_ptr<ServerPacket> GetPendingDzInvite() { return std::move(m_dz_invite); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void ClearVars(bool iAll = false);
|
void ClearVars(bool iAll = false);
|
||||||
|
|
||||||
const uint32 id;
|
const uint32 m_id;
|
||||||
uint32 pIP;
|
uint32 m_ip_address;
|
||||||
CLE_Status pOnline;
|
CLE_Status m_online;
|
||||||
uint8 stale;
|
uint8 m_stale;
|
||||||
|
|
||||||
// Login Server stuff
|
// Login Server stuff
|
||||||
char source_loginserver[64]{}; //Loginserver we came from.
|
char m_source_loginserver[64]{}; //Loginserver we came from.
|
||||||
uint32 pLSID;
|
uint32 m_login_server_id;
|
||||||
char loginserver_account_name[32]{};
|
char m_login_account_name[32]{};
|
||||||
char plskey[16]{};
|
char m_key[16]{};
|
||||||
int16 pworldadmin; // Login server's suggested admin status setting
|
int16 m_world_admin; // Login server's suggested admin status setting
|
||||||
bool plocal;
|
bool m_is_local;
|
||||||
|
|
||||||
// Account stuff
|
// Account stuff
|
||||||
uint32 paccountid;
|
uint32 m_account_id;
|
||||||
char paccountname[32]{};
|
char m_account_name[32]{};
|
||||||
int16 padmin{};
|
int16 m_admin{};
|
||||||
|
|
||||||
// Character info
|
// Character info
|
||||||
ZoneServer* pzoneserver{};
|
ZoneServer *m_zone_server{};
|
||||||
uint32 pzone{};
|
uint32 m_zone{};
|
||||||
uint16 pinstance{};
|
uint16 m_instance{};
|
||||||
uint32 pcharid{};
|
uint32 m_char_id{};
|
||||||
char pname[64]{};
|
char m_char_name[64]{};
|
||||||
uint8 plevel{};
|
uint8 m_level{};
|
||||||
uint8 pclass_{};
|
uint8 m_class_{};
|
||||||
uint16 prace{};
|
uint16 m_race{};
|
||||||
uint8 panon{};
|
uint8 m_anon{};
|
||||||
uint8 ptellsoff{};
|
uint8 m_tells_off{};
|
||||||
uint32 pguild_id{};
|
uint32 m_guild_id{};
|
||||||
uint32 pguild_rank;
|
uint32 m_guild_rank;
|
||||||
bool pguild_tribute_opt_in{};
|
bool m_guild_tribute_opt_in{};
|
||||||
bool pLFG{};
|
bool m_lfg{};
|
||||||
uint8 gm{};
|
uint8 m_gm{};
|
||||||
uint8 pClientVersion{};
|
uint8 m_client_version{};
|
||||||
uint8 pLFGFromLevel{};
|
uint8 m_lfg_from_level{};
|
||||||
uint8 pLFGToLevel{};
|
uint8 m_lfg_to_level{};
|
||||||
bool pLFGMatchFilter{};
|
bool m_lfg_match_filter{};
|
||||||
char pLFGComments[64]{};
|
char m_lfg_comments[64]{};
|
||||||
|
|
||||||
// Tell Queue -- really a vector :D
|
// Tell Queue -- really a vector :D
|
||||||
std::vector<ServerChannelMessage_Struct *> tell_queue;
|
std::vector<ServerChannelMessage_Struct *> m_tell_queue;
|
||||||
|
|
||||||
std::unique_ptr<ServerPacket> m_dz_invite;
|
std::unique_ptr<ServerPacket> m_dz_invite;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -331,8 +331,26 @@ void ClientList::SendCLEList(const int16& admin, const char* to, WorldTCPConnect
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ClientList::CLEAdd(uint32 iLSID, const char *iLoginServerName, const char* iLoginName, const char* iLoginKey, int16 iWorldAdmin, uint32 ip, uint8 local) {
|
void ClientList::CLEAdd(
|
||||||
auto tmp = new ClientListEntry(GetNextCLEID(), iLSID, iLoginServerName, iLoginName, iLoginKey, iWorldAdmin, ip, local);
|
uint32 login_server_id,
|
||||||
|
const char *login_server_name,
|
||||||
|
const char *login_name,
|
||||||
|
const char *login_key,
|
||||||
|
int16 world_admin,
|
||||||
|
uint32 ip_address,
|
||||||
|
uint8 is_local
|
||||||
|
)
|
||||||
|
{
|
||||||
|
auto tmp = new ClientListEntry(
|
||||||
|
GetNextCLEID(),
|
||||||
|
login_server_id,
|
||||||
|
login_server_name,
|
||||||
|
login_name,
|
||||||
|
login_key,
|
||||||
|
world_admin,
|
||||||
|
ip_address,
|
||||||
|
is_local
|
||||||
|
);
|
||||||
|
|
||||||
clientlist.Append(tmp);
|
clientlist.Append(tmp);
|
||||||
}
|
}
|
||||||
@ -457,19 +475,19 @@ void ClientList::CLEKeepAlive(uint32 numupdates, uint32* wid) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ClientListEntry *ClientList::CheckAuth(uint32 iLSID, const char *iKey)
|
ClientListEntry *ClientList::CheckAuth(uint32 loginserver_account_id, const char *key)
|
||||||
{
|
{
|
||||||
LinkedListIterator<ClientListEntry *> iterator(clientlist);
|
LinkedListIterator<ClientListEntry *> iterator(clientlist);
|
||||||
|
|
||||||
iterator.Reset();
|
iterator.Reset();
|
||||||
while (iterator.MoreElements()) {
|
while (iterator.MoreElements()) {
|
||||||
if (iterator.GetData()->CheckAuth(iLSID, iKey)) {
|
if (iterator.GetData()->CheckAuth(loginserver_account_id, key)) {
|
||||||
return iterator.GetData();
|
return iterator.GetData();
|
||||||
}
|
}
|
||||||
iterator.Advance();
|
iterator.Advance();
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClientList::SendOnlineGuildMembers(uint32 FromID, uint32 GuildID)
|
void ClientList::SendOnlineGuildMembers(uint32 FromID, uint32 GuildID)
|
||||||
|
|||||||
@ -51,7 +51,7 @@ public:
|
|||||||
|
|
||||||
void ClientUpdate(ZoneServer* zoneserver, ServerClientList_Struct* scl);
|
void ClientUpdate(ZoneServer* zoneserver, ServerClientList_Struct* scl);
|
||||||
void CLERemoveZSRef(ZoneServer* iZS);
|
void CLERemoveZSRef(ZoneServer* iZS);
|
||||||
ClientListEntry* CheckAuth(uint32 iLSID, const char* iKey);
|
ClientListEntry* CheckAuth(uint32 loginserver_account_id, const char* key);
|
||||||
ClientListEntry* FindCharacter(const char* name);
|
ClientListEntry* FindCharacter(const char* name);
|
||||||
ClientListEntry* FindCLEByAccountID(uint32 iAccID);
|
ClientListEntry* FindCLEByAccountID(uint32 iAccID);
|
||||||
ClientListEntry* FindCLEByCharacterID(uint32 iCharID);
|
ClientListEntry* FindCLEByCharacterID(uint32 iCharID);
|
||||||
@ -59,7 +59,7 @@ public:
|
|||||||
void DisconnectByIP(uint32 in_ip);
|
void DisconnectByIP(uint32 in_ip);
|
||||||
void CLCheckStale();
|
void CLCheckStale();
|
||||||
void CLEKeepAlive(uint32 numupdates, uint32* wid);
|
void CLEKeepAlive(uint32 numupdates, uint32* wid);
|
||||||
void CLEAdd(uint32 iLSID, const char* iLoginServerName, const char* iLoginName, const char* iLoginKey, int16 iWorldAdmin = AccountStatus::Player, uint32 ip = 0, uint8 local=0);
|
void CLEAdd(uint32 login_server_id, const char* login_server_name, const char* login_name, const char* login_key, int16 world_admin = AccountStatus::Player, uint32 ip_address = 0, uint8 is_local=0);
|
||||||
void UpdateClientGuild(uint32 char_id, uint32 guild_id);
|
void UpdateClientGuild(uint32 char_id, uint32 guild_id);
|
||||||
bool IsAccountInGame(uint32 iLSID);
|
bool IsAccountInGame(uint32 iLSID);
|
||||||
|
|
||||||
|
|||||||
@ -46,8 +46,8 @@ void LoginServer::ProcessUsertoWorldReqLeg(uint16_t opcode, EQ::Net::Packet &p)
|
|||||||
const WorldConfig *Config = WorldConfig::get();
|
const WorldConfig *Config = WorldConfig::get();
|
||||||
LogNetcode("Received ServerPacket from LS OpCode {:#04x}", opcode);
|
LogNetcode("Received ServerPacket from LS OpCode {:#04x}", opcode);
|
||||||
|
|
||||||
UsertoWorldRequestLegacy_Struct *utwr = (UsertoWorldRequestLegacy_Struct *) p.Data();
|
UsertoWorldRequestLegacy *utwr = (UsertoWorldRequestLegacy *) p.Data();
|
||||||
uint32 id = database.GetAccountIDFromLSID("eqemu", utwr->lsaccountid);
|
uint32 id = database.GetAccountIDFromLSID("eqemu", utwr->lsaccountid);
|
||||||
int16 status = database.GetAccountStatus(id);
|
int16 status = database.GetAccountStatus(id);
|
||||||
|
|
||||||
LogDebug(
|
LogDebug(
|
||||||
@ -63,11 +63,11 @@ void LoginServer::ProcessUsertoWorldReqLeg(uint16_t opcode, EQ::Net::Packet &p)
|
|||||||
|
|
||||||
ServerPacket outpack;
|
ServerPacket outpack;
|
||||||
outpack.opcode = ServerOP_UsertoWorldRespLeg;
|
outpack.opcode = ServerOP_UsertoWorldRespLeg;
|
||||||
outpack.size = sizeof(UsertoWorldResponseLegacy_Struct);
|
outpack.size = sizeof(UsertoWorldResponseLegacy);
|
||||||
outpack.pBuffer = new uchar[outpack.size];
|
outpack.pBuffer = new uchar[outpack.size];
|
||||||
memset(outpack.pBuffer, 0, outpack.size);
|
memset(outpack.pBuffer, 0, outpack.size);
|
||||||
|
|
||||||
UsertoWorldResponseLegacy_Struct *utwrs = (UsertoWorldResponseLegacy_Struct *) outpack.pBuffer;
|
UsertoWorldResponseLegacy *utwrs = (UsertoWorldResponseLegacy *) outpack.pBuffer;
|
||||||
utwrs->lsaccountid = utwr->lsaccountid;
|
utwrs->lsaccountid = utwr->lsaccountid;
|
||||||
utwrs->ToID = utwr->FromID;
|
utwrs->ToID = utwr->FromID;
|
||||||
utwrs->worldid = utwr->worldid;
|
utwrs->worldid = utwr->worldid;
|
||||||
@ -126,8 +126,8 @@ void LoginServer::ProcessUsertoWorldReq(uint16_t opcode, EQ::Net::Packet &p)
|
|||||||
const WorldConfig *Config = WorldConfig::get();
|
const WorldConfig *Config = WorldConfig::get();
|
||||||
LogNetcode("Received ServerPacket from LS OpCode {:#04x}", opcode);
|
LogNetcode("Received ServerPacket from LS OpCode {:#04x}", opcode);
|
||||||
|
|
||||||
UsertoWorldRequest_Struct *utwr = (UsertoWorldRequest_Struct *) p.Data();
|
UsertoWorldRequest *utwr = (UsertoWorldRequest *) p.Data();
|
||||||
uint32 id = database.GetAccountIDFromLSID(utwr->login, utwr->lsaccountid);
|
uint32 id = database.GetAccountIDFromLSID(utwr->login, utwr->lsaccountid);
|
||||||
int16 status = database.GetAccountStatus(id);
|
int16 status = database.GetAccountStatus(id);
|
||||||
|
|
||||||
LogDebug(
|
LogDebug(
|
||||||
@ -143,11 +143,11 @@ void LoginServer::ProcessUsertoWorldReq(uint16_t opcode, EQ::Net::Packet &p)
|
|||||||
|
|
||||||
ServerPacket outpack;
|
ServerPacket outpack;
|
||||||
outpack.opcode = ServerOP_UsertoWorldResp;
|
outpack.opcode = ServerOP_UsertoWorldResp;
|
||||||
outpack.size = sizeof(UsertoWorldResponse_Struct);
|
outpack.size = sizeof(UsertoWorldResponse);
|
||||||
outpack.pBuffer = new uchar[outpack.size];
|
outpack.pBuffer = new uchar[outpack.size];
|
||||||
memset(outpack.pBuffer, 0, outpack.size);
|
memset(outpack.pBuffer, 0, outpack.size);
|
||||||
|
|
||||||
UsertoWorldResponse_Struct *utwrs = (UsertoWorldResponse_Struct *) outpack.pBuffer;
|
UsertoWorldResponse *utwrs = (UsertoWorldResponse *) outpack.pBuffer;
|
||||||
utwrs->lsaccountid = utwr->lsaccountid;
|
utwrs->lsaccountid = utwr->lsaccountid;
|
||||||
utwrs->ToID = utwr->FromID;
|
utwrs->ToID = utwr->FromID;
|
||||||
strn0cpy(utwrs->login, utwr->login, 64);
|
strn0cpy(utwrs->login, utwr->login, 64);
|
||||||
@ -208,27 +208,27 @@ void LoginServer::ProcessLSClientAuthLegacy(uint16_t opcode, EQ::Net::Packet &p)
|
|||||||
LogNetcode("Received ServerPacket from LS OpCode {:#04x}", opcode);
|
LogNetcode("Received ServerPacket from LS OpCode {:#04x}", opcode);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
auto client_authentication_request = p.GetSerialize<ClientAuthLegacy_Struct>(0);
|
auto r = p.GetSerialize<ClientAuthLegacy>(0);
|
||||||
|
|
||||||
LogDebug(
|
LogDebug(
|
||||||
"Processing Loginserver Auth Legacy | account_id [{0}] account_name [{1}] key [{2}] admin [{3}] ip [{4}] "
|
"Processing Loginserver Auth Legacy | account_id [{}] account_name [{}] key [{}] admin [{}] ip [{}] "
|
||||||
"local_network [{5}]",
|
"local_network [{}]",
|
||||||
client_authentication_request.loginserver_account_id,
|
r.loginserver_account_id,
|
||||||
client_authentication_request.loginserver_account_name,
|
r.loginserver_account_name,
|
||||||
client_authentication_request.key,
|
r.key,
|
||||||
client_authentication_request.is_world_admin,
|
r.is_world_admin,
|
||||||
client_authentication_request.ip,
|
r.ip_address,
|
||||||
client_authentication_request.is_client_from_local_network
|
r.is_client_from_local_network
|
||||||
);
|
);
|
||||||
|
|
||||||
client_list.CLEAdd(
|
client_list.CLEAdd(
|
||||||
client_authentication_request.loginserver_account_id,
|
r.loginserver_account_id,
|
||||||
"eqemu",
|
"eqemu",
|
||||||
client_authentication_request.loginserver_account_name,
|
r.loginserver_account_name,
|
||||||
client_authentication_request.key,
|
r.key,
|
||||||
client_authentication_request.is_world_admin,
|
r.is_world_admin,
|
||||||
client_authentication_request.ip,
|
r.ip_address,
|
||||||
client_authentication_request.is_client_from_local_network
|
r.is_client_from_local_network
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
catch (std::exception &ex) {
|
catch (std::exception &ex) {
|
||||||
@ -242,28 +242,28 @@ void LoginServer::ProcessLSClientAuth(uint16_t opcode, EQ::Net::Packet &p)
|
|||||||
LogNetcode("Received ServerPacket from LS OpCode {:#04x}", opcode);
|
LogNetcode("Received ServerPacket from LS OpCode {:#04x}", opcode);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
auto client_authentication_request = p.GetSerialize<ClientAuth_Struct>(0);
|
auto r = p.GetSerialize<ClientAuth>(0);
|
||||||
|
|
||||||
LogDebug(
|
LogDebug(
|
||||||
"Processing Loginserver Auth | account_id [{0}] account_name [{1}] loginserver_name [{2}] key [{3}] "
|
"Processing Loginserver Auth | account_id [{}] account_name [{}] loginserver_name [{}] key [{}] "
|
||||||
"admin [{4}] ip [{5}] local_network [{6}]",
|
"admin [{}] ip [{}] local_network [{}]",
|
||||||
client_authentication_request.loginserver_account_id,
|
r.loginserver_account_id,
|
||||||
client_authentication_request.account_name,
|
r.account_name,
|
||||||
client_authentication_request.loginserver_name,
|
r.loginserver_name,
|
||||||
client_authentication_request.key,
|
r.key,
|
||||||
client_authentication_request.is_world_admin,
|
r.is_world_admin,
|
||||||
client_authentication_request.ip,
|
r.ip_address,
|
||||||
client_authentication_request.is_client_from_local_network
|
r.is_client_from_local_network
|
||||||
);
|
);
|
||||||
|
|
||||||
client_list.CLEAdd(
|
client_list.CLEAdd(
|
||||||
client_authentication_request.loginserver_account_id,
|
r.loginserver_account_id,
|
||||||
client_authentication_request.loginserver_name,
|
r.loginserver_name,
|
||||||
client_authentication_request.account_name,
|
r.account_name,
|
||||||
client_authentication_request.key,
|
r.key,
|
||||||
client_authentication_request.is_world_admin,
|
r.is_world_admin,
|
||||||
client_authentication_request.ip,
|
r.ip_address,
|
||||||
client_authentication_request.is_client_from_local_network
|
r.is_client_from_local_network
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
catch (std::exception &ex) {
|
catch (std::exception &ex) {
|
||||||
|
|||||||
@ -35,12 +35,6 @@ WorldDatabase content_db;
|
|||||||
extern std::vector<RaceClassAllocation> character_create_allocations;
|
extern std::vector<RaceClassAllocation> character_create_allocations;
|
||||||
extern std::vector<RaceClassCombos> character_create_race_class_combos;
|
extern std::vector<RaceClassCombos> character_create_race_class_combos;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param account_id
|
|
||||||
* @param out_app
|
|
||||||
* @param client_version_bit
|
|
||||||
*/
|
|
||||||
void WorldDatabase::GetCharSelectInfo(uint32 account_id, EQApplicationPacket **out_app, uint32 client_version_bit)
|
void WorldDatabase::GetCharSelectInfo(uint32 account_id, EQApplicationPacket **out_app, uint32 client_version_bit)
|
||||||
{
|
{
|
||||||
EQ::versions::ClientVersion
|
EQ::versions::ClientVersion
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user