Merge branches 'lsid' and 'master' of https://github.com/EQEmu/Server into lsid

This commit is contained in:
Akkadius
2019-08-10 03:26:40 -05:00
46 changed files with 1857 additions and 558 deletions
+1 -1
View File
@@ -287,7 +287,7 @@ void Adventure::Finished(AdventureWinStatus ws)
ClientListEntry *current = client_list.FindCharacter((*iter).c_str());
if(current)
{
if(current->Online() == CLE_Status_InZone)
if(current->Online() == CLE_Status::InZone)
{
//We can send our packets only.
auto pack =
+31 -21
View File
@@ -88,7 +88,6 @@ extern volatile bool UCSServerAvailable_;
Client::Client(EQStreamInterface* ieqs)
: autobootup_timeout(RuleI(World, ZoneAutobootTimeoutMS)),
CLE_keepalive_timer(RuleI(World, ClientKeepaliveTimeoutMS)),
connect(1000),
eqs(ieqs)
{
@@ -105,6 +104,7 @@ Client::Client(EQStreamInterface* ieqs)
char_name[0] = 0;
charid = 0;
zone_waiting_for_bootup = 0;
enter_world_triggered = false;
StartInTutorial = false;
m_ClientVersion = eqs->ClientVersion();
@@ -115,7 +115,7 @@ Client::Client(EQStreamInterface* ieqs)
Client::~Client() {
if (RunLoops && cle && zone_id == 0)
cle->SetOnline(CLE_Status_Offline);
cle->SetOnline(CLE_Status::Offline);
numclients--;
@@ -185,7 +185,7 @@ void Client::SendExpansionInfo() {
void Client::SendCharInfo() {
if (cle) {
cle->SetOnline(CLE_Status_CharSelect);
cle->SetOnline(CLE_Status::CharSelect);
}
if (m_ClientVersionBit & EQEmu::versions::maskRoFAndLater) {
@@ -428,7 +428,7 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app)
// Track who is in and who is out of the game
char *inout= (char *) "";
if (cle->GetOnline() == CLE_Status_Never) {
if (cle->GetOnline() == CLE_Status::Never){
// Desktop -> Char Select
inout = (char *) "In";
}
@@ -441,7 +441,7 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app)
// Either from a fresh client launch or coming back from the game.
// Exiting the game entirely does not come through here.
// Could use a Logging Out Completely message somewhere.
cle->SetOnline(CLE_Status_CharSelect);
cle->SetOnline(CLE_Status::CharSelect);
Log(Logs::General, Logs::World_Server,
"Account (%s) Logging(%s) to character select :: LSID: %d ",
@@ -1038,7 +1038,7 @@ bool Client::HandlePacket(const EQApplicationPacket *app) {
{
// I don't see this getting executed on logout
eqs->Close();
cle->SetOnline(CLE_Status_Offline); //allows this player to log in again without an ip restriction.
cle->SetOnline(CLE_Status::Offline); //allows this player to log in again without an ip restriction.
return false;
}
case OP_ZoneChange:
@@ -1081,15 +1081,15 @@ bool Client::Process() {
Log(Logs::General, Logs::World_Server, "Zone bootup timer expired, bootup failed or too slow.");
TellClientZoneUnavailable();
}
if(connect.Check()){
SendGuildList();// Send OPCode: OP_GuildsList
SendApproveWorld();
connect.Disable();
}
if (CLE_keepalive_timer.Check()) {
if (cle)
cle->KeepAlive();
}
if (cle)
cle->KeepAlive();
/************ Get all packets from packet manager out queue and process them ************/
EQApplicationPacket *app = 0;
@@ -1153,11 +1153,18 @@ void Client::EnterWorld(bool TryBootup) {
else
zone_server = zoneserver_list.FindByZoneID(zone_id);
const char *zone_name = database.GetZoneName(zone_id, true);
if (zone_server) {
// warn the world we're comming, so it knows not to shutdown
zone_server->IncomingClient(this);
if (false == enter_world_triggered) {
//Drop any clients we own in other zones.
zoneserver_list.DropClient(GetLSID(), zone_server);
// warn the zone we're coming
zone_server->IncomingClient(this);
//tell the server not to trigger this multiple times before we get a zone unavailable
enter_world_triggered = true;
}
}
else {
if (TryBootup) {
@@ -1176,9 +1183,17 @@ void Client::EnterWorld(bool TryBootup) {
return;
}
}
zone_waiting_for_bootup = 0;
if(!cle) {
if (GetAdmin() < 80 && zoneserver_list.IsZoneLocked(zone_id)) {
Log(Logs::General, Logs::World_Server, "Enter world failed. Zone is locked.");
TellClientZoneUnavailable();
return;
}
if (!cle) {
TellClientZoneUnavailable();
return;
}
@@ -1195,12 +1210,6 @@ void Client::EnterWorld(bool TryBootup) {
);
if (seen_character_select) {
if (GetAdmin() < 80 && zoneserver_list.IsZoneLocked(zone_id)) {
Log(Logs::General, Logs::World_Server, "Enter world failed. Zone is locked.");
TellClientZoneUnavailable();
return;
}
auto pack = new ServerPacket;
pack->opcode = ServerOP_AcceptWorldEntrance;
pack->size = sizeof(WorldToZone_Struct);
@@ -1306,7 +1315,7 @@ void Client::Clearance(int8 response)
safe_delete(outapp);
if (cle)
cle->SetOnline(CLE_Status_Zoning);
cle->SetOnline(CLE_Status::Zoning);
}
void Client::TellClientZoneUnavailable() {
@@ -1320,6 +1329,7 @@ void Client::TellClientZoneUnavailable() {
zone_id = 0;
zone_waiting_for_bootup = 0;
enter_world_triggered = false;
autobootup_timeout.Disable();
}
+1 -1
View File
@@ -82,6 +82,7 @@ private:
bool is_player_zoning;
Timer autobootup_timeout;
uint32 zone_waiting_for_bootup;
bool enter_world_triggered;
bool StartInTutorial;
EQEmu::versions::ClientVersion m_ClientVersion;
@@ -94,7 +95,6 @@ private:
void SetClassLanguages(PlayerProfile_Struct *pp);
ClientListEntry* cle;
Timer CLE_keepalive_timer;
Timer connect;
bool firstlogin;
bool seen_character_select;
+28 -22
View File
@@ -83,8 +83,8 @@ ClientListEntry::ClientListEntry(
memset(pLFGComments, 0, 64);
}
ClientListEntry::ClientListEntry(uint32 in_id, ZoneServer *iZS, ServerClientList_Struct *scl, int8 iOnline)
: id(in_id)
ClientListEntry::ClientListEntry(uint32 in_id, ZoneServer* iZS, ServerClientList_Struct* scl, CLE_Status iOnline)
: id(in_id)
{
ClearVars(true);
@@ -104,7 +104,7 @@ ClientListEntry::ClientListEntry(uint32 in_id, ZoneServer *iZS, ServerClientList
pLFGMatchFilter = false;
memset(pLFGComments, 0, 64);
if (iOnline >= CLE_Status_Zoning) {
if (iOnline >= CLE_Status::Zoning) {
Update(iZS, scl, iOnline);
}
else {
@@ -129,31 +129,39 @@ void ClientListEntry::SetChar(uint32 iCharID, const char *iCharName)
strn0cpy(pname, iCharName, sizeof(pname));
}
void ClientListEntry::SetOnline(ZoneServer *iZS, int8 iOnline)
{
void ClientListEntry::SetOnline(ZoneServer* iZS, CLE_Status iOnline) {
if (iZS == this->Server()) {
SetOnline(iOnline);
}
}
void ClientListEntry::SetOnline(int8 iOnline)
void ClientListEntry::SetOnline(CLE_Status iOnline)
{
if (iOnline >= CLE_Status_Online && pOnline < CLE_Status_Online) {
Log(Logs::General,
Logs::World_Server,
"ClientListEntry::SetOnline for %s(%i) = %i",
AccountName(),
AccountID(),
iOnline);
if (iOnline >= CLE_Status::Online && pOnline < CLE_Status::Online) {
numplayers++;
}
else if (iOnline < CLE_Status_Online && pOnline >= CLE_Status_Online) {
else if (iOnline < CLE_Status::Online && pOnline >= CLE_Status::Online) {
numplayers--;
}
if (iOnline != CLE_Status_Online || pOnline < CLE_Status_Online) {
if (iOnline != CLE_Status::Online || pOnline < CLE_Status::Online) {
pOnline = iOnline;
}
if (iOnline < CLE_Status_Zoning) {
if (iOnline < CLE_Status::Zoning) {
Camp();
}
if (pOnline >= CLE_Status_Online) {
if (pOnline >= CLE_Status::Online) {
stale = 0;
}
}
void ClientListEntry::LSUpdate(ZoneServer *iZS)
{
if (WorldConfig::get()->UpdateStats) {
@@ -184,8 +192,8 @@ void ClientListEntry::LSZoneChange(ZoneToZone_Struct *ztz)
safe_delete(pack);
}
}
void ClientListEntry::Update(ZoneServer *iZS, ServerClientList_Struct *scl, int8 iOnline)
{
void ClientListEntry::Update(ZoneServer* iZS, ServerClientList_Struct* scl, CLE_Status iOnline) {
if (pzoneserver != iZS) {
if (pzoneserver) {
pzoneserver->RemovePlayer();
@@ -232,7 +240,7 @@ void ClientListEntry::Update(ZoneServer *iZS, ServerClientList_Struct *scl, int8
SetOnline(iOnline);
}
void ClientListEntry::LeavingZone(ZoneServer *iZS, int8 iOnline)
void ClientListEntry::LeavingZone(ZoneServer *iZS, CLE_Status iOnline)
{
if (iZS != 0 && iZS != pzoneserver) {
return;
@@ -250,8 +258,8 @@ void ClientListEntry::LeavingZone(ZoneServer *iZS, int8 iOnline)
void ClientListEntry::ClearVars(bool iAll)
{
if (iAll) {
pOnline = CLE_Status_Never;
stale = 0;
pOnline = CLE_Status::Never;
stale = 0;
pLSID = 0;
memset(loginserver_account_name, 0, sizeof(loginserver_account_name));
@@ -299,12 +307,10 @@ bool ClientListEntry::CheckStale()
{
stale++;
if (stale > 20) {
if (pOnline > CLE_Status_Offline) {
SetOnline(CLE_Status_Offline);
}
else {
return true;
}
if (pOnline > CLE_Status::Offline)
SetOnline(CLE_Status::Offline);
return true;
}
return false;
}
+21 -16
View File
@@ -8,13 +8,15 @@
#include "../common/rulesys.h"
#include <vector>
#define CLE_Status_Never -1
#define CLE_Status_Offline 0
#define CLE_Status_Online 1 // Will not overwrite more specific online status
#define CLE_Status_CharSelect 2
#define CLE_Status_Zoning 3
#define CLE_Status_InZone 4
typedef enum
{
Never,
Offline,
Online,
CharSelect,
Zoning,
InZone
} CLE_Status;
class ZoneServer;
struct ServerClientList_Struct;
@@ -49,23 +51,26 @@ public:
* @param scl
* @param iOnline
*/
ClientListEntry(uint32 id, ZoneServer *iZS, ServerClientList_Struct *scl, int8 iOnline);
ClientListEntry(uint32 id, uint32 iAccID, const char* iAccName, MD5& iMD5Pass, int16 iAdmin = 0);
ClientListEntry(uint32 id, ZoneServer* iZS, ServerClientList_Struct* scl, CLE_Status iOnline);
~ClientListEntry();
bool CheckStale();
void Update(ZoneServer* zoneserver, ServerClientList_Struct* scl, int8 iOnline = CLE_Status_InZone);
void Update(ZoneServer* zoneserver, ServerClientList_Struct* scl, CLE_Status iOnline = CLE_Status::InZone);
void LSUpdate(ZoneServer* zoneserver);
void LSZoneChange(ZoneToZone_Struct* ztz);
bool CheckAuth(uint32 loginserver_account_id, const char* key_password);
void SetOnline(ZoneServer* iZS, int8 iOnline);
void SetOnline(int8 iOnline = CLE_Status_Online);
bool CheckAuth(const char* iName, MD5& iMD5Password);
bool CheckAuth(uint32 id, const char* key, uint32 ip);
void SetOnline(ZoneServer* iZS, CLE_Status iOnline);
void SetOnline(CLE_Status iOnline = CLE_Status::Online);
void SetChar(uint32 iCharID, const char* iCharName);
inline int8 Online() { return pOnline; }
inline CLE_Status Online() { return pOnline; }
inline const uint32 GetID() const { return id; }
inline const uint32 GetIP() const { return pIP; }
inline void SetIP(const uint32& iIP) { pIP = iIP; }
inline void KeepAlive() { stale = 0; }
inline uint8 GetStaleCounter() const { return stale; }
void LeavingZone(ZoneServer* iZS = 0, int8 iOnline = CLE_Status_Offline);
void LeavingZone(ZoneServer* iZS = 0, CLE_Status iOnline = CLE_Status::Offline);
void Camp(ZoneServer* iZS = 0);
// Login Server stuff
@@ -75,7 +80,7 @@ public:
inline const char* LSName() const { return loginserver_account_name; }
inline int16 WorldAdmin() const { return pworldadmin; }
inline const char* GetLSKey() const { return plskey; }
inline const int8 GetOnline() const { return pOnline; }
inline const CLE_Status GetOnline() const { return pOnline; }
// Account stuff
inline uint32 AccountID() const { return paccountid; }
@@ -118,8 +123,8 @@ private:
const uint32 id;
uint32 pIP;
int8 pOnline{};
uint8 stale{};
CLE_Status pOnline;
uint8 stale;
// Login Server stuff
char source_loginserver[64]{}; //Loginserver we came from.
+29 -31
View File
@@ -41,7 +41,7 @@ extern ZSList zoneserver_list;
uint32 numplayers = 0; //this really wants to be a member variable of ClientList...
ClientList::ClientList()
: CLStale_timer(45000)
: CLStale_timer(10000)
{
NextCLEID = 1;
@@ -64,8 +64,6 @@ void ClientList::Process() {
struct in_addr in;
in.s_addr = iterator.GetData()->GetIP();
Log(Logs::Detail, Logs::World_Server,"Removing client from %s:%d", inet_ntoa(in), iterator.GetData()->GetPort());
//the client destructor should take care of this.
// iterator.GetData()->Free();
iterator.RemoveCurrent();
}
else
@@ -122,7 +120,7 @@ void ClientList::GetCLEIP(uint32 iIP) {
return;
} else {
Log(Logs::General, Logs::Client_Login, "Disconnect: Account %s on IP %s.", countCLEIPs->LSName(), long2ip(countCLEIPs->GetIP()).c_str());
countCLEIPs->SetOnline(CLE_Status_Offline);
countCLEIPs->SetOnline(CLE_Status::Offline);
iterator.RemoveCurrent();
continue;
}
@@ -138,7 +136,7 @@ void ClientList::GetCLEIP(uint32 iIP) {
return;
} else {
Log(Logs::General, Logs::Client_Login, "Disconnect: Account %s on IP %s.", countCLEIPs->LSName(), long2ip(countCLEIPs->GetIP()).c_str());
countCLEIPs->SetOnline(CLE_Status_Offline); // Remove the connection
countCLEIPs->SetOnline(CLE_Status::Offline); // Remove the connection
iterator.RemoveCurrent();
continue;
}
@@ -150,7 +148,7 @@ void ClientList::GetCLEIP(uint32 iIP) {
return;
} else {
Log(Logs::General, Logs::Client_Login, "Disconnect: Account %s on IP %s.", countCLEIPs->LSName(), long2ip(countCLEIPs->GetIP()).c_str());
countCLEIPs->SetOnline(CLE_Status_Offline); // Remove the connection
countCLEIPs->SetOnline(CLE_Status::Offline); // Remove the connection
iterator.RemoveCurrent();
continue;
}
@@ -161,7 +159,7 @@ void ClientList::GetCLEIP(uint32 iIP) {
return;
} else {
Log(Logs::General, Logs::Client_Login, "Disconnect: Account %s on IP %s.", countCLEIPs->LSName(), long2ip(countCLEIPs->GetIP()).c_str());
countCLEIPs->SetOnline(CLE_Status_Offline); // Remove the connection
countCLEIPs->SetOnline(CLE_Status::Offline); // Remove the connection
iterator.RemoveCurrent();
continue;
}
@@ -182,7 +180,7 @@ uint32 ClientList::GetCLEIPCount(uint32 iIP) {
while (iterator.MoreElements()) {
countCLEIPs = iterator.GetData();
if ((countCLEIPs->GetIP() == iIP) && ((countCLEIPs->Admin() < (RuleI(World, ExemptMaxClientsStatus))) || (RuleI(World, ExemptMaxClientsStatus) < 0)) && countCLEIPs->Online() >= CLE_Status_Online) { // If the IP matches, and the connection admin status is below the exempt status, or exempt status is less than 0 (no-one is exempt)
if ((countCLEIPs->GetIP() == iIP) && ((countCLEIPs->Admin() < (RuleI(World, ExemptMaxClientsStatus))) || (RuleI(World, ExemptMaxClientsStatus) < 0)) && countCLEIPs->Online() >= CLE_Status::Online) { // If the IP matches, and the connection admin status is below the exempt status, or exempt status is less than 0 (no-one is exempt)
IPInstances++; // Increment the occurences of this IP address
}
iterator.Advance();
@@ -208,7 +206,7 @@ void ClientList::DisconnectByIP(uint32 iIP) {
zoneserver_list.SendPacket(pack);
safe_delete(pack);
}
countCLEIPs->SetOnline(CLE_Status_Offline);
countCLEIPs->SetOnline(CLE_Status::Offline);
iterator.RemoveCurrent();
}
iterator.Advance();
@@ -255,19 +253,6 @@ ClientListEntry* ClientList::FindCLEByCharacterID(uint32 iCharID) {
return nullptr;
}
ClientListEntry* ClientList::FindCLEByLSID(uint32 iLSID) {
LinkedListIterator<ClientListEntry*> iterator(clientlist);
iterator.Reset();
while (iterator.MoreElements()) {
if (iterator.GetData()->LSID() == iLSID) {
return iterator.GetData();
}
iterator.Advance();
}
return nullptr;
}
void ClientList::SendCLEList(const int16& admin, const char* to, WorldTCPConnection* connection, const char* iName) {
LinkedListIterator<ClientListEntry*> iterator(clientlist);
char* output = 0;
@@ -343,10 +328,10 @@ void ClientList::ClientUpdate(ZoneServer* zoneserver, ServerClientList_Struct* s
if (iterator.GetData()->GetID() == scl->wid) {
cle = iterator.GetData();
if (scl->remove == 2){
cle->LeavingZone(zoneserver, CLE_Status_Offline);
cle->LeavingZone(zoneserver, CLE_Status::Offline);
}
else if (scl->remove == 1)
cle->LeavingZone(zoneserver, CLE_Status_Zoning);
cle->LeavingZone(zoneserver, CLE_Status::Zoning);
else
cle->Update(zoneserver, scl);
return;
@@ -354,11 +339,11 @@ void ClientList::ClientUpdate(ZoneServer* zoneserver, ServerClientList_Struct* s
iterator.Advance();
}
if (scl->remove == 2)
cle = new ClientListEntry(GetNextCLEID(), zoneserver, scl, CLE_Status_Online);
cle = new ClientListEntry(GetNextCLEID(), zoneserver, scl, CLE_Status::Online);
else if (scl->remove == 1)
cle = new ClientListEntry(GetNextCLEID(), zoneserver, scl, CLE_Status_Zoning);
cle = new ClientListEntry(GetNextCLEID(), zoneserver, scl, CLE_Status::Zoning);
else
cle = new ClientListEntry(GetNextCLEID(), zoneserver, scl, CLE_Status_InZone);
cle = new ClientListEntry(GetNextCLEID(), zoneserver, scl, CLE_Status::InZone);
clientlist.Insert(cle);
zoneserver->ChangeWID(scl->charid, cle->GetID());
}
@@ -504,7 +489,7 @@ void ClientList::SendWhoAll(uint32 fromid,const char* to, int16 admin, Who_All_S
countcle = countclients.GetData();
const char* tmpZone = database.GetZoneName(countcle->zone());
if (
(countcle->Online() >= CLE_Status_Zoning) &&
(countcle->Online() >= CLE_Status::Zoning) &&
(!countcle->GetGM() || countcle->Anon() != 1 || admin >= countcle->Admin()) &&
(whom == 0 || (
((countcle->Admin() >= 80 && countcle->GetGM()) || whom->gmlookup == 0xFFFF) &&
@@ -584,7 +569,7 @@ void ClientList::SendWhoAll(uint32 fromid,const char* to, int16 admin, Who_All_S
const char* tmpZone = database.GetZoneName(cle->zone());
if (
(cle->Online() >= CLE_Status_Zoning) &&
(cle->Online() >= CLE_Status::Zoning) &&
(!cle->GetGM() || cle->Anon() != 1 || admin >= cle->Admin()) &&
(whom == 0 || (
((cle->Admin() >= 80 && cle->GetGM()) || whom->gmlookup == 0xFFFF) &&
@@ -757,7 +742,7 @@ void ClientList::SendFriendsWho(ServerFriendsWho_Struct *FriendsWho, WorldTCPCon
Friend_[Seperator - FriendsPointer] = 0;
ClientListEntry* CLE = FindCharacter(Friend_);
if(CLE && CLE->name() && (CLE->Online() >= CLE_Status_Zoning) && !(CLE->GetGM() && CLE->Anon())) {
if(CLE && CLE->name() && (CLE->Online() >= CLE_Status::Zoning) && !(CLE->GetGM() && CLE->Anon())) {
FriendsCLEs.push_back(CLE);
TotalLength += strlen(CLE->name());
int GuildNameLength = strlen(guild_mgr.GetGuildName(CLE->GuildID()));
@@ -969,7 +954,7 @@ void ClientList::ConsoleSendWhoAll(const char* to, int16 admin, Who_All_Struct*
cle = iterator.GetData();
const char* tmpZone = database.GetZoneName(cle->zone());
if (
(cle->Online() >= CLE_Status_Zoning)
(cle->Online() >= CLE_Status::Zoning)
&& (whom == 0 || (
((cle->Admin() >= 80 && cle->GetGM()) || whom->gmlookup == 0xFFFF) &&
(whom->lvllow == 0xFFFF || (cle->level() >= whom->lvllow && cle->level() <= whom->lvlhigh)) &&
@@ -1258,6 +1243,19 @@ void ClientList::RemoveCLEByLSID(uint32 iLSID)
}
}
bool ClientList::IsAccountInGame(uint32 iLSID) {
LinkedListIterator<ClientListEntry*> iterator(clientlist);
while (iterator.MoreElements()) {
if (iterator.GetData()->LSID() == iLSID && iterator.GetData()->Online() == CLE_Status::InZone) {
return true;
}
iterator.Advance();
}
return false;
}
int ClientList::GetClientCount() {
return(numplayers);
}
+1 -1
View File
@@ -55,7 +55,6 @@ public:
ClientListEntry* FindCharacter(const char* name);
ClientListEntry* FindCLEByAccountID(uint32 iAccID);
ClientListEntry* FindCLEByCharacterID(uint32 iCharID);
ClientListEntry* FindCLEByLSID(uint32 iLSID);
ClientListEntry* GetCLE(uint32 iID);
void GetCLEIP(uint32 iIP);
uint32 GetCLEIPCount(uint32 iLSAccountID);
@@ -65,6 +64,7 @@ public:
void CLEAdd(uint32 iLSID, const char* iLoginServerName, const char* iLoginName, const char* iLoginKey, int16 iWorldAdmin = 0, uint32 ip = 0, uint8 local=0);
void UpdateClientGuild(uint32 char_id, uint32 guild_id);
void RemoveCLEByLSID(uint32 iLSID);
bool IsAccountInGame(uint32 iLSID);
int GetClientCount();
void GetClients(const char *zone_name, std::vector<ClientListEntry *> &into);
+5 -13
View File
@@ -108,19 +108,11 @@ void LoginServer::ProcessUsertoWorldReqLeg(uint16_t opcode, EQ::Net::Packet &p)
return;
}
if (RuleB(World, DisallowDuplicateAccountLogins)) {
auto cle = client_list.FindCLEByLSID(utwr->lsaccountid);
if (cle != nullptr) {
auto status = cle->GetOnline();
if (CLE_Status_Zoning == status || CLE_Status_InZone == status) {
utwrs->response = UserToWorldStatusAlreadyOnline;
SendPacket(&outpack);
return;
}
else {
//our existing cle is in a state we can login to, mark the old as stale and remove it.
client_list.RemoveCLEByLSID(utwr->lsaccountid);
}
if (RuleB(World, EnforceCharacterLimitAtLogin)) {
if (client_list.IsAccountInGame(utwr->lsaccountid)) {
utwrs->response = UserToWorldStatusAlreadyOnline;
SendPacket(&outpack);
return;
}
}
+12
View File
@@ -708,6 +708,18 @@ void ZSList::WorldShutDown(uint32 time, uint32 interval)
}
}
void ZSList::DropClient(uint32 lsid, ZoneServer *ignore_zoneserver) {
ServerPacket packet(ServerOP_DropClient, sizeof(ServerZoneDropClient_Struct));
auto drop = (ServerZoneDropClient_Struct*)packet.pBuffer;
drop->lsid = lsid;
for (auto &zs : zone_server_list) {
if (zs.get() != ignore_zoneserver) {
zs->SendPacket(&packet);
}
}
}
void ZSList::OnTick(EQ::Timer *t)
{
if (!EventSubscriptionWatcher::Get()->IsSubscribed("EQW::ZoneUpdate")) {
+1
View File
@@ -57,6 +57,7 @@ public:
void SOPZoneBootup(const char *adminname, uint32 ZoneServerID, const char *zonename, bool iMakeStatic = false);
void UpdateUCSServerAvailable(bool ucss_available = true);
void WorldShutDown(uint32 time, uint32 interval);
void DropClient(uint32 lsid, ZoneServer *ignore_zoneserver);
ZoneServer* FindByPort(uint16 port);
ZoneServer* FindByID(uint32 ZoneID);
+4 -3
View File
@@ -437,7 +437,7 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
}
ClientListEntry* cle = client_list.FindCharacter(scm->deliverto);
if (cle == 0 || cle->Online() < CLE_Status_Zoning ||
if (cle == 0 || cle->Online() < CLE_Status::Zoning ||
(cle->TellsOff() && ((cle->Anon() == 1 && scm->fromadmin < cle->Admin()) || scm->fromadmin < 80))) {
if (!scm->noreply) {
ClientListEntry* sender = client_list.FindCharacter(scm->from);
@@ -450,7 +450,7 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
sender->Server()->SendPacket(pack);
}
}
else if (cle->Online() == CLE_Status_Zoning) {
else if (cle->Online() == CLE_Status::Zoning) {
if (!scm->noreply) {
ClientListEntry* sender = client_list.FindCharacter(scm->from);
if (cle->TellQueueFull()) {
@@ -518,7 +518,7 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
ClientListEntry* cle = client_list.FindCharacter(svm->To);
if (!cle || (cle->Online() < CLE_Status_Zoning) || !cle->Server()) {
if (!cle || (cle->Online() < CLE_Status::Zoning) || !cle->Server()) {
zoneserver_list.SendEmoteMessage(svm->From, 0, 0, 0, "'%s is not online at this time'", svm->To);
@@ -1457,6 +1457,7 @@ void ZoneServer::IncomingClient(Client* client) {
s->accid = client->GetAccountID();
s->admin = client->GetAdmin();
s->charid = client->GetCharID();
s->lsid = client->GetLSID();
if (client->GetCLE())
s->tellsoff = client->GetCLE()->TellsOff();
strn0cpy(s->charname, client->GetCharName(), sizeof(s->charname));