mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 01:11:29 +00:00
Add expansion gating for zoning
This commit is contained in:
parent
cc8aa354f1
commit
c1e58673b2
@ -117,7 +117,7 @@ SET(repositories
|
|||||||
repositories/spawngroup_repository.h
|
repositories/spawngroup_repository.h
|
||||||
repositories/tradeskill_recipe_repository.h
|
repositories/tradeskill_recipe_repository.h
|
||||||
repositories/instance_list_repository.h
|
repositories/instance_list_repository.h
|
||||||
)
|
repositories/zone_repository.h)
|
||||||
|
|
||||||
SET(common_headers
|
SET(common_headers
|
||||||
any.h
|
any.h
|
||||||
|
|||||||
@ -62,8 +62,10 @@ namespace Expansion {
|
|||||||
static const char *ExpansionName[ExpansionNumber::MaxId] = {
|
static const char *ExpansionName[ExpansionNumber::MaxId] = {
|
||||||
"Classic",
|
"Classic",
|
||||||
"The Ruins of Kunark",
|
"The Ruins of Kunark",
|
||||||
|
"The Shards of Velious",
|
||||||
"The Shadows of Luclin",
|
"The Shadows of Luclin",
|
||||||
"The Planes of Power",
|
"The Planes of Power",
|
||||||
|
"The Legacy of Ykesha",
|
||||||
"Lost Dungeons of Norrath",
|
"Lost Dungeons of Norrath",
|
||||||
"Gates of Discord",
|
"Gates of Discord",
|
||||||
"Omens of War",
|
"Omens of War",
|
||||||
|
|||||||
1054
common/repositories/zone_repository.h
Normal file
1054
common/repositories/zone_repository.h
Normal file
File diff suppressed because it is too large
Load Diff
@ -58,6 +58,7 @@ namespace WorldserverCommandHandler {
|
|||||||
function_map["database:schema"] = &WorldserverCommandHandler::DatabaseGetSchema;
|
function_map["database:schema"] = &WorldserverCommandHandler::DatabaseGetSchema;
|
||||||
function_map["database:dump"] = &WorldserverCommandHandler::DatabaseDump;
|
function_map["database:dump"] = &WorldserverCommandHandler::DatabaseDump;
|
||||||
function_map["test:test"] = &WorldserverCommandHandler::TestCommand;
|
function_map["test:test"] = &WorldserverCommandHandler::TestCommand;
|
||||||
|
function_map["test:expansion"] = &WorldserverCommandHandler::ExpansionTestCommand;
|
||||||
function_map["test:repository"] = &WorldserverCommandHandler::TestRepository;
|
function_map["test:repository"] = &WorldserverCommandHandler::TestRepository;
|
||||||
|
|
||||||
EQEmuCommand::HandleMenu(function_map, cmd, argc, argv);
|
EQEmuCommand::HandleMenu(function_map, cmd, argc, argv);
|
||||||
@ -291,6 +292,22 @@ namespace WorldserverCommandHandler {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param argc
|
||||||
|
* @param argv
|
||||||
|
* @param cmd
|
||||||
|
* @param description
|
||||||
|
*/
|
||||||
|
void ExpansionTestCommand(int argc, char **argv, argh::parser &cmd, std::string &description)
|
||||||
|
{
|
||||||
|
description = "Expansion test command";
|
||||||
|
|
||||||
|
if (cmd[{"-h", "--help"}]) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!RuleManager::Instance()->LoadRules(&database, "default", false)) {
|
if (!RuleManager::Instance()->LoadRules(&database, "default", false)) {
|
||||||
LogInfo("No rule set configured, using default rules");
|
LogInfo("No rule set configured, using default rules");
|
||||||
}
|
}
|
||||||
@ -405,4 +422,4 @@ namespace WorldserverCommandHandler {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,6 +32,7 @@ namespace WorldserverCommandHandler {
|
|||||||
void DatabaseGetSchema(int argc, char **argv, argh::parser &cmd, std::string &description);
|
void DatabaseGetSchema(int argc, char **argv, argh::parser &cmd, std::string &description);
|
||||||
void DatabaseDump(int argc, char **argv, argh::parser &cmd, std::string &description);
|
void DatabaseDump(int argc, char **argv, argh::parser &cmd, std::string &description);
|
||||||
void TestCommand(int argc, char **argv, argh::parser &cmd, std::string &description);
|
void TestCommand(int argc, char **argv, argh::parser &cmd, std::string &description);
|
||||||
|
void ExpansionTestCommand(int argc, char **argv, argh::parser &cmd, std::string &description);
|
||||||
void TestRepository(int argc, char **argv, argh::parser &cmd, std::string &description);
|
void TestRepository(int argc, char **argv, argh::parser &cmd, std::string &description);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -90,6 +90,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||||||
#else
|
#else
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include "../common/unix.h"
|
#include "../common/unix.h"
|
||||||
|
|
||||||
|
#include "../common/content/world_content_service.h"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
volatile bool RunLoops = true;
|
volatile bool RunLoops = true;
|
||||||
@ -107,6 +110,7 @@ TaskManager *taskmanager = 0;
|
|||||||
NpcScaleManager *npc_scale_manager;
|
NpcScaleManager *npc_scale_manager;
|
||||||
QuestParserCollection *parse = 0;
|
QuestParserCollection *parse = 0;
|
||||||
EQEmuLogSys LogSys;
|
EQEmuLogSys LogSys;
|
||||||
|
WorldContentService content_service;
|
||||||
const SPDat_Spell_Struct* spells;
|
const SPDat_Spell_Struct* spells;
|
||||||
int32 SPDAT_RECORDS = -1;
|
int32 SPDAT_RECORDS = -1;
|
||||||
const ZoneConfig *Config;
|
const ZoneConfig *Config;
|
||||||
@ -392,6 +396,14 @@ int main(int argc, char** argv) {
|
|||||||
LogInfo("Initialized dynamic dictionary entries");
|
LogInfo("Initialized dynamic dictionary entries");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
content_service.SetCurrentExpansion(RuleI(Expansion, CurrentExpansion));
|
||||||
|
|
||||||
|
LogInfo(
|
||||||
|
"Current expansion is [{}] ({})",
|
||||||
|
content_service.GetCurrentExpansion(),
|
||||||
|
Expansion::ExpansionName[content_service.GetCurrentExpansion()]
|
||||||
|
);
|
||||||
|
|
||||||
#ifdef BOTS
|
#ifdef BOTS
|
||||||
LogInfo("Loading bot commands");
|
LogInfo("Loading bot commands");
|
||||||
int botretval = bot_command_init();
|
int botretval = bot_command_init();
|
||||||
|
|||||||
@ -35,6 +35,9 @@ extern QueryServ* QServ;
|
|||||||
extern WorldServer worldserver;
|
extern WorldServer worldserver;
|
||||||
extern Zone* zone;
|
extern Zone* zone;
|
||||||
|
|
||||||
|
#include "../common/repositories/zone_repository.h"
|
||||||
|
#include "../common/content/world_content_service.h"
|
||||||
|
|
||||||
|
|
||||||
void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) {
|
void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) {
|
||||||
#ifdef BOTS
|
#ifdef BOTS
|
||||||
@ -284,6 +287,29 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) {
|
|||||||
|
|
||||||
//TODO: ADVENTURE ENTRANCE CHECK
|
//TODO: ADVENTURE ENTRANCE CHECK
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Expansion check
|
||||||
|
*/
|
||||||
|
auto zones = ZoneRepository::GetWhere(
|
||||||
|
fmt::format(
|
||||||
|
"expansion <= {} AND short_name = '{}'",
|
||||||
|
(content_service.GetCurrentExpansion() + 1),
|
||||||
|
target_zone_name
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
LogInfo(
|
||||||
|
"Checking zone request [{}] for expansion [{}] ({}) success [{}]",
|
||||||
|
target_zone_name,
|
||||||
|
(content_service.GetCurrentExpansion() + 1),
|
||||||
|
Expansion::ExpansionName[content_service.GetCurrentExpansion()],
|
||||||
|
!zones.empty() ? "true" : "false"
|
||||||
|
);
|
||||||
|
|
||||||
|
if (zones.empty()) {
|
||||||
|
myerror = ZONE_ERROR_NOEXPANSION;
|
||||||
|
}
|
||||||
|
|
||||||
if(myerror == 1) {
|
if(myerror == 1) {
|
||||||
//we have successfully zoned
|
//we have successfully zoned
|
||||||
DoZoneSuccess(zc, target_zone_id, target_instance_id, dest_x, dest_y, dest_z, dest_h, ignorerestrictions);
|
DoZoneSuccess(zc, target_zone_id, target_instance_id, dest_x, dest_y, dest_z, dest_h, ignorerestrictions);
|
||||||
@ -530,7 +556,7 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z
|
|||||||
heading = m_pp.binds[0].heading;
|
heading = m_pp.binds[0].heading;
|
||||||
|
|
||||||
zonesummon_ignorerestrictions = 1;
|
zonesummon_ignorerestrictions = 1;
|
||||||
LogDebug("Player [{}] has died and will be zoned to bind point in zone: [{}] at LOC x=[{}], y=[{}], z=[{}], heading=[{}]",
|
LogDebug("Player [{}] has died and will be zoned to bind point in zone: [{}] at LOC x=[{}], y=[{}], z=[{}], heading=[{}]",
|
||||||
GetName(), pZoneName, m_pp.binds[0].x, m_pp.binds[0].y, m_pp.binds[0].z, m_pp.binds[0].heading);
|
GetName(), pZoneName, m_pp.binds[0].x, m_pp.binds[0].y, m_pp.binds[0].z, m_pp.binds[0].heading);
|
||||||
break;
|
break;
|
||||||
case SummonPC:
|
case SummonPC:
|
||||||
@ -539,8 +565,8 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z
|
|||||||
SetHeading(heading);
|
SetHeading(heading);
|
||||||
break;
|
break;
|
||||||
case Rewind:
|
case Rewind:
|
||||||
LogDebug("[{}] has requested a /rewind from [{}], [{}], [{}], to [{}], [{}], [{}] in [{}]", GetName(),
|
LogDebug("[{}] has requested a /rewind from [{}], [{}], [{}], to [{}], [{}], [{}] in [{}]", GetName(),
|
||||||
m_Position.x, m_Position.y, m_Position.z,
|
m_Position.x, m_Position.y, m_Position.z,
|
||||||
m_RewindLocation.x, m_RewindLocation.y, m_RewindLocation.z, zone->GetShortName());
|
m_RewindLocation.x, m_RewindLocation.y, m_RewindLocation.z, zone->GetShortName());
|
||||||
m_ZoneSummonLocation = glm::vec3(x, y, z);
|
m_ZoneSummonLocation = glm::vec3(x, y, z);
|
||||||
m_Position = glm::vec4(m_ZoneSummonLocation, 0.0f);
|
m_Position = glm::vec4(m_ZoneSummonLocation, 0.0f);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user