mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-27 02:12:25 +00:00
Cleanup
This commit is contained in:
parent
9c450ac95b
commit
66cc83cb28
@ -1,6 +1,5 @@
|
|||||||
#include "world_content_service.h"
|
#include "world_content_service.h"
|
||||||
|
|
||||||
#include <utility>
|
|
||||||
#include <glm/vec3.hpp>
|
#include <glm/vec3.hpp>
|
||||||
#include "../database.h"
|
#include "../database.h"
|
||||||
#include "../rulesys.h"
|
#include "../rulesys.h"
|
||||||
@ -23,7 +22,7 @@ WorldContentService *WorldContentService::SetExpansionContext()
|
|||||||
// pull expansion from rules
|
// pull expansion from rules
|
||||||
int expansion = RuleI(Expansion, CurrentExpansion);
|
int expansion = RuleI(Expansion, CurrentExpansion);
|
||||||
if (expansion >= Expansion::Classic && expansion <= Expansion::MaxId) {
|
if (expansion >= Expansion::Classic && expansion <= Expansion::MaxId) {
|
||||||
WorldContentService::Instance()->SetCurrentExpansion(expansion);
|
SetCurrentExpansion(expansion);
|
||||||
}
|
}
|
||||||
|
|
||||||
LogInfo(
|
LogInfo(
|
||||||
@ -37,36 +36,27 @@ WorldContentService *WorldContentService::SetExpansionContext()
|
|||||||
|
|
||||||
std::string WorldContentService::GetCurrentExpansionName()
|
std::string WorldContentService::GetCurrentExpansionName()
|
||||||
{
|
{
|
||||||
if (WorldContentService::Instance()->GetCurrentExpansion() == Expansion::EXPANSION_ALL) {
|
if (GetCurrentExpansion() == Expansion::EXPANSION_ALL) {
|
||||||
return "All Expansions";
|
return "All Expansions";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (current_expansion >= Expansion::Classic && current_expansion <= Expansion::MaxId) {
|
if (current_expansion >= Expansion::Classic && current_expansion <= Expansion::MaxId) {
|
||||||
return Expansion::ExpansionName[WorldContentService::Instance()->GetCurrentExpansion()];
|
return Expansion::ExpansionName[GetCurrentExpansion()];
|
||||||
}
|
}
|
||||||
|
|
||||||
return "Unknown Expansion";
|
return "Unknown Expansion";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param current_expansion
|
|
||||||
*/
|
|
||||||
void WorldContentService::SetCurrentExpansion(int current_expansion)
|
void WorldContentService::SetCurrentExpansion(int current_expansion)
|
||||||
{
|
{
|
||||||
WorldContentService::current_expansion = current_expansion;
|
WorldContentService::current_expansion = current_expansion;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
const std::vector<ContentFlagsRepository::ContentFlags> &WorldContentService::GetContentFlags() const
|
const std::vector<ContentFlagsRepository::ContentFlags> &WorldContentService::GetContentFlags() const
|
||||||
{
|
{
|
||||||
return content_flags;
|
return content_flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
std::vector<std::string> WorldContentService::GetContentFlagsEnabled()
|
std::vector<std::string> WorldContentService::GetContentFlagsEnabled()
|
||||||
{
|
{
|
||||||
std::vector<std::string> enabled_flags;
|
std::vector<std::string> enabled_flags;
|
||||||
@ -80,9 +70,6 @@ std::vector<std::string> WorldContentService::GetContentFlagsEnabled()
|
|||||||
return enabled_flags;
|
return enabled_flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
std::vector<std::string> WorldContentService::GetContentFlagsDisabled()
|
std::vector<std::string> WorldContentService::GetContentFlagsDisabled()
|
||||||
{
|
{
|
||||||
std::vector<std::string> disabled_flags;
|
std::vector<std::string> disabled_flags;
|
||||||
@ -96,18 +83,11 @@ std::vector<std::string> WorldContentService::GetContentFlagsDisabled()
|
|||||||
return disabled_flags;
|
return disabled_flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param content_flags
|
|
||||||
*/
|
|
||||||
void WorldContentService::SetContentFlags(const std::vector<ContentFlagsRepository::ContentFlags> &content_flags)
|
void WorldContentService::SetContentFlags(const std::vector<ContentFlagsRepository::ContentFlags> &content_flags)
|
||||||
{
|
{
|
||||||
WorldContentService::content_flags = content_flags;
|
WorldContentService::content_flags = content_flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param content_flag
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
bool WorldContentService::IsContentFlagEnabled(const std::string &content_flag)
|
bool WorldContentService::IsContentFlagEnabled(const std::string &content_flag)
|
||||||
{
|
{
|
||||||
for (auto &f: GetContentFlags()) {
|
for (auto &f: GetContentFlags()) {
|
||||||
@ -119,10 +99,6 @@ bool WorldContentService::IsContentFlagEnabled(const std::string &content_flag)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param content_flag
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
bool WorldContentService::IsContentFlagDisabled(const std::string &content_flag)
|
bool WorldContentService::IsContentFlagDisabled(const std::string &content_flag)
|
||||||
{
|
{
|
||||||
for (auto &f: GetContentFlags()) {
|
for (auto &f: GetContentFlags()) {
|
||||||
@ -191,7 +167,7 @@ Database *WorldContentService::GetDatabase() const
|
|||||||
|
|
||||||
WorldContentService *WorldContentService::SetDatabase(Database *database)
|
WorldContentService *WorldContentService::SetDatabase(Database *database)
|
||||||
{
|
{
|
||||||
WorldContentService::m_database = database;
|
m_database = database;
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@ -309,7 +285,7 @@ WorldContentService::FindZoneResult WorldContentService::FindZone(uint32 zone_id
|
|||||||
i.notes
|
i.notes
|
||||||
);
|
);
|
||||||
|
|
||||||
return WorldContentService::FindZoneResult{
|
return FindZoneResult{
|
||||||
.zone_id = static_cast<uint32>(z.zoneidnumber),
|
.zone_id = static_cast<uint32>(z.zoneidnumber),
|
||||||
.instance = i,
|
.instance = i,
|
||||||
.zone = z
|
.zone = z
|
||||||
@ -318,7 +294,7 @@ WorldContentService::FindZoneResult WorldContentService::FindZone(uint32 zone_id
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return WorldContentService::FindZoneResult{.zone_id = 0};
|
return FindZoneResult{.zone_id = 0};
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WorldContentService::IsInPublicStaticInstance(uint32 instance_id)
|
bool WorldContentService::IsInPublicStaticInstance(uint32 instance_id)
|
||||||
@ -406,6 +382,4 @@ void WorldContentService::LoadTargetedRulesets(Database* db)
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user