mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 01:11:29 +00:00
Add option to disable expedition conflict messages
Add optional argument to CreateExpedition to disable conflict messages Some live expeditions like anguish use a timeout to prevent excessive leader conflict messages while still performing a creation request
This commit is contained in:
parent
1819b7c23b
commit
78eb3be127
@ -9585,11 +9585,11 @@ void Client::UpdateExpeditionInfoAndLockouts()
|
||||
}
|
||||
|
||||
Expedition* Client::CreateExpedition(
|
||||
std::string zone_name, uint32 version, uint32 duration,
|
||||
std::string expedition_name, uint32 min_players, uint32 max_players, bool has_replay_timer)
|
||||
std::string zone_name, uint32 version, uint32 duration, std::string expedition_name,
|
||||
uint32 min_players, uint32 max_players, bool has_replay_timer, bool disable_messages)
|
||||
{
|
||||
DynamicZone dz_instance{ zone_name, version, duration, DynamicZoneType::Expedition };
|
||||
ExpeditionRequest request{ expedition_name, min_players, max_players, has_replay_timer };
|
||||
ExpeditionRequest request{ expedition_name, min_players, max_players, has_replay_timer, disable_messages };
|
||||
return Expedition::TryCreate(this, dz_instance, request);
|
||||
}
|
||||
|
||||
|
||||
@ -1119,7 +1119,7 @@ public:
|
||||
void AddNewExpeditionLockout(const std::string& expedition_name, const std::string& event_name, uint32_t duration);
|
||||
Expedition* CreateExpedition(
|
||||
std::string zone_name, uint32 version, uint32 duration, std::string expedition_name,
|
||||
uint32 min_players, uint32 max_players, bool has_replay_timer = false);
|
||||
uint32 min_players, uint32 max_players, bool has_replay_timer = false, bool disable_messages = false);
|
||||
Expedition* GetExpedition() const;
|
||||
uint32 GetExpeditionID() const { return m_expedition_id; }
|
||||
const ExpeditionLockoutTimer* GetExpeditionLockout(
|
||||
|
||||
@ -38,12 +38,14 @@ struct ExpeditionRequestConflict
|
||||
};
|
||||
|
||||
ExpeditionRequest::ExpeditionRequest(
|
||||
std::string expedition_name, uint32_t min_players, uint32_t max_players, bool has_replay_timer
|
||||
std::string expedition_name, uint32_t min_players, uint32_t max_players,
|
||||
bool has_replay_timer, bool disable_messages
|
||||
) :
|
||||
m_expedition_name(expedition_name),
|
||||
m_min_players(min_players),
|
||||
m_max_players(max_players),
|
||||
m_has_replay_timer(has_replay_timer)
|
||||
m_has_replay_timer(has_replay_timer),
|
||||
m_disable_messages(disable_messages)
|
||||
{
|
||||
}
|
||||
|
||||
@ -288,11 +290,18 @@ bool ExpeditionRequest::CheckMembersForConflicts(MySQLRequestResult& results, bo
|
||||
void ExpeditionRequest::SendLeaderMessage(
|
||||
uint16_t chat_type, uint32_t string_id, const std::initializer_list<std::string>& parameters)
|
||||
{
|
||||
Client::SendCrossZoneMessageString(m_leader, m_leader_name, chat_type, string_id, parameters);
|
||||
if (!m_disable_messages)
|
||||
{
|
||||
Client::SendCrossZoneMessageString(m_leader, m_leader_name, chat_type, string_id, parameters);
|
||||
}
|
||||
}
|
||||
|
||||
void ExpeditionRequest::SendLeaderMemberInExpedition(const std::string& member_name, bool is_solo)
|
||||
{
|
||||
if (m_disable_messages) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (is_solo)
|
||||
{
|
||||
SendLeaderMessage(Chat::Red, EXPEDITION_YOU_BELONG);
|
||||
@ -307,7 +316,7 @@ void ExpeditionRequest::SendLeaderMemberInExpedition(const std::string& member_n
|
||||
void ExpeditionRequest::SendLeaderMemberReplayLockout(
|
||||
const std::string& member_name, const ExpeditionLockoutTimer& lockout, bool is_solo)
|
||||
{
|
||||
if (lockout.GetSecondsRemaining() <= 0)
|
||||
if (m_disable_messages || lockout.GetSecondsRemaining() <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -330,7 +339,7 @@ void ExpeditionRequest::SendLeaderMemberReplayLockout(
|
||||
void ExpeditionRequest::SendLeaderMemberEventLockout(
|
||||
const std::string& member_name, const ExpeditionLockoutTimer& lockout)
|
||||
{
|
||||
if (lockout.GetSecondsRemaining() <= 0)
|
||||
if (m_disable_messages || lockout.GetSecondsRemaining() <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@ -37,7 +37,9 @@ struct ExpeditionMember;
|
||||
class ExpeditionRequest
|
||||
{
|
||||
public:
|
||||
ExpeditionRequest(std::string expedition_name, uint32_t min_players, uint32_t max_players, bool has_replay_timer);
|
||||
ExpeditionRequest(
|
||||
std::string expedition_name, uint32_t min_players, uint32_t max_players,
|
||||
bool has_replay_timer, bool disable_messages = false);
|
||||
|
||||
bool Validate(Client* requester);
|
||||
|
||||
@ -69,6 +71,7 @@ private:
|
||||
uint32_t m_min_players = 0;
|
||||
uint32_t m_max_players = 0;
|
||||
bool m_check_event_lockouts = true;
|
||||
bool m_disable_messages = false;
|
||||
bool m_has_replay_timer = false;
|
||||
std::string m_expedition_name;
|
||||
std::string m_leader_name;
|
||||
|
||||
@ -1656,6 +1656,11 @@ Lua_Expedition Lua_Client::CreateExpedition(std::string zone_name, uint32 versio
|
||||
return self->CreateExpedition(zone_name, version, duration, expedition_name, min_players, max_players, has_replay_timer);
|
||||
}
|
||||
|
||||
Lua_Expedition Lua_Client::CreateExpedition(std::string zone_name, uint32 version, uint32 duration, std::string expedition_name, uint32 min_players, uint32 max_players, bool has_replay_timer, bool disable_messages) {
|
||||
Lua_Safe_Call_Class(Lua_Expedition);
|
||||
return self->CreateExpedition(zone_name, version, duration, expedition_name, min_players, max_players, has_replay_timer, disable_messages);
|
||||
}
|
||||
|
||||
Lua_Expedition Lua_Client::GetExpedition() {
|
||||
Lua_Safe_Call_Class(Lua_Expedition);
|
||||
return self->GetExpedition();
|
||||
@ -2036,6 +2041,7 @@ luabind::scope lua_register_client() {
|
||||
.def("GetClientMaxLevel", (int(Lua_Client::*)(void))&Lua_Client::GetClientMaxLevel)
|
||||
.def("CreateExpedition", (Lua_Expedition(Lua_Client::*)(std::string, uint32, uint32, std::string, uint32, uint32))&Lua_Client::CreateExpedition)
|
||||
.def("CreateExpedition", (Lua_Expedition(Lua_Client::*)(std::string, uint32, uint32, std::string, uint32, uint32, bool))&Lua_Client::CreateExpedition)
|
||||
.def("CreateExpedition", (Lua_Expedition(Lua_Client::*)(std::string, uint32, uint32, std::string, uint32, uint32, bool, bool))&Lua_Client::CreateExpedition)
|
||||
.def("GetExpedition", (Lua_Expedition(Lua_Client::*)(void))&Lua_Client::GetExpedition)
|
||||
.def("GetExpeditionLockouts", (luabind::object(Lua_Client::*)(lua_State* L))&Lua_Client::GetExpeditionLockouts)
|
||||
.def("GetExpeditionLockouts", (luabind::object(Lua_Client::*)(lua_State* L, std::string))&Lua_Client::GetExpeditionLockouts)
|
||||
|
||||
@ -341,6 +341,7 @@ public:
|
||||
|
||||
Lua_Expedition CreateExpedition(std::string zone_name, uint32 version, uint32 duration, std::string expedition_name, uint32 min_players, uint32 max_players);
|
||||
Lua_Expedition CreateExpedition(std::string zone_name, uint32 version, uint32 duration, std::string expedition_name, uint32 min_players, uint32 max_players, bool has_replay_timer);
|
||||
Lua_Expedition CreateExpedition(std::string zone_name, uint32 version, uint32 duration, std::string expedition_name, uint32 min_players, uint32 max_players, bool has_replay_timer, bool disable_messages);
|
||||
Lua_Expedition GetExpedition();
|
||||
luabind::object GetExpeditionLockouts(lua_State* L);
|
||||
luabind::object GetExpeditionLockouts(lua_State* L, std::string expedition_name);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user