mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-18 15:31:33 +00:00
Adust ProcessUsertoWorldReq reponse codes
This commit is contained in:
parent
7c2ee06355
commit
e92d130538
@ -70,7 +70,7 @@ void LoginServer::ProcessUsertoWorldReqLeg(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(UsertoWorldResponseLegacy_Struct);
|
||||||
outpack.pBuffer = new uchar[outpack.size];
|
outpack.pBuffer = new uchar[outpack.size];
|
||||||
memset(outpack.pBuffer, 0, outpack.size);
|
memset(outpack.pBuffer, 0, outpack.size);
|
||||||
|
|
||||||
@ -132,13 +132,13 @@ void LoginServer::ProcessUsertoWorldReq(uint16_t opcode, EQ::Net::Packet &p)
|
|||||||
uint32 id = database.GetAccountIDFromLSID(utwr->login, utwr->lsaccountid);
|
uint32 id = database.GetAccountIDFromLSID(utwr->login, utwr->lsaccountid);
|
||||||
int16 status = database.CheckStatus(id);
|
int16 status = database.CheckStatus(id);
|
||||||
|
|
||||||
auto outpack = new ServerPacket;
|
ServerPacket outpack;
|
||||||
outpack->opcode = ServerOP_UsertoWorldResp;
|
outpack.opcode = ServerOP_UsertoWorldResp;
|
||||||
outpack->size = sizeof(UsertoWorldResponse_Struct);
|
outpack.size = sizeof(UsertoWorldResponse_Struct);
|
||||||
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_Struct *utwrs = (UsertoWorldResponse_Struct *) 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);
|
||||||
@ -146,32 +146,45 @@ void LoginServer::ProcessUsertoWorldReq(uint16_t opcode, EQ::Net::Packet &p)
|
|||||||
utwrs->response = UserToWorldStatusSuccess;
|
utwrs->response = UserToWorldStatusSuccess;
|
||||||
|
|
||||||
if (Config->Locked == true) {
|
if (Config->Locked == true) {
|
||||||
if ((status == 0 || status < 100) && (status != -2 || status != -1)) {
|
if (status < 100) {
|
||||||
utwrs->response = 0;
|
utwrs->response = UserToWorldStatusWorldUnavail;
|
||||||
|
SendPacket(&outpack);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
if (status >= 100) {
|
|
||||||
utwrs->response = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
utwrs->response = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int32 x = Config->MaxClients;
|
int32 x = Config->MaxClients;
|
||||||
if ((int32) numplayers >= x && x != -1 && x != 255 && status < 80) {
|
if ((int32) numplayers >= x && x != -1 && x != 255 && status < 80) {
|
||||||
utwrs->response = -3;
|
utwrs->response = UserToWorldStatusWorldAtCapacity;
|
||||||
|
SendPacket(&outpack);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status == -1) {
|
if (status == -1) {
|
||||||
utwrs->response = -1;
|
utwrs->response = UserToWorldStatusSuspended;
|
||||||
}
|
SendPacket(&outpack);
|
||||||
if (status == -2) {
|
return;
|
||||||
utwrs->response = -2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
utwrs->worldid = utwr->worldid;
|
if (status == -2) {
|
||||||
SendPacket(outpack);
|
utwrs->response = UserToWorldStatusBanned;
|
||||||
delete outpack;
|
SendPacket(&outpack);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (RuleB(World, DisallowDuplicateAccountLogins)) {
|
||||||
|
auto cle = client_list.FindCLEByLSID(utwr->lsaccountid);
|
||||||
|
if (cle != nullptr) {
|
||||||
|
auto status = cle->GetOnline();
|
||||||
|
if (CLE_Status_Never != status && CLE_Status_Offline != status) {
|
||||||
|
utwrs->response = UserToWorldStatusAlreadyOnline;
|
||||||
|
SendPacket(&outpack);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SendPacket(&outpack);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoginServer::ProcessLSClientAuthLegacy(uint16_t opcode, EQ::Net::Packet &p)
|
void LoginServer::ProcessLSClientAuthLegacy(uint16_t opcode, EQ::Net::Packet &p)
|
||||||
|
|||||||
@ -560,9 +560,8 @@ bool Client::Process() {
|
|||||||
OnDisconnect(true);
|
OnDisconnect(true);
|
||||||
Log(Logs::General, Logs::Zone_Server, "Client linkdead: %s", name);
|
Log(Logs::General, Logs::Zone_Server, "Client linkdead: %s", name);
|
||||||
|
|
||||||
if (GetGM()) {
|
if (Admin() > 100) {
|
||||||
if (GetMerc())
|
if (GetMerc()) {
|
||||||
{
|
|
||||||
GetMerc()->Save();
|
GetMerc()->Save();
|
||||||
GetMerc()->Depop();
|
GetMerc()->Depop();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user