[Code Cleanup] More login <-> world code cleanup (#4724)

* More cleanup

* More cleanup
This commit is contained in:
Chris Miles
2025-02-28 16:08:06 -06:00
committed by GitHub
parent cb634cf57d
commit eb6ac25540
13 changed files with 412 additions and 424 deletions
+1 -1
View File
@@ -245,7 +245,7 @@ uint32 Database::CreateAccount(
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);
+1 -1
View File
@@ -47,7 +47,7 @@ static const uint32 ADVANCED_LORE_LENGTH = 8192;
*/
#pragma pack(1)
struct LoginInfo_Struct {
struct LoginInfo {
/*000*/ char login_info[64];
/*064*/ uint8 unknown064[124];
/*188*/ uint8 zoning; // 01 if zoning, 00 if not
+3 -3
View File
@@ -25,7 +25,7 @@ void EQ::Net::ServertalkServerConnection::Send(uint16_t opcode, EQ::Net::Packet
return;
if (opcode == ServerOP_UsertoWorldReq) {
auto req_in = (UsertoWorldRequest_Struct*)p.Data();
auto req_in = (UsertoWorldRequest*)p.Data();
EQ::Net::DynamicPacket req;
size_t i = 0;
@@ -45,7 +45,7 @@ void EQ::Net::ServertalkServerConnection::Send(uint16_t opcode, EQ::Net::Packet
}
if (opcode == ServerOP_LSClientAuth) {
auto req_in = (ClientAuth_Struct*)p.Data();
auto req_in = (ClientAuth*)p.Data();
EQ::Net::DynamicPacket req;
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.PutUInt8(i, req_in->lsadmin); i += 1;
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;
EQ::Net::DynamicPacket out;
+60 -43
View File
@@ -677,36 +677,53 @@ struct ServerLSPlayerZoneChange_Struct {
uint32 to; // 0 = world
};
struct ClientAuth_Struct {
struct ClientAuth {
uint32 loginserver_account_id; // ID# in login server's db
char loginserver_name[64];
char account_name[30]; // username in login server's db
char key[30]; // the Key the client will present
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
uint32 ip;
uint8 is_client_from_local_network; // 1 if the client is from the local network
char loginserver_name[64];
char account_name[30]; // username in login server's db
char key[30]; // the key the client will present
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
uint32 ip_address;
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)
{
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
char loginserver_account_name[30]; // username in login server's db
char key[30]; // the Key the client will present
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
uint32 ip;
uint8 is_client_from_local_network; // 1 if the client is from the local network
char loginserver_account_name[30]; // username in login server's db
char key[30]; // the key the client will present
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
uint32 ip_address;
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)
{
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;
};
struct UsertoWorldRequestLegacy_Struct {
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 {
struct UsertoWorldRequestLegacy {
uint32 lsaccountid;
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 ToID;
};
struct UsertoWorldResponse_Struct {
struct UsertoWorldResponse {
uint32 lsaccountid;
uint32 worldid;
int8 response; // -3) World Full, -2) Banned, -1) Suspended, 0) Denied, 1) Allowed
uint32 FromID;
uint32 ToID;
char login[64];
int8 response; // -3) World Full, -2) Banned, -1) Suspended, 0) Denied, 1) Allowed
uint32 FromID; // appears to be unused today
uint32 ToID; // appears to be unused today
char login[64];
};
// generic struct to be used for alot of simple zone->world questions