mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-18 20:08:21 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 05f566ad07 | |||
| c7a8d796fc | |||
| 77163ec137 |
-155
@@ -1,158 +1,3 @@
|
|||||||
## [23.9.1] 8/2/2025
|
|
||||||
|
|
||||||
### Hotfix
|
|
||||||
|
|
||||||
* Fix Quest Ownership Edge Case ([#4977](https://github.com/EQEmu/Server/pull/4977)) @Kinglykrab 2025-08-02
|
|
||||||
|
|
||||||
## [23.9.0] 8/2/2025
|
|
||||||
|
|
||||||
### Bots
|
|
||||||
|
|
||||||
* Fix FinishBuffing rule ([#4961](https://github.com/EQEmu/Server/pull/4961)) @nytmyr 2025-07-01
|
|
||||||
* Fix ^cast resurrects ([#4958](https://github.com/EQEmu/Server/pull/4958)) @nytmyr 2025-06-29
|
|
||||||
|
|
||||||
### Build
|
|
||||||
|
|
||||||
* Fix Linking with GCC ([#4969](https://github.com/EQEmu/Server/pull/4969)) @solar984 2025-08-03
|
|
||||||
* More Build Speed Improvements ([#4959](https://github.com/EQEmu/Server/pull/4959)) @Akkadius 2025-06-30
|
|
||||||
|
|
||||||
### Commands
|
|
||||||
|
|
||||||
* Add #show keyring Subcommand ([#4973](https://github.com/EQEmu/Server/pull/4973)) @Kinglykrab 2025-08-03
|
|
||||||
|
|
||||||
### Database
|
|
||||||
|
|
||||||
* Add Indexes to NPC's Spawns Loot ([#4972](https://github.com/EQEmu/Server/pull/4972)) @Akkadius 2025-07-30
|
|
||||||
|
|
||||||
### Feature
|
|
||||||
|
|
||||||
* Zone Scripting ([#4908](https://github.com/EQEmu/Server/pull/4908)) @Kinglykrab 2025-07-10
|
|
||||||
|
|
||||||
### Fixes
|
|
||||||
|
|
||||||
* Add a missing Froglok starting area for Titanium Startzone. ([#4962](https://github.com/EQEmu/Server/pull/4962)) @regneq 2025-07-04
|
|
||||||
* Fix Hero's Forge Ingame and Character Select ([#4966](https://github.com/EQEmu/Server/pull/4966)) @Kinglykrab 2025-07-30
|
|
||||||
* Show player count on the server list status. ([#4971](https://github.com/EQEmu/Server/pull/4971)) @regneq 2025-07-30
|
|
||||||
|
|
||||||
### Loginserver
|
|
||||||
|
|
||||||
* Fix Legacy World When Using Local DB ([#4970](https://github.com/EQEmu/Server/pull/4970)) @solar984 2025-08-03
|
|
||||||
|
|
||||||
### Performance
|
|
||||||
|
|
||||||
* Clear Wearchange Deduplication Cache ([#4960](https://github.com/EQEmu/Server/pull/4960)) @Akkadius 2025-06-30
|
|
||||||
|
|
||||||
### Quest API
|
|
||||||
|
|
||||||
* Add GetMemberRole() to Perl/Lua ([#4963](https://github.com/EQEmu/Server/pull/4963)) @Barathos 2025-07-10
|
|
||||||
* Add GetTimers() and GetPausedTimers() to Perl/Lua ([#4965](https://github.com/EQEmu/Server/pull/4965)) @Kinglykrab 2025-08-03
|
|
||||||
|
|
||||||
## [23.8.1] 6/28/2025
|
|
||||||
|
|
||||||
### Crash Fix
|
|
||||||
|
|
||||||
* Fix Possible Crashes with Raid Methods ([#4955](https://github.com/EQEmu/Server/pull/4955)) @Kinglykrab 2025-06-26
|
|
||||||
|
|
||||||
### Databuckets
|
|
||||||
|
|
||||||
* Revert Caching Changes of #4917 ([#4957](https://github.com/EQEmu/Server/pull/4957)) @Akkadius 2025-06-28
|
|
||||||
|
|
||||||
### Fixes
|
|
||||||
|
|
||||||
* Fix FindCharacter Using content_db ([#4956](https://github.com/EQEmu/Server/pull/4956)) @Kinglykrab 2025-06-26
|
|
||||||
* Fix Hero Forge on Character Select ([#4954](https://github.com/EQEmu/Server/pull/4954)) @Kinglykrab 2025-06-26
|
|
||||||
|
|
||||||
## [23.8.0] 6/25/2025
|
|
||||||
|
|
||||||
### API
|
|
||||||
|
|
||||||
* Add wwmarquee <type> <message> ([#4919](https://github.com/EQEmu/Server/pull/4919)) @Akkadius 2025-06-23
|
|
||||||
|
|
||||||
### Build
|
|
||||||
|
|
||||||
* Significantly Improve Build Times Using Unity Builds ([#4948](https://github.com/EQEmu/Server/pull/4948)) @Akkadius 2025-06-22
|
|
||||||
|
|
||||||
### Code
|
|
||||||
|
|
||||||
* AdventureManager Global to Singleton Cleanup ([#4931](https://github.com/EQEmu/Server/pull/4931)) @Kinglykrab 2025-06-25
|
|
||||||
* Cleanup Strings Header ([#4950](https://github.com/EQEmu/Server/pull/4950)) @Akkadius 2025-06-22
|
|
||||||
* ClientList Global to Singleton Cleanup ([#4942](https://github.com/EQEmu/Server/pull/4942)) @Kinglykrab 2025-06-25
|
|
||||||
* DatabaseUpdate Global to Singleton Cleanup ([#4943](https://github.com/EQEmu/Server/pull/4943)) @Kinglykrab 2025-06-25
|
|
||||||
* DiscordManager Global to Singleton Cleanup ([#4926](https://github.com/EQEmu/Server/pull/4926)) @Kinglykrab 2025-06-25
|
|
||||||
* EQ::Random Global to Singleton Cleanup ([#4936](https://github.com/EQEmu/Server/pull/4936)) @Kinglykrab 2025-06-22
|
|
||||||
* EQEmuLogSys Global to Singleton Cleanup ([#4925](https://github.com/EQEmu/Server/pull/4925)) @Akkadius 2025-06-25
|
|
||||||
* EvolvingItemsManager Global to Singleton Cleanup ([#4929](https://github.com/EQEmu/Server/pull/4929)) @Kinglykrab 2025-06-25
|
|
||||||
* LFGuildManager Global to Singleton Cleanup ([#4927](https://github.com/EQEmu/Server/pull/4927)) @Kinglykrab 2025-06-25
|
|
||||||
* LoginServerList Global to Singleton Cleanup ([#4941](https://github.com/EQEmu/Server/pull/4941)) @Kinglykrab 2025-06-25
|
|
||||||
* Optimize PCH Config (Faster Builds) ([#4951](https://github.com/EQEmu/Server/pull/4951)) @Akkadius 2025-06-22
|
|
||||||
* PCH Cleanup ([#4952](https://github.com/EQEmu/Server/pull/4952)) @Akkadius 2025-06-25
|
|
||||||
* PathManager Global to Singleton Cleanup ([#4924](https://github.com/EQEmu/Server/pull/4924)) @Akkadius 2025-06-22
|
|
||||||
* PetitionList Global to Singleton Cleanup ([#4944](https://github.com/EQEmu/Server/pull/4944)) @Kinglykrab 2025-06-25
|
|
||||||
* PlayerEventLogs Global to Singleton Cleanup ([#4928](https://github.com/EQEmu/Server/pull/4928)) @Kinglykrab 2025-06-25
|
|
||||||
* QueryServConnection Global to Singleton Cleanup ([#4938](https://github.com/EQEmu/Server/pull/4938)) @Kinglykrab 2025-06-25
|
|
||||||
* Remove Lua Rule Constants ([#4949](https://github.com/EQEmu/Server/pull/4949)) @Akkadius 2025-06-22
|
|
||||||
* Remove Regex Compile Bloat ([#4947](https://github.com/EQEmu/Server/pull/4947)) @Akkadius 2025-06-22
|
|
||||||
* Remove Unused MZoneShutdown Mutex ([#4946](https://github.com/EQEmu/Server/pull/4946)) @Kinglykrab 2025-06-22
|
|
||||||
* SharedTaskManager Global to Singleton Cleanup ([#4930](https://github.com/EQEmu/Server/pull/4930)) @Kinglykrab 2025-06-25
|
|
||||||
* SkillCaps Global to Singleton Cleanup ([#4933](https://github.com/EQEmu/Server/pull/4933)) @Kinglykrab 2025-06-22
|
|
||||||
* TaskManager Global to Singleton Cleanup ([#4945](https://github.com/EQEmu/Server/pull/4945)) @Kinglykrab 2025-06-22
|
|
||||||
* UCSConnection Global to Singleton Cleanup ([#4937](https://github.com/EQEmu/Server/pull/4937)) @Kinglykrab 2025-06-25
|
|
||||||
* WebInterfaceList Global to Singleton Cleanup ([#4935](https://github.com/EQEmu/Server/pull/4935)) @Kinglykrab 2025-06-25
|
|
||||||
* WorldContentServer Global to Singleton Cleanup ([#4939](https://github.com/EQEmu/Server/pull/4939)) @Kinglykrab 2025-06-25
|
|
||||||
* WorldEventScheduler and ZoneEventScheduler Global to Singleton Cleanup ([#4932](https://github.com/EQEmu/Server/pull/4932)) @Kinglykrab 2025-06-25
|
|
||||||
* ZSList Global to Singleton Cleanup ([#4940](https://github.com/EQEmu/Server/pull/4940)) @Kinglykrab 2025-06-25
|
|
||||||
* ZoneStore Global to Singleton Cleanup ([#4934](https://github.com/EQEmu/Server/pull/4934)) @Kinglykrab 2025-06-23
|
|
||||||
|
|
||||||
### Corpses
|
|
||||||
|
|
||||||
* Add corpse entity variables to DB ([#4911](https://github.com/EQEmu/Server/pull/4911)) @fryguy503 2025-06-25
|
|
||||||
|
|
||||||
### Databuckets
|
|
||||||
|
|
||||||
* Move Databuckets to Common ([#4918](https://github.com/EQEmu/Server/pull/4918)) @Akkadius 2025-06-16
|
|
||||||
* Nested Caching ([#4917](https://github.com/EQEmu/Server/pull/4917)) @Akkadius 2025-06-25
|
|
||||||
|
|
||||||
### Doors
|
|
||||||
|
|
||||||
* Fix door saving for versions ([#4905](https://github.com/EQEmu/Server/pull/4905)) @nytmyr 2025-06-09
|
|
||||||
|
|
||||||
### Fixes
|
|
||||||
|
|
||||||
* Bulk Send Corpses after Idle State ([#4910](https://github.com/EQEmu/Server/pull/4910)) @Akkadius 2025-06-09
|
|
||||||
* Fix ClientList Singleton Shortcomings of #4942 @Akkadius 2025-06-25
|
|
||||||
* Fix breaking changes to Titanium, SoF, SoD patches causes by big bags update ([#4922](https://github.com/EQEmu/Server/pull/4922)) @regneq 2025-06-25
|
|
||||||
|
|
||||||
### Logs
|
|
||||||
|
|
||||||
* Fix output for tasks in logs ([#4907](https://github.com/EQEmu/Server/pull/4907)) @joligario 2025-06-09
|
|
||||||
|
|
||||||
### Performance
|
|
||||||
|
|
||||||
* Auto Idle / AFK ([#4903](https://github.com/EQEmu/Server/pull/4903)) @Akkadius 2025-05-22
|
|
||||||
* Wearchange Packet Send Deduplication ([#4916](https://github.com/EQEmu/Server/pull/4916)) @Akkadius 2025-06-25
|
|
||||||
|
|
||||||
### Player Event Logs
|
|
||||||
|
|
||||||
* Don't Clear Event Data on ETL Events ([#4913](https://github.com/EQEmu/Server/pull/4913)) @Akkadius 2025-06-25
|
|
||||||
|
|
||||||
### Player Events
|
|
||||||
|
|
||||||
* Don't Write Empty Data ([#4912](https://github.com/EQEmu/Server/pull/4912)) @Akkadius 2025-06-25
|
|
||||||
* Zone Fetch Settings from QS if Enabled ([#4915](https://github.com/EQEmu/Server/pull/4915)) @Akkadius 2025-06-25
|
|
||||||
|
|
||||||
### Quest API
|
|
||||||
|
|
||||||
* Add CompleteTask and UncompleteTask methods to Perl/Lua ([#4921](https://github.com/EQEmu/Server/pull/4921)) @Barathos 2025-06-25
|
|
||||||
* Lua Client Scoped EnableTitleSets ([#4914](https://github.com/EQEmu/Server/pull/4914)) @fryguy503 2025-06-25
|
|
||||||
|
|
||||||
### Quests
|
|
||||||
|
|
||||||
* Support Multiple Quest, Plugin, and Lua Module Paths ([#4906](https://github.com/EQEmu/Server/pull/4906)) @Akkadius 2025-06-09
|
|
||||||
|
|
||||||
### World API
|
|
||||||
|
|
||||||
* Input Validation ([#4904](https://github.com/EQEmu/Server/pull/4904)) @Akkadius 2025-05-22
|
|
||||||
|
|
||||||
## [23.7.0] 5/19/2025
|
## [23.7.0] 5/19/2025
|
||||||
|
|
||||||
### CLI
|
### CLI
|
||||||
|
|||||||
@@ -363,8 +363,6 @@ MESSAGE(STATUS "**************************************************")
|
|||||||
#setup server libs and headers
|
#setup server libs and headers
|
||||||
SET(SERVER_LIBS common ${DATABASE_LIBRARY_LIBS} ${ZLIB_LIBRARY_LIBS} ${Boost_LIBRARIES} uv_a fmt RecastNavigation::Detour)
|
SET(SERVER_LIBS common ${DATABASE_LIBRARY_LIBS} ${ZLIB_LIBRARY_LIBS} ${Boost_LIBRARIES} uv_a fmt RecastNavigation::Detour)
|
||||||
|
|
||||||
set(FMT_HEADER_ONLY OFF)
|
|
||||||
|
|
||||||
INCLUDE_DIRECTORIES(SYSTEM "${DATABASE_LIBRARY_INCLUDE}")
|
INCLUDE_DIRECTORIES(SYSTEM "${DATABASE_LIBRARY_INCLUDE}")
|
||||||
INCLUDE_DIRECTORIES(SYSTEM "${ZLIB_LIBRARY_INCLUDE}")
|
INCLUDE_DIRECTORIES(SYSTEM "${ZLIB_LIBRARY_INCLUDE}")
|
||||||
INCLUDE_DIRECTORIES(SYSTEM "${Boost_INCLUDE_DIRS}")
|
INCLUDE_DIRECTORIES(SYSTEM "${Boost_INCLUDE_DIRS}")
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<b>EQEmulator - A Fan-Made Project Honoring a Legendary MMORPG</b>
|
<b>EverQuest Emulator (EQEmu) - A Fan-Made Project Honoring the Legendary MMORPG</b>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
@@ -26,19 +26,19 @@
|
|||||||
***
|
***
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
EQEmulator is a <b>passion-driven</b>, <b>open source server emulator</b> project dedicated to preserving and celebrating the legacy of a groundbreaking classic MMORPG.
|
EQEmulator is a <b>passion-driven</b>, <b>open source server emulator</b> project dedicated to preserving and celebrating the groundbreaking world of <b>EverQuest</b>, the massively multiplayer online role-playing game originally developed by <b>Verant Interactive</b> and <b>Sony Online Entertainment (now Daybreak Game Company)</b>.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
For over two decades and continuing, EQEmulator has served as a <strong>fan tribute</strong>, providing tools and technology that allow players to explore, customize, and experience the legendary game's iconic gameplay in new ways. This project exists solely out of <strong>deep admiration</strong> for the original developers, artists, designers, and visionaries who created one of the most influential online worlds of all time.
|
For over two decades and continuing, EQEmulator has served as a <strong>fan tribute</strong>, providing tools and technology that allow players to explore, customize, and experience EverQuest’s iconic gameplay in new ways. This project exists solely out of <strong>deep admiration</strong> for the original developers, artists, designers, and visionaries who created one of the most influential online worlds of all time.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
We do not claim ownership of the original game or its assets. <strong>All credit and respect belong to the original creators and Daybreak Game Company</strong>, whose work continues to inspire generations of players and developers alike.
|
We do not claim ownership of EverQuest or its assets. <strong>All credit and respect belong to the original creators and Daybreak Game Company</strong>, whose work continues to inspire generations of players and developers alike.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
EQEmulator has for over 20 years and always will be a <strong>fan-based, non-commercial open-source effort</strong> made by players, for players—preserving the legacy of the game while empowering community-driven creativity, learning and joy that the game and its creators has so strongly inspired in us all.
|
EQEmulator has for over 20 years and always will be a <strong>fan-based, non-commercial open-source effort</strong> made by players, for players—preserving the legacy of EverQuest while empowering community-driven creativity, learning and joy that the game and its creators has so strongly inspired in us all.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
***
|
***
|
||||||
@@ -47,7 +47,7 @@ EQEmulator has for over 20 years and always will be a <strong>fan-based, non-com
|
|||||||
Technical Overview & Reverse Engineering Effort
|
Technical Overview & Reverse Engineering Effort
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<p align="center">EQEmulator represents <strong>over two decades of collaborative reverse engineering</strong>, building the server from the ground up without access to the original source code. This effort was achieved entirely through <strong>community-driven analysis, network protocol decoding, and in-game behavioral research</strong>.</p>
|
<p align="center">EQEmulator represents <strong>over two decades of collaborative reverse engineering</strong>, rebuilding the EverQuest server from the ground up without access to the original source code. This effort was achieved entirely through <strong>community-driven analysis, network protocol decoding, and in-game behavioral research</strong>.</p>
|
||||||
|
|
||||||
<h1 align="center">
|
<h1 align="center">
|
||||||
💡 How We Did It
|
💡 How We Did It
|
||||||
@@ -104,10 +104,10 @@ Every system, packet, opcode, and game mechanic has been reconstructed through c
|
|||||||
🚀 Why It Matters
|
🚀 Why It Matters
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<p align="center">🧬 EQEmulator stands as a <strong>technical preservation project</strong>, ensuring that the magic of classic and custom servers lives on for future generations of players, tinkerers, and game designers.
|
<p align="center">🧬 EQEmulator stands as a <strong>technical preservation project</strong>, ensuring that the magic of classic and custom EverQuest servers lives on for future generations of players, tinkerers, and game designers.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
> We humbly acknowledge and thank the original developers for creating one of the most influential online experiences in gaming history.
|
> We humbly acknowledge and thank the original developers at **Verant Interactive** and **Sony Online Entertainment (now Daybreak Game Company)** for creating one of the most influential online experiences in gaming history.
|
||||||
|
|
||||||
<h1 align="center">
|
<h1 align="center">
|
||||||
🧑💻🖥️ Supported Clients
|
🧑💻🖥️ Supported Clients
|
||||||
@@ -148,3 +148,4 @@ If you want to set up your own EQEmulator server, please refer to the current [s
|
|||||||
<a href="https://github.com/EQEmu/server/graphs/contributors">
|
<a href="https://github.com/EQEmu/server/graphs/contributors">
|
||||||
<img src="https://contributors-img.firebaseapp.com/image?repo=EQEmu/server" />
|
<img src="https://contributors-img.firebaseapp.com/image?repo=EQEmu/server" />
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
|||||||
@@ -38,6 +38,13 @@
|
|||||||
#include "../../common/skill_caps.h"
|
#include "../../common/skill_caps.h"
|
||||||
#include "../../common/evolving_items.h"
|
#include "../../common/evolving_items.h"
|
||||||
|
|
||||||
|
EQEmuLogSys LogSys;
|
||||||
|
WorldContentService content_service;
|
||||||
|
ZoneStore zone_store;
|
||||||
|
PathManager path;
|
||||||
|
PlayerEventLogs player_event_logs;
|
||||||
|
EvolvingItemsManager evolving_items_manager;
|
||||||
|
|
||||||
void ExportSpells(SharedDatabase *db);
|
void ExportSpells(SharedDatabase *db);
|
||||||
void ExportSkillCaps(SharedDatabase *db);
|
void ExportSkillCaps(SharedDatabase *db);
|
||||||
void ExportBaseData(SharedDatabase *db);
|
void ExportBaseData(SharedDatabase *db);
|
||||||
@@ -46,10 +53,10 @@ void ExportDBStrings(SharedDatabase *db);
|
|||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
RegisterExecutablePlatform(ExePlatformClientExport);
|
RegisterExecutablePlatform(ExePlatformClientExport);
|
||||||
EQEmuLogSys::Instance()->LoadLogSettingsDefaults();
|
LogSys.LoadLogSettingsDefaults();
|
||||||
set_exception_handler();
|
set_exception_handler();
|
||||||
|
|
||||||
PathManager::Instance()->Init();
|
path.LoadPaths();
|
||||||
|
|
||||||
LogInfo("Client Files Export Utility");
|
LogInfo("Client Files Export Utility");
|
||||||
if (!EQEmuConfig::LoadConfig()) {
|
if (!EQEmuConfig::LoadConfig()) {
|
||||||
@@ -92,8 +99,8 @@ int main(int argc, char **argv)
|
|||||||
content_db.SetMySQL(database);
|
content_db.SetMySQL(database);
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmuLogSys::Instance()->SetDatabase(&database)
|
LogSys.SetDatabase(&database)
|
||||||
->SetLogPath(PathManager::Instance()->GetLogPath())
|
->SetLogPath(path.GetLogPath())
|
||||||
->LoadLogDatabaseSettings()
|
->LoadLogDatabaseSettings()
|
||||||
->StartFileLogs();
|
->StartFileLogs();
|
||||||
|
|
||||||
@@ -122,14 +129,14 @@ int main(int argc, char **argv)
|
|||||||
ExportBaseData(&content_db);
|
ExportBaseData(&content_db);
|
||||||
ExportDBStrings(&database);
|
ExportDBStrings(&database);
|
||||||
|
|
||||||
EQEmuLogSys::Instance()->CloseFileLogs();
|
LogSys.CloseFileLogs();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExportSpells(SharedDatabase* db)
|
void ExportSpells(SharedDatabase* db)
|
||||||
{
|
{
|
||||||
std::ofstream file(fmt::format("{}/export/spells_us.txt", PathManager::Instance()->GetServerPath()));
|
std::ofstream file(fmt::format("{}/export/spells_us.txt", path.GetServerPath()));
|
||||||
if (!file || !file.is_open()) {
|
if (!file || !file.is_open()) {
|
||||||
LogError("Unable to open export/spells_us.txt to write, skipping.");
|
LogError("Unable to open export/spells_us.txt to write, skipping.");
|
||||||
return;
|
return;
|
||||||
@@ -148,7 +155,7 @@ void ExportSpells(SharedDatabase* db)
|
|||||||
|
|
||||||
void ExportSkillCaps(SharedDatabase* db)
|
void ExportSkillCaps(SharedDatabase* db)
|
||||||
{
|
{
|
||||||
std::ofstream file(fmt::format("{}/export/SkillCaps.txt", PathManager::Instance()->GetServerPath()));
|
std::ofstream file(fmt::format("{}/export/SkillCaps.txt", path.GetServerPath()));
|
||||||
if (!file || !file.is_open()) {
|
if (!file || !file.is_open()) {
|
||||||
LogError("Unable to open export/SkillCaps.txt to write, skipping.");
|
LogError("Unable to open export/SkillCaps.txt to write, skipping.");
|
||||||
return;
|
return;
|
||||||
@@ -167,7 +174,7 @@ void ExportSkillCaps(SharedDatabase* db)
|
|||||||
|
|
||||||
void ExportBaseData(SharedDatabase *db)
|
void ExportBaseData(SharedDatabase *db)
|
||||||
{
|
{
|
||||||
std::ofstream file(fmt::format("{}/export/BaseData.txt", PathManager::Instance()->GetServerPath()));
|
std::ofstream file(fmt::format("{}/export/BaseData.txt", path.GetServerPath()));
|
||||||
if (!file || !file.is_open()) {
|
if (!file || !file.is_open()) {
|
||||||
LogError("Unable to open export/BaseData.txt to write, skipping.");
|
LogError("Unable to open export/BaseData.txt to write, skipping.");
|
||||||
return;
|
return;
|
||||||
@@ -186,7 +193,7 @@ void ExportBaseData(SharedDatabase *db)
|
|||||||
|
|
||||||
void ExportDBStrings(SharedDatabase *db)
|
void ExportDBStrings(SharedDatabase *db)
|
||||||
{
|
{
|
||||||
std::ofstream file(fmt::format("{}/export/dbstr_us.txt", PathManager::Instance()->GetServerPath()));
|
std::ofstream file(fmt::format("{}/export/dbstr_us.txt", path.GetServerPath()));
|
||||||
if (!file || !file.is_open()) {
|
if (!file || !file.is_open()) {
|
||||||
LogError("Unable to open export/dbstr_us.txt to write, skipping.");
|
LogError("Unable to open export/dbstr_us.txt to write, skipping.");
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -32,6 +32,13 @@
|
|||||||
#include "../../common/events/player_event_logs.h"
|
#include "../../common/events/player_event_logs.h"
|
||||||
#include "../../common/evolving_items.h"
|
#include "../../common/evolving_items.h"
|
||||||
|
|
||||||
|
EQEmuLogSys LogSys;
|
||||||
|
WorldContentService content_service;
|
||||||
|
ZoneStore zone_store;
|
||||||
|
PathManager path;
|
||||||
|
PlayerEventLogs player_event_logs;
|
||||||
|
EvolvingItemsManager evolving_items_manager;
|
||||||
|
|
||||||
void ImportSpells(SharedDatabase *db);
|
void ImportSpells(SharedDatabase *db);
|
||||||
void ImportSkillCaps(SharedDatabase *db);
|
void ImportSkillCaps(SharedDatabase *db);
|
||||||
void ImportBaseData(SharedDatabase *db);
|
void ImportBaseData(SharedDatabase *db);
|
||||||
@@ -39,10 +46,10 @@ void ImportDBStrings(SharedDatabase *db);
|
|||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
RegisterExecutablePlatform(ExePlatformClientImport);
|
RegisterExecutablePlatform(ExePlatformClientImport);
|
||||||
EQEmuLogSys::Instance()->LoadLogSettingsDefaults();
|
LogSys.LoadLogSettingsDefaults();
|
||||||
set_exception_handler();
|
set_exception_handler();
|
||||||
|
|
||||||
PathManager::Instance()->Init();
|
path.LoadPaths();
|
||||||
|
|
||||||
LogInfo("Client Files Import Utility");
|
LogInfo("Client Files Import Utility");
|
||||||
if(!EQEmuConfig::LoadConfig()) {
|
if(!EQEmuConfig::LoadConfig()) {
|
||||||
@@ -85,8 +92,8 @@ int main(int argc, char **argv) {
|
|||||||
content_db.SetMySQL(database);
|
content_db.SetMySQL(database);
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmuLogSys::Instance()->SetDatabase(&database)
|
LogSys.SetDatabase(&database)
|
||||||
->SetLogPath(PathManager::Instance()->GetLogPath())
|
->SetLogPath(path.GetLogPath())
|
||||||
->LoadLogDatabaseSettings()
|
->LoadLogDatabaseSettings()
|
||||||
->StartFileLogs();
|
->StartFileLogs();
|
||||||
|
|
||||||
@@ -95,7 +102,7 @@ int main(int argc, char **argv) {
|
|||||||
ImportBaseData(&content_db);
|
ImportBaseData(&content_db);
|
||||||
ImportDBStrings(&database);
|
ImportDBStrings(&database);
|
||||||
|
|
||||||
EQEmuLogSys::Instance()->CloseFileLogs();
|
LogSys.CloseFileLogs();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -131,7 +138,7 @@ bool IsStringField(int i) {
|
|||||||
|
|
||||||
void ImportSpells(SharedDatabase *db) {
|
void ImportSpells(SharedDatabase *db) {
|
||||||
LogInfo("Importing Spells");
|
LogInfo("Importing Spells");
|
||||||
std::string file = fmt::format("{}/import/spells_us.txt", PathManager::Instance()->GetServerPath());
|
std::string file = fmt::format("{}/import/spells_us.txt", path.GetServerPath());
|
||||||
FILE *f = fopen(file.c_str(), "r");
|
FILE *f = fopen(file.c_str(), "r");
|
||||||
if(!f) {
|
if(!f) {
|
||||||
LogError("Unable to open {} to read, skipping.", file);
|
LogError("Unable to open {} to read, skipping.", file);
|
||||||
@@ -221,7 +228,7 @@ void ImportSpells(SharedDatabase *db) {
|
|||||||
void ImportSkillCaps(SharedDatabase *db) {
|
void ImportSkillCaps(SharedDatabase *db) {
|
||||||
LogInfo("Importing Skill Caps");
|
LogInfo("Importing Skill Caps");
|
||||||
|
|
||||||
std::string file = fmt::format("{}/import/SkillCaps.txt", PathManager::Instance()->GetServerPath());
|
std::string file = fmt::format("{}/import/SkillCaps.txt", path.GetServerPath());
|
||||||
FILE *f = fopen(file.c_str(), "r");
|
FILE *f = fopen(file.c_str(), "r");
|
||||||
if(!f) {
|
if(!f) {
|
||||||
LogError("Unable to open {} to read, skipping.", file);
|
LogError("Unable to open {} to read, skipping.", file);
|
||||||
@@ -258,7 +265,7 @@ void ImportBaseData(SharedDatabase *db)
|
|||||||
{
|
{
|
||||||
LogInfo("Importing Base Data");
|
LogInfo("Importing Base Data");
|
||||||
|
|
||||||
const std::string& file_name = fmt::format("{}/import/BaseData.txt", PathManager::Instance()->GetServerPath());
|
const std::string& file_name = fmt::format("{}/import/BaseData.txt", path.GetServerPath());
|
||||||
|
|
||||||
const auto& file_contents = File::GetContents(file_name);
|
const auto& file_contents = File::GetContents(file_name);
|
||||||
if (!file_contents.error.empty()) {
|
if (!file_contents.error.empty()) {
|
||||||
@@ -298,7 +305,7 @@ void ImportBaseData(SharedDatabase *db)
|
|||||||
void ImportDBStrings(SharedDatabase *db) {
|
void ImportDBStrings(SharedDatabase *db) {
|
||||||
LogInfo("Importing DB Strings");
|
LogInfo("Importing DB Strings");
|
||||||
|
|
||||||
std::string file = fmt::format("{}/import/dbstr_us.txt", PathManager::Instance()->GetServerPath());
|
std::string file = fmt::format("{}/import/dbstr_us.txt", path.GetServerPath());
|
||||||
FILE *f = fopen(file.c_str(), "r");
|
FILE *f = fopen(file.c_str(), "r");
|
||||||
if(!f) {
|
if(!f) {
|
||||||
LogError("Unable to open {} to read, skipping.", file);
|
LogError("Unable to open {} to read, skipping.", file);
|
||||||
|
|||||||
@@ -841,8 +841,8 @@ IF (UNIX)
|
|||||||
SET_SOURCE_FILES_PROPERTIES("patches/sod.cpp" "patches/sof.cpp" "patches/rof.cpp" "patches/rof2.cpp" "patches/uf.cpp" PROPERTIES COMPILE_FLAGS -O0)
|
SET_SOURCE_FILES_PROPERTIES("patches/sod.cpp" "patches/sof.cpp" "patches/rof.cpp" "patches/rof2.cpp" "patches/uf.cpp" PROPERTIES COMPILE_FLAGS -O0)
|
||||||
ENDIF (UNIX)
|
ENDIF (UNIX)
|
||||||
|
|
||||||
IF (EQEMU_BUILD_PCH)
|
IF (WIN32 AND EQEMU_BUILD_PCH)
|
||||||
TARGET_PRECOMPILE_HEADERS(common PRIVATE pch/std-pch.h)
|
TARGET_PRECOMPILE_HEADERS(common PRIVATE pch/pch.h)
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
|
|
||||||
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
|
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
|
||||||
|
|||||||
@@ -27,7 +27,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);
|
content_service.SetCurrentExpansion(expansion);
|
||||||
}
|
}
|
||||||
|
|
||||||
LogInfo(
|
LogInfo(
|
||||||
@@ -41,12 +41,12 @@ WorldContentService *WorldContentService::SetExpansionContext()
|
|||||||
|
|
||||||
std::string WorldContentService::GetCurrentExpansionName()
|
std::string WorldContentService::GetCurrentExpansionName()
|
||||||
{
|
{
|
||||||
if (WorldContentService::Instance()->GetCurrentExpansion() == Expansion::EXPANSION_ALL) {
|
if (content_service.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[content_service.GetCurrentExpansion()];
|
||||||
}
|
}
|
||||||
|
|
||||||
return "Unknown Expansion";
|
return "Unknown Expansion";
|
||||||
@@ -185,7 +185,7 @@ void WorldContentService::ReloadContentFlags()
|
|||||||
|
|
||||||
SetContentFlags(set_content_flags);
|
SetContentFlags(set_content_flags);
|
||||||
LoadStaticGlobalZoneInstances();
|
LoadStaticGlobalZoneInstances();
|
||||||
ZoneStore::Instance()->LoadZones(*m_content_database);
|
zone_store.LoadZones(*m_content_database);
|
||||||
}
|
}
|
||||||
|
|
||||||
Database *WorldContentService::GetDatabase() const
|
Database *WorldContentService::GetDatabase() const
|
||||||
@@ -291,7 +291,7 @@ WorldContentService *WorldContentService::LoadStaticGlobalZoneInstances()
|
|||||||
// instance_list table entry for lavastorm has version = 1, is_global = 1, never_expires = 1
|
// instance_list table entry for lavastorm has version = 1, is_global = 1, never_expires = 1
|
||||||
WorldContentService::FindZoneResult WorldContentService::FindZone(uint32 zone_id, uint32 instance_id)
|
WorldContentService::FindZoneResult WorldContentService::FindZone(uint32 zone_id, uint32 instance_id)
|
||||||
{
|
{
|
||||||
for (const auto &z: ZoneStore::Instance()->GetZones()) {
|
for (const auto &z: zone_store.GetZones()) {
|
||||||
for (auto &i: m_zone_static_instances) {
|
for (auto &i: m_zone_static_instances) {
|
||||||
if (
|
if (
|
||||||
z.zoneidnumber == zone_id &&
|
z.zoneidnumber == zone_id &&
|
||||||
|
|||||||
@@ -181,12 +181,6 @@ public:
|
|||||||
FindZoneResult FindZone(uint32 zone_id, uint32 instance_id);
|
FindZoneResult FindZone(uint32 zone_id, uint32 instance_id);
|
||||||
bool IsInPublicStaticInstance(uint32 instance_id);
|
bool IsInPublicStaticInstance(uint32 instance_id);
|
||||||
|
|
||||||
static WorldContentService* Instance()
|
|
||||||
{
|
|
||||||
static WorldContentService instance;
|
|
||||||
return &instance;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int current_expansion{};
|
int current_expansion{};
|
||||||
std::vector<ContentFlagsRepository::ContentFlags> content_flags;
|
std::vector<ContentFlagsRepository::ContentFlags> content_flags;
|
||||||
@@ -200,4 +194,6 @@ private:
|
|||||||
std::vector<InstanceListRepository::InstanceList> m_zone_static_instances;
|
std::vector<InstanceListRepository::InstanceList> m_zone_static_instances;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extern WorldContentService content_service;
|
||||||
|
|
||||||
#endif //EQEMU_WORLD_CONTENT_SERVICE_H
|
#endif //EQEMU_WORLD_CONTENT_SERVICE_H
|
||||||
|
|||||||
+5
-7
@@ -27,8 +27,6 @@ void SendCrashReport(const std::string &crash_report)
|
|||||||
// "http://localhost:3010/api/v1/analytics/server-crash-report", // development
|
// "http://localhost:3010/api/v1/analytics/server-crash-report", // development
|
||||||
};
|
};
|
||||||
|
|
||||||
EQEmuLogSys* log = EQEmuLogSys::Instance();
|
|
||||||
|
|
||||||
auto config = EQEmuConfig::get();
|
auto config = EQEmuConfig::get();
|
||||||
for (auto &e: endpoints) {
|
for (auto &e: endpoints) {
|
||||||
uri u(e);
|
uri u(e);
|
||||||
@@ -70,12 +68,12 @@ void SendCrashReport(const std::string &crash_report)
|
|||||||
p["cpus"] = cpus.size();
|
p["cpus"] = cpus.size();
|
||||||
p["origination_info"] = "";
|
p["origination_info"] = "";
|
||||||
|
|
||||||
if (!log->origination_info.zone_short_name.empty()) {
|
if (!LogSys.origination_info.zone_short_name.empty()) {
|
||||||
p["origination_info"] = fmt::format(
|
p["origination_info"] = fmt::format(
|
||||||
"{} ({}) instance_id [{}]",
|
"{} ({}) instance_id [{}]",
|
||||||
log->origination_info.zone_short_name,
|
LogSys.origination_info.zone_short_name,
|
||||||
log->origination_info.zone_long_name,
|
LogSys.origination_info.zone_long_name,
|
||||||
log->origination_info.instance_id
|
LogSys.origination_info.instance_id
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -296,7 +294,7 @@ void print_trace()
|
|||||||
SendCrashReport(crash_report);
|
SendCrashReport(crash_report);
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmuLogSys::Instance()->CloseFileLogs();
|
LogSys.CloseFileLogs();
|
||||||
|
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-15
@@ -708,20 +708,6 @@ const std::string Database::GetNPCNameByID(uint32 npc_id)
|
|||||||
return e.id ? e.name : std::string();
|
return e.id ? e.name : std::string();
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename InputIterator, typename OutputIterator>
|
|
||||||
inline auto CleanMobName(InputIterator first, InputIterator last, OutputIterator result)
|
|
||||||
{
|
|
||||||
for (; first != last; ++first) {
|
|
||||||
if (*first == '_') {
|
|
||||||
*result = ' ';
|
|
||||||
}
|
|
||||||
else if (isalpha(*first) || *first == '`') {
|
|
||||||
*result = *first;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
const std::string Database::GetCleanNPCNameByID(uint32 npc_id)
|
const std::string Database::GetCleanNPCNameByID(uint32 npc_id)
|
||||||
{
|
{
|
||||||
const auto& e = NpcTypesRepository::FindOne(*this, npc_id);
|
const auto& e = NpcTypesRepository::FindOne(*this, npc_id);
|
||||||
@@ -2244,7 +2230,7 @@ void Database::PurgeCharacterParcels()
|
|||||||
pel.event_data = ss.str();
|
pel.event_data = ss.str();
|
||||||
pel.created_at = std::time(nullptr);
|
pel.created_at = std::time(nullptr);
|
||||||
|
|
||||||
PlayerEventLogs::Instance()->AddToQueue(pel);
|
player_event_logs.AddToQueue(pel);
|
||||||
|
|
||||||
ss.str("");
|
ss.str("");
|
||||||
ss.clear();
|
ss.clear();
|
||||||
|
|||||||
@@ -204,7 +204,7 @@ void DatabaseDumpService::DatabaseDump()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (IsDumpOutputToConsole()) {
|
if (IsDumpOutputToConsole()) {
|
||||||
EQEmuLogSys::Instance()->SilenceConsoleLogging();
|
LogSys.SilenceConsoleLogging();
|
||||||
}
|
}
|
||||||
|
|
||||||
LogInfo("MySQL installed [{}]", GetMySQLVersion());
|
LogInfo("MySQL installed [{}]", GetMySQLVersion());
|
||||||
@@ -324,7 +324,7 @@ void DatabaseDumpService::DatabaseDump()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!IsDumpOutputToConsole()) {
|
if (!IsDumpOutputToConsole()) {
|
||||||
EQEmuLogSys::Instance()->LoadLogSettingsDefaults();
|
LogSys.LoadLogSettingsDefaults();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!pipe_file.empty()) {
|
if (!pipe_file.empty()) {
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ bool DatabaseUpdate::UpdateManifest(
|
|||||||
std::vector<int> missing_migrations = {};
|
std::vector<int> missing_migrations = {};
|
||||||
if (version_low != version_high) {
|
if (version_low != version_high) {
|
||||||
|
|
||||||
EQEmuLogSys::Instance()->DisableMySQLErrorLogs();
|
LogSys.DisableMySQLErrorLogs();
|
||||||
bool force_interactive = false;
|
bool force_interactive = false;
|
||||||
for (int version = version_low + 1; version <= version_high; ++version) {
|
for (int version = version_low + 1; version <= version_high; ++version) {
|
||||||
for (auto &e: entries) {
|
for (auto &e: entries) {
|
||||||
@@ -184,7 +184,7 @@ bool DatabaseUpdate::UpdateManifest(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EQEmuLogSys::Instance()->EnableMySQLErrorLogs();
|
LogSys.EnableMySQLErrorLogs();
|
||||||
LogInfo("{}", Strings::Repeat("-", BREAK_LENGTH));
|
LogInfo("{}", Strings::Repeat("-", BREAK_LENGTH));
|
||||||
|
|
||||||
if (!missing_migrations.empty() && m_skip_backup) {
|
if (!missing_migrations.empty() && m_skip_backup) {
|
||||||
|
|||||||
@@ -33,13 +33,6 @@ public:
|
|||||||
DatabaseUpdate *SetContentDatabase(Database *db);
|
DatabaseUpdate *SetContentDatabase(Database *db);
|
||||||
DatabaseUpdate *SetSkipBackup(bool skip);
|
DatabaseUpdate *SetSkipBackup(bool skip);
|
||||||
bool HasPendingUpdates();
|
bool HasPendingUpdates();
|
||||||
|
|
||||||
static DatabaseUpdate* Instance()
|
|
||||||
{
|
|
||||||
static DatabaseUpdate instance;
|
|
||||||
return &instance;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_skip_backup = false;
|
bool m_skip_backup = false;
|
||||||
Database *m_database;
|
Database *m_database;
|
||||||
|
|||||||
@@ -7112,55 +7112,6 @@ ADD COLUMN `first_login` int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `xtargets`;
|
|||||||
)",
|
)",
|
||||||
.content_schema_update = false
|
.content_schema_update = false
|
||||||
},
|
},
|
||||||
ManifestEntry{
|
|
||||||
.version = 9324,
|
|
||||||
.description = "2025_06_11_player_event_logs_table.sql",
|
|
||||||
.check = "SHOW CREATE TABLE `player_event_logs`",
|
|
||||||
.condition = "missing",
|
|
||||||
.match = "COMPRESS",
|
|
||||||
.sql = R"(
|
|
||||||
ALTER TABLE player_event_logs ROW_FORMAT=COMPRESSED;
|
|
||||||
CREATE INDEX idx_event_type_char_id ON player_event_logs (event_type_id, character_id);
|
|
||||||
)",
|
|
||||||
.content_schema_update = false
|
|
||||||
},
|
|
||||||
ManifestEntry{
|
|
||||||
.version = 9325,
|
|
||||||
.description = "2025_06_10_character_corpses_entity_variables.sql",
|
|
||||||
.check = "SHOW COLUMNS FROM `character_corpses` LIKE 'entity_variables'",
|
|
||||||
.condition = "empty",
|
|
||||||
.match = "",
|
|
||||||
.sql = R"(
|
|
||||||
ALTER TABLE `character_corpses`
|
|
||||||
ADD COLUMN `entity_variables` TEXT DEFAULT NULL AFTER `rezzable`;
|
|
||||||
)",
|
|
||||||
.content_schema_update = false
|
|
||||||
},
|
|
||||||
ManifestEntry{
|
|
||||||
.version = 9326,
|
|
||||||
.description = "2025_07_27_add_indexes_npc_spawns_loot.sql",
|
|
||||||
.check = "SHOW INDEX FROM npc_types",
|
|
||||||
.condition = "missing",
|
|
||||||
.match = "idx_npc_types_loottable_id",
|
|
||||||
.sql = R"(
|
|
||||||
ALTER TABLE npc_types
|
|
||||||
ADD INDEX idx_npc_types_loottable_id (loottable_id);
|
|
||||||
|
|
||||||
ALTER TABLE spawnentry
|
|
||||||
ADD INDEX idx_spawnentry_spawngroup_id (spawngroupID),
|
|
||||||
ADD INDEX idx_spawnentry_npc_id (npcID);
|
|
||||||
|
|
||||||
ALTER TABLE lootdrop_entries
|
|
||||||
ADD INDEX idx_lootdrop_entries_lootdrop_id (lootdrop_id),
|
|
||||||
ADD INDEX idx_lootdrop_entries_item_id (item_id);
|
|
||||||
|
|
||||||
ALTER TABLE loottable_entries
|
|
||||||
ADD INDEX idx_loottable_entries_lootdrop_id (lootdrop_id),
|
|
||||||
ADD INDEX idx_loottable_entries_loottable_id (loottable_id);
|
|
||||||
)",
|
|
||||||
.content_schema_update = true
|
|
||||||
},
|
|
||||||
|
|
||||||
// -- template; copy/paste this when you need to create a new entry
|
// -- template; copy/paste this when you need to create a new entry
|
||||||
// ManifestEntry{
|
// ManifestEntry{
|
||||||
// .version = 9228,
|
// .version = 9228,
|
||||||
|
|||||||
+1
-1
@@ -160,7 +160,7 @@ MySQLRequestResult DBcore::QueryDatabase(const char *query, uint32 querylen, boo
|
|||||||
(uint32) mysql_insert_id(mysql)
|
(uint32) mysql_insert_id(mysql)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (EQEmuLogSys::Instance()->log_settings[Logs::MySQLQuery].is_category_enabled == 1) {
|
if (LogSys.log_settings[Logs::MySQLQuery].is_category_enabled == 1) {
|
||||||
if ((strncasecmp(query, "select", 6) == 0)) {
|
if ((strncasecmp(query, "select", 6) == 0)) {
|
||||||
LogMySQLQuery(
|
LogMySQLQuery(
|
||||||
"{0} -- ({1} row{2} returned) ({3}s)",
|
"{0} -- ({1} row{2} returned) ({3}s)",
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ void DiscordManager::ProcessMessageQueue()
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto webhook = EQEmuLogSys::Instance()->GetDiscordWebhooks()[q.first];
|
auto webhook = LogSys.GetDiscordWebhooks()[q.first];
|
||||||
std::string message;
|
std::string message;
|
||||||
|
|
||||||
for (auto &m: q.second) {
|
for (auto &m: q.second) {
|
||||||
@@ -68,7 +68,7 @@ void DiscordManager::ProcessMessageQueue()
|
|||||||
|
|
||||||
void DiscordManager::QueuePlayerEventMessage(const PlayerEvent::PlayerEventContainer& e)
|
void DiscordManager::QueuePlayerEventMessage(const PlayerEvent::PlayerEventContainer& e)
|
||||||
{
|
{
|
||||||
auto w = PlayerEventLogs::Instance()->GetDiscordWebhookUrlFromEventType(e.player_event_log.event_type_id);
|
auto w = player_event_logs.GetDiscordWebhookUrlFromEventType(e.player_event_log.event_type_id);
|
||||||
if (!w.empty()) {
|
if (!w.empty()) {
|
||||||
Discord::SendPlayerEventMessage(e, w);
|
Discord::SendPlayerEventMessage(e, w);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,12 +13,6 @@ public:
|
|||||||
void QueueWebhookMessage(uint32 webhook_id, const std::string& message);
|
void QueueWebhookMessage(uint32 webhook_id, const std::string& message);
|
||||||
void ProcessMessageQueue();
|
void ProcessMessageQueue();
|
||||||
void QueuePlayerEventMessage(const PlayerEvent::PlayerEventContainer& e);
|
void QueuePlayerEventMessage(const PlayerEvent::PlayerEventContainer& e);
|
||||||
|
|
||||||
static DiscordManager* Instance()
|
|
||||||
{
|
|
||||||
static DiscordManager instance;
|
|
||||||
return &instance;
|
|
||||||
}
|
|
||||||
private:
|
private:
|
||||||
std::mutex webhook_queue_lock{};
|
std::mutex webhook_queue_lock{};
|
||||||
std::map<uint32, std::vector<std::string>> webhook_message_queue{};
|
std::map<uint32, std::vector<std::string>> webhook_message_queue{};
|
||||||
|
|||||||
@@ -988,8 +988,7 @@ enum StartZoneIndex {
|
|||||||
Felwithe,
|
Felwithe,
|
||||||
Akanon,
|
Akanon,
|
||||||
Cabilis,
|
Cabilis,
|
||||||
SharVahl,
|
SharVahl
|
||||||
RatheMtn
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum FVNoDropFlagRule
|
enum FVNoDropFlagRule
|
||||||
|
|||||||
@@ -545,13 +545,13 @@ void EQStream::SendPacket(uint16 opcode, EQApplicationPacket *p)
|
|||||||
uint32 chunksize, used;
|
uint32 chunksize, used;
|
||||||
uint32 length;
|
uint32 length;
|
||||||
|
|
||||||
if (EQEmuLogSys::Instance()->log_settings[Logs::Server_Client_Packet].is_category_enabled == 1){
|
if (LogSys.log_settings[Logs::Server_Client_Packet].is_category_enabled == 1){
|
||||||
if (p->GetOpcode() != OP_SpecialMesg){
|
if (p->GetOpcode() != OP_SpecialMesg){
|
||||||
Log(Logs::General, Logs::Server_Client_Packet, "[%s - 0x%04x] [Size: %u]", OpcodeManager::EmuToName(p->GetOpcode()), p->GetOpcode(), p->Size());
|
Log(Logs::General, Logs::Server_Client_Packet, "[%s - 0x%04x] [Size: %u]", OpcodeManager::EmuToName(p->GetOpcode()), p->GetOpcode(), p->Size());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (EQEmuLogSys::Instance()->log_settings[Logs::Server_Client_Packet_With_Dump].is_category_enabled == 1){
|
if (LogSys.log_settings[Logs::Server_Client_Packet_With_Dump].is_category_enabled == 1){
|
||||||
if (p->GetOpcode() != OP_SpecialMesg){
|
if (p->GetOpcode() != OP_SpecialMesg){
|
||||||
Log(Logs::General, Logs::Server_Client_Packet_With_Dump, "[%s - 0x%04x] [Size: %u] %s", OpcodeManager::EmuToName(p->GetOpcode()), p->GetOpcode(), p->Size(), DumpPacketToString(p).c_str());
|
Log(Logs::General, Logs::Server_Client_Packet_With_Dump, "[%s - 0x%04x] [Size: %u] %s", OpcodeManager::EmuToName(p->GetOpcode()), p->GetOpcode(), p->Size(), DumpPacketToString(p).c_str());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -436,11 +436,11 @@ void EQEmuConfig::CheckUcsConfigConversion()
|
|||||||
LogInfo("Migrating old [eqemu_config] UCS configuration to new configuration");
|
LogInfo("Migrating old [eqemu_config] UCS configuration to new configuration");
|
||||||
|
|
||||||
std::string config_file_path = std::filesystem::path{
|
std::string config_file_path = std::filesystem::path{
|
||||||
PathManager::Instance()->GetServerPath() + "/eqemu_config.json"
|
path.GetServerPath() + "/eqemu_config.json"
|
||||||
}.string();
|
}.string();
|
||||||
|
|
||||||
std::string config_file_bak_path = std::filesystem::path{
|
std::string config_file_bak_path = std::filesystem::path{
|
||||||
PathManager::Instance()->GetServerPath() + "/eqemu_config.ucs-migrate-json.bak"
|
path.GetServerPath() + "/eqemu_config.ucs-migrate-json.bak"
|
||||||
}.string();
|
}.string();
|
||||||
|
|
||||||
// copy eqemu_config.json to eqemu_config.json.bak
|
// copy eqemu_config.json to eqemu_config.json.bak
|
||||||
|
|||||||
@@ -191,7 +191,7 @@ class EQEmuConfig
|
|||||||
|
|
||||||
std::string file = fmt::format(
|
std::string file = fmt::format(
|
||||||
"{}/{}",
|
"{}/{}",
|
||||||
(file_path.empty() ? PathManager::Instance()->GetServerPath() : file_path),
|
(file_path.empty() ? path.GetServerPath() : file_path),
|
||||||
EQEmuConfig::ConfigFile
|
EQEmuConfig::ConfigFile
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -537,9 +537,9 @@ void EQEmuLogSys::StartFileLogs(const std::string &log_name)
|
|||||||
{
|
{
|
||||||
EQEmuLogSys::CloseFileLogs();
|
EQEmuLogSys::CloseFileLogs();
|
||||||
|
|
||||||
if (!File::Exists(PathManager::Instance()->GetLogPath())) {
|
if (!File::Exists(path.GetLogPath())) {
|
||||||
LogInfo("Logs directory not found, creating [{}]", PathManager::Instance()->GetLogPath());
|
LogInfo("Logs directory not found, creating [{}]", path.GetLogPath());
|
||||||
File::Makedir(PathManager::Instance()->GetLogPath());
|
File::Makedir(path.GetLogPath());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -656,7 +656,7 @@ EQEmuLogSys *EQEmuLogSys::LoadLogDatabaseSettings(bool silent_load)
|
|||||||
// If we go through this whole loop and nothing is set to any debug level, there
|
// If we go through this whole loop and nothing is set to any debug level, there
|
||||||
// is no point to create a file or keep anything open
|
// is no point to create a file or keep anything open
|
||||||
if (log_settings[c.log_category_id].log_to_file > 0) {
|
if (log_settings[c.log_category_id].log_to_file > 0) {
|
||||||
m_file_logs_enabled = true;
|
LogSys.m_file_logs_enabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
db_categories.emplace_back(c.log_category_id);
|
db_categories.emplace_back(c.log_category_id);
|
||||||
|
|||||||
+18
-12
@@ -266,6 +266,8 @@ namespace Logs {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#include "eqemu_logsys_log_aliases.h"
|
||||||
|
|
||||||
class Database;
|
class Database;
|
||||||
|
|
||||||
constexpr uint16 MAX_DISCORD_WEBHOOK_ID = 300;
|
constexpr uint16 MAX_DISCORD_WEBHOOK_ID = 300;
|
||||||
@@ -283,12 +285,6 @@ public:
|
|||||||
EQEmuLogSys *LoadLogSettingsDefaults();
|
EQEmuLogSys *LoadLogSettingsDefaults();
|
||||||
EQEmuLogSys *LoadLogDatabaseSettings(bool silent_load = false);
|
EQEmuLogSys *LoadLogDatabaseSettings(bool silent_load = false);
|
||||||
|
|
||||||
static EQEmuLogSys *Instance()
|
|
||||||
{
|
|
||||||
static EQEmuLogSys instance;
|
|
||||||
return &instance;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param directory_name
|
* @param directory_name
|
||||||
*/
|
*/
|
||||||
@@ -354,7 +350,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Internally used memory reference for all log settings per category
|
* Internally used memory reference for all log settings per category
|
||||||
* These are loaded via DB and have defaults loaded in LoadLogSettingsDefaults
|
* These are loaded via DB and have defaults loaded in LoadLogSettingsDefaults
|
||||||
* Database loaded via EQEmuLogSys::Instance()->SetDatabase(&database)->LoadLogDatabaseSettings();
|
* Database loaded via LogSys.SetDatabase(&database)->LoadLogDatabaseSettings();
|
||||||
*/
|
*/
|
||||||
LogSettings log_settings[Logs::LogCategory::MaxCategoryID]{};
|
LogSettings log_settings[Logs::LogCategory::MaxCategoryID]{};
|
||||||
|
|
||||||
@@ -438,7 +434,7 @@ private:
|
|||||||
void InjectTablesIfNotExist();
|
void InjectTablesIfNotExist();
|
||||||
};
|
};
|
||||||
|
|
||||||
#include "eqemu_logsys_log_aliases.h"
|
extern EQEmuLogSys LogSys;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
template<typename... Args>
|
template<typename... Args>
|
||||||
@@ -458,9 +454,19 @@ void OutF(
|
|||||||
}
|
}
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#define OutF(ls, debug_level, log_category, file, func, line, formatStr, ...) \
|
template<typename... Args>
|
||||||
do { \
|
inline void OutF(
|
||||||
ls->Out(debug_level, log_category, file, func, line, fmt::format(formatStr, ##__VA_ARGS__).c_str()); \
|
EQEmuLogSys& ls,
|
||||||
} while(0)
|
Logs::DebugLevel debug_level,
|
||||||
|
uint16 log_category,
|
||||||
|
const char* file,
|
||||||
|
const char* func,
|
||||||
|
int line,
|
||||||
|
fmt::format_string<Args...> fmt_str,
|
||||||
|
Args&&... args
|
||||||
|
) {
|
||||||
|
std::string formatted = fmt::format(fmt_str, std::forward<Args>(args)...);
|
||||||
|
ls.Out(debug_level, log_category, file, func, line, formatted.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+364
-366
File diff suppressed because it is too large
Load Diff
@@ -716,7 +716,7 @@ std::string PlayerEventDiscordFormatter::FormatNPCHandinEvent(
|
|||||||
);
|
);
|
||||||
|
|
||||||
for (int i = 0; i < h.augment_ids.size(); i++) {
|
for (int i = 0; i < h.augment_ids.size(); i++) {
|
||||||
if (!h.augment_names[i].empty()) {
|
if (!Strings::EqualFold(h.augment_names[i], "None")) {
|
||||||
const uint8 slot_id = (i + 1);
|
const uint8 slot_id = (i + 1);
|
||||||
handin_items_info += fmt::format(
|
handin_items_info += fmt::format(
|
||||||
"Augment {}: {} ({})\n",
|
"Augment {}: {} ({})\n",
|
||||||
@@ -741,7 +741,7 @@ std::string PlayerEventDiscordFormatter::FormatNPCHandinEvent(
|
|||||||
);
|
);
|
||||||
|
|
||||||
for (int i = 0; i < r.augment_ids.size(); i++) {
|
for (int i = 0; i < r.augment_ids.size(); i++) {
|
||||||
if (!r.augment_names[i].empty()) {
|
if (!Strings::EqualFold(r.augment_names[i], "None")) {
|
||||||
const uint8 slot_id = (i + 1);
|
const uint8 slot_id = (i + 1);
|
||||||
return_items_info += fmt::format(
|
return_items_info += fmt::format(
|
||||||
"Augment {}: {} ({})\n",
|
"Augment {}: {} ({})\n",
|
||||||
|
|||||||
@@ -195,12 +195,10 @@ void PlayerEventLogs::ProcessBatchQueue()
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Helper to assign ETL table ID
|
// Helper to assign ETL table ID
|
||||||
|
auto AssignEtlId = [&](
|
||||||
auto AssignEtlId = [&](
|
PlayerEventLogsRepository::PlayerEventLogs &r,
|
||||||
PlayerEventLogsRepository::PlayerEventLogs& r,
|
PlayerEvent::EventType type
|
||||||
PlayerEvent::EventType type
|
) {
|
||||||
)
|
|
||||||
{
|
|
||||||
if (m_etl_settings.contains(type)) {
|
if (m_etl_settings.contains(type)) {
|
||||||
r.etl_table_id = m_etl_settings.at(type).next_id++;
|
r.etl_table_id = m_etl_settings.at(type).next_id++;
|
||||||
}
|
}
|
||||||
@@ -408,6 +406,7 @@ void PlayerEventLogs::ProcessBatchQueue()
|
|||||||
auto it = event_processors.find(static_cast<PlayerEvent::EventType>(r.event_type_id));
|
auto it = event_processors.find(static_cast<PlayerEvent::EventType>(r.event_type_id));
|
||||||
if (it != event_processors.end()) {
|
if (it != event_processors.end()) {
|
||||||
it->second(r); // Call the appropriate lambda
|
it->second(r); // Call the appropriate lambda
|
||||||
|
r.event_data = "{}"; // Clear event data
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
LogPlayerEventsDetail("Non-Implemented ETL routing [{}]", r.event_type_id);
|
LogPlayerEventsDetail("Non-Implemented ETL routing [{}]", r.event_type_id);
|
||||||
@@ -509,7 +508,7 @@ bool PlayerEventLogs::IsEventDiscordEnabled(int32_t event_type_id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ensure there is a matching webhook to begin with
|
// ensure there is a matching webhook to begin with
|
||||||
if (!EQEmuLogSys::Instance()->GetDiscordWebhooks()[m_settings[event_type_id].discord_webhook_id].webhook_url.empty()) {
|
if (!LogSys.GetDiscordWebhooks()[m_settings[event_type_id].discord_webhook_id].webhook_url.empty()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -529,27 +528,13 @@ std::string PlayerEventLogs::GetDiscordWebhookUrlFromEventType(int32_t event_typ
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ensure there is a matching webhook to begin with
|
// ensure there is a matching webhook to begin with
|
||||||
if (!EQEmuLogSys::Instance()->GetDiscordWebhooks()[m_settings[event_type_id].discord_webhook_id].webhook_url.empty()) {
|
if (!LogSys.GetDiscordWebhooks()[m_settings[event_type_id].discord_webhook_id].webhook_url.empty()) {
|
||||||
return EQEmuLogSys::Instance()->GetDiscordWebhooks()[m_settings[event_type_id].discord_webhook_id].webhook_url;
|
return LogSys.GetDiscordWebhooks()[m_settings[event_type_id].discord_webhook_id].webhook_url;
|
||||||
}
|
}
|
||||||
|
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlayerEventLogs::LoadPlayerEventSettingsFromQS(
|
|
||||||
const std::vector<PlayerEventLogSettingsRepository::PlayerEventLogSettings> &settings
|
|
||||||
)
|
|
||||||
{
|
|
||||||
for (const auto &e : settings) {
|
|
||||||
if (e.id >= PlayerEvent::MAX || e.id < 0) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
m_settings[e.id] = e;
|
|
||||||
}
|
|
||||||
|
|
||||||
LogInfo("Applied [{}] player event log settings from QS", settings.size());
|
|
||||||
}
|
|
||||||
|
|
||||||
// GM_COMMAND | [x] Implemented Formatter
|
// GM_COMMAND | [x] Implemented Formatter
|
||||||
// ZONING | [x] Implemented Formatter
|
// ZONING | [x] Implemented Formatter
|
||||||
// AA_GAIN | [x] Implemented Formatter
|
// AA_GAIN | [x] Implemented Formatter
|
||||||
|
|||||||
@@ -73,11 +73,9 @@ public:
|
|||||||
return BuildPlayerEventPacket(c);
|
return BuildPlayerEventPacket(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] const PlayerEventLogSettingsRepository::PlayerEventLogSettings * GetSettings() const;
|
[[nodiscard]] const PlayerEventLogSettingsRepository::PlayerEventLogSettings *GetSettings() const;
|
||||||
bool IsEventDiscordEnabled(int32_t event_type_id);
|
bool IsEventDiscordEnabled(int32_t event_type_id);
|
||||||
std::string GetDiscordWebhookUrlFromEventType(int32_t event_type_id);
|
std::string GetDiscordWebhookUrlFromEventType(int32_t event_type_id);
|
||||||
|
|
||||||
void LoadPlayerEventSettingsFromQS(const std::vector<PlayerEventLogSettingsRepository::PlayerEventLogSettings>& settings);
|
|
||||||
|
|
||||||
static std::string GetDiscordPayloadFromEvent(const PlayerEvent::PlayerEventContainer &e);
|
static std::string GetDiscordPayloadFromEvent(const PlayerEvent::PlayerEventContainer &e);
|
||||||
|
|
||||||
@@ -96,12 +94,6 @@ public:
|
|||||||
std::vector<PlayerEventAaPurchaseRepository::PlayerEventAaPurchase> aa_purchase;
|
std::vector<PlayerEventAaPurchaseRepository::PlayerEventAaPurchase> aa_purchase;
|
||||||
};
|
};
|
||||||
|
|
||||||
static PlayerEventLogs* Instance()
|
|
||||||
{
|
|
||||||
static PlayerEventLogs instance;
|
|
||||||
return &instance;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct EtlSettings {
|
struct EtlSettings {
|
||||||
bool enabled;
|
bool enabled;
|
||||||
@@ -135,4 +127,6 @@ public:
|
|||||||
std::map<PlayerEvent::EventType, EtlSettings> &GetEtlSettings() { return m_etl_settings;}
|
std::map<PlayerEvent::EventType, EtlSettings> &GetEtlSettings() { return m_etl_settings;}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extern PlayerEventLogs player_event_logs;
|
||||||
|
|
||||||
#endif //EQEMU_PLAYER_EVENT_LOGS_H
|
#endif //EQEMU_PLAYER_EVENT_LOGS_H
|
||||||
|
|||||||
+120
-553
File diff suppressed because it is too large
Load Diff
+18
-18
@@ -21,8 +21,8 @@ void EvolvingItemsManager::LoadEvolvingItems() const
|
|||||||
results.begin(),
|
results.begin(),
|
||||||
results.end(),
|
results.end(),
|
||||||
std::inserter(
|
std::inserter(
|
||||||
EvolvingItemsManager::Instance()->GetEvolvingItemsCache(),
|
evolving_items_manager.GetEvolvingItemsCache(),
|
||||||
EvolvingItemsManager::Instance()->GetEvolvingItemsCache().end()
|
evolving_items_manager.GetEvolvingItemsCache().end()
|
||||||
),
|
),
|
||||||
[](const ItemsEvolvingDetailsRepository::ItemsEvolvingDetails &x) {
|
[](const ItemsEvolvingDetailsRepository::ItemsEvolvingDetails &x) {
|
||||||
return std::make_pair(x.item_id, x);
|
return std::make_pair(x.item_id, x);
|
||||||
@@ -42,13 +42,13 @@ void EvolvingItemsManager::SetContentDatabase(Database *db)
|
|||||||
|
|
||||||
double EvolvingItemsManager::CalculateProgression(const uint64 current_amount, const uint32 item_id)
|
double EvolvingItemsManager::CalculateProgression(const uint64 current_amount, const uint32 item_id)
|
||||||
{
|
{
|
||||||
if (!EvolvingItemsManager::Instance()->GetEvolvingItemsCache().contains(item_id)) {
|
if (!evolving_items_manager.GetEvolvingItemsCache().contains(item_id)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return EvolvingItemsManager::Instance()->GetEvolvingItemsCache().at(item_id).required_amount > 0
|
return evolving_items_manager.GetEvolvingItemsCache().at(item_id).required_amount > 0
|
||||||
? static_cast<double>(current_amount)
|
? static_cast<double>(current_amount)
|
||||||
/ static_cast<double>(EvolvingItemsManager::Instance()->GetEvolvingItemsCache().at(item_id).required_amount) * 100
|
/ static_cast<double>(evolving_items_manager.GetEvolvingItemsCache().at(item_id).required_amount) * 100
|
||||||
: 0;
|
: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -73,7 +73,7 @@ void EvolvingItemsManager::DoLootChecks(const uint32 char_id, const uint16 slot_
|
|||||||
e.character_id = char_id;
|
e.character_id = char_id;
|
||||||
e.item_id = inst.GetID();
|
e.item_id = inst.GetID();
|
||||||
e.equipped = inst.GetEvolveEquipped();
|
e.equipped = inst.GetEvolveEquipped();
|
||||||
e.final_item_id = EvolvingItemsManager::Instance()->GetFinalItemID(inst);
|
e.final_item_id = evolving_items_manager.GetFinalItemID(inst);
|
||||||
|
|
||||||
auto r = CharacterEvolvingItemsRepository::InsertOne(*m_db, e);
|
auto r = CharacterEvolvingItemsRepository::InsertOne(*m_db, e);
|
||||||
e.id = r.id;
|
e.id = r.id;
|
||||||
@@ -96,20 +96,20 @@ uint32 EvolvingItemsManager::GetFinalItemID(const EQ::ItemInstance &inst) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
const auto start_iterator = std::ranges::find_if(
|
const auto start_iterator = std::ranges::find_if(
|
||||||
EvolvingItemsManager::Instance()->GetEvolvingItemsCache().cbegin(),
|
evolving_items_manager.GetEvolvingItemsCache().cbegin(),
|
||||||
EvolvingItemsManager::Instance()->GetEvolvingItemsCache().cend(),
|
evolving_items_manager.GetEvolvingItemsCache().cend(),
|
||||||
[&](const std::pair<uint32, ItemsEvolvingDetailsRepository::ItemsEvolvingDetails> &a) {
|
[&](const std::pair<uint32, ItemsEvolvingDetailsRepository::ItemsEvolvingDetails> &a) {
|
||||||
return a.second.item_evo_id == inst.GetEvolveLoreID();
|
return a.second.item_evo_id == inst.GetEvolveLoreID();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
if (start_iterator == std::end(EvolvingItemsManager::Instance()->GetEvolvingItemsCache())) {
|
if (start_iterator == std::end(evolving_items_manager.GetEvolvingItemsCache())) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto final_id = std::ranges::max_element(
|
const auto final_id = std::ranges::max_element(
|
||||||
start_iterator,
|
start_iterator,
|
||||||
EvolvingItemsManager::Instance()->GetEvolvingItemsCache().cend(),
|
evolving_items_manager.GetEvolvingItemsCache().cend(),
|
||||||
[&](
|
[&](
|
||||||
const std::pair<uint32, ItemsEvolvingDetailsRepository::ItemsEvolvingDetails> &a,
|
const std::pair<uint32, ItemsEvolvingDetailsRepository::ItemsEvolvingDetails> &a,
|
||||||
const std::pair<uint32, ItemsEvolvingDetailsRepository::ItemsEvolvingDetails> &b
|
const std::pair<uint32, ItemsEvolvingDetailsRepository::ItemsEvolvingDetails> &b
|
||||||
@@ -131,15 +131,15 @@ uint32 EvolvingItemsManager::GetNextEvolveItemID(const EQ::ItemInstance &inst) c
|
|||||||
int8 const current_level = inst.GetEvolveLvl();
|
int8 const current_level = inst.GetEvolveLvl();
|
||||||
|
|
||||||
const auto iterator = std::ranges::find_if(
|
const auto iterator = std::ranges::find_if(
|
||||||
EvolvingItemsManager::Instance()->GetEvolvingItemsCache().cbegin(),
|
evolving_items_manager.GetEvolvingItemsCache().cbegin(),
|
||||||
EvolvingItemsManager::Instance()->GetEvolvingItemsCache().cend(),
|
evolving_items_manager.GetEvolvingItemsCache().cend(),
|
||||||
[&](const std::pair<uint32, ItemsEvolvingDetailsRepository::ItemsEvolvingDetails> &a) {
|
[&](const std::pair<uint32, ItemsEvolvingDetailsRepository::ItemsEvolvingDetails> &a) {
|
||||||
return a.second.item_evo_id == inst.GetEvolveLoreID() &&
|
return a.second.item_evo_id == inst.GetEvolveLoreID() &&
|
||||||
a.second.item_evolve_level == current_level + 1;
|
a.second.item_evolve_level == current_level + 1;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
if (iterator == std::end(EvolvingItemsManager::Instance()->GetEvolvingItemsCache())) {
|
if (iterator == std::end(evolving_items_manager.GetEvolvingItemsCache())) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -255,8 +255,8 @@ EvolveTransfer EvolvingItemsManager::DetermineTransferResults(
|
|||||||
return ets;
|
return ets;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto evolving_details_inst_from = EvolvingItemsManager::Instance()->GetEvolveItemDetails(inst_from.GetID());
|
auto evolving_details_inst_from = evolving_items_manager.GetEvolveItemDetails(inst_from.GetID());
|
||||||
auto evolving_details_inst_to = EvolvingItemsManager::Instance()->GetEvolveItemDetails(inst_to.GetID());
|
auto evolving_details_inst_to = evolving_items_manager.GetEvolveItemDetails(inst_to.GetID());
|
||||||
|
|
||||||
if (!evolving_details_inst_from.id || !evolving_details_inst_to.id) {
|
if (!evolving_details_inst_from.id || !evolving_details_inst_to.id) {
|
||||||
return ets;
|
return ets;
|
||||||
@@ -272,10 +272,10 @@ EvolveTransfer EvolvingItemsManager::DetermineTransferResults(
|
|||||||
compatibility = 30;
|
compatibility = 30;
|
||||||
}
|
}
|
||||||
|
|
||||||
xp = EvolvingItemsManager::Instance()->GetTotalEarnedXP(inst_from) * compatibility / 100;
|
xp = evolving_items_manager.GetTotalEarnedXP(inst_from) * compatibility / 100;
|
||||||
auto results = EvolvingItemsManager::Instance()->GetNextItemByXP(inst_to, xp);
|
auto results = evolving_items_manager.GetNextItemByXP(inst_to, xp);
|
||||||
|
|
||||||
ets.item_from_id = EvolvingItemsManager::Instance()->GetFirstItemInLoreGroup(inst_from.GetEvolveLoreID());
|
ets.item_from_id = evolving_items_manager.GetFirstItemInLoreGroup(inst_from.GetEvolveLoreID());
|
||||||
ets.item_from_current_amount = results.from_current_amount;
|
ets.item_from_current_amount = results.from_current_amount;
|
||||||
ets.item_to_id = results.new_item_id;
|
ets.item_to_id = results.new_item_id;
|
||||||
ets.item_to_current_amount = results.new_current_amount;
|
ets.item_to_current_amount = results.new_current_amount;
|
||||||
|
|||||||
@@ -56,15 +56,12 @@ public:
|
|||||||
std::map<uint32, ItemsEvolvingDetailsRepository::ItemsEvolvingDetails>& GetEvolvingItemsCache() { return m_evolving_items_cache; }
|
std::map<uint32, ItemsEvolvingDetailsRepository::ItemsEvolvingDetails>& GetEvolvingItemsCache() { return m_evolving_items_cache; }
|
||||||
std::vector<ItemsEvolvingDetailsRepository::ItemsEvolvingDetails> GetEvolveIDItems(uint32 evolve_id);
|
std::vector<ItemsEvolvingDetailsRepository::ItemsEvolvingDetails> GetEvolveIDItems(uint32 evolve_id);
|
||||||
|
|
||||||
static EvolvingItemsManager* Instance()
|
|
||||||
{
|
|
||||||
static EvolvingItemsManager instance;
|
|
||||||
return &instance;
|
|
||||||
}
|
|
||||||
private:
|
private:
|
||||||
std::map<uint32, ItemsEvolvingDetailsRepository::ItemsEvolvingDetails> m_evolving_items_cache;
|
std::map<uint32, ItemsEvolvingDetailsRepository::ItemsEvolvingDetails> m_evolving_items_cache;
|
||||||
Database * m_db;
|
Database * m_db;
|
||||||
Database * m_content_db;
|
Database * m_content_db;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extern EvolvingItemsManager evolving_items_manager;
|
||||||
|
|
||||||
#endif //EVOLVING_H
|
#endif //EVOLVING_H
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ namespace EQ {
|
|||||||
EQ_EXCEPT("IPC Mutex", "Could not create mutex.");
|
EQ_EXCEPT("IPC Mutex", "Could not create mutex.");
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
std::string final_name = fmt::format("{}/{}.lock", PathManager::Instance()->GetSharedMemoryPath(), name);
|
std::string final_name = fmt::format("{}/{}.lock", path.GetSharedMemoryPath(), name);
|
||||||
|
|
||||||
#ifdef __DARWIN
|
#ifdef __DARWIN
|
||||||
#if __DARWIN_C_LEVEL < 200809L
|
#if __DARWIN_C_LEVEL < 200809L
|
||||||
|
|||||||
@@ -574,7 +574,7 @@ EQ::ItemInstance* EQ::ItemInstance::GetOrnamentationAugment() const
|
|||||||
uint32 EQ::ItemInstance::GetOrnamentHeroModel(int32 material_slot) const
|
uint32 EQ::ItemInstance::GetOrnamentHeroModel(int32 material_slot) const
|
||||||
{
|
{
|
||||||
// Not a Hero Forge item.
|
// Not a Hero Forge item.
|
||||||
if (m_ornament_hero_model == 0) {
|
if (m_ornament_hero_model == 0 || material_slot < 0) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1799,7 +1799,7 @@ std::vector<std::string> EQ::ItemInstance::GetAugmentNames() const
|
|||||||
|
|
||||||
for (uint8 slot_id = invaug::SOCKET_BEGIN; slot_id <= invaug::SOCKET_END; slot_id++) {
|
for (uint8 slot_id = invaug::SOCKET_BEGIN; slot_id <= invaug::SOCKET_END; slot_id++) {
|
||||||
const auto augment = GetAugment(slot_id);
|
const auto augment = GetAugment(slot_id);
|
||||||
augment_names.push_back(augment ? augment->GetItem()->Name : "");
|
augment_names.push_back(augment ? augment->GetItem()->Name : "None");
|
||||||
}
|
}
|
||||||
|
|
||||||
return augment_names;
|
return augment_names;
|
||||||
|
|||||||
@@ -335,7 +335,7 @@ namespace EQ
|
|||||||
void SetEvolveAddToCurrentAmount(const uint64 in) const { m_evolving_details.current_amount += in; }
|
void SetEvolveAddToCurrentAmount(const uint64 in) const { m_evolving_details.current_amount += in; }
|
||||||
void SetEvolveFinalItemID(const uint32 in) const { m_evolving_details.final_item_id = in; }
|
void SetEvolveFinalItemID(const uint32 in) const { m_evolving_details.final_item_id = in; }
|
||||||
bool TransferOwnership(Database& db, const uint32 to_char_id) const;
|
bool TransferOwnership(Database& db, const uint32 to_char_id) const;
|
||||||
void CalculateEvolveProgression() const { m_evolving_details.progression = EvolvingItemsManager::Instance()->CalculateProgression(GetEvolveCurrentAmount(), GetID()); }
|
void CalculateEvolveProgression() const { m_evolving_details.progression = evolving_items_manager.CalculateProgression(GetEvolveCurrentAmount(), GetID()); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
//////////////////////////
|
//////////////////////////
|
||||||
|
|||||||
@@ -1167,7 +1167,7 @@ void EQ::Net::DaybreakConnection::ProcessResend(int stream)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (EQEmuLogSys::Instance()->IsLogEnabled(Logs::General, Logs::NetClient)) {
|
if (LogSys.IsLogEnabled(Logs::General, Logs::NetClient)) {
|
||||||
size_t total_size = 0;
|
size_t total_size = 0;
|
||||||
for (auto &e: s->sent_packets) {
|
for (auto &e: s->sent_packets) {
|
||||||
total_size += e.second.packet.Length();
|
total_size += e.second.packet.Length();
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ void EQ::Net::EQStream::QueuePacket(const EQApplicationPacket *p, bool ack_req)
|
|||||||
OpcodeManager::EmuToName(p->GetOpcode()),
|
OpcodeManager::EmuToName(p->GetOpcode()),
|
||||||
(*m_opcode_manager)->EmuToEQ(p->GetOpcode()),
|
(*m_opcode_manager)->EmuToEQ(p->GetOpcode()),
|
||||||
p->Size(),
|
p->Size(),
|
||||||
(EQEmuLogSys::Instance()->IsLogEnabled(Logs::Detail, Logs::PacketServerClient) ? DumpPacketToString(p) : "")
|
(LogSys.IsLogEnabled(Logs::Detail, Logs::PacketServerClient) ? DumpPacketToString(p) : "")
|
||||||
);
|
);
|
||||||
|
|
||||||
if (m_opcode_manager && *m_opcode_manager) {
|
if (m_opcode_manager && *m_opcode_manager) {
|
||||||
|
|||||||
@@ -319,7 +319,7 @@ void EQ::Net::ServertalkServerConnection::ProcessMessage(EQ::Net::Packet &p)
|
|||||||
size_t message_len = length;
|
size_t message_len = length;
|
||||||
EQ::Net::StaticPacket packet(&data[0], message_len);
|
EQ::Net::StaticPacket packet(&data[0], message_len);
|
||||||
|
|
||||||
const auto is_detail_enabled = EQEmuLogSys::Instance()->IsLogEnabled(Logs::Detail, Logs::PacketServerToServer);
|
const auto is_detail_enabled = LogSys.IsLogEnabled(Logs::Detail, Logs::PacketServerToServer);
|
||||||
if (opcode != ServerOP_KeepAlive || is_detail_enabled) {
|
if (opcode != ServerOP_KeepAlive || is_detail_enabled) {
|
||||||
LogPacketServerToServer(
|
LogPacketServerToServer(
|
||||||
"[{:#06x}] Size [{}] {}",
|
"[{:#06x}] Size [{}] {}",
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ namespace RoF
|
|||||||
{
|
{
|
||||||
//create our opcode manager if we havent already
|
//create our opcode manager if we havent already
|
||||||
if (opcodes == nullptr) {
|
if (opcodes == nullptr) {
|
||||||
std::string opfile = fmt::format("{}/patch_{}.conf", PathManager::Instance()->GetPatchPath(), name);
|
std::string opfile = fmt::format("{}/patch_{}.conf", path.GetPatchPath(), name);
|
||||||
|
|
||||||
//load up the opcode manager.
|
//load up the opcode manager.
|
||||||
//TODO: figure out how to support shared memory with multiple patches...
|
//TODO: figure out how to support shared memory with multiple patches...
|
||||||
@@ -117,7 +117,7 @@ namespace RoF
|
|||||||
//we need to go to every stream and replace it's manager.
|
//we need to go to every stream and replace it's manager.
|
||||||
|
|
||||||
if (opcodes != nullptr) {
|
if (opcodes != nullptr) {
|
||||||
std::string opfile = fmt::format("{}/patch_{}.conf", PathManager::Instance()->GetPatchPath(), name);
|
std::string opfile = fmt::format("{}/patch_{}.conf", path.GetPatchPath(), name);
|
||||||
if (!opcodes->ReloadOpcodes(opfile.c_str())) {
|
if (!opcodes->ReloadOpcodes(opfile.c_str())) {
|
||||||
LogNetcode("[OPCODES] Error reloading opcodes file [{}] for patch [{}]", opfile.c_str(), name);
|
LogNetcode("[OPCODES] Error reloading opcodes file [{}] for patch [{}]", opfile.c_str(), name);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ namespace RoF2
|
|||||||
//create our opcode manager if we havent already
|
//create our opcode manager if we havent already
|
||||||
if (opcodes == nullptr) {
|
if (opcodes == nullptr) {
|
||||||
|
|
||||||
std::string opfile = fmt::format("{}/patch_{}.conf", PathManager::Instance()->GetPatchPath(), name);
|
std::string opfile = fmt::format("{}/patch_{}.conf", path.GetPatchPath(), name);
|
||||||
|
|
||||||
//load up the opcode manager.
|
//load up the opcode manager.
|
||||||
//TODO: figure out how to support shared memory with multiple patches...
|
//TODO: figure out how to support shared memory with multiple patches...
|
||||||
@@ -123,7 +123,7 @@ namespace RoF2
|
|||||||
//we need to go to every stream and replace it's manager.
|
//we need to go to every stream and replace it's manager.
|
||||||
|
|
||||||
if (opcodes != nullptr) {
|
if (opcodes != nullptr) {
|
||||||
std::string opfile = fmt::format("{}/patch_{}.conf", PathManager::Instance()->GetPatchPath(), name);
|
std::string opfile = fmt::format("{}/patch_{}.conf", path.GetPatchPath(), name);
|
||||||
if (!opcodes->ReloadOpcodes(opfile.c_str())) {
|
if (!opcodes->ReloadOpcodes(opfile.c_str())) {
|
||||||
LogNetcode("[OPCODES] Error reloading opcodes file [{}] for patch [{}]", opfile.c_str(), name);
|
LogNetcode("[OPCODES] Error reloading opcodes file [{}] for patch [{}]", opfile.c_str(), name);
|
||||||
return;
|
return;
|
||||||
|
|||||||
+13
-13
@@ -72,7 +72,7 @@ namespace SoD
|
|||||||
{
|
{
|
||||||
//create our opcode manager if we havent already
|
//create our opcode manager if we havent already
|
||||||
if (opcodes == nullptr) {
|
if (opcodes == nullptr) {
|
||||||
std::string opfile = fmt::format("{}/patch_{}.conf", PathManager::Instance()->GetPatchPath(), name);
|
std::string opfile = fmt::format("{}/patch_{}.conf", path.GetPatchPath(), name);
|
||||||
//load up the opcode manager.
|
//load up the opcode manager.
|
||||||
//TODO: figure out how to support shared memory with multiple patches...
|
//TODO: figure out how to support shared memory with multiple patches...
|
||||||
opcodes = new RegularOpcodeManager();
|
opcodes = new RegularOpcodeManager();
|
||||||
@@ -113,7 +113,7 @@ namespace SoD
|
|||||||
//we need to go to every stream and replace it's manager.
|
//we need to go to every stream and replace it's manager.
|
||||||
|
|
||||||
if (opcodes != nullptr) {
|
if (opcodes != nullptr) {
|
||||||
std::string opfile = fmt::format("{}/patch_{}.conf", PathManager::Instance()->GetPatchPath(), name);
|
std::string opfile = fmt::format("{}/patch_{}.conf", path.GetPatchPath(), name);
|
||||||
if (!opcodes->ReloadOpcodes(opfile.c_str())) {
|
if (!opcodes->ReloadOpcodes(opfile.c_str())) {
|
||||||
LogNetcode("[OPCODES] Error reloading opcodes file [{}] for patch [{}]", opfile.c_str(), name);
|
LogNetcode("[OPCODES] Error reloading opcodes file [{}] for patch [{}]", opfile.c_str(), name);
|
||||||
return;
|
return;
|
||||||
@@ -3966,12 +3966,12 @@ namespace SoD
|
|||||||
SoDSlot = serverSlot - 2;
|
SoDSlot = serverSlot - 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (serverSlot <= EQ::invbag::GENERAL_BAGS_END && serverSlot >= EQ::invbag::GENERAL_BAGS_BEGIN) {
|
else if (serverSlot <= EQ::invbag::GENERAL_BAGS_8_END && serverSlot >= EQ::invbag::GENERAL_BAGS_BEGIN) {
|
||||||
SoDSlot = serverSlot - (EQ::invbag::GENERAL_BAGS_BEGIN - invbag::GENERAL_BAGS_BEGIN) - ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((serverSlot - EQ::invbag::GENERAL_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT));;
|
SoDSlot = serverSlot + 11;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (serverSlot <= EQ::invbag::CURSOR_BAG_END && serverSlot >= EQ::invbag::CURSOR_BAG_BEGIN) {
|
else if (serverSlot <= EQ::invbag::CURSOR_BAG_END && serverSlot >= EQ::invbag::CURSOR_BAG_BEGIN) {
|
||||||
SoDSlot = serverSlot - (EQ::invbag::CURSOR_BAG_BEGIN - invbag::CURSOR_BAG_BEGIN);
|
SoDSlot = serverSlot - 9;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (serverSlot <= EQ::invslot::TRIBUTE_END && serverSlot >= EQ::invslot::TRIBUTE_BEGIN) {
|
else if (serverSlot <= EQ::invslot::TRIBUTE_END && serverSlot >= EQ::invslot::TRIBUTE_BEGIN) {
|
||||||
@@ -3991,7 +3991,7 @@ namespace SoD
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if (serverSlot <= EQ::invbag::BANK_BAGS_END && serverSlot >= EQ::invbag::BANK_BAGS_BEGIN) {
|
else if (serverSlot <= EQ::invbag::BANK_BAGS_END && serverSlot >= EQ::invbag::BANK_BAGS_BEGIN) {
|
||||||
SoDSlot = serverSlot - (EQ::invbag::BANK_BAGS_BEGIN - invbag::BANK_BAGS_BEGIN) - ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((serverSlot - EQ::invbag::BANK_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT));;
|
SoDSlot = serverSlot + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (serverSlot <= EQ::invslot::SHARED_BANK_END && serverSlot >= EQ::invslot::SHARED_BANK_BEGIN) {
|
else if (serverSlot <= EQ::invslot::SHARED_BANK_END && serverSlot >= EQ::invslot::SHARED_BANK_BEGIN) {
|
||||||
@@ -3999,7 +3999,7 @@ namespace SoD
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if (serverSlot <= EQ::invbag::SHARED_BANK_BAGS_END && serverSlot >= EQ::invbag::SHARED_BANK_BAGS_BEGIN) {
|
else if (serverSlot <= EQ::invbag::SHARED_BANK_BAGS_END && serverSlot >= EQ::invbag::SHARED_BANK_BAGS_BEGIN) {
|
||||||
SoDSlot = serverSlot - (EQ::invbag::SHARED_BANK_BAGS_BEGIN - invbag::SHARED_BANK_BAGS_BEGIN) - ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((serverSlot - EQ::invbag::SHARED_BANK_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT));
|
SoDSlot = serverSlot + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (serverSlot <= EQ::invslot::TRADE_END && serverSlot >= EQ::invslot::TRADE_BEGIN) {
|
else if (serverSlot <= EQ::invslot::TRADE_END && serverSlot >= EQ::invslot::TRADE_BEGIN) {
|
||||||
@@ -4007,7 +4007,7 @@ namespace SoD
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if (serverSlot <= EQ::invbag::TRADE_BAGS_END && serverSlot >= EQ::invbag::TRADE_BAGS_BEGIN) {
|
else if (serverSlot <= EQ::invbag::TRADE_BAGS_END && serverSlot >= EQ::invbag::TRADE_BAGS_BEGIN) {
|
||||||
SoDSlot = serverSlot - (EQ::invbag::TRADE_BAGS_BEGIN - invbag::TRADE_BAGS_BEGIN) - ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((serverSlot - EQ::invbag::TRADE_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT));
|
SoDSlot = serverSlot;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (serverSlot <= EQ::invslot::WORLD_END && serverSlot >= EQ::invslot::WORLD_BEGIN) {
|
else if (serverSlot <= EQ::invslot::WORLD_END && serverSlot >= EQ::invslot::WORLD_BEGIN) {
|
||||||
@@ -4049,11 +4049,11 @@ namespace SoD
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if (sod_slot <= invbag::GENERAL_BAGS_END && sod_slot >= invbag::GENERAL_BAGS_BEGIN) {
|
else if (sod_slot <= invbag::GENERAL_BAGS_END && sod_slot >= invbag::GENERAL_BAGS_BEGIN) {
|
||||||
server_slot = sod_slot + (EQ::invbag::GENERAL_BAGS_BEGIN - invbag::GENERAL_BAGS_BEGIN) + ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((sod_slot - invbag::GENERAL_BAGS_BEGIN) / invbag::SLOT_COUNT));
|
server_slot = sod_slot - 11;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (sod_slot <= invbag::CURSOR_BAG_END && sod_slot >= invbag::CURSOR_BAG_BEGIN) {
|
else if (sod_slot <= invbag::CURSOR_BAG_END && sod_slot >= invbag::CURSOR_BAG_BEGIN) {
|
||||||
server_slot = sod_slot + (EQ::invbag::CURSOR_BAG_BEGIN - invbag::CURSOR_BAG_BEGIN);
|
server_slot = sod_slot + 9;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (sod_slot <= invslot::TRIBUTE_END && sod_slot >= invslot::TRIBUTE_BEGIN) {
|
else if (sod_slot <= invslot::TRIBUTE_END && sod_slot >= invslot::TRIBUTE_BEGIN) {
|
||||||
@@ -4073,7 +4073,7 @@ namespace SoD
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if (sod_slot <= invbag::BANK_BAGS_END && sod_slot >= invbag::BANK_BAGS_BEGIN) {
|
else if (sod_slot <= invbag::BANK_BAGS_END && sod_slot >= invbag::BANK_BAGS_BEGIN) {
|
||||||
server_slot = sod_slot + (EQ::invbag::BANK_BAGS_BEGIN - invbag::BANK_BAGS_BEGIN) + ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((sod_slot - invbag::BANK_BAGS_BEGIN) / invbag::SLOT_COUNT));
|
server_slot = sod_slot - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (sod_slot <= invslot::SHARED_BANK_END && sod_slot >= invslot::SHARED_BANK_BEGIN) {
|
else if (sod_slot <= invslot::SHARED_BANK_END && sod_slot >= invslot::SHARED_BANK_BEGIN) {
|
||||||
@@ -4081,7 +4081,7 @@ namespace SoD
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if (sod_slot <= invbag::SHARED_BANK_BAGS_END && sod_slot >= invbag::SHARED_BANK_BAGS_BEGIN) {
|
else if (sod_slot <= invbag::SHARED_BANK_BAGS_END && sod_slot >= invbag::SHARED_BANK_BAGS_BEGIN) {
|
||||||
server_slot = sod_slot + (EQ::invbag::SHARED_BANK_BAGS_BEGIN - invbag::SHARED_BANK_BAGS_BEGIN) + ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((sod_slot - invbag::SHARED_BANK_BAGS_BEGIN) / invbag::SLOT_COUNT));
|
server_slot = sod_slot - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (sod_slot <= invslot::TRADE_END && sod_slot >= invslot::TRADE_BEGIN) {
|
else if (sod_slot <= invslot::TRADE_END && sod_slot >= invslot::TRADE_BEGIN) {
|
||||||
@@ -4089,7 +4089,7 @@ namespace SoD
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if (sod_slot <= invbag::TRADE_BAGS_END && sod_slot >= invbag::TRADE_BAGS_BEGIN) {
|
else if (sod_slot <= invbag::TRADE_BAGS_END && sod_slot >= invbag::TRADE_BAGS_BEGIN) {
|
||||||
server_slot = sod_slot + (EQ::invbag::TRADE_BAGS_BEGIN - invbag::TRADE_BAGS_BEGIN) + ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((sod_slot - invbag::TRADE_BAGS_BEGIN) / invbag::SLOT_COUNT));
|
server_slot = sod_slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (sod_slot <= invslot::WORLD_END && sod_slot >= invslot::WORLD_BEGIN) {
|
else if (sod_slot <= invslot::WORLD_END && sod_slot >= invslot::WORLD_BEGIN) {
|
||||||
|
|||||||
+13
-13
@@ -71,7 +71,7 @@ namespace SoF
|
|||||||
{
|
{
|
||||||
//create our opcode manager if we havent already
|
//create our opcode manager if we havent already
|
||||||
if (opcodes == nullptr) {
|
if (opcodes == nullptr) {
|
||||||
std::string opfile = fmt::format("{}/patch_{}.conf", PathManager::Instance()->GetPatchPath(), name);
|
std::string opfile = fmt::format("{}/patch_{}.conf", path.GetPatchPath(), name);
|
||||||
//load up the opcode manager.
|
//load up the opcode manager.
|
||||||
//TODO: figure out how to support shared memory with multiple patches...
|
//TODO: figure out how to support shared memory with multiple patches...
|
||||||
opcodes = new RegularOpcodeManager();
|
opcodes = new RegularOpcodeManager();
|
||||||
@@ -110,7 +110,7 @@ namespace SoF
|
|||||||
//we need to go to every stream and replace it's manager.
|
//we need to go to every stream and replace it's manager.
|
||||||
|
|
||||||
if (opcodes != nullptr) {
|
if (opcodes != nullptr) {
|
||||||
std::string opfile = fmt::format("{}/patch_{}.conf", PathManager::Instance()->GetPatchPath(), name);
|
std::string opfile = fmt::format("{}/patch_{}.conf", path.GetPatchPath(), name);
|
||||||
if (!opcodes->ReloadOpcodes(opfile.c_str())) {
|
if (!opcodes->ReloadOpcodes(opfile.c_str())) {
|
||||||
LogNetcode("[OPCODES] Error reloading opcodes file [{}] for patch [{}]", opfile.c_str(), name);
|
LogNetcode("[OPCODES] Error reloading opcodes file [{}] for patch [{}]", opfile.c_str(), name);
|
||||||
return;
|
return;
|
||||||
@@ -3355,12 +3355,12 @@ namespace SoF
|
|||||||
sof_slot = server_slot - 2;
|
sof_slot = server_slot - 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQ::invbag::GENERAL_BAGS_END && server_slot >= EQ::invbag::GENERAL_BAGS_BEGIN) {
|
else if (server_slot <= EQ::invbag::GENERAL_BAGS_8_END && server_slot >= EQ::invbag::GENERAL_BAGS_BEGIN) {
|
||||||
sof_slot = server_slot - (EQ::invbag::GENERAL_BAGS_BEGIN - invbag::GENERAL_BAGS_BEGIN) - ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((server_slot - EQ::invbag::GENERAL_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT));;
|
sof_slot = server_slot + 11;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQ::invbag::CURSOR_BAG_END && server_slot >= EQ::invbag::CURSOR_BAG_BEGIN) {
|
else if (server_slot <= EQ::invbag::CURSOR_BAG_END && server_slot >= EQ::invbag::CURSOR_BAG_BEGIN) {
|
||||||
sof_slot = server_slot - (EQ::invbag::CURSOR_BAG_BEGIN - invbag::CURSOR_BAG_BEGIN);
|
sof_slot = server_slot - 9;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQ::invslot::TRIBUTE_END && server_slot >= EQ::invslot::TRIBUTE_BEGIN) {
|
else if (server_slot <= EQ::invslot::TRIBUTE_END && server_slot >= EQ::invslot::TRIBUTE_BEGIN) {
|
||||||
@@ -3380,7 +3380,7 @@ namespace SoF
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQ::invbag::BANK_BAGS_END && server_slot >= EQ::invbag::BANK_BAGS_BEGIN) {
|
else if (server_slot <= EQ::invbag::BANK_BAGS_END && server_slot >= EQ::invbag::BANK_BAGS_BEGIN) {
|
||||||
sof_slot = server_slot - (EQ::invbag::BANK_BAGS_BEGIN - invbag::BANK_BAGS_BEGIN) - ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((server_slot - EQ::invbag::BANK_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT));
|
sof_slot = server_slot + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQ::invslot::SHARED_BANK_END && server_slot >= EQ::invslot::SHARED_BANK_BEGIN) {
|
else if (server_slot <= EQ::invslot::SHARED_BANK_END && server_slot >= EQ::invslot::SHARED_BANK_BEGIN) {
|
||||||
@@ -3388,7 +3388,7 @@ namespace SoF
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQ::invbag::SHARED_BANK_BAGS_END && server_slot >= EQ::invbag::SHARED_BANK_BAGS_BEGIN) {
|
else if (server_slot <= EQ::invbag::SHARED_BANK_BAGS_END && server_slot >= EQ::invbag::SHARED_BANK_BAGS_BEGIN) {
|
||||||
sof_slot = server_slot - (EQ::invbag::SHARED_BANK_BAGS_BEGIN - invbag::SHARED_BANK_BAGS_BEGIN) - ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((server_slot - EQ::invbag::SHARED_BANK_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT));
|
sof_slot = server_slot + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQ::invslot::TRADE_END && server_slot >= EQ::invslot::TRADE_BEGIN) {
|
else if (server_slot <= EQ::invslot::TRADE_END && server_slot >= EQ::invslot::TRADE_BEGIN) {
|
||||||
@@ -3396,7 +3396,7 @@ namespace SoF
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQ::invbag::TRADE_BAGS_END && server_slot >= EQ::invbag::TRADE_BAGS_BEGIN) {
|
else if (server_slot <= EQ::invbag::TRADE_BAGS_END && server_slot >= EQ::invbag::TRADE_BAGS_BEGIN) {
|
||||||
sof_slot = server_slot - (EQ::invbag::TRADE_BAGS_BEGIN - invbag::TRADE_BAGS_BEGIN) - ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((server_slot - EQ::invbag::TRADE_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT));
|
sof_slot = server_slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (server_slot <= EQ::invslot::WORLD_END && server_slot >= EQ::invslot::WORLD_BEGIN) {
|
else if (server_slot <= EQ::invslot::WORLD_END && server_slot >= EQ::invslot::WORLD_BEGIN) {
|
||||||
@@ -3442,11 +3442,11 @@ namespace SoF
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if (sof_slot <= invbag::GENERAL_BAGS_END && sof_slot >= invbag::GENERAL_BAGS_BEGIN) {
|
else if (sof_slot <= invbag::GENERAL_BAGS_END && sof_slot >= invbag::GENERAL_BAGS_BEGIN) {
|
||||||
server_slot = sof_slot + (EQ::invbag::GENERAL_BAGS_BEGIN - invbag::GENERAL_BAGS_BEGIN) + ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((sof_slot - invbag::GENERAL_BAGS_BEGIN) / invbag::SLOT_COUNT));;
|
server_slot = sof_slot - 11;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (sof_slot <= invbag::CURSOR_BAG_END && sof_slot >= invbag::CURSOR_BAG_BEGIN) {
|
else if (sof_slot <= invbag::CURSOR_BAG_END && sof_slot >= invbag::CURSOR_BAG_BEGIN) {
|
||||||
server_slot = sof_slot + (EQ::invbag::CURSOR_BAG_BEGIN - invbag::CURSOR_BAG_BEGIN);
|
server_slot = sof_slot + 9;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (sof_slot <= invslot::TRIBUTE_END && sof_slot >= invslot::TRIBUTE_BEGIN) {
|
else if (sof_slot <= invslot::TRIBUTE_END && sof_slot >= invslot::TRIBUTE_BEGIN) {
|
||||||
@@ -3466,7 +3466,7 @@ namespace SoF
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if (sof_slot <= invbag::BANK_BAGS_END && sof_slot >= invbag::BANK_BAGS_BEGIN) {
|
else if (sof_slot <= invbag::BANK_BAGS_END && sof_slot >= invbag::BANK_BAGS_BEGIN) {
|
||||||
server_slot = sof_slot + (EQ::invbag::BANK_BAGS_BEGIN - invbag::BANK_BAGS_BEGIN) + ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((sof_slot - invbag::BANK_BAGS_BEGIN) / invbag::SLOT_COUNT));;
|
server_slot = sof_slot - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (sof_slot <= invslot::SHARED_BANK_END && sof_slot >= invslot::SHARED_BANK_BEGIN) {
|
else if (sof_slot <= invslot::SHARED_BANK_END && sof_slot >= invslot::SHARED_BANK_BEGIN) {
|
||||||
@@ -3474,7 +3474,7 @@ namespace SoF
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if (sof_slot <= invbag::SHARED_BANK_BAGS_END && sof_slot >= invbag::SHARED_BANK_BAGS_BEGIN) {
|
else if (sof_slot <= invbag::SHARED_BANK_BAGS_END && sof_slot >= invbag::SHARED_BANK_BAGS_BEGIN) {
|
||||||
server_slot = sof_slot + (EQ::invbag::SHARED_BANK_BAGS_BEGIN - invbag::SHARED_BANK_BAGS_BEGIN) + ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((sof_slot - invbag::SHARED_BANK_BAGS_BEGIN) / invbag::SLOT_COUNT));;
|
server_slot = sof_slot - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (sof_slot <= invslot::TRADE_END && sof_slot >= invslot::TRADE_BEGIN) {
|
else if (sof_slot <= invslot::TRADE_END && sof_slot >= invslot::TRADE_BEGIN) {
|
||||||
@@ -3482,7 +3482,7 @@ namespace SoF
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if (sof_slot <= invbag::TRADE_BAGS_END && sof_slot >= invbag::TRADE_BAGS_BEGIN) {
|
else if (sof_slot <= invbag::TRADE_BAGS_END && sof_slot >= invbag::TRADE_BAGS_BEGIN) {
|
||||||
server_slot = sof_slot + (EQ::invbag::TRADE_BAGS_BEGIN - invbag::TRADE_BAGS_BEGIN) + ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((sof_slot - invbag::TRADE_BAGS_BEGIN) / invbag::SLOT_COUNT));;
|
server_slot = sof_slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (sof_slot <= invslot::WORLD_END && sof_slot >= invslot::WORLD_BEGIN) {
|
else if (sof_slot <= invslot::WORLD_END && sof_slot >= invslot::WORLD_BEGIN) {
|
||||||
|
|||||||
+14
-14
@@ -73,7 +73,7 @@ namespace Titanium
|
|||||||
auto Config = EQEmuConfig::get();
|
auto Config = EQEmuConfig::get();
|
||||||
//create our opcode manager if we havent already
|
//create our opcode manager if we havent already
|
||||||
if (opcodes == nullptr) {
|
if (opcodes == nullptr) {
|
||||||
std::string opfile = fmt::format("{}/patch_{}.conf", PathManager::Instance()->GetPatchPath(), name);
|
std::string opfile = fmt::format("{}/patch_{}.conf", path.GetPatchPath(), name);
|
||||||
//load up the opcode manager.
|
//load up the opcode manager.
|
||||||
//TODO: figure out how to support shared memory with multiple patches...
|
//TODO: figure out how to support shared memory with multiple patches...
|
||||||
opcodes = new RegularOpcodeManager();
|
opcodes = new RegularOpcodeManager();
|
||||||
@@ -114,7 +114,7 @@ namespace Titanium
|
|||||||
//we need to go to every stream and replace it's manager.
|
//we need to go to every stream and replace it's manager.
|
||||||
|
|
||||||
if (opcodes != nullptr) {
|
if (opcodes != nullptr) {
|
||||||
std::string opfile = fmt::format("{}/patch_{}.conf", PathManager::Instance()->GetPatchPath(), name);
|
std::string opfile = fmt::format("{}/patch_{}.conf", path.GetPatchPath(), name);
|
||||||
if (!opcodes->ReloadOpcodes(opfile.c_str())) {
|
if (!opcodes->ReloadOpcodes(opfile.c_str())) {
|
||||||
LogNetcode("[OPCODES] Error reloading opcodes file [{}] for patch [{}]", opfile.c_str(), name);
|
LogNetcode("[OPCODES] Error reloading opcodes file [{}] for patch [{}]", opfile.c_str(), name);
|
||||||
return;
|
return;
|
||||||
@@ -3596,12 +3596,12 @@ namespace Titanium
|
|||||||
else if (server_slot == (EQ::invslot::POSSESSIONS_COUNT + EQ::invslot::slotAmmo)) {
|
else if (server_slot == (EQ::invslot::POSSESSIONS_COUNT + EQ::invslot::slotAmmo)) {
|
||||||
titanium_slot = server_slot - 4;
|
titanium_slot = server_slot - 4;
|
||||||
}
|
}
|
||||||
else if (server_slot <= EQ::invbag::GENERAL_BAGS_END &&
|
else if (server_slot <= EQ::invbag::GENERAL_BAGS_8_END &&
|
||||||
server_slot >= EQ::invbag::GENERAL_BAGS_BEGIN) {
|
server_slot >= EQ::invbag::GENERAL_BAGS_BEGIN) {
|
||||||
titanium_slot = server_slot - (EQ::invbag::GENERAL_BAGS_BEGIN - invbag::GENERAL_BAGS_BEGIN) - ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((server_slot - EQ::invbag::GENERAL_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT));
|
titanium_slot = server_slot;
|
||||||
}
|
}
|
||||||
else if (server_slot <= EQ::invbag::CURSOR_BAG_END && server_slot >= EQ::invbag::CURSOR_BAG_BEGIN) {
|
else if (server_slot <= EQ::invbag::CURSOR_BAG_END && server_slot >= EQ::invbag::CURSOR_BAG_BEGIN) {
|
||||||
titanium_slot = server_slot - (EQ::invbag::CURSOR_BAG_BEGIN - invbag::CURSOR_BAG_BEGIN);
|
titanium_slot = server_slot - 20;
|
||||||
}
|
}
|
||||||
else if (server_slot <= EQ::invslot::TRIBUTE_END && server_slot >= EQ::invslot::TRIBUTE_BEGIN) {
|
else if (server_slot <= EQ::invslot::TRIBUTE_END && server_slot >= EQ::invslot::TRIBUTE_BEGIN) {
|
||||||
titanium_slot = server_slot;
|
titanium_slot = server_slot;
|
||||||
@@ -3616,21 +3616,21 @@ namespace Titanium
|
|||||||
else if (server_slot <= EQ::invslot::BANK_END && server_slot >= EQ::invslot::BANK_BEGIN) {
|
else if (server_slot <= EQ::invslot::BANK_END && server_slot >= EQ::invslot::BANK_BEGIN) {
|
||||||
titanium_slot = server_slot;
|
titanium_slot = server_slot;
|
||||||
}
|
}
|
||||||
else if (server_slot <= EQ::invbag::BANK_BAGS_END && server_slot >= EQ::invbag::BANK_BAGS_BEGIN) {
|
else if (server_slot <= EQ::invbag::BANK_BAGS_16_END && server_slot >= EQ::invbag::BANK_BAGS_BEGIN) {
|
||||||
titanium_slot = server_slot - (EQ::invbag::BANK_BAGS_BEGIN - invbag::BANK_BAGS_BEGIN) - ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((server_slot - EQ::invbag::BANK_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT));
|
titanium_slot = server_slot;
|
||||||
}
|
}
|
||||||
else if (server_slot <= EQ::invslot::SHARED_BANK_END && server_slot >= EQ::invslot::SHARED_BANK_BEGIN) {
|
else if (server_slot <= EQ::invslot::SHARED_BANK_END && server_slot >= EQ::invslot::SHARED_BANK_BEGIN) {
|
||||||
titanium_slot = server_slot;
|
titanium_slot = server_slot;
|
||||||
}
|
}
|
||||||
else if (server_slot <= EQ::invbag::SHARED_BANK_BAGS_END &&
|
else if (server_slot <= EQ::invbag::SHARED_BANK_BAGS_END &&
|
||||||
server_slot >= EQ::invbag::SHARED_BANK_BAGS_BEGIN) {
|
server_slot >= EQ::invbag::SHARED_BANK_BAGS_BEGIN) {
|
||||||
titanium_slot = server_slot - (EQ::invbag::SHARED_BANK_BAGS_BEGIN - invbag::SHARED_BANK_BAGS_BEGIN) - ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((server_slot - EQ::invbag::SHARED_BANK_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT));
|
titanium_slot = server_slot;
|
||||||
}
|
}
|
||||||
else if (server_slot <= EQ::invslot::TRADE_END && server_slot >= EQ::invslot::TRADE_BEGIN) {
|
else if (server_slot <= EQ::invslot::TRADE_END && server_slot >= EQ::invslot::TRADE_BEGIN) {
|
||||||
titanium_slot = server_slot;
|
titanium_slot = server_slot;
|
||||||
}
|
}
|
||||||
else if (server_slot <= EQ::invbag::TRADE_BAGS_END && server_slot >= EQ::invbag::TRADE_BAGS_BEGIN) {
|
else if (server_slot <= EQ::invbag::TRADE_BAGS_END && server_slot >= EQ::invbag::TRADE_BAGS_BEGIN) {
|
||||||
titanium_slot = server_slot - (EQ::invbag::TRADE_BAGS_BEGIN - invbag::TRADE_BAGS_BEGIN) - ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((server_slot - EQ::invbag::TRADE_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT));
|
titanium_slot = server_slot;
|
||||||
}
|
}
|
||||||
else if (server_slot <= EQ::invslot::WORLD_END && server_slot >= EQ::invslot::WORLD_BEGIN) {
|
else if (server_slot <= EQ::invslot::WORLD_END && server_slot >= EQ::invslot::WORLD_BEGIN) {
|
||||||
titanium_slot = server_slot;
|
titanium_slot = server_slot;
|
||||||
@@ -3687,10 +3687,10 @@ namespace Titanium
|
|||||||
server_slot = titanium_slot + 4;
|
server_slot = titanium_slot + 4;
|
||||||
}
|
}
|
||||||
else if (titanium_slot <= invbag::GENERAL_BAGS_END && titanium_slot >= invbag::GENERAL_BAGS_BEGIN) {
|
else if (titanium_slot <= invbag::GENERAL_BAGS_END && titanium_slot >= invbag::GENERAL_BAGS_BEGIN) {
|
||||||
server_slot = titanium_slot + (EQ::invbag::GENERAL_BAGS_BEGIN - invbag::GENERAL_BAGS_BEGIN) + ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((titanium_slot - invbag::GENERAL_BAGS_BEGIN) / invbag::SLOT_COUNT));
|
server_slot = titanium_slot;
|
||||||
}
|
}
|
||||||
else if (titanium_slot <= invbag::CURSOR_BAG_END && titanium_slot >= invbag::CURSOR_BAG_BEGIN) {
|
else if (titanium_slot <= invbag::CURSOR_BAG_END && titanium_slot >= invbag::CURSOR_BAG_BEGIN) {
|
||||||
server_slot = titanium_slot + (EQ::invbag::CURSOR_BAG_BEGIN - invbag::CURSOR_BAG_BEGIN);
|
server_slot = titanium_slot + 20;
|
||||||
}
|
}
|
||||||
else if (titanium_slot <= invslot::TRIBUTE_END && titanium_slot >= invslot::TRIBUTE_BEGIN) {
|
else if (titanium_slot <= invslot::TRIBUTE_END && titanium_slot >= invslot::TRIBUTE_BEGIN) {
|
||||||
server_slot = titanium_slot;
|
server_slot = titanium_slot;
|
||||||
@@ -3705,19 +3705,19 @@ namespace Titanium
|
|||||||
server_slot = titanium_slot;
|
server_slot = titanium_slot;
|
||||||
}
|
}
|
||||||
else if (titanium_slot <= invbag::BANK_BAGS_END && titanium_slot >= invbag::BANK_BAGS_BEGIN) {
|
else if (titanium_slot <= invbag::BANK_BAGS_END && titanium_slot >= invbag::BANK_BAGS_BEGIN) {
|
||||||
server_slot = titanium_slot + (EQ::invbag::BANK_BAGS_BEGIN - invbag::BANK_BAGS_BEGIN) + ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((titanium_slot - invbag::BANK_BAGS_BEGIN) / invbag::SLOT_COUNT));
|
server_slot = titanium_slot;
|
||||||
}
|
}
|
||||||
else if (titanium_slot <= invslot::SHARED_BANK_END && titanium_slot >= invslot::SHARED_BANK_BEGIN) {
|
else if (titanium_slot <= invslot::SHARED_BANK_END && titanium_slot >= invslot::SHARED_BANK_BEGIN) {
|
||||||
server_slot = titanium_slot;
|
server_slot = titanium_slot;
|
||||||
}
|
}
|
||||||
else if (titanium_slot <= invbag::SHARED_BANK_BAGS_END && titanium_slot >= invbag::SHARED_BANK_BAGS_BEGIN) {
|
else if (titanium_slot <= invbag::SHARED_BANK_BAGS_END && titanium_slot >= invbag::SHARED_BANK_BAGS_BEGIN) {
|
||||||
server_slot = titanium_slot + (EQ::invbag::SHARED_BANK_BAGS_BEGIN - invbag::SHARED_BANK_BAGS_BEGIN) + ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((titanium_slot - invbag::SHARED_BANK_BAGS_BEGIN) / invbag::SLOT_COUNT));
|
server_slot = titanium_slot;
|
||||||
}
|
}
|
||||||
else if (titanium_slot <= invslot::TRADE_END && titanium_slot >= invslot::TRADE_BEGIN) {
|
else if (titanium_slot <= invslot::TRADE_END && titanium_slot >= invslot::TRADE_BEGIN) {
|
||||||
server_slot = titanium_slot;
|
server_slot = titanium_slot;
|
||||||
}
|
}
|
||||||
else if (titanium_slot <= invbag::TRADE_BAGS_END && titanium_slot >= invbag::TRADE_BAGS_BEGIN) {
|
else if (titanium_slot <= invbag::TRADE_BAGS_END && titanium_slot >= invbag::TRADE_BAGS_BEGIN) {
|
||||||
server_slot = titanium_slot + (EQ::invbag::TRADE_BAGS_BEGIN - invbag::TRADE_BAGS_BEGIN) + ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((titanium_slot - invbag::TRADE_BAGS_BEGIN) / invbag::SLOT_COUNT));
|
server_slot = titanium_slot;
|
||||||
}
|
}
|
||||||
else if (titanium_slot <= invslot::WORLD_END && titanium_slot >= invslot::WORLD_BEGIN) {
|
else if (titanium_slot <= invslot::WORLD_END && titanium_slot >= invslot::WORLD_BEGIN) {
|
||||||
server_slot = titanium_slot;
|
server_slot = titanium_slot;
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ namespace UF
|
|||||||
{
|
{
|
||||||
//create our opcode manager if we havent already
|
//create our opcode manager if we havent already
|
||||||
if (opcodes == nullptr) {
|
if (opcodes == nullptr) {
|
||||||
std::string opfile = fmt::format("{}/patch_{}.conf", PathManager::Instance()->GetPatchPath(), name);
|
std::string opfile = fmt::format("{}/patch_{}.conf", path.GetPatchPath(), name);
|
||||||
//load up the opcode manager.
|
//load up the opcode manager.
|
||||||
//TODO: figure out how to support shared memory with multiple patches...
|
//TODO: figure out how to support shared memory with multiple patches...
|
||||||
opcodes = new RegularOpcodeManager();
|
opcodes = new RegularOpcodeManager();
|
||||||
@@ -117,7 +117,7 @@ namespace UF
|
|||||||
//we need to go to every stream and replace it's manager.
|
//we need to go to every stream and replace it's manager.
|
||||||
|
|
||||||
if (opcodes != nullptr) {
|
if (opcodes != nullptr) {
|
||||||
std::string opfile = fmt::format("{}/patch_{}.conf", PathManager::Instance()->GetPatchPath(), name);
|
std::string opfile = fmt::format("{}/patch_{}.conf", path.GetPatchPath(), name);
|
||||||
if (!opcodes->ReloadOpcodes(opfile.c_str())) {
|
if (!opcodes->ReloadOpcodes(opfile.c_str())) {
|
||||||
LogNetcode("[OPCODES] Error reloading opcodes file [{}] for patch [{}]", opfile.c_str(), name);
|
LogNetcode("[OPCODES] Error reloading opcodes file [{}] for patch [{}]", opfile.c_str(), name);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
namespace fs = std::filesystem;
|
namespace fs = std::filesystem;
|
||||||
|
|
||||||
void PathManager::Init()
|
void PathManager::LoadPaths()
|
||||||
{
|
{
|
||||||
m_server_path = File::FindEqemuConfigPath();
|
m_server_path = File::FindEqemuConfigPath();
|
||||||
|
|
||||||
|
|||||||
@@ -7,13 +7,7 @@
|
|||||||
|
|
||||||
class PathManager {
|
class PathManager {
|
||||||
public:
|
public:
|
||||||
void Init();
|
void LoadPaths();
|
||||||
|
|
||||||
static PathManager *Instance()
|
|
||||||
{
|
|
||||||
static PathManager instance;
|
|
||||||
return &instance;
|
|
||||||
}
|
|
||||||
|
|
||||||
[[nodiscard]] const std::string &GetLogPath() const;
|
[[nodiscard]] const std::string &GetLogPath() const;
|
||||||
[[nodiscard]] const std::string &GetLuaModsPath() const;
|
[[nodiscard]] const std::string &GetLuaModsPath() const;
|
||||||
@@ -44,4 +38,6 @@ private:
|
|||||||
std::string m_shared_memory_path;
|
std::string m_shared_memory_path;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extern PathManager path;
|
||||||
|
|
||||||
#endif //EQEMU_PATH_MANAGER_H
|
#endif //EQEMU_PATH_MANAGER_H
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "../types.h"
|
|
||||||
#include "../database.h"
|
|
||||||
#include "../strings.h"
|
|
||||||
#include "../eqemu_logsys.h"
|
|
||||||
#include "../eqemu_logsys_log_aliases.h"
|
|
||||||
#include "../features.h"
|
|
||||||
#include "../global_define.h"
|
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
// types
|
||||||
|
#include <limits>
|
||||||
|
#include <string>
|
||||||
|
#include <cctype>
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
|
// containers
|
||||||
|
#include <iterator>
|
||||||
|
#include <set>
|
||||||
|
#include <unordered_set>
|
||||||
|
#include <map>
|
||||||
|
#include <unordered_map>
|
||||||
|
#include <list>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
// utilities
|
||||||
|
#include <iostream>
|
||||||
|
#include <cassert>
|
||||||
|
#include <cmath>
|
||||||
|
#include <memory>
|
||||||
|
#include <functional>
|
||||||
|
#include <algorithm>
|
||||||
|
#include <utility>
|
||||||
|
#include <tuple>
|
||||||
|
#include <fstream>
|
||||||
|
#include <cstdio>
|
||||||
|
|
||||||
|
// fmt
|
||||||
|
#include <fmt/format.h>
|
||||||
|
|
||||||
|
// lua
|
||||||
|
#include "lua.hpp"
|
||||||
|
#include <luabind/luabind.hpp>
|
||||||
|
#include <luabind/object.hpp>
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
// Lightweight, widely used
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
#include <map>
|
|
||||||
#include <unordered_map>
|
|
||||||
#include <memory>
|
|
||||||
#include <limits>
|
|
||||||
#include <cstdint>
|
|
||||||
#include <cassert>
|
|
||||||
|
|
||||||
// fmt
|
|
||||||
#include <fmt/format.h>
|
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include "process.h"
|
#include "process.h"
|
||||||
#include <fmt/format.h>
|
|
||||||
|
|
||||||
std::string Process::execute(const std::string &cmd)
|
std::string Process::execute(const std::string &cmd)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -116,12 +116,6 @@ namespace EQ {
|
|||||||
Reseed();
|
Reseed();
|
||||||
}
|
}
|
||||||
|
|
||||||
static Random* Instance()
|
|
||||||
{
|
|
||||||
static Random instance;
|
|
||||||
return &instance;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#ifndef BIASED_INT_DIST
|
#ifndef BIASED_INT_DIST
|
||||||
typedef std::uniform_int_distribution<int>::param_type int_param_t;
|
typedef std::uniform_int_distribution<int>::param_type int_param_t;
|
||||||
|
|||||||
@@ -70,7 +70,6 @@ public:
|
|||||||
uint32_t gm_exp;
|
uint32_t gm_exp;
|
||||||
uint32_t killed_by;
|
uint32_t killed_by;
|
||||||
uint8_t rezzable;
|
uint8_t rezzable;
|
||||||
std::string entity_variables;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static std::string PrimaryKey()
|
static std::string PrimaryKey()
|
||||||
@@ -132,7 +131,6 @@ public:
|
|||||||
"gm_exp",
|
"gm_exp",
|
||||||
"killed_by",
|
"killed_by",
|
||||||
"rezzable",
|
"rezzable",
|
||||||
"entity_variables",
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -190,7 +188,6 @@ public:
|
|||||||
"gm_exp",
|
"gm_exp",
|
||||||
"killed_by",
|
"killed_by",
|
||||||
"rezzable",
|
"rezzable",
|
||||||
"entity_variables",
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -282,7 +279,6 @@ public:
|
|||||||
e.gm_exp = 0;
|
e.gm_exp = 0;
|
||||||
e.killed_by = 0;
|
e.killed_by = 0;
|
||||||
e.rezzable = 0;
|
e.rezzable = 0;
|
||||||
e.entity_variables = "";
|
|
||||||
|
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
@@ -370,7 +366,6 @@ public:
|
|||||||
e.gm_exp = row[48] ? static_cast<uint32_t>(strtoul(row[48], nullptr, 10)) : 0;
|
e.gm_exp = row[48] ? static_cast<uint32_t>(strtoul(row[48], nullptr, 10)) : 0;
|
||||||
e.killed_by = row[49] ? static_cast<uint32_t>(strtoul(row[49], nullptr, 10)) : 0;
|
e.killed_by = row[49] ? static_cast<uint32_t>(strtoul(row[49], nullptr, 10)) : 0;
|
||||||
e.rezzable = row[50] ? static_cast<uint8_t>(strtoul(row[50], nullptr, 10)) : 0;
|
e.rezzable = row[50] ? static_cast<uint8_t>(strtoul(row[50], nullptr, 10)) : 0;
|
||||||
e.entity_variables = row[51] ? row[51] : "";
|
|
||||||
|
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
@@ -454,7 +449,6 @@ public:
|
|||||||
v.push_back(columns[48] + " = " + std::to_string(e.gm_exp));
|
v.push_back(columns[48] + " = " + std::to_string(e.gm_exp));
|
||||||
v.push_back(columns[49] + " = " + std::to_string(e.killed_by));
|
v.push_back(columns[49] + " = " + std::to_string(e.killed_by));
|
||||||
v.push_back(columns[50] + " = " + std::to_string(e.rezzable));
|
v.push_back(columns[50] + " = " + std::to_string(e.rezzable));
|
||||||
v.push_back(columns[51] + " = '" + Strings::Escape(e.entity_variables) + "'");
|
|
||||||
|
|
||||||
auto results = db.QueryDatabase(
|
auto results = db.QueryDatabase(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
@@ -527,7 +521,6 @@ public:
|
|||||||
v.push_back(std::to_string(e.gm_exp));
|
v.push_back(std::to_string(e.gm_exp));
|
||||||
v.push_back(std::to_string(e.killed_by));
|
v.push_back(std::to_string(e.killed_by));
|
||||||
v.push_back(std::to_string(e.rezzable));
|
v.push_back(std::to_string(e.rezzable));
|
||||||
v.push_back("'" + Strings::Escape(e.entity_variables) + "'");
|
|
||||||
|
|
||||||
auto results = db.QueryDatabase(
|
auto results = db.QueryDatabase(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
@@ -608,7 +601,6 @@ public:
|
|||||||
v.push_back(std::to_string(e.gm_exp));
|
v.push_back(std::to_string(e.gm_exp));
|
||||||
v.push_back(std::to_string(e.killed_by));
|
v.push_back(std::to_string(e.killed_by));
|
||||||
v.push_back(std::to_string(e.rezzable));
|
v.push_back(std::to_string(e.rezzable));
|
||||||
v.push_back("'" + Strings::Escape(e.entity_variables) + "'");
|
|
||||||
|
|
||||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||||
}
|
}
|
||||||
@@ -693,7 +685,6 @@ public:
|
|||||||
e.gm_exp = row[48] ? static_cast<uint32_t>(strtoul(row[48], nullptr, 10)) : 0;
|
e.gm_exp = row[48] ? static_cast<uint32_t>(strtoul(row[48], nullptr, 10)) : 0;
|
||||||
e.killed_by = row[49] ? static_cast<uint32_t>(strtoul(row[49], nullptr, 10)) : 0;
|
e.killed_by = row[49] ? static_cast<uint32_t>(strtoul(row[49], nullptr, 10)) : 0;
|
||||||
e.rezzable = row[50] ? static_cast<uint8_t>(strtoul(row[50], nullptr, 10)) : 0;
|
e.rezzable = row[50] ? static_cast<uint8_t>(strtoul(row[50], nullptr, 10)) : 0;
|
||||||
e.entity_variables = row[51] ? row[51] : "";
|
|
||||||
|
|
||||||
all_entries.push_back(e);
|
all_entries.push_back(e);
|
||||||
}
|
}
|
||||||
@@ -769,7 +760,6 @@ public:
|
|||||||
e.gm_exp = row[48] ? static_cast<uint32_t>(strtoul(row[48], nullptr, 10)) : 0;
|
e.gm_exp = row[48] ? static_cast<uint32_t>(strtoul(row[48], nullptr, 10)) : 0;
|
||||||
e.killed_by = row[49] ? static_cast<uint32_t>(strtoul(row[49], nullptr, 10)) : 0;
|
e.killed_by = row[49] ? static_cast<uint32_t>(strtoul(row[49], nullptr, 10)) : 0;
|
||||||
e.rezzable = row[50] ? static_cast<uint8_t>(strtoul(row[50], nullptr, 10)) : 0;
|
e.rezzable = row[50] ? static_cast<uint8_t>(strtoul(row[50], nullptr, 10)) : 0;
|
||||||
e.entity_variables = row[51] ? row[51] : "";
|
|
||||||
|
|
||||||
all_entries.push_back(e);
|
all_entries.push_back(e);
|
||||||
}
|
}
|
||||||
@@ -895,7 +885,6 @@ public:
|
|||||||
v.push_back(std::to_string(e.gm_exp));
|
v.push_back(std::to_string(e.gm_exp));
|
||||||
v.push_back(std::to_string(e.killed_by));
|
v.push_back(std::to_string(e.killed_by));
|
||||||
v.push_back(std::to_string(e.rezzable));
|
v.push_back(std::to_string(e.rezzable));
|
||||||
v.push_back("'" + Strings::Escape(e.entity_variables) + "'");
|
|
||||||
|
|
||||||
auto results = db.QueryDatabase(
|
auto results = db.QueryDatabase(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
@@ -969,7 +958,6 @@ public:
|
|||||||
v.push_back(std::to_string(e.gm_exp));
|
v.push_back(std::to_string(e.gm_exp));
|
||||||
v.push_back(std::to_string(e.killed_by));
|
v.push_back(std::to_string(e.killed_by));
|
||||||
v.push_back(std::to_string(e.rezzable));
|
v.push_back(std::to_string(e.rezzable));
|
||||||
v.push_back("'" + Strings::Escape(e.entity_variables) + "'");
|
|
||||||
|
|
||||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
#include "../../database.h"
|
#include "../../database.h"
|
||||||
#include "../../strings.h"
|
#include "../../strings.h"
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
#include <cereal/cereal.hpp>
|
|
||||||
class BasePlayerEventLogSettingsRepository {
|
class BasePlayerEventLogSettingsRepository {
|
||||||
public:
|
public:
|
||||||
struct PlayerEventLogSettings {
|
struct PlayerEventLogSettings {
|
||||||
@@ -25,20 +25,6 @@ public:
|
|||||||
int32_t retention_days;
|
int32_t retention_days;
|
||||||
int32_t discord_webhook_id;
|
int32_t discord_webhook_id;
|
||||||
uint8_t etl_enabled;
|
uint8_t etl_enabled;
|
||||||
|
|
||||||
// cereal
|
|
||||||
template<class Archive>
|
|
||||||
void serialize(Archive &ar)
|
|
||||||
{
|
|
||||||
ar(
|
|
||||||
CEREAL_NVP(id),
|
|
||||||
CEREAL_NVP(event_name),
|
|
||||||
CEREAL_NVP(event_enabled),
|
|
||||||
CEREAL_NVP(retention_days),
|
|
||||||
CEREAL_NVP(discord_webhook_id),
|
|
||||||
CEREAL_NVP(etl_enabled)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static std::string PrimaryKey()
|
static std::string PrimaryKey()
|
||||||
|
|||||||
@@ -231,21 +231,6 @@ public:
|
|||||||
|
|
||||||
return UpdateOne(db, corpse);
|
return UpdateOne(db, corpse);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int UpdateEntityVariables(Database& db, uint32 corpse_id, const std::string& json_string)
|
|
||||||
{
|
|
||||||
auto results = db.QueryDatabase(
|
|
||||||
fmt::format(
|
|
||||||
"UPDATE `{}` SET `entity_variables` = '{}' WHERE `{}` = {}",
|
|
||||||
TableName(),
|
|
||||||
Strings::Escape(json_string),
|
|
||||||
PrimaryKey(),
|
|
||||||
corpse_id
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
return results.Success() ? results.RowsAffected() : 0;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //EQEMU_CHARACTER_CORPSES_REPOSITORY_H
|
#endif //EQEMU_CHARACTER_CORPSES_REPOSITORY_H
|
||||||
|
|||||||
@@ -167,30 +167,6 @@ public:
|
|||||||
|
|
||||||
return zone_player_counts;
|
return zone_player_counts;
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::vector<uint32_t> GetCharacterIDsByAccountID(
|
|
||||||
Database& db,
|
|
||||||
uint32_t account_id
|
|
||||||
)
|
|
||||||
{
|
|
||||||
std::vector<uint32_t> character_ids;
|
|
||||||
|
|
||||||
auto query = fmt::format(
|
|
||||||
"SELECT id FROM character_data WHERE account_id = {} AND deleted_at IS NULL",
|
|
||||||
account_id
|
|
||||||
);
|
|
||||||
|
|
||||||
auto results = db.QueryDatabase(query);
|
|
||||||
if (results.Success()) {
|
|
||||||
for (auto row : results) {
|
|
||||||
if (row[0]) {
|
|
||||||
character_ids.push_back(static_cast<uint32_t>(std::stoul(row[0])));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return character_ids;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //EQEMU_CHARACTER_DATA_REPOSITORY_H
|
#endif //EQEMU_CHARACTER_DATA_REPOSITORY_H
|
||||||
|
|||||||
@@ -142,7 +142,6 @@ public:
|
|||||||
{.parent_command = "show", .sub_command = "hatelist", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "hatelist"},
|
{.parent_command = "show", .sub_command = "hatelist", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "hatelist"},
|
||||||
{.parent_command = "show", .sub_command = "inventory", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "peekinv"},
|
{.parent_command = "show", .sub_command = "inventory", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "peekinv"},
|
||||||
{.parent_command = "show", .sub_command = "ip_lookup", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "iplookup"},
|
{.parent_command = "show", .sub_command = "ip_lookup", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "iplookup"},
|
||||||
{.parent_command = "show", .sub_command = "keyring", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "showkeyring"},
|
|
||||||
{.parent_command = "show", .sub_command = "line_of_sight", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "checklos"},
|
{.parent_command = "show", .sub_command = "line_of_sight", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "checklos"},
|
||||||
{.parent_command = "show", .sub_command = "network", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "network"},
|
{.parent_command = "show", .sub_command = "network", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "network"},
|
||||||
{.parent_command = "show", .sub_command = "network_stats", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "netstats"},
|
{.parent_command = "show", .sub_command = "network_stats", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "netstats"},
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace ContentFilterCriteria {
|
|||||||
table_prefix = table_prefix + ".";
|
table_prefix = table_prefix + ".";
|
||||||
}
|
}
|
||||||
|
|
||||||
int current_expansion_filter_criteria = WorldContentService::Instance()->GetCurrentExpansion();
|
int current_expansion_filter_criteria = content_service.GetCurrentExpansion();
|
||||||
if (current_expansion_filter_criteria == Expansion::EXPANSION_ALL) {
|
if (current_expansion_filter_criteria == Expansion::EXPANSION_ALL) {
|
||||||
current_expansion_filter_criteria = Expansion::EXPANSION_FILTER_MAX;
|
current_expansion_filter_criteria = Expansion::EXPANSION_FILTER_MAX;
|
||||||
}
|
}
|
||||||
@@ -33,8 +33,8 @@ namespace ContentFilterCriteria {
|
|||||||
table_prefix
|
table_prefix
|
||||||
);
|
);
|
||||||
|
|
||||||
std::vector<std::string> flags_disabled = WorldContentService::Instance()->GetContentFlagsDisabled();
|
std::vector<std::string> flags_disabled = content_service.GetContentFlagsDisabled();
|
||||||
std::vector<std::string> flags_enabled = WorldContentService::Instance()->GetContentFlagsEnabled();
|
std::vector<std::string> flags_enabled = content_service.GetContentFlagsEnabled();
|
||||||
std::string flags_in_filter_enabled;
|
std::string flags_in_filter_enabled;
|
||||||
std::string flags_in_filter_disabled;
|
std::string flags_in_filter_disabled;
|
||||||
if (!flags_enabled.empty()) {
|
if (!flags_enabled.empty()) {
|
||||||
|
|||||||
@@ -43,47 +43,6 @@ public:
|
|||||||
* method and encapsulate filters there
|
* method and encapsulate filters there
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T1, typename T2, typename T3, typename T4>
|
|
||||||
static std::vector<std::string> join_tuple(
|
|
||||||
const std::string &glue,
|
|
||||||
const std::pair<char, char> &encapsulation,
|
|
||||||
const std::vector<std::tuple<T1, T2, T3, T4>> &src
|
|
||||||
)
|
|
||||||
{
|
|
||||||
if (src.empty()) {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<std::string> output;
|
|
||||||
|
|
||||||
for (const std::tuple<T1, T2, T3, T4> &src_iter: src) {
|
|
||||||
|
|
||||||
output.emplace_back(
|
|
||||||
|
|
||||||
fmt::format(
|
|
||||||
"{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
|
|
||||||
encapsulation.first,
|
|
||||||
std::get<0>(src_iter),
|
|
||||||
encapsulation.second,
|
|
||||||
glue,
|
|
||||||
encapsulation.first,
|
|
||||||
std::get<1>(src_iter),
|
|
||||||
encapsulation.second,
|
|
||||||
glue,
|
|
||||||
encapsulation.first,
|
|
||||||
std::get<2>(src_iter),
|
|
||||||
encapsulation.second,
|
|
||||||
glue,
|
|
||||||
encapsulation.first,
|
|
||||||
std::get<3>(src_iter),
|
|
||||||
encapsulation.second
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return output;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Custom extended repository methods here
|
// Custom extended repository methods here
|
||||||
static std::vector<std::string> GetRuleNames(Database &db, int rule_set_id)
|
static std::vector<std::string> GetRuleNames(Database &db, int rule_set_id)
|
||||||
{
|
{
|
||||||
@@ -128,28 +87,12 @@ public:
|
|||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
static std::string
|
|
||||||
ImplodePair(const std::string &glue, const std::pair<char, char> &encapsulation, const std::vector<T> &src)
|
|
||||||
{
|
|
||||||
if (src.empty()) {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
std::ostringstream oss;
|
|
||||||
for (const T &src_iter: src) {
|
|
||||||
oss << encapsulation.first << src_iter << encapsulation.second << glue;
|
|
||||||
}
|
|
||||||
std::string output(oss.str());
|
|
||||||
output.resize(output.size() - glue.size());
|
|
||||||
return output;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool DeleteOrphanedRules(Database& db, std::vector<std::string>& v)
|
static bool DeleteOrphanedRules(Database& db, std::vector<std::string>& v)
|
||||||
{
|
{
|
||||||
const auto query = fmt::format(
|
const auto query = fmt::format(
|
||||||
"DELETE FROM {} WHERE rule_name IN ({})",
|
"DELETE FROM {} WHERE rule_name IN ({})",
|
||||||
TableName(),
|
TableName(),
|
||||||
ImplodePair(",", std::pair<char, char>('\'', '\''), v)
|
Strings::ImplodePair(",", std::pair<char, char>('\'', '\''), v)
|
||||||
);
|
);
|
||||||
|
|
||||||
return db.QueryDatabase(query).Success();
|
return db.QueryDatabase(query).Success();
|
||||||
@@ -160,7 +103,7 @@ public:
|
|||||||
const auto query = fmt::format(
|
const auto query = fmt::format(
|
||||||
"REPLACE INTO {} (`ruleset_id`, `rule_name`, `rule_value`, `notes`) VALUES {}",
|
"REPLACE INTO {} (`ruleset_id`, `rule_name`, `rule_value`, `notes`) VALUES {}",
|
||||||
TableName(),
|
TableName(),
|
||||||
ImplodePair(
|
Strings::ImplodePair(
|
||||||
",",
|
",",
|
||||||
std::pair<char, char>('(', ')'),
|
std::pair<char, char>('(', ')'),
|
||||||
join_tuple(",", std::pair<char, char>('\'', '\''), v)
|
join_tuple(",", std::pair<char, char>('\'', '\''), v)
|
||||||
|
|||||||
+1
-1
@@ -233,7 +233,7 @@ RULE_BOOL(Character, SneakAlwaysSucceedOver100, false, "When sneak skill is over
|
|||||||
RULE_INT(Character, BandolierSwapDelay, 0, "Bandolier swap delay in milliseconds, default is 0")
|
RULE_INT(Character, BandolierSwapDelay, 0, "Bandolier swap delay in milliseconds, default is 0")
|
||||||
RULE_BOOL(Character, EnableHackedFastCampForGM, false, "Enables hacked fast camp for GM clients, if the GM doesn't have a hacked client they'll camp like normal")
|
RULE_BOOL(Character, EnableHackedFastCampForGM, false, "Enables hacked fast camp for GM clients, if the GM doesn't have a hacked client they'll camp like normal")
|
||||||
RULE_BOOL(Character, AlwaysAllowNameChange, false, "Enable this option to allow /changename to work without enabling a name change via scripts.")
|
RULE_BOOL(Character, AlwaysAllowNameChange, false, "Enable this option to allow /changename to work without enabling a name change via scripts.")
|
||||||
RULE_BOOL(Character, EnableAutoAFK, false, "Enable or disable the auto AFK feature, cuts down on packet spam")
|
RULE_BOOL(Character, EnableAutoAFK, true, "Enable or disable the auto AFK feature, cuts down on packet spam")
|
||||||
RULE_BOOL(Character, AutoIdleFilterPackets, true, "Enable or disable filtering packets when auto AFK is enabled, heavily cuts down on packet spam in zones with lots of players")
|
RULE_BOOL(Character, AutoIdleFilterPackets, true, "Enable or disable filtering packets when auto AFK is enabled, heavily cuts down on packet spam in zones with lots of players")
|
||||||
RULE_INT(Character, SecondsBeforeIdleCombatZone, 600, "Seconds before a player is considered idle in combat zones (600 = 10 minutes)")
|
RULE_INT(Character, SecondsBeforeIdleCombatZone, 600, "Seconds before a player is considered idle in combat zones (600 = 10 minutes)")
|
||||||
RULE_INT(Character, SecondsBeforeIdleNonCombatZone, 60, "Seconds before a player is considered idle in non-combat zones (60 = 1 minute)")
|
RULE_INT(Character, SecondsBeforeIdleNonCombatZone, 60, "Seconds before a player is considered idle in non-combat zones (60 = 1 minute)")
|
||||||
|
|||||||
+1
-3
@@ -273,9 +273,8 @@
|
|||||||
#define ServerOP_WWTaskUpdate 0x4758
|
#define ServerOP_WWTaskUpdate 0x4758
|
||||||
|
|
||||||
// player events
|
// player events
|
||||||
#define ServerOP_QSSendQuery 0x5000
|
#define ServerOP_QSSendQuery 0x5000
|
||||||
#define ServerOP_PlayerEvent 0x5100
|
#define ServerOP_PlayerEvent 0x5100
|
||||||
#define ServerOP_SendPlayerEventSettings 0x5101
|
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
CZUpdateType_Character,
|
CZUpdateType_Character,
|
||||||
@@ -1779,7 +1778,6 @@ struct BazaarPurchaseMessaging_Struct {
|
|||||||
uint32 id;
|
uint32 id;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#pragma pack()
|
#pragma pack()
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+6
-54
@@ -824,7 +824,7 @@ bool SharedDatabase::GetInventory(Client *c)
|
|||||||
e.character_id = char_id;
|
e.character_id = char_id;
|
||||||
e.item_id = item_id;
|
e.item_id = item_id;
|
||||||
e.equipped = inst->GetEvolveEquipped();
|
e.equipped = inst->GetEvolveEquipped();
|
||||||
e.final_item_id = EvolvingItemsManager::Instance()->GetFinalItemID(*inst);
|
e.final_item_id = evolving_items_manager.GetFinalItemID(*inst);
|
||||||
|
|
||||||
auto r = CharacterEvolvingItemsRepository::InsertOne(*this, e);
|
auto r = CharacterEvolvingItemsRepository::InsertOne(*this, e);
|
||||||
e.id = r.id;
|
e.id = r.id;
|
||||||
@@ -974,7 +974,7 @@ bool SharedDatabase::LoadItems(const std::string &prefix) {
|
|||||||
const auto Config = EQEmuConfig::get();
|
const auto Config = EQEmuConfig::get();
|
||||||
EQ::IPCMutex mutex("items");
|
EQ::IPCMutex mutex("items");
|
||||||
mutex.Lock();
|
mutex.Lock();
|
||||||
std::string file_name = fmt::format("{}/{}{}", PathManager::Instance()->GetSharedMemoryPath(), prefix, std::string("items"));
|
std::string file_name = fmt::format("{}/{}{}", path.GetSharedMemoryPath(), prefix, std::string("items"));
|
||||||
items_mmf = std::make_unique<EQ::MemoryMappedFile>(file_name);
|
items_mmf = std::make_unique<EQ::MemoryMappedFile>(file_name);
|
||||||
items_hash = std::make_unique<EQ::FixedMemoryHashSet<EQ::ItemData>>(static_cast<uint8*>(items_mmf->Get()), items_mmf->Size());
|
items_hash = std::make_unique<EQ::FixedMemoryHashSet<EQ::ItemData>>(static_cast<uint8*>(items_mmf->Get()), items_mmf->Size());
|
||||||
mutex.Unlock();
|
mutex.Unlock();
|
||||||
@@ -1544,60 +1544,12 @@ bool SharedDatabase::GetCommandSettings(std::map<std::string, std::pair<uint8, s
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T1, typename T2>
|
|
||||||
inline std::vector<std::string> join_pair(
|
|
||||||
const std::string &glue,
|
|
||||||
const std::pair<char, char> &encapsulation,
|
|
||||||
const std::vector<std::pair<T1, T2>> &src
|
|
||||||
)
|
|
||||||
{
|
|
||||||
if (src.empty()) {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<std::string> output;
|
|
||||||
|
|
||||||
for (const std::pair<T1, T2> &src_iter: src) {
|
|
||||||
output.emplace_back(
|
|
||||||
|
|
||||||
fmt::format(
|
|
||||||
"{}{}{}{}{}{}{}",
|
|
||||||
encapsulation.first,
|
|
||||||
src_iter.first,
|
|
||||||
encapsulation.second,
|
|
||||||
glue,
|
|
||||||
encapsulation.first,
|
|
||||||
src_iter.second,
|
|
||||||
encapsulation.second
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return output;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
inline std::string
|
|
||||||
ImplodePair(const std::string &glue, const std::pair<char, char> &encapsulation, const std::vector<T> &src)
|
|
||||||
{
|
|
||||||
if (src.empty()) {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
std::ostringstream oss;
|
|
||||||
for (const T &src_iter: src) {
|
|
||||||
oss << encapsulation.first << src_iter << encapsulation.second << glue;
|
|
||||||
}
|
|
||||||
std::string output(oss.str());
|
|
||||||
output.resize(output.size() - glue.size());
|
|
||||||
return output;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool SharedDatabase::UpdateInjectedCommandSettings(const std::vector<std::pair<std::string, uint8>> &injected)
|
bool SharedDatabase::UpdateInjectedCommandSettings(const std::vector<std::pair<std::string, uint8>> &injected)
|
||||||
{
|
{
|
||||||
if (injected.size()) {
|
if (injected.size()) {
|
||||||
const std::string query = fmt::format(
|
const std::string query = fmt::format(
|
||||||
"REPLACE INTO `command_settings`(`command`, `access`) VALUES {}",
|
"REPLACE INTO `command_settings`(`command`, `access`) VALUES {}",
|
||||||
ImplodePair(
|
Strings::ImplodePair(
|
||||||
",",
|
",",
|
||||||
std::pair<char, char>('(', ')'),
|
std::pair<char, char>('(', ')'),
|
||||||
join_pair(",", std::pair<char, char>('\'', '\''), injected)
|
join_pair(",", std::pair<char, char>('\'', '\''), injected)
|
||||||
@@ -1624,7 +1576,7 @@ bool SharedDatabase::UpdateOrphanedCommandSettings(const std::vector<std::string
|
|||||||
if (orphaned.size()) {
|
if (orphaned.size()) {
|
||||||
std::string query = fmt::format(
|
std::string query = fmt::format(
|
||||||
"DELETE FROM `command_settings` WHERE `command` IN ({})",
|
"DELETE FROM `command_settings` WHERE `command` IN ({})",
|
||||||
ImplodePair(",", std::pair<char, char>('\'', '\''), orphaned)
|
Strings::ImplodePair(",", std::pair<char, char>('\'', '\''), orphaned)
|
||||||
);
|
);
|
||||||
|
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
@@ -1634,7 +1586,7 @@ bool SharedDatabase::UpdateOrphanedCommandSettings(const std::vector<std::string
|
|||||||
|
|
||||||
query = fmt::format(
|
query = fmt::format(
|
||||||
"DELETE FROM `command_subsettings` WHERE `parent_command` IN ({})",
|
"DELETE FROM `command_subsettings` WHERE `parent_command` IN ({})",
|
||||||
ImplodePair(",", std::pair<char, char>('\'', '\''), orphaned)
|
Strings::ImplodePair(",", std::pair<char, char>('\'', '\''), orphaned)
|
||||||
);
|
);
|
||||||
|
|
||||||
auto results_two = QueryDatabase(query);
|
auto results_two = QueryDatabase(query);
|
||||||
@@ -1713,7 +1665,7 @@ bool SharedDatabase::LoadSpells(const std::string &prefix, int32 *records, const
|
|||||||
EQ::IPCMutex mutex("spells");
|
EQ::IPCMutex mutex("spells");
|
||||||
mutex.Lock();
|
mutex.Lock();
|
||||||
|
|
||||||
std::string file_name = fmt::format("{}/{}{}", PathManager::Instance()->GetSharedMemoryPath(), prefix, std::string("spells"));
|
std::string file_name = fmt::format("{}/{}{}", path.GetSharedMemoryPath(), prefix, std::string("spells"));
|
||||||
spells_mmf = std::make_unique<EQ::MemoryMappedFile>(file_name);
|
spells_mmf = std::make_unique<EQ::MemoryMappedFile>(file_name);
|
||||||
LogInfo("Loading [{}]", file_name);
|
LogInfo("Loading [{}]", file_name);
|
||||||
*records = *static_cast<uint32*>(spells_mmf->Get());
|
*records = *static_cast<uint32*>(spells_mmf->Get());
|
||||||
|
|||||||
+2
-6
@@ -16,16 +16,12 @@ public:
|
|||||||
static int32_t GetSkillCapMaxLevel(uint8 class_id, EQ::skills::SkillType skill_id);
|
static int32_t GetSkillCapMaxLevel(uint8 class_id, EQ::skills::SkillType skill_id);
|
||||||
|
|
||||||
SkillCaps *SetContentDatabase(Database *db);
|
SkillCaps *SetContentDatabase(Database *db);
|
||||||
|
|
||||||
static SkillCaps* Instance()
|
|
||||||
{
|
|
||||||
static SkillCaps instance;
|
|
||||||
return &instance;
|
|
||||||
}
|
|
||||||
private:
|
private:
|
||||||
Database *m_content_database{};
|
Database *m_content_database{};
|
||||||
std::map<uint64, SkillCapsRepository::SkillCaps> m_skill_caps = {};
|
std::map<uint64, SkillCapsRepository::SkillCaps> m_skill_caps = {};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extern SkillCaps skill_caps;
|
||||||
|
|
||||||
|
|
||||||
#endif //CODE_SKILL_CAPS_H
|
#endif //CODE_SKILL_CAPS_H
|
||||||
|
|||||||
@@ -358,7 +358,6 @@ bool RequiresStackCheck(uint16 spell_type) {
|
|||||||
case BotSpellTypes::CompleteHeal:
|
case BotSpellTypes::CompleteHeal:
|
||||||
case BotSpellTypes::PetCompleteHeals:
|
case BotSpellTypes::PetCompleteHeals:
|
||||||
case BotSpellTypes::GroupCompleteHeals:
|
case BotSpellTypes::GroupCompleteHeals:
|
||||||
case BotSpellTypes::Resurrect:
|
|
||||||
return false;
|
return false;
|
||||||
default:
|
default:
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -34,7 +34,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "strings.h"
|
#include "strings.h"
|
||||||
#include <cereal/external/rapidjson/document.h>
|
|
||||||
#include <fmt/format.h>
|
#include <fmt/format.h>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
@@ -42,7 +41,6 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
|
||||||
|
|
||||||
#include <random>
|
#include <random>
|
||||||
#include <string>
|
#include <string>
|
||||||
@@ -51,12 +49,6 @@
|
|||||||
#include "strings_legacy.cpp" // legacy c functions
|
#include "strings_legacy.cpp" // legacy c functions
|
||||||
#include "strings_misc.cpp" // anything non "Strings" scoped
|
#include "strings_misc.cpp" // anything non "Strings" scoped
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
|
||||||
#include <ctype.h>
|
|
||||||
#include <functional>
|
|
||||||
#include <algorithm>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
std::string Strings::Random(size_t length)
|
std::string Strings::Random(size_t length)
|
||||||
{
|
{
|
||||||
static auto &chrs = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
static auto &chrs = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||||
@@ -709,18 +701,6 @@ std::string &Strings::Trim(std::string &str, const std::string &chars)
|
|||||||
return LTrim(RTrim(str, chars), chars);
|
return LTrim(RTrim(str, chars), chars);
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string NUM_TO_ENGLISH_X[] = {
|
|
||||||
"", "One ", "Two ", "Three ", "Four ",
|
|
||||||
"Five ", "Six ", "Seven ", "Eight ", "Nine ", "Ten ", "Eleven ",
|
|
||||||
"Twelve ", "Thirteen ", "Fourteen ", "Fifteen ",
|
|
||||||
"Sixteen ", "Seventeen ", "Eighteen ", "Nineteen "
|
|
||||||
};
|
|
||||||
|
|
||||||
const std::string NUM_TO_ENGLISH_Y[] = {
|
|
||||||
"", "", "Twenty ", "Thirty ", "Forty ",
|
|
||||||
"Fifty ", "Sixty ", "Seventy ", "Eighty ", "Ninety "
|
|
||||||
};
|
|
||||||
|
|
||||||
// Function to convert single digit or two digit number into words
|
// Function to convert single digit or two digit number into words
|
||||||
std::string Strings::ConvertToDigit(int n, const std::string& suffix)
|
std::string Strings::ConvertToDigit(int n, const std::string& suffix)
|
||||||
{
|
{
|
||||||
|
|||||||
+193
-3
@@ -36,19 +36,53 @@
|
|||||||
#define _STRINGUTIL_H_
|
#define _STRINGUTIL_H_
|
||||||
|
|
||||||
#include <charconv>
|
#include <charconv>
|
||||||
#include <cstring>
|
#include <sstream>
|
||||||
|
#include <string.h>
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <cstdarg>
|
#include <cstdarg>
|
||||||
|
#include <tuple>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
#ifdef _WIN32
|
#include <fmt/format.h>
|
||||||
|
#include <cereal/external/rapidjson/document.h>
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
|
// this doesn't appear to affect linux-based systems..need feedback for _WIN64
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef _WINDOWS
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
#include <functional>
|
||||||
|
#include <algorithm>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
|
namespace detail {
|
||||||
|
// template magic to check if std::from_chars floating point functions exist
|
||||||
|
template <typename T, typename = void>
|
||||||
|
struct has_from_chars_float : std::false_type { };
|
||||||
|
|
||||||
|
// basically it "uses" this template if they do exist because reasons
|
||||||
|
template <typename T>
|
||||||
|
struct has_from_chars_float < T,
|
||||||
|
std::void_t<decltype(std::from_chars(std::declval<const char *>(), std::declval<const char *>(),
|
||||||
|
std::declval<T &>()))>> : std::true_type { };
|
||||||
|
}; // namespace detail
|
||||||
|
|
||||||
|
namespace EQ {
|
||||||
|
// lame -- older GCC's didn't define this, clang's libc++ however does, even though they lack FP support
|
||||||
|
#if defined(__GNUC__) && (__GNUC__ < 11) && !defined(__clang__)
|
||||||
|
enum class chars_format {
|
||||||
|
scientific = 1, fixed = 2, hex = 4, general = fixed | scientific
|
||||||
|
};
|
||||||
|
#else
|
||||||
|
using chars_format = std::chars_format;
|
||||||
|
#endif
|
||||||
|
}; // namespace EQ
|
||||||
|
|
||||||
class Strings {
|
class Strings {
|
||||||
public:
|
public:
|
||||||
static bool Contains(std::vector<std::string> container, const std::string& element);
|
static bool Contains(std::vector<std::string> container, const std::string& element);
|
||||||
@@ -99,6 +133,61 @@ public:
|
|||||||
static bool BeginsWith(const std::string& subject, const std::string& search);
|
static bool BeginsWith(const std::string& subject, const std::string& search);
|
||||||
static bool EndsWith(const std::string& subject, const std::string& search);
|
static bool EndsWith(const std::string& subject, const std::string& search);
|
||||||
static std::string ZoneTime(const uint8 hours, const uint8 minutes);
|
static std::string ZoneTime(const uint8 hours, const uint8 minutes);
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
static std::string
|
||||||
|
ImplodePair(const std::string &glue, const std::pair<char, char> &encapsulation, const std::vector<T> &src)
|
||||||
|
{
|
||||||
|
if (src.empty()) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
std::ostringstream oss;
|
||||||
|
for (const T &src_iter: src) {
|
||||||
|
oss << encapsulation.first << src_iter << encapsulation.second << glue;
|
||||||
|
}
|
||||||
|
std::string output(oss.str());
|
||||||
|
output.resize(output.size() - glue.size());
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
|
||||||
|
// basic string_view overloads that just use std stuff since they work!
|
||||||
|
template <typename T>
|
||||||
|
std::enable_if_t<std::is_floating_point_v<T> && detail::has_from_chars_float<T>::value, std::from_chars_result>
|
||||||
|
static from_chars(std::string_view str, T& value, EQ::chars_format fmt = EQ::chars_format::general)
|
||||||
|
{
|
||||||
|
return std::from_chars(str.data(), str.data() + str.size(), value, fmt);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
std::enable_if_t<std::is_integral_v<T>, std::from_chars_result>
|
||||||
|
static from_chars(std::string_view str, T& value, int base = 10)
|
||||||
|
{
|
||||||
|
return std::from_chars(str.data(), str.data() + str.size(), value, base);
|
||||||
|
}
|
||||||
|
|
||||||
|
// fallback versions of floating point in case they're not implemented
|
||||||
|
// TODO: add error handling ...
|
||||||
|
// This does have to allocate since from_chars doesn't need a null terminated string and neither does string_view
|
||||||
|
template <typename T>
|
||||||
|
std::enable_if_t<std::is_floating_point_v<T> && !detail::has_from_chars_float<T>::value && std::is_same_v<T, float>, std::from_chars_result>
|
||||||
|
static from_chars(std::string_view str, T& value, EQ::chars_format fmt = EQ::chars_format::general)
|
||||||
|
{
|
||||||
|
std::from_chars_result res{};
|
||||||
|
std::string tmp_str(str.data(), str.size());
|
||||||
|
value = strtof(tmp_str.data(), nullptr);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
std::enable_if_t<std::is_floating_point_v<T> && !detail::has_from_chars_float<T>::value && std::is_same_v<T, double>, std::from_chars_result>
|
||||||
|
static from_chars(std::string_view str, T& value, EQ::chars_format fmt = EQ::chars_format::general)
|
||||||
|
{
|
||||||
|
std::from_chars_result res{};
|
||||||
|
std::string tmp_str(str.data(), str.size());
|
||||||
|
value = strtod(tmp_str.data(), nullptr);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
static std::string Slugify(const std::string &input, const std::string &separator = "-");
|
static std::string Slugify(const std::string &input, const std::string &separator = "-");
|
||||||
static bool IsValidJson(const std::string& json);
|
static bool IsValidJson(const std::string& json);
|
||||||
};
|
};
|
||||||
@@ -110,6 +199,93 @@ const std::string vStringFormat(const char *format, va_list args);
|
|||||||
// Used for grid nodes, as NPC names remove numerals.
|
// Used for grid nodes, as NPC names remove numerals.
|
||||||
// But general purpose
|
// But general purpose
|
||||||
|
|
||||||
|
const std::string NUM_TO_ENGLISH_X[] = {
|
||||||
|
"", "One ", "Two ", "Three ", "Four ",
|
||||||
|
"Five ", "Six ", "Seven ", "Eight ", "Nine ", "Ten ", "Eleven ",
|
||||||
|
"Twelve ", "Thirteen ", "Fourteen ", "Fifteen ",
|
||||||
|
"Sixteen ", "Seventeen ", "Eighteen ", "Nineteen "
|
||||||
|
};
|
||||||
|
|
||||||
|
const std::string NUM_TO_ENGLISH_Y[] = {
|
||||||
|
"", "", "Twenty ", "Thirty ", "Forty ",
|
||||||
|
"Fifty ", "Sixty ", "Seventy ", "Eighty ", "Ninety "
|
||||||
|
};
|
||||||
|
|
||||||
|
// _WIN32 builds require that #include<fmt/format.h> be included in whatever code file the invocation is made from (no header files)
|
||||||
|
template<typename T1, typename T2>
|
||||||
|
std::vector<std::string> join_pair(
|
||||||
|
const std::string &glue,
|
||||||
|
const std::pair<char, char> &encapsulation,
|
||||||
|
const std::vector<std::pair<T1, T2>> &src
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (src.empty()) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<std::string> output;
|
||||||
|
|
||||||
|
for (const std::pair<T1, T2> &src_iter: src) {
|
||||||
|
output.emplace_back(
|
||||||
|
|
||||||
|
fmt::format(
|
||||||
|
"{}{}{}{}{}{}{}",
|
||||||
|
encapsulation.first,
|
||||||
|
src_iter.first,
|
||||||
|
encapsulation.second,
|
||||||
|
glue,
|
||||||
|
encapsulation.first,
|
||||||
|
src_iter.second,
|
||||||
|
encapsulation.second
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
|
||||||
|
// _WIN32 builds require that #include<fmt/format.h> be included in whatever code file the invocation is made from (no header files)
|
||||||
|
template<typename T1, typename T2, typename T3, typename T4>
|
||||||
|
std::vector<std::string> join_tuple(
|
||||||
|
const std::string &glue,
|
||||||
|
const std::pair<char, char> &encapsulation,
|
||||||
|
const std::vector<std::tuple<T1, T2, T3, T4>> &src
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (src.empty()) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<std::string> output;
|
||||||
|
|
||||||
|
for (const std::tuple<T1, T2, T3, T4> &src_iter: src) {
|
||||||
|
|
||||||
|
output.emplace_back(
|
||||||
|
|
||||||
|
fmt::format(
|
||||||
|
"{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
|
||||||
|
encapsulation.first,
|
||||||
|
std::get<0>(src_iter),
|
||||||
|
encapsulation.second,
|
||||||
|
glue,
|
||||||
|
encapsulation.first,
|
||||||
|
std::get<1>(src_iter),
|
||||||
|
encapsulation.second,
|
||||||
|
glue,
|
||||||
|
encapsulation.first,
|
||||||
|
std::get<2>(src_iter),
|
||||||
|
encapsulation.second,
|
||||||
|
glue,
|
||||||
|
encapsulation.first,
|
||||||
|
std::get<3>(src_iter),
|
||||||
|
encapsulation.second
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
|
||||||
// misc functions
|
// misc functions
|
||||||
std::string SanitizeWorldServerName(std::string server_long_name);
|
std::string SanitizeWorldServerName(std::string server_long_name);
|
||||||
std::vector<std::string> GetBadWords();
|
std::vector<std::string> GetBadWords();
|
||||||
@@ -134,4 +310,18 @@ std::string FormatName(const std::string &char_name);
|
|||||||
bool IsAllowedWorldServerCharacterList(char c);
|
bool IsAllowedWorldServerCharacterList(char c);
|
||||||
void SanitizeWorldServerName(char *name);
|
void SanitizeWorldServerName(char *name);
|
||||||
|
|
||||||
|
template<typename InputIterator, typename OutputIterator>
|
||||||
|
auto CleanMobName(InputIterator first, InputIterator last, OutputIterator result)
|
||||||
|
{
|
||||||
|
for (; first != last; ++first) {
|
||||||
|
if (*first == '_') {
|
||||||
|
*result = ' ';
|
||||||
|
}
|
||||||
|
else if (isalpha(*first) || *first == '`') {
|
||||||
|
*result = *first;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+2
-2
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
// Build variables
|
// Build variables
|
||||||
// these get injected during the build pipeline
|
// these get injected during the build pipeline
|
||||||
#define CURRENT_VERSION "23.9.1-dev" // always append -dev to the current version for custom-builds
|
#define CURRENT_VERSION "23.7.0-dev" // always append -dev to the current version for custom-builds
|
||||||
#define LOGIN_VERSION "0.8.0"
|
#define LOGIN_VERSION "0.8.0"
|
||||||
#define COMPILE_DATE __DATE__
|
#define COMPILE_DATE __DATE__
|
||||||
#define COMPILE_TIME __TIME__
|
#define COMPILE_TIME __TIME__
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
* Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt
|
* Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define CURRENT_BINARY_DATABASE_VERSION 9326
|
#define CURRENT_BINARY_DATABASE_VERSION 9323
|
||||||
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9054
|
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9054
|
||||||
#define CUSTOM_BINARY_DATABASE_VERSION 0
|
#define CUSTOM_BINARY_DATABASE_VERSION 0
|
||||||
|
|
||||||
|
|||||||
+10
-13
@@ -104,39 +104,36 @@ public:
|
|||||||
uint8 GetZoneIdleWhenEmpty(uint32 zone_id, int version = 0);
|
uint8 GetZoneIdleWhenEmpty(uint32 zone_id, int version = 0);
|
||||||
uint32 GetZoneSecondsBeforeIdle(uint32 zone_id, int version = 0);
|
uint32 GetZoneSecondsBeforeIdle(uint32 zone_id, int version = 0);
|
||||||
|
|
||||||
static ZoneStore* Instance()
|
|
||||||
{
|
|
||||||
static ZoneStore instance;
|
|
||||||
return &instance;
|
|
||||||
}
|
|
||||||
private:
|
private:
|
||||||
std::vector<ZoneRepository::Zone> m_zones;
|
std::vector<ZoneRepository::Zone> m_zones;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extern ZoneStore zone_store;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Global helpers
|
* Global helpers
|
||||||
*/
|
*/
|
||||||
inline uint32 ZoneID(const char *in_zone_name) { return ZoneStore::Instance()->GetZoneID(in_zone_name); }
|
inline uint32 ZoneID(const char *in_zone_name) { return zone_store.GetZoneID(in_zone_name); }
|
||||||
inline uint32 ZoneID(const std::string& zone_name) { return ZoneStore::Instance()->GetZoneID(zone_name); }
|
inline uint32 ZoneID(const std::string& zone_name) { return zone_store.GetZoneID(zone_name); }
|
||||||
inline const char *ZoneName(uint32 zone_id, bool error_unknown = false)
|
inline const char *ZoneName(uint32 zone_id, bool error_unknown = false)
|
||||||
{
|
{
|
||||||
return ZoneStore::Instance()->GetZoneName(
|
return zone_store.GetZoneName(
|
||||||
zone_id,
|
zone_id,
|
||||||
error_unknown
|
error_unknown
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
inline const char *ZoneLongName(uint32 zone_id, bool error_unknown = false)
|
inline const char *ZoneLongName(uint32 zone_id, bool error_unknown = false)
|
||||||
{
|
{
|
||||||
return ZoneStore::Instance()->GetZoneLongName(
|
return zone_store.GetZoneLongName(
|
||||||
zone_id,
|
zone_id,
|
||||||
error_unknown
|
error_unknown
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
inline ZoneRepository::Zone *GetZone(uint32 zone_id, int version = 0) { return ZoneStore::Instance()->GetZone(zone_id, version); };
|
inline ZoneRepository::Zone *GetZone(uint32 zone_id, int version = 0) { return zone_store.GetZone(zone_id, version); };
|
||||||
inline ZoneRepository::Zone *GetZone(const char *in_zone_name) { return ZoneStore::Instance()->GetZone(in_zone_name); };
|
inline ZoneRepository::Zone *GetZone(const char *in_zone_name) { return zone_store.GetZone(in_zone_name); };
|
||||||
inline ZoneRepository::Zone *GetZone(const char *in_zone_name, int version = 0)
|
inline ZoneRepository::Zone *GetZone(const char *in_zone_name, int version = 0)
|
||||||
{
|
{
|
||||||
return ZoneStore::Instance()->GetZone(
|
return zone_store.GetZone(
|
||||||
ZoneID(
|
ZoneID(
|
||||||
in_zone_name
|
in_zone_name
|
||||||
), version
|
), version
|
||||||
@@ -144,7 +141,7 @@ inline ZoneRepository::Zone *GetZone(const char *in_zone_name, int version = 0)
|
|||||||
};
|
};
|
||||||
inline ZoneRepository::Zone *GetZoneVersionWithFallback(uint32 zone_id, int version = 0)
|
inline ZoneRepository::Zone *GetZoneVersionWithFallback(uint32 zone_id, int version = 0)
|
||||||
{
|
{
|
||||||
return ZoneStore::Instance()->GetZoneWithFallback(
|
return zone_store.GetZoneWithFallback(
|
||||||
zone_id,
|
zone_id,
|
||||||
version
|
version
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -33,16 +33,19 @@
|
|||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
|
EQEmuLogSys LogSys;
|
||||||
|
PathManager path;
|
||||||
|
|
||||||
bool RunLoops = false;
|
bool RunLoops = false;
|
||||||
|
|
||||||
void CatchSignal(int sig_num);
|
void CatchSignal(int sig_num);
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
RegisterExecutablePlatform(ExePlatformLaunch);
|
RegisterExecutablePlatform(ExePlatformLaunch);
|
||||||
EQEmuLogSys::Instance()->LoadLogSettingsDefaults();
|
LogSys.LoadLogSettingsDefaults();
|
||||||
set_exception_handler();
|
set_exception_handler();
|
||||||
|
|
||||||
PathManager::Instance()->Init();
|
path.LoadPaths();
|
||||||
|
|
||||||
std::string launcher_name;
|
std::string launcher_name;
|
||||||
if(argc == 2) {
|
if(argc == 2) {
|
||||||
@@ -166,7 +169,7 @@ int main(int argc, char *argv[]) {
|
|||||||
delete zone->second;
|
delete zone->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmuLogSys::Instance()->CloseFileLogs();
|
LogSys.CloseFileLogs();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ bool Client::Process()
|
|||||||
OpcodeManager::EmuToName(app->GetOpcode()),
|
OpcodeManager::EmuToName(app->GetOpcode()),
|
||||||
o->EmuToEQ(app->GetOpcode()) == 0 ? app->GetProtocolOpcode() : o->EmuToEQ(app->GetOpcode()),
|
o->EmuToEQ(app->GetOpcode()) == 0 ? app->GetProtocolOpcode() : o->EmuToEQ(app->GetOpcode()),
|
||||||
app->Size(),
|
app->Size(),
|
||||||
(EQEmuLogSys::Instance()->IsLogEnabled(Logs::Detail, Logs::PacketClientServer) ? DumpPacketToString(app) : "")
|
(LogSys.IsLogEnabled(Logs::Detail, Logs::PacketClientServer) ? DumpPacketToString(app) : "")
|
||||||
);
|
);
|
||||||
|
|
||||||
if (m_client_status == cs_failed_to_login) {
|
if (m_client_status == cs_failed_to_login) {
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ ClientManager::ClientManager()
|
|||||||
|
|
||||||
std::string opcodes_path = fmt::format(
|
std::string opcodes_path = fmt::format(
|
||||||
"{}/{}",
|
"{}/{}",
|
||||||
PathManager::Instance()->GetOpcodePath(),
|
path.GetOpcodePath(),
|
||||||
"login_opcodes.conf"
|
"login_opcodes.conf"
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -131,7 +131,7 @@ ClientManager::ClientManager()
|
|||||||
|
|
||||||
opcodes_path = fmt::format(
|
opcodes_path = fmt::format(
|
||||||
"{}/{}",
|
"{}/{}",
|
||||||
PathManager::Instance()->GetOpcodePath(),
|
path.GetOpcodePath(),
|
||||||
"login_opcodes_sod.conf"
|
"login_opcodes_sod.conf"
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -169,7 +169,7 @@ ClientManager::ClientManager()
|
|||||||
|
|
||||||
opcodes_path = fmt::format(
|
opcodes_path = fmt::format(
|
||||||
"{}/{}",
|
"{}/{}",
|
||||||
PathManager::Instance()->GetOpcodePath(),
|
path.GetOpcodePath(),
|
||||||
"login_opcodes_larion.conf"
|
"login_opcodes_larion.conf"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
+12
-8
@@ -22,8 +22,12 @@
|
|||||||
#include <thread>
|
#include <thread>
|
||||||
|
|
||||||
LoginServer server;
|
LoginServer server;
|
||||||
|
EQEmuLogSys LogSys;
|
||||||
bool run_server = true;
|
bool run_server = true;
|
||||||
|
PathManager path;
|
||||||
Database database;
|
Database database;
|
||||||
|
PlayerEventLogs player_event_logs;
|
||||||
|
ZoneStore zone_store;
|
||||||
|
|
||||||
void CatchSignal(int sig_num)
|
void CatchSignal(int sig_num)
|
||||||
{
|
{
|
||||||
@@ -48,7 +52,7 @@ void LoadDatabaseConnection()
|
|||||||
void LoadServerConfig()
|
void LoadServerConfig()
|
||||||
{
|
{
|
||||||
server.config = EQ::JsonConfigFile::Load(
|
server.config = EQ::JsonConfigFile::Load(
|
||||||
fmt::format("{}/login.json", PathManager::Instance()->GetServerPath())
|
fmt::format("{}/login.json", path.GetServerPath())
|
||||||
);
|
);
|
||||||
LogInfo("Config System Init");
|
LogInfo("Config System Init");
|
||||||
|
|
||||||
@@ -155,21 +159,21 @@ int main(int argc, char **argv)
|
|||||||
LogInfo("Logging System Init");
|
LogInfo("Logging System Init");
|
||||||
|
|
||||||
if (argc == 1) {
|
if (argc == 1) {
|
||||||
EQEmuLogSys::Instance()->LoadLogSettingsDefaults();
|
LogSys.LoadLogSettingsDefaults();
|
||||||
}
|
}
|
||||||
|
|
||||||
PathManager::Instance()->Init();
|
path.LoadPaths();
|
||||||
|
|
||||||
// command handler
|
// command handler
|
||||||
if (argc > 1) {
|
if (argc > 1) {
|
||||||
EQEmuLogSys::Instance()->SilenceConsoleLogging();
|
LogSys.SilenceConsoleLogging();
|
||||||
|
|
||||||
LoadServerConfig();
|
LoadServerConfig();
|
||||||
LoadDatabaseConnection();
|
LoadDatabaseConnection();
|
||||||
|
|
||||||
EQEmuLogSys::Instance()->LoadLogSettingsDefaults();
|
LogSys.LoadLogSettingsDefaults();
|
||||||
EQEmuLogSys::Instance()->log_settings[Logs::Debug].log_to_console = static_cast<uint8>(Logs::General);
|
LogSys.log_settings[Logs::Debug].log_to_console = static_cast<uint8>(Logs::General);
|
||||||
EQEmuLogSys::Instance()->log_settings[Logs::Debug].is_category_enabled = 1;
|
LogSys.log_settings[Logs::Debug].is_category_enabled = 1;
|
||||||
|
|
||||||
LoginserverCommandHandler::CommandHandler(argc, argv);
|
LoginserverCommandHandler::CommandHandler(argc, argv);
|
||||||
}
|
}
|
||||||
@@ -178,7 +182,7 @@ int main(int argc, char **argv)
|
|||||||
LoadDatabaseConnection();
|
LoadDatabaseConnection();
|
||||||
|
|
||||||
if (argc == 1) {
|
if (argc == 1) {
|
||||||
EQEmuLogSys::Instance()->SetDatabase(&database)
|
LogSys.SetDatabase(&database)
|
||||||
->SetLogPath("logs")
|
->SetLogPath("logs")
|
||||||
->LoadLogDatabaseSettings()
|
->LoadLogDatabaseSettings()
|
||||||
->StartFileLogs();
|
->StartFileLogs();
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ public:
|
|||||||
inline void DefaultLoginServerName(const std::string &v) { m_default_loginserver_name = v; }
|
inline void DefaultLoginServerName(const std::string &v) { m_default_loginserver_name = v; }
|
||||||
inline std::string GetDefaultLoginServerName() const { return m_default_loginserver_name; }
|
inline std::string GetDefaultLoginServerName() const { return m_default_loginserver_name; }
|
||||||
inline bool IsShowPlayerCountEnabled() const { return m_show_player_count; }
|
inline bool IsShowPlayerCountEnabled() const { return m_show_player_count; }
|
||||||
inline void SetShowPlayerCount(bool show_player_count) { m_show_player_count = show_player_count; }
|
inline void SetShowPlayerCount(bool show_player_count) { show_player_count = show_player_count; }
|
||||||
inline bool IsWorldDevTestServersListBottom() const { return m_world_dev_list_bottom; }
|
inline bool IsWorldDevTestServersListBottom() const { return m_world_dev_list_bottom; }
|
||||||
inline void SetWorldDevTestServersListBottom(bool list_bottom) { m_world_dev_list_bottom = list_bottom; }
|
inline void SetWorldDevTestServersListBottom(bool list_bottom) { m_world_dev_list_bottom = list_bottom; }
|
||||||
inline bool IsWorldSpecialCharacterStartListBottom() const { return m_special_char_list_bottom; }
|
inline bool IsWorldSpecialCharacterStartListBottom() const { return m_special_char_list_bottom; }
|
||||||
|
|||||||
@@ -155,11 +155,7 @@ void WorldServer::ProcessUserToWorldResponseLegacy(uint16_t opcode, const EQ::Ne
|
|||||||
auto *res = (UsertoWorldResponseLegacy *) packet.Data();
|
auto *res = (UsertoWorldResponseLegacy *) packet.Data();
|
||||||
|
|
||||||
LogDebug("Trying to find client with user id of [{}]", res->lsaccountid);
|
LogDebug("Trying to find client with user id of [{}]", res->lsaccountid);
|
||||||
std::string db_loginserver = "local";
|
Client *c = server.client_manager->GetClient(res->lsaccountid, "eqemu");
|
||||||
if (std::getenv("LSPX")) {
|
|
||||||
db_loginserver = "eqemu";
|
|
||||||
}
|
|
||||||
Client *c = server.client_manager->GetClient(res->lsaccountid, db_loginserver);
|
|
||||||
if (c) {
|
if (c) {
|
||||||
LogDebug(
|
LogDebug(
|
||||||
"Found client with user id of [{}] and account name of [{}]",
|
"Found client with user id of [{}] and account name of [{}]",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "eqemu-server",
|
"name": "eqemu-server",
|
||||||
"version": "23.9.1",
|
"version": "23.7.0",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/EQEmu/Server.git"
|
"url": "https://github.com/EQEmu/Server.git"
|
||||||
|
|||||||
@@ -44,12 +44,6 @@ public:
|
|||||||
bool LoadDatabase();
|
bool LoadDatabase();
|
||||||
void HandlePacket(ServerPacket *pack);
|
void HandlePacket(ServerPacket *pack);
|
||||||
void ExpireEntries();
|
void ExpireEntries();
|
||||||
|
|
||||||
static LFGuildManager* Instance()
|
|
||||||
{
|
|
||||||
static LFGuildManager instance;
|
|
||||||
return &instance;
|
|
||||||
}
|
|
||||||
private:
|
private:
|
||||||
void SendPlayerMatches(uint32 FromZoneID, uint32 FromInstanceID, char *From, uint32 FromLevel, uint32 ToLevel, uint32 MinAA, uint32 TimeZone, uint32 Classes);
|
void SendPlayerMatches(uint32 FromZoneID, uint32 FromInstanceID, char *From, uint32 FromLevel, uint32 ToLevel, uint32 MinAA, uint32 TimeZone, uint32 Classes);
|
||||||
void SendGuildMatches(uint32 FromZoneID, uint32 FromInstanceID, char *From, uint32 Level, uint32 AAPoints, uint32 TimeZone, uint32 Class);
|
void SendGuildMatches(uint32 FromZoneID, uint32 FromInstanceID, char *From, uint32 Level, uint32 AAPoints, uint32 TimeZone, uint32 Class);
|
||||||
|
|||||||
+19
-11
@@ -20,15 +20,23 @@
|
|||||||
#include "../common/net/console_server.h"
|
#include "../common/net/console_server.h"
|
||||||
#include "../queryserv/zonelist.h"
|
#include "../queryserv/zonelist.h"
|
||||||
#include "../queryserv/zoneserver.h"
|
#include "../queryserv/zoneserver.h"
|
||||||
|
#include "../common/discord/discord_manager.h"
|
||||||
|
|
||||||
volatile bool RunLoops = true;
|
volatile bool RunLoops = true;
|
||||||
|
|
||||||
QSDatabase qs_database;
|
QSDatabase qs_database;
|
||||||
Database database;
|
Database database;
|
||||||
|
LFGuildManager lfguildmanager;
|
||||||
std::string WorldShortName;
|
std::string WorldShortName;
|
||||||
const queryservconfig *Config;
|
const queryservconfig *Config;
|
||||||
WorldServer *worldserver = 0;
|
WorldServer *worldserver = 0;
|
||||||
|
EQEmuLogSys LogSys;
|
||||||
|
PathManager path;
|
||||||
|
ZoneStore zone_store;
|
||||||
|
PlayerEventLogs player_event_logs;
|
||||||
|
ZSList zs_list;
|
||||||
uint32 numzones = 0;
|
uint32 numzones = 0;
|
||||||
|
DiscordManager discord_manager;
|
||||||
|
|
||||||
void CatchSignal(int sig_num)
|
void CatchSignal(int sig_num)
|
||||||
{
|
{
|
||||||
@@ -38,11 +46,11 @@ void CatchSignal(int sig_num)
|
|||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
RegisterExecutablePlatform(ExePlatformQueryServ);
|
RegisterExecutablePlatform(ExePlatformQueryServ);
|
||||||
EQEmuLogSys::Instance()->LoadLogSettingsDefaults();
|
LogSys.LoadLogSettingsDefaults();
|
||||||
set_exception_handler();
|
set_exception_handler();
|
||||||
Timer LFGuildExpireTimer(60000);
|
Timer LFGuildExpireTimer(60000);
|
||||||
|
|
||||||
PathManager::Instance()->Init();
|
path.LoadPaths();
|
||||||
|
|
||||||
LogInfo("Starting EQEmu QueryServ");
|
LogInfo("Starting EQEmu QueryServ");
|
||||||
if (!queryservconfig::LoadConfig()) {
|
if (!queryservconfig::LoadConfig()) {
|
||||||
@@ -77,8 +85,8 @@ int main()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmuLogSys::Instance()->SetDatabase(&database)
|
LogSys.SetDatabase(&database)
|
||||||
->SetLogPath(PathManager::Instance()->GetLogPath())
|
->SetLogPath(path.GetLogPath())
|
||||||
->LoadLogDatabaseSettings()
|
->LoadLogDatabaseSettings()
|
||||||
->StartFileLogs();
|
->StartFileLogs();
|
||||||
|
|
||||||
@@ -121,7 +129,7 @@ int main()
|
|||||||
server_connection->OnConnectionIdentified(
|
server_connection->OnConnectionIdentified(
|
||||||
"Zone", [&console](std::shared_ptr<EQ::Net::ServertalkServerConnection> connection) {
|
"Zone", [&console](std::shared_ptr<EQ::Net::ServertalkServerConnection> connection) {
|
||||||
numzones++;
|
numzones++;
|
||||||
ZSList::Instance()->Add(new ZoneServer(connection, console.get()));
|
zs_list.Add(new ZoneServer(connection, console.get()));
|
||||||
|
|
||||||
LogInfo(
|
LogInfo(
|
||||||
"New Zone Server connection from [{}] at [{}:{}] zone_count [{}]",
|
"New Zone Server connection from [{}] at [{}:{}] zone_count [{}]",
|
||||||
@@ -136,7 +144,7 @@ int main()
|
|||||||
server_connection->OnConnectionRemoved(
|
server_connection->OnConnectionRemoved(
|
||||||
"Zone", [](std::shared_ptr<EQ::Net::ServertalkServerConnection> connection) {
|
"Zone", [](std::shared_ptr<EQ::Net::ServertalkServerConnection> connection) {
|
||||||
numzones--;
|
numzones--;
|
||||||
ZSList::Instance()->Remove(connection->GetUUID());
|
zs_list.Remove(connection->GetUUID());
|
||||||
|
|
||||||
LogInfo(
|
LogInfo(
|
||||||
"Removed Zone Server connection from [{}] total zone_count [{}]",
|
"Removed Zone Server connection from [{}] total zone_count [{}]",
|
||||||
@@ -151,10 +159,10 @@ int main()
|
|||||||
worldserver->Connect();
|
worldserver->Connect();
|
||||||
|
|
||||||
/* Load Looking For Guild Manager */
|
/* Load Looking For Guild Manager */
|
||||||
LFGuildManager::Instance()->LoadDatabase();
|
lfguildmanager.LoadDatabase();
|
||||||
|
|
||||||
Timer player_event_process_timer(1000);
|
Timer player_event_process_timer(1000);
|
||||||
PlayerEventLogs::Instance()->SetDatabase(&qs_database)->Init();
|
player_event_logs.SetDatabase(&qs_database)->Init();
|
||||||
|
|
||||||
auto loop_fn = [&](EQ::Timer *t) {
|
auto loop_fn = [&](EQ::Timer *t) {
|
||||||
Timer::SetCurrentTime();
|
Timer::SetCurrentTime();
|
||||||
@@ -165,11 +173,11 @@ int main()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (LFGuildExpireTimer.Check()) {
|
if (LFGuildExpireTimer.Check()) {
|
||||||
LFGuildManager::Instance()->ExpireEntries();
|
lfguildmanager.ExpireEntries();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player_event_process_timer.Check()) {
|
if (player_event_process_timer.Check()) {
|
||||||
PlayerEventLogs::Instance()->Process();
|
player_event_logs.Process();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -179,7 +187,7 @@ int main()
|
|||||||
EQ::EventLoop::Get().Run();
|
EQ::EventLoop::Get().Run();
|
||||||
|
|
||||||
safe_delete(worldserver);
|
safe_delete(worldserver);
|
||||||
EQEmuLogSys::Instance()->CloseFileLogs();
|
LogSys.CloseFileLogs();
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateWindowTitle(char *iNewTitle)
|
void UpdateWindowTitle(char *iNewTitle)
|
||||||
|
|||||||
@@ -21,11 +21,10 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#include "zonelist.h"
|
|
||||||
|
|
||||||
extern WorldServer worldserver;
|
extern WorldServer worldserver;
|
||||||
extern const queryservconfig *Config;
|
extern const queryservconfig *Config;
|
||||||
extern QSDatabase qs_database;
|
extern QSDatabase qs_database;
|
||||||
|
extern LFGuildManager lfguildmanager;
|
||||||
|
|
||||||
WorldServer::WorldServer()
|
WorldServer::WorldServer()
|
||||||
{
|
{
|
||||||
@@ -77,9 +76,8 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
|||||||
case ServerOP_ServerReloadRequest: {
|
case ServerOP_ServerReloadRequest: {
|
||||||
auto o = (ServerReload::Request*) p.Data();
|
auto o = (ServerReload::Request*) p.Data();
|
||||||
if (o->type == ServerReload::Type::Logs) {
|
if (o->type == ServerReload::Type::Logs) {
|
||||||
EQEmuLogSys::Instance()->LoadLogDatabaseSettings();
|
LogSys.LoadLogDatabaseSettings();
|
||||||
PlayerEventLogs::Instance()->ReloadSettings();
|
player_event_logs.ReloadSettings();
|
||||||
ZSList::Instance()->SendPlayerEventLogSettings();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@@ -114,7 +112,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
|||||||
pack.pBuffer = (uchar *) p.Data();
|
pack.pBuffer = (uchar *) p.Data();
|
||||||
pack.opcode = opcode;
|
pack.opcode = opcode;
|
||||||
pack.size = (uint32) p.Length();
|
pack.size = (uint32) p.Length();
|
||||||
LFGuildManager::Instance()->HandlePacket(&pack);
|
lfguildmanager.HandlePacket(&pack);
|
||||||
pack.pBuffer = nullptr;
|
pack.pBuffer = nullptr;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,8 +5,6 @@
|
|||||||
void ZSList::Add(ZoneServer* zoneserver) {
|
void ZSList::Add(ZoneServer* zoneserver) {
|
||||||
zone_server_list.emplace_back(std::unique_ptr<ZoneServer>(zoneserver));
|
zone_server_list.emplace_back(std::unique_ptr<ZoneServer>(zoneserver));
|
||||||
zoneserver->SetIsZoneConnected(true);
|
zoneserver->SetIsZoneConnected(true);
|
||||||
|
|
||||||
zoneserver->SendPlayerEventLogSettings();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ZSList::Remove(const std::string &uuid)
|
void ZSList::Remove(const std::string &uuid)
|
||||||
@@ -20,10 +18,3 @@ void ZSList::Remove(const std::string &uuid)
|
|||||||
iter++;
|
iter++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ZSList::SendPlayerEventLogSettings()
|
|
||||||
{
|
|
||||||
for (auto &zs : zone_server_list) {
|
|
||||||
zs->SendPlayerEventLogSettings();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
+4
-11
@@ -6,22 +6,15 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <list>
|
#include <list>
|
||||||
#include "zoneserver.h"
|
|
||||||
|
|
||||||
class WorldTCPConnection;
|
class WorldTCPConnection;
|
||||||
|
class ZoneServer;
|
||||||
|
|
||||||
class ZSList {
|
class ZSList {
|
||||||
public:
|
public:
|
||||||
std::list<std::unique_ptr<ZoneServer>>& GetZsList() { return zone_server_list; }
|
std::list<std::unique_ptr<ZoneServer>> &GetZsList() { return zone_server_list; }
|
||||||
void Add(ZoneServer* zoneserver);
|
void Add(ZoneServer *zoneserver);
|
||||||
void Remove(const std::string& uuid);
|
void Remove(const std::string &uuid);
|
||||||
void SendPlayerEventLogSettings();
|
|
||||||
|
|
||||||
static ZSList* Instance()
|
|
||||||
{
|
|
||||||
static ZSList instance;
|
|
||||||
return &instance;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::list<std::unique_ptr<ZoneServer>> zone_server_list;
|
std::list<std::unique_ptr<ZoneServer>> zone_server_list;
|
||||||
|
|||||||
@@ -5,6 +5,8 @@
|
|||||||
#include "../common/events/player_event_logs.h"
|
#include "../common/events/player_event_logs.h"
|
||||||
#include "../common/discord/discord_manager.h"
|
#include "../common/discord/discord_manager.h"
|
||||||
|
|
||||||
|
extern DiscordManager discord_manager;
|
||||||
|
|
||||||
ZoneServer::ZoneServer(
|
ZoneServer::ZoneServer(
|
||||||
std::shared_ptr<EQ::Net::ServertalkServerConnection> in_connection,
|
std::shared_ptr<EQ::Net::ServertalkServerConnection> in_connection,
|
||||||
EQ::Net::ConsoleServer *in_console
|
EQ::Net::ConsoleServer *in_console
|
||||||
@@ -33,9 +35,9 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
|||||||
cereal::BinaryInputArchive archive(ss);
|
cereal::BinaryInputArchive archive(ss);
|
||||||
archive(n);
|
archive(n);
|
||||||
|
|
||||||
PlayerEventLogs::Instance()->AddToQueue(n.player_event_log);
|
player_event_logs.AddToQueue(n.player_event_log);
|
||||||
|
|
||||||
DiscordManager::Instance()->QueuePlayerEventMessage(n);
|
discord_manager.QueuePlayerEventMessage(n);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
@@ -44,27 +46,3 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ZoneServer::SendPlayerEventLogSettings()
|
|
||||||
{
|
|
||||||
EQ::Net::DynamicPacket dyn_pack;
|
|
||||||
std::vector<PlayerEventLogSettingsRepository::PlayerEventLogSettings> settings(
|
|
||||||
PlayerEventLogs::Instance()->GetSettings(),
|
|
||||||
PlayerEventLogs::Instance()->GetSettings() + PlayerEvent::EventType::MAX
|
|
||||||
);
|
|
||||||
|
|
||||||
dyn_pack.PutSerialize(0, settings);
|
|
||||||
|
|
||||||
auto packet_size = sizeof(ServerSendPlayerEvent_Struct) + dyn_pack.Length();
|
|
||||||
|
|
||||||
auto pack = std::make_unique<ServerPacket>(
|
|
||||||
ServerOP_SendPlayerEventSettings,
|
|
||||||
static_cast<uint32_t>(packet_size)
|
|
||||||
);
|
|
||||||
|
|
||||||
auto* buf = reinterpret_cast<ServerSendPlayerEvent_Struct*>(pack->pBuffer);
|
|
||||||
buf->cereal_size = static_cast<uint32_t>(dyn_pack.Length());
|
|
||||||
memcpy(buf->cereal_data, dyn_pack.Data(), dyn_pack.Length());
|
|
||||||
|
|
||||||
SendPacket(pack.release());
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -16,12 +16,11 @@ class ZoneServer : public WorldTCPConnection {
|
|||||||
public:
|
public:
|
||||||
ZoneServer(std::shared_ptr<EQ::Net::ServertalkServerConnection> in_connection, EQ::Net::ConsoleServer *in_console);
|
ZoneServer(std::shared_ptr<EQ::Net::ServertalkServerConnection> in_connection, EQ::Net::ConsoleServer *in_console);
|
||||||
~ZoneServer();
|
~ZoneServer();
|
||||||
void SendPacket(ServerPacket *pack) { m_connection->SendPacket(pack); }
|
void SendPacket(ServerPacket *pack) { m_connection->SendPacket(pack); }
|
||||||
void SetIsZoneConnected(bool in) { m_is_zone_connected = in; }
|
void SetIsZoneConnected(bool in) { m_is_zone_connected = in; }
|
||||||
bool GetIsZoneConnected() { return m_is_zone_connected; }
|
bool GetIsZoneConnected() { return m_is_zone_connected; }
|
||||||
void HandleMessage(uint16 opcode, const EQ::Net::Packet &p);
|
void HandleMessage(uint16 opcode, const EQ::Net::Packet &p);
|
||||||
std::string GetUUID() const { return m_connection->GetUUID(); }
|
std::string GetUUID() const { return m_connection->GetUUID(); }
|
||||||
void SendPlayerEventLogSettings();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<EQ::Net::ServertalkServerConnection> m_connection{};
|
std::shared_ptr<EQ::Net::ServertalkServerConnection> m_connection{};
|
||||||
|
|||||||
+16
-9
@@ -35,6 +35,13 @@
|
|||||||
#include "../common/events/player_event_logs.h"
|
#include "../common/events/player_event_logs.h"
|
||||||
#include "../common/evolving_items.h"
|
#include "../common/evolving_items.h"
|
||||||
|
|
||||||
|
EQEmuLogSys LogSys;
|
||||||
|
WorldContentService content_service;
|
||||||
|
ZoneStore zone_store;
|
||||||
|
PathManager path;
|
||||||
|
PlayerEventLogs player_event_logs;
|
||||||
|
EvolvingItemsManager evolving_items_manager;
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WINDOWS
|
||||||
#include <direct.h>
|
#include <direct.h>
|
||||||
#else
|
#else
|
||||||
@@ -74,10 +81,10 @@ inline bool MakeDirectory(const std::string &directory_name)
|
|||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
RegisterExecutablePlatform(ExePlatformSharedMemory);
|
RegisterExecutablePlatform(ExePlatformSharedMemory);
|
||||||
EQEmuLogSys::Instance()->LoadLogSettingsDefaults();
|
LogSys.LoadLogSettingsDefaults();
|
||||||
set_exception_handler();
|
set_exception_handler();
|
||||||
|
|
||||||
PathManager::Instance()->Init();
|
path.LoadPaths();
|
||||||
|
|
||||||
LogInfo("Shared Memory Loader Program");
|
LogInfo("Shared Memory Loader Program");
|
||||||
if (!EQEmuConfig::LoadConfig()) {
|
if (!EQEmuConfig::LoadConfig()) {
|
||||||
@@ -119,8 +126,8 @@ int main(int argc, char **argv)
|
|||||||
content_db.SetMySQL(database);
|
content_db.SetMySQL(database);
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmuLogSys::Instance()->SetDatabase(&database)
|
LogSys.SetDatabase(&database)
|
||||||
->SetLogPath(PathManager::Instance()->GetLogPath())
|
->SetLogPath(path.GetLogPath())
|
||||||
->LoadLogDatabaseSettings()
|
->LoadLogDatabaseSettings()
|
||||||
->StartFileLogs();
|
->StartFileLogs();
|
||||||
|
|
||||||
@@ -162,16 +169,16 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
WorldContentService::Instance()->SetCurrentExpansion(RuleI(Expansion, CurrentExpansion));
|
content_service.SetCurrentExpansion(RuleI(Expansion, CurrentExpansion));
|
||||||
WorldContentService::Instance()->SetDatabase(&database)
|
content_service.SetDatabase(&database)
|
||||||
->SetContentDatabase(&content_db)
|
->SetContentDatabase(&content_db)
|
||||||
->SetExpansionContext()
|
->SetExpansionContext()
|
||||||
->ReloadContentFlags();
|
->ReloadContentFlags();
|
||||||
|
|
||||||
LogInfo(
|
LogInfo(
|
||||||
"Current expansion is [{}] ({})",
|
"Current expansion is [{}] ({})",
|
||||||
WorldContentService::Instance()->GetCurrentExpansion(),
|
content_service.GetCurrentExpansion(),
|
||||||
WorldContentService::Instance()->GetCurrentExpansionName()
|
content_service.GetCurrentExpansionName()
|
||||||
);
|
);
|
||||||
|
|
||||||
std::string hotfix_name = "";
|
std::string hotfix_name = "";
|
||||||
@@ -237,6 +244,6 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmuLogSys::Instance()->CloseFileLogs();
|
LogSys.CloseFileLogs();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-2
@@ -34,12 +34,14 @@
|
|||||||
#include "task_state_test.h"
|
#include "task_state_test.h"
|
||||||
|
|
||||||
const EQEmuConfig *Config;
|
const EQEmuConfig *Config;
|
||||||
|
EQEmuLogSys LogSys;
|
||||||
|
PathManager path;
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
RegisterExecutablePlatform(ExePlatformClientImport);
|
RegisterExecutablePlatform(ExePlatformClientImport);
|
||||||
EQEmuLogSys::Instance()->LoadLogSettingsDefaults();
|
LogSys.LoadLogSettingsDefaults();
|
||||||
PathManager::Instance()->Init();
|
path.LoadPaths();
|
||||||
|
|
||||||
auto ConfigLoadResult = EQEmuConfig::LoadConfig();
|
auto ConfigLoadResult = EQEmuConfig::LoadConfig();
|
||||||
Config = EQEmuConfig::get();
|
Config = EQEmuConfig::get();
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ public:
|
|||||||
TEST_ADD(StringUtilTest::EscapeStringTest);
|
TEST_ADD(StringUtilTest::EscapeStringTest);
|
||||||
TEST_ADD(StringUtilTest::SearchDeliminatedStringTest);
|
TEST_ADD(StringUtilTest::SearchDeliminatedStringTest);
|
||||||
TEST_ADD(StringUtilTest::SplitStringTest);
|
TEST_ADD(StringUtilTest::SplitStringTest);
|
||||||
|
TEST_ADD(StringUtilTest::FromCharsTest);
|
||||||
TEST_ADD(StringUtilTest::TestIsFloat);
|
TEST_ADD(StringUtilTest::TestIsFloat);
|
||||||
TEST_ADD(StringUtilTest::TestIsNumber);
|
TEST_ADD(StringUtilTest::TestIsNumber);
|
||||||
}
|
}
|
||||||
@@ -107,6 +108,21 @@ public:
|
|||||||
TEST_ASSERT(v[2] == "789");
|
TEST_ASSERT(v[2] == "789");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FromCharsTest() {
|
||||||
|
char int_chars[] = "123";
|
||||||
|
int int_value = 0;
|
||||||
|
|
||||||
|
char float_chars[] = "3.14";
|
||||||
|
float float_value = 0.0f;
|
||||||
|
|
||||||
|
Strings::from_chars(int_chars, int_value);
|
||||||
|
TEST_ASSERT(int_value == 123);
|
||||||
|
|
||||||
|
Strings::from_chars(float_chars, float_value);
|
||||||
|
TEST_ASSERT(float_value == 3.14f);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void TestIsFloat() {
|
void TestIsFloat() {
|
||||||
TEST_ASSERT_EQUALS(Strings::IsFloat("0.23424523"), true);
|
TEST_ASSERT_EQUALS(Strings::IsFloat("0.23424523"), true);
|
||||||
TEST_ASSERT_EQUALS(Strings::IsFloat("12312312313.23424523"), true);
|
TEST_ASSERT_EQUALS(Strings::IsFloat("12312312313.23424523"), true);
|
||||||
|
|||||||
+2
-2
@@ -482,7 +482,7 @@ Clientlist::Clientlist(int ChatPort) {
|
|||||||
const ucsconfig *Config = ucsconfig::get();
|
const ucsconfig *Config = ucsconfig::get();
|
||||||
|
|
||||||
|
|
||||||
std::string opcodes_file = fmt::format("{}/{}", PathManager::Instance()->GetServerPath(), Config->MailOpCodesFile);
|
std::string opcodes_file = fmt::format("{}/{}", path.GetServerPath(), Config->MailOpCodesFile);
|
||||||
|
|
||||||
LogInfo("Loading [{}]", opcodes_file);
|
LogInfo("Loading [{}]", opcodes_file);
|
||||||
if (!ChatOpMgr->LoadOpcodes(opcodes_file.c_str()))
|
if (!ChatOpMgr->LoadOpcodes(opcodes_file.c_str()))
|
||||||
@@ -651,7 +651,7 @@ void Clientlist::Process()
|
|||||||
OpcodeManager::EmuToName(app->GetOpcode()),
|
OpcodeManager::EmuToName(app->GetOpcode()),
|
||||||
o->EmuToEQ(app->GetOpcode()) == 0 ? app->GetProtocolOpcode() : o->EmuToEQ(app->GetOpcode()),
|
o->EmuToEQ(app->GetOpcode()) == 0 ? app->GetProtocolOpcode() : o->EmuToEQ(app->GetOpcode()),
|
||||||
app->Size(),
|
app->Size(),
|
||||||
(EQEmuLogSys::Instance()->IsLogEnabled(Logs::Detail, Logs::PacketClientServer) ? DumpPacketToString(app) : "")
|
(LogSys.IsLogEnabled(Logs::Detail, Logs::PacketClientServer) ? DumpPacketToString(app) : "")
|
||||||
);
|
);
|
||||||
|
|
||||||
switch (opcode) {
|
switch (opcode) {
|
||||||
|
|||||||
+13
-9
@@ -44,8 +44,13 @@
|
|||||||
|
|
||||||
ChatChannelList *ChannelList;
|
ChatChannelList *ChannelList;
|
||||||
Clientlist *g_Clientlist;
|
Clientlist *g_Clientlist;
|
||||||
|
EQEmuLogSys LogSys;
|
||||||
UCSDatabase database;
|
UCSDatabase database;
|
||||||
WorldServer *worldserver = nullptr;
|
WorldServer *worldserver = nullptr;
|
||||||
|
DiscordManager discord_manager;
|
||||||
|
PathManager path;
|
||||||
|
ZoneStore zone_store;
|
||||||
|
PlayerEventLogs player_event_logs;
|
||||||
|
|
||||||
const ucsconfig *Config;
|
const ucsconfig *Config;
|
||||||
|
|
||||||
@@ -70,7 +75,7 @@ void Shutdown() {
|
|||||||
LogInfo("Shutting down...");
|
LogInfo("Shutting down...");
|
||||||
ChannelList->RemoveAllChannels();
|
ChannelList->RemoveAllChannels();
|
||||||
g_Clientlist->CloseAllConnections();
|
g_Clientlist->CloseAllConnections();
|
||||||
EQEmuLogSys::Instance()->CloseFileLogs();
|
LogSys.CloseFileLogs();
|
||||||
}
|
}
|
||||||
|
|
||||||
int caught_loop = 0;
|
int caught_loop = 0;
|
||||||
@@ -85,24 +90,24 @@ void CatchSignal(int sig_num) {
|
|||||||
LogInfo("In a signal handler loop and process is incapable of exiting properly, forcefully cleaning up");
|
LogInfo("In a signal handler loop and process is incapable of exiting properly, forcefully cleaning up");
|
||||||
ChannelList->RemoveAllChannels();
|
ChannelList->RemoveAllChannels();
|
||||||
g_Clientlist->CloseAllConnections();
|
g_Clientlist->CloseAllConnections();
|
||||||
EQEmuLogSys::Instance()->CloseFileLogs();
|
LogSys.CloseFileLogs();
|
||||||
std::exit(0);
|
std::exit(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlayerEventQueueListener() {
|
void PlayerEventQueueListener() {
|
||||||
while (caught_loop == 0) {
|
while (caught_loop == 0) {
|
||||||
DiscordManager::Instance()->ProcessMessageQueue();
|
discord_manager.ProcessMessageQueue();
|
||||||
Sleep(100);
|
Sleep(100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
RegisterExecutablePlatform(ExePlatformUCS);
|
RegisterExecutablePlatform(ExePlatformUCS);
|
||||||
EQEmuLogSys::Instance()->LoadLogSettingsDefaults();
|
LogSys.LoadLogSettingsDefaults();
|
||||||
set_exception_handler();
|
set_exception_handler();
|
||||||
|
|
||||||
PathManager::Instance()->Init();
|
path.LoadPaths();
|
||||||
|
|
||||||
// Check every minute for unused channels we can delete
|
// Check every minute for unused channels we can delete
|
||||||
//
|
//
|
||||||
@@ -134,13 +139,12 @@ int main() {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmuLogSys::Instance()
|
LogSys.SetDatabase(&database)
|
||||||
->SetDatabase(&database)
|
->SetLogPath(path.GetLogPath())
|
||||||
->SetLogPath(PathManager::Instance()->GetLogPath())
|
|
||||||
->LoadLogDatabaseSettings()
|
->LoadLogDatabaseSettings()
|
||||||
->StartFileLogs();
|
->StartFileLogs();
|
||||||
|
|
||||||
PlayerEventLogs::Instance()->SetDatabase(&database)->Init();
|
player_event_logs.SetDatabase(&database)->Init();
|
||||||
|
|
||||||
char tmp[64];
|
char tmp[64];
|
||||||
|
|
||||||
|
|||||||
+5
-4
@@ -42,6 +42,7 @@ extern WorldServer worldserver;
|
|||||||
extern Clientlist *g_Clientlist;
|
extern Clientlist *g_Clientlist;
|
||||||
extern const ucsconfig *Config;
|
extern const ucsconfig *Config;
|
||||||
extern UCSDatabase database;
|
extern UCSDatabase database;
|
||||||
|
extern DiscordManager discord_manager;
|
||||||
|
|
||||||
void ProcessMailTo(Client *c, const std::string& from, const std::string& subject, const std::string& message);
|
void ProcessMailTo(Client *c, const std::string& from, const std::string& subject, const std::string& message);
|
||||||
|
|
||||||
@@ -78,8 +79,8 @@ void WorldServer::ProcessMessage(uint16 opcode, EQ::Net::Packet &p)
|
|||||||
case ServerOP_ServerReloadRequest: {
|
case ServerOP_ServerReloadRequest: {
|
||||||
auto o = (ServerReload::Request*) pack->pBuffer;
|
auto o = (ServerReload::Request*) pack->pBuffer;
|
||||||
if (o->type == ServerReload::Type::Logs) {
|
if (o->type == ServerReload::Type::Logs) {
|
||||||
EQEmuLogSys::Instance()->LoadLogDatabaseSettings();
|
LogSys.LoadLogDatabaseSettings();
|
||||||
PlayerEventLogs::Instance()->ReloadSettings();
|
player_event_logs.ReloadSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@@ -91,14 +92,14 @@ void WorldServer::ProcessMessage(uint16 opcode, EQ::Net::Packet &p)
|
|||||||
cereal::BinaryInputArchive archive(ss);
|
cereal::BinaryInputArchive archive(ss);
|
||||||
archive(n);
|
archive(n);
|
||||||
|
|
||||||
DiscordManager::Instance()->QueuePlayerEventMessage(n);
|
discord_manager.QueuePlayerEventMessage(n);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ServerOP_DiscordWebhookMessage: {
|
case ServerOP_DiscordWebhookMessage: {
|
||||||
auto *q = (DiscordWebhookMessage_Struct *) p.Data();
|
auto *q = (DiscordWebhookMessage_Struct *) p.Data();
|
||||||
|
|
||||||
DiscordManager::Instance()->QueueWebhookMessage(
|
discord_manager.QueueWebhookMessage(
|
||||||
q->webhook_id,
|
q->webhook_id,
|
||||||
q->message
|
q->message
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -14,15 +14,15 @@ perl utils/scripts/build/tag-version.pl
|
|||||||
|
|
||||||
mkdir -p build && cd build && \
|
mkdir -p build && cd build && \
|
||||||
cmake -DEQEMU_BUILD_TESTS=ON \
|
cmake -DEQEMU_BUILD_TESTS=ON \
|
||||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
|
||||||
-DEQEMU_BUILD_STATIC=ON \
|
-DEQEMU_BUILD_STATIC=ON \
|
||||||
-DEQEMU_BUILD_LOGIN=ON \
|
-DEQEMU_BUILD_LOGIN=ON \
|
||||||
-DEQEMU_BUILD_LUA=ON \
|
-DEQEMU_BUILD_LUA=ON \
|
||||||
-DEQEMU_BUILD_PERL=ON \
|
-DEQEMU_BUILD_PERL=ON \
|
||||||
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING="-g -Wno-everything" \
|
-DCMAKE_CXX_FLAGS:STRING="-O1 -g -Wno-everything" \
|
||||||
|
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING="-O1 -g -Wno-everything" \
|
||||||
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
||||||
-G 'Unix Makefiles' \
|
-G 'Unix Makefiles' \
|
||||||
.. && make -j$((`nproc`-2))
|
.. && make -j$((`nproc`-12))
|
||||||
|
|
||||||
curl https://raw.githubusercontent.com/Akkadius/eqemu-install-v2/master/eqemu_config.json --output eqemu_config.json
|
curl https://raw.githubusercontent.com/Akkadius/eqemu-install-v2/master/eqemu_config.json --output eqemu_config.json
|
||||||
./bin/tests
|
./bin/tests
|
||||||
|
|||||||
@@ -6,10 +6,13 @@ toolchain go1.23.5
|
|||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/google/go-github/v41 v41.0.0
|
github.com/google/go-github/v41 v41.0.0
|
||||||
golang.org/x/oauth2 v0.27.0
|
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
|
github.com/golang/protobuf v1.3.2 // indirect
|
||||||
github.com/google/go-querystring v1.1.0 // indirect
|
github.com/google/go-querystring v1.1.0 // indirect
|
||||||
golang.org/x/crypto v0.36.0 // indirect
|
golang.org/x/crypto v0.36.0 // indirect
|
||||||
|
golang.org/x/net v0.38.0 // indirect
|
||||||
|
google.golang.org/appengine v1.6.7 // indirect
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||||
|
github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs=
|
||||||
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||||
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
|
github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ=
|
||||||
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
|
|
||||||
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
|
||||||
github.com/google/go-github/v41 v41.0.0 h1:HseJrM2JFf2vfiZJ8anY2hqBjdfY1Vlj/K27ueww4gg=
|
github.com/google/go-github/v41 v41.0.0 h1:HseJrM2JFf2vfiZJ8anY2hqBjdfY1Vlj/K27ueww4gg=
|
||||||
github.com/google/go-github/v41 v41.0.0/go.mod h1:XgmCA5H323A9rtgExdTcnDkcqp6S30AVACCBDOonIxg=
|
github.com/google/go-github/v41 v41.0.0/go.mod h1:XgmCA5H323A9rtgExdTcnDkcqp6S30AVACCBDOonIxg=
|
||||||
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
|
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
|
||||||
@@ -14,9 +14,10 @@ golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34=
|
|||||||
golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc=
|
golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc=
|
||||||
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
|
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
|
||||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||||
|
golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8=
|
||||||
|
golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
|
||||||
|
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be h1:vEDujvNQGv4jgYKudGeI/+DAX4Jffq6hpD55MmoEvKs=
|
||||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||||
golang.org/x/oauth2 v0.27.0 h1:da9Vo7/tDv5RH/7nZDz1eMGS/q1Vv1N/7FCrBhI9I3M=
|
|
||||||
golang.org/x/oauth2 v0.27.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8=
|
|
||||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
@@ -26,4 +27,5 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
|||||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
|
google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=
|
||||||
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
||||||
|
|||||||
@@ -35,12 +35,12 @@ if (scalar(@enum) > 0) {
|
|||||||
|
|
||||||
foreach my $cat (@cats) {
|
foreach my $cat (@cats) {
|
||||||
print "#define Log" . $cat . "(message, ...) do {\\
|
print "#define Log" . $cat . "(message, ...) do {\\
|
||||||
if (EQEmuLogSys::Instance()->IsLogEnabled(Logs::General, Logs::" . $cat . "))\\
|
if (LogSys.IsLogEnabled(Logs::General, Logs::" . $cat . "))\\
|
||||||
OutF(LogSys, Logs::General, Logs::" . $cat . ", __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\\
|
OutF(LogSys, Logs::General, Logs::" . $cat . ", __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\\
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define Log" . $cat . "Detail(message, ...) do {\\
|
#define Log" . $cat . "Detail(message, ...) do {\\
|
||||||
if (EQEmuLogSys::Instance()->IsLogEnabled(Logs::Detail, Logs::" . $cat . "))\\
|
if (LogSys.IsLogEnabled(Logs::Detail, Logs::" . $cat . "))\\
|
||||||
OutF(LogSys, Logs::Detail, Logs::" . $cat . ", __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\\
|
OutF(LogSys, Logs::Detail, Logs::" . $cat . ", __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\\
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
|||||||
@@ -114,8 +114,7 @@ if ($requested_table_to_generate ne "all") {
|
|||||||
|
|
||||||
my @cereal_enabled_tables = (
|
my @cereal_enabled_tables = (
|
||||||
"data_buckets",
|
"data_buckets",
|
||||||
"player_event_logs",
|
"player_event_logs"
|
||||||
"player_event_log_settings"
|
|
||||||
);
|
);
|
||||||
|
|
||||||
my $generated_base_repository_files = "";
|
my $generated_base_repository_files = "";
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ ADD_EXECUTABLE(world ${world_sources} ${world_headers})
|
|||||||
INSTALL(TARGETS world RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
|
INSTALL(TARGETS world RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
|
||||||
|
|
||||||
IF (WIN32 AND EQEMU_BUILD_PCH)
|
IF (WIN32 AND EQEMU_BUILD_PCH)
|
||||||
TARGET_PRECOMPILE_HEADERS(world PRIVATE ../common/pch/std-pch.h)
|
TARGET_PRECOMPILE_HEADERS(world PRIVATE ../common/pch/pch.h)
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
|
|
||||||
ADD_DEFINITIONS(-DWORLD)
|
ADD_DEFINITIONS(-DWORLD)
|
||||||
|
|||||||
+18
-15
@@ -15,6 +15,9 @@
|
|||||||
#include "../common/zone_store.h"
|
#include "../common/zone_store.h"
|
||||||
#include "../common/repositories/character_corpses_repository.h"
|
#include "../common/repositories/character_corpses_repository.h"
|
||||||
|
|
||||||
|
extern ZSList zoneserver_list;
|
||||||
|
extern ClientList client_list;
|
||||||
|
extern AdventureManager adventure_manager;
|
||||||
extern EQ::Random emu_random;
|
extern EQ::Random emu_random;
|
||||||
|
|
||||||
Adventure::Adventure(AdventureTemplate *t)
|
Adventure::Adventure(AdventureTemplate *t)
|
||||||
@@ -174,7 +177,7 @@ void Adventure::SetStatus(AdventureStatus new_status)
|
|||||||
ut->instance_id = instance_id;
|
ut->instance_id = instance_id;
|
||||||
ut->new_duration = adventure_template->duration + 60;
|
ut->new_duration = adventure_template->duration + 60;
|
||||||
|
|
||||||
ZSList::Instance()->SendPacket(0, instance_id, pack);
|
zoneserver_list.SendPacket(0, instance_id, pack);
|
||||||
safe_delete(pack);
|
safe_delete(pack);
|
||||||
}
|
}
|
||||||
else if(new_status == AS_WaitingForSecondaryEndTime)
|
else if(new_status == AS_WaitingForSecondaryEndTime)
|
||||||
@@ -188,7 +191,7 @@ void Adventure::SetStatus(AdventureStatus new_status)
|
|||||||
ut->instance_id = instance_id;
|
ut->instance_id = instance_id;
|
||||||
ut->new_duration = 1860;
|
ut->new_duration = 1860;
|
||||||
|
|
||||||
ZSList::Instance()->SendPacket(0, instance_id, pack);
|
zoneserver_list.SendPacket(0, instance_id, pack);
|
||||||
safe_delete(pack);
|
safe_delete(pack);
|
||||||
}
|
}
|
||||||
else if(new_status == AS_Finished)
|
else if(new_status == AS_Finished)
|
||||||
@@ -202,7 +205,7 @@ void Adventure::SetStatus(AdventureStatus new_status)
|
|||||||
ut->instance_id = instance_id;
|
ut->instance_id = instance_id;
|
||||||
ut->new_duration = 1860;
|
ut->new_duration = 1860;
|
||||||
|
|
||||||
ZSList::Instance()->SendPacket(0, instance_id, pack);
|
zoneserver_list.SendPacket(0, instance_id, pack);
|
||||||
safe_delete(pack);
|
safe_delete(pack);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -213,7 +216,7 @@ void Adventure::SetStatus(AdventureStatus new_status)
|
|||||||
auto iter = players.begin();
|
auto iter = players.begin();
|
||||||
while(iter != players.end())
|
while(iter != players.end())
|
||||||
{
|
{
|
||||||
AdventureManager::Instance()->GetAdventureData((*iter).c_str());
|
adventure_manager.GetAdventureData((*iter).c_str());
|
||||||
++iter;
|
++iter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -227,11 +230,11 @@ void Adventure::SendAdventureMessage(uint32 type, const char *msg)
|
|||||||
auto iter = players.begin();
|
auto iter = players.begin();
|
||||||
while(iter != players.end())
|
while(iter != players.end())
|
||||||
{
|
{
|
||||||
ClientListEntry *current = ClientList::Instance()->FindCharacter((*iter).c_str());
|
ClientListEntry *current = client_list.FindCharacter((*iter).c_str());
|
||||||
if(current)
|
if(current)
|
||||||
{
|
{
|
||||||
strcpy(sms->to, (*iter).c_str());
|
strcpy(sms->to, (*iter).c_str());
|
||||||
ZSList::Instance()->SendPacket(current->zone(), current->instance(), pack);
|
zoneserver_list.SendPacket(current->zone(), current->instance(), pack);
|
||||||
}
|
}
|
||||||
++iter;
|
++iter;
|
||||||
}
|
}
|
||||||
@@ -280,7 +283,7 @@ void Adventure::Finished(AdventureWinStatus ws)
|
|||||||
{
|
{
|
||||||
auto iter = players.begin();
|
auto iter = players.begin();
|
||||||
while (iter != players.end()) {
|
while (iter != players.end()) {
|
||||||
ClientListEntry *current = ClientList::Instance()->FindCharacter((*iter).c_str());
|
ClientListEntry *current = client_list.FindCharacter((*iter).c_str());
|
||||||
auto character_id = database.GetCharacterID(*iter);
|
auto character_id = database.GetCharacterID(*iter);
|
||||||
|
|
||||||
if (character_id == 0) {
|
if (character_id == 0) {
|
||||||
@@ -307,7 +310,7 @@ void Adventure::Finished(AdventureWinStatus ws)
|
|||||||
af->win = false;
|
af->win = false;
|
||||||
af->points = 0;
|
af->points = 0;
|
||||||
}
|
}
|
||||||
ZSList::Instance()->SendPacket(current->zone(), current->instance(), pack);
|
zoneserver_list.SendPacket(current->zone(), current->instance(), pack);
|
||||||
database.UpdateAdventureStatsEntry(character_id, GetTemplate()->theme, (ws != AWS_Lose) ? true : false);
|
database.UpdateAdventureStatsEntry(character_id, GetTemplate()->theme, (ws != AWS_Lose) ? true : false);
|
||||||
delete pack;
|
delete pack;
|
||||||
}
|
}
|
||||||
@@ -328,7 +331,7 @@ void Adventure::Finished(AdventureWinStatus ws)
|
|||||||
afe.win = false;
|
afe.win = false;
|
||||||
afe.points = 0;
|
afe.points = 0;
|
||||||
}
|
}
|
||||||
AdventureManager::Instance()->AddFinishedEvent(afe);
|
adventure_manager.AddFinishedEvent(afe);
|
||||||
database.UpdateAdventureStatsEntry(character_id, GetTemplate()->theme, (ws != AWS_Lose) ? true : false);
|
database.UpdateAdventureStatsEntry(character_id, GetTemplate()->theme, (ws != AWS_Lose) ? true : false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -349,12 +352,12 @@ void Adventure::Finished(AdventureWinStatus ws)
|
|||||||
afe.win = false;
|
afe.win = false;
|
||||||
afe.points = 0;
|
afe.points = 0;
|
||||||
}
|
}
|
||||||
AdventureManager::Instance()->AddFinishedEvent(afe);
|
adventure_manager.AddFinishedEvent(afe);
|
||||||
database.UpdateAdventureStatsEntry(character_id, GetTemplate()->theme, (ws != AWS_Lose) ? true : false);
|
database.UpdateAdventureStatsEntry(character_id, GetTemplate()->theme, (ws != AWS_Lose) ? true : false);
|
||||||
}
|
}
|
||||||
++iter;
|
++iter;
|
||||||
}
|
}
|
||||||
AdventureManager::Instance()->GetAdventureData(this);
|
adventure_manager.GetAdventureData(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Adventure::MoveCorpsesToGraveyard()
|
void Adventure::MoveCorpsesToGraveyard()
|
||||||
@@ -365,8 +368,8 @@ void Adventure::MoveCorpsesToGraveyard()
|
|||||||
|
|
||||||
glm::vec4 position;
|
glm::vec4 position;
|
||||||
|
|
||||||
float x = GetTemplate()->graveyard_x + EQ::Random::Instance()->Real(-GetTemplate()->graveyard_radius, GetTemplate()->graveyard_radius);
|
float x = GetTemplate()->graveyard_x + emu_random.Real(-GetTemplate()->graveyard_radius, GetTemplate()->graveyard_radius);
|
||||||
float y = GetTemplate()->graveyard_y + EQ::Random::Instance()->Real(-GetTemplate()->graveyard_radius, GetTemplate()->graveyard_radius);
|
float y = GetTemplate()->graveyard_y + emu_random.Real(-GetTemplate()->graveyard_radius, GetTemplate()->graveyard_radius);
|
||||||
float z = GetTemplate()->graveyard_z;
|
float z = GetTemplate()->graveyard_z;
|
||||||
|
|
||||||
position.x = x;
|
position.x = x;
|
||||||
@@ -393,7 +396,7 @@ void Adventure::MoveCorpsesToGraveyard()
|
|||||||
d->InstanceID = 0;
|
d->InstanceID = 0;
|
||||||
d->ZoneID = GetTemplate()->graveyard_zone_id;
|
d->ZoneID = GetTemplate()->graveyard_zone_id;
|
||||||
|
|
||||||
ZSList::Instance()->SendPacket(0, GetInstanceID(), pack);
|
zoneserver_list.SendPacket(0, GetInstanceID(), pack);
|
||||||
|
|
||||||
delete pack;
|
delete pack;
|
||||||
|
|
||||||
@@ -404,7 +407,7 @@ void Adventure::MoveCorpsesToGraveyard()
|
|||||||
spc->player_corpse_id = e.id;
|
spc->player_corpse_id = e.id;
|
||||||
spc->zone_id = GetTemplate()->graveyard_zone_id;
|
spc->zone_id = GetTemplate()->graveyard_zone_id;
|
||||||
|
|
||||||
ZSList::Instance()->SendPacket(spc->zone_id, 0, pack);
|
zoneserver_list.SendPacket(spc->zone_id, 0, pack);
|
||||||
|
|
||||||
delete pack;
|
delete pack;
|
||||||
}
|
}
|
||||||
|
|||||||
+59
-55
@@ -14,6 +14,10 @@
|
|||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
extern ZSList zoneserver_list;
|
||||||
|
extern ClientList client_list;
|
||||||
|
extern EQ::Random emu_random;
|
||||||
|
|
||||||
AdventureManager::AdventureManager()
|
AdventureManager::AdventureManager()
|
||||||
{
|
{
|
||||||
process_timer = new Timer(500);
|
process_timer = new Timer(500);
|
||||||
@@ -64,7 +68,7 @@ void AdventureManager::Process()
|
|||||||
void AdventureManager::CalculateAdventureRequestReply(const char *data)
|
void AdventureManager::CalculateAdventureRequestReply(const char *data)
|
||||||
{
|
{
|
||||||
ServerAdventureRequest_Struct *sar = (ServerAdventureRequest_Struct*)data;
|
ServerAdventureRequest_Struct *sar = (ServerAdventureRequest_Struct*)data;
|
||||||
ClientListEntry *leader = ClientList::Instance()->FindCharacter(sar->leader);
|
ClientListEntry *leader = client_list.FindCharacter(sar->leader);
|
||||||
if(!leader)
|
if(!leader)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -80,7 +84,7 @@ void AdventureManager::CalculateAdventureRequestReply(const char *data)
|
|||||||
ServerAdventureRequestDeny_Struct *deny = (ServerAdventureRequestDeny_Struct*)pack->pBuffer;
|
ServerAdventureRequestDeny_Struct *deny = (ServerAdventureRequestDeny_Struct*)pack->pBuffer;
|
||||||
strcpy(deny->leader, sar->leader);
|
strcpy(deny->leader, sar->leader);
|
||||||
strcpy(deny->reason, "There are currently no adventures set for this theme.");
|
strcpy(deny->reason, "There are currently no adventures set for this theme.");
|
||||||
ZSList::Instance()->SendPacket(leader->zone(), leader->instance(), pack);
|
zoneserver_list.SendPacket(leader->zone(), leader->instance(), pack);
|
||||||
delete pack;
|
delete pack;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -109,7 +113,7 @@ void AdventureManager::CalculateAdventureRequestReply(const char *data)
|
|||||||
ss << (data + sizeof(ServerAdventureRequest_Struct) + (64 * i)) << " is already apart of an active adventure.";
|
ss << (data + sizeof(ServerAdventureRequest_Struct) + (64 * i)) << " is already apart of an active adventure.";
|
||||||
|
|
||||||
strcpy(deny->reason, ss.str().c_str());
|
strcpy(deny->reason, ss.str().c_str());
|
||||||
ZSList::Instance()->SendPacket(leader->zone(), leader->instance(), pack);
|
zoneserver_list.SendPacket(leader->zone(), leader->instance(), pack);
|
||||||
delete pack;
|
delete pack;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -181,7 +185,7 @@ void AdventureManager::CalculateAdventureRequestReply(const char *data)
|
|||||||
|
|
||||||
for(int i = 0; i < sar->member_count; ++i)
|
for(int i = 0; i < sar->member_count; ++i)
|
||||||
{
|
{
|
||||||
ClientListEntry *current = ClientList::Instance()->FindCharacter((data + sizeof(ServerAdventureRequest_Struct) + (64 * i)));
|
ClientListEntry *current = client_list.FindCharacter((data + sizeof(ServerAdventureRequest_Struct) + (64 * i)));
|
||||||
if(current)
|
if(current)
|
||||||
{
|
{
|
||||||
int lvl = current->level();
|
int lvl = current->level();
|
||||||
@@ -240,7 +244,7 @@ void AdventureManager::CalculateAdventureRequestReply(const char *data)
|
|||||||
ServerAdventureRequestDeny_Struct *deny = (ServerAdventureRequestDeny_Struct*)pack->pBuffer;
|
ServerAdventureRequestDeny_Struct *deny = (ServerAdventureRequestDeny_Struct*)pack->pBuffer;
|
||||||
strcpy(deny->leader, sar->leader);
|
strcpy(deny->leader, sar->leader);
|
||||||
strcpy(deny->reason, "The number of found players for this adventure was zero.");
|
strcpy(deny->reason, "The number of found players for this adventure was zero.");
|
||||||
ZSList::Instance()->SendPacket(leader->zone(), leader->instance(), pack);
|
zoneserver_list.SendPacket(leader->zone(), leader->instance(), pack);
|
||||||
delete pack;
|
delete pack;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -257,7 +261,7 @@ void AdventureManager::CalculateAdventureRequestReply(const char *data)
|
|||||||
ss << "The maximum level range for this adventure is " << RuleI(Adventure, MaxLevelRange);
|
ss << "The maximum level range for this adventure is " << RuleI(Adventure, MaxLevelRange);
|
||||||
ss << " but the level range calculated was " << (max_level - min_level) << ".";
|
ss << " but the level range calculated was " << (max_level - min_level) << ".";
|
||||||
strcpy(deny->reason, ss.str().c_str());
|
strcpy(deny->reason, ss.str().c_str());
|
||||||
ZSList::Instance()->SendPacket(leader->zone(), leader->instance(), pack);
|
zoneserver_list.SendPacket(leader->zone(), leader->instance(), pack);
|
||||||
delete pack;
|
delete pack;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -320,7 +324,7 @@ void AdventureManager::CalculateAdventureRequestReply(const char *data)
|
|||||||
if(eligible_adventures.size() > 0)
|
if(eligible_adventures.size() > 0)
|
||||||
{
|
{
|
||||||
ea_iter = eligible_adventures.begin();
|
ea_iter = eligible_adventures.begin();
|
||||||
int c_index = EQ::Random::Instance()->Int(0, (eligible_adventures.size()-1));
|
int c_index = emu_random.Int(0, (eligible_adventures.size()-1));
|
||||||
for(int i = 0; i < c_index; ++i)
|
for(int i = 0; i < c_index; ++i)
|
||||||
{
|
{
|
||||||
++ea_iter;
|
++ea_iter;
|
||||||
@@ -334,7 +338,7 @@ void AdventureManager::CalculateAdventureRequestReply(const char *data)
|
|||||||
sra->id = (*ea_iter)->id;
|
sra->id = (*ea_iter)->id;
|
||||||
sra->member_count = sar->member_count;
|
sra->member_count = sar->member_count;
|
||||||
memcpy((pack->pBuffer + sizeof(ServerAdventureRequestAccept_Struct)), (data + sizeof(ServerAdventureRequest_Struct)), (sar->member_count * 64));
|
memcpy((pack->pBuffer + sizeof(ServerAdventureRequestAccept_Struct)), (data + sizeof(ServerAdventureRequest_Struct)), (sar->member_count * 64));
|
||||||
ZSList::Instance()->SendPacket(leader->zone(), leader->instance(), pack);
|
zoneserver_list.SendPacket(leader->zone(), leader->instance(), pack);
|
||||||
delete pack;
|
delete pack;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -344,7 +348,7 @@ void AdventureManager::CalculateAdventureRequestReply(const char *data)
|
|||||||
ServerAdventureRequestDeny_Struct *deny = (ServerAdventureRequestDeny_Struct*)pack->pBuffer;
|
ServerAdventureRequestDeny_Struct *deny = (ServerAdventureRequestDeny_Struct*)pack->pBuffer;
|
||||||
strcpy(deny->leader, sar->leader);
|
strcpy(deny->leader, sar->leader);
|
||||||
strcpy(deny->reason, "The number of adventures returned was zero.");
|
strcpy(deny->reason, "The number of adventures returned was zero.");
|
||||||
ZSList::Instance()->SendPacket(leader->zone(), leader->instance(), pack);
|
zoneserver_list.SendPacket(leader->zone(), leader->instance(), pack);
|
||||||
delete pack;
|
delete pack;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -353,7 +357,7 @@ void AdventureManager::CalculateAdventureRequestReply(const char *data)
|
|||||||
void AdventureManager::TryAdventureCreate(const char *data)
|
void AdventureManager::TryAdventureCreate(const char *data)
|
||||||
{
|
{
|
||||||
ServerAdventureRequestCreate_Struct *src = (ServerAdventureRequestCreate_Struct*)data;
|
ServerAdventureRequestCreate_Struct *src = (ServerAdventureRequestCreate_Struct*)data;
|
||||||
ClientListEntry *leader = ClientList::Instance()->FindCharacter(src->leader);
|
ClientListEntry *leader = client_list.FindCharacter(src->leader);
|
||||||
if(!leader)
|
if(!leader)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -364,7 +368,7 @@ void AdventureManager::TryAdventureCreate(const char *data)
|
|||||||
{
|
{
|
||||||
auto pack = new ServerPacket(ServerOP_AdventureCreateDeny, 64);
|
auto pack = new ServerPacket(ServerOP_AdventureCreateDeny, 64);
|
||||||
strcpy((char*)pack->pBuffer, src->leader);
|
strcpy((char*)pack->pBuffer, src->leader);
|
||||||
ZSList::Instance()->SendPacket(leader->zone(), leader->instance(), pack);
|
zoneserver_list.SendPacket(leader->zone(), leader->instance(), pack);
|
||||||
delete pack;
|
delete pack;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -374,7 +378,7 @@ void AdventureManager::TryAdventureCreate(const char *data)
|
|||||||
{
|
{
|
||||||
auto pack = new ServerPacket(ServerOP_AdventureCreateDeny, 64);
|
auto pack = new ServerPacket(ServerOP_AdventureCreateDeny, 64);
|
||||||
strcpy((char*)pack->pBuffer, src->leader);
|
strcpy((char*)pack->pBuffer, src->leader);
|
||||||
ZSList::Instance()->SendPacket(leader->zone(), leader->instance(), pack);
|
zoneserver_list.SendPacket(leader->zone(), leader->instance(), pack);
|
||||||
delete pack;
|
delete pack;
|
||||||
delete adv;
|
delete adv;
|
||||||
return;
|
return;
|
||||||
@@ -387,7 +391,7 @@ void AdventureManager::TryAdventureCreate(const char *data)
|
|||||||
{
|
{
|
||||||
auto pack = new ServerPacket(ServerOP_AdventureCreateDeny, 64);
|
auto pack = new ServerPacket(ServerOP_AdventureCreateDeny, 64);
|
||||||
strcpy((char*)pack->pBuffer, src->leader);
|
strcpy((char*)pack->pBuffer, src->leader);
|
||||||
ZSList::Instance()->SendPacket(leader->zone(), leader->instance(), pack);
|
zoneserver_list.SendPacket(leader->zone(), leader->instance(), pack);
|
||||||
delete pack;
|
delete pack;
|
||||||
delete adv;
|
delete adv;
|
||||||
return;
|
return;
|
||||||
@@ -400,7 +404,7 @@ void AdventureManager::TryAdventureCreate(const char *data)
|
|||||||
for(int i = 0; i < src->member_count; ++i)
|
for(int i = 0; i < src->member_count; ++i)
|
||||||
{
|
{
|
||||||
|
|
||||||
ClientListEntry *player = ClientList::Instance()->FindCharacter((data + sizeof(ServerAdventureRequestCreate_Struct) + (64 * i)));
|
ClientListEntry *player = client_list.FindCharacter((data + sizeof(ServerAdventureRequestCreate_Struct) + (64 * i)));
|
||||||
if(player)
|
if(player)
|
||||||
{
|
{
|
||||||
int f_count = 0;
|
int f_count = 0;
|
||||||
@@ -432,7 +436,7 @@ void AdventureManager::TryAdventureCreate(const char *data)
|
|||||||
sfa->zone_in_object = finished_adventures[f]->GetTemplate()->zone_in_object_id;
|
sfa->zone_in_object = finished_adventures[f]->GetTemplate()->zone_in_object_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
ZSList::Instance()->SendPacket(player->zone(), player->instance(), pack);
|
zoneserver_list.SendPacket(player->zone(), player->instance(), pack);
|
||||||
safe_delete_array(finished_adventures);
|
safe_delete_array(finished_adventures);
|
||||||
delete pack;
|
delete pack;
|
||||||
}
|
}
|
||||||
@@ -454,7 +458,7 @@ void AdventureManager::GetAdventureData(Adventure *adv)
|
|||||||
|
|
||||||
void AdventureManager::GetAdventureData(const char *name)
|
void AdventureManager::GetAdventureData(const char *name)
|
||||||
{
|
{
|
||||||
ClientListEntry *player = ClientList::Instance()->FindCharacter(name);
|
ClientListEntry *player = client_list.FindCharacter(name);
|
||||||
if(player)
|
if(player)
|
||||||
{
|
{
|
||||||
int f_count = 0;
|
int f_count = 0;
|
||||||
@@ -493,7 +497,7 @@ void AdventureManager::GetAdventureData(const char *name)
|
|||||||
delete pack;
|
delete pack;
|
||||||
auto pack = new ServerPacket(ServerOP_AdventureDataClear, 64);
|
auto pack = new ServerPacket(ServerOP_AdventureDataClear, 64);
|
||||||
strcpy((char*)pack->pBuffer, name);
|
strcpy((char*)pack->pBuffer, name);
|
||||||
ZSList::Instance()->SendPacket(player->zone(), player->instance(), pack);
|
zoneserver_list.SendPacket(player->zone(), player->instance(), pack);
|
||||||
|
|
||||||
delete pack;
|
delete pack;
|
||||||
delete[] finished_adventures;
|
delete[] finished_adventures;
|
||||||
@@ -511,7 +515,7 @@ void AdventureManager::GetAdventureData(const char *name)
|
|||||||
sfa->zone_in_object = finished_adventures[i]->GetTemplate()->zone_in_object_id;
|
sfa->zone_in_object = finished_adventures[i]->GetTemplate()->zone_in_object_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
ZSList::Instance()->SendPacket(player->zone(), player->instance(), pack);
|
zoneserver_list.SendPacket(player->zone(), player->instance(), pack);
|
||||||
safe_delete_array(finished_adventures);
|
safe_delete_array(finished_adventures);
|
||||||
delete pack;
|
delete pack;
|
||||||
delete[] finished_adventures;
|
delete[] finished_adventures;
|
||||||
@@ -760,7 +764,7 @@ void AdventureManager::PlayerClickedDoor(const char *player, int zone_id, int do
|
|||||||
{
|
{
|
||||||
if((*iter)->PlayerExists(player))
|
if((*iter)->PlayerExists(player))
|
||||||
{
|
{
|
||||||
ClientListEntry *pc = ClientList::Instance()->FindCharacter(player);
|
ClientListEntry *pc = client_list.FindCharacter(player);
|
||||||
if(pc)
|
if(pc)
|
||||||
{
|
{
|
||||||
auto pack =
|
auto pack =
|
||||||
@@ -779,7 +783,7 @@ void AdventureManager::PlayerClickedDoor(const char *player, int zone_id, int do
|
|||||||
(*iter)->SetStatus(AS_WaitingForPrimaryEndTime);
|
(*iter)->SetStatus(AS_WaitingForPrimaryEndTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
ZSList::Instance()->SendPacket(pc->zone(), pc->instance(), pack);
|
zoneserver_list.SendPacket(pc->zone(), pc->instance(), pack);
|
||||||
safe_delete(pack);
|
safe_delete(pack);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@@ -788,19 +792,19 @@ void AdventureManager::PlayerClickedDoor(const char *player, int zone_id, int do
|
|||||||
++iter;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
ClientListEntry *pc = ClientList::Instance()->FindCharacter(player);
|
ClientListEntry *pc = client_list.FindCharacter(player);
|
||||||
if(pc)
|
if(pc)
|
||||||
{
|
{
|
||||||
auto pack = new ServerPacket(ServerOP_AdventureClickDoorError, 64);
|
auto pack = new ServerPacket(ServerOP_AdventureClickDoorError, 64);
|
||||||
strcpy((char*)pack->pBuffer, player);
|
strcpy((char*)pack->pBuffer, player);
|
||||||
ZSList::Instance()->SendPacket(pc->zone(), pc->instance(), pack);
|
zoneserver_list.SendPacket(pc->zone(), pc->instance(), pack);
|
||||||
safe_delete(pack);
|
safe_delete(pack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdventureManager::LeaveAdventure(const char *name)
|
void AdventureManager::LeaveAdventure(const char *name)
|
||||||
{
|
{
|
||||||
ClientListEntry *pc = ClientList::Instance()->FindCharacter(name);
|
ClientListEntry *pc = client_list.FindCharacter(name);
|
||||||
if(pc)
|
if(pc)
|
||||||
{
|
{
|
||||||
Adventure *current = GetActiveAdventure(name);
|
Adventure *current = GetActiveAdventure(name);
|
||||||
@@ -810,7 +814,7 @@ void AdventureManager::LeaveAdventure(const char *name)
|
|||||||
{
|
{
|
||||||
auto pack = new ServerPacket(ServerOP_AdventureLeaveDeny, 64);
|
auto pack = new ServerPacket(ServerOP_AdventureLeaveDeny, 64);
|
||||||
strcpy((char*)pack->pBuffer, name);
|
strcpy((char*)pack->pBuffer, name);
|
||||||
ZSList::Instance()->SendPacket(pc->zone(), pc->instance(), pack);
|
zoneserver_list.SendPacket(pc->zone(), pc->instance(), pack);
|
||||||
safe_delete(pack);
|
safe_delete(pack);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -823,7 +827,7 @@ void AdventureManager::LeaveAdventure(const char *name)
|
|||||||
current->RemovePlayer(name);
|
current->RemovePlayer(name);
|
||||||
auto pack = new ServerPacket(ServerOP_AdventureLeaveReply, 64);
|
auto pack = new ServerPacket(ServerOP_AdventureLeaveReply, 64);
|
||||||
strcpy((char*)pack->pBuffer, name);
|
strcpy((char*)pack->pBuffer, name);
|
||||||
ZSList::Instance()->SendPacket(pc->zone(), pc->instance(), pack);
|
zoneserver_list.SendPacket(pc->zone(), pc->instance(), pack);
|
||||||
safe_delete(pack);
|
safe_delete(pack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -831,7 +835,7 @@ void AdventureManager::LeaveAdventure(const char *name)
|
|||||||
{
|
{
|
||||||
auto pack = new ServerPacket(ServerOP_AdventureLeaveReply, 64);
|
auto pack = new ServerPacket(ServerOP_AdventureLeaveReply, 64);
|
||||||
strcpy((char*)pack->pBuffer, name);
|
strcpy((char*)pack->pBuffer, name);
|
||||||
ZSList::Instance()->SendPacket(pc->zone(), pc->instance(), pack);
|
zoneserver_list.SendPacket(pc->zone(), pc->instance(), pack);
|
||||||
safe_delete(pack);
|
safe_delete(pack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -863,12 +867,12 @@ void AdventureManager::IncrementCount(uint16 instance_id)
|
|||||||
|
|
||||||
while(siter != slist.end())
|
while(siter != slist.end())
|
||||||
{
|
{
|
||||||
ClientListEntry *pc = ClientList::Instance()->FindCharacter((*siter).c_str());
|
ClientListEntry *pc = client_list.FindCharacter((*siter).c_str());
|
||||||
if(pc)
|
if(pc)
|
||||||
{
|
{
|
||||||
memset(ac->player, 0, 64);
|
memset(ac->player, 0, 64);
|
||||||
strcpy(ac->player, (*siter).c_str());
|
strcpy(ac->player, (*siter).c_str());
|
||||||
ZSList::Instance()->SendPacket(pc->zone(), pc->instance(), pack);
|
zoneserver_list.SendPacket(pc->zone(), pc->instance(), pack);
|
||||||
}
|
}
|
||||||
++siter;
|
++siter;
|
||||||
}
|
}
|
||||||
@@ -932,7 +936,7 @@ void AdventureManager::GetZoneData(uint16 instance_id)
|
|||||||
zd->dest_y = temp->dest_y;
|
zd->dest_y = temp->dest_y;
|
||||||
zd->dest_z = temp->dest_z;
|
zd->dest_z = temp->dest_z;
|
||||||
zd->dest_h = temp->dest_h;
|
zd->dest_h = temp->dest_h;
|
||||||
ZSList::Instance()->SendPacket(0, instance_id, pack);
|
zoneserver_list.SendPacket(0, instance_id, pack);
|
||||||
delete pack;
|
delete pack;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1258,7 +1262,7 @@ void AdventureManager::DoLeaderboardRequest(const char* player, uint8 type)
|
|||||||
|
|
||||||
void AdventureManager::DoLeaderboardRequestWins(const char* player)
|
void AdventureManager::DoLeaderboardRequestWins(const char* player)
|
||||||
{
|
{
|
||||||
ClientListEntry *pc = ClientList::Instance()->FindCharacter(player);
|
ClientListEntry *pc = client_list.FindCharacter(player);
|
||||||
if(pc)
|
if(pc)
|
||||||
{
|
{
|
||||||
auto pack = new ServerPacket(ServerOP_AdventureLeaderboard, 64 + sizeof(AdventureLeaderboard_Struct));
|
auto pack = new ServerPacket(ServerOP_AdventureLeaderboard, 64 + sizeof(AdventureLeaderboard_Struct));
|
||||||
@@ -1317,14 +1321,14 @@ void AdventureManager::DoLeaderboardRequestWins(const char* player)
|
|||||||
al->failure = our_failures;
|
al->failure = our_failures;
|
||||||
}
|
}
|
||||||
|
|
||||||
ZSList::Instance()->SendPacket(pc->zone(), pc->instance(), pack);
|
zoneserver_list.SendPacket(pc->zone(), pc->instance(), pack);
|
||||||
delete pack;
|
delete pack;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdventureManager::DoLeaderboardRequestPercentage(const char* player)
|
void AdventureManager::DoLeaderboardRequestPercentage(const char* player)
|
||||||
{
|
{
|
||||||
ClientListEntry *pc = ClientList::Instance()->FindCharacter(player);
|
ClientListEntry *pc = client_list.FindCharacter(player);
|
||||||
if(pc)
|
if(pc)
|
||||||
{
|
{
|
||||||
auto pack = new ServerPacket(ServerOP_AdventureLeaderboard, 64 + sizeof(AdventureLeaderboard_Struct));
|
auto pack = new ServerPacket(ServerOP_AdventureLeaderboard, 64 + sizeof(AdventureLeaderboard_Struct));
|
||||||
@@ -1383,14 +1387,14 @@ void AdventureManager::DoLeaderboardRequestPercentage(const char* player)
|
|||||||
al->failure = our_failures;
|
al->failure = our_failures;
|
||||||
}
|
}
|
||||||
|
|
||||||
ZSList::Instance()->SendPacket(pc->zone(), pc->instance(), pack);
|
zoneserver_list.SendPacket(pc->zone(), pc->instance(), pack);
|
||||||
delete pack;
|
delete pack;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdventureManager::DoLeaderboardRequestWinsGuk(const char* player)
|
void AdventureManager::DoLeaderboardRequestWinsGuk(const char* player)
|
||||||
{
|
{
|
||||||
ClientListEntry *pc = ClientList::Instance()->FindCharacter(player);
|
ClientListEntry *pc = client_list.FindCharacter(player);
|
||||||
if(pc)
|
if(pc)
|
||||||
{
|
{
|
||||||
auto pack = new ServerPacket(ServerOP_AdventureLeaderboard, 64 + sizeof(AdventureLeaderboard_Struct));
|
auto pack = new ServerPacket(ServerOP_AdventureLeaderboard, 64 + sizeof(AdventureLeaderboard_Struct));
|
||||||
@@ -1449,14 +1453,14 @@ void AdventureManager::DoLeaderboardRequestWinsGuk(const char* player)
|
|||||||
al->failure = our_failures;
|
al->failure = our_failures;
|
||||||
}
|
}
|
||||||
|
|
||||||
ZSList::Instance()->SendPacket(pc->zone(), pc->instance(), pack);
|
zoneserver_list.SendPacket(pc->zone(), pc->instance(), pack);
|
||||||
delete pack;
|
delete pack;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdventureManager::DoLeaderboardRequestPercentageGuk(const char* player)
|
void AdventureManager::DoLeaderboardRequestPercentageGuk(const char* player)
|
||||||
{
|
{
|
||||||
ClientListEntry *pc = ClientList::Instance()->FindCharacter(player);
|
ClientListEntry *pc = client_list.FindCharacter(player);
|
||||||
if(pc)
|
if(pc)
|
||||||
{
|
{
|
||||||
auto pack = new ServerPacket(ServerOP_AdventureLeaderboard, 64 + sizeof(AdventureLeaderboard_Struct));
|
auto pack = new ServerPacket(ServerOP_AdventureLeaderboard, 64 + sizeof(AdventureLeaderboard_Struct));
|
||||||
@@ -1515,14 +1519,14 @@ void AdventureManager::DoLeaderboardRequestPercentageGuk(const char* player)
|
|||||||
al->failure = our_failures;
|
al->failure = our_failures;
|
||||||
}
|
}
|
||||||
|
|
||||||
ZSList::Instance()->SendPacket(pc->zone(), pc->instance(), pack);
|
zoneserver_list.SendPacket(pc->zone(), pc->instance(), pack);
|
||||||
delete pack;
|
delete pack;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdventureManager::DoLeaderboardRequestWinsMir(const char* player)
|
void AdventureManager::DoLeaderboardRequestWinsMir(const char* player)
|
||||||
{
|
{
|
||||||
ClientListEntry *pc = ClientList::Instance()->FindCharacter(player);
|
ClientListEntry *pc = client_list.FindCharacter(player);
|
||||||
if(pc)
|
if(pc)
|
||||||
{
|
{
|
||||||
auto pack = new ServerPacket(ServerOP_AdventureLeaderboard, 64 + sizeof(AdventureLeaderboard_Struct));
|
auto pack = new ServerPacket(ServerOP_AdventureLeaderboard, 64 + sizeof(AdventureLeaderboard_Struct));
|
||||||
@@ -1581,14 +1585,14 @@ void AdventureManager::DoLeaderboardRequestWinsMir(const char* player)
|
|||||||
al->failure = our_failures;
|
al->failure = our_failures;
|
||||||
}
|
}
|
||||||
|
|
||||||
ZSList::Instance()->SendPacket(pc->zone(), pc->instance(), pack);
|
zoneserver_list.SendPacket(pc->zone(), pc->instance(), pack);
|
||||||
delete pack;
|
delete pack;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdventureManager::DoLeaderboardRequestPercentageMir(const char* player)
|
void AdventureManager::DoLeaderboardRequestPercentageMir(const char* player)
|
||||||
{
|
{
|
||||||
ClientListEntry *pc = ClientList::Instance()->FindCharacter(player);
|
ClientListEntry *pc = client_list.FindCharacter(player);
|
||||||
if(pc)
|
if(pc)
|
||||||
{
|
{
|
||||||
auto pack = new ServerPacket(ServerOP_AdventureLeaderboard, 64 + sizeof(AdventureLeaderboard_Struct));
|
auto pack = new ServerPacket(ServerOP_AdventureLeaderboard, 64 + sizeof(AdventureLeaderboard_Struct));
|
||||||
@@ -1647,14 +1651,14 @@ void AdventureManager::DoLeaderboardRequestPercentageMir(const char* player)
|
|||||||
al->failure = our_failures;
|
al->failure = our_failures;
|
||||||
}
|
}
|
||||||
|
|
||||||
ZSList::Instance()->SendPacket(pc->zone(), pc->instance(), pack);
|
zoneserver_list.SendPacket(pc->zone(), pc->instance(), pack);
|
||||||
delete pack;
|
delete pack;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdventureManager::DoLeaderboardRequestWinsMmc(const char* player)
|
void AdventureManager::DoLeaderboardRequestWinsMmc(const char* player)
|
||||||
{
|
{
|
||||||
ClientListEntry *pc = ClientList::Instance()->FindCharacter(player);
|
ClientListEntry *pc = client_list.FindCharacter(player);
|
||||||
if(pc)
|
if(pc)
|
||||||
{
|
{
|
||||||
auto pack = new ServerPacket(ServerOP_AdventureLeaderboard, 64 + sizeof(AdventureLeaderboard_Struct));
|
auto pack = new ServerPacket(ServerOP_AdventureLeaderboard, 64 + sizeof(AdventureLeaderboard_Struct));
|
||||||
@@ -1713,14 +1717,14 @@ void AdventureManager::DoLeaderboardRequestWinsMmc(const char* player)
|
|||||||
al->failure = our_failures;
|
al->failure = our_failures;
|
||||||
}
|
}
|
||||||
|
|
||||||
ZSList::Instance()->SendPacket(pc->zone(), pc->instance(), pack);
|
zoneserver_list.SendPacket(pc->zone(), pc->instance(), pack);
|
||||||
delete pack;
|
delete pack;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdventureManager::DoLeaderboardRequestPercentageMmc(const char* player)
|
void AdventureManager::DoLeaderboardRequestPercentageMmc(const char* player)
|
||||||
{
|
{
|
||||||
ClientListEntry *pc = ClientList::Instance()->FindCharacter(player);
|
ClientListEntry *pc = client_list.FindCharacter(player);
|
||||||
if(pc)
|
if(pc)
|
||||||
{
|
{
|
||||||
auto pack = new ServerPacket(ServerOP_AdventureLeaderboard, 64 + sizeof(AdventureLeaderboard_Struct));
|
auto pack = new ServerPacket(ServerOP_AdventureLeaderboard, 64 + sizeof(AdventureLeaderboard_Struct));
|
||||||
@@ -1779,14 +1783,14 @@ void AdventureManager::DoLeaderboardRequestPercentageMmc(const char* player)
|
|||||||
al->failure = our_failures;
|
al->failure = our_failures;
|
||||||
}
|
}
|
||||||
|
|
||||||
ZSList::Instance()->SendPacket(pc->zone(), pc->instance(), pack);
|
zoneserver_list.SendPacket(pc->zone(), pc->instance(), pack);
|
||||||
delete pack;
|
delete pack;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdventureManager::DoLeaderboardRequestWinsRuj(const char* player)
|
void AdventureManager::DoLeaderboardRequestWinsRuj(const char* player)
|
||||||
{
|
{
|
||||||
ClientListEntry *pc = ClientList::Instance()->FindCharacter(player);
|
ClientListEntry *pc = client_list.FindCharacter(player);
|
||||||
if(pc)
|
if(pc)
|
||||||
{
|
{
|
||||||
auto pack = new ServerPacket(ServerOP_AdventureLeaderboard, 64 + sizeof(AdventureLeaderboard_Struct));
|
auto pack = new ServerPacket(ServerOP_AdventureLeaderboard, 64 + sizeof(AdventureLeaderboard_Struct));
|
||||||
@@ -1845,14 +1849,14 @@ void AdventureManager::DoLeaderboardRequestWinsRuj(const char* player)
|
|||||||
al->failure = our_failures;
|
al->failure = our_failures;
|
||||||
}
|
}
|
||||||
|
|
||||||
ZSList::Instance()->SendPacket(pc->zone(), pc->instance(), pack);
|
zoneserver_list.SendPacket(pc->zone(), pc->instance(), pack);
|
||||||
delete pack;
|
delete pack;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdventureManager::DoLeaderboardRequestPercentageRuj(const char* player)
|
void AdventureManager::DoLeaderboardRequestPercentageRuj(const char* player)
|
||||||
{
|
{
|
||||||
ClientListEntry *pc = ClientList::Instance()->FindCharacter(player);
|
ClientListEntry *pc = client_list.FindCharacter(player);
|
||||||
if(pc)
|
if(pc)
|
||||||
{
|
{
|
||||||
auto pack = new ServerPacket(ServerOP_AdventureLeaderboard, 64 + sizeof(AdventureLeaderboard_Struct));
|
auto pack = new ServerPacket(ServerOP_AdventureLeaderboard, 64 + sizeof(AdventureLeaderboard_Struct));
|
||||||
@@ -1911,14 +1915,14 @@ void AdventureManager::DoLeaderboardRequestPercentageRuj(const char* player)
|
|||||||
al->failure = our_failures;
|
al->failure = our_failures;
|
||||||
}
|
}
|
||||||
|
|
||||||
ZSList::Instance()->SendPacket(pc->zone(), pc->instance(), pack);
|
zoneserver_list.SendPacket(pc->zone(), pc->instance(), pack);
|
||||||
delete pack;
|
delete pack;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdventureManager::DoLeaderboardRequestWinsTak(const char* player)
|
void AdventureManager::DoLeaderboardRequestWinsTak(const char* player)
|
||||||
{
|
{
|
||||||
ClientListEntry *pc = ClientList::Instance()->FindCharacter(player);
|
ClientListEntry *pc = client_list.FindCharacter(player);
|
||||||
if(pc)
|
if(pc)
|
||||||
{
|
{
|
||||||
auto pack = new ServerPacket(ServerOP_AdventureLeaderboard, 64 + sizeof(AdventureLeaderboard_Struct));
|
auto pack = new ServerPacket(ServerOP_AdventureLeaderboard, 64 + sizeof(AdventureLeaderboard_Struct));
|
||||||
@@ -1977,14 +1981,14 @@ void AdventureManager::DoLeaderboardRequestWinsTak(const char* player)
|
|||||||
al->failure = our_failures;
|
al->failure = our_failures;
|
||||||
}
|
}
|
||||||
|
|
||||||
ZSList::Instance()->SendPacket(pc->zone(), pc->instance(), pack);
|
zoneserver_list.SendPacket(pc->zone(), pc->instance(), pack);
|
||||||
delete pack;
|
delete pack;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdventureManager::DoLeaderboardRequestPercentageTak(const char* player)
|
void AdventureManager::DoLeaderboardRequestPercentageTak(const char* player)
|
||||||
{
|
{
|
||||||
ClientListEntry *pc = ClientList::Instance()->FindCharacter(player);
|
ClientListEntry *pc = client_list.FindCharacter(player);
|
||||||
if(pc)
|
if(pc)
|
||||||
{
|
{
|
||||||
auto pack = new ServerPacket(ServerOP_AdventureLeaderboard, 64 + sizeof(AdventureLeaderboard_Struct));
|
auto pack = new ServerPacket(ServerOP_AdventureLeaderboard, 64 + sizeof(AdventureLeaderboard_Struct));
|
||||||
@@ -2043,7 +2047,7 @@ void AdventureManager::DoLeaderboardRequestPercentageTak(const char* player)
|
|||||||
al->failure = our_failures;
|
al->failure = our_failures;
|
||||||
}
|
}
|
||||||
|
|
||||||
ZSList::Instance()->SendPacket(pc->zone(), pc->instance(), pack);
|
zoneserver_list.SendPacket(pc->zone(), pc->instance(), pack);
|
||||||
delete pack;
|
delete pack;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2070,7 +2074,7 @@ bool AdventureManager::PopFinishedEvent(const char *name, AdventureFinishEvent &
|
|||||||
|
|
||||||
void AdventureManager::SendAdventureFinish(AdventureFinishEvent fe)
|
void AdventureManager::SendAdventureFinish(AdventureFinishEvent fe)
|
||||||
{
|
{
|
||||||
ClientListEntry *pc = ClientList::Instance()->FindCharacter(fe.name.c_str());
|
ClientListEntry *pc = client_list.FindCharacter(fe.name.c_str());
|
||||||
if(pc)
|
if(pc)
|
||||||
{
|
{
|
||||||
auto pack = new ServerPacket(ServerOP_AdventureFinish, sizeof(ServerAdventureFinish_Struct));
|
auto pack = new ServerPacket(ServerOP_AdventureFinish, sizeof(ServerAdventureFinish_Struct));
|
||||||
@@ -2080,7 +2084,7 @@ void AdventureManager::SendAdventureFinish(AdventureFinishEvent fe)
|
|||||||
af->win = fe.win;
|
af->win = fe.win;
|
||||||
af->points = fe.points;
|
af->points = fe.points;
|
||||||
|
|
||||||
ZSList::Instance()->SendPacket(pc->zone(), pc->instance(), pack);
|
zoneserver_list.SendPacket(pc->zone(), pc->instance(), pack);
|
||||||
delete pack;
|
delete pack;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,12 +40,6 @@ public:
|
|||||||
AdventureTemplate *GetAdventureTemplate(int theme, int id);
|
AdventureTemplate *GetAdventureTemplate(int theme, int id);
|
||||||
AdventureTemplate *GetAdventureTemplate(int id);
|
AdventureTemplate *GetAdventureTemplate(int id);
|
||||||
void GetZoneData(uint16 instance_id);
|
void GetZoneData(uint16 instance_id);
|
||||||
|
|
||||||
static AdventureManager* Instance()
|
|
||||||
{
|
|
||||||
static AdventureManager instance;
|
|
||||||
return &instance;
|
|
||||||
}
|
|
||||||
protected:
|
protected:
|
||||||
bool IsInExcludedZoneList(std::list<AdventureZones> excluded_zones, std::string zone_name, int version);
|
bool IsInExcludedZoneList(std::list<AdventureZones> excluded_zones, std::string zone_name, int version);
|
||||||
bool IsInExcludedZoneInList(std::list<AdventureZoneIn> excluded_zone_ins, int zone_id, int door_object);
|
bool IsInExcludedZoneInList(std::list<AdventureZoneIn> excluded_zone_ins, int zone_id, int door_object);
|
||||||
|
|||||||
@@ -12,9 +12,9 @@ void WorldserverCLI::EtlGetSettings(int argc, char **argv, argh::parser &cmd, st
|
|||||||
Json::Value etl_settings;
|
Json::Value etl_settings;
|
||||||
Json::Value player_events;
|
Json::Value player_events;
|
||||||
|
|
||||||
PlayerEventLogs::Instance()->SetDatabase(&database)->Init();
|
player_event_logs.SetDatabase(&database)->Init();
|
||||||
auto event_settings = PlayerEventLogs::Instance()->GetSettings();
|
auto event_settings = player_event_logs.GetSettings();
|
||||||
auto etl_details = PlayerEventLogs::Instance()->GetEtlSettings();
|
auto etl_details = player_event_logs.GetEtlSettings();
|
||||||
|
|
||||||
for (int i = PlayerEvent::GM_COMMAND; i < PlayerEvent::EventType::MAX; i++) {
|
for (int i = PlayerEvent::GM_COMMAND; i < PlayerEvent::EventType::MAX; i++) {
|
||||||
player_events["event_id"] = event_settings[i].id;
|
player_events["event_id"] = event_settings[i].id;
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ void WorldserverCLI::ExpansionTestCommand(int argc, char **argv, argh::parser &c
|
|||||||
LogInfo("No rule set configured, using default rules");
|
LogInfo("No rule set configured, using default rules");
|
||||||
}
|
}
|
||||||
|
|
||||||
WorldContentService::Instance()->SetCurrentExpansion(RuleI(Expansion, CurrentExpansion));
|
content_service.SetCurrentExpansion(RuleI(Expansion, CurrentExpansion));
|
||||||
|
|
||||||
std::vector<ContentFlagsRepository::ContentFlags> flags = {};
|
std::vector<ContentFlagsRepository::ContentFlags> flags = {};
|
||||||
auto f = ContentFlagsRepository::NewEntity();
|
auto f = ContentFlagsRepository::NewEntity();
|
||||||
@@ -32,13 +32,13 @@ void WorldserverCLI::ExpansionTestCommand(int argc, char **argv, argh::parser &c
|
|||||||
flags.push_back(f);
|
flags.push_back(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
WorldContentService::Instance()->SetContentFlags(flags);
|
content_service.SetContentFlags(flags);
|
||||||
|
|
||||||
LogInfo(
|
LogInfo(
|
||||||
"Current expansion is [{}] ({}) is Velious Enabled [{}] Criteria [{}]",
|
"Current expansion is [{}] ({}) is Velious Enabled [{}] Criteria [{}]",
|
||||||
WorldContentService::Instance()->GetCurrentExpansion(),
|
content_service.GetCurrentExpansion(),
|
||||||
WorldContentService::Instance()->GetCurrentExpansionName(),
|
content_service.GetCurrentExpansionName(),
|
||||||
WorldContentService::Instance()->IsTheScarsOfVeliousEnabled() ? "true" : "false",
|
content_service.IsTheScarsOfVeliousEnabled() ? "true" : "false",
|
||||||
ContentFilterCriteria::apply()
|
ContentFilterCriteria::apply()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
+21
-38
@@ -36,7 +36,6 @@
|
|||||||
#include "../common/shareddb.h"
|
#include "../common/shareddb.h"
|
||||||
#include "../common/opcodemgr.h"
|
#include "../common/opcodemgr.h"
|
||||||
#include "../common/data_verification.h"
|
#include "../common/data_verification.h"
|
||||||
#include "../common/data_bucket.h"
|
|
||||||
|
|
||||||
#include "client.h"
|
#include "client.h"
|
||||||
#include "worlddb.h"
|
#include "worlddb.h"
|
||||||
@@ -89,6 +88,10 @@
|
|||||||
std::vector<RaceClassAllocation> character_create_allocations;
|
std::vector<RaceClassAllocation> character_create_allocations;
|
||||||
std::vector<RaceClassCombos> character_create_race_class_combos;
|
std::vector<RaceClassCombos> character_create_race_class_combos;
|
||||||
|
|
||||||
|
extern ZSList zoneserver_list;
|
||||||
|
extern LoginServerList loginserverlist;
|
||||||
|
extern ClientList client_list;
|
||||||
|
extern EQ::Random emu_random;
|
||||||
extern uint32 numclients;
|
extern uint32 numclients;
|
||||||
extern volatile bool RunLoops;
|
extern volatile bool RunLoops;
|
||||||
extern volatile bool UCSServerAvailable_;
|
extern volatile bool UCSServerAvailable_;
|
||||||
@@ -132,8 +135,6 @@ Client::Client(EQStreamInterface* ieqs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
Client::~Client() {
|
Client::~Client() {
|
||||||
ClearDataBucketsCache();
|
|
||||||
|
|
||||||
if (RunLoops && cle && zone_id == 0)
|
if (RunLoops && cle && zone_id == 0)
|
||||||
cle->SetOnline(CLE_Status::Offline);
|
cle->SetOnline(CLE_Status::Offline);
|
||||||
|
|
||||||
@@ -475,9 +476,7 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app)
|
|||||||
|
|
||||||
LogClientLogin("Checking authentication id [{}]", id);
|
LogClientLogin("Checking authentication id [{}]", id);
|
||||||
|
|
||||||
if ((cle = ClientList::Instance()->CheckAuth(id, password))) {
|
if ((cle = client_list.CheckAuth(id, password))) {
|
||||||
LoadDataBucketsCache();
|
|
||||||
|
|
||||||
LogClientLogin("Checking authentication id [{}] passed", id);
|
LogClientLogin("Checking authentication id [{}] passed", id);
|
||||||
if (!is_player_zoning) {
|
if (!is_player_zoning) {
|
||||||
// Track who is in and who is out of the game
|
// Track who is in and who is out of the game
|
||||||
@@ -515,7 +514,7 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app)
|
|||||||
ServerLSPlayerJoinWorld_Struct* join =(ServerLSPlayerJoinWorld_Struct*)pack->pBuffer;
|
ServerLSPlayerJoinWorld_Struct* join =(ServerLSPlayerJoinWorld_Struct*)pack->pBuffer;
|
||||||
strcpy(join->key,GetLSKey());
|
strcpy(join->key,GetLSKey());
|
||||||
join->lsaccount_id = GetLSID();
|
join->lsaccount_id = GetLSID();
|
||||||
LoginServerList::Instance()->SendPacket(pack);
|
loginserverlist.SendPacket(pack);
|
||||||
safe_delete(pack);
|
safe_delete(pack);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -798,7 +797,7 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) {
|
|||||||
RuleB(World, EnableIPExemptions) ||
|
RuleB(World, EnableIPExemptions) ||
|
||||||
RuleI(World, MaxClientsPerIP) > 0
|
RuleI(World, MaxClientsPerIP) > 0
|
||||||
) {
|
) {
|
||||||
ClientList::Instance()->GetCLEIP(GetIP()); //Check current CLE Entry IPs against incoming connection
|
client_list.GetCLEIP(GetIP()); //Check current CLE Entry IPs against incoming connection
|
||||||
}
|
}
|
||||||
|
|
||||||
auto ew = (EnterWorld_Struct *) app->pBuffer;
|
auto ew = (EnterWorld_Struct *) app->pBuffer;
|
||||||
@@ -818,7 +817,7 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto r = WorldContentService::Instance()->FindZone(zone_id, instance_id);
|
auto r = content_service.FindZone(zone_id, instance_id);
|
||||||
if (r.zone_id && r.instance.id != instance_id) {
|
if (r.zone_id && r.instance.id != instance_id) {
|
||||||
LogInfo(
|
LogInfo(
|
||||||
"Zone [{}] has been remapped to instance_id [{}] from instance_id [{}] for client [{}]",
|
"Zone [{}] has been remapped to instance_id [{}] from instance_id [{}] for client [{}]",
|
||||||
@@ -985,7 +984,7 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) {
|
|||||||
safe_delete(outapp);
|
safe_delete(outapp);
|
||||||
|
|
||||||
// set mailkey - used for duration of character session
|
// set mailkey - used for duration of character session
|
||||||
int mail_key = EQ::Random::Instance()->Int(1, INT_MAX);
|
int mail_key = emu_random.Int(1, INT_MAX);
|
||||||
|
|
||||||
database.SetMailKey(charid, GetIP(), mail_key);
|
database.SetMailKey(charid, GetIP(), mail_key);
|
||||||
if (UCSServerAvailable_) {
|
if (UCSServerAvailable_) {
|
||||||
@@ -1098,7 +1097,7 @@ bool Client::HandlePacket(const EQApplicationPacket *app) {
|
|||||||
OpcodeManager::EmuToName(app->GetOpcode()),
|
OpcodeManager::EmuToName(app->GetOpcode()),
|
||||||
o->EmuToEQ(app->GetOpcode()) == 0 ? app->GetProtocolOpcode() : o->EmuToEQ(app->GetOpcode()),
|
o->EmuToEQ(app->GetOpcode()) == 0 ? app->GetProtocolOpcode() : o->EmuToEQ(app->GetOpcode()),
|
||||||
app->Size(),
|
app->Size(),
|
||||||
(EQEmuLogSys::Instance()->IsLogEnabled(Logs::Detail, Logs::PacketClientServer) ? DumpPacketToString(app) : "")
|
(LogSys.IsLogEnabled(Logs::Detail, Logs::PacketClientServer) ? DumpPacketToString(app) : "")
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!eqs->CheckState(ESTABLISHED)) {
|
if (!eqs->CheckState(ESTABLISHED)) {
|
||||||
@@ -1247,7 +1246,7 @@ bool Client::Process() {
|
|||||||
ServerLSPlayerLeftWorld_Struct* logout =(ServerLSPlayerLeftWorld_Struct*)pack->pBuffer;
|
ServerLSPlayerLeftWorld_Struct* logout =(ServerLSPlayerLeftWorld_Struct*)pack->pBuffer;
|
||||||
strcpy(logout->key,GetLSKey());
|
strcpy(logout->key,GetLSKey());
|
||||||
logout->lsaccount_id = GetLSID();
|
logout->lsaccount_id = GetLSID();
|
||||||
LoginServerList::Instance()->SendPacket(pack);
|
loginserverlist.SendPacket(pack);
|
||||||
safe_delete(pack);
|
safe_delete(pack);
|
||||||
}
|
}
|
||||||
LogInfo("Client disconnected (not active in process)");
|
LogInfo("Client disconnected (not active in process)");
|
||||||
@@ -1413,18 +1412,18 @@ void Client::EnterWorld(bool TryBootup) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
zone_server = ZSList::Instance()->FindByInstanceID(instance_id);
|
zone_server = zoneserver_list.FindByInstanceID(instance_id);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
zone_server = ZSList::Instance()->FindByZoneID(zone_id);
|
zone_server = zoneserver_list.FindByZoneID(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *zone_name = ZoneName(zone_id, true);
|
const char *zone_name = ZoneName(zone_id, true);
|
||||||
if (zone_server) {
|
if (zone_server) {
|
||||||
if (false == enter_world_triggered) {
|
if (false == enter_world_triggered) {
|
||||||
//Drop any clients we own in other zones.
|
//Drop any clients we own in other zones.
|
||||||
ZSList::Instance()->DropClient(GetLSID(), zone_server);
|
zoneserver_list.DropClient(GetLSID(), zone_server);
|
||||||
|
|
||||||
// warn the zone we're coming
|
// warn the zone we're coming
|
||||||
zone_server->IncomingClient(this);
|
zone_server->IncomingClient(this);
|
||||||
@@ -1437,7 +1436,7 @@ void Client::EnterWorld(bool TryBootup) {
|
|||||||
if (TryBootup) {
|
if (TryBootup) {
|
||||||
LogInfo("Attempting autobootup of [{}] [{}] [{}]", zone_name, zone_id, instance_id);
|
LogInfo("Attempting autobootup of [{}] [{}] [{}]", zone_name, zone_id, instance_id);
|
||||||
autobootup_timeout.Start();
|
autobootup_timeout.Start();
|
||||||
zone_waiting_for_bootup = ZSList::Instance()->TriggerBootup(zone_id, instance_id);
|
zone_waiting_for_bootup = zoneserver_list.TriggerBootup(zone_id, instance_id);
|
||||||
if (zone_waiting_for_bootup == 0) {
|
if (zone_waiting_for_bootup == 0) {
|
||||||
LogInfo("No zoneserver available to boot up");
|
LogInfo("No zoneserver available to boot up");
|
||||||
TellClientZoneUnavailable();
|
TellClientZoneUnavailable();
|
||||||
@@ -1453,7 +1452,7 @@ void Client::EnterWorld(bool TryBootup) {
|
|||||||
|
|
||||||
zone_waiting_for_bootup = 0;
|
zone_waiting_for_bootup = 0;
|
||||||
|
|
||||||
if (GetAdmin() < 80 && ZSList::Instance()->IsZoneLocked(zone_id)) {
|
if (GetAdmin() < 80 && zoneserver_list.IsZoneLocked(zone_id)) {
|
||||||
LogInfo("Enter world failed. Zone is locked");
|
LogInfo("Enter world failed. Zone is locked");
|
||||||
TellClientZoneUnavailable();
|
TellClientZoneUnavailable();
|
||||||
return;
|
return;
|
||||||
@@ -1499,11 +1498,11 @@ void Client::Clearance(int8 response)
|
|||||||
ZoneServer* zs = nullptr;
|
ZoneServer* zs = nullptr;
|
||||||
if(instance_id > 0)
|
if(instance_id > 0)
|
||||||
{
|
{
|
||||||
zs = ZSList::Instance()->FindByInstanceID(instance_id);
|
zs = zoneserver_list.FindByInstanceID(instance_id);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
zs = ZSList::Instance()->FindByZoneID(zone_id);
|
zs = zoneserver_list.FindByZoneID(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(zs == 0 || response == -1 || response == 0)
|
if(zs == 0 || response == -1 || response == 0)
|
||||||
@@ -2172,7 +2171,7 @@ void Client::SetClassStartingSkills(PlayerProfile_Struct *pp)
|
|||||||
i == EQ::skills::SkillAlcoholTolerance || i == EQ::skills::SkillBindWound)
|
i == EQ::skills::SkillAlcoholTolerance || i == EQ::skills::SkillBindWound)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
pp->skills[i] = SkillCaps::Instance()->GetSkillCap(pp->class_, (EQ::skills::SkillType)i, 1).cap;
|
pp->skills[i] = skill_caps.GetSkillCap(pp->class_, (EQ::skills::SkillType)i, 1).cap;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2370,7 +2369,7 @@ bool Client::StoreCharacter(
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string& zone_name = ZoneStore::Instance()->GetZoneName(p_player_profile_struct->zone_id, true);
|
const std::string& zone_name = zone_store.GetZoneName(p_player_profile_struct->zone_id, true);
|
||||||
if (Strings::EqualFold(zone_name, "UNKNOWN")) {
|
if (Strings::EqualFold(zone_name, "UNKNOWN")) {
|
||||||
p_player_profile_struct->zone_id = Zones::QEYNOS;
|
p_player_profile_struct->zone_id = Zones::QEYNOS;
|
||||||
}
|
}
|
||||||
@@ -2428,7 +2427,7 @@ bool Client::StoreCharacter(
|
|||||||
|
|
||||||
void Client::RecordPossibleHack(const std::string& message)
|
void Client::RecordPossibleHack(const std::string& message)
|
||||||
{
|
{
|
||||||
if (PlayerEventLogs::Instance()->IsEventEnabled(PlayerEvent::POSSIBLE_HACK)) {
|
if (player_event_logs.IsEventEnabled(PlayerEvent::POSSIBLE_HACK)) {
|
||||||
auto event = PlayerEvent::PossibleHackEvent{.message = message};
|
auto event = PlayerEvent::PossibleHackEvent{.message = message};
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
{
|
{
|
||||||
@@ -2519,19 +2518,3 @@ void Client::SendUnsupportedClientPacket(const std::string& message)
|
|||||||
|
|
||||||
QueuePacket(&packet);
|
QueuePacket(&packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::LoadDataBucketsCache()
|
|
||||||
{
|
|
||||||
DataBucket::BulkLoadEntitiesToCache(DataBucketLoadType::Account, {GetAccountID()});
|
|
||||||
const auto ids = CharacterDataRepository::GetCharacterIDsByAccountID(database, GetAccountID());
|
|
||||||
DataBucket::BulkLoadEntitiesToCache(DataBucketLoadType::Client, ids);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Client::ClearDataBucketsCache()
|
|
||||||
{
|
|
||||||
DataBucket::DeleteFromCache(GetAccountID(), DataBucketLoadType::Account);
|
|
||||||
auto ids = CharacterDataRepository::GetCharacterIDsByAccountID(database, GetAccountID());
|
|
||||||
for (const auto& id : ids) {
|
|
||||||
DataBucket::DeleteFromCache(id, DataBucketLoadType::Client);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -121,9 +121,6 @@ private:
|
|||||||
bool CanTradeFVNoDropItem();
|
bool CanTradeFVNoDropItem();
|
||||||
void RecordPossibleHack(const std::string& message);
|
void RecordPossibleHack(const std::string& message);
|
||||||
void SendUnsupportedClientPacket(const std::string& message);
|
void SendUnsupportedClientPacket(const std::string& message);
|
||||||
|
|
||||||
void LoadDataBucketsCache();
|
|
||||||
void ClearDataBucketsCache();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
bool CheckCharCreateInfoSoF(CharCreate_Struct *cc);
|
bool CheckCharCreateInfoSoF(CharCreate_Struct *cc);
|
||||||
|
|||||||
@@ -9,7 +9,10 @@
|
|||||||
#include "world_config.h"
|
#include "world_config.h"
|
||||||
|
|
||||||
extern uint32 numplayers;
|
extern uint32 numplayers;
|
||||||
|
extern LoginServerList loginserverlist;
|
||||||
|
extern ClientList client_list;
|
||||||
extern volatile bool RunLoops;
|
extern volatile bool RunLoops;
|
||||||
|
extern SharedTaskManager shared_task_manager;
|
||||||
|
|
||||||
ClientListEntry::ClientListEntry(
|
ClientListEntry::ClientListEntry(
|
||||||
uint32 id,
|
uint32 id,
|
||||||
@@ -91,7 +94,7 @@ ClientListEntry::~ClientListEntry()
|
|||||||
{
|
{
|
||||||
if (RunLoops) {
|
if (RunLoops) {
|
||||||
Camp(); // updates zoneserver's numplayers
|
Camp(); // updates zoneserver's numplayers
|
||||||
ClientList::Instance()->RemoveCLEReferances(this);
|
client_list.RemoveCLEReferances(this);
|
||||||
}
|
}
|
||||||
for (auto &elem: m_tell_queue) {
|
for (auto &elem: m_tell_queue) {
|
||||||
safe_delete_array(elem);
|
safe_delete_array(elem);
|
||||||
@@ -143,7 +146,7 @@ void ClientListEntry::LSUpdate(ZoneServer *iZS)
|
|||||||
zone->count = iZS->NumPlayers();
|
zone->count = iZS->NumPlayers();
|
||||||
zone->zone = iZS->GetZoneID();
|
zone->zone = iZS->GetZoneID();
|
||||||
zone->zone_wid = iZS->GetID();
|
zone->zone_wid = iZS->GetID();
|
||||||
LoginServerList::Instance()->SendPacket(pack);
|
loginserverlist.SendPacket(pack);
|
||||||
safe_delete(pack);
|
safe_delete(pack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -159,7 +162,7 @@ void ClientListEntry::LSZoneChange(ZoneToZone_Struct *ztz)
|
|||||||
zonechange->lsaccount_id = LSID();
|
zonechange->lsaccount_id = LSID();
|
||||||
zonechange->from = ztz->current_zone_id;
|
zonechange->from = ztz->current_zone_id;
|
||||||
zonechange->to = ztz->requested_zone_id;
|
zonechange->to = ztz->requested_zone_id;
|
||||||
LoginServerList::Instance()->SendPacket(pack);
|
loginserverlist.SendPacket(pack);
|
||||||
safe_delete(pack);
|
safe_delete(pack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -221,7 +224,7 @@ void ClientListEntry::LeavingZone(ZoneServer *iZS, CLE_Status iOnline)
|
|||||||
}
|
}
|
||||||
SetOnline(iOnline);
|
SetOnline(iOnline);
|
||||||
|
|
||||||
SharedTaskManager::Instance()->RemoveActiveInvitationByCharacterID(CharID());
|
shared_task_manager.RemoveActiveInvitationByCharacterID(CharID());
|
||||||
|
|
||||||
if (m_zone_server) {
|
if (m_zone_server) {
|
||||||
m_zone_server->RemovePlayer();
|
m_zone_server->RemovePlayer();
|
||||||
|
|||||||
+15
-12
@@ -36,6 +36,9 @@
|
|||||||
#include "../common/zone_store.h"
|
#include "../common/zone_store.h"
|
||||||
#include <set>
|
#include <set>
|
||||||
|
|
||||||
|
extern WebInterfaceList web_interface;
|
||||||
|
|
||||||
|
extern ZSList zoneserver_list;
|
||||||
uint32 numplayers = 0; //this really wants to be a member variable of ClientList...
|
uint32 numplayers = 0; //this really wants to be a member variable of ClientList...
|
||||||
|
|
||||||
ClientList::ClientList()
|
ClientList::ClientList()
|
||||||
@@ -231,7 +234,7 @@ void ClientList::DisconnectByIP(uint32 in_ip) {
|
|||||||
strn0cpy(skp->adminname, "SessionLimit", sizeof(skp->adminname));
|
strn0cpy(skp->adminname, "SessionLimit", sizeof(skp->adminname));
|
||||||
strn0cpy(skp->name, cle->name(), sizeof(skp->name));
|
strn0cpy(skp->name, cle->name(), sizeof(skp->name));
|
||||||
skp->adminrank = 255;
|
skp->adminrank = 255;
|
||||||
ZSList::Instance()->SendPacket(pack);
|
zoneserver_list.SendPacket(pack);
|
||||||
safe_delete(pack);
|
safe_delete(pack);
|
||||||
}
|
}
|
||||||
cle->SetOnline(CLE_Status::Offline);
|
cle->SetOnline(CLE_Status::Offline);
|
||||||
@@ -550,7 +553,7 @@ void ClientList::SendOnlineGuildMembers(uint32 FromID, uint32 GuildID)
|
|||||||
|
|
||||||
Iterator.Advance();
|
Iterator.Advance();
|
||||||
}
|
}
|
||||||
ZSList::Instance()->SendPacket(from->zone(), from->instance(), pack);
|
zoneserver_list.SendPacket(from->zone(), from->instance(), pack);
|
||||||
safe_delete(pack);
|
safe_delete(pack);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1315,7 +1318,7 @@ void ClientList::RemoveCLEReferances(ClientListEntry* cle) {
|
|||||||
|
|
||||||
bool ClientList::SendPacket(const char* to, ServerPacket* pack) {
|
bool ClientList::SendPacket(const char* to, ServerPacket* pack) {
|
||||||
if (to == 0 || to[0] == 0) {
|
if (to == 0 || to[0] == 0) {
|
||||||
ZSList::Instance()->SendPacket(pack);
|
zoneserver_list.SendPacket(pack);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (to[0] == '*') {
|
else if (to[0] == '*') {
|
||||||
@@ -1331,7 +1334,7 @@ bool ClientList::SendPacket(const char* to, ServerPacket* pack) {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
ZoneServer* zs = ZSList::Instance()->FindByName(to);
|
ZoneServer* zs = zoneserver_list.FindByName(to);
|
||||||
if (zs != nullptr) {
|
if (zs != nullptr) {
|
||||||
zs->SendPacket(pack);
|
zs->SendPacket(pack);
|
||||||
return true;
|
return true;
|
||||||
@@ -1436,7 +1439,7 @@ void ClientList::SendClientVersionSummary(const char *Name)
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (client_count[EQ::versions::ClientVersion::Titanium]) {
|
if (client_count[EQ::versions::ClientVersion::Titanium]) {
|
||||||
ZSList::Instance()->SendEmoteMessage(
|
zoneserver_list.SendEmoteMessage(
|
||||||
Name,
|
Name,
|
||||||
0,
|
0,
|
||||||
AccountStatus::Player,
|
AccountStatus::Player,
|
||||||
@@ -1449,7 +1452,7 @@ void ClientList::SendClientVersionSummary(const char *Name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (client_count[EQ::versions::ClientVersion::SoF]) {
|
if (client_count[EQ::versions::ClientVersion::SoF]) {
|
||||||
ZSList::Instance()->SendEmoteMessage(
|
zoneserver_list.SendEmoteMessage(
|
||||||
Name,
|
Name,
|
||||||
0,
|
0,
|
||||||
AccountStatus::Player,
|
AccountStatus::Player,
|
||||||
@@ -1462,7 +1465,7 @@ void ClientList::SendClientVersionSummary(const char *Name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (client_count[EQ::versions::ClientVersion::SoD]) {
|
if (client_count[EQ::versions::ClientVersion::SoD]) {
|
||||||
ZSList::Instance()->SendEmoteMessage(
|
zoneserver_list.SendEmoteMessage(
|
||||||
Name,
|
Name,
|
||||||
0,
|
0,
|
||||||
AccountStatus::Player,
|
AccountStatus::Player,
|
||||||
@@ -1475,7 +1478,7 @@ void ClientList::SendClientVersionSummary(const char *Name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (client_count[EQ::versions::ClientVersion::UF]) {
|
if (client_count[EQ::versions::ClientVersion::UF]) {
|
||||||
ZSList::Instance()->SendEmoteMessage(
|
zoneserver_list.SendEmoteMessage(
|
||||||
Name,
|
Name,
|
||||||
0,
|
0,
|
||||||
AccountStatus::Player,
|
AccountStatus::Player,
|
||||||
@@ -1488,7 +1491,7 @@ void ClientList::SendClientVersionSummary(const char *Name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (client_count[EQ::versions::ClientVersion::RoF]) {
|
if (client_count[EQ::versions::ClientVersion::RoF]) {
|
||||||
ZSList::Instance()->SendEmoteMessage(
|
zoneserver_list.SendEmoteMessage(
|
||||||
Name,
|
Name,
|
||||||
0,
|
0,
|
||||||
AccountStatus::Player,
|
AccountStatus::Player,
|
||||||
@@ -1501,7 +1504,7 @@ void ClientList::SendClientVersionSummary(const char *Name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (client_count[EQ::versions::ClientVersion::RoF2]) {
|
if (client_count[EQ::versions::ClientVersion::RoF2]) {
|
||||||
ZSList::Instance()->SendEmoteMessage(
|
zoneserver_list.SendEmoteMessage(
|
||||||
Name,
|
Name,
|
||||||
0,
|
0,
|
||||||
AccountStatus::Player,
|
AccountStatus::Player,
|
||||||
@@ -1514,7 +1517,7 @@ void ClientList::SendClientVersionSummary(const char *Name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ZSList::Instance()->SendEmoteMessage(
|
zoneserver_list.SendEmoteMessage(
|
||||||
Name,
|
Name,
|
||||||
0,
|
0,
|
||||||
AccountStatus::Player,
|
AccountStatus::Player,
|
||||||
@@ -1610,7 +1613,7 @@ void ClientList::OnTick(EQ::Timer *t)
|
|||||||
Iterator.Advance();
|
Iterator.Advance();
|
||||||
}
|
}
|
||||||
|
|
||||||
WebInterfaceList::Instance()->SendEvent(out);
|
web_interface.SendEvent(out);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user