#35 world peering limit client to one character active, only recover linkdead
This commit is contained in:
parent
712b5ebf3f
commit
8be57ce9eb
@ -176,7 +176,7 @@ public:
|
|||||||
void setZonePeerDataSelf(ZoneChangeDetails* opt_details, std::string zoneFileName, std::string zoneName, int32 zoneId,
|
void setZonePeerDataSelf(ZoneChangeDetails* opt_details, std::string zoneFileName, std::string zoneName, int32 zoneId,
|
||||||
int32 instanceId, float safeX, float safeY, float safeZ, float safeHeading, bool lockState, sint16 minStatus,
|
int32 instanceId, float safeX, float safeY, float safeZ, float safeHeading, bool lockState, sint16 minStatus,
|
||||||
int16 minLevel, int16 maxLevel, int16 minVersion, int32 defaultLockoutTime, int32 defaultReenterTime, int8 instanceType, int32 numPlayers, bool isCityZone, void* zonePtr = nullptr);
|
int16 minLevel, int16 maxLevel, int16 minVersion, int32 defaultLockoutTime, int32 defaultReenterTime, int8 instanceType, int32 numPlayers, bool isCityZone, void* zonePtr = nullptr);
|
||||||
bool IsClientConnectedPeer(int32 account_id);
|
bool IsClientConnectedPeer(int32 account_id, int32 char_id);
|
||||||
std::string GetCharacterPeerId(std::string charName);
|
std::string GetCharacterPeerId(std::string charName);
|
||||||
void SendPeersChannelMessage(int32 group_id, std::string fromName, std::string message, int16 channel, int32 language_id = 0, int8 custom_type = 0);
|
void SendPeersChannelMessage(int32 group_id, std::string fromName, std::string message, int16 channel, int32 language_id = 0, int8 custom_type = 0);
|
||||||
void SendPeersGuildChannelMessage(int32 guild_id, std::string fromName, std::string message, int16 channel, int32 language_id = 0, int8 custom_type = 0);
|
void SendPeersGuildChannelMessage(int32 guild_id, std::string fromName, std::string message, int16 channel, int32 language_id = 0, int8 custom_type = 0);
|
||||||
|
@ -911,7 +911,7 @@ bool ZoneList::GetZoneByInstance(ZoneChangeDetails* zone_details, int32 instance
|
|||||||
return (tmp != nullptr) ? true : false;
|
return (tmp != nullptr) ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PeerManager::IsClientConnectedPeer(int32 account_id) {
|
bool PeerManager::IsClientConnectedPeer(int32 account_id, int32 char_id) {
|
||||||
for (auto& [peerId, peer] : peers) {
|
for (auto& [peerId, peer] : peers) {
|
||||||
if(peer->healthCheck.status != HealthStatus::OK)
|
if(peer->healthCheck.status != HealthStatus::OK)
|
||||||
continue;
|
continue;
|
||||||
@ -920,6 +920,7 @@ bool PeerManager::IsClientConnectedPeer(int32 account_id) {
|
|||||||
for (const auto& zone : peer->client_tree->get_child("Clients")) {
|
for (const auto& zone : peer->client_tree->get_child("Clients")) {
|
||||||
// Access each field within the current zone
|
// Access each field within the current zone
|
||||||
int32 client_acct_id = zone.second.get<int32>("account_id");
|
int32 client_acct_id = zone.second.get<int32>("account_id");
|
||||||
|
int32 in_character_id = zone.second.get<int32>("character_id");
|
||||||
bool is_linkdead = zone.second.get<bool>("is_linkdead");
|
bool is_linkdead = zone.second.get<bool>("is_linkdead");
|
||||||
bool is_zoning = zone.second.get<bool>("is_zoning");
|
bool is_zoning = zone.second.get<bool>("is_zoning");
|
||||||
bool in_zone = zone.second.get<bool>("in_zone");
|
bool in_zone = zone.second.get<bool>("in_zone");
|
||||||
@ -927,7 +928,7 @@ bool PeerManager::IsClientConnectedPeer(int32 account_id) {
|
|||||||
if(client_acct_id == account_id) {
|
if(client_acct_id == account_id) {
|
||||||
if(is_zoning)
|
if(is_zoning)
|
||||||
return true;
|
return true;
|
||||||
else if(is_linkdead)
|
else if(is_linkdead && in_character_id == char_id)
|
||||||
return false;
|
return false;
|
||||||
else if(in_zone)
|
else if(in_zone)
|
||||||
return true;
|
return true;
|
||||||
@ -1306,7 +1307,7 @@ bool ZoneList::ClientConnected(int32 account_id, int32 char_id){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!ret) {
|
if(!ret) {
|
||||||
ret = peer_manager.IsClientConnectedPeer(account_id);
|
ret = peer_manager.IsClientConnectedPeer(account_id, char_id);
|
||||||
}
|
}
|
||||||
MClientList.unlock();
|
MClientList.unlock();
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -455,7 +455,7 @@ class ZoneList {
|
|||||||
bool GetZone(ZoneChangeDetails* zone_details, int32 opt_zone_id, std::string opt_zone_name = "", bool loadZone = true, bool skip_existing_zones = false, bool increment_zone = true, bool check_peers = true, bool check_instances = false, bool only_always_loaded = false, bool skip_self = false, bool duplicated_zone = false, int32 minLevel = 0, int32 maxLevel = 0, int32 avgLevel = 0, int32 firstLevel = 0);
|
bool GetZone(ZoneChangeDetails* zone_details, int32 opt_zone_id, std::string opt_zone_name = "", bool loadZone = true, bool skip_existing_zones = false, bool increment_zone = true, bool check_peers = true, bool check_instances = false, bool only_always_loaded = false, bool skip_self = false, bool duplicated_zone = false, int32 minLevel = 0, int32 maxLevel = 0, int32 avgLevel = 0, int32 firstLevel = 0);
|
||||||
bool GetZoneByInstance(ZoneChangeDetails* zone_details, int32 instance_id, int32 zone_id = 0, bool loadZone = true, bool skip_existing_zones = false, bool increment_zone = true, bool check_peers = true, int32 minLevel = 0, int32 maxLevel = 0, int32 avgLevel = 0, int32 firstLevel = 0);
|
bool GetZoneByInstance(ZoneChangeDetails* zone_details, int32 instance_id, int32 zone_id = 0, bool loadZone = true, bool skip_existing_zones = false, bool increment_zone = true, bool check_peers = true, int32 minLevel = 0, int32 maxLevel = 0, int32 avgLevel = 0, int32 firstLevel = 0);
|
||||||
|
|
||||||
bool IsClientConnectedPeer(int32 account_id);
|
bool IsClientConnectedPeer(int32 account_id, int32 char_id);
|
||||||
//ZoneServer* Get(int32 id, bool loadZone = true, bool skip_existing_zones = false, bool increment_zone = true);
|
//ZoneServer* Get(int32 id, bool loadZone = true, bool skip_existing_zones = false, bool increment_zone = true);
|
||||||
//ZoneServer* Get(const char* zone_name, bool loadZone=true, bool skip_existing_zones = false, bool increment_zone = true);
|
//ZoneServer* Get(const char* zone_name, bool loadZone=true, bool skip_existing_zones = false, bool increment_zone = true);
|
||||||
//ZoneServer* GetByInstanceID(int32 id, int32 zone_id=0, bool skip_existing_zones = false, bool increment_zone = true);
|
//ZoneServer* GetByInstanceID(int32 id, int32 zone_id=0, bool skip_existing_zones = false, bool increment_zone = true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user