mirror of
https://github.com/EQEmu/Server.git
synced 2026-09-04 22:56:37 +00:00
[Expeditions] Decouple dz updates from expeditions (#1303)
Use internal dz messages to process duration and location changes Add world DynamicZone class (later this will inherit from a base) Add FindDynamicZoneByID to get dz from zone and world system caches
This commit is contained in:
+101
-7
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "dynamic_zone.h"
|
||||
#include "client.h"
|
||||
#include "expedition.h"
|
||||
#include "worldserver.h"
|
||||
#include "zonedb.h"
|
||||
#include "../common/eqemu_logsys.h"
|
||||
@@ -37,20 +38,27 @@ DynamicZone::DynamicZone(
|
||||
}
|
||||
|
||||
DynamicZone::DynamicZone(
|
||||
std::string zone_shortname, uint32_t version, uint32_t duration, DynamicZoneType type
|
||||
std::string zone_name, uint32_t version, uint32_t duration, DynamicZoneType type
|
||||
) :
|
||||
m_version(version),
|
||||
m_duration(duration),
|
||||
m_type(type)
|
||||
DynamicZone(ZoneID(zone_name), version, duration, type)
|
||||
{
|
||||
m_zone_id = ZoneID(zone_shortname.c_str());
|
||||
|
||||
if (!m_zone_id)
|
||||
{
|
||||
LogDynamicZones("Failed to get zone id for zone [{}]", zone_shortname);
|
||||
LogDynamicZones("Failed to get zone id for zone [{}]", zone_name);
|
||||
}
|
||||
}
|
||||
|
||||
DynamicZone* DynamicZone::FindDynamicZoneByID(uint32_t dz_id)
|
||||
{
|
||||
auto expedition = Expedition::FindCachedExpeditionByDynamicZoneID(dz_id);
|
||||
if (expedition)
|
||||
{
|
||||
return &expedition->GetDynamicZone();
|
||||
}
|
||||
// todo: other system caches
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::unordered_map<uint32_t, DynamicZone> DynamicZone::LoadMultipleDzFromDatabase(
|
||||
const std::vector<uint32_t>& dynamic_zone_ids)
|
||||
{
|
||||
@@ -443,12 +451,23 @@ void DynamicZone::SetCompass(const DynamicZoneLocation& location, bool update_db
|
||||
{
|
||||
m_compass = location;
|
||||
|
||||
if (m_on_compass_change)
|
||||
{
|
||||
m_on_compass_change();
|
||||
}
|
||||
|
||||
if (update_db)
|
||||
{
|
||||
SaveCompassToDatabase();
|
||||
SendWorldSetLocation(ServerOP_DzSetCompass, location);
|
||||
}
|
||||
}
|
||||
|
||||
void DynamicZone::SetCompass(uint32_t zone_id, float x, float y, float z, bool update_db)
|
||||
{
|
||||
SetCompass({ zone_id, x, y, z, 0.0f }, update_db);
|
||||
}
|
||||
|
||||
void DynamicZone::SetSafeReturn(const DynamicZoneLocation& location, bool update_db)
|
||||
{
|
||||
m_safereturn = location;
|
||||
@@ -456,9 +475,15 @@ void DynamicZone::SetSafeReturn(const DynamicZoneLocation& location, bool update
|
||||
if (update_db)
|
||||
{
|
||||
SaveSafeReturnToDatabase();
|
||||
SendWorldSetLocation(ServerOP_DzSetSafeReturn, location);
|
||||
}
|
||||
}
|
||||
|
||||
void DynamicZone::SetSafeReturn(uint32_t zone_id, float x, float y, float z, float heading, bool update_db)
|
||||
{
|
||||
SetSafeReturn({ zone_id, x, y, z, heading }, update_db);
|
||||
}
|
||||
|
||||
void DynamicZone::SetZoneInLocation(const DynamicZoneLocation& location, bool update_db)
|
||||
{
|
||||
m_zonein = location;
|
||||
@@ -467,9 +492,15 @@ void DynamicZone::SetZoneInLocation(const DynamicZoneLocation& location, bool up
|
||||
if (update_db)
|
||||
{
|
||||
SaveZoneInLocationToDatabase();
|
||||
SendWorldSetLocation(ServerOP_DzSetZoneIn, location);
|
||||
}
|
||||
}
|
||||
|
||||
void DynamicZone::SetZoneInLocation(float x, float y, float z, float heading, bool update_db)
|
||||
{
|
||||
SetZoneInLocation({ 0, x, y, z, heading }, update_db);
|
||||
}
|
||||
|
||||
bool DynamicZone::IsCurrentZoneDzInstance() const
|
||||
{
|
||||
return (zone && zone->GetInstanceID() != 0 && zone->GetInstanceID() == GetInstanceID());
|
||||
@@ -496,6 +527,17 @@ uint32_t DynamicZone::GetSecondsRemaining() const
|
||||
return 0;
|
||||
}
|
||||
|
||||
void DynamicZone::SetSecondsRemaining(uint32_t seconds_remaining)
|
||||
{
|
||||
// async
|
||||
constexpr uint32_t pack_size = sizeof(ServerDzSetDuration_Struct);
|
||||
auto pack = std::make_unique<ServerPacket>(ServerOP_DzSetSecondsRemaining, pack_size);
|
||||
auto buf = reinterpret_cast<ServerDzSetDuration_Struct*>(pack->pBuffer);
|
||||
buf->dz_id = GetID();
|
||||
buf->seconds = seconds_remaining;
|
||||
worldserver.SendPacket(pack.get());
|
||||
}
|
||||
|
||||
void DynamicZone::SetUpdatedDuration(uint32_t new_duration)
|
||||
{
|
||||
// preserves original start time, just modifies duration and expire time
|
||||
@@ -511,6 +553,22 @@ void DynamicZone::SetUpdatedDuration(uint32_t new_duration)
|
||||
}
|
||||
}
|
||||
|
||||
void DynamicZone::SendWorldSetLocation(uint16_t server_opcode, const DynamicZoneLocation& location)
|
||||
{
|
||||
uint32_t pack_size = sizeof(ServerDzLocation_Struct);
|
||||
auto pack = std::make_unique<ServerPacket>(server_opcode, pack_size);
|
||||
auto buf = reinterpret_cast<ServerDzLocation_Struct*>(pack->pBuffer);
|
||||
buf->dz_id = GetID();
|
||||
buf->sender_zone_id = zone ? zone->GetZoneID() : 0;
|
||||
buf->sender_instance_id = zone ? zone->GetInstanceID() : 0;
|
||||
buf->zone_id = location.zone_id;
|
||||
buf->x = location.x;
|
||||
buf->y = location.y;
|
||||
buf->z = location.z;
|
||||
buf->heading = location.heading;
|
||||
worldserver.SendPacket(pack.get());
|
||||
}
|
||||
|
||||
void DynamicZone::HandleWorldMessage(ServerPacket* pack)
|
||||
{
|
||||
switch (pack->opcode)
|
||||
@@ -540,5 +598,41 @@ void DynamicZone::HandleWorldMessage(ServerPacket* pack)
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ServerOP_DzDurationUpdate:
|
||||
{
|
||||
auto buf = reinterpret_cast<ServerDzSetDuration_Struct*>(pack->pBuffer);
|
||||
auto dz = DynamicZone::FindDynamicZoneByID(buf->dz_id);
|
||||
if (dz)
|
||||
{
|
||||
dz->SetUpdatedDuration(buf->seconds);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ServerOP_DzSetCompass:
|
||||
case ServerOP_DzSetSafeReturn:
|
||||
case ServerOP_DzSetZoneIn:
|
||||
{
|
||||
auto buf = reinterpret_cast<ServerDzLocation_Struct*>(pack->pBuffer);
|
||||
if (zone && !zone->IsZone(buf->sender_zone_id, buf->sender_instance_id))
|
||||
{
|
||||
auto dz = DynamicZone::FindDynamicZoneByID(buf->dz_id);
|
||||
if (dz)
|
||||
{
|
||||
if (pack->opcode == ServerOP_DzSetCompass)
|
||||
{
|
||||
dz->SetCompass(buf->zone_id, buf->x, buf->y, buf->z, false);
|
||||
}
|
||||
else if (pack->opcode == ServerOP_DzSetSafeReturn)
|
||||
{
|
||||
dz->SetSafeReturn(buf->zone_id, buf->x, buf->y, buf->z, buf->heading, false);
|
||||
}
|
||||
else if (pack->opcode == ServerOP_DzSetZoneIn)
|
||||
{
|
||||
dz->SetZoneInLocation(buf->x, buf->y, buf->z, buf->heading, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+10
-10
@@ -21,8 +21,10 @@
|
||||
#ifndef DYNAMIC_ZONE_H
|
||||
#define DYNAMIC_ZONE_H
|
||||
|
||||
#include "../common/eq_constants.h"
|
||||
#include <chrono>
|
||||
#include <cstdint>
|
||||
#include <functional>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
@@ -30,16 +32,6 @@
|
||||
class MySQLRequestRow;
|
||||
class ServerPacket;
|
||||
|
||||
enum class DynamicZoneType : uint8_t
|
||||
{
|
||||
None = 0,
|
||||
Expedition,
|
||||
Tutorial,
|
||||
Task,
|
||||
Mission, // Shared Task
|
||||
Quest
|
||||
};
|
||||
|
||||
struct DynamicZoneLocation
|
||||
{
|
||||
uint32_t zone_id = 0;
|
||||
@@ -62,6 +54,7 @@ public:
|
||||
DynamicZone(uint32_t dz_id) : m_id(dz_id) {}
|
||||
DynamicZone(DynamicZoneType type) : m_type(type) {}
|
||||
|
||||
static DynamicZone* FindDynamicZoneByID(uint32_t dz_id);
|
||||
static std::unordered_map<uint32_t, DynamicZone> LoadMultipleDzFromDatabase(
|
||||
const std::vector<uint32_t>& dynamic_zone_ids);
|
||||
static void HandleWorldMessage(ServerPacket* pack);
|
||||
@@ -88,15 +81,20 @@ public:
|
||||
bool IsInstanceID(uint32_t instance_id) const;
|
||||
bool IsValid() const { return m_instance_id != 0; }
|
||||
bool IsSameDz(uint32_t zone_id, uint32_t instance_id) const;
|
||||
void RegisterOnCompassChange(const std::function<void()>& on_change) { m_on_compass_change = on_change; }
|
||||
void RemoveAllCharacters(bool enable_removal_timers = true);
|
||||
void RemoveCharacter(uint32_t character_id);
|
||||
void SaveInstanceMembersToDatabase(const std::vector<uint32_t>& character_ids);
|
||||
void SendInstanceCharacterChange(uint32_t character_id, bool removed);
|
||||
void SetCompass(const DynamicZoneLocation& location, bool update_db = false);
|
||||
void SetCompass(uint32_t zone_id, float x, float y, float z, bool update_db = false);
|
||||
void SetLeaderName(const std::string& leader_name) { m_leader_name = leader_name; }
|
||||
void SetName(const std::string& name) { m_name = name; }
|
||||
void SetSafeReturn(const DynamicZoneLocation& location, bool update_db = false);
|
||||
void SetSafeReturn(uint32_t zone_id, float x, float y, float z, float heading, bool update_db = false);
|
||||
void SetSecondsRemaining(uint32_t seconds_remaining);
|
||||
void SetZoneInLocation(const DynamicZoneLocation& location, bool update_db = false);
|
||||
void SetZoneInLocation(float x, float y, float z, float heading, bool update_db = false);
|
||||
void SetUpdatedDuration(uint32_t seconds);
|
||||
|
||||
private:
|
||||
@@ -105,6 +103,7 @@ private:
|
||||
void SaveCompassToDatabase();
|
||||
void SaveSafeReturnToDatabase();
|
||||
void SaveZoneInLocationToDatabase();
|
||||
void SendWorldSetLocation(uint16_t server_opcode, const DynamicZoneLocation& location);
|
||||
uint32_t SaveToDatabase();
|
||||
|
||||
uint32_t m_id = 0;
|
||||
@@ -122,6 +121,7 @@ private:
|
||||
std::chrono::seconds m_duration;
|
||||
std::chrono::time_point<std::chrono::system_clock> m_start_time;
|
||||
std::chrono::time_point<std::chrono::system_clock> m_expire_time;
|
||||
std::function<void()> m_on_compass_change;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+2
-114
@@ -69,6 +69,7 @@ void Expedition::SetDynamicZone(DynamicZone&& dz)
|
||||
dz.SetLeaderName(GetLeaderName());
|
||||
|
||||
m_dynamiczone = std::move(dz);
|
||||
m_dynamiczone.RegisterOnCompassChange([this]() { SendCompassUpdateToZoneMembers(); });
|
||||
}
|
||||
|
||||
Expedition* Expedition::TryCreate(
|
||||
@@ -1631,24 +1632,6 @@ void Expedition::SendWorldMemberStatus(uint32_t character_id, ExpeditionMemberSt
|
||||
worldserver.SendPacket(pack.get());
|
||||
}
|
||||
|
||||
void Expedition::SendWorldDzLocationUpdate(uint16_t server_opcode, const DynamicZoneLocation& location)
|
||||
{
|
||||
uint32_t pack_size = sizeof(ServerDzLocation_Struct);
|
||||
auto pack = std::make_unique<ServerPacket>(server_opcode, pack_size);
|
||||
auto buf = reinterpret_cast<ServerDzLocation_Struct*>(pack->pBuffer);
|
||||
buf->owner_id = GetID();
|
||||
buf->dz_zone_id = m_dynamiczone.GetZoneID();
|
||||
buf->dz_instance_id = m_dynamiczone.GetInstanceID();
|
||||
buf->sender_zone_id = zone ? zone->GetZoneID() : 0;
|
||||
buf->sender_instance_id = zone ? zone->GetInstanceID() : 0;
|
||||
buf->zone_id = location.zone_id;
|
||||
buf->x = location.x;
|
||||
buf->y = location.y;
|
||||
buf->z = location.z;
|
||||
buf->heading = location.heading;
|
||||
worldserver.SendPacket(pack.get());
|
||||
}
|
||||
|
||||
void Expedition::SendWorldMemberSwapped(
|
||||
const std::string& remove_char_name, uint32_t remove_char_id, const std::string& add_char_name, uint32_t add_char_id)
|
||||
{
|
||||
@@ -1716,16 +1699,6 @@ void Expedition::SendWorldCharacterLockout(
|
||||
worldserver.SendPacket(pack.get());
|
||||
}
|
||||
|
||||
void Expedition::SendWorldSetSecondsRemaining(uint32_t seconds_remaining)
|
||||
{
|
||||
uint32_t pack_size = sizeof(ServerExpeditionUpdateDuration_Struct);
|
||||
auto pack = std::make_unique<ServerPacket>(ServerOP_ExpeditionSecondsRemaining, pack_size);
|
||||
auto buf = reinterpret_cast<ServerExpeditionUpdateDuration_Struct*>(pack->pBuffer);
|
||||
buf->expedition_id = GetID();
|
||||
buf->new_duration_seconds = seconds_remaining;
|
||||
worldserver.SendPacket(pack.get());
|
||||
}
|
||||
|
||||
void Expedition::AddLockoutByCharacterID(
|
||||
uint32_t character_id, const std::string& expedition_name, const std::string& event_name,
|
||||
uint32_t seconds, const std::string& uuid)
|
||||
@@ -2007,32 +1980,6 @@ void Expedition::HandleWorldMessage(ServerPacket* pack)
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ServerOP_ExpeditionDzCompass:
|
||||
case ServerOP_ExpeditionDzSafeReturn:
|
||||
case ServerOP_ExpeditionDzZoneIn:
|
||||
{
|
||||
auto buf = reinterpret_cast<ServerDzLocation_Struct*>(pack->pBuffer);
|
||||
if (zone && !zone->IsZone(buf->sender_zone_id, buf->sender_instance_id))
|
||||
{
|
||||
auto expedition = Expedition::FindCachedExpeditionByID(buf->owner_id);
|
||||
if (expedition)
|
||||
{
|
||||
if (pack->opcode == ServerOP_ExpeditionDzCompass)
|
||||
{
|
||||
expedition->SetDzCompass(buf->zone_id, buf->x, buf->y, buf->z, false);
|
||||
}
|
||||
else if (pack->opcode == ServerOP_ExpeditionDzSafeReturn)
|
||||
{
|
||||
expedition->SetDzSafeReturn(buf->zone_id, buf->x, buf->y, buf->z, buf->heading, false);
|
||||
}
|
||||
else if (pack->opcode == ServerOP_ExpeditionDzZoneIn)
|
||||
{
|
||||
expedition->SetDzZoneInLocation(buf->x, buf->y, buf->z, buf->heading, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ServerOP_ExpeditionCharacterLockout:
|
||||
{
|
||||
auto buf = reinterpret_cast<ServerExpeditionCharacterLockout_Struct*>(pack->pBuffer);
|
||||
@@ -2056,16 +2003,6 @@ void Expedition::HandleWorldMessage(ServerPacket* pack)
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ServerOP_ExpeditionDzDuration:
|
||||
{
|
||||
auto buf = reinterpret_cast<ServerExpeditionUpdateDuration_Struct*>(pack->pBuffer);
|
||||
auto expedition = Expedition::FindCachedExpeditionByID(buf->expedition_id);
|
||||
if (expedition)
|
||||
{
|
||||
expedition->UpdateDzDuration(buf->new_duration_seconds);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ServerOP_ExpeditionExpireWarning:
|
||||
{
|
||||
auto buf = reinterpret_cast<ServerExpeditionExpireWarning_Struct*>(pack->pBuffer);
|
||||
@@ -2079,11 +2016,8 @@ void Expedition::HandleWorldMessage(ServerPacket* pack)
|
||||
}
|
||||
}
|
||||
|
||||
void Expedition::SetDzCompass(uint32_t zone_id, float x, float y, float z, bool update_db)
|
||||
void Expedition::SendCompassUpdateToZoneMembers()
|
||||
{
|
||||
DynamicZoneLocation location{ zone_id, x, y, z, 0.0f };
|
||||
m_dynamiczone.SetCompass(location, update_db);
|
||||
|
||||
for (const auto& member : m_members)
|
||||
{
|
||||
Client* member_client = entity_list.GetClientByCharID(member.char_id);
|
||||
@@ -2092,52 +2026,6 @@ void Expedition::SetDzCompass(uint32_t zone_id, float x, float y, float z, bool
|
||||
member_client->SendDzCompassUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
if (update_db)
|
||||
{
|
||||
SendWorldDzLocationUpdate(ServerOP_ExpeditionDzCompass, location);
|
||||
}
|
||||
}
|
||||
|
||||
void Expedition::SetDzCompass(const std::string& zone_name, float x, float y, float z, bool update_db)
|
||||
{
|
||||
auto zone_id = ZoneID(zone_name.c_str());
|
||||
SetDzCompass(zone_id, x, y, z, update_db);
|
||||
}
|
||||
|
||||
void Expedition::SetDzSafeReturn(uint32_t zone_id, float x, float y, float z, float heading, bool update_db)
|
||||
{
|
||||
DynamicZoneLocation location{ zone_id, x, y, z, heading };
|
||||
|
||||
m_dynamiczone.SetSafeReturn(location, update_db);
|
||||
|
||||
if (update_db)
|
||||
{
|
||||
SendWorldDzLocationUpdate(ServerOP_ExpeditionDzSafeReturn, location);
|
||||
}
|
||||
}
|
||||
|
||||
void Expedition::SetDzSafeReturn(const std::string& zone_name, float x, float y, float z, float heading, bool update_db)
|
||||
{
|
||||
auto zone_id = ZoneID(zone_name.c_str());
|
||||
SetDzSafeReturn(zone_id, x, y, z, heading, update_db);
|
||||
}
|
||||
|
||||
void Expedition::SetDzSecondsRemaining(uint32_t seconds_remaining)
|
||||
{
|
||||
SendWorldSetSecondsRemaining(seconds_remaining); // async
|
||||
}
|
||||
|
||||
void Expedition::SetDzZoneInLocation(float x, float y, float z, float heading, bool update_db)
|
||||
{
|
||||
DynamicZoneLocation location{ 0, x, y, z, heading };
|
||||
|
||||
m_dynamiczone.SetZoneInLocation(location, update_db);
|
||||
|
||||
if (update_db)
|
||||
{
|
||||
SendWorldDzLocationUpdate(ServerOP_ExpeditionDzZoneIn, location);
|
||||
}
|
||||
}
|
||||
|
||||
bool Expedition::CanClientLootCorpse(Client* client, uint32_t npc_type_id, uint32_t spawn_id)
|
||||
|
||||
+1
-10
@@ -161,13 +161,6 @@ public:
|
||||
void DzQuit(Client* requester);
|
||||
void DzKickPlayers(Client* requester);
|
||||
|
||||
void SetDzCompass(uint32_t zone_id, float x, float y, float z, bool update_db = false);
|
||||
void SetDzCompass(const std::string& zone_name, float x, float y, float z, bool update_db = false);
|
||||
void SetDzSafeReturn(uint32_t zone_id, float x, float y, float z, float heading, bool update_db = false);
|
||||
void SetDzSafeReturn(const std::string& zone_name, float x, float y, float z, float heading, bool update_db = false);
|
||||
void SetDzSecondsRemaining(uint32_t seconds_remaining);
|
||||
void SetDzZoneInLocation(float x, float y, float z, float heading, bool update_db = false);
|
||||
|
||||
static const int32_t REPLAY_TIMER_ID;
|
||||
static const int32_t EVENT_TIMER_ID;
|
||||
|
||||
@@ -197,7 +190,7 @@ private:
|
||||
void SendMembersExpireWarning(uint32_t minutes);
|
||||
void SendNewMemberAddedToZoneMembers(const std::string& added_name);
|
||||
void SendUpdatesToZoneMembers(bool clear = false, bool message_on_clear = true);
|
||||
void SendWorldDzLocationUpdate(uint16_t server_opcode, const DynamicZoneLocation& location);
|
||||
void SendCompassUpdateToZoneMembers();
|
||||
void SendWorldExpeditionUpdate(uint16_t server_opcode);
|
||||
void SendWorldAddPlayerInvite(const std::string& inviter_name, const std::string& swap_remove_name,
|
||||
const std::string& add_name, bool pending = false);
|
||||
@@ -209,12 +202,10 @@ private:
|
||||
void SendWorldMemberStatus(uint32_t character_id, ExpeditionMemberStatus status);
|
||||
void SendWorldMemberSwapped(const std::string& remove_char_name, uint32_t remove_char_id,
|
||||
const std::string& add_char_name, uint32_t add_char_id);
|
||||
void SendWorldSetSecondsRemaining(uint32_t seconds_remaining);
|
||||
void SendWorldSettingChanged(uint16_t server_opcode, bool setting_value);
|
||||
void SetDynamicZone(DynamicZone&& dz);
|
||||
void TryAddClient(Client* add_client, const std::string& inviter_name,
|
||||
const std::string& swap_remove_name, Client* leader_client = nullptr);
|
||||
void UpdateDzDuration(uint32_t new_duration) { m_dynamiczone.SetUpdatedDuration(new_duration); }
|
||||
void UpdateMemberStatus(uint32_t update_character_id, ExpeditionMemberStatus status);
|
||||
|
||||
ExpeditionMember GetMemberData(uint32_t character_id);
|
||||
|
||||
@@ -168,7 +168,7 @@ bool Lua_Expedition::IsLocked() {
|
||||
|
||||
void Lua_Expedition::RemoveCompass() {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetDzCompass(0, 0, 0, 0, true);
|
||||
self->GetDynamicZone().SetCompass(0, 0, 0, 0, true);
|
||||
}
|
||||
|
||||
void Lua_Expedition::RemoveLockout(std::string event_name) {
|
||||
@@ -178,12 +178,12 @@ void Lua_Expedition::RemoveLockout(std::string event_name) {
|
||||
|
||||
void Lua_Expedition::SetCompass(uint32_t zone_id, float x, float y, float z) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetDzCompass(zone_id, x, y, z, true);
|
||||
self->GetDynamicZone().SetCompass(zone_id, x, y, z, true);
|
||||
}
|
||||
|
||||
void Lua_Expedition::SetCompass(std::string zone_name, float x, float y, float z) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetDzCompass(zone_name, x, y, z, true);
|
||||
self->GetDynamicZone().SetCompass(ZoneID(zone_name), x, y, z, true);
|
||||
}
|
||||
|
||||
void Lua_Expedition::SetLocked(bool lock_expedition) {
|
||||
@@ -218,23 +218,23 @@ void Lua_Expedition::SetReplayLockoutOnMemberJoin(bool enable) {
|
||||
|
||||
void Lua_Expedition::SetSafeReturn(uint32_t zone_id, float x, float y, float z, float heading) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetDzSafeReturn(zone_id, x, y, z, heading, true);
|
||||
self->GetDynamicZone().SetSafeReturn(zone_id, x, y, z, heading, true);
|
||||
}
|
||||
|
||||
void Lua_Expedition::SetSafeReturn(std::string zone_name, float x, float y, float z, float heading) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetDzSafeReturn(zone_name, x, y, z, heading, true);
|
||||
self->GetDynamicZone().SetSafeReturn(ZoneID(zone_name), x, y, z, heading, true);
|
||||
}
|
||||
|
||||
void Lua_Expedition::SetSecondsRemaining(uint32_t seconds_remaining)
|
||||
{
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetDzSecondsRemaining(seconds_remaining);
|
||||
self->GetDynamicZone().SetSecondsRemaining(seconds_remaining);
|
||||
}
|
||||
|
||||
void Lua_Expedition::SetZoneInLocation(float x, float y, float z, float heading) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->SetDzZoneInLocation(x, y, z, heading, true);
|
||||
self->GetDynamicZone().SetZoneInLocation(x, y, z, heading, true);
|
||||
}
|
||||
|
||||
void Lua_Expedition::UpdateLockoutDuration(std::string event_name, uint32_t duration) {
|
||||
|
||||
@@ -407,7 +407,7 @@ XS(XS_Expedition_RemoveCompass) {
|
||||
Expedition* THIS = nullptr;
|
||||
VALIDATE_THIS_IS_EXPEDITION;
|
||||
|
||||
THIS->SetDzCompass(0, 0, 0, 0, true);
|
||||
THIS->GetDynamicZone().SetCompass(0, 0, 0, 0, true);
|
||||
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
@@ -446,12 +446,12 @@ XS(XS_Expedition_SetCompass) {
|
||||
if (SvTYPE(ST(1)) == SVt_PV)
|
||||
{
|
||||
std::string zone_name(SvPV_nolen(ST(1)));
|
||||
THIS->SetDzCompass(zone_name, x, y, z, true);
|
||||
THIS->GetDynamicZone().SetCompass(ZoneID(zone_name), x, y, z, true);
|
||||
}
|
||||
else if (SvTYPE(ST(1)) == SVt_IV)
|
||||
{
|
||||
uint32_t zone_id = static_cast<uint32_t>(SvUV(ST(1)));
|
||||
THIS->SetDzCompass(zone_id, x, y, z, true);
|
||||
THIS->GetDynamicZone().SetCompass(zone_id, x, y, z, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -556,12 +556,12 @@ XS(XS_Expedition_SetSafeReturn) {
|
||||
if (SvTYPE(ST(1)) == SVt_PV)
|
||||
{
|
||||
std::string zone_name(SvPV_nolen(ST(1)));
|
||||
THIS->SetDzSafeReturn(zone_name, x, y, z, heading, true);
|
||||
THIS->GetDynamicZone().SetSafeReturn(ZoneID(zone_name), x, y, z, heading, true);
|
||||
}
|
||||
else if (SvTYPE(ST(1)) == SVt_IV)
|
||||
{
|
||||
uint32_t zone_id = static_cast<uint32_t>(SvUV(ST(1)));
|
||||
THIS->SetDzSafeReturn(zone_id, x, y, z, heading, true);
|
||||
THIS->GetDynamicZone().SetSafeReturn(zone_id, x, y, z, heading, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -582,7 +582,7 @@ XS(XS_Expedition_SetSecondsRemaining) {
|
||||
VALIDATE_THIS_IS_EXPEDITION;
|
||||
|
||||
uint32_t seconds_remaining = static_cast<uint32_t>(SvUV(ST(1)));
|
||||
THIS->SetDzSecondsRemaining(seconds_remaining);
|
||||
THIS->GetDynamicZone().SetSecondsRemaining(seconds_remaining);
|
||||
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
@@ -602,7 +602,7 @@ XS(XS_Expedition_SetZoneInLocation) {
|
||||
float z = static_cast<float>(SvNV(ST(3)));
|
||||
float heading = static_cast<float>(SvNV(ST(4)));
|
||||
|
||||
THIS->SetDzZoneInLocation(x, y, z, heading, true);
|
||||
THIS->GetDynamicZone().SetZoneInLocation(x, y, z, heading, true);
|
||||
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
|
||||
@@ -2900,10 +2900,6 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
case ServerOP_ExpeditionGetOnlineMembers:
|
||||
case ServerOP_ExpeditionDzAddPlayer:
|
||||
case ServerOP_ExpeditionDzMakeLeader:
|
||||
case ServerOP_ExpeditionDzCompass:
|
||||
case ServerOP_ExpeditionDzSafeReturn:
|
||||
case ServerOP_ExpeditionDzZoneIn:
|
||||
case ServerOP_ExpeditionDzDuration:
|
||||
case ServerOP_ExpeditionCharacterLockout:
|
||||
case ServerOP_ExpeditionExpireWarning:
|
||||
{
|
||||
@@ -2912,6 +2908,10 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
}
|
||||
case ServerOP_DzCharacterChange:
|
||||
case ServerOP_DzRemoveAllCharacters:
|
||||
case ServerOP_DzDurationUpdate:
|
||||
case ServerOP_DzSetCompass:
|
||||
case ServerOP_DzSetSafeReturn:
|
||||
case ServerOP_DzSetZoneIn:
|
||||
{
|
||||
DynamicZone::HandleWorldMessage(pack);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user