mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 03:08:26 +00:00
Merge branch 'master' of https://github.com/EQEmu/Server into lsid
This commit is contained in:
+6
-3
@@ -5,8 +5,9 @@ SET(zone_sources
|
||||
aa_ability.cpp
|
||||
aggro.cpp
|
||||
aggromanager.cpp
|
||||
aura.cpp
|
||||
api_service.cpp
|
||||
attack.cpp
|
||||
aura.cpp
|
||||
beacon.cpp
|
||||
bonuses.cpp
|
||||
bot.cpp
|
||||
@@ -140,12 +141,14 @@ SET(zone_sources
|
||||
zone.cpp
|
||||
zone_config.cpp
|
||||
zonedb.cpp
|
||||
zoning.cpp)
|
||||
zoning.cpp
|
||||
)
|
||||
|
||||
SET(zone_headers
|
||||
aa.h
|
||||
aa_ability.h
|
||||
aggromanager.h
|
||||
api_service.h
|
||||
aura.h
|
||||
basic_functions.h
|
||||
beacon.h
|
||||
@@ -158,7 +161,7 @@ SET(zone_headers
|
||||
command.h
|
||||
common.h
|
||||
corpse.h
|
||||
data_bucket.h
|
||||
data_bucket.h
|
||||
doors.h
|
||||
embparser.h
|
||||
embperl.h
|
||||
|
||||
@@ -0,0 +1,901 @@
|
||||
/**
|
||||
* EQEmulator: Everquest Server Emulator
|
||||
* Copyright (C) 2001-2019 EQEmulator Development Team (https://github.com/EQEmu/Server)
|
||||
*
|
||||
* 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 <memory>
|
||||
#include "../common/net/websocket_server.h"
|
||||
#include "../common/eqemu_logsys.h"
|
||||
#include "zonedb.h"
|
||||
#include "client.h"
|
||||
#include "entity.h"
|
||||
#include "corpse.h"
|
||||
#include "api_service.h"
|
||||
#include "npc.h"
|
||||
#include "object.h"
|
||||
#include "zone.h"
|
||||
#include "doors.h"
|
||||
#include <iostream>
|
||||
|
||||
extern Zone *zone;
|
||||
|
||||
EQ::Net::WebsocketLoginStatus
|
||||
CheckLogin(EQ::Net::WebsocketServerConnection *connection, const std::string &username, const std::string &password)
|
||||
{
|
||||
EQ::Net::WebsocketLoginStatus ret;
|
||||
ret.logged_in = false;
|
||||
|
||||
ret.account_id = database.CheckLogin(username.c_str(), password.c_str());
|
||||
|
||||
if (ret.account_id == 0) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
char account_name[64];
|
||||
database.GetAccountName(static_cast<uint32>(ret.account_id), account_name);
|
||||
ret.account_name = account_name;
|
||||
ret.logged_in = true;
|
||||
ret.status = database.CheckStatus(ret.account_id);
|
||||
return ret;
|
||||
}
|
||||
|
||||
Json::Value ApiGetPacketStatistics(EQ::Net::WebsocketServerConnection *connection, Json::Value params)
|
||||
{
|
||||
if (zone->GetZoneID() == 0) {
|
||||
throw EQ::Net::WebsocketException("Zone must be loaded to invoke this call");
|
||||
}
|
||||
|
||||
Json::Value response;
|
||||
auto &list = entity_list.GetClientList();
|
||||
|
||||
for (auto &iter : list) {
|
||||
auto client = iter.second;
|
||||
auto connection = client->Connection();
|
||||
auto opts = connection->GetManager()->GetOptions();
|
||||
auto eqs_stats = connection->GetStats();
|
||||
auto &stats = eqs_stats.DaybreakStats;
|
||||
auto now = EQ::Net::Clock::now();
|
||||
auto sec_since_stats_reset = std::chrono::duration_cast<std::chrono::duration<double>>(
|
||||
now - stats.created
|
||||
).count();
|
||||
|
||||
Json::Value row;
|
||||
|
||||
row["client_id"] = client->GetID();
|
||||
row["client_name"] = client->GetCleanName();
|
||||
row["seconds_since_reset"] = sec_since_stats_reset;
|
||||
row["sent_bytes"] = stats.sent_bytes;
|
||||
row["receive_bytes"] = stats.recv_bytes;
|
||||
row["min_ping"] = stats.min_ping;
|
||||
row["max_ping"] = stats.max_ping;
|
||||
row["last_ping"] = stats.last_ping;
|
||||
row["average_ping"] = stats.avg_ping;
|
||||
row["realtime_receive_packets"] = stats.recv_packets;
|
||||
row["realtime_sent_packets"] = stats.sent_packets;
|
||||
row["sync_recv_packets"] = stats.sync_recv_packets;
|
||||
row["sync_sent_packets"] = stats.sync_sent_packets;
|
||||
row["sync_remote_recv_packets"] = stats.sync_remote_recv_packets;
|
||||
row["sync_remote_sent_packets"] = stats.sync_remote_sent_packets;
|
||||
row["packet_loss_in"] = (100.0 * (1.0 - static_cast<double>(stats.sync_recv_packets) /
|
||||
static_cast<double>(stats.sync_remote_sent_packets)));
|
||||
row["packet_loss_out"] = (100.0 * (1.0 - static_cast<double>(stats.sync_remote_recv_packets) /
|
||||
static_cast<double>(stats.sync_sent_packets)));
|
||||
row["resent_packets"] = stats.resent_packets;
|
||||
row["resent_fragments"] = stats.resent_fragments;
|
||||
row["resent_non_fragments"] = stats.resent_full;
|
||||
row["dropped_datarate_packets"] = stats.dropped_datarate_packets;
|
||||
|
||||
Json::Value sent_packet_types;
|
||||
|
||||
for (auto i = 0; i < _maxEmuOpcode; ++i) {
|
||||
auto count = eqs_stats.SentCount[i];
|
||||
if (count > 0) {
|
||||
sent_packet_types[OpcodeNames[i]] = count;
|
||||
}
|
||||
}
|
||||
|
||||
Json::Value receive_packet_types;
|
||||
|
||||
for (auto i = 0; i < _maxEmuOpcode; ++i) {
|
||||
auto count = eqs_stats.RecvCount[i];
|
||||
if (count > 0) {
|
||||
receive_packet_types[OpcodeNames[i]] = count;
|
||||
}
|
||||
}
|
||||
|
||||
row["sent_packet_types"] = sent_packet_types;
|
||||
row["receive_packet_types"] = receive_packet_types;
|
||||
|
||||
response.append(row);
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
Json::Value ApiGetOpcodeList(EQ::Net::WebsocketServerConnection *connection, Json::Value params)
|
||||
{
|
||||
if (zone->GetZoneID() == 0) {
|
||||
throw EQ::Net::WebsocketException("Zone must be loaded to invoke this call");
|
||||
}
|
||||
|
||||
Json::Value response;
|
||||
for (auto i = 0; i < _maxEmuOpcode; ++i) {
|
||||
Json::Value row = OpcodeNames[i];
|
||||
|
||||
response.append(row);
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
Json::Value ApiGetNpcListDetail(EQ::Net::WebsocketServerConnection *connection, Json::Value params)
|
||||
{
|
||||
if (zone->GetZoneID() == 0) {
|
||||
throw EQ::Net::WebsocketException("Zone must be loaded to invoke this call");
|
||||
}
|
||||
|
||||
Json::Value response;
|
||||
auto &list = entity_list.GetNPCList();
|
||||
|
||||
for (auto &iter : list) {
|
||||
auto npc = iter.second;
|
||||
Json::Value row;
|
||||
|
||||
/**
|
||||
* Main
|
||||
*/
|
||||
row["id"] = npc->GetID();
|
||||
row["clean_name"] = npc->GetCleanName();
|
||||
row["x"] = npc->GetX();
|
||||
row["y"] = npc->GetY();
|
||||
row["z"] = npc->GetZ();
|
||||
row["heading"] = npc->GetHeading();
|
||||
|
||||
/**
|
||||
* Rest
|
||||
*/
|
||||
row["accuracy_rating"] = npc->GetAccuracyRating();
|
||||
row["ai_has_spells"] = npc->AI_HasSpells();
|
||||
row["ai_has_spells_effects"] = npc->AI_HasSpellsEffects();
|
||||
row["ammo_id_file"] = npc->GetAmmoIDfile();
|
||||
row["attack_delay"] = npc->GetAttackDelay();
|
||||
row["attack_speed"] = npc->GetAttackSpeed();
|
||||
row["avoidance_rating"] = npc->GetAvoidanceRating();
|
||||
row["base_damage"] = npc->GetBaseDamage();
|
||||
row["combat_event"] = npc->GetCombatEvent();
|
||||
row["copper"] = npc->GetCopper();
|
||||
row["count_loot"] = npc->CountLoot();
|
||||
row["drops_global_loot"] = npc->DropsGlobalLoot();
|
||||
row["gold"] = npc->GetGold();
|
||||
row["grid"] = npc->GetGrid();
|
||||
row["has_private_corpse"] = npc->HasPrivateCorpse();
|
||||
row["is_animal"] = npc->IsAnimal();
|
||||
row["is_guarding"] = npc->IsGuarding();
|
||||
row["is_ldon_locked"] = npc->IsLDoNLocked();
|
||||
row["is_ldon_trap_detected"] = npc->IsLDoNTrapDetected();
|
||||
row["is_ldon_trapped"] = npc->IsLDoNTrapped();
|
||||
row["is_merchant_open"] = npc->IsMerchantOpen();
|
||||
row["is_not_targetable_with_hotkey"] = npc->IsNotTargetableWithHotkey();
|
||||
row["is_proximity_set"] = npc->IsProximitySet();
|
||||
row["is_taunting"] = npc->IsTaunting();
|
||||
row["ldon_locked_skill"] = npc->GetLDoNLockedSkill();
|
||||
row["ldon_trap_spell_id"] = npc->GetLDoNTrapSpellID();
|
||||
row["ldon_trap_type"] = npc->GetLDoNTrapType();
|
||||
row["loottable_id"] = npc->GetLoottableID();
|
||||
row["max_dmg"] = npc->GetMaxDMG();
|
||||
row["max_wp"] = npc->GetMaxWp();
|
||||
row["min_damage"] = npc->GetMinDamage();
|
||||
row["min_dmg"] = npc->GetMinDMG();
|
||||
row["npc_spells_effects_id"] = npc->GetNPCSpellsEffectsID();
|
||||
row["npc_spells_id"] = npc->GetNPCSpellsID();
|
||||
row["npchp_regen"] = npc->GetNPCHPRegen();
|
||||
row["num_merc_types"] = npc->GetNumMercTypes();
|
||||
row["num_mercs"] = npc->GetNumMercs();
|
||||
row["number_of_attacks"] = npc->GetNumberOfAttacks();
|
||||
row["pet_spell_id"] = npc->GetPetSpellID();
|
||||
row["platinum"] = npc->GetPlatinum();
|
||||
row["prim_skill"] = npc->GetPrimSkill();
|
||||
|
||||
if (npc->IsProximitySet()) {
|
||||
row["proximity_max_x"] = npc->GetProximityMaxX();
|
||||
row["proximity_max_y"] = npc->GetProximityMaxY();
|
||||
row["proximity_max_z"] = npc->GetProximityMaxZ();
|
||||
row["proximity_min_x"] = npc->GetProximityMinX();
|
||||
row["proximity_min_y"] = npc->GetProximityMinY();
|
||||
row["proximity_min_z"] = npc->GetProximityMinZ();
|
||||
}
|
||||
|
||||
row["ranged_skill"] = npc->GetRangedSkill();
|
||||
row["raw_ac"] = npc->GetRawAC();
|
||||
row["sec_skill"] = npc->GetSecSkill();
|
||||
row["silver"] = npc->GetSilver();
|
||||
row["slow_mitigation"] = npc->GetSlowMitigation();
|
||||
row["sp2"] = npc->GetSp2();
|
||||
row["swarm_owner"] = npc->GetSwarmOwner();
|
||||
row["swarm_target"] = npc->GetSwarmTarget();
|
||||
row["waypoint_max"] = npc->GetWaypointMax();
|
||||
row["will_aggro_npcs"] = npc->WillAggroNPCs();
|
||||
|
||||
response.append(row);
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
Json::Value ApiGetDoorListDetail(EQ::Net::WebsocketServerConnection *connection, Json::Value params)
|
||||
{
|
||||
if (zone->GetZoneID() == 0) {
|
||||
throw EQ::Net::WebsocketException("Zone must be loaded to invoke this call");
|
||||
}
|
||||
|
||||
Json::Value response;
|
||||
auto &door_list = entity_list.GetDoorsList();
|
||||
|
||||
for (auto itr : door_list) {
|
||||
Doors *door = itr.second;
|
||||
|
||||
Json::Value row;
|
||||
|
||||
row["door_name"] = door->GetDoorName();
|
||||
row["client_version_mask"] = door->GetClientVersionMask();
|
||||
row["disable_timer"] = door->GetDisableTimer();
|
||||
row["door_db_id"] = door->GetDoorDBID();
|
||||
row["door_id"] = door->GetDoorID();
|
||||
row["door_param"] = door->GetDoorParam();
|
||||
row["entity_id"] = door->GetEntityID();
|
||||
row["guild_id"] = door->GetGuildID();
|
||||
row["incline"] = door->GetIncline();
|
||||
row["invert_state"] = door->GetInvertState();
|
||||
row["is_door"] = door->IsDoor();
|
||||
row["is_door_open"] = door->IsDoorOpen();
|
||||
row["is_ldon_door"] = door->IsLDoNDoor();
|
||||
row["key_item"] = door->GetKeyItem();
|
||||
row["lockpick"] = door->GetLockpick();
|
||||
row["no_keyring"] = door->GetNoKeyring();
|
||||
row["open_type"] = door->GetOpenType();
|
||||
row["size"] = door->GetSize();
|
||||
row["trigger_door_id"] = door->GetTriggerDoorID();
|
||||
row["trigger_type"] = door->GetTriggerType();
|
||||
row["x"] = door->GetX();
|
||||
row["y"] = door->GetY();
|
||||
row["z"] = door->GetZ();
|
||||
|
||||
response.append(row);
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
Json::Value ApiGetCorpseListDetail(EQ::Net::WebsocketServerConnection *connection, Json::Value params)
|
||||
{
|
||||
if (zone->GetZoneID() == 0) {
|
||||
throw EQ::Net::WebsocketException("Zone must be loaded to invoke this call");
|
||||
}
|
||||
|
||||
Json::Value response;
|
||||
auto &corpse_list = entity_list.GetCorpseList();
|
||||
|
||||
for (auto itr : corpse_list) {
|
||||
auto corpse = itr.second;
|
||||
|
||||
Json::Value row;
|
||||
|
||||
row["char_id"] = corpse->GetCharID();
|
||||
row["copper"] = corpse->GetCopper();
|
||||
row["corpse_dbid"] = corpse->GetCorpseDBID();
|
||||
row["count_items"] = corpse->CountItems();
|
||||
row["decay_time"] = corpse->GetDecayTime();
|
||||
row["gold"] = corpse->GetGold();
|
||||
row["is_become_npc_corpse"] = corpse->IsBecomeNPCCorpse();
|
||||
row["is_being_looted"] = corpse->IsBeingLooted();
|
||||
row["is_corpse"] = corpse->IsCorpse();
|
||||
row["is_locked"] = corpse->IsLocked();
|
||||
row["is_npc_corpse"] = corpse->IsNPCCorpse();
|
||||
row["is_player_corpse"] = corpse->IsPlayerCorpse();
|
||||
row["is_rezzed"] = corpse->IsRezzed();
|
||||
row["owner_name"] = corpse->GetOwnerName();
|
||||
row["platinum"] = corpse->GetPlatinum();
|
||||
row["player_kill_item"] = corpse->GetPlayerKillItem();
|
||||
row["rez_exp"] = corpse->GetRezExp();
|
||||
row["rez_time"] = corpse->GetRezTime();
|
||||
row["silver"] = corpse->GetSilver();
|
||||
|
||||
response.append(row);
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
Json::Value ApiGetObjectListDetail(EQ::Net::WebsocketServerConnection *connection, Json::Value params)
|
||||
{
|
||||
if (zone->GetZoneID() == 0) {
|
||||
throw EQ::Net::WebsocketException("Zone must be loaded to invoke this call");
|
||||
}
|
||||
|
||||
Json::Value response;
|
||||
auto &list = entity_list.GetObjectList();
|
||||
|
||||
for (auto &iter : list) {
|
||||
auto object = iter.second;
|
||||
|
||||
Json::Value row;
|
||||
|
||||
row["display_name"] = object->GetDisplayName();
|
||||
row["dbid"] = object->GetDBID();
|
||||
row["heading_data"] = object->GetHeadingData();
|
||||
row["icon"] = object->GetIcon();
|
||||
row["is_ground_spawn"] = object->IsGroundSpawn();
|
||||
row["item_id"] = object->GetItemID();
|
||||
row["model_name"] = object->GetModelName();
|
||||
row["size"] = object->GetSize();
|
||||
row["solid_type"] = object->GetSolidType();
|
||||
row["tilt_x"] = object->GetTiltX();
|
||||
row["tilt_y"] = object->GetTiltY();
|
||||
row["type"] = object->GetType();
|
||||
row["x"] = object->GetX();
|
||||
row["y"] = object->GetY();
|
||||
row["z"] = object->GetZ();
|
||||
|
||||
response.append(row);
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
Json::Value ApiGetMobListDetail(EQ::Net::WebsocketServerConnection *connection, Json::Value params)
|
||||
{
|
||||
if (zone->GetZoneID() == 0) {
|
||||
throw EQ::Net::WebsocketException("Zone must be loaded to invoke this call");
|
||||
}
|
||||
|
||||
Json::Value response;
|
||||
auto &list = entity_list.GetMobList();
|
||||
|
||||
for (auto &iter : list) {
|
||||
auto mob = iter.second;
|
||||
|
||||
Json::Value row;
|
||||
|
||||
/**
|
||||
* Main
|
||||
*/
|
||||
row["id"] = mob->GetID();
|
||||
row["clean_name"] = mob->GetCleanName();
|
||||
row["x"] = mob->GetX();
|
||||
row["y"] = mob->GetY();
|
||||
row["z"] = mob->GetZ();
|
||||
row["heading"] = mob->GetHeading();
|
||||
|
||||
/**
|
||||
* Rest
|
||||
*/
|
||||
row["ac"] = mob->GetAC();
|
||||
row["ac_softcap"] = mob->GetACSoftcap();
|
||||
row["ac_sum"] = mob->ACSum();
|
||||
row["active_light_type"] = mob->GetActiveLightType();
|
||||
row["aggro_range"] = mob->GetAggroRange();
|
||||
row["allow_beneficial"] = mob->GetAllowBeneficial();
|
||||
row["animation"] = mob->GetAnimation();
|
||||
row["assist_range"] = mob->GetAssistRange();
|
||||
row["aura_slots"] = mob->GetAuraSlots();
|
||||
row["base_fear_speed"] = mob->GetBaseFearSpeed();
|
||||
row["base_runspeed"] = mob->GetBaseRunspeed();
|
||||
row["base_size"] = mob->GetBaseSize();
|
||||
row["base_walkspeed"] = mob->GetBaseWalkspeed();
|
||||
row["beard"] = mob->GetBeard();
|
||||
row["beard_color"] = mob->GetBeardColor();
|
||||
row["best_melee_skill"] = mob->GetBestMeleeSkill();
|
||||
row["calc_fear_resist_chance"] = mob->CalcFearResistChance();
|
||||
row["calc_resist_chance_bonus"] = mob->CalcResistChanceBonus();
|
||||
row["can_block_spell"] = mob->CanBlockSpell();
|
||||
row["can_facestab"] = mob->CanFacestab();
|
||||
row["casted_spell_inv_slot"] = mob->GetCastedSpellInvSlot();
|
||||
row["casting_spell_id"] = mob->CastingSpellID();
|
||||
row["charmed"] = mob->Charmed();
|
||||
row["check_last_los_state"] = mob->CheckLastLosState();
|
||||
row["class"] = mob->GetClass();
|
||||
row["class_level_factor"] = mob->GetClassLevelFactor();
|
||||
row["class_race_ac_bonus"] = mob->GetClassRaceACBonus();
|
||||
row["compute_defense"] = mob->compute_defense();
|
||||
row["count_dispellable_buffs"] = mob->CountDispellableBuffs();
|
||||
row["cripp_blow_chance"] = mob->GetCrippBlowChance();
|
||||
row["cur_wp"] = mob->GetCurWp();
|
||||
row["cwp"] = mob->GetCWP();
|
||||
row["cwpp"] = mob->GetCWPP();
|
||||
row["divine_aura"] = mob->DivineAura();
|
||||
row["do_casting_checks"] = mob->DoCastingChecks();
|
||||
row["dont_buff_me_before"] = mob->DontBuffMeBefore();
|
||||
row["dont_cure_me_before"] = mob->DontCureMeBefore();
|
||||
row["dont_dot_me_before"] = mob->DontDotMeBefore();
|
||||
row["dont_heal_me_before"] = mob->DontHealMeBefore();
|
||||
row["dont_root_me_before"] = mob->DontRootMeBefore();
|
||||
row["dont_snare_me_before"] = mob->DontSnareMeBefore();
|
||||
row["drakkin_details"] = mob->GetDrakkinDetails();
|
||||
row["drakkin_heritage"] = mob->GetDrakkinHeritage();
|
||||
row["drakkin_tattoo"] = mob->GetDrakkinTattoo();
|
||||
row["emote_id"] = mob->GetEmoteID();
|
||||
row["equipment_light_type"] = mob->GetEquipmentLightType();
|
||||
row["eye_color1"] = mob->GetEyeColor1();
|
||||
row["eye_color2"] = mob->GetEyeColor2();
|
||||
row["fear_speed"] = mob->GetFearSpeed();
|
||||
row["flurry_chance"] = mob->GetFlurryChance();
|
||||
row["follow_can_run"] = mob->GetFollowCanRun();
|
||||
row["follow_distance"] = mob->GetFollowDistance();
|
||||
row["follow_id"] = mob->GetFollowID();
|
||||
row["gender"] = mob->GetGender();
|
||||
row["hair_color"] = mob->GetHairColor();
|
||||
row["hair_style"] = mob->GetHairStyle();
|
||||
row["has_active_song"] = mob->HasActiveSong();
|
||||
row["has_assist_aggro"] = mob->HasAssistAggro();
|
||||
row["has_died"] = mob->HasDied();
|
||||
row["has_disc_buff"] = mob->HasDiscBuff();
|
||||
row["has_endur_upkeep"] = mob->HasEndurUpkeep();
|
||||
row["has_free_aura_slots"] = mob->HasFreeAuraSlots();
|
||||
row["has_free_trap_slots"] = mob->HasFreeTrapSlots();
|
||||
row["has_mgb"] = mob->HasMGB();
|
||||
row["has_numhits"] = mob->HasNumhits();
|
||||
row["has_pet"] = mob->HasPet();
|
||||
row["has_pet_affinity"] = mob->HasPetAffinity();
|
||||
row["has_primary_aggro"] = mob->HasPrimaryAggro();
|
||||
row["has_project_illusion"] = mob->HasProjectIllusion();
|
||||
row["has_projectile_attack"] = mob->HasProjectileAttack();
|
||||
row["has_shield_equiped"] = mob->HasShieldEquiped();
|
||||
row["has_special_abilities"] = mob->HasSpecialAbilities();
|
||||
row["has_tar_reflection"] = mob->HasTargetReflection();
|
||||
row["has_temp_pets_active"] = mob->HasTempPetsActive();
|
||||
row["has_two_hand_blunt_equiped"] = mob->HasTwoHandBluntEquiped();
|
||||
row["has_two_hander_equipped"] = mob->HasTwoHanderEquipped();
|
||||
row["has_virus"] = mob->HasVirus();
|
||||
row["hate_summon"] = mob->HateSummon();
|
||||
row["helm_texture"] = mob->GetHelmTexture();
|
||||
row["hp"] = mob->GetHP();
|
||||
row["improved_taunt"] = mob->ImprovedTaunt();
|
||||
row["innate_light_type"] = mob->GetInnateLightType();
|
||||
row["is_ai_controlled"] = mob->IsAIControlled();
|
||||
row["is_amnesiad"] = mob->IsAmnesiad();
|
||||
row["is_animation"] = mob->IsAnimation();
|
||||
row["is_blind"] = mob->IsBlind();
|
||||
row["is_casting"] = mob->IsCasting();
|
||||
row["is_charmed"] = mob->IsCharmed();
|
||||
row["is_destructible_object"] = mob->IsDestructibleObject();
|
||||
row["is_engaged"] = mob->IsEngaged();
|
||||
row["is_enraged"] = mob->IsEnraged();
|
||||
row["is_familiar"] = mob->IsFamiliar();
|
||||
row["is_feared"] = mob->IsFeared();
|
||||
row["is_findable"] = mob->IsFindable();
|
||||
row["is_focused"] = mob->IsFocused();
|
||||
row["is_g_held"] = mob->IsGHeld();
|
||||
row["is_grouped"] = mob->IsGrouped();
|
||||
row["is_held"] = mob->IsHeld();
|
||||
row["is_looting"] = mob->IsLooting();
|
||||
row["is_melee_disabled"] = mob->IsMeleeDisabled();
|
||||
row["is_mezzed"] = mob->IsMezzed();
|
||||
row["is_moved"] = mob->IsMoved();
|
||||
row["is_moving"] = mob->IsMoving();
|
||||
row["is_no_cast"] = mob->IsNoCast();
|
||||
row["is_off_hand_atk"] = mob->IsOffHandAtk();
|
||||
row["is_pet_owner_client"] = mob->IsPetOwnerClient();
|
||||
row["is_pet_regroup"] = mob->IsPetRegroup();
|
||||
row["is_pet_stop"] = mob->IsPetStop();
|
||||
row["is_pseudo_rooted"] = mob->IsPseudoRooted();
|
||||
row["is_raid_grouped"] = mob->IsRaidGrouped();
|
||||
row["is_rare_spawn"] = mob->IsRareSpawn();
|
||||
row["is_roamer"] = mob->IsRoamer();
|
||||
row["is_rooted"] = mob->IsRooted();
|
||||
row["is_running"] = mob->IsRunning();
|
||||
row["is_silenced"] = mob->IsSilenced();
|
||||
row["is_stunned"] = mob->IsStunned();
|
||||
row["is_tar_lock_pet"] = mob->IsTargetLockPet();
|
||||
row["is_tarable"] = mob->IsTargetable();
|
||||
row["is_tared"] = mob->IsTargeted();
|
||||
row["is_temp_pet"] = mob->IsTempPet();
|
||||
row["is_trackable"] = mob->IsTrackable();
|
||||
row["item_hp_bonuses"] = mob->GetItemHPBonuses();
|
||||
row["last_name"] = mob->GetLastName();
|
||||
row["level"] = mob->GetLevel();
|
||||
row["luclin_face"] = mob->GetLuclinFace();
|
||||
row["mana"] = mob->GetMana();
|
||||
row["mana_percent"] = mob->GetManaPercent();
|
||||
row["mana_ratio"] = mob->GetManaRatio();
|
||||
row["max_hp"] = mob->GetMaxHP();
|
||||
row["max_mana"] = mob->GetMaxMana();
|
||||
row["melee_mitigation"] = mob->GetMeleeMitigation();
|
||||
row["mitigation_ac"] = mob->GetMitigationAC();
|
||||
row["movespeed"] = mob->GetMovespeed();
|
||||
row["name"] = mob->GetName();
|
||||
row["next_hp_event"] = mob->GetNextHPEvent();
|
||||
row["next_inc_hp_event"] = mob->GetNextIncHPEvent();
|
||||
row["npc_assist_cap"] = mob->NPCAssistCap();
|
||||
row["npc_type_id"] = mob->GetNPCTypeID();
|
||||
row["orig_level"] = mob->GetOrigLevel();
|
||||
row["orig_name"] = mob->GetOrigName();
|
||||
row["owner_id"] = mob->GetOwnerID();
|
||||
row["pet_id"] = mob->GetPetID();
|
||||
row["pet_power"] = mob->GetPetPower();
|
||||
row["pet_tar_lock_id"] = mob->GetPetTargetLockID();
|
||||
row["qglobal"] = mob->GetQglobal();
|
||||
row["race"] = mob->GetRace();
|
||||
row["run_anim_speed"] = mob->GetRunAnimSpeed();
|
||||
row["sanctuary"] = mob->Sanctuary();
|
||||
row["see_hide"] = mob->SeeHide();
|
||||
row["see_improved_hide"] = mob->SeeImprovedHide();
|
||||
row["see_invisible"] = mob->SeeInvisible();
|
||||
row["see_invisible_undead"] = mob->SeeInvisibleUndead();
|
||||
row["size"] = mob->GetSize();
|
||||
row["slow_mitigation"] = mob->GetSlowMitigation();
|
||||
row["snared_amount"] = mob->GetSnaredAmount();
|
||||
row["spawned"] = mob->Spawned();
|
||||
row["spell_hp_bonuses"] = mob->GetSpellHPBonuses();
|
||||
row["spell_light_type"] = mob->GetSpellLightType();
|
||||
row["spell_power_distance_mod"] = mob->GetSpellPowerDistanceMod();
|
||||
row["spell_x"] = mob->GetSpellX();
|
||||
row["spell_y"] = mob->GetSpellY();
|
||||
row["spell_z"] = mob->GetSpellZ();
|
||||
row["tar_ring_x"] = mob->GetTargetRingX();
|
||||
row["tar_ring_y"] = mob->GetTargetRingY();
|
||||
row["tar_ring_z"] = mob->GetTargetRingZ();
|
||||
row["temp_pet_count"] = mob->GetTempPetCount();
|
||||
row["texture"] = mob->GetTexture();
|
||||
row["trap_slots"] = mob->GetTrapSlots();
|
||||
row["try_death_save"] = mob->TryDeathSave();
|
||||
row["try_divine_save"] = mob->TryDivineSave();
|
||||
row["try_spell_on_death"] = mob->TrySpellOnDeath();
|
||||
row["update_active_light"] = mob->UpdateActiveLight();
|
||||
row["wander_type"] = mob->GetWanderType();
|
||||
|
||||
response.append(row);
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
Json::Value ApiGetClientListDetail(EQ::Net::WebsocketServerConnection *connection, Json::Value params)
|
||||
{
|
||||
if (zone->GetZoneID() == 0) {
|
||||
throw EQ::Net::WebsocketException("Zone must be loaded to invoke this call");
|
||||
}
|
||||
|
||||
Json::Value response;
|
||||
auto &list = entity_list.GetClientList();
|
||||
|
||||
for (auto &iter : list) {
|
||||
auto client = iter.second;
|
||||
|
||||
Json::Value row;
|
||||
|
||||
/**
|
||||
* Main
|
||||
*/
|
||||
row["id"] = client->GetID();
|
||||
row["clean_name"] = client->GetCleanName();
|
||||
row["x"] = client->GetX();
|
||||
row["y"] = client->GetY();
|
||||
row["z"] = client->GetZ();
|
||||
row["heading"] = client->GetHeading();
|
||||
|
||||
/**
|
||||
* Rest
|
||||
*/
|
||||
row["aa_percent"] = client->GetAAPercent();
|
||||
row["aa_points"] = client->GetAAPoints();
|
||||
row["aaxp"] = client->GetAAXP();
|
||||
row["account_age"] = client->GetAccountAge();
|
||||
row["account_creation"] = client->GetAccountCreation();
|
||||
row["account_id"] = client->AccountID();
|
||||
row["account_name"] = client->AccountName();
|
||||
row["act_agi"] = client->GetActAGI();
|
||||
row["act_cha"] = client->GetActCHA();
|
||||
row["act_dex"] = client->GetActDEX();
|
||||
row["act_int"] = client->GetActINT();
|
||||
row["act_sta"] = client->GetActSTA();
|
||||
row["act_str"] = client->GetActSTR();
|
||||
row["act_wis"] = client->GetActWIS();
|
||||
row["active_task_count"] = client->GetActiveTaskCount();
|
||||
row["admin"] = client->Admin();
|
||||
row["aggro_count"] = client->GetAggroCount();
|
||||
row["aggro_meter_available"] = client->AggroMeterAvailable();
|
||||
row["all_money"] = client->GetAllMoney();
|
||||
row["anon"] = client->GetAnon();
|
||||
row["atk_rating"] = client->GetATKRating();
|
||||
row["auto_attack_enabled"] = client->AutoAttackEnabled();
|
||||
row["auto_fire_enabled"] = client->AutoFireEnabled();
|
||||
row["auto_split_enabled"] = client->AutoSplitEnabled();
|
||||
row["base_agi"] = client->GetBaseAGI();
|
||||
row["base_beard"] = client->GetBaseBeard();
|
||||
row["base_beard_color"] = client->GetBaseBeardColor();
|
||||
row["base_cha"] = client->GetBaseCHA();
|
||||
row["base_class"] = client->GetBaseClass();
|
||||
row["base_corrup"] = client->GetBaseCorrup();
|
||||
row["base_details"] = client->GetBaseDetails();
|
||||
row["base_dex"] = client->GetBaseDEX();
|
||||
row["base_eye_color"] = client->GetBaseEyeColor();
|
||||
row["base_face"] = client->GetBaseFace();
|
||||
row["base_gender"] = client->GetBaseGender();
|
||||
row["base_hair_color"] = client->GetBaseHairColor();
|
||||
row["base_hair_style"] = client->GetBaseHairStyle();
|
||||
row["base_heritage"] = client->GetBaseHeritage();
|
||||
row["base_hp"] = client->GetBaseHP();
|
||||
row["base_int"] = client->GetBaseINT();
|
||||
row["base_ph_r"] = client->GetBasePhR();
|
||||
row["base_race"] = client->GetBaseRace();
|
||||
row["base_sta"] = client->GetBaseSTA();
|
||||
row["base_str"] = client->GetBaseSTR();
|
||||
row["base_tattoo"] = client->GetBaseTattoo();
|
||||
row["base_wis"] = client->GetBaseWIS();
|
||||
row["become_npc_level"] = client->GetBecomeNPCLevel();
|
||||
row["boat_id"] = client->GetBoatID();
|
||||
row["buyer_welcome_message"] = client->GetBuyerWelcomeMessage();
|
||||
row["calc_atk"] = client->CalcATK();
|
||||
row["calc_base_mana"] = client->CalcBaseMana();
|
||||
row["calc_current_weight"] = client->CalcCurrentWeight();
|
||||
row["calc_endurance_regen_cap"] = client->CalcEnduranceRegenCap();
|
||||
row["calc_hp_regen_cap"] = client->CalcHPRegenCap();
|
||||
row["calc_mana_regen_cap"] = client->CalcManaRegenCap();
|
||||
row["calc_max_mana"] = client->CalcMaxMana();
|
||||
row["can_fast_regen"] = client->CanFastRegen();
|
||||
row["can_fish"] = client->CanFish();
|
||||
row["can_med_on_horse"] = client->CanMedOnHorse();
|
||||
row["carried_money"] = client->GetCarriedMoney();
|
||||
row["char_max_level_from_bucket"] = client->GetCharMaxLevelFromBucket();
|
||||
row["char_max_level_from_q_global"] = client->GetCharMaxLevelFromQGlobal();
|
||||
row["character_id"] = client->CharacterID();
|
||||
row["check_can_unsuspend_merc"] = client->CheckCanUnsuspendMerc();
|
||||
row["check_double_attack"] = client->CheckDoubleAttack();
|
||||
row["check_double_ranged_attack"] = client->CheckDoubleRangedAttack();
|
||||
row["check_dual_wield"] = client->CheckDualWield();
|
||||
row["check_trade_non_droppable"] = client->CheckTradeNonDroppable();
|
||||
row["check_triple_attack"] = client->CheckTripleAttack();
|
||||
row["client_max_level"] = client->GetClientMaxLevel();
|
||||
row["client_version_bit"] = client->ClientVersionBit();
|
||||
row["connected"] = client->Connected();
|
||||
row["copper"] = client->GetCopper();
|
||||
row["corpse_count"] = client->GetCorpseCount();
|
||||
row["duel_tar"] = client->GetDuelTarget();
|
||||
row["ebon_crystals"] = client->GetEbonCrystals();
|
||||
row["endurance"] = client->GetEndurance();
|
||||
row["endurance_percent"] = client->GetEndurancePercent();
|
||||
row["exp"] = client->GetEXP();
|
||||
row["face"] = client->GetFace();
|
||||
row["feigned"] = client->GetFeigned();
|
||||
row["gm"] = client->GetGM();
|
||||
row["gm_speed"] = client->GetGMSpeed();
|
||||
row["gold"] = client->GetGold();
|
||||
row["group_exp"] = client->GetGroupEXP();
|
||||
row["group_leadership_aa_health_enhancement"] = client->GroupLeadershipAAHealthEnhancement();
|
||||
row["group_leadership_aa_health_regeneration"] = client->GroupLeadershipAAHealthRegeneration();
|
||||
row["group_leadership_aa_mana_enhancement"] = client->GroupLeadershipAAManaEnhancement();
|
||||
row["group_leadership_aa_offense_enhancement"] = client->GroupLeadershipAAOffenseEnhancement();
|
||||
row["group_points"] = client->GetGroupPoints();
|
||||
row["guild_id"] = client->GuildID();
|
||||
row["guild_rank"] = client->GuildRank();
|
||||
row["has_adventure_data"] = client->HasAdventureData();
|
||||
row["hide_me"] = client->GetHideMe();
|
||||
row["horse_id"] = client->GetHorseId();
|
||||
row["hunger"] = client->GetHunger();
|
||||
row["hungry"] = client->Hungry();
|
||||
row["in_zone"] = client->InZone();
|
||||
row["instance_id"] = client->GetInstanceID();
|
||||
row["interrogate_inv_state"] = client->GetInterrogateInvState();
|
||||
row["ip"] = client->GetIP();
|
||||
row["is_become_npc"] = client->IsBecomeNPC();
|
||||
row["is_buyer"] = client->IsBuyer();
|
||||
row["is_dead"] = client->IsDead();
|
||||
row["is_dragging_corpse"] = client->IsDraggingCorpse();
|
||||
row["is_dueling"] = client->IsDueling();
|
||||
row["is_guild_banker"] = client->IsGuildBanker();
|
||||
row["is_hovering_for_respawn"] = client->IsHoveringForRespawn();
|
||||
row["is_in_a_guild"] = client->IsInAGuild();
|
||||
row["is_ld"] = client->IsLD();
|
||||
row["is_leadership_exp_on"] = client->IsLeadershipEXPOn();
|
||||
row["is_lfp"] = client->IsLFP();
|
||||
row["is_medding"] = client->IsMedding();
|
||||
row["is_on_adventure"] = client->IsOnAdventure();
|
||||
row["is_rezz_pending"] = client->IsRezzPending();
|
||||
row["is_sitting"] = client->IsSitting();
|
||||
row["is_starved"] = client->IsStarved();
|
||||
row["is_tracking"] = client->IsTracking();
|
||||
row["is_trader"] = client->IsTrader();
|
||||
row["is_unconscious"] = client->IsUnconscious();
|
||||
row["ldon_losses"] = client->GetLDoNLosses();
|
||||
row["ldon_wins"] = client->GetLDoNWins();
|
||||
row["last_inv_snapshot_time"] = client->GetLastInvSnapshotTime();
|
||||
row["last_name"] = client->GetLastName();
|
||||
row["level2"] = client->GetLevel2();
|
||||
row["level_regen"] = client->LevelRegen();
|
||||
row["ls_account_id"] = client->LSAccountID();
|
||||
row["max_endurance"] = client->GetMaxEndurance();
|
||||
row["max_x_tars"] = client->GetMaxXTargets();
|
||||
row["merc_id"] = client->GetMercID();
|
||||
row["merc_only_or_no_group"] = client->MercOnlyOrNoGroup();
|
||||
row["merc_slot"] = client->GetMercSlot();
|
||||
row["next_inv_snapshot_time"] = client->GetNextInvSnapshotTime();
|
||||
row["num_mercs"] = client->GetNumMercs();
|
||||
row["pending_adventure_create"] = client->GetPendingAdventureCreate();
|
||||
row["pending_adventure_door_click"] = client->GetPendingAdventureDoorClick();
|
||||
row["pending_adventure_leave"] = client->GetPendingAdventureLeave();
|
||||
row["pending_adventure_request"] = client->GetPendingAdventureRequest();
|
||||
row["pending_guild_invitation"] = client->GetPendingGuildInvitation();
|
||||
row["platinum"] = client->GetPlatinum();
|
||||
row["port"] = client->GetPort();
|
||||
row["primary_skill_value"] = client->GetPrimarySkillValue();
|
||||
row["proximity_x"] = client->ProximityX();
|
||||
row["proximity_y"] = client->ProximityY();
|
||||
row["proximity_z"] = client->ProximityZ();
|
||||
row["pvp_points"] = client->GetPVPPoints();
|
||||
row["radiant_crystals"] = client->GetRadiantCrystals();
|
||||
row["raid_exp"] = client->GetRaidEXP();
|
||||
row["raid_points"] = client->GetRaidPoints();
|
||||
row["raw_item_ac"] = client->GetRawItemAC();
|
||||
row["required_aa_experience"] = client->GetRequiredAAExperience();
|
||||
row["revoked"] = client->GetRevoked();
|
||||
row["run_mode"] = client->GetRunMode();
|
||||
row["save_currency"] = client->SaveCurrency();
|
||||
row["save_task_state"] = client->SaveTaskState();
|
||||
row["silver"] = client->GetSilver();
|
||||
row["skill_points"] = client->GetSkillPoints();
|
||||
row["spent_aa"] = client->GetSpentAA();
|
||||
row["tgb"] = client->TGB();
|
||||
row["thirst"] = client->GetThirst();
|
||||
row["thirsty"] = client->Thirsty();
|
||||
row["total_atk"] = client->GetTotalATK();
|
||||
row["total_seconds_played"] = client->GetTotalSecondsPlayed();
|
||||
row["weight"] = client->GetWeight();
|
||||
row["wid"] = client->GetWID();
|
||||
row["x_tarting_available"] = client->XTargettingAvailable();
|
||||
|
||||
response.append(row);
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
Json::Value ApiGetZoneAttributes(EQ::Net::WebsocketServerConnection *connection, Json::Value params)
|
||||
{
|
||||
if (zone->GetZoneID() == 0) {
|
||||
throw EQ::Net::WebsocketException("Zone must be loaded to invoke this call");
|
||||
}
|
||||
|
||||
Json::Value response;
|
||||
Json::Value row;
|
||||
|
||||
row["aggro_limit_reached"] = zone->AggroLimitReached();
|
||||
row["allow_mercs"] = zone->AllowMercs();
|
||||
row["buff_timers_suspended"] = zone->BuffTimersSuspended();
|
||||
row["can_bind"] = zone->CanBind();
|
||||
row["can_cast_outdoor"] = zone->CanCastOutdoor();
|
||||
row["can_do_combat"] = zone->CanDoCombat();
|
||||
row["can_levitate"] = zone->CanLevitate();
|
||||
row["count_auth"] = zone->CountAuth();
|
||||
row["count_spawn2"] = zone->CountSpawn2();
|
||||
row["file_name"] = zone->GetFileName();
|
||||
row["graveyard_id"] = zone->graveyard_id();
|
||||
row["graveyard_zoneid"] = zone->graveyard_zoneid();
|
||||
row["has_graveyard"] = zone->HasGraveyard();
|
||||
row["has_map"] = zone->HasMap();
|
||||
row["has_water_map"] = zone->HasWaterMap();
|
||||
row["has_weather"] = zone->HasWeather();
|
||||
row["instance_id"] = zone->GetInstanceID();
|
||||
row["instance_version"] = zone->GetInstanceVersion();
|
||||
row["instant_grids"] = zone->InstantGrids();
|
||||
row["is_city"] = zone->IsCity();
|
||||
row["is_hotzone"] = zone->IsHotzone();
|
||||
row["is_instance_persistent"] = zone->IsInstancePersistent();
|
||||
row["is_pvp_zone"] = zone->IsPVPZone();
|
||||
row["is_static_zone"] = zone->IsStaticZone();
|
||||
row["is_ucs_server_available"] = zone->IsUCSServerAvailable();
|
||||
row["long_name"] = zone->GetLongName();
|
||||
row["max_clients"] = zone->GetMaxClients();
|
||||
row["mobs_aggro_count"] = zone->MobsAggroCount();
|
||||
row["save_zone_cfg"] = zone->SaveZoneCFG();
|
||||
row["short_name"] = zone->GetShortName();
|
||||
row["total_blocked_spells"] = zone->GetTotalBlockedSpells();
|
||||
row["zone_id"] = zone->GetZoneID();
|
||||
row["zone_type"] = zone->GetZoneType();
|
||||
|
||||
response.append(row);
|
||||
return response;
|
||||
}
|
||||
|
||||
Json::Value ApiGetLogsysCategories(EQ::Net::WebsocketServerConnection *connection, Json::Value params)
|
||||
{
|
||||
if (zone->GetZoneID() == 0) {
|
||||
throw EQ::Net::WebsocketException("Zone must be loaded to invoke this call");
|
||||
}
|
||||
|
||||
Json::Value response;
|
||||
|
||||
for (int i = 1; i < Logs::LogCategory::MaxCategoryID; i++) {
|
||||
Json::Value row;
|
||||
|
||||
row["log_category_id"] = i;
|
||||
row["log_category_description"] = Logs::LogCategoryName[i];
|
||||
row["log_to_console"] = LogSys.log_settings[i].log_to_console;
|
||||
row["log_to_file"] = LogSys.log_settings[i].log_to_file;
|
||||
row["log_to_gmsay"] = LogSys.log_settings[i].log_to_gmsay;
|
||||
|
||||
response.append(row);
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
Json::Value ApiSetLoggingLevel(EQ::Net::WebsocketServerConnection *connection, Json::Value params)
|
||||
{
|
||||
if (zone->GetZoneID() == 0) {
|
||||
throw EQ::Net::WebsocketException("Zone must be loaded to invoke this call");
|
||||
}
|
||||
|
||||
Json::Value response;
|
||||
|
||||
auto logging_category = params[0].asInt();
|
||||
auto logging_level = params[1].asInt();
|
||||
|
||||
response["status"] = "Category doesn't exist";
|
||||
|
||||
Log(Logs::General, Logs::Status, "Logging category is %i and level is %i",
|
||||
logging_category,
|
||||
logging_level
|
||||
);
|
||||
|
||||
if (logging_category < Logs::LogCategory::MaxCategoryID &&
|
||||
logging_category > Logs::LogCategory::None
|
||||
) {
|
||||
LogSys.log_settings[logging_category].log_to_console = logging_level;
|
||||
response["status"] = "Category log level updated";
|
||||
}
|
||||
|
||||
if (logging_level > 0) {
|
||||
LogSys.log_settings[logging_category].is_category_enabled = 1;
|
||||
}
|
||||
else {
|
||||
LogSys.log_settings[logging_category].is_category_enabled = 0;
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
void RegisterApiLogEvent(std::unique_ptr<EQ::Net::WebsocketServer> &server)
|
||||
{
|
||||
LogSys.SetConsoleHandler(
|
||||
[&](uint16 debug_level, uint16 log_category, const std::string &msg) {
|
||||
Json::Value data;
|
||||
data["debug_level"] = debug_level;
|
||||
data["log_category"] = log_category;
|
||||
data["msg"] = msg;
|
||||
server->DispatchEvent(EQ::Net::SubscriptionEventLog, data, 50);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
void RegisterApiService(std::unique_ptr<EQ::Net::WebsocketServer> &server)
|
||||
{
|
||||
server->SetLoginHandler(CheckLogin);
|
||||
server->SetMethodHandler("get_packet_statistics", &ApiGetPacketStatistics, 50);
|
||||
server->SetMethodHandler("get_opcode_list", &ApiGetOpcodeList, 50);
|
||||
server->SetMethodHandler("get_npc_list_detail", &ApiGetNpcListDetail, 50);
|
||||
server->SetMethodHandler("get_door_list_detail", &ApiGetDoorListDetail, 50);
|
||||
server->SetMethodHandler("get_corpse_list_detail", &ApiGetCorpseListDetail, 50);
|
||||
server->SetMethodHandler("get_object_list_detail", &ApiGetObjectListDetail, 50);
|
||||
server->SetMethodHandler("get_mob_list_detail", &ApiGetMobListDetail, 50);
|
||||
server->SetMethodHandler("get_client_list_detail", &ApiGetClientListDetail, 50);
|
||||
server->SetMethodHandler("get_zone_attributes", &ApiGetZoneAttributes, 50);
|
||||
server->SetMethodHandler("get_logsys_categories", &ApiGetLogsysCategories, 50);
|
||||
server->SetMethodHandler("set_logging_level", &ApiSetLoggingLevel, 50);
|
||||
|
||||
RegisterApiLogEvent(server);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* EQEmulator: Everquest Server Emulator
|
||||
* Copyright (C) 2001-2019 EQEmulator Development Team (https://github.com/EQEmu/Server)
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include "../common/net/websocket_server.h"
|
||||
|
||||
void RegisterApiService(std::unique_ptr<EQ::Net::WebsocketServer> &server);
|
||||
+35
-2
@@ -1401,7 +1401,8 @@ int bot_command_init(void)
|
||||
bot_command_add("movementspeed", "Orders a bot to cast a movement speed enhancement spell", 0, bot_command_movement_speed) ||
|
||||
bot_command_add("owneroption", "Sets options available to bot owners", 0, bot_command_owner_option) ||
|
||||
bot_command_add("pet", "Lists the available bot pet [subcommands]", 0, bot_command_pet) ||
|
||||
bot_command_add("petremove", "Orders a bot to remove its pet", 0, bot_subcommand_pet_remove) ||
|
||||
bot_command_add("petgetlost", "Orders a bot to remove its summoned pet", 0, bot_subcommand_pet_get_lost) ||
|
||||
bot_command_add("petremove", "Orders a bot to remove its charmed pet", 0, bot_subcommand_pet_remove) ||
|
||||
bot_command_add("petsettype", "Orders a Magician bot to use a specified pet type", 0, bot_subcommand_pet_set_type) ||
|
||||
bot_command_add("picklock", "Orders a capable bot to pick the lock of the closest door", 0, bot_command_pick_lock) ||
|
||||
bot_command_add("portal", "Orders a Wizard bot to open a magical doorway to a specified destination", 0, bot_subcommand_portal) ||
|
||||
@@ -3479,12 +3480,13 @@ void bot_command_pet(Client *c, const Seperator *sep)
|
||||
{
|
||||
/* VS2012 code - begin */
|
||||
std::list<const char*> subcommand_list;
|
||||
subcommand_list.push_back("petgetlost");
|
||||
subcommand_list.push_back("petremove");
|
||||
subcommand_list.push_back("petsettype");
|
||||
/* VS2012 code - end */
|
||||
|
||||
/* VS2013 code
|
||||
const std::list<const char*> subcommand_list = { "petremove", "petsettype" };
|
||||
const std::list<const char*> subcommand_list = { "petgetlost", "petremove", "petsettype" };
|
||||
*/
|
||||
|
||||
if (helper_command_alias_fail(c, "bot_command_pet", sep->arg[0], "pet"))
|
||||
@@ -7433,6 +7435,37 @@ void bot_subcommand_inventory_window(Client *c, const Seperator *sep)
|
||||
c->SendPopupToClient(window_title.c_str(), window_text.c_str());
|
||||
}
|
||||
|
||||
void bot_subcommand_pet_get_lost(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (helper_command_alias_fail(c, "bot_subcommand_pet_get_lost", sep->arg[0], "petgetlost"))
|
||||
return;
|
||||
if (helper_is_help_or_usage(sep->arg[1])) {
|
||||
c->Message(m_usage, "usage: %s ([actionable: target | byname | ownergroup | botgroup | targetgroup | namesgroup | healrotation | spawned] ([actionable_name]))", sep->arg[0]);
|
||||
return;
|
||||
}
|
||||
int ab_mask = ActionableBots::ABM_NoFilter;
|
||||
|
||||
std::list<Bot*> sbl;
|
||||
if (ActionableBots::PopulateSBL(c, sep->arg[1], sbl, ab_mask, sep->arg[2]) == ActionableBots::ABT_None)
|
||||
return;
|
||||
|
||||
int summoned_pet = 0;
|
||||
for (auto bot_iter : sbl) {
|
||||
if (!bot_iter->GetPet() || bot_iter->GetPet()->IsCharmed())
|
||||
continue;
|
||||
|
||||
bot_iter->GetPet()->Say_StringID(PET_GETLOST_STRING);
|
||||
bot_iter->GetPet()->Depop(false);
|
||||
bot_iter->SetPetID(0);
|
||||
database.botdb.DeletePetItems(bot_iter->GetBotID());
|
||||
database.botdb.DeletePetBuffs(bot_iter->GetBotID());
|
||||
database.botdb.DeletePetStats(bot_iter->GetBotID());
|
||||
++summoned_pet;
|
||||
}
|
||||
|
||||
c->Message(m_action, "%i of your bots released their summoned pet%s", summoned_pet, (summoned_pet == 1) ? "" : "s");
|
||||
}
|
||||
|
||||
void bot_subcommand_pet_remove(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (helper_command_alias_fail(c, "bot_subcommand_pet_remove", sep->arg[0], "petremove"))
|
||||
|
||||
@@ -652,6 +652,7 @@ void bot_subcommand_inventory_give(Client *c, const Seperator *sep);
|
||||
void bot_subcommand_inventory_list(Client *c, const Seperator *sep);
|
||||
void bot_subcommand_inventory_remove(Client *c, const Seperator *sep);
|
||||
void bot_subcommand_inventory_window(Client *c, const Seperator *sep);
|
||||
void bot_subcommand_pet_get_lost(Client *c, const Seperator *sep);
|
||||
void bot_subcommand_pet_remove(Client *c, const Seperator *sep);
|
||||
void bot_subcommand_pet_set_type(Client *c, const Seperator *sep);
|
||||
void bot_subcommand_portal(Client *c, const Seperator *sep);
|
||||
|
||||
+168
-76
@@ -55,6 +55,7 @@
|
||||
#include "../common/say_link.h"
|
||||
#include "../common/eqemu_logsys.h"
|
||||
#include "../common/profanity_manager.h"
|
||||
#include "../common/net/eqstream.h"
|
||||
|
||||
#include "data_bucket.h"
|
||||
#include "command.h"
|
||||
@@ -844,18 +845,32 @@ void command_setanim(Client *c, const Seperator *sep)
|
||||
|
||||
void command_serverinfo(Client *c, const Seperator *sep)
|
||||
{
|
||||
#ifdef _WINDOWS
|
||||
char intbuffer [sizeof(unsigned long)];
|
||||
c->Message(0, "Operating system information.");
|
||||
c->Message(0, " %s", Ver_name);
|
||||
c->Message(0, " Build number: %s", ultoa(Ver_build, intbuffer, 10));
|
||||
c->Message(0, " Minor version: %s", ultoa(Ver_min, intbuffer, 10));
|
||||
c->Message(0, " Major version: %s", ultoa(Ver_maj, intbuffer, 10));
|
||||
c->Message(0, " Platform Id: %s", ultoa(Ver_pid, intbuffer, 10));
|
||||
#else
|
||||
char buffer[255];
|
||||
c->Message(0, "Operating system information: %s", GetOS(buffer));
|
||||
#endif
|
||||
auto os = EQ::GetOS();
|
||||
auto cpus = EQ::GetCPUs();
|
||||
auto pid = EQ::GetPID();
|
||||
auto rss = EQ::GetRSS();
|
||||
auto uptime = EQ::GetUptime();
|
||||
|
||||
c->Message(0, "Operating System Information");
|
||||
c->Message(0, "==================================================");
|
||||
c->Message(0, "System: %s", os.sysname.c_str());
|
||||
c->Message(0, "Release: %s", os.release.c_str());
|
||||
c->Message(0, "Version: %s", os.version.c_str());
|
||||
c->Message(0, "Machine: %s", os.machine.c_str());
|
||||
c->Message(0, "Uptime: %.2f seconds", uptime);
|
||||
c->Message(0, "==================================================");
|
||||
c->Message(0, "CPU Information");
|
||||
c->Message(0, "==================================================");
|
||||
for (size_t i = 0; i < cpus.size(); ++i) {
|
||||
auto &cp = cpus[i];
|
||||
c->Message(0, "CPU #%i: %s, Speed: %.2fGhz", i, cp.model.c_str(), cp.speed);
|
||||
}
|
||||
c->Message(0, "==================================================");
|
||||
c->Message(0, "Process Information");
|
||||
c->Message(0, "==================================================");
|
||||
c->Message(0, "PID: %u", pid);
|
||||
c->Message(0, "RSS: %.2f MB", rss / 1048576.0);
|
||||
c->Message(0, "==================================================");
|
||||
}
|
||||
|
||||
void command_getvariable(Client *c, const Seperator *sep)
|
||||
@@ -9494,23 +9509,77 @@ void command_netstats(Client *c, const Seperator *sep)
|
||||
{
|
||||
if(c)
|
||||
{
|
||||
if(c->GetTarget() && c->GetTarget()->IsClient())
|
||||
{
|
||||
c->Message(0, "Sent:");
|
||||
c->Message(0, "Total: %u, per second: %u", c->GetTarget()->CastToClient()->Connection()->GetBytesSent(),
|
||||
c->GetTarget()->CastToClient()->Connection()->GetBytesSentPerSecond());
|
||||
c->Message(0, "Recieved:");
|
||||
c->Message(0, "Total: %u, per second: %u", c->GetTarget()->CastToClient()->Connection()->GetBytesRecieved(),
|
||||
c->GetTarget()->CastToClient()->Connection()->GetBytesRecvPerSecond());
|
||||
auto client = c;
|
||||
if (c->GetTarget() && c->GetTarget()->IsClient()) {
|
||||
client = c->GetTarget()->CastToClient();
|
||||
}
|
||||
|
||||
if (strcasecmp(sep->arg[1], "reset") == 0) {
|
||||
auto connection = c->Connection();
|
||||
c->Message(0, "Resetting client stats (packet loss will not read correctly after reset).");
|
||||
connection->ResetStats();
|
||||
return;
|
||||
}
|
||||
|
||||
auto connection = c->Connection();
|
||||
auto opts = connection->GetManager()->GetOptions();
|
||||
auto eqs_stats = connection->GetStats();
|
||||
auto &stats = eqs_stats.DaybreakStats;
|
||||
auto now = EQ::Net::Clock::now();
|
||||
auto sec_since_stats_reset = std::chrono::duration_cast<std::chrono::duration<double>>(now - stats.created).count();
|
||||
|
||||
c->Message(0, "Netstats:");
|
||||
c->Message(0, "--------------------------------------------------------------------");
|
||||
c->Message(0, "Sent Bytes: %u (%.2f/sec)", stats.sent_bytes, stats.sent_bytes / sec_since_stats_reset);
|
||||
c->Message(0, "Recv Bytes: %u (%.2f/sec)", stats.recv_bytes, stats.recv_bytes / sec_since_stats_reset);
|
||||
c->Message(0, "Bytes Before Encode (Sent): %u, Compression Rate: %.2f%%", stats.bytes_before_encode,
|
||||
static_cast<double>(stats.bytes_before_encode - stats.sent_bytes) / static_cast<double>(stats.bytes_before_encode) * 100.0);
|
||||
c->Message(0, "Bytes After Decode (Recv): %u, Compression Rate: %.2f%%", stats.bytes_after_decode,
|
||||
static_cast<double>(stats.bytes_after_decode - stats.recv_bytes) / static_cast<double>(stats.bytes_after_decode) * 100.0);
|
||||
c->Message(0, "Min Ping: %u", stats.min_ping);
|
||||
c->Message(0, "Max Ping: %u", stats.max_ping);
|
||||
c->Message(0, "Last Ping: %u", stats.last_ping);
|
||||
c->Message(0, "Average Ping: %u", stats.avg_ping);
|
||||
c->Message(0, "--------------------------------------------------------------------");
|
||||
c->Message(0, "(Realtime) Recv Packets: %u (%.2f/sec)", stats.recv_packets, stats.recv_packets / sec_since_stats_reset);
|
||||
c->Message(0, "(Realtime) Sent Packets: %u (%.2f/sec)", stats.sent_packets, stats.sent_packets / sec_since_stats_reset);
|
||||
c->Message(0, "(Sync) Recv Packets: %u", stats.sync_recv_packets);
|
||||
c->Message(0, "(Sync) Sent Packets: %u", stats.sync_sent_packets);
|
||||
c->Message(0, "(Sync) Remote Recv Packets: %u", stats.sync_remote_recv_packets);
|
||||
c->Message(0, "(Sync) Remote Sent Packets: %u", stats.sync_remote_sent_packets);
|
||||
c->Message(0, "Packet Loss In: %.2f%%", 100.0 * (1.0 - static_cast<double>(stats.sync_recv_packets) / static_cast<double>(stats.sync_remote_sent_packets)));
|
||||
c->Message(0, "Packet Loss Out: %.2f%%", 100.0 * (1.0 - static_cast<double>(stats.sync_remote_recv_packets) / static_cast<double>(stats.sync_sent_packets)));
|
||||
c->Message(0, "--------------------------------------------------------------------");
|
||||
c->Message(0, "Resent Packets: %u (%.2f/sec)", stats.resent_packets, stats.resent_packets / sec_since_stats_reset);
|
||||
c->Message(0, "Resent Fragments: %u (%.2f/sec)", stats.resent_fragments, stats.resent_fragments / sec_since_stats_reset);
|
||||
c->Message(0, "Resent Non-Fragments: %u (%.2f/sec)", stats.resent_full, stats.resent_full / sec_since_stats_reset);
|
||||
c->Message(0, "Dropped Datarate Packets: %u (%.2f/sec)", stats.dropped_datarate_packets, stats.dropped_datarate_packets / sec_since_stats_reset);
|
||||
|
||||
if (opts.daybreak_options.outgoing_data_rate > 0.0) {
|
||||
c->Message(0, "Outgoing Link Saturation %.2f%% (%.2fkb/sec)", 100.0 * (1.0 - ((opts.daybreak_options.outgoing_data_rate - stats.datarate_remaining) / opts.daybreak_options.outgoing_data_rate)), opts.daybreak_options.outgoing_data_rate);
|
||||
}
|
||||
|
||||
if (strcasecmp(sep->arg[1], "full") == 0) {
|
||||
c->Message(0, "--------------------------------------------------------------------");
|
||||
c->Message(0, "Sent Packet Types");
|
||||
for (auto i = 0; i < _maxEmuOpcode; ++i) {
|
||||
auto cnt = eqs_stats.SentCount[i];
|
||||
if (cnt > 0) {
|
||||
c->Message(0, "%s: %u (%.2f / sec)", OpcodeNames[i], cnt, cnt / sec_since_stats_reset);
|
||||
}
|
||||
}
|
||||
|
||||
c->Message(0, "--------------------------------------------------------------------");
|
||||
c->Message(0, "Recv Packet Types");
|
||||
for (auto i = 0; i < _maxEmuOpcode; ++i) {
|
||||
auto cnt = eqs_stats.RecvCount[i];
|
||||
if (cnt > 0) {
|
||||
c->Message(0, "%s: %u (%.2f / sec)", OpcodeNames[i], cnt, cnt / sec_since_stats_reset);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
c->Message(0, "Sent:");
|
||||
c->Message(0, "Total: %u, per second: %u", c->Connection()->GetBytesSent(), c->Connection()->GetBytesSentPerSecond());
|
||||
c->Message(0, "Recieved:");
|
||||
c->Message(0, "Total: %u, per second: %u", c->Connection()->GetBytesRecieved(), c->Connection()->GetBytesRecvPerSecond());
|
||||
}
|
||||
|
||||
c->Message(0, "--------------------------------------------------------------------");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11716,15 +11785,25 @@ void command_logs(Client *c, const Seperator *sep){
|
||||
safe_delete(pack);
|
||||
}
|
||||
/* #logs list_settings */
|
||||
if (strcasecmp(sep->arg[1], "list_settings") == 0 || (strcasecmp(sep->arg[1], "set") == 0 && strcasecmp(sep->arg[3], "") == 0)){
|
||||
if (strcasecmp(sep->arg[1], "list_settings") == 0 ||
|
||||
(strcasecmp(sep->arg[1], "set") == 0 && strcasecmp(sep->arg[3], "") == 0)) {
|
||||
c->Message(0, "[Category ID | console | file | gmsay | Category Description]");
|
||||
int redisplay_columns = 0;
|
||||
for (int i = 0; i < Logs::LogCategory::MaxCategoryID; i++){
|
||||
if (redisplay_columns == 10){
|
||||
for (int i = 0; i < Logs::LogCategory::MaxCategoryID; i++) {
|
||||
if (redisplay_columns == 10) {
|
||||
c->Message(0, "[Category ID | console | file | gmsay | Category Description]");
|
||||
redisplay_columns = 0;
|
||||
}
|
||||
c->Message(0, StringFormat("--- %i | %u | %u | %u | %s", i, LogSys.log_settings[i].log_to_console, LogSys.log_settings[i].log_to_file, LogSys.log_settings[i].log_to_gmsay, Logs::LogCategoryName[i]).c_str());
|
||||
c->Message(
|
||||
0,
|
||||
StringFormat(
|
||||
"--- %i | %u | %u | %u | %s",
|
||||
i,
|
||||
LogSys.log_settings[i].log_to_console,
|
||||
LogSys.log_settings[i].log_to_file,
|
||||
LogSys.log_settings[i].log_to_gmsay,
|
||||
Logs::LogCategoryName[i]
|
||||
).c_str());
|
||||
redisplay_columns++;
|
||||
}
|
||||
}
|
||||
@@ -12179,33 +12258,32 @@ void command_network(Client *c, const Seperator *sep)
|
||||
if (!strcasecmp(sep->arg[1], "getopt"))
|
||||
{
|
||||
auto eqsi = c->Connection();
|
||||
auto dbc = eqsi->GetRawConnection();
|
||||
auto manager = dbc->GetManager();
|
||||
auto &opts = manager->GetOptions();
|
||||
|
||||
auto manager = eqsi->GetManager();
|
||||
auto opts = manager->GetOptions();
|
||||
|
||||
if (!strcasecmp(sep->arg[2], "all"))
|
||||
{
|
||||
c->Message(0, "max_packet_size: %llu", opts.max_packet_size);
|
||||
c->Message(0, "max_connection_count: %llu", opts.max_connection_count);
|
||||
c->Message(0, "keepalive_delay_ms: %llu", opts.keepalive_delay_ms);
|
||||
c->Message(0, "resend_delay_factor: %.2f", opts.resend_delay_factor);
|
||||
c->Message(0, "resend_delay_ms: %llu", opts.resend_delay_ms);
|
||||
c->Message(0, "resend_delay_min: %llu", opts.resend_delay_min);
|
||||
c->Message(0, "resend_delay_max: %llu", opts.resend_delay_max);
|
||||
c->Message(0, "connect_delay_ms: %llu", opts.connect_delay_ms);
|
||||
c->Message(0, "connect_stale_ms: %llu", opts.connect_stale_ms);
|
||||
c->Message(0, "stale_connection_ms: %llu", opts.stale_connection_ms);
|
||||
c->Message(0, "crc_length: %llu", opts.crc_length);
|
||||
c->Message(0, "hold_size: %llu", opts.hold_size);
|
||||
c->Message(0, "hold_length_ms: %llu", opts.hold_length_ms);
|
||||
c->Message(0, "simulated_in_packet_loss: %llu", opts.simulated_in_packet_loss);
|
||||
c->Message(0, "simulated_out_packet_loss: %llu", opts.simulated_out_packet_loss);
|
||||
c->Message(0, "tic_rate_hertz: %.2f", opts.tic_rate_hertz);
|
||||
c->Message(0, "resend_timeout: %llu", opts.resend_timeout);
|
||||
c->Message(0, "connection_close_time: %llu", opts.connection_close_time);
|
||||
c->Message(0, "encode_passes[0]: %llu", opts.encode_passes[0]);
|
||||
c->Message(0, "encode_passes[1]: %llu", opts.encode_passes[1]);
|
||||
c->Message(0, "port: %llu", opts.port);
|
||||
c->Message(0, "max_packet_size: %llu", (uint64_t)opts.daybreak_options.max_packet_size);
|
||||
c->Message(0, "max_connection_count: %llu", (uint64_t)opts.daybreak_options.max_connection_count);
|
||||
c->Message(0, "keepalive_delay_ms: %llu", (uint64_t)opts.daybreak_options.keepalive_delay_ms);
|
||||
c->Message(0, "resend_delay_factor: %.2f", opts.daybreak_options.resend_delay_factor);
|
||||
c->Message(0, "resend_delay_ms: %llu", (uint64_t)opts.daybreak_options.resend_delay_ms);
|
||||
c->Message(0, "resend_delay_min: %llu", (uint64_t)opts.daybreak_options.resend_delay_min);
|
||||
c->Message(0, "resend_delay_max: %llu", (uint64_t)opts.daybreak_options.resend_delay_max);
|
||||
c->Message(0, "connect_delay_ms: %llu", (uint64_t)opts.daybreak_options.connect_delay_ms);
|
||||
c->Message(0, "connect_stale_ms: %llu", (uint64_t)opts.daybreak_options.connect_stale_ms);
|
||||
c->Message(0, "stale_connection_ms: %llu", (uint64_t)opts.daybreak_options.stale_connection_ms);
|
||||
c->Message(0, "crc_length: %llu", (uint64_t)opts.daybreak_options.crc_length);
|
||||
c->Message(0, "hold_size: %llu", (uint64_t)opts.daybreak_options.hold_size);
|
||||
c->Message(0, "hold_length_ms: %llu", (uint64_t)opts.daybreak_options.hold_length_ms);
|
||||
c->Message(0, "simulated_in_packet_loss: %llu", (uint64_t)opts.daybreak_options.simulated_in_packet_loss);
|
||||
c->Message(0, "simulated_out_packet_loss: %llu", (uint64_t)opts.daybreak_options.simulated_out_packet_loss);
|
||||
c->Message(0, "tic_rate_hertz: %.2f", opts.daybreak_options.tic_rate_hertz);
|
||||
c->Message(0, "resend_timeout: %llu", (uint64_t)opts.daybreak_options.resend_timeout);
|
||||
c->Message(0, "connection_close_time: %llu", (uint64_t)opts.daybreak_options.connection_close_time);
|
||||
c->Message(0, "encode_passes[0]: %llu", (uint64_t)opts.daybreak_options.encode_passes[0]);
|
||||
c->Message(0, "encode_passes[1]: %llu", (uint64_t)opts.daybreak_options.encode_passes[1]);
|
||||
c->Message(0, "port: %llu", (uint64_t)opts.daybreak_options.port);
|
||||
}
|
||||
else {
|
||||
c->Message(0, "Unknown get option: %s", sep->arg[2]);
|
||||
@@ -12238,76 +12316,90 @@ void command_network(Client *c, const Seperator *sep)
|
||||
else if (!strcasecmp(sep->arg[1], "setopt"))
|
||||
{
|
||||
auto eqsi = c->Connection();
|
||||
auto dbc = eqsi->GetRawConnection();
|
||||
auto manager = dbc->GetManager();
|
||||
auto &opts = manager->GetOptions();
|
||||
|
||||
auto manager = eqsi->GetManager();
|
||||
auto opts = manager->GetOptions();
|
||||
|
||||
if (!strcasecmp(sep->arg[3], ""))
|
||||
{
|
||||
c->Message(0, "Missing value for set");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
std::string value = sep->arg[3];
|
||||
if (!strcasecmp(sep->arg[2], "max_connection_count"))
|
||||
{
|
||||
opts.max_connection_count = std::stoull(value);
|
||||
opts.daybreak_options.max_connection_count = std::stoull(value);
|
||||
manager->SetOptions(opts);
|
||||
}
|
||||
else if (!strcasecmp(sep->arg[2], "keepalive_delay_ms"))
|
||||
{
|
||||
opts.keepalive_delay_ms = std::stoull(value);
|
||||
opts.daybreak_options.keepalive_delay_ms = std::stoull(value);
|
||||
manager->SetOptions(opts);
|
||||
}
|
||||
else if (!strcasecmp(sep->arg[2], "resend_delay_factor"))
|
||||
{
|
||||
opts.resend_delay_factor = std::stod(value);
|
||||
opts.daybreak_options.resend_delay_factor = std::stod(value);
|
||||
manager->SetOptions(opts);
|
||||
}
|
||||
else if (!strcasecmp(sep->arg[2], "resend_delay_ms"))
|
||||
{
|
||||
opts.resend_delay_ms = std::stoull(value);
|
||||
opts.daybreak_options.resend_delay_ms = std::stoull(value);
|
||||
manager->SetOptions(opts);
|
||||
}
|
||||
else if (!strcasecmp(sep->arg[2], "resend_delay_min"))
|
||||
{
|
||||
opts.resend_delay_min = std::stoull(value);
|
||||
opts.daybreak_options.resend_delay_min = std::stoull(value);
|
||||
manager->SetOptions(opts);
|
||||
}
|
||||
else if (!strcasecmp(sep->arg[2], "resend_delay_max"))
|
||||
{
|
||||
opts.resend_delay_max = std::stoull(value);
|
||||
opts.daybreak_options.resend_delay_max = std::stoull(value);
|
||||
manager->SetOptions(opts);
|
||||
}
|
||||
else if (!strcasecmp(sep->arg[2], "connect_delay_ms"))
|
||||
{
|
||||
opts.connect_delay_ms = std::stoull(value);
|
||||
opts.daybreak_options.connect_delay_ms = std::stoull(value);
|
||||
manager->SetOptions(opts);
|
||||
}
|
||||
else if (!strcasecmp(sep->arg[2], "connect_stale_ms"))
|
||||
{
|
||||
opts.connect_stale_ms = std::stoull(value);
|
||||
opts.daybreak_options.connect_stale_ms = std::stoull(value);
|
||||
manager->SetOptions(opts);
|
||||
}
|
||||
else if (!strcasecmp(sep->arg[2], "stale_connection_ms"))
|
||||
{
|
||||
opts.stale_connection_ms = std::stoull(value);
|
||||
opts.daybreak_options.stale_connection_ms = std::stoull(value);
|
||||
manager->SetOptions(opts);
|
||||
}
|
||||
else if (!strcasecmp(sep->arg[2], "hold_size"))
|
||||
{
|
||||
opts.hold_size = std::stoull(value);
|
||||
opts.daybreak_options.hold_size = std::stoull(value);
|
||||
manager->SetOptions(opts);
|
||||
}
|
||||
else if (!strcasecmp(sep->arg[2], "hold_length_ms"))
|
||||
{
|
||||
opts.hold_length_ms = std::stoull(value);
|
||||
opts.daybreak_options.hold_length_ms = std::stoull(value);
|
||||
manager->SetOptions(opts);
|
||||
}
|
||||
else if (!strcasecmp(sep->arg[2], "simulated_in_packet_loss"))
|
||||
{
|
||||
opts.simulated_in_packet_loss = std::stoull(value);
|
||||
opts.daybreak_options.simulated_in_packet_loss = std::stoull(value);
|
||||
manager->SetOptions(opts);
|
||||
}
|
||||
else if (!strcasecmp(sep->arg[2], "simulated_out_packet_loss"))
|
||||
{
|
||||
opts.simulated_out_packet_loss = std::stoull(value);
|
||||
opts.daybreak_options.simulated_out_packet_loss = std::stoull(value);
|
||||
manager->SetOptions(opts);
|
||||
}
|
||||
else if (!strcasecmp(sep->arg[2], "resend_timeout"))
|
||||
{
|
||||
opts.resend_timeout = std::stoull(value);
|
||||
opts.daybreak_options.resend_timeout = std::stoull(value);
|
||||
manager->SetOptions(opts);
|
||||
}
|
||||
else if (!strcasecmp(sep->arg[2], "connection_close_time"))
|
||||
{
|
||||
opts.connection_close_time = std::stoull(value);
|
||||
opts.daybreak_options.connection_close_time = std::stoull(value);
|
||||
manager->SetOptions(opts);
|
||||
}
|
||||
else {
|
||||
c->Message(0, "Unknown set option: %s", sep->arg[2]);
|
||||
|
||||
@@ -671,24 +671,27 @@ void MobMovementManager::SendCommandToClients(Mob *m, float dx, float dy, float
|
||||
}
|
||||
}
|
||||
else {
|
||||
float short_range = RuleR(Pathing, ShortMovementUpdateRange);
|
||||
float long_range = zone->GetMaxMovementUpdateRange();
|
||||
|
||||
for (auto &c : _impl->Clients) {
|
||||
float dist = c->CalculateDistance(m->GetX(), m->GetY(), m->GetZ());
|
||||
|
||||
bool match = false;
|
||||
if (range & ClientRangeClose) {
|
||||
if (dist < 250.0f) {
|
||||
if (dist < short_range) {
|
||||
match = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!match && range & ClientRangeMedium) {
|
||||
if (dist >= 250.0f && dist < 1500.0f) {
|
||||
if (dist >= short_range && dist < long_range) {
|
||||
match = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!match && range & ClientRangeLong) {
|
||||
if (dist >= 1500.0f) {
|
||||
if (dist >= long_range) {
|
||||
match = true;
|
||||
}
|
||||
}
|
||||
|
||||
+34
-6
@@ -42,7 +42,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#include "../common/eqemu_exception.h"
|
||||
#include "../common/spdat.h"
|
||||
#include "../common/eqemu_logsys.h"
|
||||
#include "../common/eqemu_logsys_fmt.h"
|
||||
|
||||
#include "api_service.h"
|
||||
#include "zone_config.h"
|
||||
#include "masterentity.h"
|
||||
#include "worldserver.h"
|
||||
@@ -66,6 +68,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#include "../common/event/event_loop.h"
|
||||
#include "../common/event/timer.h"
|
||||
#include "../common/net/eqstream.h"
|
||||
#include "../common/net/servertalk_server.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
@@ -235,7 +238,7 @@ int main(int argc, char** argv) {
|
||||
}
|
||||
|
||||
/* Register Log System and Settings */
|
||||
LogSys.OnLogHookCallBackZone(&Zone::GMSayHookCallBackProcess);
|
||||
LogSys.SetGMSayHandler(&Zone::GMSayHookCallBackProcess);
|
||||
database.LoadLogSettings(LogSys.log_settings);
|
||||
LogSys.StartFileLogs();
|
||||
|
||||
@@ -433,38 +436,63 @@ int main(int argc, char** argv) {
|
||||
Log(Logs::Detail, Logs::None, "Main thread running with thread id %d", pthread_self());
|
||||
#endif
|
||||
|
||||
bool worldwasconnected = worldserver.Connected();
|
||||
bool eqsf_open = false;
|
||||
bool websocker_server_opened = false;
|
||||
|
||||
Timer quest_timers(100);
|
||||
UpdateWindowTitle();
|
||||
bool worldwasconnected = worldserver.Connected();
|
||||
std::shared_ptr<EQStreamInterface> eqss;
|
||||
EQStreamInterface *eqsi;
|
||||
bool eqsf_open = false;
|
||||
std::unique_ptr<EQ::Net::EQStreamManager> eqsm;
|
||||
std::chrono::time_point<std::chrono::system_clock> frame_prev = std::chrono::system_clock::now();
|
||||
std::unique_ptr<EQ::Net::WebsocketServer> ws_server;
|
||||
|
||||
auto loop_fn = [&](EQ::Timer* t) {
|
||||
//Advance the timer to our current point in time
|
||||
Timer::SetCurrentTime();
|
||||
|
||||
//Calculate frame time
|
||||
/**
|
||||
* Calculate frame time
|
||||
*/
|
||||
std::chrono::time_point<std::chrono::system_clock> frame_now = std::chrono::system_clock::now();
|
||||
frame_time = std::chrono::duration_cast<std::chrono::duration<double>>(frame_now - frame_prev).count();
|
||||
frame_prev = frame_now;
|
||||
|
||||
/**
|
||||
* Telnet server
|
||||
*/
|
||||
if (!websocker_server_opened && Config->ZonePort != 0) {
|
||||
Log(
|
||||
Logs::General,
|
||||
Logs::Zone_Server,
|
||||
"Websocket Server listener started (%s:%u).",
|
||||
Config->TelnetIP.c_str(),
|
||||
Config->ZonePort
|
||||
);
|
||||
ws_server.reset(new EQ::Net::WebsocketServer(Config->TelnetIP, Config->ZonePort));
|
||||
RegisterApiService(ws_server);
|
||||
websocker_server_opened = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* EQStreamManager
|
||||
*/
|
||||
if (!eqsf_open && Config->ZonePort != 0) {
|
||||
Log(Logs::General, Logs::Zone_Server, "Starting EQ Network server on port %d", Config->ZonePort);
|
||||
|
||||
EQ::Net::EQStreamManagerOptions opts(Config->ZonePort, false, true);
|
||||
EQStreamManagerInterfaceOptions opts(Config->ZonePort, false, RuleB(Network, CompressZoneStream));
|
||||
opts.daybreak_options.resend_delay_ms = RuleI(Network, ResendDelayBaseMS);
|
||||
opts.daybreak_options.resend_delay_factor = RuleR(Network, ResendDelayFactor);
|
||||
opts.daybreak_options.resend_delay_min = RuleI(Network, ResendDelayMinMS);
|
||||
opts.daybreak_options.resend_delay_max = RuleI(Network, ResendDelayMaxMS);
|
||||
opts.daybreak_options.outgoing_data_rate = RuleR(Network, ClientDataRate);
|
||||
eqsm.reset(new EQ::Net::EQStreamManager(opts));
|
||||
eqsf_open = true;
|
||||
|
||||
eqsm->OnNewConnection([&stream_identifier](std::shared_ptr<EQ::Net::EQStream> stream) {
|
||||
stream_identifier.AddStream(stream);
|
||||
LogF(Logs::Detail, Logs::World_Server, "New connection from IP {0}:{1}", stream->RemoteEndpoint(), ntohs(stream->GetRemotePort()));
|
||||
LogF(Logs::Detail, Logs::World_Server, "New connection from IP {0}:{1}", stream->GetRemoteIP(), ntohs(stream->GetRemotePort()));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ glm::mat4 CreateScaleMatrix(float sx, float sy, float sz) {
|
||||
return scale;
|
||||
}
|
||||
|
||||
OrientedBoundingBox::OrientedBoundingBox(glm::vec3 pos, glm::vec3 rot, glm::vec3 scale, glm::vec3 extents) {
|
||||
OrientedBoundingBox::OrientedBoundingBox(const glm::vec3 &pos, const glm::vec3 &rot, const glm::vec3 &scale, const glm::vec3 &extents) {
|
||||
min_x = -extents.x;
|
||||
max_x = extents.x;
|
||||
|
||||
@@ -81,7 +81,7 @@ OrientedBoundingBox::OrientedBoundingBox(glm::vec3 pos, glm::vec3 rot, glm::vec3
|
||||
inverted_transformation = glm::inverse(transformation);
|
||||
}
|
||||
|
||||
bool OrientedBoundingBox::ContainsPoint(glm::vec3 p) const {
|
||||
bool OrientedBoundingBox::ContainsPoint(const glm::vec3 &p) const {
|
||||
glm::vec4 pt(p.x, p.y, p.z, 1);
|
||||
glm::vec4 box_space_p = inverted_transformation * pt;
|
||||
|
||||
|
||||
@@ -8,10 +8,10 @@ class OrientedBoundingBox
|
||||
{
|
||||
public:
|
||||
OrientedBoundingBox() { }
|
||||
OrientedBoundingBox(glm::vec3 pos, glm::vec3 rot, glm::vec3 scale, glm::vec3 extents);
|
||||
OrientedBoundingBox(const glm::vec3 &pos, const glm::vec3 &rot, const glm::vec3 &scale, const glm::vec3 &extents);
|
||||
~OrientedBoundingBox() { }
|
||||
|
||||
bool ContainsPoint(glm::vec3 p) const;
|
||||
bool ContainsPoint(const glm::vec3 &p) const;
|
||||
|
||||
glm::mat4& GetTransformation() { return transformation; }
|
||||
glm::mat4& GetInvertedTransformation() { return inverted_transformation; }
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
extern Zone *zone;
|
||||
|
||||
const int MaxNavmeshNodes = 4096;
|
||||
const int MaxNavmeshNodes = 1024;
|
||||
|
||||
struct PathfinderNavmesh::Implementation
|
||||
{
|
||||
|
||||
@@ -30,7 +30,8 @@ bool WaterMapV2::InLava(const glm::vec3& location) const {
|
||||
}
|
||||
|
||||
bool WaterMapV2::InLiquid(const glm::vec3& location) const {
|
||||
return InWater(location) || InLava(location) || InVWater(location);
|
||||
auto rt = ReturnRegionType(location);
|
||||
return rt == RegionTypeWater || rt == RegionTypeVWater || rt == RegionTypeLava;
|
||||
}
|
||||
|
||||
bool WaterMapV2::InPvP(const glm::vec3& location) const {
|
||||
|
||||
@@ -24,6 +24,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#include "../common/rulesys.h"
|
||||
#include "../common/string_util.h"
|
||||
#include "../common/misc_functions.h"
|
||||
#include "../common/eqemu_logsys.h"
|
||||
#include "../common/eqemu_logsys_fmt.h"
|
||||
|
||||
#include "map.h"
|
||||
#include "npc.h"
|
||||
|
||||
@@ -1773,10 +1773,10 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
}
|
||||
case ServerOP_ReloadRules: {
|
||||
worldserver.SendEmoteMessage(
|
||||
0, 0, 0, 15,
|
||||
"Rules reloaded for Zone: '%s' Instance ID: %u",
|
||||
zone->GetLongName(),
|
||||
zone->GetInstanceID()
|
||||
0, 0, 100, 15,
|
||||
"Rules reloaded for Zone: '%s' Instance ID: %u",
|
||||
zone->GetLongName(),
|
||||
zone->GetInstanceID()
|
||||
);
|
||||
RuleManager::Instance()->LoadRules(&database, RuleManager::Instance()->GetActiveRuleset(), true);
|
||||
break;
|
||||
|
||||
+2
-29
@@ -1070,14 +1070,14 @@ bool Zone::LoadZoneCFG(const char* filename, uint16 instance_id)
|
||||
map_name = nullptr;
|
||||
|
||||
if(!database.GetZoneCFG(database.GetZoneID(filename), instance_id, &newzone_data, can_bind,
|
||||
can_combat, can_levitate, can_castoutdoor, is_city, is_hotzone, allow_mercs, zone_type, default_ruleset, &map_name))
|
||||
can_combat, can_levitate, can_castoutdoor, is_city, is_hotzone, allow_mercs, max_movement_update_range, zone_type, default_ruleset, &map_name))
|
||||
{
|
||||
// If loading a non-zero instance failed, try loading the default
|
||||
if (instance_id != 0)
|
||||
{
|
||||
safe_delete_array(map_name);
|
||||
if(!database.GetZoneCFG(database.GetZoneID(filename), 0, &newzone_data, can_bind, can_combat, can_levitate,
|
||||
can_castoutdoor, is_city, is_hotzone, allow_mercs, zone_type, default_ruleset, &map_name))
|
||||
can_castoutdoor, is_city, is_hotzone, allow_mercs, max_movement_update_range, zone_type, default_ruleset, &map_name))
|
||||
{
|
||||
Log(Logs::General, Logs::Error, "Error loading the Zone Config.");
|
||||
return false;
|
||||
@@ -1834,33 +1834,6 @@ void Zone::ShowSpawnStatusByID(Mob* client, uint32 spawnid)
|
||||
client->Message(0, "No matching spawn id was found in this zone.");
|
||||
}
|
||||
|
||||
|
||||
bool Zone::RemoveSpawnEntry(uint32 spawnid)
|
||||
{
|
||||
LinkedListIterator<Spawn2*> iterator(spawn2_list);
|
||||
|
||||
|
||||
iterator.Reset();
|
||||
while(iterator.MoreElements())
|
||||
{
|
||||
if(iterator.GetData()->GetID() == spawnid)
|
||||
{
|
||||
iterator.RemoveCurrent();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
iterator.Advance();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Zone::RemoveSpawnGroup(uint32 in_id) {
|
||||
if(spawn_group_list.RemoveSpawnGroup(in_id))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ZoneDatabase::GetDecayTimes(npcDecayTimes_Struct *npcCorpseDecayTimes)
|
||||
{
|
||||
const std::string query =
|
||||
|
||||
+268
-264
@@ -31,32 +31,31 @@
|
||||
#include "pathfinder_interface.h"
|
||||
#include "global_loot_manager.h"
|
||||
|
||||
struct ZonePoint
|
||||
{
|
||||
float x;
|
||||
float y;
|
||||
float z;
|
||||
float heading;
|
||||
struct ZonePoint {
|
||||
float x;
|
||||
float y;
|
||||
float z;
|
||||
float heading;
|
||||
uint16 number;
|
||||
float target_x;
|
||||
float target_y;
|
||||
float target_z;
|
||||
float target_heading;
|
||||
float target_x;
|
||||
float target_y;
|
||||
float target_z;
|
||||
float target_heading;
|
||||
uint16 target_zone_id;
|
||||
int32 target_zone_instance;
|
||||
int32 target_zone_instance;
|
||||
uint32 client_version_mask;
|
||||
};
|
||||
|
||||
struct ZoneClientAuth_Struct {
|
||||
uint32 ip; // client's IP address
|
||||
uint32 wid; // client's WorldID#
|
||||
uint32 accid;
|
||||
int16 admin;
|
||||
uint32 charid;
|
||||
bool tellsoff;
|
||||
char charname[64];
|
||||
char lskey[30];
|
||||
bool stale;
|
||||
uint32 ip; // client's IP address
|
||||
uint32 wid; // client's WorldID#
|
||||
uint32 accid;
|
||||
int16 admin;
|
||||
uint32 charid;
|
||||
bool tellsoff;
|
||||
char charname[64];
|
||||
char lskey[30];
|
||||
bool stale;
|
||||
};
|
||||
|
||||
struct ZoneEXPModInfo {
|
||||
@@ -65,11 +64,11 @@ struct ZoneEXPModInfo {
|
||||
};
|
||||
|
||||
struct item_tick_struct {
|
||||
uint32 itemid;
|
||||
uint32 chance;
|
||||
uint32 level;
|
||||
int16 bagslot;
|
||||
std::string qglobal;
|
||||
uint32 itemid;
|
||||
uint32 chance;
|
||||
uint32 level;
|
||||
int16 bagslot;
|
||||
std::string qglobal;
|
||||
};
|
||||
|
||||
class Client;
|
||||
@@ -81,290 +80,295 @@ struct NPCType;
|
||||
struct ServerZoneIncomingClient_Struct;
|
||||
class MobMovementManager;
|
||||
|
||||
class Zone
|
||||
{
|
||||
class Zone {
|
||||
public:
|
||||
static bool Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone = false);
|
||||
static void Shutdown(bool quite = false);
|
||||
|
||||
Zone(uint32 in_zoneid, uint32 in_instanceid, const char* in_short_name);
|
||||
Zone(uint32 in_zoneid, uint32 in_instanceid, const char *in_short_name);
|
||||
~Zone();
|
||||
|
||||
/* When zone has its own version of time */
|
||||
bool is_zone_time_localized;
|
||||
|
||||
bool Init(bool iStaticZone);
|
||||
bool LoadZoneCFG(const char* filename, uint16 instance_id);
|
||||
bool SaveZoneCFG();
|
||||
bool IsLoaded();
|
||||
bool IsPVPZone() { return pvpzone; }
|
||||
inline const char* GetLongName() { return long_name; }
|
||||
inline const char* GetFileName() { return file_name; }
|
||||
inline const char* GetShortName() { return short_name; }
|
||||
inline const uint32 GetZoneID() const { return zoneid; }
|
||||
inline const uint32 GetInstanceID() const { return instanceid; }
|
||||
inline const uint16 GetInstanceVersion() const { return instanceversion; }
|
||||
inline const bool IsInstancePersistent() const { return pers_instance; }
|
||||
inline const uint8 GetZoneType() const { return zone_type; }
|
||||
|
||||
inline Timer* GetInstanceTimer() { return Instance_Timer; }
|
||||
Timer spawn2_timer;
|
||||
|
||||
inline glm::vec3 GetSafePoint() { return m_SafePoint; }
|
||||
inline const uint32& graveyard_zoneid() { return pgraveyard_zoneid; }
|
||||
inline glm::vec4 GetGraveyardPoint() { return m_Graveyard; }
|
||||
inline const uint32& graveyard_id() { return pgraveyard_id; }
|
||||
|
||||
inline const uint32& GetMaxClients() { return pMaxClients; }
|
||||
|
||||
//new AA
|
||||
void LoadAlternateAdvancement();
|
||||
AA::Ability *GetAlternateAdvancementAbility(int id);
|
||||
AA::Ability *GetAlternateAdvancementAbilityByRank(int rank_id);
|
||||
AA::Rank *GetAlternateAdvancementRank(int rank_id);
|
||||
std::pair<AA::Ability*, AA::Rank*> GetAlternateAdvancementAbilityAndRank(int id, int points_spent);
|
||||
|
||||
void LoadZoneDoors(const char* zone, int16 version);
|
||||
bool LoadZoneObjects();
|
||||
bool LoadGroundSpawns();
|
||||
void ReloadStaticData();
|
||||
|
||||
uint32 CountSpawn2();
|
||||
ZonePoint* GetClosestZonePoint(const glm::vec3& location, const char* to_name, Client *client, float max_distance = 40000.0f);
|
||||
ZonePoint* GetClosestZonePoint(const glm::vec3& location, uint32 to, Client *client, float max_distance = 40000.0f);
|
||||
ZonePoint* GetClosestZonePointWithoutZone(float x, float y, float z, Client *client, float max_distance = 40000.0f);
|
||||
SpawnGroupList spawn_group_list;
|
||||
|
||||
bool RemoveSpawnEntry(uint32 spawnid);
|
||||
bool RemoveSpawnGroup(uint32 in_id);
|
||||
|
||||
bool Process();
|
||||
void Despawn(uint32 spawngroupID);
|
||||
|
||||
bool Depop(bool StartSpawnTimer = false);
|
||||
void Repop(uint32 delay = 0);
|
||||
void RepopClose(const glm::vec4& client_position, uint32 repop_distance);
|
||||
void ClearNPCTypeCache(int id);
|
||||
void SpawnStatus(Mob* client);
|
||||
void ShowEnabledSpawnStatus(Mob* client);
|
||||
void ShowDisabledSpawnStatus(Mob* client);
|
||||
void ShowSpawnStatusByID(Mob* client, uint32 spawnid);
|
||||
void StartShutdownTimer(uint32 set_time = (RuleI(Zone, AutoShutdownDelay)));
|
||||
void ChangeWeather();
|
||||
bool HasWeather();
|
||||
void AddAuth(ServerZoneIncomingClient_Struct* szic);
|
||||
void RemoveAuth(const char* iCharName);
|
||||
void ResetAuth();
|
||||
bool GetAuth(uint32 iIP, const char* iCharName, uint32* oWID = 0, uint32* oAccID = 0, uint32* oCharID = 0, int16* oStatus = 0, char* oLSKey = 0, bool* oTellsOff = 0);
|
||||
uint32 CountAuth();
|
||||
|
||||
void AddAggroMob() { aggroedmobs++; }
|
||||
void DelAggroMob() { aggroedmobs--; }
|
||||
bool AggroLimitReached() { return (aggroedmobs>10)?true:false; } // change this value, to allow more NPCs to autoaggro
|
||||
int32 MobsAggroCount() { return aggroedmobs; }
|
||||
inline bool InstantGrids() { return(!initgrids_timer.Enabled()); }
|
||||
void SetStaticZone(bool sz) { staticzone = sz; }
|
||||
inline bool IsStaticZone() { return staticzone; }
|
||||
inline void SetZoneHasCurrentTime(bool time) { zone_has_current_time = time; }
|
||||
|
||||
void SpawnConditionChanged(const SpawnCondition &c, int16 old_value);
|
||||
|
||||
void GetMerchantDataForZoneLoad();
|
||||
void LoadNewMerchantData(uint32 merchantid);
|
||||
void LoadTempMerchantData();
|
||||
uint32 GetTempMerchantQuantity(uint32 NPCID, uint32 Slot);
|
||||
int SaveTempItem(uint32 merchantid, uint32 npcid, uint32 item, int32 charges, bool sold=false);
|
||||
void LoadMercTemplates();
|
||||
void LoadMercSpells();
|
||||
void LoadLevelEXPMods();
|
||||
MercTemplate* GetMercTemplate( uint32 template_id );
|
||||
|
||||
void SetInstanceTimer(uint32 new_duration);
|
||||
void LoadLDoNTraps();
|
||||
void LoadLDoNTrapEntries();
|
||||
void LoadAdventureFlavor();
|
||||
|
||||
std::map<uint32,NPCType *> npctable;
|
||||
std::map<uint32,NPCType *> merctable;
|
||||
std::map<uint32,std::list<MerchantList> > merchanttable;
|
||||
std::map<uint32,std::list<TempMerchantList> > tmpmerchanttable;
|
||||
std::map<uint32,std::string> adventure_entry_list_flavor;
|
||||
std::map<uint32,LDoNTrapTemplate*> ldon_trap_list;
|
||||
std::map<uint32,std::list<LDoNTrapTemplate*> > ldon_trap_entry_list;
|
||||
std::map<uint32,std::list<MercStanceInfo> > merc_stance_list;
|
||||
std::map<uint32, MercTemplate> merc_templates;
|
||||
std::map<uint32,std::list<MercSpellEntry> > merc_spells_list;
|
||||
std::map<uint32, ZoneEXPModInfo> level_exp_mod;
|
||||
std::list<InternalVeteranReward> VeteranRewards;
|
||||
std::list<AltCurrencyDefinition_Struct> AlternateCurrencies;
|
||||
char *adv_data;
|
||||
bool is_zone_time_localized;
|
||||
bool AggroLimitReached() { return (aggroedmobs > 10) ? true : false; }
|
||||
bool AllowMercs() const { return (allow_mercs); }
|
||||
bool CanBind() const { return (can_bind); }
|
||||
bool CanCastOutdoor() const { return (can_castoutdoor); } //qadar
|
||||
bool CanDoCombat() const { return (can_combat); }
|
||||
bool CanLevitate() const { return (can_levitate); } // Magoth78
|
||||
bool Depop(bool StartSpawnTimer = false);
|
||||
bool did_adventure_actions;
|
||||
bool GetAuth(
|
||||
uint32 iIP,
|
||||
const char *iCharName,
|
||||
uint32 *oWID = 0,
|
||||
uint32 *oAccID = 0,
|
||||
uint32 *oCharID = 0,
|
||||
int16 *oStatus = 0,
|
||||
char *oLSKey = 0,
|
||||
bool *oTellsOff = 0
|
||||
);
|
||||
bool HasGraveyard();
|
||||
bool HasWeather();
|
||||
bool Init(bool iStaticZone);
|
||||
bool IsCity() const { return (is_city); }
|
||||
bool IsHotzone() const { return (is_hotzone); }
|
||||
bool IsLoaded();
|
||||
bool IsPVPZone() { return pvpzone; }
|
||||
bool IsSpellBlocked(uint32 spell_id, const glm::vec3 &location);
|
||||
bool IsUCSServerAvailable() { return m_ucss_available; }
|
||||
bool LoadGroundSpawns();
|
||||
bool LoadZoneCFG(const char *filename, uint16 instance_id);
|
||||
bool LoadZoneObjects();
|
||||
bool Process();
|
||||
bool SaveZoneCFG();
|
||||
|
||||
//new AA
|
||||
std::unordered_map<int, std::unique_ptr<AA::Ability>> aa_abilities;
|
||||
std::unordered_map<int, std::unique_ptr<AA::Rank>> aa_ranks;
|
||||
char *adv_data;
|
||||
|
||||
void DoAdventureCountIncrease();
|
||||
void DoAdventureAssassinationCountIncrease();
|
||||
void DoAdventureActions();
|
||||
void LoadVeteranRewards();
|
||||
void LoadAlternateCurrencies();
|
||||
void LoadNPCEmotes(LinkedList<NPC_Emote_Struct*>* NPCEmoteList);
|
||||
void ReloadWorld(uint32 Option);
|
||||
void ReloadMerchants();
|
||||
const char *GetSpellBlockedMessage(uint32 spell_id, const glm::vec3 &location);
|
||||
|
||||
Map *zonemap;
|
||||
WaterMap *watermap;
|
||||
IPathfinder *pathing;
|
||||
NewZone_Struct newzone_data;
|
||||
EQEmu::Random random;
|
||||
EQTime zone_time;
|
||||
|
||||
SpawnConditionManager spawn_conditions;
|
||||
ZonePoint *GetClosestZonePoint(const glm::vec3 &location, const char *to_name, Client *client, float max_distance = 40000.0f);
|
||||
|
||||
EQTime zone_time;
|
||||
void GetTimeSync();
|
||||
void SetDate(uint16 year, uint8 month, uint8 day, uint8 hour, uint8 minute);
|
||||
void SetTime(uint8 hour, uint8 minute, bool update_world = true);
|
||||
|
||||
void weatherSend(Client* client = nullptr);
|
||||
bool CanBind() const { return(can_bind); }
|
||||
bool IsCity() const { return(is_city); }
|
||||
bool CanDoCombat() const { return(can_combat); }
|
||||
bool CanLevitate() const {return(can_levitate); } // Magoth78
|
||||
bool CanCastOutdoor() const {return(can_castoutdoor);} //qadar
|
||||
bool AllowMercs() const {return(allow_mercs);}
|
||||
bool IsHotzone() const { return(is_hotzone); }
|
||||
inline bool BuffTimersSuspended() const { return newzone_data.SuspendBuffs != 0; };
|
||||
|
||||
time_t weather_timer;
|
||||
uint8 weather_intensity;
|
||||
uint8 zone_weather;
|
||||
|
||||
uint8 loglevelvar;
|
||||
uint8 merchantvar;
|
||||
uint8 tradevar;
|
||||
uint8 lootvar;
|
||||
|
||||
bool HasGraveyard();
|
||||
void SetGraveyard(uint32 zoneid, const glm::vec4& graveyardPosition);
|
||||
|
||||
void LoadBlockedSpells(uint32 zoneid);
|
||||
void ClearBlockedSpells();
|
||||
bool IsSpellBlocked(uint32 spell_id, const glm::vec3& location);
|
||||
const char *GetSpellBlockedMessage(uint32 spell_id, const glm::vec3& location);
|
||||
int GetTotalBlockedSpells() { return totalBS; }
|
||||
inline bool BuffTimersSuspended() const { return newzone_data.SuspendBuffs != 0; };
|
||||
inline bool HasMap() { return zonemap != nullptr; }
|
||||
inline bool HasWaterMap() { return watermap != nullptr; }
|
||||
|
||||
QGlobalCache *GetQGlobals() { return qGlobals; }
|
||||
QGlobalCache *CreateQGlobals() { qGlobals = new QGlobalCache(); return qGlobals; }
|
||||
void UpdateQGlobal(uint32 qid, QGlobal newGlobal);
|
||||
void DeleteQGlobal(std::string name, uint32 npcID, uint32 charID, uint32 zoneID);
|
||||
|
||||
LinkedList<Spawn2*> spawn2_list;
|
||||
LinkedList<ZonePoint*> zone_point_list;
|
||||
uint32 numzonepoints;
|
||||
|
||||
LinkedList<NPC_Emote_Struct*> NPCEmoteList;
|
||||
|
||||
void LoadTickItems();
|
||||
uint32 GetSpawnKillCount(uint32 in_spawnid);
|
||||
void UpdateHotzone();
|
||||
std::unordered_map<int, item_tick_struct> tick_items;
|
||||
|
||||
inline bool InstantGrids() { return (!initgrids_timer.Enabled()); }
|
||||
inline bool IsStaticZone() { return staticzone; }
|
||||
inline const bool IsInstancePersistent() const { return pers_instance; }
|
||||
inline const char *GetFileName() { return file_name; }
|
||||
inline const char *GetLongName() { return long_name; }
|
||||
inline const char *GetShortName() { return short_name; }
|
||||
inline const uint8 GetZoneType() const { return zone_type; }
|
||||
inline const uint16 GetInstanceVersion() const { return instanceversion; }
|
||||
inline const uint32 &GetMaxClients() { return pMaxClients; }
|
||||
inline const uint32 &graveyard_id() { return pgraveyard_id; }
|
||||
inline const uint32 &graveyard_zoneid() { return pgraveyard_zoneid; }
|
||||
inline const uint32 GetInstanceID() const { return instanceid; }
|
||||
inline const uint32 GetZoneID() const { return zoneid; }
|
||||
inline glm::vec3 GetSafePoint() { return m_SafePoint; }
|
||||
inline glm::vec4 GetGraveyardPoint() { return m_Graveyard; }
|
||||
inline std::vector<int> GetGlobalLootTables(NPC *mob) const { return m_global_loot.GetGlobalLootTables(mob); }
|
||||
inline Timer *GetInstanceTimer() { return Instance_Timer; }
|
||||
inline void AddGlobalLootEntry(GlobalLootEntry &in) { return m_global_loot.AddEntry(in); }
|
||||
inline void ShowZoneGlobalLoot(Client *to) { m_global_loot.ShowZoneGlobalLoot(to); }
|
||||
inline void SetZoneHasCurrentTime(bool time) { zone_has_current_time = time; }
|
||||
inline void ShowNPCGlobalLoot(Client *to, NPC *who) { m_global_loot.ShowNPCGlobalLoot(to, who); }
|
||||
inline void ShowZoneGlobalLoot(Client *to) { m_global_loot.ShowZoneGlobalLoot(to); }
|
||||
int GetTotalBlockedSpells() { return totalBS; }
|
||||
int SaveTempItem(uint32 merchantid, uint32 npcid, uint32 item, int32 charges, bool sold = false);
|
||||
int32 MobsAggroCount() { return aggroedmobs; }
|
||||
|
||||
IPathfinder *pathing;
|
||||
LinkedList<NPC_Emote_Struct *> NPCEmoteList;
|
||||
LinkedList<Spawn2 *> spawn2_list;
|
||||
LinkedList<ZonePoint *> zone_point_list;
|
||||
Map *zonemap;
|
||||
MercTemplate *GetMercTemplate(uint32 template_id);
|
||||
NewZone_Struct newzone_data;
|
||||
QGlobalCache *CreateQGlobals()
|
||||
{
|
||||
qGlobals = new QGlobalCache();
|
||||
return qGlobals;
|
||||
}
|
||||
QGlobalCache *GetQGlobals() { return qGlobals; }
|
||||
SpawnConditionManager spawn_conditions;
|
||||
SpawnGroupList spawn_group_list;
|
||||
|
||||
std::list<AltCurrencyDefinition_Struct> AlternateCurrencies;
|
||||
std::list<InternalVeteranReward> VeteranRewards;
|
||||
std::map<uint32, LDoNTrapTemplate *> ldon_trap_list;
|
||||
std::map<uint32, MercTemplate> merc_templates;
|
||||
std::map<uint32, NPCType *> merctable;
|
||||
std::map<uint32, NPCType *> npctable;
|
||||
std::map<uint32, std::list<LDoNTrapTemplate *> > ldon_trap_entry_list;
|
||||
std::map<uint32, std::list<MerchantList> > merchanttable;
|
||||
std::map<uint32, std::list<MercSpellEntry> > merc_spells_list;
|
||||
std::map<uint32, std::list<MercStanceInfo> > merc_stance_list;
|
||||
std::map<uint32, std::list<TempMerchantList> > tmpmerchanttable;
|
||||
std::map<uint32, std::string> adventure_entry_list_flavor;
|
||||
std::map<uint32, ZoneEXPModInfo> level_exp_mod;
|
||||
|
||||
std::pair<AA::Ability *, AA::Rank *> GetAlternateAdvancementAbilityAndRank(int id, int points_spent);
|
||||
|
||||
std::unordered_map<int, item_tick_struct> tick_items;
|
||||
std::unordered_map<int, std::unique_ptr<AA::Ability>> aa_abilities;
|
||||
std::unordered_map<int, std::unique_ptr<AA::Rank>> aa_ranks;
|
||||
|
||||
time_t weather_timer;
|
||||
Timer spawn2_timer;
|
||||
|
||||
uint8 weather_intensity;
|
||||
uint8 zone_weather;
|
||||
uint8 loglevelvar;
|
||||
uint8 lootvar;
|
||||
uint8 merchantvar;
|
||||
uint8 tradevar;
|
||||
uint32 numzonepoints;
|
||||
uint32 CountAuth();
|
||||
uint32 CountSpawn2();
|
||||
uint32 GetSpawnKillCount(uint32 in_spawnid);
|
||||
uint32 GetTempMerchantQuantity(uint32 NPCID, uint32 Slot);
|
||||
|
||||
void AddAggroMob() { aggroedmobs++; }
|
||||
void AddAuth(ServerZoneIncomingClient_Struct *szic);
|
||||
void ChangeWeather();
|
||||
void ClearBlockedSpells();
|
||||
void ClearNPCTypeCache(int id);
|
||||
void DelAggroMob() { aggroedmobs--; }
|
||||
void DeleteQGlobal(std::string name, uint32 npcID, uint32 charID, uint32 zoneID);
|
||||
void Despawn(uint32 spawngroupID);
|
||||
void DoAdventureActions();
|
||||
void DoAdventureAssassinationCountIncrease();
|
||||
void DoAdventureCountIncrease();
|
||||
void GetMerchantDataForZoneLoad();
|
||||
void GetTimeSync();
|
||||
void LoadAdventureFlavor();
|
||||
void LoadAlternateAdvancement();
|
||||
void LoadAlternateCurrencies();
|
||||
void LoadBlockedSpells(uint32 zoneid);
|
||||
void LoadLDoNTrapEntries();
|
||||
void LoadLDoNTraps();
|
||||
void LoadLevelEXPMods();
|
||||
void LoadMercSpells();
|
||||
void LoadMercTemplates();
|
||||
void LoadNewMerchantData(uint32 merchantid);
|
||||
void LoadNPCEmotes(LinkedList<NPC_Emote_Struct *> *NPCEmoteList);
|
||||
void LoadTempMerchantData();
|
||||
void LoadTickItems();
|
||||
void LoadVeteranRewards();
|
||||
void LoadZoneDoors(const char *zone, int16 version);
|
||||
void ReloadStaticData();
|
||||
void ReloadWorld(uint32 Option);
|
||||
void RemoveAuth(const char *iCharName);
|
||||
void Repop(uint32 delay = 0);
|
||||
void RepopClose(const glm::vec4 &client_position, uint32 repop_distance);
|
||||
void RequestUCSServerStatus();
|
||||
void ResetAuth();
|
||||
void SetDate(uint16 year, uint8 month, uint8 day, uint8 hour, uint8 minute);
|
||||
void SetGraveyard(uint32 zoneid, const glm::vec4 &graveyardPosition);
|
||||
void SetInstanceTimer(uint32 new_duration);
|
||||
void SetStaticZone(bool sz) { staticzone = sz; }
|
||||
void SetTime(uint8 hour, uint8 minute, bool update_world = true);
|
||||
void SetUCSServerAvailable(bool ucss_available, uint32 update_timestamp);
|
||||
bool IsUCSServerAvailable() { return m_ucss_available; }
|
||||
void ShowDisabledSpawnStatus(Mob *client);
|
||||
void ShowEnabledSpawnStatus(Mob *client);
|
||||
void ShowSpawnStatusByID(Mob *client, uint32 spawnid);
|
||||
void SpawnConditionChanged(const SpawnCondition &c, int16 old_value);
|
||||
void SpawnStatus(Mob *client);
|
||||
void StartShutdownTimer(uint32 set_time = (RuleI(Zone, AutoShutdownDelay)));
|
||||
void UpdateHotzone();
|
||||
void UpdateQGlobal(uint32 qid, QGlobal newGlobal);
|
||||
void weatherSend(Client *client = nullptr);
|
||||
|
||||
// random object that provides random values for the zone
|
||||
EQEmu::Random random;
|
||||
WaterMap *watermap;
|
||||
ZonePoint *GetClosestZonePoint(const glm::vec3 &location, uint32 to, Client *client, float max_distance = 40000.0f);
|
||||
ZonePoint *GetClosestZonePointWithoutZone(float x, float y, float z, Client *client, float max_distance = 40000.0f);
|
||||
|
||||
static void GMSayHookCallBackProcess(uint16 log_category, std::string message){
|
||||
/* Cut messages down to 4000 max to prevent client crash */
|
||||
if (!message.empty())
|
||||
/**
|
||||
* GMSay Callback for LogSys
|
||||
*
|
||||
* @param log_category
|
||||
* @param message
|
||||
*/
|
||||
static void GMSayHookCallBackProcess(uint16 log_category, std::string message)
|
||||
{
|
||||
/**
|
||||
* Cut messages down to 4000 max to prevent client crash
|
||||
*/
|
||||
if (!message.empty()) {
|
||||
message = message.substr(0, 4000);
|
||||
}
|
||||
|
||||
/* Replace Occurrences of % or MessageStatus will crash */
|
||||
/**
|
||||
* Replace Occurrences of % or MessageStatus will crash
|
||||
*/
|
||||
find_replace(message, std::string("%"), std::string("."));
|
||||
|
||||
if (message.find("\n") != std::string::npos){
|
||||
if (message.find("\n") != std::string::npos) {
|
||||
auto message_split = SplitString(message, '\n');
|
||||
entity_list.MessageStatus(0, 80, LogSys.GetGMSayColorFromCategory(log_category), "%s", message_split[0].c_str());
|
||||
entity_list.MessageStatus(
|
||||
0,
|
||||
80,
|
||||
LogSys.GetGMSayColorFromCategory(log_category),
|
||||
"%s",
|
||||
message_split[0].c_str()
|
||||
);
|
||||
|
||||
for (size_t iter = 1; iter < message_split.size(); ++iter) {
|
||||
entity_list.MessageStatus(0, 80, LogSys.GetGMSayColorFromCategory(log_category), "--- %s", message_split[iter].c_str());
|
||||
entity_list.MessageStatus(
|
||||
0,
|
||||
80,
|
||||
LogSys.GetGMSayColorFromCategory(log_category),
|
||||
"--- %s",
|
||||
message_split[iter].c_str()
|
||||
);
|
||||
}
|
||||
}
|
||||
else{
|
||||
else {
|
||||
entity_list.MessageStatus(0, 80, LogSys.GetGMSayColorFromCategory(log_category), "%s", message.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
//MODDING HOOKS
|
||||
double GetMaxMovementUpdateRange() const { return max_movement_update_range; }
|
||||
|
||||
/**
|
||||
* Modding hooks
|
||||
*/
|
||||
void mod_init();
|
||||
void mod_repop();
|
||||
|
||||
private:
|
||||
uint32 zoneid;
|
||||
uint32 instanceid;
|
||||
uint16 instanceversion;
|
||||
bool pers_instance;
|
||||
char* short_name;
|
||||
char file_name[16];
|
||||
char* long_name;
|
||||
char* map_name;
|
||||
bool pvpzone;
|
||||
bool allow_mercs;
|
||||
bool can_bind;
|
||||
bool can_castoutdoor;
|
||||
bool can_combat;
|
||||
bool can_levitate;
|
||||
bool is_city;
|
||||
bool is_hotzone;
|
||||
bool pers_instance;
|
||||
bool pvpzone;
|
||||
bool m_ucss_available;
|
||||
bool staticzone;
|
||||
bool zone_has_current_time;
|
||||
double max_movement_update_range;
|
||||
char *long_name;
|
||||
char *map_name;
|
||||
char *short_name;
|
||||
char file_name[16];
|
||||
glm::vec3 m_SafePoint;
|
||||
uint32 pMaxClients;
|
||||
bool can_bind;
|
||||
bool is_city;
|
||||
bool can_combat;
|
||||
bool can_castoutdoor;
|
||||
bool can_levitate;
|
||||
bool is_hotzone;
|
||||
uint8 zone_type;
|
||||
bool allow_mercs;
|
||||
uint32 pgraveyard_id, pgraveyard_zoneid;
|
||||
glm::vec4 m_Graveyard;
|
||||
int default_ruleset;
|
||||
int default_ruleset;
|
||||
int totalBS;
|
||||
int32 aggroedmobs;
|
||||
uint8 zone_type;
|
||||
uint16 instanceversion;
|
||||
uint32 instanceid;
|
||||
uint32 pgraveyard_id, pgraveyard_zoneid;
|
||||
uint32 pMaxClients;
|
||||
uint32 zoneid;
|
||||
uint32 m_last_ucss_update;
|
||||
uint32 pQueuedMerchantsWorkID;
|
||||
uint32 pQueuedTempMerchantsWorkID;
|
||||
|
||||
int totalBS;
|
||||
ZoneSpellsBlocked *blocked_spells;
|
||||
GlobalLootManager m_global_loot;
|
||||
LinkedList<ZoneClientAuth_Struct *> client_auth_list;
|
||||
MobMovementManager *mMovementManager;
|
||||
QGlobalCache *qGlobals;
|
||||
Timer *Instance_Shutdown_Timer;
|
||||
Timer *Instance_Timer;
|
||||
Timer *Instance_Warning_timer;
|
||||
Timer *Weather_Timer;
|
||||
Timer autoshutdown_timer;
|
||||
Timer clientauth_timer;
|
||||
Timer hotzone_timer;
|
||||
Timer initgrids_timer; //delayed loading of initial grids.
|
||||
Timer qglobal_purge_timer;
|
||||
ZoneSpellsBlocked *blocked_spells;
|
||||
|
||||
/*
|
||||
Spawn related things
|
||||
*/
|
||||
int32 aggroedmobs;
|
||||
Timer initgrids_timer; //delayed loading of initial grids.
|
||||
|
||||
|
||||
bool staticzone;
|
||||
bool zone_has_current_time;
|
||||
|
||||
uint32 pQueuedMerchantsWorkID;
|
||||
uint32 pQueuedTempMerchantsWorkID;
|
||||
|
||||
Timer autoshutdown_timer;
|
||||
Timer clientauth_timer;
|
||||
Timer qglobal_purge_timer;
|
||||
Timer* Weather_Timer;
|
||||
Timer* Instance_Timer;
|
||||
Timer* Instance_Shutdown_Timer;
|
||||
Timer* Instance_Warning_timer;
|
||||
LinkedList<ZoneClientAuth_Struct*> client_auth_list;
|
||||
QGlobalCache *qGlobals;
|
||||
|
||||
Timer hotzone_timer;
|
||||
|
||||
GlobalLootManager m_global_loot;
|
||||
|
||||
bool m_ucss_available;
|
||||
uint32 m_last_ucss_update;
|
||||
|
||||
MobMovementManager *mMovementManager;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+18
-3
@@ -80,7 +80,21 @@ bool ZoneDatabase::SaveZoneCFG(uint32 zoneid, uint16 instance_id, NewZone_Struct
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ZoneDatabase::GetZoneCFG(uint32 zoneid, uint16 instance_id, NewZone_Struct *zone_data, bool &can_bind, bool &can_combat, bool &can_levitate, bool &can_castoutdoor, bool &is_city, bool &is_hotzone, bool &allow_mercs, uint8 &zone_type, int &ruleset, char **map_filename) {
|
||||
bool ZoneDatabase::GetZoneCFG(
|
||||
uint32 zoneid,
|
||||
uint16 instance_id,
|
||||
NewZone_Struct *zone_data,
|
||||
bool &can_bind,
|
||||
bool &can_combat,
|
||||
bool &can_levitate,
|
||||
bool &can_castoutdoor,
|
||||
bool &is_city,
|
||||
bool &is_hotzone,
|
||||
bool &allow_mercs,
|
||||
double &max_movement_update_range,
|
||||
uint8 &zone_type,
|
||||
int &ruleset,
|
||||
char **map_filename) {
|
||||
|
||||
*map_filename = new char[100];
|
||||
zone_data->zone_id = zoneid;
|
||||
@@ -147,7 +161,8 @@ bool ZoneDatabase::GetZoneCFG(uint32 zoneid, uint16 instance_id, NewZone_Struct
|
||||
"fast_regen_hp, " // 57
|
||||
"fast_regen_mana, " // 58
|
||||
"fast_regen_endurance, " // 59
|
||||
"npc_max_aggro_dist " // 60
|
||||
"npc_max_aggro_dist, " // 60
|
||||
"max_movement_update_range " // 61
|
||||
"FROM zone WHERE zoneidnumber = %i AND version = %i",
|
||||
zoneid, instance_id);
|
||||
auto results = QueryDatabase(query);
|
||||
@@ -206,7 +221,7 @@ bool ZoneDatabase::GetZoneCFG(uint32 zoneid, uint16 instance_id, NewZone_Struct
|
||||
can_levitate = atoi(row[33]) == 0 ? false : true;
|
||||
can_castoutdoor = atoi(row[34]) == 0 ? false : true;
|
||||
is_hotzone = atoi(row[35]) == 0 ? false : true;
|
||||
|
||||
max_movement_update_range = atof(row[61]);
|
||||
|
||||
ruleset = atoi(row[36]);
|
||||
zone_data->SuspendBuffs = atoi(row[37]);
|
||||
|
||||
+15
-1
@@ -386,7 +386,21 @@ public:
|
||||
bool LoadAlternateAdvancement(Client *c);
|
||||
|
||||
/* Zone related */
|
||||
bool GetZoneCFG(uint32 zoneid, uint16 instance_id, NewZone_Struct *data, bool &can_bind, bool &can_combat, bool &can_levitate, bool &can_castoutdoor, bool &is_city, bool &is_hotzone, bool &allow_mercs, uint8 &zone_type, int &ruleset, char **map_filename);
|
||||
bool GetZoneCFG(
|
||||
uint32 zoneid,
|
||||
uint16 instance_id,
|
||||
NewZone_Struct *data,
|
||||
bool &can_bind,
|
||||
bool &can_combat,
|
||||
bool &can_levitate,
|
||||
bool &can_castoutdoor,
|
||||
bool &is_city,
|
||||
bool &is_hotzone,
|
||||
bool &allow_mercs,
|
||||
double &max_movement_update_range,
|
||||
uint8 &zone_type,
|
||||
int &ruleset,
|
||||
char **map_filename);
|
||||
bool SaveZoneCFG(uint32 zoneid, uint16 instance_id, NewZone_Struct* zd);
|
||||
bool LoadStaticZonePoints(LinkedList<ZonePoint*>* zone_point_list,const char* zonename, uint32 version);
|
||||
bool UpdateZoneSafeCoords(const char* zonename, const glm::vec3& location);
|
||||
|
||||
Reference in New Issue
Block a user