mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-31 13:16:39 +00:00
Compare commits
51 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 78b0c86442 | |||
| ce3d3153d8 | |||
| 92cc457067 | |||
| 9780623fea | |||
| d89bcf4f6c | |||
| 34b3a3fc88 | |||
| 8f54abec61 | |||
| ed4d72c54b | |||
| 2d8ef8d286 | |||
| 6424e6a3f3 | |||
| 8606ccffc9 | |||
| 2bf02a5be5 | |||
| abc507d173 | |||
| c18cba4faf | |||
| 010ba01ee7 | |||
| 75698a809f | |||
| 37a7b7fc41 | |||
| f21cc170df | |||
| d47bf687d0 | |||
| 035c51944f | |||
| c2ebc2540a | |||
| c82f1b9afc | |||
| 15684567cf | |||
| 533dc997fd | |||
| 03b30d5c7a | |||
| d89f9bdcc7 | |||
| 490cffb5ea | |||
| d95b64e0b8 | |||
| 1ed282f6ff | |||
| a3a498634f | |||
| c44596b38a | |||
| fe43d26dd6 | |||
| 3155b82abb | |||
| 4c6aaa6995 | |||
| c82dee575a | |||
| 33db85f2ee | |||
| b40e4ce7cd | |||
| 20ff325013 | |||
| 8a7d5e72cb | |||
| 4493ebebab | |||
| 77793f364e | |||
| e258aaa068 | |||
| 3b779ef301 | |||
| 3f3c0f2fda | |||
| 0f164c456e | |||
| 6172c49b08 | |||
| 66a7dd0143 | |||
| 5c6e7a8b09 | |||
| bd85fc96a0 | |||
| 8e40e5357c | |||
| 5f0b999ca9 |
@@ -1,3 +1,68 @@
|
|||||||
|
## [22.61.0] 1/6/2025
|
||||||
|
|
||||||
|
### Bots
|
||||||
|
|
||||||
|
* Fix AA ranks to account for level ([#4567](https://github.com/EQEmu/Server/pull/4567)) @nytmyr 2024-12-07
|
||||||
|
|
||||||
|
### Code
|
||||||
|
|
||||||
|
* Convert Event Parses to Single Line ([#4569](https://github.com/EQEmu/Server/pull/4569)) @Kinglykrab 2024-12-12
|
||||||
|
* Fix GM Flag Spell Restriction Bypasses ([#4571](https://github.com/EQEmu/Server/pull/4571)) @Kinglykrab 2025-01-06
|
||||||
|
* Remove Unused Group Methods ([#4559](https://github.com/EQEmu/Server/pull/4559)) @Kinglykrab 2024-12-12
|
||||||
|
|
||||||
|
### Commands
|
||||||
|
|
||||||
|
* Add #find bot Subcommand ([#4563](https://github.com/EQEmu/Server/pull/4563)) @Kinglykrab 2024-12-12
|
||||||
|
* Add #find ldon_theme Subcommand ([#4564](https://github.com/EQEmu/Server/pull/4564)) @Kinglykrab 2024-12-12
|
||||||
|
* Fix #copycharacter ([#4582](https://github.com/EQEmu/Server/pull/4582)) @Akkadius 2025-01-06
|
||||||
|
|
||||||
|
### Databuckets
|
||||||
|
|
||||||
|
* Improved Reliability and Performance of Databuckets ([#4562](https://github.com/EQEmu/Server/pull/4562)) @Akkadius 2024-12-12
|
||||||
|
|
||||||
|
### Feature
|
||||||
|
|
||||||
|
* Enable bazaar window 'Find Trader' functionality ([#4560](https://github.com/EQEmu/Server/pull/4560)) @neckkola 2024-12-12
|
||||||
|
|
||||||
|
### Filesystem
|
||||||
|
|
||||||
|
* Path Manager Improvements ([#4557](https://github.com/EQEmu/Server/pull/4557)) @Akkadius 2025-01-06
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
|
||||||
|
* Allow Items in ROF2 to Stack to 32,767 ([#4556](https://github.com/EQEmu/Server/pull/4556)) @Kinglykrab 2024-12-12
|
||||||
|
* Fix EVENT_COMBAT on NPC Death ([#4558](https://github.com/EQEmu/Server/pull/4558)) @Kinglykrab 2024-11-28
|
||||||
|
* Guild Membership Update Fix ([#4581](https://github.com/EQEmu/Server/pull/4581)) @neckkola 2025-01-06
|
||||||
|
* Guild creation to propagate across zones ([#4575](https://github.com/EQEmu/Server/pull/4575)) @neckkola 2025-01-06
|
||||||
|
* Repair a EQEMUConfig Memory Leak ([#4584](https://github.com/EQEmu/Server/pull/4584)) @neckkola 2025-01-06
|
||||||
|
* Repair a LoadNPCEmote MemoryLeak ([#4586](https://github.com/EQEmu/Server/pull/4586)) @neckkola 2025-01-06
|
||||||
|
* Repair a memory leak in GuildsList ([#4585](https://github.com/EQEmu/Server/pull/4585)) @neckkola 2025-01-06
|
||||||
|
* Resolve a client crash when logging in or zoning ([#4572](https://github.com/EQEmu/Server/pull/4572)) @neckkola 2024-12-14
|
||||||
|
|
||||||
|
### Groups
|
||||||
|
|
||||||
|
* Fix AmIMainAssist incorrectly checking for MainTankName ([#4565](https://github.com/EQEmu/Server/pull/4565)) @nytmyr 2024-12-04
|
||||||
|
|
||||||
|
### Inventory
|
||||||
|
|
||||||
|
* Add GetInventorySlots() Method ([#4566](https://github.com/EQEmu/Server/pull/4566)) @Kinglykrab 2025-01-06
|
||||||
|
|
||||||
|
### Logs
|
||||||
|
|
||||||
|
* Improve Crash log defaults ([#4579](https://github.com/EQEmu/Server/pull/4579)) @Akkadius 2025-01-06
|
||||||
|
|
||||||
|
### Maps
|
||||||
|
|
||||||
|
* Fix broken Map MMFS implementation ([#4576](https://github.com/EQEmu/Server/pull/4576)) @Akkadius 2025-01-06
|
||||||
|
|
||||||
|
### Network
|
||||||
|
|
||||||
|
* Prune / disconnect TCP connections gracefully ([#4574](https://github.com/EQEmu/Server/pull/4574)) @Akkadius 2025-01-06
|
||||||
|
|
||||||
|
### Rules
|
||||||
|
|
||||||
|
* Add rules for requiring custom files from client ([#4561](https://github.com/EQEmu/Server/pull/4561)) @knervous 2024-12-12
|
||||||
|
|
||||||
## [22.60.0] 11/25/2024
|
## [22.60.0] 11/25/2024
|
||||||
|
|
||||||
### Bazaar
|
### Bazaar
|
||||||
|
|||||||
@@ -37,6 +37,9 @@ IF(EQEMU_ADD_PROFILER)
|
|||||||
SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--no-as-needed,-lprofiler,--as-needed")
|
SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--no-as-needed,-lprofiler,--as-needed")
|
||||||
ENDIF(EQEMU_ADD_PROFILER)
|
ENDIF(EQEMU_ADD_PROFILER)
|
||||||
|
|
||||||
|
IF(USE_MAP_MMFS)
|
||||||
|
ADD_DEFINITIONS(-DUSE_MAP_MMFS)
|
||||||
|
ENDIF (USE_MAP_MMFS)
|
||||||
|
|
||||||
IF(MSVC)
|
IF(MSVC)
|
||||||
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
|
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
|
||||||
|
|||||||
@@ -36,12 +36,14 @@
|
|||||||
#include "../../common/file.h"
|
#include "../../common/file.h"
|
||||||
#include "../../common/events/player_event_logs.h"
|
#include "../../common/events/player_event_logs.h"
|
||||||
#include "../../common/skill_caps.h"
|
#include "../../common/skill_caps.h"
|
||||||
|
#include "../../common/evolving_items.h"
|
||||||
|
|
||||||
EQEmuLogSys LogSys;
|
EQEmuLogSys LogSys;
|
||||||
WorldContentService content_service;
|
WorldContentService content_service;
|
||||||
ZoneStore zone_store;
|
ZoneStore zone_store;
|
||||||
PathManager path;
|
PathManager path;
|
||||||
PlayerEventLogs player_event_logs;
|
PlayerEventLogs player_event_logs;
|
||||||
|
EvolvingItemsManager evolving_items_manager;
|
||||||
|
|
||||||
void ExportSpells(SharedDatabase *db);
|
void ExportSpells(SharedDatabase *db);
|
||||||
void ExportSkillCaps(SharedDatabase *db);
|
void ExportSkillCaps(SharedDatabase *db);
|
||||||
|
|||||||
@@ -30,12 +30,14 @@
|
|||||||
#include "../../common/repositories/base_data_repository.h"
|
#include "../../common/repositories/base_data_repository.h"
|
||||||
#include "../../common/file.h"
|
#include "../../common/file.h"
|
||||||
#include "../../common/events/player_event_logs.h"
|
#include "../../common/events/player_event_logs.h"
|
||||||
|
#include "../../common/evolving_items.h"
|
||||||
|
|
||||||
EQEmuLogSys LogSys;
|
EQEmuLogSys LogSys;
|
||||||
WorldContentService content_service;
|
WorldContentService content_service;
|
||||||
ZoneStore zone_store;
|
ZoneStore zone_store;
|
||||||
PathManager path;
|
PathManager path;
|
||||||
PlayerEventLogs player_event_logs;
|
PlayerEventLogs player_event_logs;
|
||||||
|
EvolvingItemsManager evolving_items_manager;
|
||||||
|
|
||||||
void ImportSpells(SharedDatabase *db);
|
void ImportSpells(SharedDatabase *db);
|
||||||
void ImportSkillCaps(SharedDatabase *db);
|
void ImportSkillCaps(SharedDatabase *db);
|
||||||
|
|||||||
+6
-12
@@ -39,6 +39,7 @@ SET(common_sources
|
|||||||
event_sub.cpp
|
event_sub.cpp
|
||||||
events/player_event_logs.cpp
|
events/player_event_logs.cpp
|
||||||
events/player_event_discord_formatter.cpp
|
events/player_event_discord_formatter.cpp
|
||||||
|
evolving_items.cpp
|
||||||
expedition_lockout_timer.cpp
|
expedition_lockout_timer.cpp
|
||||||
extprofile.cpp
|
extprofile.cpp
|
||||||
discord/discord_manager.cpp
|
discord/discord_manager.cpp
|
||||||
@@ -112,8 +113,6 @@ SET(common_sources
|
|||||||
net/websocket_server.cpp
|
net/websocket_server.cpp
|
||||||
net/websocket_server_connection.cpp
|
net/websocket_server_connection.cpp
|
||||||
patches/patches.cpp
|
patches/patches.cpp
|
||||||
patches/laurion.cpp
|
|
||||||
patches/laurion_limits.cpp
|
|
||||||
patches/sod.cpp
|
patches/sod.cpp
|
||||||
patches/sod_limits.cpp
|
patches/sod_limits.cpp
|
||||||
patches/sof.cpp
|
patches/sof.cpp
|
||||||
@@ -174,6 +173,7 @@ SET(repositories
|
|||||||
repositories/base/base_character_currency_repository.h
|
repositories/base/base_character_currency_repository.h
|
||||||
repositories/base/base_character_data_repository.h
|
repositories/base/base_character_data_repository.h
|
||||||
repositories/base/base_character_disciplines_repository.h
|
repositories/base/base_character_disciplines_repository.h
|
||||||
|
repositories/base/base_character_evolving_items_repository.h
|
||||||
repositories/base/base_character_expedition_lockouts_repository.h
|
repositories/base/base_character_expedition_lockouts_repository.h
|
||||||
repositories/base/base_character_exp_modifiers_repository.h
|
repositories/base/base_character_exp_modifiers_repository.h
|
||||||
repositories/base/base_character_inspect_messages_repository.h
|
repositories/base/base_character_inspect_messages_repository.h
|
||||||
@@ -242,6 +242,7 @@ SET(repositories
|
|||||||
repositories/base/base_inventory_snapshots_repository.h
|
repositories/base/base_inventory_snapshots_repository.h
|
||||||
repositories/base/base_ip_exemptions_repository.h
|
repositories/base/base_ip_exemptions_repository.h
|
||||||
repositories/base/base_items_repository.h
|
repositories/base/base_items_repository.h
|
||||||
|
repositories/base/base_items_evolving_details_repository.h
|
||||||
repositories/base/base_ldon_trap_entries_repository.h
|
repositories/base/base_ldon_trap_entries_repository.h
|
||||||
repositories/base/base_ldon_trap_templates_repository.h
|
repositories/base/base_ldon_trap_templates_repository.h
|
||||||
repositories/base/base_level_exp_mods_repository.h
|
repositories/base/base_level_exp_mods_repository.h
|
||||||
@@ -357,6 +358,7 @@ SET(repositories
|
|||||||
repositories/character_currency_repository.h
|
repositories/character_currency_repository.h
|
||||||
repositories/character_data_repository.h
|
repositories/character_data_repository.h
|
||||||
repositories/character_disciplines_repository.h
|
repositories/character_disciplines_repository.h
|
||||||
|
repositories/character_evolving_items_repository.h
|
||||||
repositories/character_expedition_lockouts_repository.h
|
repositories/character_expedition_lockouts_repository.h
|
||||||
repositories/character_exp_modifiers_repository.h
|
repositories/character_exp_modifiers_repository.h
|
||||||
repositories/character_inspect_messages_repository.h
|
repositories/character_inspect_messages_repository.h
|
||||||
@@ -425,6 +427,7 @@ SET(repositories
|
|||||||
repositories/inventory_snapshots_repository.h
|
repositories/inventory_snapshots_repository.h
|
||||||
repositories/ip_exemptions_repository.h
|
repositories/ip_exemptions_repository.h
|
||||||
repositories/items_repository.h
|
repositories/items_repository.h
|
||||||
|
repositories/items_evolving_details_repository.h
|
||||||
repositories/ldon_trap_entries_repository.h
|
repositories/ldon_trap_entries_repository.h
|
||||||
repositories/ldon_trap_templates_repository.h
|
repositories/ldon_trap_templates_repository.h
|
||||||
repositories/level_exp_mods_repository.h
|
repositories/level_exp_mods_repository.h
|
||||||
@@ -557,6 +560,7 @@ SET(common_headers
|
|||||||
events/player_event_discord_formatter.h
|
events/player_event_discord_formatter.h
|
||||||
events/player_events.h
|
events/player_events.h
|
||||||
event_sub.h
|
event_sub.h
|
||||||
|
evolving_items.h
|
||||||
expedition_lockout_timer.h
|
expedition_lockout_timer.h
|
||||||
extprofile.h
|
extprofile.h
|
||||||
faction.h
|
faction.h
|
||||||
@@ -657,10 +661,6 @@ SET(common_headers
|
|||||||
net/websocket_server.h
|
net/websocket_server.h
|
||||||
net/websocket_server_connection.h
|
net/websocket_server_connection.h
|
||||||
patches/patches.h
|
patches/patches.h
|
||||||
patches/laurion.h
|
|
||||||
patches/laurion_limits.h
|
|
||||||
patches/laurion_ops.h
|
|
||||||
patches/laurion_structs.h
|
|
||||||
patches/sod.h
|
patches/sod.h
|
||||||
patches/sod_limits.h
|
patches/sod_limits.h
|
||||||
patches/sod_ops.h
|
patches/sod_ops.h
|
||||||
@@ -747,10 +747,6 @@ SOURCE_GROUP(Net FILES
|
|||||||
|
|
||||||
SOURCE_GROUP(Patches FILES
|
SOURCE_GROUP(Patches FILES
|
||||||
patches/patches.h
|
patches/patches.h
|
||||||
patches/laurion.h
|
|
||||||
patches/laurion_limits.h
|
|
||||||
patches/laurion_ops.h
|
|
||||||
patches/laurion_structs.h
|
|
||||||
patches/sod.h
|
patches/sod.h
|
||||||
patches/sod_limits.h
|
patches/sod_limits.h
|
||||||
patches/sod_ops.h
|
patches/sod_ops.h
|
||||||
@@ -779,8 +775,6 @@ SOURCE_GROUP(Patches FILES
|
|||||||
patches/uf_ops.h
|
patches/uf_ops.h
|
||||||
patches/uf_structs.h
|
patches/uf_structs.h
|
||||||
patches/patches.cpp
|
patches/patches.cpp
|
||||||
patches/laurion.cpp
|
|
||||||
patches/laurion_limits.cpp
|
|
||||||
patches/sod.cpp
|
patches/sod.cpp
|
||||||
patches/sod_limits.cpp
|
patches/sod_limits.cpp
|
||||||
patches/sof.cpp
|
patches/sof.cpp
|
||||||
|
|||||||
@@ -59,7 +59,6 @@ public:
|
|||||||
void WriteUInt8(uint8 value) { *(uint8 *)(pBuffer + _wpos) = value; _wpos += sizeof(uint8); }
|
void WriteUInt8(uint8 value) { *(uint8 *)(pBuffer + _wpos) = value; _wpos += sizeof(uint8); }
|
||||||
void WriteUInt32(uint32 value) { *(uint32 *)(pBuffer + _wpos) = value; _wpos += sizeof(uint32); }
|
void WriteUInt32(uint32 value) { *(uint32 *)(pBuffer + _wpos) = value; _wpos += sizeof(uint32); }
|
||||||
void WriteUInt64(uint64 value) { *(uint64 *)(pBuffer + _wpos) = value; _wpos += sizeof(uint64); }
|
void WriteUInt64(uint64 value) { *(uint64 *)(pBuffer + _wpos) = value; _wpos += sizeof(uint64); }
|
||||||
void WriteSInt16(int32 value) { *(int16*)(pBuffer + _wpos) = value; _wpos += sizeof(int16); }
|
|
||||||
void WriteUInt16(uint32 value) { *(uint16 *)(pBuffer + _wpos) = value; _wpos += sizeof(uint16); }
|
void WriteUInt16(uint32 value) { *(uint16 *)(pBuffer + _wpos) = value; _wpos += sizeof(uint16); }
|
||||||
void WriteSInt32(int32 value) { *(int32 *)(pBuffer + _wpos) = value; _wpos += sizeof(int32); }
|
void WriteSInt32(int32 value) { *(int32 *)(pBuffer + _wpos) = value; _wpos += sizeof(int32); }
|
||||||
void WriteFloat(float value) { *(float *)(pBuffer + _wpos) = value; _wpos += sizeof(float); }
|
void WriteFloat(float value) { *(float *)(pBuffer + _wpos) = value; _wpos += sizeof(float); }
|
||||||
|
|||||||
+38
-7
@@ -8,13 +8,14 @@ std::vector<BazaarSearchResultsFromDB_Struct>
|
|||||||
Bazaar::GetSearchResults(
|
Bazaar::GetSearchResults(
|
||||||
SharedDatabase &db,
|
SharedDatabase &db,
|
||||||
BazaarSearchCriteria_Struct search,
|
BazaarSearchCriteria_Struct search,
|
||||||
uint32 char_zone_id
|
uint32 char_zone_id,
|
||||||
|
int32 char_zone_instance_id
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
LogTrading(
|
LogTrading(
|
||||||
"Searching for items with search criteria - item_name [{}] min_cost [{}] max_cost [{}] min_level [{}] "
|
"Searching for items with search criteria - item_name [{}] min_cost [{}] max_cost [{}] min_level [{}] "
|
||||||
"max_level [{}] max_results [{}] prestige [{}] augment [{}] trader_entity_id [{}] trader_id [{}] "
|
"max_level [{}] max_results [{}] prestige [{}] augment [{}] trader_entity_id [{}] trader_id [{}] "
|
||||||
"search_scope [{}] char_zone_id [{}]",
|
"search_scope [{}] char_zone_id [{}], char_zone_instance_id [{}]",
|
||||||
search.item_name,
|
search.item_name,
|
||||||
search.min_cost,
|
search.min_cost,
|
||||||
search.max_cost,
|
search.max_cost,
|
||||||
@@ -26,26 +27,49 @@ Bazaar::GetSearchResults(
|
|||||||
search.trader_entity_id,
|
search.trader_entity_id,
|
||||||
search.trader_id,
|
search.trader_id,
|
||||||
search.search_scope,
|
search.search_scope,
|
||||||
char_zone_id
|
char_zone_id,
|
||||||
|
char_zone_instance_id
|
||||||
);
|
);
|
||||||
|
|
||||||
|
bool convert = false;
|
||||||
std::string search_criteria_trader("TRUE ");
|
std::string search_criteria_trader("TRUE ");
|
||||||
|
|
||||||
if (search.search_scope == NonRoFBazaarSearchScope) {
|
if (search.search_scope == NonRoFBazaarSearchScope) {
|
||||||
search_criteria_trader.append(
|
search_criteria_trader.append(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
" AND trader.char_entity_id = {} AND trader.char_zone_id = {}",
|
" AND trader.char_entity_id = {} AND trader.char_zone_id = {} AND trader.char_zone_instance_id = {}",
|
||||||
search.trader_entity_id,
|
search.trader_entity_id,
|
||||||
Zones::BAZAAR
|
Zones::BAZAAR,
|
||||||
|
char_zone_instance_id
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else if (search.search_scope == Local_Scope) {
|
else if (search.search_scope == Local_Scope) {
|
||||||
search_criteria_trader.append(fmt::format(" AND trader.char_zone_id = {}", char_zone_id));
|
search_criteria_trader.append(fmt::format(
|
||||||
|
" AND trader.char_zone_id = {} AND trader.char_zone_instance_id = {}",
|
||||||
|
char_zone_id,
|
||||||
|
char_zone_instance_id)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
else if (search.trader_id > 0) {
|
else if (search.trader_id > 0) {
|
||||||
|
if (RuleB(Bazaar, UseAlternateBazaarSearch)) {
|
||||||
|
if (search.trader_id >= TraderRepository::TRADER_CONVERT_ID) {
|
||||||
|
convert = true;
|
||||||
|
search_criteria_trader.append(fmt::format(
|
||||||
|
" AND trader.char_zone_id = {} AND trader.char_zone_instance_id = {}",
|
||||||
|
Zones::BAZAAR,
|
||||||
|
search.trader_id - TraderRepository::TRADER_CONVERT_ID)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
search_criteria_trader.append(fmt::format(" AND trader.char_id = {}", search.trader_id));
|
search_criteria_trader.append(fmt::format(" AND trader.char_id = {}", search.trader_id));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
search_criteria_trader.append(fmt::format(" AND trader.char_id = {}", search.trader_id));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (search.min_cost != 0) {
|
if (search.min_cost != 0) {
|
||||||
search_criteria_trader.append(fmt::format(" AND trader.item_cost >= {}", search.min_cost * 1000));
|
search_criteria_trader.append(fmt::format(" AND trader.item_cost >= {}", search.min_cost * 1000));
|
||||||
}
|
}
|
||||||
@@ -62,7 +86,7 @@ Bazaar::GetSearchResults(
|
|||||||
std::string query = fmt::format(
|
std::string query = fmt::format(
|
||||||
"SELECT COUNT(item_id), trader.char_id, trader.item_id, trader.item_sn, trader.item_charges, trader.item_cost, "
|
"SELECT COUNT(item_id), trader.char_id, trader.item_id, trader.item_sn, trader.item_charges, trader.item_cost, "
|
||||||
"trader.slot_id, SUM(trader.item_charges), trader.char_zone_id, trader.char_entity_id, character_data.name, "
|
"trader.slot_id, SUM(trader.item_charges), trader.char_zone_id, trader.char_entity_id, character_data.name, "
|
||||||
"aug_slot_1, aug_slot_2, aug_slot_3, aug_slot_4, aug_slot_5, aug_slot_6 "
|
"aug_slot_1, aug_slot_2, aug_slot_3, aug_slot_4, aug_slot_5, aug_slot_6, trader.char_zone_instance_id "
|
||||||
"FROM trader, character_data "
|
"FROM trader, character_data "
|
||||||
"WHERE {} AND trader.char_id = character_data.id "
|
"WHERE {} AND trader.char_id = character_data.id "
|
||||||
"GROUP BY trader.item_sn, trader.item_charges, trader.char_id",
|
"GROUP BY trader.item_sn, trader.item_charges, trader.char_id",
|
||||||
@@ -131,6 +155,7 @@ Bazaar::GetSearchResults(
|
|||||||
r.stackable = item->Stackable;
|
r.stackable = item->Stackable;
|
||||||
r.icon_id = item->Icon;
|
r.icon_id = item->Icon;
|
||||||
r.trader_zone_id = Strings::ToInt(row[8]);
|
r.trader_zone_id = Strings::ToInt(row[8]);
|
||||||
|
r.trader_zone_instance_id = Strings::ToInt(row[17]);
|
||||||
r.trader_entity_id = Strings::ToInt(row[9]);
|
r.trader_entity_id = Strings::ToInt(row[9]);
|
||||||
r.serial_number_RoF = fmt::format("{:016}\0", Strings::ToInt(row[3]));
|
r.serial_number_RoF = fmt::format("{:016}\0", Strings::ToInt(row[3]));
|
||||||
r.item_name = fmt::format("{:.63}\0", item->Name);
|
r.item_name = fmt::format("{:.63}\0", item->Name);
|
||||||
@@ -347,6 +372,12 @@ Bazaar::GetSearchResults(
|
|||||||
}
|
}
|
||||||
|
|
||||||
LogTradingDetail("Found item [{}] meeting search criteria.", r.item_name);
|
LogTradingDetail("Found item [{}] meeting search criteria.", r.item_name);
|
||||||
|
if (RuleB(Bazaar, UseAlternateBazaarSearch)) {
|
||||||
|
if (convert || (r.trader_zone_id == Zones::BAZAAR && r.trader_zone_instance_id != char_zone_instance_id)) {
|
||||||
|
r.trader_id = TraderRepository::TRADER_CONVERT_ID + r.trader_zone_instance_id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
all_entries.push_back(r);
|
all_entries.push_back(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@
|
|||||||
class Bazaar {
|
class Bazaar {
|
||||||
public:
|
public:
|
||||||
static std::vector<BazaarSearchResultsFromDB_Struct>
|
static std::vector<BazaarSearchResultsFromDB_Struct>
|
||||||
GetSearchResults(SharedDatabase &db, BazaarSearchCriteria_Struct search, unsigned int char_zone_id);
|
GetSearchResults(SharedDatabase &db, BazaarSearchCriteria_Struct search, unsigned int char_zone_id, int char_zone_instance_id);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -71,9 +71,6 @@ namespace Class {
|
|||||||
constexpr uint8 FellowshipMaster = 69;
|
constexpr uint8 FellowshipMaster = 69;
|
||||||
constexpr uint8 AlternateCurrencyMerchant = 70;
|
constexpr uint8 AlternateCurrencyMerchant = 70;
|
||||||
constexpr uint8 MercenaryLiaison = 71;
|
constexpr uint8 MercenaryLiaison = 71;
|
||||||
constexpr uint8 RealEstateMerchant = 72;
|
|
||||||
constexpr uint8 LoyaltyMerchant = 73;
|
|
||||||
constexpr uint8 TributeMaster2 = 74;
|
|
||||||
|
|
||||||
constexpr uint8 PLAYER_CLASS_COUNT = 16;
|
constexpr uint8 PLAYER_CLASS_COUNT = 16;
|
||||||
constexpr uint16 ALL_CLASSES_BITMASK = 65535;
|
constexpr uint16 ALL_CLASSES_BITMASK = 65535;
|
||||||
|
|||||||
@@ -294,6 +294,8 @@ void print_trace()
|
|||||||
SendCrashReport(crash_report);
|
SendCrashReport(crash_report);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LogSys.CloseFileLogs();
|
||||||
|
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -101,24 +101,6 @@ void CRC32::SetEQChecksum(uchar* in_data, uint32 in_length, uint32 start_at)
|
|||||||
memcpy(in_data, (char*)&check, 4);
|
memcpy(in_data, (char*)&check, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long CRC32::GetEQChecksum(uchar* in_data, uint32 in_length, uint32 start_at)
|
|
||||||
{
|
|
||||||
unsigned long data;
|
|
||||||
unsigned long check = 0xffffffff;
|
|
||||||
|
|
||||||
for (uint32 i = start_at; i < in_length; i++)
|
|
||||||
{
|
|
||||||
data = in_data[i];
|
|
||||||
data = data ^ (check);
|
|
||||||
data = data & 0x000000ff;
|
|
||||||
check = check >> 8;
|
|
||||||
data = CRC32Table[data];
|
|
||||||
check = check ^ data;
|
|
||||||
}
|
|
||||||
|
|
||||||
return check;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32 CRC32::Update(const uint8* buf, uint32 bufsize, uint32 crc32var) {
|
uint32 CRC32::Update(const uint8* buf, uint32 bufsize, uint32 crc32var) {
|
||||||
for(uint32 i=0; i < bufsize; i++)
|
for(uint32 i=0; i < bufsize; i++)
|
||||||
Calc(buf[i], crc32var);
|
Calc(buf[i], crc32var);
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ public:
|
|||||||
static uint32 Generate(const uint8* buf, uint32 bufsize);
|
static uint32 Generate(const uint8* buf, uint32 bufsize);
|
||||||
static uint32 GenerateNoFlip(const uint8* buf, uint32 bufsize); // Same as Generate(), but without the ~
|
static uint32 GenerateNoFlip(const uint8* buf, uint32 bufsize); // Same as Generate(), but without the ~
|
||||||
static void SetEQChecksum(uchar* in_data, uint32 in_length, uint32 start_at=4);
|
static void SetEQChecksum(uchar* in_data, uint32 in_length, uint32 start_at=4);
|
||||||
static unsigned long GetEQChecksum(uchar* in_data, uint32 in_length, uint32 start_at = 4);
|
|
||||||
|
|
||||||
// Multiple buffer CRC32
|
// Multiple buffer CRC32
|
||||||
static uint32 Update(const uint8* buf, uint32 bufsize, uint32 crc32 = 0xFFFFFFFF);
|
static uint32 Update(const uint8* buf, uint32 bufsize, uint32 crc32 = 0xFFFFFFFF);
|
||||||
|
|||||||
+49
-1
@@ -1860,7 +1860,35 @@ bool Database::CopyCharacter(
|
|||||||
|
|
||||||
const int64 new_character_id = (CharacterDataRepository::GetMaxId(*this) + 1);
|
const int64 new_character_id = (CharacterDataRepository::GetMaxId(*this) + 1);
|
||||||
|
|
||||||
std::vector<std::string> tables_to_zero_id = { "keyring", "data_buckets", "character_instance_safereturns" };
|
// validate destination name doesn't exist already
|
||||||
|
const auto& destination_characters = CharacterDataRepository::GetWhere(
|
||||||
|
*this,
|
||||||
|
fmt::format(
|
||||||
|
"`name` = '{}' AND `deleted_at` IS NULL LIMIT 1",
|
||||||
|
Strings::Escape(destination_character_name)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
if (!destination_characters.empty()) {
|
||||||
|
LogError("Character [{}] already exists", destination_character_name);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<std::string> tables_to_zero_id = {
|
||||||
|
"keyring",
|
||||||
|
"data_buckets",
|
||||||
|
"character_instance_safereturns",
|
||||||
|
"character_expedition_lockouts",
|
||||||
|
"character_instance_lockouts",
|
||||||
|
"character_parcels",
|
||||||
|
"character_tribute",
|
||||||
|
"player_titlesets",
|
||||||
|
};
|
||||||
|
|
||||||
|
std::vector<std::string> ignore_tables = {
|
||||||
|
"guilds",
|
||||||
|
};
|
||||||
|
|
||||||
|
size_t total_rows_copied = 0;
|
||||||
|
|
||||||
TransactionBegin();
|
TransactionBegin();
|
||||||
|
|
||||||
@@ -1868,6 +1896,10 @@ bool Database::CopyCharacter(
|
|||||||
const std::string& table_name = t.first;
|
const std::string& table_name = t.first;
|
||||||
const std::string& character_id_column_name = t.second;
|
const std::string& character_id_column_name = t.second;
|
||||||
|
|
||||||
|
if (Strings::Contains(ignore_tables, table_name)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
auto results = QueryDatabase(
|
auto results = QueryDatabase(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
"SHOW COLUMNS FROM {}",
|
"SHOW COLUMNS FROM {}",
|
||||||
@@ -1918,6 +1950,10 @@ bool Database::CopyCharacter(
|
|||||||
value = std::to_string(destination_account_id);
|
value = std::to_string(destination_account_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!Strings::IsNumber(value)) {
|
||||||
|
value = Strings::Escape(value);
|
||||||
|
}
|
||||||
|
|
||||||
new_values.emplace_back(value);
|
new_values.emplace_back(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1950,6 +1986,11 @@ bool Database::CopyCharacter(
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
size_t rows_copied = insert_rows.size(); // Rows copied for this table
|
||||||
|
total_rows_copied += rows_copied; // Increment grand total
|
||||||
|
|
||||||
|
LogInfo("Copying table [{}] rows [{}]", table_name, Strings::Commify(rows_copied));
|
||||||
|
|
||||||
if (!insert.ErrorMessage().empty()) {
|
if (!insert.ErrorMessage().empty()) {
|
||||||
TransactionRollback();
|
TransactionRollback();
|
||||||
return false;
|
return false;
|
||||||
@@ -1959,6 +2000,13 @@ bool Database::CopyCharacter(
|
|||||||
|
|
||||||
TransactionCommit();
|
TransactionCommit();
|
||||||
|
|
||||||
|
LogInfo(
|
||||||
|
"Character [{}] copied to [{}] total rows [{}]",
|
||||||
|
source_character_name,
|
||||||
|
destination_character_name,
|
||||||
|
Strings::Commify(total_rows_copied)
|
||||||
|
);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5771,6 +5771,524 @@ CREATE INDEX idx_character_expires ON data_buckets (character_id, expires);
|
|||||||
CREATE INDEX idx_npc_expires ON data_buckets (npc_id, expires);
|
CREATE INDEX idx_npc_expires ON data_buckets (npc_id, expires);
|
||||||
CREATE INDEX idx_bot_expires ON data_buckets (bot_id, expires);
|
CREATE INDEX idx_bot_expires ON data_buckets (bot_id, expires);
|
||||||
)"
|
)"
|
||||||
|
},
|
||||||
|
ManifestEntry{
|
||||||
|
.version = 9286,
|
||||||
|
.description = "2024_11_26_bazaar_find_trader.sql",
|
||||||
|
.check = "SHOW COLUMNS FROM `trader` LIKE 'char_zone_instance_id'",
|
||||||
|
.condition = "empty",
|
||||||
|
.match = "",
|
||||||
|
.sql = R"(
|
||||||
|
ALTER TABLE `trader`
|
||||||
|
ADD COLUMN `char_zone_instance_id` INT NULL DEFAULT '0' AFTER `char_zone_id`;
|
||||||
|
)"
|
||||||
|
},
|
||||||
|
ManifestEntry{
|
||||||
|
.version = 9287,
|
||||||
|
.description = "2024_11_26_bazaar_find_trader.sql",
|
||||||
|
.check = "SHOW COLUMNS FROM `npc_types` LIKE 'walkspeed'",
|
||||||
|
.condition = "missing",
|
||||||
|
.match = "float",
|
||||||
|
.sql = R"(
|
||||||
|
ALTER TABLE `npc_types` MODIFY COLUMN `walkspeed` float NOT NULL DEFAULT 0;
|
||||||
|
)",
|
||||||
|
.content_schema_update = true
|
||||||
|
},
|
||||||
|
ManifestEntry{
|
||||||
|
.version = 9288,
|
||||||
|
.description = "2024_11_10_zone_player_partitioning.sql",
|
||||||
|
.check = "SHOW CREATE TABLE `zone`",
|
||||||
|
.condition = "missing",
|
||||||
|
.match = "shard_at_player_count",
|
||||||
|
.sql = R"(
|
||||||
|
ALTER TABLE `zone`
|
||||||
|
ADD COLUMN `shard_at_player_count` int(11) NULL DEFAULT 0 AFTER `seconds_before_idle`;
|
||||||
|
)",
|
||||||
|
.content_schema_update = true
|
||||||
|
},
|
||||||
|
ManifestEntry{
|
||||||
|
.version = 9289,
|
||||||
|
.description = "2025_01_19_evolving_items__character_evolving_items",
|
||||||
|
.check = "SHOW TABLES LIKE 'character_evolving_items'",
|
||||||
|
.condition = "empty",
|
||||||
|
.match = "",
|
||||||
|
.sql = R"(
|
||||||
|
CREATE TABLE `character_evolving_items` (
|
||||||
|
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
`character_id` INT(10) UNSIGNED NULL DEFAULT '0',
|
||||||
|
`item_id` INT(10) UNSIGNED NULL DEFAULT '0',
|
||||||
|
`activated` TINYINT(1) UNSIGNED NULL DEFAULT '0',
|
||||||
|
`equipped` TINYINT(3) UNSIGNED NULL DEFAULT '0',
|
||||||
|
`current_amount` BIGINT(20) NULL DEFAULT '0',
|
||||||
|
`progression` DOUBLE(22,0) NULL DEFAULT '0',
|
||||||
|
`final_item_id` INT(10) UNSIGNED NULL DEFAULT '0',
|
||||||
|
`deleted_at` DATETIME NULL DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
|
)
|
||||||
|
COLLATE='latin1_swedish_ci'
|
||||||
|
ENGINE=InnoDB
|
||||||
|
AUTO_INCREMENT=1
|
||||||
|
;
|
||||||
|
)"
|
||||||
|
},
|
||||||
|
ManifestEntry{
|
||||||
|
.version = 9290,
|
||||||
|
.description = "2025_01_19_evolving_items__items_evolving_details",
|
||||||
|
.check = "SHOW TABLES LIKE 'items_evolving_details'",
|
||||||
|
.condition = "empty",
|
||||||
|
.match = "",
|
||||||
|
.sql = R"(
|
||||||
|
CREATE TABLE `items_evolving_details` (
|
||||||
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
|
`item_evo_id` int(10) unsigned DEFAULT 0 COMMENT 'items.evoid',
|
||||||
|
`item_evolve_level` int(10) unsigned DEFAULT 0 COMMENT 'items.evolvinglevel',
|
||||||
|
`item_id` int(10) unsigned DEFAULT 0 COMMENT 'items.id',
|
||||||
|
`type` int(10) unsigned DEFAULT 0,
|
||||||
|
`sub_type` int(10) unsigned DEFAULT 0,
|
||||||
|
`required_amount` bigint(20) DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
|
||||||
|
INSERT INTO `items_evolving_details` VALUES
|
||||||
|
(1,1000,1,86900,99,1,0),
|
||||||
|
(2,1000,2,86901,99,1,0),
|
||||||
|
(3,1000,3,86902,99,1,0),
|
||||||
|
(4,1000,4,86903,99,1,0),
|
||||||
|
(5,1000,5,86904,99,1,0),
|
||||||
|
(6,1001,1,86910,99,1,0),
|
||||||
|
(7,1001,2,86911,99,1,0),
|
||||||
|
(8,1001,3,86912,99,1,0),
|
||||||
|
(9,1001,4,86913,99,1,0),
|
||||||
|
(10,1001,5,86914,99,1,0),
|
||||||
|
(11,1001,6,86915,99,1,0),
|
||||||
|
(12,1001,7,86916,99,1,0),
|
||||||
|
(13,1002,1,86920,99,1,0),
|
||||||
|
(14,1002,2,86921,99,1,0),
|
||||||
|
(15,1002,3,86922,99,1,0),
|
||||||
|
(16,1002,4,86923,99,1,0),
|
||||||
|
(17,1002,5,86924,99,1,0),
|
||||||
|
(18,1002,6,86925,99,1,0),
|
||||||
|
(19,1002,7,86926,99,1,0),
|
||||||
|
(20,1003,1,86930,99,1,0),
|
||||||
|
(21,1003,2,86931,99,1,0),
|
||||||
|
(22,1003,3,86932,99,1,0),
|
||||||
|
(23,1003,4,86933,99,1,0),
|
||||||
|
(24,1003,5,86934,99,1,0),
|
||||||
|
(25,1003,6,86935,99,1,0),
|
||||||
|
(26,1004,1,86940,99,1,0),
|
||||||
|
(27,1004,2,86941,99,1,0),
|
||||||
|
(28,1004,3,86942,99,1,0),
|
||||||
|
(29,1004,4,86943,99,1,0),
|
||||||
|
(30,1004,5,86944,99,1,0),
|
||||||
|
(31,1004,6,86945,99,1,0),
|
||||||
|
(32,1005,1,86950,99,1,0),
|
||||||
|
(33,1005,2,86951,99,1,0),
|
||||||
|
(34,1005,3,86952,99,1,0),
|
||||||
|
(35,1005,4,86953,99,1,0),
|
||||||
|
(36,1005,5,86954,99,1,0),
|
||||||
|
(37,1005,6,86955,99,1,0),
|
||||||
|
(38,1005,7,86956,99,1,0),
|
||||||
|
(39,1006,1,86960,99,1,0),
|
||||||
|
(40,1006,2,86961,99,1,0),
|
||||||
|
(41,1006,3,86962,99,1,0),
|
||||||
|
(42,1006,4,86963,99,1,0),
|
||||||
|
(43,1006,5,86964,99,1,0),
|
||||||
|
(44,1006,6,86965,99,1,0),
|
||||||
|
(45,1006,7,86966,99,1,0),
|
||||||
|
(46,1007,1,86970,99,1,0),
|
||||||
|
(47,1007,2,86971,99,1,0),
|
||||||
|
(48,1007,3,86972,99,1,0),
|
||||||
|
(49,1007,4,86973,99,1,0),
|
||||||
|
(50,1007,5,86974,99,1,0),
|
||||||
|
(51,1007,6,86975,99,1,0),
|
||||||
|
(52,1007,7,86976,99,1,0),
|
||||||
|
(53,1008,1,86980,99,1,0),
|
||||||
|
(54,1008,2,86981,99,1,0),
|
||||||
|
(55,1008,3,86982,99,1,0),
|
||||||
|
(56,1008,4,86983,99,1,0),
|
||||||
|
(57,1008,5,86984,99,1,0),
|
||||||
|
(58,1009,1,86990,99,1,0),
|
||||||
|
(59,1009,2,86991,99,1,0),
|
||||||
|
(60,1009,3,86992,99,1,0),
|
||||||
|
(61,1009,4,86993,99,1,0),
|
||||||
|
(62,1009,5,86994,99,1,0),
|
||||||
|
(63,1009,6,86995,99,1,0),
|
||||||
|
(64,1009,7,86996,99,1,0),
|
||||||
|
(65,1009,8,86997,99,1,0),
|
||||||
|
(66,1009,9,86998,99,1,0),
|
||||||
|
(67,1009,10,86999,99,1,0),
|
||||||
|
(68,1010,1,90001,99,1,0),
|
||||||
|
(69,1010,2,90002,99,1,0),
|
||||||
|
(70,1010,3,90003,99,1,0),
|
||||||
|
(71,1010,6,90006,99,1,0),
|
||||||
|
(72,1010,7,90007,99,1,0),
|
||||||
|
(73,1010,8,90008,99,1,0),
|
||||||
|
(74,1010,10,90010,99,1,0),
|
||||||
|
(75,1050,1,89270,99,1,0),
|
||||||
|
(76,1050,2,89271,99,1,0),
|
||||||
|
(77,1050,3,89272,99,1,0),
|
||||||
|
(78,1050,4,89273,99,1,0),
|
||||||
|
(79,1050,5,89274,99,1,0),
|
||||||
|
(80,1050,6,89275,99,1,0),
|
||||||
|
(81,1051,1,89280,99,1,0),
|
||||||
|
(82,1051,2,89281,99,1,0),
|
||||||
|
(83,1051,3,89282,99,1,0),
|
||||||
|
(84,1051,4,89283,99,1,0),
|
||||||
|
(85,1051,5,89284,99,1,0),
|
||||||
|
(86,1052,1,89290,99,1,0),
|
||||||
|
(87,1052,2,89291,99,1,0),
|
||||||
|
(88,1052,3,89292,99,1,0),
|
||||||
|
(89,1052,4,89293,99,1,0),
|
||||||
|
(90,1052,5,89294,99,1,0),
|
||||||
|
(91,1052,6,89295,99,1,0),
|
||||||
|
(92,1052,7,89296,99,1,0),
|
||||||
|
(93,1053,1,89300,99,1,0),
|
||||||
|
(94,1053,2,89301,99,1,0),
|
||||||
|
(95,1053,3,89302,99,1,0),
|
||||||
|
(96,1053,4,89303,99,1,0),
|
||||||
|
(97,1053,5,89304,99,1,0),
|
||||||
|
(98,1053,6,89305,99,1,0),
|
||||||
|
(99,1053,7,89306,99,1,0),
|
||||||
|
(100,1053,8,89307,99,1,0),
|
||||||
|
(101,1053,9,89308,99,1,0),
|
||||||
|
(102,1054,1,89310,99,1,0),
|
||||||
|
(103,1054,2,89311,99,1,0),
|
||||||
|
(104,1054,3,89312,99,1,0),
|
||||||
|
(105,1054,4,89313,99,1,0),
|
||||||
|
(106,1054,5,89314,99,1,0),
|
||||||
|
(107,1054,6,89315,99,1,0),
|
||||||
|
(108,1055,1,89320,99,1,0),
|
||||||
|
(109,1055,2,89321,99,1,0),
|
||||||
|
(110,1055,3,89322,99,1,0),
|
||||||
|
(111,1055,4,89323,99,1,0),
|
||||||
|
(112,1055,5,89324,99,1,0),
|
||||||
|
(113,1055,6,89325,99,1,0),
|
||||||
|
(114,1055,7,89326,99,1,0),
|
||||||
|
(115,1056,1,89330,99,1,0),
|
||||||
|
(116,1056,2,89331,99,1,0),
|
||||||
|
(117,1056,3,89332,99,1,0),
|
||||||
|
(118,1056,4,89333,99,1,0),
|
||||||
|
(119,1056,5,89334,99,1,0),
|
||||||
|
(120,1057,1,89340,99,1,0),
|
||||||
|
(121,1057,2,89341,99,1,0),
|
||||||
|
(122,1057,3,89342,99,1,0),
|
||||||
|
(123,1057,4,89343,99,1,0),
|
||||||
|
(124,1057,5,89344,99,1,0),
|
||||||
|
(125,1057,6,89345,99,1,0),
|
||||||
|
(126,1057,7,89346,99,1,0),
|
||||||
|
(127,1057,8,89347,99,1,0),
|
||||||
|
(128,1058,1,89350,99,1,0),
|
||||||
|
(129,1058,2,89351,99,1,0),
|
||||||
|
(130,1058,3,89352,99,1,0),
|
||||||
|
(131,1058,4,89353,99,1,0),
|
||||||
|
(132,1058,5,89354,99,1,0),
|
||||||
|
(133,1058,6,89355,99,1,0),
|
||||||
|
(134,1058,7,89356,99,1,0),
|
||||||
|
(135,1059,1,89360,99,1,0),
|
||||||
|
(136,1059,2,89361,99,1,0),
|
||||||
|
(137,1059,3,89362,99,1,0),
|
||||||
|
(138,1060,1,89490,99,1,0),
|
||||||
|
(139,1060,2,89491,99,1,0),
|
||||||
|
(140,1060,3,89492,99,1,0),
|
||||||
|
(141,1061,1,89500,99,1,0),
|
||||||
|
(142,1061,2,89501,99,1,0),
|
||||||
|
(143,1061,3,89502,99,1,0),
|
||||||
|
(144,1062,1,89510,99,1,0),
|
||||||
|
(145,1062,2,89511,99,1,0),
|
||||||
|
(146,1062,3,89512,99,1,0),
|
||||||
|
(147,1063,1,89520,99,1,0),
|
||||||
|
(148,1063,2,89521,99,1,0),
|
||||||
|
(149,1063,3,89522,99,1,0),
|
||||||
|
(150,1064,1,89530,99,1,0),
|
||||||
|
(151,1064,2,89531,99,1,0),
|
||||||
|
(152,1064,3,89532,99,1,0),
|
||||||
|
(153,1065,1,89540,99,1,0),
|
||||||
|
(154,1065,2,89541,99,1,0),
|
||||||
|
(155,1065,3,89542,99,1,0),
|
||||||
|
(156,1066,1,89550,3,274,500),
|
||||||
|
(157,1066,2,89551,3,274,1000),
|
||||||
|
(158,1066,3,89552,3,274,2000),
|
||||||
|
(159,1067,1,89560,99,1,0),
|
||||||
|
(160,1067,2,89561,99,1,0),
|
||||||
|
(161,1067,3,89562,99,1,0),
|
||||||
|
(162,1069,1,85571,99,1,0),
|
||||||
|
(163,1069,2,85572,99,1,0),
|
||||||
|
(164,1069,3,85573,99,1,0),
|
||||||
|
(165,1200,1,95001,99,1,0),
|
||||||
|
(166,1200,2,95002,99,1,0),
|
||||||
|
(167,1200,3,95003,99,1,0),
|
||||||
|
(168,1200,4,95004,99,1,0),
|
||||||
|
(169,1200,5,95005,99,1,0),
|
||||||
|
(170,1200,6,95006,99,1,0),
|
||||||
|
(171,1200,7,95007,99,1,0),
|
||||||
|
(172,1201,1,95008,99,1,0),
|
||||||
|
(173,1201,2,95009,99,1,0),
|
||||||
|
(174,1201,3,95010,99,1,0),
|
||||||
|
(175,1201,4,95011,99,1,0),
|
||||||
|
(176,1201,5,95012,99,1,0),
|
||||||
|
(177,1201,6,95013,99,1,0),
|
||||||
|
(178,1201,7,95014,99,1,0),
|
||||||
|
(179,1202,1,95015,99,1,0),
|
||||||
|
(180,1202,2,95016,99,1,0),
|
||||||
|
(181,1202,3,95017,99,1,0),
|
||||||
|
(182,1202,4,95018,99,1,0),
|
||||||
|
(183,1202,5,95019,99,1,0),
|
||||||
|
(184,1202,6,95020,99,1,0),
|
||||||
|
(185,1202,7,95021,99,1,0),
|
||||||
|
(186,1203,1,95022,99,1,0),
|
||||||
|
(187,1203,2,95023,99,1,0),
|
||||||
|
(188,1203,3,95024,99,1,0),
|
||||||
|
(189,1203,4,95025,99,1,0),
|
||||||
|
(190,1203,5,95026,99,1,0),
|
||||||
|
(191,1203,6,95027,99,1,0),
|
||||||
|
(192,1203,7,95028,99,1,0),
|
||||||
|
(193,1204,1,95029,99,1,0),
|
||||||
|
(194,1204,2,95030,99,1,0),
|
||||||
|
(195,1204,3,95031,99,1,0),
|
||||||
|
(196,1204,4,95032,99,1,0),
|
||||||
|
(197,1204,5,95033,99,1,0),
|
||||||
|
(198,1204,6,95034,99,1,0),
|
||||||
|
(199,1204,7,95035,99,1,0),
|
||||||
|
(200,1205,1,95036,99,1,0),
|
||||||
|
(201,1205,2,95037,99,1,0),
|
||||||
|
(202,1205,3,95038,99,1,0),
|
||||||
|
(203,1205,4,95039,99,1,0),
|
||||||
|
(204,1205,5,95040,99,1,0),
|
||||||
|
(205,1205,6,95041,99,1,0),
|
||||||
|
(206,1205,7,95042,99,1,0),
|
||||||
|
(207,1206,1,95043,99,1,0),
|
||||||
|
(208,1206,2,95044,99,1,0),
|
||||||
|
(209,1206,3,95045,99,1,0),
|
||||||
|
(210,1206,4,95046,99,1,0),
|
||||||
|
(211,1206,5,95047,99,1,0),
|
||||||
|
(212,1206,6,95048,99,1,0),
|
||||||
|
(213,1206,7,95049,99,1,0),
|
||||||
|
(214,1207,1,95050,99,1,0),
|
||||||
|
(215,1207,2,95051,99,1,0),
|
||||||
|
(216,1207,3,95052,99,1,0),
|
||||||
|
(217,1207,4,95053,99,1,0),
|
||||||
|
(218,1207,5,95054,99,1,0),
|
||||||
|
(219,1207,6,95055,99,1,0),
|
||||||
|
(220,1207,7,95056,99,1,0),
|
||||||
|
(221,1208,1,95057,99,1,0),
|
||||||
|
(222,1208,2,95058,99,1,0),
|
||||||
|
(223,1208,3,95059,99,1,0),
|
||||||
|
(224,1208,4,95060,99,1,0),
|
||||||
|
(225,1208,5,95061,99,1,0),
|
||||||
|
(226,1208,6,95062,99,1,0),
|
||||||
|
(227,1208,7,95063,99,1,0),
|
||||||
|
(228,1209,1,95064,99,1,0),
|
||||||
|
(229,1209,2,95065,99,1,0),
|
||||||
|
(230,1209,3,95066,99,1,0),
|
||||||
|
(231,1209,4,95067,99,1,0),
|
||||||
|
(232,1209,5,95068,99,1,0),
|
||||||
|
(233,1209,6,95069,99,1,0),
|
||||||
|
(234,1209,7,95070,99,1,0),
|
||||||
|
(235,1210,1,95071,99,1,0),
|
||||||
|
(236,1210,2,95072,99,1,0),
|
||||||
|
(237,1210,3,95073,99,1,0),
|
||||||
|
(238,1210,4,95074,99,1,0),
|
||||||
|
(239,1210,5,95075,99,1,0),
|
||||||
|
(240,1210,6,95076,99,1,0),
|
||||||
|
(241,1210,7,95077,99,1,0),
|
||||||
|
(242,1211,1,85612,1,1,100000),
|
||||||
|
(243,1211,2,85613,1,1,200000),
|
||||||
|
(244,1211,3,85614,1,1,300000),
|
||||||
|
(245,1214,1,80035,99,1,0),
|
||||||
|
(246,1301,1,102700,99,1,0),
|
||||||
|
(247,1301,4,102703,99,1,0),
|
||||||
|
(248,1302,1,102704,99,1,0),
|
||||||
|
(249,1302,2,102705,99,1,0),
|
||||||
|
(250,1303,1,102706,99,1,0),
|
||||||
|
(251,1303,2,102707,99,1,0),
|
||||||
|
(252,1303,3,102708,99,1,0),
|
||||||
|
(253,1304,1,102709,99,1,0),
|
||||||
|
(254,1304,5,102713,99,1,0),
|
||||||
|
(255,1305,1,102714,99,1,0),
|
||||||
|
(256,1306,1,102716,99,1,0),
|
||||||
|
(257,1306,5,102720,99,1,0),
|
||||||
|
(258,1307,1,102721,99,1,0),
|
||||||
|
(259,1307,3,102723,99,1,0),
|
||||||
|
(260,1308,1,102724,99,1,0),
|
||||||
|
(261,1309,1,102727,99,1,0),
|
||||||
|
(262,1309,2,102728,99,1,0),
|
||||||
|
(263,1310,1,102729,99,1,0),
|
||||||
|
(264,1310,3,102731,99,1,0),
|
||||||
|
(265,1311,1,102732,99,1,0),
|
||||||
|
(266,1311,4,102735,99,1,0),
|
||||||
|
(267,1312,1,102736,99,1,0),
|
||||||
|
(268,1312,3,102738,99,1,0),
|
||||||
|
(269,1313,1,102739,99,1,0),
|
||||||
|
(270,1314,1,102743,99,1,0),
|
||||||
|
(271,1314,2,102744,99,1,0),
|
||||||
|
(272,1314,3,102745,99,1,0),
|
||||||
|
(273,1315,1,102746,99,1,0),
|
||||||
|
(274,1315,2,102747,99,1,0),
|
||||||
|
(275,1316,1,102748,99,1,0),
|
||||||
|
(276,1316,5,102752,99,1,0),
|
||||||
|
(277,1317,1,102753,99,1,0),
|
||||||
|
(278,1318,1,102756,99,1,0),
|
||||||
|
(279,1319,1,102759,99,1,0),
|
||||||
|
(280,1319,3,102761,99,1,0),
|
||||||
|
(281,1320,1,102762,99,1,0),
|
||||||
|
(282,1321,1,102765,99,1,0),
|
||||||
|
(283,1321,2,102766,99,1,0),
|
||||||
|
(284,1321,3,102767,99,1,0),
|
||||||
|
(285,1322,1,102768,99,1,0),
|
||||||
|
(286,1322,2,102769,99,1,0),
|
||||||
|
(287,1322,3,102770,99,1,0),
|
||||||
|
(288,1323,1,102771,99,1,0),
|
||||||
|
(289,1324,1,102774,99,1,0),
|
||||||
|
(290,1400,1,102800,99,1,0),
|
||||||
|
(291,1401,1,102807,99,1,0),
|
||||||
|
(292,1401,7,102813,99,1,0),
|
||||||
|
(293,1402,1,102814,99,1,0),
|
||||||
|
(294,1402,7,102820,99,1,0),
|
||||||
|
(295,1403,1,102821,99,1,0),
|
||||||
|
(296,1404,1,102828,99,1,0),
|
||||||
|
(297,1405,1,102835,99,1,0),
|
||||||
|
(298,1406,1,102842,99,1,0),
|
||||||
|
(299,1408,1,109310,99,1,0),
|
||||||
|
(300,1408,5,109314,99,1,0),
|
||||||
|
(301,1409,1,109315,99,1,0),
|
||||||
|
(302,1409,5,109319,99,1,0),
|
||||||
|
(303,1410,1,109320,99,1,0),
|
||||||
|
(304,1410,5,109324,99,1,0),
|
||||||
|
(305,1411,1,109325,99,1,0),
|
||||||
|
(306,1411,5,109329,99,1,0),
|
||||||
|
(307,1412,1,109330,99,1,0),
|
||||||
|
(308,1412,5,109334,99,1,0),
|
||||||
|
(309,1413,1,109335,99,1,0),
|
||||||
|
(310,1413,5,109339,99,1,0),
|
||||||
|
(311,1414,1,109340,99,1,0),
|
||||||
|
(312,1414,5,109344,99,1,0),
|
||||||
|
(313,1415,1,109345,99,1,0),
|
||||||
|
(314,1415,5,109349,99,1,0),
|
||||||
|
(315,1416,1,109350,99,1,0),
|
||||||
|
(316,1416,2,109351,99,1,0),
|
||||||
|
(317,1416,5,109354,99,1,0),
|
||||||
|
(318,1417,1,109355,99,1,0),
|
||||||
|
(319,1417,5,109359,99,1,0),
|
||||||
|
(320,1418,1,109360,99,1,0),
|
||||||
|
(321,1418,5,109364,99,1,0),
|
||||||
|
(322,1419,1,109365,99,1,0),
|
||||||
|
(323,1419,3,109367,99,1,0),
|
||||||
|
(324,1419,5,109369,99,1,0),
|
||||||
|
(325,1420,1,109370,99,1,0),
|
||||||
|
(326,1420,5,109374,99,1,0),
|
||||||
|
(327,1421,1,109375,99,1,0),
|
||||||
|
(328,1421,5,109379,99,1,0),
|
||||||
|
(329,1422,1,109380,99,1,0),
|
||||||
|
(330,1422,5,109384,99,1,0),
|
||||||
|
(331,1423,1,109385,99,1,0),
|
||||||
|
(332,1423,2,109386,99,1,0),
|
||||||
|
(333,1423,5,109389,99,1,0),
|
||||||
|
(334,1436,1,120378,99,1,0),
|
||||||
|
(335,1436,2,120379,99,1,0),
|
||||||
|
(336,1436,3,120380,99,1,0),
|
||||||
|
(337,1436,4,120381,99,1,0),
|
||||||
|
(338,1436,5,120382,99,1,0),
|
||||||
|
(339,1436,6,120383,99,1,0),
|
||||||
|
(340,1436,7,120384,99,1,0),
|
||||||
|
(341,1436,8,120385,99,1,0),
|
||||||
|
(342,1436,9,120386,99,1,0),
|
||||||
|
(343,1436,10,120387,99,1,0),
|
||||||
|
(344,1436,11,120388,99,1,0),
|
||||||
|
(345,1436,12,120389,99,1,0),
|
||||||
|
(346,1436,13,120390,99,1,0),
|
||||||
|
(347,1436,14,120391,99,1,0),
|
||||||
|
(348,1436,15,120392,99,1,0),
|
||||||
|
(349,1436,16,120393,99,1,0),
|
||||||
|
(350,1436,17,120394,99,1,0),
|
||||||
|
(351,1436,18,120395,99,1,0),
|
||||||
|
(352,1436,19,120396,99,1,0),
|
||||||
|
(353,1436,20,120397,99,1,0),
|
||||||
|
(354,1440,1,56992,99,1,0),
|
||||||
|
(355,1440,2,56993,99,1,0),
|
||||||
|
(356,1440,3,56994,99,1,0),
|
||||||
|
(357,1440,4,56995,99,1,0),
|
||||||
|
(358,1440,5,56996,99,1,0),
|
||||||
|
(359,1441,1,132787,99,1,0),
|
||||||
|
(360,1441,2,132788,99,1,0),
|
||||||
|
(361,1441,3,132789,99,1,0),
|
||||||
|
(362,1441,4,132790,99,1,0),
|
||||||
|
(363,1441,5,132791,99,1,0),
|
||||||
|
(364,1441,6,132792,99,1,0),
|
||||||
|
(365,1441,7,132793,99,1,0),
|
||||||
|
(366,1441,8,132794,99,1,0),
|
||||||
|
(367,1441,9,132795,99,1,0),
|
||||||
|
(368,1441,10,132796,99,1,0),
|
||||||
|
(369,1441,11,132797,99,1,0),
|
||||||
|
(370,1441,13,132799,99,1,0),
|
||||||
|
(371,1441,14,132800,99,1,0),
|
||||||
|
(372,1441,15,132801,99,1,0),
|
||||||
|
(373,1441,16,132802,99,1,0),
|
||||||
|
(374,1441,17,132803,99,1,0),
|
||||||
|
(375,1441,18,132804,99,1,0),
|
||||||
|
(376,1441,19,132805,99,1,0),
|
||||||
|
(377,1441,20,132806,99,1,0),
|
||||||
|
(378,1442,1,133137,99,1,0),
|
||||||
|
(379,1442,2,133138,99,1,0),
|
||||||
|
(380,1442,3,133139,99,1,0),
|
||||||
|
(381,1442,4,133140,99,1,0),
|
||||||
|
(382,1442,10,133146,99,1,0),
|
||||||
|
(383,1442,11,133147,99,1,0),
|
||||||
|
(384,1442,12,133148,99,1,0),
|
||||||
|
(385,1442,13,133149,99,1,0),
|
||||||
|
(386,1442,14,133150,99,1,0),
|
||||||
|
(387,1442,15,133151,99,1,0),
|
||||||
|
(388,1442,16,133152,99,1,0),
|
||||||
|
(389,1442,17,133153,99,1,0),
|
||||||
|
(390,1442,18,133154,99,1,0),
|
||||||
|
(391,1442,19,133155,99,1,0),
|
||||||
|
(392,1442,20,133156,99,1,0),
|
||||||
|
(393,1443,1,133406,99,1,0),
|
||||||
|
(394,1443,2,133407,99,1,0),
|
||||||
|
(395,1443,3,133408,99,1,0),
|
||||||
|
(396,1443,4,133409,99,1,0),
|
||||||
|
(397,1443,5,133410,99,1,0),
|
||||||
|
(398,1443,6,133411,99,1,0),
|
||||||
|
(399,1443,7,133412,99,1,0),
|
||||||
|
(400,1443,8,133413,99,1,0),
|
||||||
|
(401,1443,9,133414,99,1,0),
|
||||||
|
(402,1443,10,133415,99,1,0),
|
||||||
|
(403,1443,11,133416,99,1,0),
|
||||||
|
(404,1443,12,133417,99,1,0),
|
||||||
|
(405,1443,13,133418,99,1,0),
|
||||||
|
(406,1443,14,133419,99,1,0),
|
||||||
|
(407,1443,15,133420,99,1,0),
|
||||||
|
(408,1443,16,133421,99,1,0),
|
||||||
|
(409,1443,17,133422,99,1,0),
|
||||||
|
(410,1443,18,133423,99,1,0),
|
||||||
|
(411,1443,19,133424,99,1,0),
|
||||||
|
(412,1443,20,133425,99,1,0),
|
||||||
|
(413,1444,1,94938,99,1,0),
|
||||||
|
(414,1444,2,94939,99,1,0),
|
||||||
|
(415,1444,3,94940,99,1,0),
|
||||||
|
(416,1444,4,94941,99,1,0),
|
||||||
|
(417,1444,5,94942,99,1,0),
|
||||||
|
(418,1444,6,94943,99,1,0),
|
||||||
|
(419,1444,7,94944,99,1,0),
|
||||||
|
(420,1444,8,94945,99,1,0),
|
||||||
|
(421,1444,9,94946,99,1,0),
|
||||||
|
(422,1444,10,94947,99,1,0),
|
||||||
|
(423,1444,11,94948,99,1,0),
|
||||||
|
(424,1444,12,94949,99,1,0),
|
||||||
|
(425,1444,13,94950,99,1,0),
|
||||||
|
(426,1444,14,94951,99,1,0),
|
||||||
|
(427,1444,15,94952,99,1,0),
|
||||||
|
(428,1444,16,94953,99,1,0),
|
||||||
|
(429,1444,17,94954,99,1,0),
|
||||||
|
(430,1444,18,94955,99,1,0),
|
||||||
|
(431,1444,19,94956,99,1,0),
|
||||||
|
(432,1444,20,94957,99,1,0),
|
||||||
|
(433,1445,1,98858,99,1,0),
|
||||||
|
(434,1445,2,98859,99,1,0),
|
||||||
|
(435,1445,3,98860,99,1,0),
|
||||||
|
(436,1445,4,98861,99,1,0),
|
||||||
|
(437,1445,5,98862,99,1,0);
|
||||||
|
|
||||||
|
)",
|
||||||
|
.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{
|
||||||
|
|||||||
@@ -114,7 +114,9 @@ bool Database::CheckInstanceExpired(uint16 instance_id)
|
|||||||
timeval tv{};
|
timeval tv{};
|
||||||
gettimeofday(&tv, nullptr);
|
gettimeofday(&tv, nullptr);
|
||||||
|
|
||||||
return (i.start_time + i.duration) <= tv.tv_sec;
|
// Use uint64_t for the addition to prevent overflow
|
||||||
|
uint64_t expiration_time = static_cast<uint64_t>(i.start_time) + static_cast<uint64_t>(i.duration);
|
||||||
|
return expiration_time <= tv.tv_sec;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Database::CreateInstance(uint16 instance_id, uint32 zone_id, uint32 version, uint32 duration)
|
bool Database::CreateInstance(uint16 instance_id, uint32 zone_id, uint32 version, uint32 duration)
|
||||||
@@ -469,15 +471,13 @@ void Database::AssignRaidToInstance(uint32 raid_id, uint32 instance_id)
|
|||||||
|
|
||||||
void Database::DeleteInstance(uint16 instance_id)
|
void Database::DeleteInstance(uint16 instance_id)
|
||||||
{
|
{
|
||||||
|
// I'm not sure why this isn't in here but we should add it in a later change and make sure it's tested
|
||||||
|
// InstanceListRepository::DeleteWhere(*this, fmt::format("id = {}", instance_id));
|
||||||
InstanceListPlayerRepository::DeleteWhere(*this, fmt::format("id = {}", instance_id));
|
InstanceListPlayerRepository::DeleteWhere(*this, fmt::format("id = {}", instance_id));
|
||||||
|
|
||||||
RespawnTimesRepository::DeleteWhere(*this, fmt::format("instance_id = {}", instance_id));
|
RespawnTimesRepository::DeleteWhere(*this, fmt::format("instance_id = {}", instance_id));
|
||||||
|
|
||||||
SpawnConditionValuesRepository::DeleteWhere(*this, fmt::format("instance_id = {}", instance_id));
|
SpawnConditionValuesRepository::DeleteWhere(*this, fmt::format("instance_id = {}", instance_id));
|
||||||
|
|
||||||
DynamicZoneMembersRepository::DeleteByInstance(*this, instance_id);
|
DynamicZoneMembersRepository::DeleteByInstance(*this, instance_id);
|
||||||
DynamicZonesRepository::DeleteWhere(*this, fmt::format("instance_id = {}", instance_id));
|
DynamicZonesRepository::DeleteWhere(*this, fmt::format("instance_id = {}", instance_id));
|
||||||
|
|
||||||
CharacterCorpsesRepository::BuryInstance(*this, instance_id);
|
CharacterCorpsesRepository::BuryInstance(*this, instance_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ namespace DatabaseSchema {
|
|||||||
{"character_enabledtasks", "charid"},
|
{"character_enabledtasks", "charid"},
|
||||||
{"character_expedition_lockouts", "character_id"},
|
{"character_expedition_lockouts", "character_id"},
|
||||||
{"character_exp_modifiers", "character_id"},
|
{"character_exp_modifiers", "character_id"},
|
||||||
|
{"character_evolving_items", "character_id"},
|
||||||
{"character_inspect_messages", "id"},
|
{"character_inspect_messages", "id"},
|
||||||
{"character_instance_safereturns", "character_id"},
|
{"character_instance_safereturns", "character_id"},
|
||||||
{"character_item_recast", "id"},
|
{"character_item_recast", "id"},
|
||||||
@@ -124,6 +125,7 @@ namespace DatabaseSchema {
|
|||||||
"character_enabledtasks",
|
"character_enabledtasks",
|
||||||
"character_expedition_lockouts",
|
"character_expedition_lockouts",
|
||||||
"character_exp_modifiers",
|
"character_exp_modifiers",
|
||||||
|
"character_evolving_items",
|
||||||
"character_inspect_messages",
|
"character_inspect_messages",
|
||||||
"character_instance_safereturns",
|
"character_instance_safereturns",
|
||||||
"character_item_recast",
|
"character_item_recast",
|
||||||
@@ -212,6 +214,7 @@ namespace DatabaseSchema {
|
|||||||
"ground_spawns",
|
"ground_spawns",
|
||||||
"horses",
|
"horses",
|
||||||
"items",
|
"items",
|
||||||
|
"items_evolving_details",
|
||||||
"ldon_trap_entries",
|
"ldon_trap_entries",
|
||||||
"ldon_trap_templates",
|
"ldon_trap_templates",
|
||||||
"lootdrop",
|
"lootdrop",
|
||||||
|
|||||||
+15
-23
@@ -140,29 +140,6 @@ std::string EQ::constants::GetLanguageName(uint8 language_id)
|
|||||||
return EQ::constants::GetLanguageMap().find(language_id)->second;
|
return EQ::constants::GetLanguageMap().find(language_id)->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::map<uint32, std::string>& EQ::constants::GetLDoNThemeMap()
|
|
||||||
{
|
|
||||||
static const std::map<uint32, std::string> ldon_theme_map = {
|
|
||||||
{ LDoNThemes::Unused, "Unused" },
|
|
||||||
{ LDoNThemes::GUK, "Deepest Guk" },
|
|
||||||
{ LDoNThemes::MIR, "Miragul's Menagerie" },
|
|
||||||
{ LDoNThemes::MMC, "Mistmoore Catacombs" },
|
|
||||||
{ LDoNThemes::RUJ, "Rujarkian Hills" },
|
|
||||||
{ LDoNThemes::TAK, "Takish-Hiz" },
|
|
||||||
};
|
|
||||||
|
|
||||||
return ldon_theme_map;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string EQ::constants::GetLDoNThemeName(uint32 theme_id)
|
|
||||||
{
|
|
||||||
if (!EQ::ValueWithin(theme_id, LDoNThemes::Unused, LDoNThemes::TAK)) {
|
|
||||||
return std::string();
|
|
||||||
}
|
|
||||||
|
|
||||||
return EQ::constants::GetLDoNThemeMap().find(theme_id)->second;
|
|
||||||
}
|
|
||||||
|
|
||||||
const std::map<int8, std::string>& EQ::constants::GetFlyModeMap()
|
const std::map<int8, std::string>& EQ::constants::GetFlyModeMap()
|
||||||
{
|
{
|
||||||
static const std::map<int8, std::string> flymode_map = {
|
static const std::map<int8, std::string> flymode_map = {
|
||||||
@@ -459,3 +436,18 @@ bool ComparisonType::IsValid(uint8 type)
|
|||||||
{
|
{
|
||||||
return comparison_types.find(type) != comparison_types.end();
|
return comparison_types.find(type) != comparison_types.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32 LDoNTheme::GetBitmask(uint32 theme_id)
|
||||||
|
{
|
||||||
|
return IsValid(theme_id) ? ldon_theme_names[theme_id].second : LDoNTheme::UnusedBit;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string LDoNTheme::GetName(uint32 theme_id)
|
||||||
|
{
|
||||||
|
return IsValid(theme_id) ? ldon_theme_names[theme_id].first : "UNKNOWN LDON THEME";
|
||||||
|
}
|
||||||
|
|
||||||
|
bool LDoNTheme::IsValid(uint32 theme_id)
|
||||||
|
{
|
||||||
|
return ldon_theme_names.find(theme_id) != ldon_theme_names.end();
|
||||||
|
}
|
||||||
|
|||||||
+32
-5
@@ -352,9 +352,6 @@ namespace EQ
|
|||||||
extern const std::map<uint8, std::string>& GetLanguageMap();
|
extern const std::map<uint8, std::string>& GetLanguageMap();
|
||||||
std::string GetLanguageName(uint8 language_id);
|
std::string GetLanguageName(uint8 language_id);
|
||||||
|
|
||||||
extern const std::map<uint32, std::string>& GetLDoNThemeMap();
|
|
||||||
std::string GetLDoNThemeName(uint32 theme_id);
|
|
||||||
|
|
||||||
extern const std::map<int8, std::string>& GetFlyModeMap();
|
extern const std::map<int8, std::string>& GetFlyModeMap();
|
||||||
std::string GetFlyModeName(int8 flymode_id);
|
std::string GetFlyModeName(int8 flymode_id);
|
||||||
|
|
||||||
@@ -460,10 +457,11 @@ enum ServerLockType : int {
|
|||||||
Unlock
|
Unlock
|
||||||
};
|
};
|
||||||
|
|
||||||
enum Invisibility : uint8 {
|
enum Invisibility : uint16 {
|
||||||
Visible,
|
Visible,
|
||||||
Invisible,
|
Invisible,
|
||||||
Special = 255
|
Special = 255,
|
||||||
|
GMInvis = 3001
|
||||||
};
|
};
|
||||||
|
|
||||||
enum AugmentActions : int {
|
enum AugmentActions : int {
|
||||||
@@ -751,6 +749,35 @@ static std::map<uint32, std::string> stance_names = {
|
|||||||
{ Stance::AEBurn, "AE Burn" }
|
{ Stance::AEBurn, "AE Burn" }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
namespace LDoNTheme {
|
||||||
|
constexpr uint32 Unused = 0;
|
||||||
|
constexpr uint32 GUK = 1;
|
||||||
|
constexpr uint32 MIR = 2;
|
||||||
|
constexpr uint32 MMC = 3;
|
||||||
|
constexpr uint32 RUJ = 4;
|
||||||
|
constexpr uint32 TAK = 5;
|
||||||
|
|
||||||
|
constexpr uint32 UnusedBit = 0;
|
||||||
|
constexpr uint32 GUKBit = 1;
|
||||||
|
constexpr uint32 MIRBit = 2;
|
||||||
|
constexpr uint32 MMCBit = 4;
|
||||||
|
constexpr uint32 RUJBit = 8;
|
||||||
|
constexpr uint32 TAKBit = 16;
|
||||||
|
|
||||||
|
uint32 GetBitmask(uint32 theme_id);
|
||||||
|
std::string GetName(uint32 theme_id);
|
||||||
|
bool IsValid(uint32 theme_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::map<uint32, std::pair<std::string, uint32>> ldon_theme_names = {
|
||||||
|
{ LDoNTheme::Unused, { "Unused", LDoNTheme::UnusedBit }, },
|
||||||
|
{ LDoNTheme::GUK, { "Deepest Guk", LDoNTheme::GUKBit }, },
|
||||||
|
{ LDoNTheme::MIR, { "Miragul's Menagerie", LDoNTheme::MIRBit }, },
|
||||||
|
{ LDoNTheme::MMC, { "Mistmoore Catacombs", LDoNTheme::MMCBit }, },
|
||||||
|
{ LDoNTheme::RUJ, { "Rujarkian Hills", LDoNTheme::RUJBit }, },
|
||||||
|
{ LDoNTheme::TAK, { "Takish-Hiz", LDoNTheme::TAKBit }, },
|
||||||
|
};
|
||||||
|
|
||||||
namespace PCNPCOnlyFlagType {
|
namespace PCNPCOnlyFlagType {
|
||||||
constexpr int PC = 1;
|
constexpr int PC = 1;
|
||||||
constexpr int NPC = 2;
|
constexpr int NPC = 2;
|
||||||
|
|||||||
+6
-2
@@ -1,6 +1,8 @@
|
|||||||
// system use
|
// system use
|
||||||
N(OP_ExploreUnknown),
|
N(OP_ExploreUnknown),
|
||||||
// start (please add new opcodes in descending order and re-order any name changes where applicable)
|
// start (please add new opcodes in descending order and re-order any name changes where applicable)
|
||||||
|
N(OP_0x0193),
|
||||||
|
N(OP_0x0347),
|
||||||
N(OP_AAAction),
|
N(OP_AAAction),
|
||||||
N(OP_AAExpUpdate),
|
N(OP_AAExpUpdate),
|
||||||
N(OP_AcceptNewTask),
|
N(OP_AcceptNewTask),
|
||||||
@@ -160,6 +162,7 @@ N(OP_EnduranceUpdate),
|
|||||||
N(OP_EnterChat),
|
N(OP_EnterChat),
|
||||||
N(OP_EnterWorld),
|
N(OP_EnterWorld),
|
||||||
N(OP_EnvDamage),
|
N(OP_EnvDamage),
|
||||||
|
N(OP_EvolveItem),
|
||||||
N(OP_ExpansionInfo),
|
N(OP_ExpansionInfo),
|
||||||
N(OP_ExpUpdate),
|
N(OP_ExpUpdate),
|
||||||
N(OP_FaceChange),
|
N(OP_FaceChange),
|
||||||
@@ -287,6 +290,7 @@ N(OP_ItemLinkText),
|
|||||||
N(OP_ItemName),
|
N(OP_ItemName),
|
||||||
N(OP_ItemPacket),
|
N(OP_ItemPacket),
|
||||||
N(OP_ItemPreview),
|
N(OP_ItemPreview),
|
||||||
|
N(OP_ItemPreviewRequest),
|
||||||
N(OP_ItemRecastDelay),
|
N(OP_ItemRecastDelay),
|
||||||
N(OP_ItemVerifyReply),
|
N(OP_ItemVerifyReply),
|
||||||
N(OP_ItemVerifyRequest),
|
N(OP_ItemVerifyRequest),
|
||||||
@@ -354,7 +358,6 @@ N(OP_MercenaryTimer),
|
|||||||
N(OP_MercenaryTimerRequest),
|
N(OP_MercenaryTimerRequest),
|
||||||
N(OP_MercenaryUnknown1),
|
N(OP_MercenaryUnknown1),
|
||||||
N(OP_MercenaryUnsuspendResponse),
|
N(OP_MercenaryUnsuspendResponse),
|
||||||
N(OP_MerchantBulkItems),
|
|
||||||
N(OP_MobEnduranceUpdate),
|
N(OP_MobEnduranceUpdate),
|
||||||
N(OP_MobHealth),
|
N(OP_MobHealth),
|
||||||
N(OP_MobManaUpdate),
|
N(OP_MobManaUpdate),
|
||||||
@@ -373,7 +376,6 @@ N(OP_MultiLineMsg),
|
|||||||
N(OP_NewSpawn),
|
N(OP_NewSpawn),
|
||||||
N(OP_NewTitlesAvailable),
|
N(OP_NewTitlesAvailable),
|
||||||
N(OP_NewZone),
|
N(OP_NewZone),
|
||||||
N(OP_NPCMoveUpdate),
|
|
||||||
N(OP_OnLevelMessage),
|
N(OP_OnLevelMessage),
|
||||||
N(OP_OpenContainer),
|
N(OP_OpenContainer),
|
||||||
N(OP_OpenDiscordMerchant),
|
N(OP_OpenDiscordMerchant),
|
||||||
@@ -400,6 +402,8 @@ N(OP_PetitionSearchText),
|
|||||||
N(OP_PetitionUnCheckout),
|
N(OP_PetitionUnCheckout),
|
||||||
N(OP_PetitionUpdate),
|
N(OP_PetitionUpdate),
|
||||||
N(OP_PickPocket),
|
N(OP_PickPocket),
|
||||||
|
N(OP_PickZone),
|
||||||
|
N(OP_PickZoneWindow),
|
||||||
N(OP_PlayerProfile),
|
N(OP_PlayerProfile),
|
||||||
N(OP_PlayerStateAdd),
|
N(OP_PlayerStateAdd),
|
||||||
N(OP_PlayerStateRemove),
|
N(OP_PlayerStateRemove),
|
||||||
|
|||||||
@@ -56,8 +56,6 @@ const char* EQ::versions::ClientVersionName(ClientVersion client_version)
|
|||||||
return "RoF";
|
return "RoF";
|
||||||
case ClientVersion::RoF2:
|
case ClientVersion::RoF2:
|
||||||
return "RoF2";
|
return "RoF2";
|
||||||
case ClientVersion::Laurion:
|
|
||||||
return "Laurion";
|
|
||||||
default:
|
default:
|
||||||
return "Invalid Version";
|
return "Invalid Version";
|
||||||
};
|
};
|
||||||
@@ -78,8 +76,6 @@ uint32 EQ::versions::ConvertClientVersionToClientVersionBit(ClientVersion client
|
|||||||
return bitRoF;
|
return bitRoF;
|
||||||
case ClientVersion::RoF2:
|
case ClientVersion::RoF2:
|
||||||
return bitRoF2;
|
return bitRoF2;
|
||||||
case ClientVersion::Laurion:
|
|
||||||
return bitLaurion;
|
|
||||||
default:
|
default:
|
||||||
return bitUnknown;
|
return bitUnknown;
|
||||||
}
|
}
|
||||||
@@ -100,8 +96,6 @@ EQ::versions::ClientVersion EQ::versions::ConvertClientVersionBitToClientVersion
|
|||||||
return ClientVersion::RoF;
|
return ClientVersion::RoF;
|
||||||
case ((uint32)1 << (static_cast<unsigned int>(ClientVersion::RoF2) - 1)) :
|
case ((uint32)1 << (static_cast<unsigned int>(ClientVersion::RoF2) - 1)) :
|
||||||
return ClientVersion::RoF2;
|
return ClientVersion::RoF2;
|
||||||
case ((uint32)1 << (static_cast<unsigned int>(ClientVersion::Laurion) - 1)):
|
|
||||||
return ClientVersion::Laurion;
|
|
||||||
default:
|
default:
|
||||||
return ClientVersion::Unknown;
|
return ClientVersion::Unknown;
|
||||||
}
|
}
|
||||||
@@ -190,8 +184,6 @@ const char* EQ::versions::MobVersionName(MobVersion mob_version)
|
|||||||
return "RoF";
|
return "RoF";
|
||||||
case MobVersion::RoF2:
|
case MobVersion::RoF2:
|
||||||
return "RoF2";
|
return "RoF2";
|
||||||
case MobVersion::Laurion:
|
|
||||||
return "Laurion";
|
|
||||||
case MobVersion::NPC:
|
case MobVersion::NPC:
|
||||||
return "NPC";
|
return "NPC";
|
||||||
case MobVersion::NPCMerchant:
|
case MobVersion::NPCMerchant:
|
||||||
@@ -220,8 +212,6 @@ const char* EQ::versions::MobVersionName(MobVersion mob_version)
|
|||||||
return "Offline RoF";
|
return "Offline RoF";
|
||||||
case MobVersion::OfflineRoF2:
|
case MobVersion::OfflineRoF2:
|
||||||
return "Offline RoF2";
|
return "Offline RoF2";
|
||||||
case MobVersion::OfflineLaurion:
|
|
||||||
return "Offline Laurion";
|
|
||||||
default:
|
default:
|
||||||
return "Invalid Version";
|
return "Invalid Version";
|
||||||
};
|
};
|
||||||
@@ -245,8 +235,6 @@ EQ::versions::ClientVersion EQ::versions::ConvertMobVersionToClientVersion(MobVe
|
|||||||
return ClientVersion::RoF;
|
return ClientVersion::RoF;
|
||||||
case MobVersion::RoF2:
|
case MobVersion::RoF2:
|
||||||
return ClientVersion::RoF2;
|
return ClientVersion::RoF2;
|
||||||
case MobVersion::Laurion:
|
|
||||||
return ClientVersion::Laurion;
|
|
||||||
default:
|
default:
|
||||||
return ClientVersion::Unknown;
|
return ClientVersion::Unknown;
|
||||||
}
|
}
|
||||||
@@ -270,8 +258,6 @@ EQ::versions::MobVersion EQ::versions::ConvertClientVersionToMobVersion(ClientVe
|
|||||||
return MobVersion::RoF;
|
return MobVersion::RoF;
|
||||||
case ClientVersion::RoF2:
|
case ClientVersion::RoF2:
|
||||||
return MobVersion::RoF2;
|
return MobVersion::RoF2;
|
||||||
case ClientVersion::Laurion:
|
|
||||||
return MobVersion::Laurion;
|
|
||||||
default:
|
default:
|
||||||
return MobVersion::Unknown;
|
return MobVersion::Unknown;
|
||||||
}
|
}
|
||||||
@@ -292,8 +278,6 @@ EQ::versions::MobVersion EQ::versions::ConvertPCMobVersionToOfflinePCMobVersion(
|
|||||||
return MobVersion::OfflineRoF;
|
return MobVersion::OfflineRoF;
|
||||||
case MobVersion::RoF2:
|
case MobVersion::RoF2:
|
||||||
return MobVersion::OfflineRoF2;
|
return MobVersion::OfflineRoF2;
|
||||||
case MobVersion::Laurion:
|
|
||||||
return MobVersion::OfflineLaurion;
|
|
||||||
default:
|
default:
|
||||||
return MobVersion::Unknown;
|
return MobVersion::Unknown;
|
||||||
}
|
}
|
||||||
@@ -314,8 +298,6 @@ EQ::versions::MobVersion EQ::versions::ConvertOfflinePCMobVersionToPCMobVersion(
|
|||||||
return MobVersion::RoF;
|
return MobVersion::RoF;
|
||||||
case MobVersion::OfflineRoF2:
|
case MobVersion::OfflineRoF2:
|
||||||
return MobVersion::RoF2;
|
return MobVersion::RoF2;
|
||||||
case MobVersion::OfflineLaurion:
|
|
||||||
return MobVersion::Laurion;
|
|
||||||
default:
|
default:
|
||||||
return MobVersion::Unknown;
|
return MobVersion::Unknown;
|
||||||
}
|
}
|
||||||
@@ -336,8 +318,6 @@ EQ::versions::ClientVersion EQ::versions::ConvertOfflinePCMobVersionToClientVers
|
|||||||
return ClientVersion::RoF;
|
return ClientVersion::RoF;
|
||||||
case MobVersion::OfflineRoF2:
|
case MobVersion::OfflineRoF2:
|
||||||
return ClientVersion::RoF2;
|
return ClientVersion::RoF2;
|
||||||
case MobVersion::OfflineLaurion:
|
|
||||||
return ClientVersion::Laurion;
|
|
||||||
default:
|
default:
|
||||||
return ClientVersion::Unknown;
|
return ClientVersion::Unknown;
|
||||||
}
|
}
|
||||||
@@ -358,8 +338,6 @@ EQ::versions::MobVersion EQ::versions::ConvertClientVersionToOfflinePCMobVersion
|
|||||||
return MobVersion::OfflineRoF;
|
return MobVersion::OfflineRoF;
|
||||||
case ClientVersion::RoF2:
|
case ClientVersion::RoF2:
|
||||||
return MobVersion::OfflineRoF2;
|
return MobVersion::OfflineRoF2;
|
||||||
case ClientVersion::Laurion:
|
|
||||||
return MobVersion::OfflineLaurion;
|
|
||||||
default:
|
default:
|
||||||
return MobVersion::Unknown;
|
return MobVersion::Unknown;
|
||||||
}
|
}
|
||||||
@@ -410,27 +388,6 @@ const char* EQ::expansions::ExpansionName(Expansion expansion)
|
|||||||
return "Rain of Fear";
|
return "Rain of Fear";
|
||||||
case Expansion::CotF:
|
case Expansion::CotF:
|
||||||
return "Call of the Forsaken";
|
return "Call of the Forsaken";
|
||||||
case Expansion::TDS:
|
|
||||||
return "The Darkened Sea";
|
|
||||||
case Expansion::TBM:
|
|
||||||
return "The Broken Mirror";
|
|
||||||
case Expansion::EoK:
|
|
||||||
return "Empires of Kunark";
|
|
||||||
case Expansion::RoS:
|
|
||||||
return "Ring of Scale";
|
|
||||||
case Expansion::TBL:
|
|
||||||
return "The Burning Lands";
|
|
||||||
case Expansion::ToV:
|
|
||||||
return "Torment of Velious";
|
|
||||||
case Expansion::CoV:
|
|
||||||
return "Claws of Veeshan";
|
|
||||||
case Expansion::ToL:
|
|
||||||
return "Terror of Luclin";
|
|
||||||
case Expansion::NoS:
|
|
||||||
return "Night of Shadows";
|
|
||||||
case Expansion::LS:
|
|
||||||
return "Laurion's Song";
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return "Invalid Expansion";
|
return "Invalid Expansion";
|
||||||
}
|
}
|
||||||
@@ -484,26 +441,6 @@ uint32 EQ::expansions::ConvertExpansionToExpansionBit(Expansion expansion)
|
|||||||
return bitRoF;
|
return bitRoF;
|
||||||
case Expansion::CotF:
|
case Expansion::CotF:
|
||||||
return bitCotF;
|
return bitCotF;
|
||||||
case Expansion::TDS:
|
|
||||||
return bitTDS;
|
|
||||||
case Expansion::TBM:
|
|
||||||
return bitTBM;
|
|
||||||
case Expansion::EoK:
|
|
||||||
return bitEoK;
|
|
||||||
case Expansion::RoS:
|
|
||||||
return bitRoS;
|
|
||||||
case Expansion::TBL:
|
|
||||||
return bitTBL;
|
|
||||||
case Expansion::ToV:
|
|
||||||
return bitToV;
|
|
||||||
case Expansion::CoV:
|
|
||||||
return bitCoV;
|
|
||||||
case Expansion::ToL:
|
|
||||||
return bitToL;
|
|
||||||
case Expansion::NoS:
|
|
||||||
return bitNoS;
|
|
||||||
case Expansion::LS:
|
|
||||||
return bitLS;
|
|
||||||
default:
|
default:
|
||||||
return bitEverQuest;
|
return bitEverQuest;
|
||||||
}
|
}
|
||||||
@@ -552,26 +489,6 @@ EQ::expansions::Expansion EQ::expansions::ConvertExpansionBitToExpansion(uint32
|
|||||||
return Expansion::RoF;
|
return Expansion::RoF;
|
||||||
case bitCotF:
|
case bitCotF:
|
||||||
return Expansion::CotF;
|
return Expansion::CotF;
|
||||||
case bitTDS:
|
|
||||||
return Expansion::TDS;
|
|
||||||
case bitTBM:
|
|
||||||
return Expansion::TBM;
|
|
||||||
case bitEoK:
|
|
||||||
return Expansion::EoK;
|
|
||||||
case bitRoS:
|
|
||||||
return Expansion::RoS;
|
|
||||||
case bitTBL:
|
|
||||||
return Expansion::TBL;
|
|
||||||
case bitToV:
|
|
||||||
return Expansion::ToV;
|
|
||||||
case bitCoV:
|
|
||||||
return Expansion::CoV;
|
|
||||||
case bitToL:
|
|
||||||
return Expansion::ToL;
|
|
||||||
case bitNoS:
|
|
||||||
return Expansion::NoS;
|
|
||||||
case bitLS:
|
|
||||||
return Expansion::LS;
|
|
||||||
default:
|
default:
|
||||||
return Expansion::EverQuest;
|
return Expansion::EverQuest;
|
||||||
}
|
}
|
||||||
@@ -620,26 +537,6 @@ uint32 EQ::expansions::ConvertExpansionToExpansionsMask(Expansion expansion)
|
|||||||
return maskRoF;
|
return maskRoF;
|
||||||
case Expansion::CotF:
|
case Expansion::CotF:
|
||||||
return maskCotF;
|
return maskCotF;
|
||||||
case Expansion::TDS:
|
|
||||||
return maskTDS;
|
|
||||||
case Expansion::TBM:
|
|
||||||
return maskTBM;
|
|
||||||
case Expansion::EoK:
|
|
||||||
return maskEoK;
|
|
||||||
case Expansion::RoS:
|
|
||||||
return maskRoS;
|
|
||||||
case Expansion::TBL:
|
|
||||||
return maskTBL;
|
|
||||||
case Expansion::ToV:
|
|
||||||
return maskToV;
|
|
||||||
case Expansion::CoV:
|
|
||||||
return maskCoV;
|
|
||||||
case Expansion::ToL:
|
|
||||||
return maskToL;
|
|
||||||
case Expansion::NoS:
|
|
||||||
return maskNoS;
|
|
||||||
case Expansion::LS:
|
|
||||||
return maskLS;
|
|
||||||
default:
|
default:
|
||||||
return maskEverQuest;
|
return maskEverQuest;
|
||||||
}
|
}
|
||||||
|
|||||||
+9
-45
@@ -36,8 +36,7 @@ namespace EQ
|
|||||||
SoD, // Build: 'Dec 19 2008 15:22:49'
|
SoD, // Build: 'Dec 19 2008 15:22:49'
|
||||||
UF, // Build: 'Jun 8 2010 16:44:32'
|
UF, // Build: 'Jun 8 2010 16:44:32'
|
||||||
RoF, // Build: 'Dec 10 2012 17:35:44'
|
RoF, // Build: 'Dec 10 2012 17:35:44'
|
||||||
RoF2, // Build: 'May 10 2013 23:30:08'
|
RoF2 // Build: 'May 10 2013 23:30:08'
|
||||||
Laurion
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum ClientVersionBitmask : uint32 {
|
enum ClientVersionBitmask : uint32 {
|
||||||
@@ -49,7 +48,6 @@ namespace EQ
|
|||||||
bitUF = 0x00000010,
|
bitUF = 0x00000010,
|
||||||
bitRoF = 0x00000020,
|
bitRoF = 0x00000020,
|
||||||
bitRoF2 = 0x00000040,
|
bitRoF2 = 0x00000040,
|
||||||
bitLaurion = 0x00000080,
|
|
||||||
maskUnknown = 0x00000000,
|
maskUnknown = 0x00000000,
|
||||||
maskTitaniumAndEarlier = 0x00000003,
|
maskTitaniumAndEarlier = 0x00000003,
|
||||||
maskSoFAndEarlier = 0x00000007,
|
maskSoFAndEarlier = 0x00000007,
|
||||||
@@ -61,11 +59,10 @@ namespace EQ
|
|||||||
maskUFAndLater = 0xFFFFFFF0,
|
maskUFAndLater = 0xFFFFFFF0,
|
||||||
maskRoFAndLater = 0xFFFFFFE0,
|
maskRoFAndLater = 0xFFFFFFE0,
|
||||||
maskRoF2AndLater = 0xFFFFFFC0,
|
maskRoF2AndLater = 0xFFFFFFC0,
|
||||||
maskLaurionAndLater = 0xFFFFFF80,
|
|
||||||
maskAllClients = 0xFFFFFFFF
|
maskAllClients = 0xFFFFFFFF
|
||||||
};
|
};
|
||||||
|
|
||||||
const ClientVersion LastClientVersion = ClientVersion::Laurion;
|
const ClientVersion LastClientVersion = ClientVersion::RoF2;
|
||||||
const size_t ClientVersionCount = (static_cast<size_t>(LastClientVersion) + 1);
|
const size_t ClientVersionCount = (static_cast<size_t>(LastClientVersion) + 1);
|
||||||
|
|
||||||
bool IsValidClientVersion(ClientVersion client_version);
|
bool IsValidClientVersion(ClientVersion client_version);
|
||||||
@@ -83,7 +80,6 @@ namespace EQ
|
|||||||
UF,
|
UF,
|
||||||
RoF,
|
RoF,
|
||||||
RoF2,
|
RoF2,
|
||||||
Laurion,
|
|
||||||
NPC,
|
NPC,
|
||||||
NPCMerchant,
|
NPCMerchant,
|
||||||
Merc,
|
Merc,
|
||||||
@@ -97,14 +93,13 @@ namespace EQ
|
|||||||
OfflineSoD,
|
OfflineSoD,
|
||||||
OfflineUF,
|
OfflineUF,
|
||||||
OfflineRoF,
|
OfflineRoF,
|
||||||
OfflineRoF2,
|
OfflineRoF2
|
||||||
OfflineLaurion
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const MobVersion LastMobVersion = MobVersion::OfflineLaurion;
|
const MobVersion LastMobVersion = MobVersion::OfflineRoF2;
|
||||||
const MobVersion LastPCMobVersion = MobVersion::Laurion;
|
const MobVersion LastPCMobVersion = MobVersion::RoF2;
|
||||||
const MobVersion LastNonPCMobVersion = MobVersion::BotPet;
|
const MobVersion LastNonPCMobVersion = MobVersion::BotPet;
|
||||||
const MobVersion LastOfflinePCMobVersion = MobVersion::OfflineLaurion;
|
const MobVersion LastOfflinePCMobVersion = MobVersion::OfflineRoF2;
|
||||||
const size_t MobVersionCount = (static_cast<size_t>(LastMobVersion) + 1);
|
const size_t MobVersionCount = (static_cast<size_t>(LastMobVersion) + 1);
|
||||||
|
|
||||||
bool IsValidMobVersion(MobVersion mob_version);
|
bool IsValidMobVersion(MobVersion mob_version);
|
||||||
@@ -136,8 +131,7 @@ namespace EQ
|
|||||||
ucsSoDCombined = 'D',
|
ucsSoDCombined = 'D',
|
||||||
ucsUFCombined = 'E',
|
ucsUFCombined = 'E',
|
||||||
ucsRoFCombined = 'F',
|
ucsRoFCombined = 'F',
|
||||||
ucsRoF2Combined = 'G',
|
ucsRoF2Combined = 'G'
|
||||||
ucsLaurionCombined = 'G'
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} /*versions*/
|
} /*versions*/
|
||||||
@@ -164,17 +158,7 @@ namespace EQ
|
|||||||
HoT,
|
HoT,
|
||||||
VoA,
|
VoA,
|
||||||
RoF,
|
RoF,
|
||||||
CotF,
|
CotF
|
||||||
TDS,
|
|
||||||
TBM,
|
|
||||||
EoK,
|
|
||||||
RoS,
|
|
||||||
TBL,
|
|
||||||
ToV,
|
|
||||||
CoV,
|
|
||||||
ToL,
|
|
||||||
NoS,
|
|
||||||
LS
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum ExpansionBitmask : uint32 {
|
enum ExpansionBitmask : uint32 {
|
||||||
@@ -199,16 +183,6 @@ namespace EQ
|
|||||||
bitVoA = 0x00020000,
|
bitVoA = 0x00020000,
|
||||||
bitRoF = 0x00040000,
|
bitRoF = 0x00040000,
|
||||||
bitCotF = 0x00080000,
|
bitCotF = 0x00080000,
|
||||||
bitTDS = 0x00100000,
|
|
||||||
bitTBM = 0x00200000,
|
|
||||||
bitEoK = 0x00400000,
|
|
||||||
bitRoS = 0x00800000,
|
|
||||||
bitTBL = 0x01000000,
|
|
||||||
bitToV = 0x02000000,
|
|
||||||
bitCoV = 0x04000000,
|
|
||||||
bitToL = 0x08000000,
|
|
||||||
bitNoS = 0x10000000,
|
|
||||||
bitLS = 0x20000000,
|
|
||||||
maskEverQuest = 0x00000000,
|
maskEverQuest = 0x00000000,
|
||||||
maskRoK = 0x00000001,
|
maskRoK = 0x00000001,
|
||||||
maskSoV = 0x00000003,
|
maskSoV = 0x00000003,
|
||||||
@@ -229,17 +203,7 @@ namespace EQ
|
|||||||
maskHoT = 0x0001FFFF,
|
maskHoT = 0x0001FFFF,
|
||||||
maskVoA = 0x0003FFFF,
|
maskVoA = 0x0003FFFF,
|
||||||
maskRoF = 0x0007FFFF,
|
maskRoF = 0x0007FFFF,
|
||||||
maskCotF = 0x000FFFFF,
|
maskCotF = 0x000FFFFF
|
||||||
maskTDS = 0x001FFFFF,
|
|
||||||
maskTBM = 0x003FFFFF,
|
|
||||||
maskEoK = 0x007FFFFF,
|
|
||||||
maskRoS = 0x00FFFFFF,
|
|
||||||
maskTBL = 0x01FFFFFF,
|
|
||||||
maskToV = 0x03FFFFFF,
|
|
||||||
maskCoV = 0x07FFFFFF,
|
|
||||||
maskToL = 0x0FFFFFFF,
|
|
||||||
maskNoS = 0x1FFFFFFF,
|
|
||||||
maskLS = 0x3FFFFFFF,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const char* ExpansionName(Expansion expansion);
|
const char* ExpansionName(Expansion expansion);
|
||||||
|
|||||||
+1
-58
@@ -762,46 +762,6 @@ typedef enum {
|
|||||||
FilterStrikethrough = 26, //0=show, 1=hide // RoF2 Confirmed
|
FilterStrikethrough = 26, //0=show, 1=hide // RoF2 Confirmed
|
||||||
FilterStuns = 27, //0=show, 1=hide // RoF2 Confirmed
|
FilterStuns = 27, //0=show, 1=hide // RoF2 Confirmed
|
||||||
FilterBardSongsOnPets = 28, //0=show, 1=hide // RoF2 Confirmed
|
FilterBardSongsOnPets = 28, //0=show, 1=hide // RoF2 Confirmed
|
||||||
FilterSwarmPetDeath = 29,
|
|
||||||
FilterFellowshipChat = 30,
|
|
||||||
FilterMercenaryMessages = 31,
|
|
||||||
FilterSpam = 32,
|
|
||||||
FilterAchievements = 33,
|
|
||||||
FilterPvPMessages = 34,
|
|
||||||
FilterSpellNameInCast = 35,
|
|
||||||
FilterRandomMine = 36,
|
|
||||||
FilterRandomGroupRaid = 37,
|
|
||||||
FilterRandomOthers = 38,
|
|
||||||
FilterEnvironmentalDamage = 39,
|
|
||||||
FilterMessages = 40,
|
|
||||||
FilterOverwriteDetrimental = 41,
|
|
||||||
FilterOverwriteBeneficial = 42,
|
|
||||||
FilterCantUseCommand = 43,
|
|
||||||
FilterCombatAbilityReuse = 44,
|
|
||||||
FilterAAAbilityReuse = 45,
|
|
||||||
FilterProcBeginCasting = 46,
|
|
||||||
FilterDestroyedItems = 47,
|
|
||||||
FilterYourAuras = 48,
|
|
||||||
FilterOtherAuras = 49,
|
|
||||||
FilterYourHeals = 50,
|
|
||||||
FilterOtherHeals = 51,
|
|
||||||
FilterYourDoTs = 52,
|
|
||||||
FilterOtherDoTs = 53,
|
|
||||||
FilterOtherDirectDamage = 54,
|
|
||||||
FilterSpellEmotes = 55,
|
|
||||||
FilterFactionMessages = 56,
|
|
||||||
FilterTauntMessages = 57,
|
|
||||||
FilterYourDisciplines = 58,
|
|
||||||
FilterOtherDisplines = 59,
|
|
||||||
FilterAchievementsOthers = 60,
|
|
||||||
FilterRaidVictory = 61,
|
|
||||||
FilterOtherDirectDamageCrits = 62,
|
|
||||||
FilterDoTYoursCritical = 63,
|
|
||||||
FilterDoTOthersCritical = 64,
|
|
||||||
FilterDoTDamageTaken = 65,
|
|
||||||
FilterHealsReceived = 66,
|
|
||||||
FilterHealsYoursCritical = 67,
|
|
||||||
FilterHealsOthersCritical = 68,
|
|
||||||
_FilterCount
|
_FilterCount
|
||||||
} eqFilterType;
|
} eqFilterType;
|
||||||
|
|
||||||
@@ -1033,24 +993,6 @@ enum class DynamicZoneMemberStatus : uint8_t
|
|||||||
LinkDead
|
LinkDead
|
||||||
};
|
};
|
||||||
|
|
||||||
enum LDoNThemes {
|
|
||||||
Unused = 0,
|
|
||||||
GUK,
|
|
||||||
MIR,
|
|
||||||
MMC,
|
|
||||||
RUJ,
|
|
||||||
TAK
|
|
||||||
};
|
|
||||||
|
|
||||||
enum LDoNThemeBits {
|
|
||||||
UnusedBit = 0,
|
|
||||||
GUKBit = 1,
|
|
||||||
MIRBit = 2,
|
|
||||||
MMCBit = 4,
|
|
||||||
RUJBit = 8,
|
|
||||||
TAKBit = 16
|
|
||||||
};
|
|
||||||
|
|
||||||
enum StartZoneIndex {
|
enum StartZoneIndex {
|
||||||
Odus = 0,
|
Odus = 0,
|
||||||
Qeynos,
|
Qeynos,
|
||||||
@@ -1172,4 +1114,5 @@ enum ExpSource
|
|||||||
namespace DoorType {
|
namespace DoorType {
|
||||||
constexpr uint32 BuyerStall = 155;
|
constexpr uint32 BuyerStall = 155;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /*COMMON_EQ_CONSTANTS_H*/
|
#endif /*COMMON_EQ_CONSTANTS_H*/
|
||||||
|
|||||||
+14
-89
@@ -47,6 +47,7 @@ static const EQ::constants::LookupEntry constants_static_lookup_entries[EQ::vers
|
|||||||
ClientUnknown::constants::EXPANSION_BIT,
|
ClientUnknown::constants::EXPANSION_BIT,
|
||||||
ClientUnknown::constants::EXPANSIONS_MASK,
|
ClientUnknown::constants::EXPANSIONS_MASK,
|
||||||
ClientUnknown::INULL,
|
ClientUnknown::INULL,
|
||||||
|
ClientUnknown::INULL,
|
||||||
ClientUnknown::INULL
|
ClientUnknown::INULL
|
||||||
),
|
),
|
||||||
/*[ClientVersion::Client62] =*/
|
/*[ClientVersion::Client62] =*/
|
||||||
@@ -55,6 +56,7 @@ static const EQ::constants::LookupEntry constants_static_lookup_entries[EQ::vers
|
|||||||
Client62::constants::EXPANSION_BIT,
|
Client62::constants::EXPANSION_BIT,
|
||||||
Client62::constants::EXPANSIONS_MASK,
|
Client62::constants::EXPANSIONS_MASK,
|
||||||
Client62::INULL,
|
Client62::INULL,
|
||||||
|
Client62::INULL,
|
||||||
Client62::INULL
|
Client62::INULL
|
||||||
),
|
),
|
||||||
/*[ClientVersion::Titanium] =*/
|
/*[ClientVersion::Titanium] =*/
|
||||||
@@ -63,7 +65,8 @@ static const EQ::constants::LookupEntry constants_static_lookup_entries[EQ::vers
|
|||||||
Titanium::constants::EXPANSION_BIT,
|
Titanium::constants::EXPANSION_BIT,
|
||||||
Titanium::constants::EXPANSIONS_MASK,
|
Titanium::constants::EXPANSIONS_MASK,
|
||||||
Titanium::constants::CHARACTER_CREATION_LIMIT,
|
Titanium::constants::CHARACTER_CREATION_LIMIT,
|
||||||
Titanium::constants::SAY_LINK_BODY_SIZE
|
Titanium::constants::SAY_LINK_BODY_SIZE,
|
||||||
|
Titanium::INULL
|
||||||
),
|
),
|
||||||
/*[ClientVersion::SoF] =*/
|
/*[ClientVersion::SoF] =*/
|
||||||
EQ::constants::LookupEntry(
|
EQ::constants::LookupEntry(
|
||||||
@@ -71,7 +74,8 @@ static const EQ::constants::LookupEntry constants_static_lookup_entries[EQ::vers
|
|||||||
SoF::constants::EXPANSION_BIT,
|
SoF::constants::EXPANSION_BIT,
|
||||||
SoF::constants::EXPANSIONS_MASK,
|
SoF::constants::EXPANSIONS_MASK,
|
||||||
SoF::constants::CHARACTER_CREATION_LIMIT,
|
SoF::constants::CHARACTER_CREATION_LIMIT,
|
||||||
SoF::constants::SAY_LINK_BODY_SIZE
|
SoF::constants::SAY_LINK_BODY_SIZE,
|
||||||
|
SoF::INULL
|
||||||
),
|
),
|
||||||
/*[ClientVersion::SoD] =*/
|
/*[ClientVersion::SoD] =*/
|
||||||
EQ::constants::LookupEntry(
|
EQ::constants::LookupEntry(
|
||||||
@@ -79,7 +83,8 @@ static const EQ::constants::LookupEntry constants_static_lookup_entries[EQ::vers
|
|||||||
SoD::constants::EXPANSION_BIT,
|
SoD::constants::EXPANSION_BIT,
|
||||||
SoD::constants::EXPANSIONS_MASK,
|
SoD::constants::EXPANSIONS_MASK,
|
||||||
SoD::constants::CHARACTER_CREATION_LIMIT,
|
SoD::constants::CHARACTER_CREATION_LIMIT,
|
||||||
SoD::constants::SAY_LINK_BODY_SIZE
|
SoD::constants::SAY_LINK_BODY_SIZE,
|
||||||
|
SoD::INULL
|
||||||
),
|
),
|
||||||
/*[ClientVersion::UF] =*/
|
/*[ClientVersion::UF] =*/
|
||||||
EQ::constants::LookupEntry(
|
EQ::constants::LookupEntry(
|
||||||
@@ -87,7 +92,8 @@ static const EQ::constants::LookupEntry constants_static_lookup_entries[EQ::vers
|
|||||||
UF::constants::EXPANSION_BIT,
|
UF::constants::EXPANSION_BIT,
|
||||||
UF::constants::EXPANSIONS_MASK,
|
UF::constants::EXPANSIONS_MASK,
|
||||||
UF::constants::CHARACTER_CREATION_LIMIT,
|
UF::constants::CHARACTER_CREATION_LIMIT,
|
||||||
UF::constants::SAY_LINK_BODY_SIZE
|
UF::constants::SAY_LINK_BODY_SIZE,
|
||||||
|
UF::INULL
|
||||||
),
|
),
|
||||||
/*[ClientVersion::RoF] =*/
|
/*[ClientVersion::RoF] =*/
|
||||||
EQ::constants::LookupEntry(
|
EQ::constants::LookupEntry(
|
||||||
@@ -95,7 +101,8 @@ static const EQ::constants::LookupEntry constants_static_lookup_entries[EQ::vers
|
|||||||
RoF::constants::EXPANSION_BIT,
|
RoF::constants::EXPANSION_BIT,
|
||||||
RoF::constants::EXPANSIONS_MASK,
|
RoF::constants::EXPANSIONS_MASK,
|
||||||
RoF::constants::CHARACTER_CREATION_LIMIT,
|
RoF::constants::CHARACTER_CREATION_LIMIT,
|
||||||
RoF::constants::SAY_LINK_BODY_SIZE
|
RoF::constants::SAY_LINK_BODY_SIZE,
|
||||||
|
RoF::INULL
|
||||||
),
|
),
|
||||||
/*[ClientVersion::RoF2] =*/
|
/*[ClientVersion::RoF2] =*/
|
||||||
EQ::constants::LookupEntry(
|
EQ::constants::LookupEntry(
|
||||||
@@ -103,15 +110,8 @@ static const EQ::constants::LookupEntry constants_static_lookup_entries[EQ::vers
|
|||||||
RoF2::constants::EXPANSION_BIT,
|
RoF2::constants::EXPANSION_BIT,
|
||||||
RoF2::constants::EXPANSIONS_MASK,
|
RoF2::constants::EXPANSIONS_MASK,
|
||||||
RoF2::constants::CHARACTER_CREATION_LIMIT,
|
RoF2::constants::CHARACTER_CREATION_LIMIT,
|
||||||
RoF2::constants::SAY_LINK_BODY_SIZE
|
RoF2::constants::SAY_LINK_BODY_SIZE,
|
||||||
),
|
RoF2::constants::MAX_BAZAAR_TRADERS
|
||||||
/*[ClientVersion::Laurion] =*/
|
|
||||||
EQ::constants::LookupEntry(
|
|
||||||
Laurion::constants::EXPANSION,
|
|
||||||
Laurion::constants::EXPANSION_BIT,
|
|
||||||
Laurion::constants::EXPANSIONS_MASK,
|
|
||||||
Laurion::constants::CHARACTER_CREATION_LIMIT,
|
|
||||||
Laurion::constants::SAY_LINK_BODY_SIZE
|
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -378,33 +378,6 @@ static const EQ::inventory::LookupEntry inventory_static_lookup_entries[EQ::vers
|
|||||||
RoF2::inventory::ConcatenateInvTypeLimbo,
|
RoF2::inventory::ConcatenateInvTypeLimbo,
|
||||||
RoF2::inventory::AllowOverLevelEquipment
|
RoF2::inventory::AllowOverLevelEquipment
|
||||||
),
|
),
|
||||||
/*[MobVersion::LS] =*/
|
|
||||||
EQ::inventory::LookupEntry(
|
|
||||||
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
|
|
||||||
EQ::invtype::POSSESSIONS_SIZE, RoF2::invtype::BANK_SIZE, RoF2::invtype::SHARED_BANK_SIZE,
|
|
||||||
RoF2::invtype::TRADE_SIZE, RoF2::invtype::WORLD_SIZE, RoF2::invtype::LIMBO_SIZE,
|
|
||||||
RoF2::invtype::TRIBUTE_SIZE, RoF2::invtype::TROPHY_TRIBUTE_SIZE, RoF2::invtype::GUILD_TRIBUTE_SIZE,
|
|
||||||
RoF2::invtype::MERCHANT_SIZE, RoF2::invtype::DELETED_SIZE, RoF2::invtype::CORPSE_SIZE,
|
|
||||||
RoF2::invtype::BAZAAR_SIZE, RoF2::invtype::INSPECT_SIZE, RoF2::invtype::REAL_ESTATE_SIZE,
|
|
||||||
RoF2::invtype::VIEW_MOD_PC_SIZE, RoF2::invtype::VIEW_MOD_BANK_SIZE, RoF2::invtype::VIEW_MOD_SHARED_BANK_SIZE,
|
|
||||||
RoF2::invtype::VIEW_MOD_LIMBO_SIZE, RoF2::invtype::ALT_STORAGE_SIZE, RoF2::invtype::ARCHIVED_SIZE,
|
|
||||||
RoF2::invtype::MAIL_SIZE, RoF2::invtype::GUILD_TROPHY_TRIBUTE_SIZE, RoF2::invtype::KRONO_SIZE,
|
|
||||||
RoF2::invtype::OTHER_SIZE
|
|
||||||
),
|
|
||||||
|
|
||||||
RoF2::invslot::EQUIPMENT_BITMASK,
|
|
||||||
RoF2::invslot::GENERAL_BITMASK,
|
|
||||||
RoF2::invslot::CURSOR_BITMASK,
|
|
||||||
RoF2::invslot::POSSESSIONS_BITMASK,
|
|
||||||
RoF2::invslot::CORPSE_BITMASK,
|
|
||||||
RoF2::invbag::SLOT_COUNT,
|
|
||||||
RoF2::invaug::SOCKET_COUNT,
|
|
||||||
|
|
||||||
RoF2::inventory::AllowEmptyBagInBag,
|
|
||||||
RoF2::inventory::AllowClickCastFromBag,
|
|
||||||
RoF2::inventory::ConcatenateInvTypeLimbo,
|
|
||||||
RoF2::inventory::AllowOverLevelEquipment
|
|
||||||
),
|
|
||||||
/*[MobVersion::NPC] =*/
|
/*[MobVersion::NPC] =*/
|
||||||
EQ::inventory::LookupEntry(
|
EQ::inventory::LookupEntry(
|
||||||
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
|
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
|
||||||
@@ -778,33 +751,6 @@ static const EQ::inventory::LookupEntry inventory_static_lookup_entries[EQ::vers
|
|||||||
RoF2::invbag::SLOT_COUNT,
|
RoF2::invbag::SLOT_COUNT,
|
||||||
RoF2::invaug::SOCKET_COUNT,
|
RoF2::invaug::SOCKET_COUNT,
|
||||||
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
false
|
|
||||||
),
|
|
||||||
/*[MobVersion::OfflineLS] =*/
|
|
||||||
EQ::inventory::LookupEntry(
|
|
||||||
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
|
|
||||||
RoF2::INULL, RoF2::INULL, RoF2::INULL,
|
|
||||||
RoF2::invtype::TRADE_SIZE, RoF2::INULL, RoF2::INULL,
|
|
||||||
RoF2::INULL, RoF2::INULL, RoF2::INULL,
|
|
||||||
RoF2::invtype::MERCHANT_SIZE, RoF2::INULL, RoF2::INULL,
|
|
||||||
RoF2::invtype::BAZAAR_SIZE, RoF2::invtype::INSPECT_SIZE, RoF2::INULL,
|
|
||||||
RoF2::invtype::VIEW_MOD_PC_SIZE, RoF2::invtype::VIEW_MOD_BANK_SIZE, RoF2::invtype::VIEW_MOD_SHARED_BANK_SIZE,
|
|
||||||
RoF2::invtype::VIEW_MOD_LIMBO_SIZE, RoF2::INULL, RoF2::INULL,
|
|
||||||
RoF2::INULL, RoF2::INULL, RoF2::INULL,
|
|
||||||
RoF2::INULL
|
|
||||||
),
|
|
||||||
|
|
||||||
RoF2::INULL,
|
|
||||||
RoF2::INULL,
|
|
||||||
RoF2::INULL,
|
|
||||||
RoF2::INULL,
|
|
||||||
RoF2::INULL,
|
|
||||||
RoF2::invbag::SLOT_COUNT,
|
|
||||||
RoF2::invaug::SOCKET_COUNT,
|
|
||||||
|
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
@@ -1056,10 +1002,6 @@ static const EQ::behavior::LookupEntry behavior_static_lookup_entries[EQ::versio
|
|||||||
EQ::behavior::LookupEntry(
|
EQ::behavior::LookupEntry(
|
||||||
RoF2::behavior::CoinHasWeight
|
RoF2::behavior::CoinHasWeight
|
||||||
),
|
),
|
||||||
/*[MobVersion::LS] =*/
|
|
||||||
EQ::behavior::LookupEntry(
|
|
||||||
RoF2::behavior::CoinHasWeight
|
|
||||||
),
|
|
||||||
/*[MobVersion::NPC] =*/
|
/*[MobVersion::NPC] =*/
|
||||||
EQ::behavior::LookupEntry(
|
EQ::behavior::LookupEntry(
|
||||||
EQ::behavior::CoinHasWeight
|
EQ::behavior::CoinHasWeight
|
||||||
@@ -1113,10 +1055,6 @@ static const EQ::behavior::LookupEntry behavior_static_lookup_entries[EQ::versio
|
|||||||
RoF::behavior::CoinHasWeight
|
RoF::behavior::CoinHasWeight
|
||||||
),
|
),
|
||||||
/*[MobVersion::OfflineRoF2] =*/
|
/*[MobVersion::OfflineRoF2] =*/
|
||||||
EQ::behavior::LookupEntry(
|
|
||||||
RoF2::behavior::CoinHasWeight
|
|
||||||
),
|
|
||||||
/*[MobVersion::OfflineLS] =*/
|
|
||||||
EQ::behavior::LookupEntry(
|
EQ::behavior::LookupEntry(
|
||||||
RoF2::behavior::CoinHasWeight
|
RoF2::behavior::CoinHasWeight
|
||||||
)
|
)
|
||||||
@@ -1272,19 +1210,6 @@ static const EQ::spells::LookupEntry spells_static_lookup_entries[EQ::versions::
|
|||||||
RoF2::spells::NPC_BUFFS,
|
RoF2::spells::NPC_BUFFS,
|
||||||
RoF2::spells::PET_BUFFS,
|
RoF2::spells::PET_BUFFS,
|
||||||
RoF2::spells::MERC_BUFFS
|
RoF2::spells::MERC_BUFFS
|
||||||
),
|
|
||||||
/*[ClientVersion::Laurion] =*/
|
|
||||||
EQ::spells::LookupEntry(
|
|
||||||
Laurion::spells::SPELL_ID_MAX,
|
|
||||||
Laurion::spells::SPELLBOOK_SIZE,
|
|
||||||
UF::spells::SPELL_GEM_COUNT, // client translators are setup to allow the max value a client supports..however, the top 4 indices are not valid in this case
|
|
||||||
Laurion::spells::LONG_BUFFS,
|
|
||||||
Laurion::spells::SHORT_BUFFS,
|
|
||||||
Laurion::spells::DISC_BUFFS,
|
|
||||||
Laurion::spells::TOTAL_BUFFS,
|
|
||||||
Laurion::spells::NPC_BUFFS,
|
|
||||||
Laurion::spells::PET_BUFFS,
|
|
||||||
Laurion::spells::MERC_BUFFS
|
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+6
-3
@@ -29,7 +29,7 @@
|
|||||||
#include "../common/patches/uf_limits.h"
|
#include "../common/patches/uf_limits.h"
|
||||||
#include "../common/patches/rof_limits.h"
|
#include "../common/patches/rof_limits.h"
|
||||||
#include "../common/patches/rof2_limits.h"
|
#include "../common/patches/rof2_limits.h"
|
||||||
#include "../common/patches/laurion_limits.h"
|
|
||||||
|
|
||||||
namespace EQ
|
namespace EQ
|
||||||
{
|
{
|
||||||
@@ -42,6 +42,7 @@ namespace EQ
|
|||||||
uint32 ExpansionsMask;
|
uint32 ExpansionsMask;
|
||||||
int16 CharacterCreationLimit;
|
int16 CharacterCreationLimit;
|
||||||
size_t SayLinkBodySize;
|
size_t SayLinkBodySize;
|
||||||
|
uint32 BazaarTraderLimit;
|
||||||
|
|
||||||
LookupEntry(const LookupEntry *lookup_entry) { }
|
LookupEntry(const LookupEntry *lookup_entry) { }
|
||||||
LookupEntry(
|
LookupEntry(
|
||||||
@@ -49,13 +50,15 @@ namespace EQ
|
|||||||
uint32 ExpansionBit,
|
uint32 ExpansionBit,
|
||||||
uint32 ExpansionsMask,
|
uint32 ExpansionsMask,
|
||||||
int16 CharacterCreationLimit,
|
int16 CharacterCreationLimit,
|
||||||
size_t SayLinkBodySize
|
size_t SayLinkBodySize,
|
||||||
|
uint32 BazaarTraderLimit
|
||||||
) :
|
) :
|
||||||
Expansion(Expansion),
|
Expansion(Expansion),
|
||||||
ExpansionBit(ExpansionBit),
|
ExpansionBit(ExpansionBit),
|
||||||
ExpansionsMask(ExpansionsMask),
|
ExpansionsMask(ExpansionsMask),
|
||||||
CharacterCreationLimit(CharacterCreationLimit),
|
CharacterCreationLimit(CharacterCreationLimit),
|
||||||
SayLinkBodySize(SayLinkBodySize)
|
SayLinkBodySize(SayLinkBodySize),
|
||||||
|
BazaarTraderLimit(BazaarTraderLimit)
|
||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -47,13 +47,6 @@ static const uint32 ADVANCED_LORE_LENGTH = 8192;
|
|||||||
*/
|
*/
|
||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
|
|
||||||
struct EqGuid
|
|
||||||
{
|
|
||||||
uint32_t Id;
|
|
||||||
uint16_t WorldId;
|
|
||||||
uint16_t Reserved;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct LoginInfo_Struct {
|
struct LoginInfo_Struct {
|
||||||
/*000*/ char login_info[64];
|
/*000*/ char login_info[64];
|
||||||
/*064*/ uint8 unknown064[124];
|
/*064*/ uint8 unknown064[124];
|
||||||
@@ -331,7 +324,6 @@ union
|
|||||||
bool guild_show;
|
bool guild_show;
|
||||||
bool trader;
|
bool trader;
|
||||||
bool buyer;
|
bool buyer;
|
||||||
EqGuid CharacterGuid;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct PlayerState_Struct {
|
struct PlayerState_Struct {
|
||||||
@@ -3750,7 +3742,8 @@ struct GetItems_Struct{
|
|||||||
|
|
||||||
struct BecomeTrader_Struct {
|
struct BecomeTrader_Struct {
|
||||||
uint32 action;
|
uint32 action;
|
||||||
uint32 zone_id;
|
uint16 zone_id;
|
||||||
|
uint16 zone_instance_id;
|
||||||
uint32 trader_id;
|
uint32 trader_id;
|
||||||
uint32 entity_id;
|
uint32 entity_id;
|
||||||
char trader_name[64];
|
char trader_name[64];
|
||||||
@@ -6355,6 +6348,7 @@ enum BazaarTraderBarterActions {
|
|||||||
TraderAck2 = 22,
|
TraderAck2 = 22,
|
||||||
AddTraderToBazaarWindow = 24,
|
AddTraderToBazaarWindow = 24,
|
||||||
RemoveTraderFromBazaarWindow = 25,
|
RemoveTraderFromBazaarWindow = 25,
|
||||||
|
FirstOpenSearch = 26,
|
||||||
ClickTrader = 28,
|
ClickTrader = 28,
|
||||||
DeliveryCostUpdate = 29
|
DeliveryCostUpdate = 29
|
||||||
};
|
};
|
||||||
@@ -6394,6 +6388,7 @@ struct BazaarSearchResultsFromDB_Struct {
|
|||||||
uint32 icon_id;
|
uint32 icon_id;
|
||||||
uint32 sum_charges;
|
uint32 sum_charges;
|
||||||
uint32 trader_zone_id;
|
uint32 trader_zone_id;
|
||||||
|
int32 trader_zone_instance_id;
|
||||||
uint32 trader_entity_id;
|
uint32 trader_entity_id;
|
||||||
uint32 item_stat;
|
uint32 item_stat;
|
||||||
bool stackable;
|
bool stackable;
|
||||||
@@ -6415,6 +6410,7 @@ struct BazaarSearchResultsFromDB_Struct {
|
|||||||
CEREAL_NVP(icon_id),
|
CEREAL_NVP(icon_id),
|
||||||
CEREAL_NVP(sum_charges),
|
CEREAL_NVP(sum_charges),
|
||||||
CEREAL_NVP(trader_zone_id),
|
CEREAL_NVP(trader_zone_id),
|
||||||
|
CEREAL_NVP(trader_zone_instance_id),
|
||||||
CEREAL_NVP(trader_entity_id),
|
CEREAL_NVP(trader_entity_id),
|
||||||
CEREAL_NVP(item_stat),
|
CEREAL_NVP(item_stat),
|
||||||
CEREAL_NVP(stackable),
|
CEREAL_NVP(stackable),
|
||||||
@@ -6444,6 +6440,90 @@ struct BuylineItemDetails_Struct {
|
|||||||
uint32 item_quantity;
|
uint32 item_quantity;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct PickZoneEntry_Struct {
|
||||||
|
int16 zone_id;
|
||||||
|
int16 unknown;
|
||||||
|
int32 player_count;
|
||||||
|
int32 instance_id;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct PickZoneWindow_Struct {
|
||||||
|
char padding000[64];
|
||||||
|
int64 session_id;
|
||||||
|
int8 option_count;
|
||||||
|
char padding073[23];
|
||||||
|
PickZoneEntry_Struct entries[10];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct PickZone_Struct {
|
||||||
|
int64 session_id;
|
||||||
|
int32 selection_id;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct EvolveItemToggle {
|
||||||
|
uint32 action;
|
||||||
|
uint32 unknown_004;
|
||||||
|
uint64 unique_id;
|
||||||
|
uint32 percentage;
|
||||||
|
uint32 activated;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct EvolveXPWindowReceive {
|
||||||
|
uint32 action;
|
||||||
|
uint32 unknown_004;
|
||||||
|
uint64 item1_unique_id;
|
||||||
|
uint64 item2_unique_id;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct EvolveItemMessaging {
|
||||||
|
uint32 action;
|
||||||
|
char serialized_data[];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct EvolveXPWindowSend {
|
||||||
|
/*000*/ uint32 action;
|
||||||
|
/*004*/ uint64 item1_unique_id;
|
||||||
|
/*012*/ uint64 item2_unique_id;
|
||||||
|
/*020*/ uint32 compatibility;
|
||||||
|
/*024*/ uint32 max_transfer_level;
|
||||||
|
/*028*/ uint8 item1_present;
|
||||||
|
/*029*/ uint8 item2_present;
|
||||||
|
/*030*/ std::string serialize_item_1;
|
||||||
|
/*034*/ std::string serialize_item_2;
|
||||||
|
|
||||||
|
template<class Archive>
|
||||||
|
void serialize(Archive &archive)
|
||||||
|
{
|
||||||
|
archive(
|
||||||
|
CEREAL_NVP(action),
|
||||||
|
CEREAL_NVP(item1_unique_id),
|
||||||
|
CEREAL_NVP(item2_unique_id),
|
||||||
|
CEREAL_NVP(compatibility),
|
||||||
|
CEREAL_NVP(max_transfer_level),
|
||||||
|
CEREAL_NVP(item1_present),
|
||||||
|
CEREAL_NVP(item2_present),
|
||||||
|
CEREAL_NVP(serialize_item_1),
|
||||||
|
CEREAL_NVP(serialize_item_2)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct EvolveTransfer {
|
||||||
|
uint32 item_from_id;
|
||||||
|
uint32 item_from_current_amount;
|
||||||
|
uint32 item_to_id;
|
||||||
|
uint32 item_to_current_amount;
|
||||||
|
uint32 compatibility;
|
||||||
|
uint32 max_transfer_level;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct EvolveGetNextItem {
|
||||||
|
uint32 new_item_id;
|
||||||
|
uint64 new_current_amount;
|
||||||
|
uint64 from_current_amount;
|
||||||
|
uint32 max_transfer_level;
|
||||||
|
};
|
||||||
|
|
||||||
// Restore structure packing to default
|
// Restore structure packing to default
|
||||||
#pragma pack()
|
#pragma pack()
|
||||||
|
|
||||||
|
|||||||
@@ -137,9 +137,9 @@ class EQEmuConfig
|
|||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual ~EQEmuConfig() {}
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
virtual ~EQEmuConfig() {}
|
||||||
|
|
||||||
// Produce a const singleton
|
// Produce a const singleton
|
||||||
static const EQEmuConfig *get()
|
static const EQEmuConfig *get()
|
||||||
|
|||||||
@@ -25,6 +25,8 @@
|
|||||||
#include "repositories/discord_webhooks_repository.h"
|
#include "repositories/discord_webhooks_repository.h"
|
||||||
#include "repositories/logsys_categories_repository.h"
|
#include "repositories/logsys_categories_repository.h"
|
||||||
#include "termcolor/rang.hpp"
|
#include "termcolor/rang.hpp"
|
||||||
|
#include "path_manager.h"
|
||||||
|
#include "file.h"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
@@ -85,6 +87,7 @@ EQEmuLogSys *EQEmuLogSys::LoadLogSettingsDefaults()
|
|||||||
* Set Defaults
|
* Set Defaults
|
||||||
*/
|
*/
|
||||||
log_settings[Logs::Crash].log_to_console = static_cast<uint8>(Logs::General);
|
log_settings[Logs::Crash].log_to_console = static_cast<uint8>(Logs::General);
|
||||||
|
log_settings[Logs::Crash].log_to_file = static_cast<uint8>(Logs::General);
|
||||||
log_settings[Logs::MySQLError].log_to_console = static_cast<uint8>(Logs::General);
|
log_settings[Logs::MySQLError].log_to_console = static_cast<uint8>(Logs::General);
|
||||||
log_settings[Logs::NPCScaling].log_to_gmsay = static_cast<uint8>(Logs::General);
|
log_settings[Logs::NPCScaling].log_to_gmsay = static_cast<uint8>(Logs::General);
|
||||||
log_settings[Logs::HotReload].log_to_gmsay = static_cast<uint8>(Logs::General);
|
log_settings[Logs::HotReload].log_to_gmsay = static_cast<uint8>(Logs::General);
|
||||||
@@ -532,6 +535,11 @@ void EQEmuLogSys::StartFileLogs(const std::string &log_name)
|
|||||||
{
|
{
|
||||||
EQEmuLogSys::CloseFileLogs();
|
EQEmuLogSys::CloseFileLogs();
|
||||||
|
|
||||||
|
if (!File::Exists(path.GetLogPath())) {
|
||||||
|
LogInfo("Logs directory not found, creating [{}]", path.GetLogPath());
|
||||||
|
File::Makedir(path.GetLogPath());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When loading settings, we must have been given a reason in category based logging to output to a file in order to even create or open one...
|
* When loading settings, we must have been given a reason in category based logging to output to a file in order to even create or open one...
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -142,6 +142,8 @@ namespace Logs {
|
|||||||
EqTime,
|
EqTime,
|
||||||
Corpses,
|
Corpses,
|
||||||
XTargets,
|
XTargets,
|
||||||
|
EvolveItem,
|
||||||
|
Visibility,
|
||||||
MaxCategoryID /* Don't Remove this */
|
MaxCategoryID /* Don't Remove this */
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -242,7 +244,9 @@ namespace Logs {
|
|||||||
"Zoning",
|
"Zoning",
|
||||||
"EqTime",
|
"EqTime",
|
||||||
"Corpses",
|
"Corpses",
|
||||||
"XTargets"
|
"XTargets",
|
||||||
|
"EvolveItem",
|
||||||
|
"Visibility"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -131,6 +131,16 @@
|
|||||||
OutF(LogSys, Logs::Detail, Logs::Error, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
OutF(LogSys, Logs::Detail, Logs::Error, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
#define LogEvolveItem(message, ...) do {\
|
||||||
|
if (LogSys.IsLogEnabled(Logs::General, Logs::EvolveItem))\
|
||||||
|
OutF(LogSys, Logs::General, Logs::EvolveItem, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define LogEvolveItemDetail(message, ...) do {\
|
||||||
|
if (LogSys.IsLogEnabled(Logs::Detail, Logs::EvolveItem))\
|
||||||
|
OutF(LogSys, Logs::Detail, Logs::EvolveItem, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||||
|
} while (0)
|
||||||
|
|
||||||
#define LogGuilds(message, ...) do {\
|
#define LogGuilds(message, ...) do {\
|
||||||
if (LogSys.IsLogEnabled(Logs::General, Logs::Guilds))\
|
if (LogSys.IsLogEnabled(Logs::General, Logs::Guilds))\
|
||||||
OutF(LogSys, Logs::General, Logs::Guilds, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
OutF(LogSys, Logs::General, Logs::Guilds, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||||
@@ -844,6 +854,16 @@
|
|||||||
OutF(LogSys, Logs::Detail, Logs::XTargets, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
OutF(LogSys, Logs::Detail, Logs::XTargets, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
#define LogVisibility(message, ...) do {\
|
||||||
|
if (LogSys.IsLogEnabled(Logs::General, Logs::Visibility))\
|
||||||
|
OutF(LogSys, Logs::General, Logs::Visibility, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define LogVisibilityDetail(message, ...) do {\
|
||||||
|
if (LogSys.IsLogEnabled(Logs::Detail, Logs::Visibility))\
|
||||||
|
OutF(LogSys, Logs::Detail, Logs::Visibility, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||||
|
} while (0)
|
||||||
|
|
||||||
#define Log(debug_level, log_category, message, ...) do {\
|
#define Log(debug_level, log_category, message, ...) do {\
|
||||||
if (LogSys.IsLogEnabled(debug_level, log_category))\
|
if (LogSys.IsLogEnabled(debug_level, log_category))\
|
||||||
LogSys.Out(debug_level, log_category, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
LogSys.Out(debug_level, log_category, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||||
|
|||||||
@@ -707,6 +707,7 @@ void PlayerEventLogs::SetSettingsDefaults()
|
|||||||
m_settings[PlayerEvent::PARCEL_RETRIEVE].event_enabled = 1;
|
m_settings[PlayerEvent::PARCEL_RETRIEVE].event_enabled = 1;
|
||||||
m_settings[PlayerEvent::PARCEL_DELETE].event_enabled = 1;
|
m_settings[PlayerEvent::PARCEL_DELETE].event_enabled = 1;
|
||||||
m_settings[PlayerEvent::BARTER_TRANSACTION].event_enabled = 1;
|
m_settings[PlayerEvent::BARTER_TRANSACTION].event_enabled = 1;
|
||||||
|
m_settings[PlayerEvent::EVOLVE_ITEM].event_enabled = 1;
|
||||||
|
|
||||||
for (int i = PlayerEvent::GM_COMMAND; i != PlayerEvent::MAX; i++) {
|
for (int i = PlayerEvent::GM_COMMAND; i != PlayerEvent::MAX; i++) {
|
||||||
m_settings[i].retention_days = RETENTION_DAYS_DEFAULT;
|
m_settings[i].retention_days = RETENTION_DAYS_DEFAULT;
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ namespace PlayerEvent {
|
|||||||
PARCEL_RETRIEVE,
|
PARCEL_RETRIEVE,
|
||||||
PARCEL_DELETE,
|
PARCEL_DELETE,
|
||||||
BARTER_TRANSACTION,
|
BARTER_TRANSACTION,
|
||||||
|
EVOLVE_ITEM,
|
||||||
MAX // dont remove
|
MAX // dont remove
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -124,7 +125,8 @@ namespace PlayerEvent {
|
|||||||
"Parcel Item Sent",
|
"Parcel Item Sent",
|
||||||
"Parcel Item Retrieved",
|
"Parcel Item Retrieved",
|
||||||
"Parcel Prune Routine",
|
"Parcel Prune Routine",
|
||||||
"Barter Transaction"
|
"Barter Transaction",
|
||||||
|
"Evolve Item Update"
|
||||||
};
|
};
|
||||||
|
|
||||||
// Generic struct used by all events
|
// Generic struct used by all events
|
||||||
@@ -1115,6 +1117,29 @@ namespace PlayerEvent {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct EvolveItem {
|
||||||
|
std::string status;
|
||||||
|
uint32 item_id;
|
||||||
|
uint64 unique_id;
|
||||||
|
std::string item_name;
|
||||||
|
uint32 level;
|
||||||
|
double progression;
|
||||||
|
|
||||||
|
// cereal
|
||||||
|
template<class Archive>
|
||||||
|
void serialize(Archive &ar)
|
||||||
|
{
|
||||||
|
ar(
|
||||||
|
CEREAL_NVP(status),
|
||||||
|
CEREAL_NVP(item_id),
|
||||||
|
CEREAL_NVP(unique_id),
|
||||||
|
CEREAL_NVP(item_name),
|
||||||
|
CEREAL_NVP(level),
|
||||||
|
CEREAL_NVP(progression)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //EQEMU_PLAYER_EVENTS_H
|
#endif //EQEMU_PLAYER_EVENTS_H
|
||||||
|
|||||||
@@ -0,0 +1,303 @@
|
|||||||
|
#include "evolving_items.h"
|
||||||
|
#include "item_instance.h"
|
||||||
|
#include "events/player_event_logs.h"
|
||||||
|
#include "repositories/character_evolving_items_repository.h"
|
||||||
|
|
||||||
|
EvolvingItemsManager::EvolvingItemsManager()
|
||||||
|
{
|
||||||
|
m_db = nullptr;
|
||||||
|
m_content_db = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
void EvolvingItemsManager::LoadEvolvingItems() const
|
||||||
|
{
|
||||||
|
auto const &results = ItemsEvolvingDetailsRepository::All(*m_content_db);
|
||||||
|
|
||||||
|
if (results.empty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::ranges::transform(
|
||||||
|
results.begin(),
|
||||||
|
results.end(),
|
||||||
|
std::inserter(
|
||||||
|
evolving_items_manager.GetEvolvingItemsCache(),
|
||||||
|
evolving_items_manager.GetEvolvingItemsCache().end()
|
||||||
|
),
|
||||||
|
[](const ItemsEvolvingDetailsRepository::ItemsEvolvingDetails &x) {
|
||||||
|
return std::make_pair(x.item_id, x);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void EvolvingItemsManager::SetDatabase(Database *db)
|
||||||
|
{
|
||||||
|
m_db = db;
|
||||||
|
}
|
||||||
|
|
||||||
|
void EvolvingItemsManager::SetContentDatabase(Database *db)
|
||||||
|
{
|
||||||
|
m_content_db = db;
|
||||||
|
}
|
||||||
|
|
||||||
|
double EvolvingItemsManager::CalculateProgression(const uint64 current_amount, const uint32 item_id)
|
||||||
|
{
|
||||||
|
if (!evolving_items_manager.GetEvolvingItemsCache().contains(item_id)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return evolving_items_manager.GetEvolvingItemsCache().at(item_id).required_amount > 0
|
||||||
|
? static_cast<double>(current_amount)
|
||||||
|
/ static_cast<double>(evolving_items_manager.GetEvolvingItemsCache().at(item_id).required_amount) * 100
|
||||||
|
: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void EvolvingItemsManager::DoLootChecks(const uint32 char_id, const uint16 slot_id, const EQ::ItemInstance &inst) const
|
||||||
|
{
|
||||||
|
inst.SetEvolveEquipped(false);
|
||||||
|
if (inst.IsEvolving() && slot_id <= EQ::invslot::EQUIPMENT_END && slot_id >= EQ::invslot::EQUIPMENT_BEGIN) {
|
||||||
|
inst.SetEvolveEquipped(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!inst.IsEvolving()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!inst.GetEvolveUniqueID()) {
|
||||||
|
auto e = CharacterEvolvingItemsRepository::NewEntity();
|
||||||
|
|
||||||
|
e.character_id = char_id;
|
||||||
|
e.item_id = inst.GetID();
|
||||||
|
e.equipped = inst.GetEvolveEquipped();
|
||||||
|
e.final_item_id = evolving_items_manager.GetFinalItemID(inst);
|
||||||
|
|
||||||
|
auto r = CharacterEvolvingItemsRepository::InsertOne(*m_db, e);
|
||||||
|
e.id = r.id;
|
||||||
|
|
||||||
|
inst.SetEvolveUniqueID(e.id);
|
||||||
|
inst.SetEvolveCharID(e.character_id);
|
||||||
|
inst.SetEvolveItemID(e.item_id);
|
||||||
|
inst.SetEvolveFinalItemID(e.final_item_id);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
CharacterEvolvingItemsRepository::SetEquipped(*m_db, inst.GetEvolveUniqueID(), inst.GetEvolveEquipped());
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32 EvolvingItemsManager::GetFinalItemID(const EQ::ItemInstance &inst) const
|
||||||
|
{
|
||||||
|
const auto start_iterator = std::ranges::find_if(
|
||||||
|
evolving_items_manager.GetEvolvingItemsCache().cbegin(),
|
||||||
|
evolving_items_manager.GetEvolvingItemsCache().cend(),
|
||||||
|
[&](const std::pair<uint32, ItemsEvolvingDetailsRepository::ItemsEvolvingDetails> &a) {
|
||||||
|
return a.second.item_evo_id == inst.GetEvolveLoreID();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
if (start_iterator == std::end(evolving_items_manager.GetEvolvingItemsCache())) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
const auto final_id = std::ranges::max_element(
|
||||||
|
start_iterator,
|
||||||
|
evolving_items_manager.GetEvolvingItemsCache().cend(),
|
||||||
|
[&](
|
||||||
|
const std::pair<uint32, ItemsEvolvingDetailsRepository::ItemsEvolvingDetails> &a,
|
||||||
|
const std::pair<uint32, ItemsEvolvingDetailsRepository::ItemsEvolvingDetails> &b
|
||||||
|
) {
|
||||||
|
return a.second.item_evo_id == b.second.item_evo_id &&
|
||||||
|
a.second.item_evolve_level < b.second.item_evolve_level;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
return final_id->first;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32 EvolvingItemsManager::GetNextEvolveItemID(const EQ::ItemInstance &inst) const
|
||||||
|
{
|
||||||
|
int8 const current_level = inst.GetEvolveLvl();
|
||||||
|
|
||||||
|
const auto iterator = std::ranges::find_if(
|
||||||
|
evolving_items_manager.GetEvolvingItemsCache().cbegin(),
|
||||||
|
evolving_items_manager.GetEvolvingItemsCache().cend(),
|
||||||
|
[&](const std::pair<uint32, ItemsEvolvingDetailsRepository::ItemsEvolvingDetails> &a) {
|
||||||
|
return a.second.item_evo_id == inst.GetEvolveLoreID() &&
|
||||||
|
a.second.item_evolve_level == current_level + 1;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
if (iterator == std::end(evolving_items_manager.GetEvolvingItemsCache())) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return iterator->first;
|
||||||
|
}
|
||||||
|
|
||||||
|
ItemsEvolvingDetailsRepository::ItemsEvolvingDetails EvolvingItemsManager::GetEvolveItemDetails(const uint64 unique_id)
|
||||||
|
{
|
||||||
|
if (GetEvolvingItemsCache().contains(unique_id)) {
|
||||||
|
return GetEvolvingItemsCache().at(unique_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ItemsEvolvingDetailsRepository::NewEntity();
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<ItemsEvolvingDetailsRepository::ItemsEvolvingDetails> EvolvingItemsManager::GetEvolveIDItems(
|
||||||
|
const uint32 evolve_id
|
||||||
|
)
|
||||||
|
{
|
||||||
|
std::vector<ItemsEvolvingDetailsRepository::ItemsEvolvingDetails> e{};
|
||||||
|
|
||||||
|
for (auto const &[key, value]: GetEvolvingItemsCache()) {
|
||||||
|
if (value.item_evo_id == evolve_id) {
|
||||||
|
e.push_back(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::ranges::sort(
|
||||||
|
e.begin(),
|
||||||
|
e.end(),
|
||||||
|
[&](
|
||||||
|
ItemsEvolvingDetailsRepository::ItemsEvolvingDetails const &a,
|
||||||
|
ItemsEvolvingDetailsRepository::ItemsEvolvingDetails const &b
|
||||||
|
) {
|
||||||
|
return a.item_evolve_level < b.item_evolve_level;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint64 EvolvingItemsManager::GetTotalEarnedXP(const EQ::ItemInstance &inst)
|
||||||
|
{
|
||||||
|
if (!inst) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint64 xp = inst.GetEvolveCurrentAmount();
|
||||||
|
auto evolve_id_item_cache = GetEvolveIDItems(inst.GetEvolveLoreID());
|
||||||
|
auto current_level = inst.GetEvolveLvl();
|
||||||
|
|
||||||
|
for (auto const &i: evolve_id_item_cache) {
|
||||||
|
if (i.item_evolve_level < current_level) {
|
||||||
|
xp += i.required_amount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return xp;
|
||||||
|
}
|
||||||
|
|
||||||
|
EvolveGetNextItem EvolvingItemsManager::GetNextItemByXP(const EQ::ItemInstance &inst_in, const int64 in_xp)
|
||||||
|
{
|
||||||
|
EvolveGetNextItem ets{};
|
||||||
|
const auto evolve_items = GetEvolveIDItems(inst_in.GetEvolveLoreID());
|
||||||
|
uint32 max_transfer_level = 0;
|
||||||
|
int64 xp = in_xp;
|
||||||
|
|
||||||
|
for (auto const &e: evolve_items) {
|
||||||
|
if (e.item_evolve_level < inst_in.GetEvolveLvl()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int64 have = 0;
|
||||||
|
if (e.item_evolve_level == inst_in.GetEvolveLvl()) {
|
||||||
|
have = inst_in.GetEvolveCurrentAmount();
|
||||||
|
}
|
||||||
|
|
||||||
|
const auto required = e.required_amount;
|
||||||
|
const int64 need = required - have;
|
||||||
|
const int64 balance = xp - need;
|
||||||
|
|
||||||
|
if (balance <= 0) {
|
||||||
|
ets.new_current_amount = have + xp;
|
||||||
|
ets.new_item_id = e.item_id;
|
||||||
|
ets.from_current_amount = 0;
|
||||||
|
ets.max_transfer_level = max_transfer_level;
|
||||||
|
return ets;
|
||||||
|
}
|
||||||
|
|
||||||
|
xp = balance;
|
||||||
|
max_transfer_level += 1;
|
||||||
|
|
||||||
|
ets.new_current_amount = required;
|
||||||
|
ets.new_item_id = e.item_id;
|
||||||
|
ets.from_current_amount = balance - required;
|
||||||
|
ets.max_transfer_level = max_transfer_level;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ets;
|
||||||
|
}
|
||||||
|
|
||||||
|
EvolveTransfer EvolvingItemsManager::DetermineTransferResults(
|
||||||
|
const EQ::ItemInstance &inst_from,
|
||||||
|
const EQ::ItemInstance &inst_to
|
||||||
|
)
|
||||||
|
{
|
||||||
|
EvolveTransfer ets{};
|
||||||
|
|
||||||
|
auto evolving_details_inst_from = evolving_items_manager.GetEvolveItemDetails(inst_from.GetID());
|
||||||
|
auto evolving_details_inst_to = evolving_items_manager.GetEvolveItemDetails(inst_to.GetID());
|
||||||
|
|
||||||
|
if (!evolving_details_inst_from.id || !evolving_details_inst_to.id) {
|
||||||
|
return ets;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (evolving_details_inst_from.type == evolving_details_inst_to.type) {
|
||||||
|
uint32 compatibility = 0;
|
||||||
|
uint64 xp = 0;
|
||||||
|
if (evolving_details_inst_from.sub_type == evolving_details_inst_to.sub_type) {
|
||||||
|
compatibility = 100;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
compatibility = 30;
|
||||||
|
}
|
||||||
|
|
||||||
|
xp = evolving_items_manager.GetTotalEarnedXP(inst_from) * compatibility / 100;
|
||||||
|
auto results = evolving_items_manager.GetNextItemByXP(inst_to, xp);
|
||||||
|
|
||||||
|
ets.item_from_id = evolving_items_manager.GetFirstItemInLoreGroup(inst_from.GetEvolveLoreID());
|
||||||
|
ets.item_from_current_amount = results.from_current_amount;
|
||||||
|
ets.item_to_id = results.new_item_id;
|
||||||
|
ets.item_to_current_amount = results.new_current_amount;
|
||||||
|
ets.compatibility = compatibility;
|
||||||
|
ets.max_transfer_level = results.max_transfer_level;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ets;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32 EvolvingItemsManager::GetFirstItemInLoreGroup(const uint32 lore_id)
|
||||||
|
{
|
||||||
|
for (auto const &[key, value]: GetEvolvingItemsCache()) {
|
||||||
|
if (value.item_evo_id == lore_id && value.item_evolve_level == 1) {
|
||||||
|
return key;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32 EvolvingItemsManager::GetFirstItemInLoreGroupByItemID(const uint32 item_id)
|
||||||
|
{
|
||||||
|
for (auto const &[key, value]: GetEvolvingItemsCache()) {
|
||||||
|
if (value.item_id == item_id) {
|
||||||
|
for (auto const &[key2, value2]: GetEvolvingItemsCache()) {
|
||||||
|
if (value2.item_evo_id == value.item_evo_id && value2.item_evolve_level == 1) {
|
||||||
|
return key;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void EvolvingItemsManager::LoadPlayerEvent(const EQ::ItemInstance &inst, PlayerEvent::EvolveItem &e)
|
||||||
|
{
|
||||||
|
e.item_id = inst.GetID();
|
||||||
|
e.item_name = inst.GetItem() ? inst.GetItem()->Name : std::string();
|
||||||
|
e.level = inst.GetEvolveLvl();
|
||||||
|
e.progression = inst.GetEvolveProgression();
|
||||||
|
e.unique_id = inst.GetEvolveUniqueID();
|
||||||
|
}
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
#ifndef EVOLVING_H
|
||||||
|
#define EVOLVING_H
|
||||||
|
|
||||||
|
#include "shareddb.h"
|
||||||
|
#include "events/player_events.h"
|
||||||
|
#include "repositories/items_evolving_details_repository.h"
|
||||||
|
|
||||||
|
namespace EQ {
|
||||||
|
class ItemInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace EvolvingItems {
|
||||||
|
namespace Actions {
|
||||||
|
constexpr int8 UPDATE_ITEMS = 0;
|
||||||
|
constexpr int8 TRANSFER_WINDOW_OPEN = 1;
|
||||||
|
constexpr int8 TRANSFER_WINDOW_DETAILS = 2;
|
||||||
|
constexpr int8 TRANSFER_XP = 3;
|
||||||
|
constexpr int8 FINAL_RESULT = 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace Types {
|
||||||
|
constexpr int8 AMOUNT_OF_EXP = 1;
|
||||||
|
constexpr int8 NUMBER_OF_KILLS = 2;
|
||||||
|
constexpr int8 SPECIFIC_MOB_RACE = 3;
|
||||||
|
constexpr int8 SPECIFIC_ZONE_ID = 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace SubTypes {
|
||||||
|
constexpr int8 ALL_EXP = 0;
|
||||||
|
constexpr int8 SOLO_EXP = 1;
|
||||||
|
constexpr int8 GROUP_EXP = 2;
|
||||||
|
constexpr int8 RAID_EXP = 3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class EvolvingItemsManager
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
EvolvingItemsManager();
|
||||||
|
void SetDatabase(Database *db);
|
||||||
|
void SetContentDatabase(Database *db);
|
||||||
|
|
||||||
|
void LoadEvolvingItems() const;
|
||||||
|
void DoLootChecks(uint32 char_id, uint16 slot_id, const EQ::ItemInstance &inst) const;
|
||||||
|
uint32 GetFinalItemID(const EQ::ItemInstance &inst) const;
|
||||||
|
uint32 GetNextEvolveItemID(const EQ::ItemInstance &inst) const;
|
||||||
|
uint32 GetFirstItemInLoreGroup(uint32 lore_id);
|
||||||
|
uint32 GetFirstItemInLoreGroupByItemID(uint32 item_id);
|
||||||
|
uint64 GetTotalEarnedXP(const EQ::ItemInstance &inst);
|
||||||
|
static double CalculateProgression(uint64 current_amount, uint32 item_id);
|
||||||
|
static void LoadPlayerEvent(const EQ::ItemInstance &inst, PlayerEvent::EvolveItem &e);
|
||||||
|
|
||||||
|
ItemsEvolvingDetailsRepository::ItemsEvolvingDetails GetEvolveItemDetails(uint64 id);
|
||||||
|
EvolveTransfer DetermineTransferResults(const EQ::ItemInstance& inst_from, const EQ::ItemInstance& inst_to);
|
||||||
|
EvolveGetNextItem GetNextItemByXP(const EQ::ItemInstance &inst_in, int64 in_xp);
|
||||||
|
std::map<uint32, ItemsEvolvingDetailsRepository::ItemsEvolvingDetails>& GetEvolvingItemsCache() { return evolving_items_cache; }
|
||||||
|
std::vector<ItemsEvolvingDetailsRepository::ItemsEvolvingDetails> GetEvolveIDItems(uint32 evolve_id);
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::map<uint32, ItemsEvolvingDetailsRepository::ItemsEvolvingDetails> evolving_items_cache;
|
||||||
|
Database * m_db;
|
||||||
|
Database * m_content_db;
|
||||||
|
};
|
||||||
|
|
||||||
|
extern EvolvingItemsManager evolving_items_manager;
|
||||||
|
|
||||||
|
#endif //EVOLVING_H
|
||||||
@@ -344,6 +344,8 @@ bool EQ::InventoryProfile::SwapItem(
|
|||||||
fail_state = swapNotAllowed;
|
fail_state = swapNotAllowed;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
source_item_instance->SetEvolveEquipped(false);
|
||||||
if ((destination_slot >= invslot::EQUIPMENT_BEGIN && destination_slot <= invslot::EQUIPMENT_END)) {
|
if ((destination_slot >= invslot::EQUIPMENT_BEGIN && destination_slot <= invslot::EQUIPMENT_END)) {
|
||||||
auto source_item = source_item_instance->GetItem();
|
auto source_item = source_item_instance->GetItem();
|
||||||
if (!source_item) {
|
if (!source_item) {
|
||||||
@@ -362,6 +364,9 @@ bool EQ::InventoryProfile::SwapItem(
|
|||||||
fail_state = swapLevel;
|
fail_state = swapLevel;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (source_item_instance->IsEvolving() > 0) {
|
||||||
|
source_item_instance->SetEvolveEquipped(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -370,6 +375,8 @@ bool EQ::InventoryProfile::SwapItem(
|
|||||||
fail_state = swapNotAllowed;
|
fail_state = swapNotAllowed;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
destination_item_instance->SetEvolveEquipped(false);
|
||||||
if ((source_slot >= invslot::EQUIPMENT_BEGIN && source_slot <= invslot::EQUIPMENT_END)) {
|
if ((source_slot >= invslot::EQUIPMENT_BEGIN && source_slot <= invslot::EQUIPMENT_END)) {
|
||||||
auto destination_item = destination_item_instance->GetItem();
|
auto destination_item = destination_item_instance->GetItem();
|
||||||
if (!destination_item) {
|
if (!destination_item) {
|
||||||
@@ -388,6 +395,9 @@ bool EQ::InventoryProfile::SwapItem(
|
|||||||
fail_state = swapLevel;
|
fail_state = swapLevel;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (destination_item_instance->IsEvolving()) {
|
||||||
|
destination_item_instance->SetEvolveEquipped(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -612,9 +622,9 @@ bool EQ::InventoryProfile::HasAugmentEquippedByID(uint32 item_id)
|
|||||||
return has_equipped;
|
return has_equipped;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQ::InventoryProfile::CountAugmentEquippedByID(uint32 item_id)
|
uint32 EQ::InventoryProfile::CountAugmentEquippedByID(uint32 item_id)
|
||||||
{
|
{
|
||||||
int quantity = 0;
|
uint32 quantity = 0;
|
||||||
ItemInstance* item = nullptr;
|
ItemInstance* item = nullptr;
|
||||||
|
|
||||||
for (int slot_id = EQ::invslot::EQUIPMENT_BEGIN; slot_id <= EQ::invslot::EQUIPMENT_END; ++slot_id) {
|
for (int slot_id = EQ::invslot::EQUIPMENT_BEGIN; slot_id <= EQ::invslot::EQUIPMENT_END; ++slot_id) {
|
||||||
@@ -643,9 +653,9 @@ bool EQ::InventoryProfile::HasItemEquippedByID(uint32 item_id)
|
|||||||
return has_equipped;
|
return has_equipped;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EQ::InventoryProfile::CountItemEquippedByID(uint32 item_id)
|
uint32 EQ::InventoryProfile::CountItemEquippedByID(uint32 item_id)
|
||||||
{
|
{
|
||||||
int quantity = 0;
|
uint32 quantity = 0;
|
||||||
ItemInstance* item = nullptr;
|
ItemInstance* item = nullptr;
|
||||||
|
|
||||||
for (int slot_id = EQ::invslot::EQUIPMENT_BEGIN; slot_id <= EQ::invslot::EQUIPMENT_END; ++slot_id) {
|
for (int slot_id = EQ::invslot::EQUIPMENT_BEGIN; slot_id <= EQ::invslot::EQUIPMENT_END; ++slot_id) {
|
||||||
@@ -1402,6 +1412,8 @@ int16 EQ::InventoryProfile::_PutItem(int16 slot_id, ItemInstance* inst)
|
|||||||
int16 result = INVALID_INDEX;
|
int16 result = INVALID_INDEX;
|
||||||
int16 parentSlot = INVALID_INDEX;
|
int16 parentSlot = INVALID_INDEX;
|
||||||
|
|
||||||
|
inst->SetEvolveEquipped(false);
|
||||||
|
|
||||||
if (slot_id == invslot::slotCursor) {
|
if (slot_id == invslot::slotCursor) {
|
||||||
// Replace current item on cursor, if exists
|
// Replace current item on cursor, if exists
|
||||||
m_cursor.pop(); // no memory delete, clients of this function know what they are doing
|
m_cursor.pop(); // no memory delete, clients of this function know what they are doing
|
||||||
@@ -1410,6 +1422,9 @@ int16 EQ::InventoryProfile::_PutItem(int16 slot_id, ItemInstance* inst)
|
|||||||
}
|
}
|
||||||
else if (slot_id >= invslot::EQUIPMENT_BEGIN && slot_id <= invslot::EQUIPMENT_END) {
|
else if (slot_id >= invslot::EQUIPMENT_BEGIN && slot_id <= invslot::EQUIPMENT_END) {
|
||||||
if ((((uint64)1 << slot_id) & m_lookup->PossessionsBitmask) != 0) {
|
if ((((uint64)1 << slot_id) & m_lookup->PossessionsBitmask) != 0) {
|
||||||
|
if (inst->IsEvolving()) {
|
||||||
|
inst->SetEvolveEquipped(true);
|
||||||
|
}
|
||||||
m_worn[slot_id] = inst;
|
m_worn[slot_id] = inst;
|
||||||
result = slot_id;
|
result = slot_id;
|
||||||
}
|
}
|
||||||
@@ -1808,3 +1823,182 @@ int16 EQ::InventoryProfile::FindFirstFreeSlotThatFitsItem(const EQ::ItemData *it
|
|||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//This function has the same flaw as noted above
|
||||||
|
// Helper functions for evolving items
|
||||||
|
int16 EQ::InventoryProfile::HasEvolvingItem(uint64 evolve_unique_id, uint8 quantity, uint8 where)
|
||||||
|
{
|
||||||
|
int16 slot_id = INVALID_INDEX;
|
||||||
|
|
||||||
|
// Altered by Father Nitwit to support a specification of
|
||||||
|
// where to search, with a default value to maintain compatibility
|
||||||
|
|
||||||
|
// Check each inventory bucket
|
||||||
|
if (where & invWhereWorn) {
|
||||||
|
slot_id = _HasEvolvingItem(m_worn, evolve_unique_id, quantity);
|
||||||
|
if (slot_id != INVALID_INDEX) {
|
||||||
|
return slot_id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (where & invWherePersonal) {
|
||||||
|
slot_id = _HasEvolvingItem(m_inv, evolve_unique_id, quantity);
|
||||||
|
if (slot_id != INVALID_INDEX) {
|
||||||
|
return slot_id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (where & invWhereBank) {
|
||||||
|
slot_id = _HasEvolvingItem(m_bank, evolve_unique_id, quantity);
|
||||||
|
if (slot_id != INVALID_INDEX) {
|
||||||
|
return slot_id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (where & invWhereSharedBank) {
|
||||||
|
slot_id = _HasEvolvingItem(m_shbank, evolve_unique_id, quantity);
|
||||||
|
if (slot_id != INVALID_INDEX) {
|
||||||
|
return slot_id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (where & invWhereTrading) {
|
||||||
|
slot_id = _HasEvolvingItem(m_trade, evolve_unique_id, quantity);
|
||||||
|
if (slot_id != INVALID_INDEX) {
|
||||||
|
return slot_id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Behavioral change - Limbo is no longer checked due to improper handling of return value
|
||||||
|
if (where & invWhereCursor) {
|
||||||
|
// Check cursor queue
|
||||||
|
slot_id = _HasEvolvingItem(m_cursor, evolve_unique_id, quantity);
|
||||||
|
if (slot_id != INVALID_INDEX) {
|
||||||
|
return slot_id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return slot_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Internal Method: Checks an inventory bucket for a particular evolving item unique id
|
||||||
|
int16 EQ::InventoryProfile::_HasEvolvingItem(
|
||||||
|
std::map<int16, ItemInstance *> &bucket, uint64 evolve_unique_id, uint8 quantity)
|
||||||
|
{
|
||||||
|
uint32 quantity_found = 0;
|
||||||
|
|
||||||
|
for (auto const &[key, value]: bucket) {
|
||||||
|
if (!value) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (key <= EQ::invslot::POSSESSIONS_END && key >= EQ::invslot::POSSESSIONS_BEGIN) {
|
||||||
|
if (((uint64) 1 << key & m_lookup->PossessionsBitmask) == 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (key <= EQ::invslot::BANK_END && key >= EQ::invslot::BANK_BEGIN) {
|
||||||
|
if (key - EQ::invslot::BANK_BEGIN >= m_lookup->InventoryTypeSize.Bank) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (value->GetEvolveUniqueID() == evolve_unique_id) {
|
||||||
|
quantity_found += value->GetCharges() <= 0 ? 1 : value->GetCharges();
|
||||||
|
if (quantity_found >= quantity) {
|
||||||
|
return key;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int index = invaug::SOCKET_BEGIN; index <= invaug::SOCKET_END; ++index) {
|
||||||
|
if (value->GetAugmentEvolveUniqueID(index) == evolve_unique_id && quantity <= 1) {
|
||||||
|
return invslot::SLOT_AUGMENT_GENERIC_RETURN;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!value->IsClassBag()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (auto const &[bag_key, bag_value]: *value->GetContents()) {
|
||||||
|
if (!bag_value) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bag_value->GetEvolveUniqueID() == evolve_unique_id) {
|
||||||
|
quantity_found += bag_value->GetCharges() <= 0 ? 1 : bag_value->GetCharges();
|
||||||
|
if (quantity_found >= quantity) {
|
||||||
|
return CalcSlotId(key, bag_key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int index = invaug::SOCKET_BEGIN; index <= invaug::SOCKET_END; ++index) {
|
||||||
|
if (bag_value->GetAugmentEvolveUniqueID(index) == evolve_unique_id && quantity <= 1) {
|
||||||
|
return invslot::SLOT_AUGMENT_GENERIC_RETURN;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return INVALID_INDEX;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Internal Method: Checks an inventory queue type bucket for a particular item
|
||||||
|
int16 EQ::InventoryProfile::_HasEvolvingItem(ItemInstQueue &iqueue, uint64 evolve_unique_id, uint8 quantity)
|
||||||
|
{
|
||||||
|
// The downfall of this (these) queue procedure is that callers presume that when an item is
|
||||||
|
// found, it is presented as being available on the cursor. In cases of a parity check, this
|
||||||
|
// is sufficient. However, in cases where referential criteria is considered, this can lead
|
||||||
|
// to unintended results. Funtionality should be observed when referencing the return value
|
||||||
|
// of this query
|
||||||
|
|
||||||
|
uint32 quantity_found = 0;
|
||||||
|
|
||||||
|
for (auto const &inst: iqueue) {
|
||||||
|
if (!inst) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (inst->GetEvolveUniqueID() == evolve_unique_id) {
|
||||||
|
quantity_found += inst->GetCharges() <= 0 ? 1 : inst->GetCharges();
|
||||||
|
if (quantity_found >= quantity) {
|
||||||
|
return invslot::slotCursor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int index = invaug::SOCKET_BEGIN; index <= invaug::SOCKET_END; ++index) {
|
||||||
|
if (inst->GetAugmentEvolveUniqueID(index) == evolve_unique_id && quantity <= 1) {
|
||||||
|
return invslot::SLOT_AUGMENT_GENERIC_RETURN;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!inst->IsClassBag()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (auto const &[bag_key, bag_value]: *inst->GetContents()) {
|
||||||
|
if (!bag_value) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bag_value->GetEvolveUniqueID() == evolve_unique_id) {
|
||||||
|
quantity_found += bag_value->GetCharges() <= 0 ? 1 : bag_value->GetCharges();
|
||||||
|
if (quantity_found >= quantity) {
|
||||||
|
return CalcSlotId(invslot::slotCursor, bag_key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int index = invaug::SOCKET_BEGIN; index <= invaug::SOCKET_END; ++index) {
|
||||||
|
if (bag_value->GetAugmentEvolveUniqueID(index) == evolve_unique_id && quantity <= 1) {
|
||||||
|
return invslot::SLOT_AUGMENT_GENERIC_RETURN;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// We only check the visible cursor due to lack of queue processing ability (client allows duplicate in limbo)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return INVALID_INDEX;
|
||||||
|
}
|
||||||
|
|||||||
@@ -57,6 +57,8 @@ public:
|
|||||||
|
|
||||||
inline std::list<EQ::ItemInstance*>::const_iterator cbegin() { return m_list.cbegin(); }
|
inline std::list<EQ::ItemInstance*>::const_iterator cbegin() { return m_list.cbegin(); }
|
||||||
inline std::list<EQ::ItemInstance*>::const_iterator cend() { return m_list.cend(); }
|
inline std::list<EQ::ItemInstance*>::const_iterator cend() { return m_list.cend(); }
|
||||||
|
inline std::list<EQ::ItemInstance*>::iterator begin() { return m_list.begin(); }
|
||||||
|
inline std::list<EQ::ItemInstance*>::iterator end() { return m_list.end(); }
|
||||||
|
|
||||||
inline int size() { return static_cast<int>(m_list.size()); } // TODO: change to size_t
|
inline int size() { return static_cast<int>(m_list.size()); } // TODO: change to size_t
|
||||||
inline bool empty() { return m_list.empty(); }
|
inline bool empty() { return m_list.empty(); }
|
||||||
@@ -147,13 +149,13 @@ namespace EQ
|
|||||||
bool HasItemEquippedByID(uint32 item_id);
|
bool HasItemEquippedByID(uint32 item_id);
|
||||||
|
|
||||||
// Check how many of a specific item the player has equipped by Item ID
|
// Check how many of a specific item the player has equipped by Item ID
|
||||||
int CountItemEquippedByID(uint32 item_id);
|
uint32 CountItemEquippedByID(uint32 item_id);
|
||||||
|
|
||||||
// Check if player has a specific augment equipped by Item ID
|
// Check if player has a specific augment equipped by Item ID
|
||||||
bool HasAugmentEquippedByID(uint32 item_id);
|
bool HasAugmentEquippedByID(uint32 item_id);
|
||||||
|
|
||||||
// Check how many of a specific augment the player has equipped by Item ID
|
// Check how many of a specific augment the player has equipped by Item ID
|
||||||
int CountAugmentEquippedByID(uint32 item_id);
|
uint32 CountAugmentEquippedByID(uint32 item_id);
|
||||||
|
|
||||||
// Get a list of augments from a specific slot ID
|
// Get a list of augments from a specific slot ID
|
||||||
std::vector<uint32> GetAugmentIDsBySlotID(int16 slot_id);
|
std::vector<uint32> GetAugmentIDsBySlotID(int16 slot_id);
|
||||||
@@ -211,6 +213,11 @@ namespace EQ
|
|||||||
void SetCustomItemData(uint32 character_id, int16 slot_id, const std::string &identifier, bool value);
|
void SetCustomItemData(uint32 character_id, int16 slot_id, const std::string &identifier, bool value);
|
||||||
std::string GetCustomItemData(int16 slot_id, const std::string& identifier);
|
std::string GetCustomItemData(int16 slot_id, const std::string& identifier);
|
||||||
static const int GetItemStatValue(uint32 item_id, const std::string& identifier);
|
static const int GetItemStatValue(uint32 item_id, const std::string& identifier);
|
||||||
|
|
||||||
|
std::map<int16, ItemInstance*>& GetWorn() { return m_worn; }
|
||||||
|
std::map<int16, ItemInstance*>& GetPersonal() { return m_inv; }
|
||||||
|
int16 HasEvolvingItem(uint64 evolve_unique_id, uint8 quantity, uint8 where);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
///////////////////////////////
|
///////////////////////////////
|
||||||
// Protected Methods
|
// Protected Methods
|
||||||
@@ -233,6 +240,8 @@ namespace EQ
|
|||||||
int16 _HasItemByUse(ItemInstQueue& iqueue, uint8 use, uint8 quantity);
|
int16 _HasItemByUse(ItemInstQueue& iqueue, uint8 use, uint8 quantity);
|
||||||
int16 _HasItemByLoreGroup(std::map<int16, ItemInstance*>& bucket, uint32 loregroup);
|
int16 _HasItemByLoreGroup(std::map<int16, ItemInstance*>& bucket, uint32 loregroup);
|
||||||
int16 _HasItemByLoreGroup(ItemInstQueue& iqueue, uint32 loregroup);
|
int16 _HasItemByLoreGroup(ItemInstQueue& iqueue, uint32 loregroup);
|
||||||
|
int16 _HasEvolvingItem(std::map<int16, ItemInstance*>& bucket, uint64 evolve_unique_id, uint8 quantity);
|
||||||
|
int16 _HasEvolvingItem(ItemInstQueue& iqueue, uint64 evolve_unique_id, uint8 quantity);
|
||||||
|
|
||||||
|
|
||||||
// Player inventory
|
// Player inventory
|
||||||
|
|||||||
+56
-51
@@ -25,6 +25,7 @@
|
|||||||
#include "rulesys.h"
|
#include "rulesys.h"
|
||||||
#include "shareddb.h"
|
#include "shareddb.h"
|
||||||
#include "strings.h"
|
#include "strings.h"
|
||||||
|
#include "evolving_items.h"
|
||||||
|
|
||||||
//#include "../common/light_source.h"
|
//#include "../common/light_source.h"
|
||||||
|
|
||||||
@@ -76,6 +77,10 @@ EQ::ItemInstance::ItemInstance(const ItemData* item, int16 charges) {
|
|||||||
m_color = m_item->Color;
|
m_color = m_item->Color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (IsEvolving()) {
|
||||||
|
SetTimer("evolve", RuleI(EvolvingItems, DelayUponEquipping));
|
||||||
|
}
|
||||||
|
|
||||||
m_SerialNumber = GetNextItemInstSerialNumber();
|
m_SerialNumber = GetNextItemInstSerialNumber();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,6 +100,10 @@ EQ::ItemInstance::ItemInstance(SharedDatabase *db, uint32 item_id, int16 charges
|
|||||||
m_color = 0;
|
m_color = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (IsEvolving()) {
|
||||||
|
SetTimer("evolve", RuleI(EvolvingItems, DelayUponEquipping));
|
||||||
|
}
|
||||||
|
|
||||||
m_SerialNumber = GetNextItemInstSerialNumber();
|
m_SerialNumber = GetNextItemInstSerialNumber();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -146,7 +155,6 @@ EQ::ItemInstance::ItemInstance(const ItemInstance& copy)
|
|||||||
|
|
||||||
m_exp = copy.m_exp;
|
m_exp = copy.m_exp;
|
||||||
m_evolveLvl = copy.m_evolveLvl;
|
m_evolveLvl = copy.m_evolveLvl;
|
||||||
m_activated = copy.m_activated;
|
|
||||||
|
|
||||||
if (copy.m_scaledItem) {
|
if (copy.m_scaledItem) {
|
||||||
m_scaledItem = new ItemData(*copy.m_scaledItem);
|
m_scaledItem = new ItemData(*copy.m_scaledItem);
|
||||||
@@ -154,12 +162,7 @@ EQ::ItemInstance::ItemInstance(const ItemInstance& copy)
|
|||||||
m_scaledItem = nullptr;
|
m_scaledItem = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (copy.m_evolveInfo) {
|
m_evolving_details = copy.m_evolving_details;
|
||||||
m_evolveInfo = new EvolveInfo(*copy.m_evolveInfo);
|
|
||||||
} else {
|
|
||||||
m_evolveInfo = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_scaling = copy.m_scaling;
|
m_scaling = copy.m_scaling;
|
||||||
m_ornamenticon = copy.m_ornamenticon;
|
m_ornamenticon = copy.m_ornamenticon;
|
||||||
m_ornamentidfile = copy.m_ornamentidfile;
|
m_ornamentidfile = copy.m_ornamentidfile;
|
||||||
@@ -174,7 +177,6 @@ EQ::ItemInstance::~ItemInstance()
|
|||||||
Clear();
|
Clear();
|
||||||
safe_delete(m_item);
|
safe_delete(m_item);
|
||||||
safe_delete(m_scaledItem);
|
safe_delete(m_scaledItem);
|
||||||
safe_delete(m_evolveInfo);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Query item type
|
// Query item type
|
||||||
@@ -1030,29 +1032,6 @@ void EQ::ItemInstance::ScaleItem() {
|
|||||||
m_scaledItem->CharmFileID = 0; // this stops the client from trying to scale the item itself.
|
m_scaledItem->CharmFileID = 0; // this stops the client from trying to scale the item itself.
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQ::ItemInstance::EvolveOnAllKills() const {
|
|
||||||
return (m_evolveInfo && m_evolveInfo->AllKills);
|
|
||||||
}
|
|
||||||
|
|
||||||
int8 EQ::ItemInstance::GetMaxEvolveLvl() const {
|
|
||||||
if (m_evolveInfo)
|
|
||||||
return m_evolveInfo->MaxLvl;
|
|
||||||
else
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32 EQ::ItemInstance::GetKillsNeeded(uint8 currentlevel) {
|
|
||||||
uint32 kills = -1; // default to -1 (max uint32 value) because this value is usually divided by, so we don't want to ever return zero.
|
|
||||||
if (m_evolveInfo)
|
|
||||||
if (currentlevel != m_evolveInfo->MaxLvl)
|
|
||||||
kills = m_evolveInfo->LvlKills[currentlevel - 1];
|
|
||||||
|
|
||||||
if (kills == 0)
|
|
||||||
kills = -1;
|
|
||||||
|
|
||||||
return kills;
|
|
||||||
}
|
|
||||||
|
|
||||||
void EQ::ItemInstance::SetTimer(std::string name, uint32 time) {
|
void EQ::ItemInstance::SetTimer(std::string name, uint32 time) {
|
||||||
Timer t(time);
|
Timer t(time);
|
||||||
t.Start(time, false);
|
t.Start(time, false);
|
||||||
@@ -1951,28 +1930,54 @@ void EQ::ItemInstance::ClearGUIDMap()
|
|||||||
{
|
{
|
||||||
guids.clear();
|
guids.clear();
|
||||||
}
|
}
|
||||||
//
|
|
||||||
// class EvolveInfo
|
bool EQ::ItemInstance::TransferOwnership(Database &db, const uint32 to_char_id) const
|
||||||
//
|
{
|
||||||
EvolveInfo::EvolveInfo() {
|
if (!to_char_id || !IsEvolving()) {
|
||||||
// nothing here yet
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
SetEvolveCharID(to_char_id);
|
||||||
|
CharacterEvolvingItemsRepository::UpdateCharID(db, GetEvolveUniqueID(), to_char_id);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
EvolveInfo::EvolveInfo(uint32 first, uint8 max, bool allkills, uint32 L2, uint32 L3, uint32 L4, uint32 L5, uint32 L6, uint32 L7, uint32 L8, uint32 L9, uint32 L10) {
|
uint32 EQ::ItemInstance::GetAugmentEvolveUniqueID(uint8 augment_index) const
|
||||||
FirstItem = first;
|
{
|
||||||
MaxLvl = max;
|
if (!m_item || !m_item->IsClassCommon()) {
|
||||||
AllKills = allkills;
|
return 0;
|
||||||
LvlKills[0] = L2;
|
}
|
||||||
LvlKills[1] = L3;
|
|
||||||
LvlKills[2] = L4;
|
const auto item = GetItem(augment_index);
|
||||||
LvlKills[3] = L5;
|
if (item) {
|
||||||
LvlKills[4] = L6;
|
return item->GetEvolveUniqueID();
|
||||||
LvlKills[5] = L7;
|
}
|
||||||
LvlKills[6] = L8;
|
|
||||||
LvlKills[7] = L9;
|
return 0;
|
||||||
LvlKills[8] = L10;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EvolveInfo::~EvolveInfo() {
|
void EQ::ItemInstance::SetTimer(std::string name, uint32 time) const{
|
||||||
|
Timer t(time);
|
||||||
|
t.Start(time, false);
|
||||||
|
m_timers[name] = t;
|
||||||
|
}
|
||||||
|
|
||||||
|
void EQ::ItemInstance::SetEvolveEquipped(const bool in) const
|
||||||
|
{
|
||||||
|
if (!IsEvolving()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_evolving_details.equipped = in;
|
||||||
|
if (in && !GetTimers().contains("evolve")) {
|
||||||
|
SetTimer("evolve", RuleI(EvolvingItems, DelayUponEquipping));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (in) {
|
||||||
|
GetTimers().at("evolve").SetTimer(RuleI(EvolvingItems, DelayUponEquipping));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
GetTimers().at("evolve").Disable();
|
||||||
}
|
}
|
||||||
|
|||||||
+54
-46
@@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
#ifndef COMMON_ITEM_INSTANCE_H
|
#ifndef COMMON_ITEM_INSTANCE_H
|
||||||
#define COMMON_ITEM_INSTANCE_H
|
#define COMMON_ITEM_INSTANCE_H
|
||||||
|
#include "evolving_items.h"
|
||||||
|
|
||||||
|
|
||||||
class ItemParse; // Parses item packets
|
class ItemParse; // Parses item packets
|
||||||
@@ -34,6 +35,7 @@ class EvolveInfo; // Stores information about an evolving item family
|
|||||||
#include "../common/bodytypes.h"
|
#include "../common/bodytypes.h"
|
||||||
#include "../common/deity.h"
|
#include "../common/deity.h"
|
||||||
#include "../common/memory_buffer.h"
|
#include "../common/memory_buffer.h"
|
||||||
|
#include "../common/repositories/character_evolving_items_repository.h"
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
@@ -205,13 +207,9 @@ namespace EQ
|
|||||||
bool IsDroppable(bool recurse = true) const;
|
bool IsDroppable(bool recurse = true) const;
|
||||||
|
|
||||||
bool IsScaling() const { return m_scaling; }
|
bool IsScaling() const { return m_scaling; }
|
||||||
bool IsEvolving() const { return (m_evolveLvl >= 1); }
|
|
||||||
uint32 GetExp() const { return m_exp; }
|
uint32 GetExp() const { return m_exp; }
|
||||||
void SetExp(uint32 exp) { m_exp = exp; }
|
void SetExp(uint32 exp) { m_exp = exp; }
|
||||||
void AddExp(uint32 exp) { m_exp += exp; }
|
void AddExp(uint32 exp) { m_exp += exp; }
|
||||||
bool IsActivated() { return m_activated; }
|
|
||||||
void SetActivated(bool activated) { m_activated = activated; }
|
|
||||||
int8 GetEvolveLvl() const { return m_evolveLvl; }
|
|
||||||
void SetScaling(bool v) { m_scaling = v; }
|
void SetScaling(bool v) { m_scaling = v; }
|
||||||
uint32 GetOrnamentationIcon() const { return m_ornamenticon; }
|
uint32 GetOrnamentationIcon() const { return m_ornamenticon; }
|
||||||
void SetOrnamentIcon(uint32 ornament_icon) { m_ornamenticon = ornament_icon; }
|
void SetOrnamentIcon(uint32 ornament_icon) { m_ornamenticon = ornament_icon; }
|
||||||
@@ -226,9 +224,6 @@ namespace EQ
|
|||||||
|
|
||||||
void Initialize(SharedDatabase *db = nullptr);
|
void Initialize(SharedDatabase *db = nullptr);
|
||||||
void ScaleItem();
|
void ScaleItem();
|
||||||
bool EvolveOnAllKills() const;
|
|
||||||
int8 GetMaxEvolveLvl() const;
|
|
||||||
uint32 GetKillsNeeded(uint8 currentlevel);
|
|
||||||
|
|
||||||
std::string Serialize(int16 slot_id) const { InternalSerializedItem_Struct s; s.slot_id = slot_id; s.inst = (const void*)this; std::string ser; ser.assign((char*)&s, sizeof(InternalSerializedItem_Struct)); return ser; }
|
std::string Serialize(int16 slot_id) const { InternalSerializedItem_Struct s; s.slot_id = slot_id; s.inst = (const void*)this; std::string ser; ser.assign((char*)&s, sizeof(InternalSerializedItem_Struct)); return ser; }
|
||||||
void Serialize(OutBuffer& ob, int16 slot_id) const { InternalSerializedItem_Struct isi; isi.slot_id = slot_id; isi.inst = (const void*)this; ob.write((const char*)&isi, sizeof(isi)); }
|
void Serialize(OutBuffer& ob, int16 slot_id) const { InternalSerializedItem_Struct isi; isi.slot_id = slot_id; isi.inst = (const void*)this; ob.write((const char*)&isi, sizeof(isi)); }
|
||||||
@@ -236,8 +231,9 @@ namespace EQ
|
|||||||
inline int32 GetSerialNumber() const { return m_SerialNumber; }
|
inline int32 GetSerialNumber() const { return m_SerialNumber; }
|
||||||
inline void SetSerialNumber(int32 id) { m_SerialNumber = id; }
|
inline void SetSerialNumber(int32 id) { m_SerialNumber = id; }
|
||||||
|
|
||||||
std::map<std::string, ::Timer>& GetTimers() { return m_timers; }
|
std::map<std::string, ::Timer>& GetTimers() const { return m_timers; }
|
||||||
void SetTimer(std::string name, uint32 time);
|
void SetTimer(std::string name, uint32 time);
|
||||||
|
void SetTimer(std::string name, uint32 time) const;
|
||||||
void StopTimer(std::string name);
|
void StopTimer(std::string name);
|
||||||
void ClearTimers();
|
void ClearTimers();
|
||||||
|
|
||||||
@@ -312,6 +308,34 @@ namespace EQ
|
|||||||
static void AddGUIDToMap(uint64 existing_serial_number);
|
static void AddGUIDToMap(uint64 existing_serial_number);
|
||||||
static void ClearGUIDMap();
|
static void ClearGUIDMap();
|
||||||
|
|
||||||
|
// evolving items stuff
|
||||||
|
CharacterEvolvingItemsRepository::CharacterEvolvingItems &GetEvolvingDetails() const { return m_evolving_details; }
|
||||||
|
|
||||||
|
int8 GetEvolveLvl() const { if (GetItem()) { return GetItem()->EvolvingLevel; } return false; }
|
||||||
|
bool IsEvolving() const { if (GetItem()) { return GetItem()->EvolvingItem; } return false; }
|
||||||
|
int8 GetMaxEvolveLvl() const { if (GetItem()) { return GetItem()->EvolvingMax; } return false; }
|
||||||
|
bool GetEvolveActivated() const { return m_evolving_details.activated ? true : false; }
|
||||||
|
bool GetEvolveEquipped() const { return m_evolving_details.equipped ? true : false; }
|
||||||
|
double GetEvolveProgression() const { return m_evolving_details.progression; }
|
||||||
|
uint64 GetEvolveUniqueID() const { return m_evolving_details.id; }
|
||||||
|
uint32 GetEvolveCharID() const { return m_evolving_details.character_id; }
|
||||||
|
uint32 GetEvolveItemID() const { return m_evolving_details.item_id; }
|
||||||
|
uint32 GetEvolveLoreID() const { if (GetItem()) { return GetItem()->EvolvingID; } return false; }
|
||||||
|
uint64 GetEvolveCurrentAmount() const { return m_evolving_details.current_amount; }
|
||||||
|
uint32 GetEvolveFinalItemID() const { return m_evolving_details.final_item_id; }
|
||||||
|
uint32 GetAugmentEvolveUniqueID(uint8 augment_index) const;
|
||||||
|
void SetEvolveEquipped(const bool in) const;
|
||||||
|
void SetEvolveActivated(const bool in) const { m_evolving_details.activated = in; }
|
||||||
|
void SetEvolveProgression(const double in) const { m_evolving_details.progression = in; }
|
||||||
|
void SetEvolveUniqueID(const uint64 in) const { m_evolving_details.id = in; }
|
||||||
|
void SetEvolveCharID(const uint32 in) const { m_evolving_details.character_id = in; }
|
||||||
|
void SetEvolveItemID(const uint32 in) const { m_evolving_details.item_id = in; }
|
||||||
|
void SetEvolveCurrentAmount(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; }
|
||||||
|
bool TransferOwnership(Database& db, const uint32 to_char_id) const;
|
||||||
|
void CalculateEvolveProgression() const { m_evolving_details.progression = evolving_items_manager.CalculateProgression(GetEvolveCurrentAmount(), GetID()); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
//////////////////////////
|
//////////////////////////
|
||||||
// Protected Members
|
// Protected Members
|
||||||
@@ -323,48 +347,32 @@ namespace EQ
|
|||||||
|
|
||||||
void _PutItem(uint8 index, ItemInstance* inst) { m_contents[index] = inst; }
|
void _PutItem(uint8 index, ItemInstance* inst) { m_contents[index] = inst; }
|
||||||
|
|
||||||
ItemInstTypes m_use_type {ItemInstNormal}; // Usage type for item
|
ItemInstTypes m_use_type{ItemInstNormal};// Usage type for item
|
||||||
const ItemData* m_item {nullptr}; // Ptr to item data
|
const ItemData * m_item{nullptr}; // Ptr to item data
|
||||||
int16 m_charges {0}; // # of charges for chargeable items
|
int16 m_charges{0}; // # of charges for chargeable items
|
||||||
uint32 m_price {0}; // Bazaar /trader price
|
uint32 m_price{0}; // Bazaar /trader price
|
||||||
uint32 m_color {0};
|
uint32 m_color{0};
|
||||||
uint32 m_merchantslot {0};
|
uint32 m_merchantslot{0};
|
||||||
int16 m_currentslot {0};
|
int16 m_currentslot{0};
|
||||||
bool m_attuned {false};
|
bool m_attuned{false};
|
||||||
int32 m_merchantcount {1}; //number avaliable on the merchant, -1=unlimited
|
int32 m_merchantcount{1};//number avaliable on the merchant, -1=unlimited
|
||||||
int32 m_SerialNumber {0}; // Unique identifier for this instance of an item. Needed for Bazaar.
|
int32 m_SerialNumber{0}; // Unique identifier for this instance of an item. Needed for Bazaar.
|
||||||
uint32 m_exp {0};
|
uint32 m_exp{0};
|
||||||
int8 m_evolveLvl {0};
|
int8 m_evolveLvl{0};
|
||||||
bool m_activated {false};
|
ItemData * m_scaledItem{nullptr};
|
||||||
ItemData* m_scaledItem {nullptr};
|
bool m_scaling{false};
|
||||||
::EvolveInfo* m_evolveInfo {nullptr};
|
uint32 m_ornamenticon{0};
|
||||||
bool m_scaling {false};
|
uint32 m_ornamentidfile{0};
|
||||||
uint32 m_ornamenticon {0};
|
uint32 m_new_id_file{0};
|
||||||
uint32 m_ornamentidfile {0};
|
uint32 m_ornament_hero_model{0};
|
||||||
uint32 m_new_id_file {0};
|
uint32 m_recast_timestamp{0};
|
||||||
uint32 m_ornament_hero_model {0};
|
int m_task_delivered_count{0};
|
||||||
uint32 m_recast_timestamp {0};
|
mutable CharacterEvolvingItemsRepository::CharacterEvolvingItems m_evolving_details{};
|
||||||
int m_task_delivered_count {0};
|
|
||||||
|
|
||||||
// Items inside of this item (augs or contents) {};
|
// Items inside of this item (augs or contents) {};
|
||||||
std::map<uint8, ItemInstance*> m_contents {}; // Zero-based index: min=0, max=9
|
std::map<uint8, ItemInstance*> m_contents {}; // Zero-based index: min=0, max=9
|
||||||
std::map<std::string, std::string> m_custom_data {};
|
std::map<std::string, std::string> m_custom_data {};
|
||||||
std::map<std::string, ::Timer> m_timers {};
|
mutable std::map<std::string, ::Timer> m_timers {};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
class EvolveInfo {
|
|
||||||
public:
|
|
||||||
friend class EQ::ItemInstance;
|
|
||||||
//temporary
|
|
||||||
uint16 LvlKills[9];
|
|
||||||
uint32 FirstItem;
|
|
||||||
uint8 MaxLvl;
|
|
||||||
bool AllKills;
|
|
||||||
|
|
||||||
EvolveInfo();
|
|
||||||
EvolveInfo(uint32 first, uint8 max, bool allkills, uint32 L2, uint32 L3, uint32 L4, uint32 L5, uint32 L6, uint32 L7, uint32 L8, uint32 L9, uint32 L10);
|
|
||||||
~EvolveInfo();
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif /*COMMON_ITEM_INSTANCE_H*/
|
#endif /*COMMON_ITEM_INSTANCE_H*/
|
||||||
|
|||||||
@@ -80,6 +80,8 @@ void EQ::Net::TCPConnection::Start() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (nread == UV_EOF) {
|
else if (nread == UV_EOF) {
|
||||||
|
connection->Disconnect();
|
||||||
|
|
||||||
if (buf->base) {
|
if (buf->base) {
|
||||||
delete[] buf->base;
|
delete[] buf->base;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -250,6 +250,7 @@ IN(OP_TraderBuy, TraderBuy_Struct);
|
|||||||
IN(OP_Trader, Trader_ShowItems_Struct);
|
IN(OP_Trader, Trader_ShowItems_Struct);
|
||||||
IN(OP_GMFind, GMSummon_Struct);
|
IN(OP_GMFind, GMSummon_Struct);
|
||||||
IN(OP_PickPocket, PickPocket_Struct);
|
IN(OP_PickPocket, PickPocket_Struct);
|
||||||
|
IN(OP_PickZone, PickZone_Struct);
|
||||||
IN(OP_Bind_Wound, BindWound_Struct);
|
IN(OP_Bind_Wound, BindWound_Struct);
|
||||||
INr(OP_TrackTarget);
|
INr(OP_TrackTarget);
|
||||||
INr(OP_Track);
|
INr(OP_Track);
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,55 +0,0 @@
|
|||||||
/* EQEMu: Everquest Server Emulator
|
|
||||||
|
|
||||||
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation; version 2 of the License.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY except by those people which sell it, which
|
|
||||||
are required to give you total support for your newly bought product;
|
|
||||||
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef COMMON_LAURION_H
|
|
||||||
#define COMMON_LAURION_H
|
|
||||||
|
|
||||||
#include "../struct_strategy.h"
|
|
||||||
|
|
||||||
class EQStreamIdentifier;
|
|
||||||
|
|
||||||
namespace Laurion
|
|
||||||
{
|
|
||||||
|
|
||||||
//these are the only public member of this namespace.
|
|
||||||
extern void Register(EQStreamIdentifier& into);
|
|
||||||
extern void Reload();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//you should not directly access anything below..
|
|
||||||
//I just dont feel like making a seperate header for it.
|
|
||||||
|
|
||||||
class Strategy : public StructStrategy {
|
|
||||||
public:
|
|
||||||
Strategy();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
virtual std::string Describe() const;
|
|
||||||
virtual const EQ::versions::ClientVersion ClientVersion() const;
|
|
||||||
|
|
||||||
//magic macro to declare our opcode processors
|
|
||||||
#include "ss_declare.h"
|
|
||||||
#include "laurion_ops.h"
|
|
||||||
};
|
|
||||||
|
|
||||||
}; /*Laurion*/
|
|
||||||
|
|
||||||
#endif /*COMMON_LAURION_H*/
|
|
||||||
@@ -1,284 +0,0 @@
|
|||||||
/* EQEMu: Everquest Server Emulator
|
|
||||||
|
|
||||||
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation; version 2 of the License.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY except by those people which sell it, which
|
|
||||||
are required to give you total support for your newly bought product;
|
|
||||||
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "laurion_limits.h"
|
|
||||||
|
|
||||||
#include "../strings.h"
|
|
||||||
|
|
||||||
|
|
||||||
int16 Laurion::invtype::GetInvTypeSize(int16 inv_type)
|
|
||||||
{
|
|
||||||
switch (inv_type) {
|
|
||||||
case invtype::typePossessions:
|
|
||||||
return invtype::POSSESSIONS_SIZE;
|
|
||||||
case invtype::typeBank:
|
|
||||||
return invtype::BANK_SIZE;
|
|
||||||
case invtype::typeSharedBank:
|
|
||||||
return invtype::SHARED_BANK_SIZE;
|
|
||||||
case invtype::typeTrade:
|
|
||||||
return invtype::TRADE_SIZE;
|
|
||||||
case invtype::typeWorld:
|
|
||||||
return invtype::WORLD_SIZE;
|
|
||||||
case invtype::typeLimbo:
|
|
||||||
return invtype::LIMBO_SIZE;
|
|
||||||
case invtype::typeTribute:
|
|
||||||
return invtype::TRIBUTE_SIZE;
|
|
||||||
case invtype::typeTrophyTribute:
|
|
||||||
return invtype::TROPHY_TRIBUTE_SIZE;
|
|
||||||
case invtype::typeGuildTribute:
|
|
||||||
return invtype::GUILD_TRIBUTE_SIZE;
|
|
||||||
case invtype::typeMerchant:
|
|
||||||
return invtype::MERCHANT_SIZE;
|
|
||||||
case invtype::typeDeleted:
|
|
||||||
return invtype::DELETED_SIZE;
|
|
||||||
case invtype::typeCorpse:
|
|
||||||
return invtype::CORPSE_SIZE;
|
|
||||||
case invtype::typeBazaar:
|
|
||||||
return invtype::BAZAAR_SIZE;
|
|
||||||
case invtype::typeInspect:
|
|
||||||
return invtype::INSPECT_SIZE;
|
|
||||||
case invtype::typeRealEstate:
|
|
||||||
return invtype::REAL_ESTATE_SIZE;
|
|
||||||
case invtype::typeViewMODPC:
|
|
||||||
return invtype::VIEW_MOD_PC_SIZE;
|
|
||||||
case invtype::typeViewMODBank:
|
|
||||||
return invtype::VIEW_MOD_BANK_SIZE;
|
|
||||||
case invtype::typeViewMODSharedBank:
|
|
||||||
return invtype::VIEW_MOD_SHARED_BANK_SIZE;
|
|
||||||
case invtype::typeViewMODLimbo:
|
|
||||||
return invtype::VIEW_MOD_LIMBO_SIZE;
|
|
||||||
case invtype::typeAltStorage:
|
|
||||||
return invtype::ALT_STORAGE_SIZE;
|
|
||||||
case invtype::typeArchived:
|
|
||||||
return invtype::ARCHIVED_SIZE;
|
|
||||||
case invtype::typeMail:
|
|
||||||
return invtype::MAIL_SIZE;
|
|
||||||
case invtype::typeGuildTrophyTribute:
|
|
||||||
return invtype::GUILD_TROPHY_TRIBUTE_SIZE;
|
|
||||||
case invtype::typeKrono:
|
|
||||||
return invtype::KRONO_SIZE;
|
|
||||||
case invtype::typeOther:
|
|
||||||
return invtype::OTHER_SIZE;
|
|
||||||
default:
|
|
||||||
return INULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const char* Laurion::invtype::GetInvTypeName(int16 inv_type)
|
|
||||||
{
|
|
||||||
switch (inv_type) {
|
|
||||||
case invtype::TYPE_INVALID:
|
|
||||||
return "Invalid Type";
|
|
||||||
case invtype::typePossessions:
|
|
||||||
return "Possessions";
|
|
||||||
case invtype::typeBank:
|
|
||||||
return "Bank";
|
|
||||||
case invtype::typeSharedBank:
|
|
||||||
return "Shared Bank";
|
|
||||||
case invtype::typeTrade:
|
|
||||||
return "Trade";
|
|
||||||
case invtype::typeWorld:
|
|
||||||
return "World";
|
|
||||||
case invtype::typeLimbo:
|
|
||||||
return "Limbo";
|
|
||||||
case invtype::typeTribute:
|
|
||||||
return "Tribute";
|
|
||||||
case invtype::typeTrophyTribute:
|
|
||||||
return "Trophy Tribute";
|
|
||||||
case invtype::typeGuildTribute:
|
|
||||||
return "Guild Tribute";
|
|
||||||
case invtype::typeMerchant:
|
|
||||||
return "Merchant";
|
|
||||||
case invtype::typeDeleted:
|
|
||||||
return "Deleted";
|
|
||||||
case invtype::typeCorpse:
|
|
||||||
return "Corpse";
|
|
||||||
case invtype::typeBazaar:
|
|
||||||
return "Bazaar";
|
|
||||||
case invtype::typeInspect:
|
|
||||||
return "Inspect";
|
|
||||||
case invtype::typeRealEstate:
|
|
||||||
return "Real Estate";
|
|
||||||
case invtype::typeViewMODPC:
|
|
||||||
return "View MOD PC";
|
|
||||||
case invtype::typeViewMODBank:
|
|
||||||
return "View MOD Bank";
|
|
||||||
case invtype::typeViewMODSharedBank:
|
|
||||||
return "View MOD Shared Bank";
|
|
||||||
case invtype::typeViewMODLimbo:
|
|
||||||
return "View MOD Limbo";
|
|
||||||
case invtype::typeAltStorage:
|
|
||||||
return "Alt Storage";
|
|
||||||
case invtype::typeArchived:
|
|
||||||
return "Archived";
|
|
||||||
case invtype::typeMail:
|
|
||||||
return "Mail";
|
|
||||||
case invtype::typeGuildTrophyTribute:
|
|
||||||
return "Guild Trophy Tribute";
|
|
||||||
case invtype::typeKrono:
|
|
||||||
return "Krono";
|
|
||||||
case invtype::typeOther:
|
|
||||||
return "Other";
|
|
||||||
default:
|
|
||||||
return "Unknown Type";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Laurion::invtype::IsInvTypePersistent(int16 inv_type)
|
|
||||||
{
|
|
||||||
switch (inv_type) {
|
|
||||||
case invtype::typePossessions:
|
|
||||||
case invtype::typeBank:
|
|
||||||
case invtype::typeSharedBank:
|
|
||||||
case invtype::typeTrade:
|
|
||||||
case invtype::typeWorld:
|
|
||||||
case invtype::typeLimbo:
|
|
||||||
case invtype::typeTribute:
|
|
||||||
case invtype::typeTrophyTribute:
|
|
||||||
case invtype::typeGuildTribute:
|
|
||||||
return true;
|
|
||||||
default:
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const char* Laurion::invslot::GetInvPossessionsSlotName(int16 inv_slot)
|
|
||||||
{
|
|
||||||
switch (inv_slot) {
|
|
||||||
case invslot::SLOT_INVALID:
|
|
||||||
return "Invalid Slot";
|
|
||||||
case invslot::slotCharm:
|
|
||||||
return "Charm";
|
|
||||||
case invslot::slotEar1:
|
|
||||||
return "Ear 1";
|
|
||||||
case invslot::slotHead:
|
|
||||||
return "Head";
|
|
||||||
case invslot::slotFace:
|
|
||||||
return "Face";
|
|
||||||
case invslot::slotEar2:
|
|
||||||
return "Ear 2";
|
|
||||||
case invslot::slotNeck:
|
|
||||||
return "Neck";
|
|
||||||
case invslot::slotShoulders:
|
|
||||||
return "Shoulders";
|
|
||||||
case invslot::slotArms:
|
|
||||||
return "Arms";
|
|
||||||
case invslot::slotBack:
|
|
||||||
return "Back";
|
|
||||||
case invslot::slotWrist1:
|
|
||||||
return "Wrist 1";
|
|
||||||
case invslot::slotWrist2:
|
|
||||||
return "Wrist 2";
|
|
||||||
case invslot::slotRange:
|
|
||||||
return "Range";
|
|
||||||
case invslot::slotHands:
|
|
||||||
return "Hands";
|
|
||||||
case invslot::slotPrimary:
|
|
||||||
return "Primary";
|
|
||||||
case invslot::slotSecondary:
|
|
||||||
return "Secondary";
|
|
||||||
case invslot::slotFinger1:
|
|
||||||
return "Finger 1";
|
|
||||||
case invslot::slotFinger2:
|
|
||||||
return "Finger 2";
|
|
||||||
case invslot::slotChest:
|
|
||||||
return "Chest";
|
|
||||||
case invslot::slotLegs:
|
|
||||||
return "Legs";
|
|
||||||
case invslot::slotFeet:
|
|
||||||
return "Feet";
|
|
||||||
case invslot::slotWaist:
|
|
||||||
return "Waist";
|
|
||||||
case invslot::slotPowerSource:
|
|
||||||
return "Power Source";
|
|
||||||
case invslot::slotAmmo:
|
|
||||||
return "Ammo";
|
|
||||||
case invslot::slotGeneral1:
|
|
||||||
return "General 1";
|
|
||||||
case invslot::slotGeneral2:
|
|
||||||
return "General 2";
|
|
||||||
case invslot::slotGeneral3:
|
|
||||||
return "General 3";
|
|
||||||
case invslot::slotGeneral4:
|
|
||||||
return "General 4";
|
|
||||||
case invslot::slotGeneral5:
|
|
||||||
return "General 5";
|
|
||||||
case invslot::slotGeneral6:
|
|
||||||
return "General 6";
|
|
||||||
case invslot::slotGeneral7:
|
|
||||||
return "General 7";
|
|
||||||
case invslot::slotGeneral8:
|
|
||||||
return "General 8";
|
|
||||||
case invslot::slotGeneral9:
|
|
||||||
return "General 9";
|
|
||||||
case invslot::slotGeneral10:
|
|
||||||
return "General 10";
|
|
||||||
case invslot::slotCursor:
|
|
||||||
return "Cursor";
|
|
||||||
default:
|
|
||||||
return "Unknown Slot";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const char* Laurion::invslot::GetInvSlotName(int16 inv_type, int16 inv_slot)
|
|
||||||
{
|
|
||||||
if (inv_type == invtype::typePossessions)
|
|
||||||
return invslot::GetInvPossessionsSlotName(inv_slot);
|
|
||||||
|
|
||||||
int16 type_size = invtype::GetInvTypeSize(inv_type);
|
|
||||||
|
|
||||||
if (!type_size || inv_slot == invslot::SLOT_INVALID)
|
|
||||||
return "Invalid Slot";
|
|
||||||
|
|
||||||
if ((inv_slot + 1) >= type_size)
|
|
||||||
return "Unknown Slot";
|
|
||||||
|
|
||||||
static std::string ret_str;
|
|
||||||
ret_str = StringFormat("Slot %i", (inv_slot + 1));
|
|
||||||
|
|
||||||
return ret_str.c_str();
|
|
||||||
}
|
|
||||||
|
|
||||||
const char* Laurion::invbag::GetInvBagIndexName(int16 bag_index)
|
|
||||||
{
|
|
||||||
if (bag_index == invbag::SLOT_INVALID)
|
|
||||||
return "Invalid Bag";
|
|
||||||
|
|
||||||
if (bag_index >= invbag::SLOT_COUNT)
|
|
||||||
return "Unknown Bag";
|
|
||||||
|
|
||||||
static std::string ret_str;
|
|
||||||
ret_str = StringFormat("Bag %i", (bag_index + 1));
|
|
||||||
|
|
||||||
return ret_str.c_str();
|
|
||||||
}
|
|
||||||
|
|
||||||
const char* Laurion::invaug::GetInvAugIndexName(int16 aug_index)
|
|
||||||
{
|
|
||||||
if (aug_index == invaug::SOCKET_INVALID)
|
|
||||||
return "Invalid Augment";
|
|
||||||
|
|
||||||
if (aug_index >= invaug::SOCKET_COUNT)
|
|
||||||
return "Unknown Augment";
|
|
||||||
|
|
||||||
static std::string ret_str;
|
|
||||||
ret_str = StringFormat("Augment %i", (aug_index + 1));
|
|
||||||
|
|
||||||
return ret_str.c_str();
|
|
||||||
}
|
|
||||||
@@ -1,355 +0,0 @@
|
|||||||
/* EQEMu: Everquest Server Emulator
|
|
||||||
|
|
||||||
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation; version 2 of the License.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY except by those people which sell it, which
|
|
||||||
are required to give you total support for your newly bought product;
|
|
||||||
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef COMMON_LAURION_LIMITS_H
|
|
||||||
#define COMMON_LAURION_LIMITS_H
|
|
||||||
|
|
||||||
#include "../types.h"
|
|
||||||
#include "../emu_versions.h"
|
|
||||||
#include "../skills.h"
|
|
||||||
|
|
||||||
namespace Laurion
|
|
||||||
{
|
|
||||||
const int16 IINVALID = -1;
|
|
||||||
const int16 INULL = 0;
|
|
||||||
|
|
||||||
namespace inventory {
|
|
||||||
inline EQ::versions::ClientVersion GetInventoryRef() { return EQ::versions::ClientVersion::Laurion; }
|
|
||||||
|
|
||||||
const bool ConcatenateInvTypeLimbo = false;
|
|
||||||
|
|
||||||
const bool AllowOverLevelEquipment = true;
|
|
||||||
|
|
||||||
const bool AllowEmptyBagInBag = true;
|
|
||||||
const bool AllowClickCastFromBag = true;
|
|
||||||
|
|
||||||
} /*inventory*/
|
|
||||||
|
|
||||||
namespace invtype {
|
|
||||||
inline EQ::versions::ClientVersion GetInvTypeRef() { return EQ::versions::ClientVersion::Laurion; }
|
|
||||||
|
|
||||||
namespace enum_ {
|
|
||||||
enum InventoryTypes : int16 {
|
|
||||||
typePossessions = INULL,
|
|
||||||
typeBank,
|
|
||||||
typeSharedBank,
|
|
||||||
typeTrade,
|
|
||||||
typeWorld,
|
|
||||||
typeLimbo,
|
|
||||||
typeTribute,
|
|
||||||
typeTrophyTribute,
|
|
||||||
typeGuildTribute,
|
|
||||||
typeMerchant,
|
|
||||||
typeDeleted,
|
|
||||||
typeCorpse,
|
|
||||||
typeBazaar,
|
|
||||||
typeInspect,
|
|
||||||
typeRealEstate,
|
|
||||||
typeViewMODPC,
|
|
||||||
typeViewMODBank,
|
|
||||||
typeViewMODSharedBank,
|
|
||||||
typeViewMODLimbo,
|
|
||||||
typeAltStorage,
|
|
||||||
typeArchived,
|
|
||||||
typeMail,
|
|
||||||
typeGuildTrophyTribute,
|
|
||||||
typeKrono,
|
|
||||||
typeOther,
|
|
||||||
typeMercenaryItems,
|
|
||||||
typeViewModMercenaryItems,
|
|
||||||
typeMountKeyRingItems,
|
|
||||||
typeViewModMountKeyRingItems,
|
|
||||||
typeIllusionKeyRingItems,
|
|
||||||
typeViewModIllusionKeyRingItems,
|
|
||||||
typeFamiliarKeyRingItems,
|
|
||||||
typeViewModFamiliarKeyRingItems,
|
|
||||||
typeHeroForgeKeyRingItems,
|
|
||||||
typeViewModHeroForgeKeyRingItems,
|
|
||||||
typeTeleportationKeyRingItems,
|
|
||||||
typeViewModTeleportationKeyRingItems,
|
|
||||||
typeOverflow,
|
|
||||||
typeDragonHoard,
|
|
||||||
typeTradeskillDepot,
|
|
||||||
typeGuildTradeskillDepot
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace enum_
|
|
||||||
using namespace enum_;
|
|
||||||
|
|
||||||
const int16 POSSESSIONS_SIZE = 34;
|
|
||||||
const int16 BANK_SIZE = 24;
|
|
||||||
const int16 SHARED_BANK_SIZE = 2;
|
|
||||||
const int16 TRADE_SIZE = 8;
|
|
||||||
const int16 WORLD_SIZE = 10;
|
|
||||||
const int16 LIMBO_SIZE = 36;
|
|
||||||
const int16 TRIBUTE_SIZE = 5;
|
|
||||||
const int16 TROPHY_TRIBUTE_SIZE = 0;//unknown
|
|
||||||
const int16 GUILD_TRIBUTE_SIZE = 2;//unverified
|
|
||||||
const int16 MERCHANT_SIZE = 200;
|
|
||||||
const int16 DELETED_SIZE = 0;//unknown - "Recovery Tab"
|
|
||||||
const int16 CORPSE_SIZE = POSSESSIONS_SIZE;
|
|
||||||
const int16 BAZAAR_SIZE = 200;
|
|
||||||
const int16 INSPECT_SIZE = 23;
|
|
||||||
const int16 REAL_ESTATE_SIZE = 0;//unknown
|
|
||||||
const int16 VIEW_MOD_PC_SIZE = POSSESSIONS_SIZE;
|
|
||||||
const int16 VIEW_MOD_BANK_SIZE = BANK_SIZE;
|
|
||||||
const int16 VIEW_MOD_SHARED_BANK_SIZE = SHARED_BANK_SIZE;
|
|
||||||
const int16 VIEW_MOD_LIMBO_SIZE = LIMBO_SIZE;
|
|
||||||
const int16 ALT_STORAGE_SIZE = 0;//unknown - "Shroud Bank"
|
|
||||||
const int16 ARCHIVED_SIZE = 0;//unknown
|
|
||||||
const int16 MAIL_SIZE = 0;//unknown
|
|
||||||
const int16 GUILD_TROPHY_TRIBUTE_SIZE = 0;//unknown
|
|
||||||
const int16 KRONO_SIZE = 0;//unknown
|
|
||||||
const int16 OTHER_SIZE = 0;//unknown
|
|
||||||
|
|
||||||
const int16 TRADE_NPC_SIZE = 4; // defined by implication
|
|
||||||
|
|
||||||
const int16 TYPE_INVALID = IINVALID;
|
|
||||||
const int16 TYPE_BEGIN = typePossessions;
|
|
||||||
const int16 TYPE_END = typeOther;
|
|
||||||
const int16 TYPE_COUNT = (TYPE_END - TYPE_BEGIN) + 1;
|
|
||||||
|
|
||||||
int16 GetInvTypeSize(int16 inv_type);
|
|
||||||
const char* GetInvTypeName(int16 inv_type);
|
|
||||||
|
|
||||||
bool IsInvTypePersistent(int16 inv_type);
|
|
||||||
|
|
||||||
} /*invtype*/
|
|
||||||
|
|
||||||
namespace invslot {
|
|
||||||
inline EQ::versions::ClientVersion GetInvSlotRef() { return EQ::versions::ClientVersion::Laurion; }
|
|
||||||
|
|
||||||
namespace enum_ {
|
|
||||||
enum InventorySlots : int16 {
|
|
||||||
slotCharm = INULL,
|
|
||||||
slotEar1,
|
|
||||||
slotHead,
|
|
||||||
slotFace,
|
|
||||||
slotEar2,
|
|
||||||
slotNeck,
|
|
||||||
slotShoulders,
|
|
||||||
slotArms,
|
|
||||||
slotBack,
|
|
||||||
slotWrist1,
|
|
||||||
slotWrist2,
|
|
||||||
slotRange,
|
|
||||||
slotHands,
|
|
||||||
slotPrimary,
|
|
||||||
slotSecondary,
|
|
||||||
slotFinger1,
|
|
||||||
slotFinger2,
|
|
||||||
slotChest,
|
|
||||||
slotLegs,
|
|
||||||
slotFeet,
|
|
||||||
slotWaist,
|
|
||||||
slotPowerSource,
|
|
||||||
slotAmmo,
|
|
||||||
slotGeneral1,
|
|
||||||
slotGeneral2,
|
|
||||||
slotGeneral3,
|
|
||||||
slotGeneral4,
|
|
||||||
slotGeneral5,
|
|
||||||
slotGeneral6,
|
|
||||||
slotGeneral7,
|
|
||||||
slotGeneral8,
|
|
||||||
slotGeneral9,
|
|
||||||
slotGeneral10,
|
|
||||||
slotGeneral11,
|
|
||||||
slotGeneral12,
|
|
||||||
slotCursor
|
|
||||||
};
|
|
||||||
|
|
||||||
constexpr int16 format_as(InventorySlots slot) { return static_cast<int16>(slot); }
|
|
||||||
} // namespace enum_
|
|
||||||
using namespace enum_;
|
|
||||||
|
|
||||||
const int16 SLOT_INVALID = IINVALID;
|
|
||||||
const int16 SLOT_BEGIN = INULL;
|
|
||||||
|
|
||||||
const int16 POSSESSIONS_BEGIN = slotCharm;
|
|
||||||
const int16 POSSESSIONS_END = slotCursor;
|
|
||||||
const int16 POSSESSIONS_COUNT = (POSSESSIONS_END - POSSESSIONS_BEGIN) + 1;
|
|
||||||
|
|
||||||
const int16 EQUIPMENT_BEGIN = slotCharm;
|
|
||||||
const int16 EQUIPMENT_END = slotAmmo;
|
|
||||||
const int16 EQUIPMENT_COUNT = (EQUIPMENT_END - EQUIPMENT_BEGIN) + 1;
|
|
||||||
|
|
||||||
//We support more if enabled but for now lets leave it at the 10 slots
|
|
||||||
const int16 GENERAL_BEGIN = slotGeneral1;
|
|
||||||
const int16 GENERAL_END = slotGeneral10;
|
|
||||||
const int16 GENERAL_COUNT = (GENERAL_END - GENERAL_BEGIN) + 1;
|
|
||||||
|
|
||||||
const int16 BONUS_BEGIN = invslot::slotCharm;
|
|
||||||
const int16 BONUS_STAT_END = invslot::slotPowerSource;
|
|
||||||
const int16 BONUS_SKILL_END = invslot::slotAmmo;
|
|
||||||
|
|
||||||
const int16 CORPSE_BEGIN = invslot::slotGeneral1;
|
|
||||||
const int16 CORPSE_END = invslot::slotGeneral1 + invslot::slotCursor;
|
|
||||||
|
|
||||||
const uint64 EQUIPMENT_BITMASK = 0x00000000007FFFFF;
|
|
||||||
const uint64 GENERAL_BITMASK = 0x00000007FF800000;
|
|
||||||
const uint64 CURSOR_BITMASK = 0x0000000800000000;
|
|
||||||
const uint64 POSSESSIONS_BITMASK = (EQUIPMENT_BITMASK | GENERAL_BITMASK | CURSOR_BITMASK); // based on 36-slot count (Laurion+)
|
|
||||||
const uint64 CORPSE_BITMASK = (GENERAL_BITMASK | CURSOR_BITMASK | (EQUIPMENT_BITMASK << 36)); // based on 36-slot count (Laurion+)
|
|
||||||
|
|
||||||
|
|
||||||
const char* GetInvPossessionsSlotName(int16 inv_slot);
|
|
||||||
const char* GetInvSlotName(int16 inv_type, int16 inv_slot);
|
|
||||||
|
|
||||||
} /*invslot*/
|
|
||||||
|
|
||||||
namespace invbag {
|
|
||||||
inline EQ::versions::ClientVersion GetInvBagRef() { return EQ::versions::ClientVersion::Laurion; }
|
|
||||||
|
|
||||||
const int16 SLOT_INVALID = IINVALID;
|
|
||||||
const int16 SLOT_BEGIN = INULL;
|
|
||||||
const int16 SLOT_END = 9; //254;
|
|
||||||
const int16 SLOT_COUNT = 10; //255; // server Size will be 255..unsure what actual client is (test)
|
|
||||||
|
|
||||||
const char* GetInvBagIndexName(int16 bag_index);
|
|
||||||
|
|
||||||
} /*invbag*/
|
|
||||||
|
|
||||||
namespace invaug {
|
|
||||||
inline EQ::versions::ClientVersion GetInvAugRef() { return EQ::versions::ClientVersion::Laurion; }
|
|
||||||
|
|
||||||
const int16 SOCKET_INVALID = IINVALID;
|
|
||||||
const int16 SOCKET_BEGIN = INULL;
|
|
||||||
const int16 SOCKET_END = 5;
|
|
||||||
const int16 SOCKET_COUNT = 6;
|
|
||||||
|
|
||||||
const char* GetInvAugIndexName(int16 aug_index);
|
|
||||||
|
|
||||||
} /*invaug*/
|
|
||||||
|
|
||||||
namespace item {
|
|
||||||
inline EQ::versions::ClientVersion GetItemRef() { return EQ::versions::ClientVersion::Laurion; }
|
|
||||||
|
|
||||||
//enum Unknown : int { // looks like item class..but, RoF has it too - nothing in UF-
|
|
||||||
// Unknown1 = 0,
|
|
||||||
// Unknown2 = 1,
|
|
||||||
// Unknown3 = 2,
|
|
||||||
// Unknown4 = 5 // krono?
|
|
||||||
//};
|
|
||||||
|
|
||||||
enum ItemPacketType : int {
|
|
||||||
ItemPacketMerchant = 0x64,
|
|
||||||
ItemPacketTradeView = 0x65,
|
|
||||||
ItemPacketLoot = 0x66,
|
|
||||||
ItemPacketTrade = 0x67,
|
|
||||||
//looks like they added something at 0x68 that didn't exist before and shifted everything after it up by 1
|
|
||||||
ItemPacketUnknown068 = 0x68, //Not sure but it seems to deal with the cursor somehow.
|
|
||||||
ItemPacketCharInventory = 0x6A, //Rof 0x69 -> Larion 0x6a (requires translation)
|
|
||||||
ItemPacketLimbo = 0x6B, //0x6A -> 0x6B
|
|
||||||
ItemPacketWorldContainer = 0x6C,
|
|
||||||
ItemPacketTributeItem = 0x6D,
|
|
||||||
ItemPacketGuildTribute = 0x6E,
|
|
||||||
ItemPacketCharmUpdate = 0x6f,
|
|
||||||
ItemPacketRecovery = 0x72,
|
|
||||||
ItemPacketParcel = 0x74,
|
|
||||||
ItemPacketUnknown075 = 0x75, //Not sure but uses a lot of the same logic as the trade and char inventory types
|
|
||||||
ItemPacketOverflow = 0x76,
|
|
||||||
ItemPacketDragonHoard = 0x77,
|
|
||||||
ItemPacketTradeskill = 0x78,
|
|
||||||
ItemPacketTradeskillDepot = 0x79,
|
|
||||||
ItemPacketInvalid = 0xFF
|
|
||||||
};
|
|
||||||
|
|
||||||
} /*item*/
|
|
||||||
|
|
||||||
namespace profile {
|
|
||||||
inline EQ::versions::ClientVersion GetProfileRef() { return EQ::versions::ClientVersion::Laurion; }
|
|
||||||
|
|
||||||
const int16 BANDOLIERS_SIZE = 20; // number of bandolier instances
|
|
||||||
const int16 BANDOLIER_ITEM_COUNT = 4; // number of equipment slots in bandolier instance
|
|
||||||
|
|
||||||
const int16 POTION_BELT_SIZE = 5;
|
|
||||||
|
|
||||||
const int16 SKILL_ARRAY_SIZE = 100;
|
|
||||||
|
|
||||||
} /*profile*/
|
|
||||||
|
|
||||||
namespace constants {
|
|
||||||
inline EQ::versions::ClientVersion GetConstantsRef() { return EQ::versions::ClientVersion::Laurion; }
|
|
||||||
|
|
||||||
const EQ::expansions::Expansion EXPANSION = EQ::expansions::Expansion::LS;
|
|
||||||
const uint32 EXPANSION_BIT = EQ::expansions::bitLS;
|
|
||||||
const uint32 EXPANSIONS_MASK = EQ::expansions::maskLS;
|
|
||||||
|
|
||||||
const size_t CHARACTER_CREATION_LIMIT = 12;
|
|
||||||
|
|
||||||
const size_t SAY_LINK_BODY_SIZE = 56;
|
|
||||||
const uint32 MAX_GUILD_ID = 50000;
|
|
||||||
|
|
||||||
} /*constants*/
|
|
||||||
|
|
||||||
namespace behavior {
|
|
||||||
inline EQ::versions::ClientVersion GetBehaviorRef() { return EQ::versions::ClientVersion::Laurion; }
|
|
||||||
|
|
||||||
const bool CoinHasWeight = false;
|
|
||||||
|
|
||||||
} /*behavior*/
|
|
||||||
|
|
||||||
namespace skills {
|
|
||||||
inline EQ::versions::ClientVersion GetSkillsRef() { return EQ::versions::ClientVersion::Laurion; }
|
|
||||||
|
|
||||||
const size_t LastUsableSkill = EQ::skills::Skill2HPiercing;
|
|
||||||
|
|
||||||
} /*skills*/
|
|
||||||
|
|
||||||
namespace spells {
|
|
||||||
inline EQ::versions::ClientVersion GetSkillsRef() { return EQ::versions::ClientVersion::Laurion; }
|
|
||||||
|
|
||||||
enum class CastingSlot : uint32 {
|
|
||||||
Gem1 = 0,
|
|
||||||
Gem2 = 1,
|
|
||||||
Gem3 = 2,
|
|
||||||
Gem4 = 3,
|
|
||||||
Gem5 = 4,
|
|
||||||
Gem6 = 5,
|
|
||||||
Gem7 = 6,
|
|
||||||
Gem8 = 7,
|
|
||||||
Gem9 = 8,
|
|
||||||
Gem10 = 9,
|
|
||||||
Gem11 = 10,
|
|
||||||
Gem12 = 11,
|
|
||||||
MaxGems = 18, // fallacy..only 12 slot are useable...
|
|
||||||
Item = 12,
|
|
||||||
Discipline = 13,
|
|
||||||
AltAbility = 0xFF
|
|
||||||
};
|
|
||||||
|
|
||||||
const int SPELL_ID_MAX = 71999;
|
|
||||||
const int SPELLBOOK_SIZE = 1120;
|
|
||||||
const int SPELL_GEM_COUNT = static_cast<uint32>(CastingSlot::MaxGems);
|
|
||||||
const int SPELL_GEM_RECAST_TIMER = 15;
|
|
||||||
|
|
||||||
const int LONG_BUFFS = 42;
|
|
||||||
const int SHORT_BUFFS = 30;
|
|
||||||
const int DISC_BUFFS = 1;
|
|
||||||
const int TOTAL_BUFFS = LONG_BUFFS + SHORT_BUFFS + DISC_BUFFS;
|
|
||||||
const int NPC_BUFFS = 400;
|
|
||||||
const int PET_BUFFS = NPC_BUFFS;
|
|
||||||
const int MERC_BUFFS = LONG_BUFFS;
|
|
||||||
|
|
||||||
} /*spells*/
|
|
||||||
|
|
||||||
}; /* Laurion */
|
|
||||||
|
|
||||||
#endif /*COMMON_LAURION_LIMITS_H*/
|
|
||||||
@@ -1,96 +0,0 @@
|
|||||||
|
|
||||||
//list of packets we need to encode on the way out:
|
|
||||||
E(OP_Action)
|
|
||||||
E(OP_Animation)
|
|
||||||
E(OP_ApplyPoison)
|
|
||||||
E(OP_AugmentInfo)
|
|
||||||
E(OP_BeginCast)
|
|
||||||
E(OP_BlockedBuffs)
|
|
||||||
E(OP_Buff)
|
|
||||||
E(OP_BuffCreate)
|
|
||||||
E(OP_CancelTrade)
|
|
||||||
E(OP_CastSpell)
|
|
||||||
E(OP_ChannelMessage)
|
|
||||||
E(OP_CharInventory)
|
|
||||||
E(OP_ClickObjectAction)
|
|
||||||
E(OP_ClientUpdate)
|
|
||||||
E(OP_Consider)
|
|
||||||
E(OP_Damage)
|
|
||||||
E(OP_Death)
|
|
||||||
E(OP_DeleteCharge)
|
|
||||||
E(OP_DeleteItem)
|
|
||||||
E(OP_DeleteSpawn)
|
|
||||||
E(OP_DisciplineUpdate)
|
|
||||||
E(OP_ExpansionInfo)
|
|
||||||
E(OP_ExpUpdate)
|
|
||||||
E(OP_FormattedMessage)
|
|
||||||
E(OP_GMTraining)
|
|
||||||
E(OP_GMTrainSkillConfirm)
|
|
||||||
E(OP_GroundSpawn)
|
|
||||||
E(OP_HPUpdate)
|
|
||||||
E(OP_Illusion)
|
|
||||||
E(OP_ItemPacket)
|
|
||||||
E(OP_LogServer)
|
|
||||||
E(OP_ManaChange)
|
|
||||||
E(OP_MobHealth)
|
|
||||||
E(OP_MoneyOnCorpse)
|
|
||||||
E(OP_MoveItem)
|
|
||||||
E(OP_NewSpawn)
|
|
||||||
E(OP_NewZone)
|
|
||||||
E(OP_OnLevelMessage)
|
|
||||||
E(OP_PlayerProfile)
|
|
||||||
E(OP_RemoveBlockedBuffs)
|
|
||||||
E(OP_RespondAA)
|
|
||||||
E(OP_RequestClientZoneChange)
|
|
||||||
E(OP_RecipeAutoCombine)
|
|
||||||
E(OP_SendAATable)
|
|
||||||
E(OP_SendCharInfo)
|
|
||||||
E(OP_SendMaxCharacters)
|
|
||||||
E(OP_SendMembership)
|
|
||||||
E(OP_SendMembershipDetails)
|
|
||||||
E(OP_SendZonepoints)
|
|
||||||
E(OP_ShopPlayerBuy)
|
|
||||||
E(OP_ShopPlayerSell)
|
|
||||||
E(OP_ShopRequest)
|
|
||||||
E(OP_SkillUpdate)
|
|
||||||
E(OP_SpecialMesg)
|
|
||||||
E(OP_SpawnAppearance)
|
|
||||||
E(OP_SpawnDoor)
|
|
||||||
E(OP_Stun)
|
|
||||||
E(OP_WearChange)
|
|
||||||
E(OP_ZoneChange)
|
|
||||||
E(OP_ZoneEntry)
|
|
||||||
E(OP_ZonePlayerToBind)
|
|
||||||
E(OP_ZoneSpawns)
|
|
||||||
|
|
||||||
//list of packets we need to decode on the way in:
|
|
||||||
D(OP_Animation)
|
|
||||||
D(OP_ApplyPoison)
|
|
||||||
D(OP_AugmentInfo)
|
|
||||||
D(OP_AugmentItem)
|
|
||||||
D(OP_BlockedBuffs)
|
|
||||||
D(OP_CastSpell)
|
|
||||||
D(OP_ChannelMessage)
|
|
||||||
D(OP_ClientUpdate)
|
|
||||||
D(OP_ClickDoor)
|
|
||||||
D(OP_Consider)
|
|
||||||
D(OP_ConsiderCorpse)
|
|
||||||
D(OP_DeleteItem)
|
|
||||||
D(OP_EnterWorld)
|
|
||||||
D(OP_GMTraining)
|
|
||||||
D(OP_GroupDisband)
|
|
||||||
D(OP_GroupInvite)
|
|
||||||
D(OP_GroupInvite2)
|
|
||||||
D(OP_MoveItem)
|
|
||||||
D(OP_RemoveBlockedBuffs)
|
|
||||||
D(OP_SetServerFilter)
|
|
||||||
D(OP_ShopPlayerBuy)
|
|
||||||
D(OP_ShopPlayerSell)
|
|
||||||
D(OP_ShopRequest)
|
|
||||||
D(OP_SpawnAppearance)
|
|
||||||
D(OP_TradeSkillCombine)
|
|
||||||
D(OP_WearChange)
|
|
||||||
D(OP_ZoneEntry)
|
|
||||||
D(OP_ZoneChange)
|
|
||||||
#undef E
|
|
||||||
#undef D
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -26,7 +26,7 @@
|
|||||||
#include "sod.h"
|
#include "sod.h"
|
||||||
#include "rof.h"
|
#include "rof.h"
|
||||||
#include "rof2.h"
|
#include "rof2.h"
|
||||||
#include "laurion.h"
|
|
||||||
|
|
||||||
void RegisterAllPatches(EQStreamIdentifier &into)
|
void RegisterAllPatches(EQStreamIdentifier &into)
|
||||||
{
|
{
|
||||||
@@ -36,7 +36,6 @@ void RegisterAllPatches(EQStreamIdentifier &into)
|
|||||||
UF::Register(into);
|
UF::Register(into);
|
||||||
RoF::Register(into);
|
RoF::Register(into);
|
||||||
RoF2::Register(into);
|
RoF2::Register(into);
|
||||||
Laurion::Register(into);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReloadAllPatches()
|
void ReloadAllPatches()
|
||||||
@@ -47,5 +46,4 @@ void ReloadAllPatches()
|
|||||||
UF::Reload();
|
UF::Reload();
|
||||||
RoF::Reload();
|
RoF::Reload();
|
||||||
RoF2::Reload();
|
RoF2::Reload();
|
||||||
Laurion::Reload();
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5188,7 +5188,14 @@ namespace RoF
|
|||||||
|
|
||||||
//sprintf(hdr.unknown000, "06e0002Y1W00");
|
//sprintf(hdr.unknown000, "06e0002Y1W00");
|
||||||
|
|
||||||
snprintf(hdr.unknown000, sizeof(hdr.unknown000), "%016d", item->ID);
|
strn0cpy(
|
||||||
|
hdr.unknown000,
|
||||||
|
fmt::format(
|
||||||
|
"{:016}\0",
|
||||||
|
packet_type == ItemPacketInvalid ? 0 : inst->GetSerialNumber()
|
||||||
|
).c_str(),
|
||||||
|
sizeof(hdr.unknown000)
|
||||||
|
);
|
||||||
|
|
||||||
hdr.stacksize = (inst->IsStackable() ? ((inst->GetCharges() > 1000) ? 0xFFFFFFFF : inst->GetCharges()) : 1);
|
hdr.stacksize = (inst->IsStackable() ? ((inst->GetCharges() > 1000) ? 0xFFFFFFFF : inst->GetCharges()) : 1);
|
||||||
hdr.unknown004 = 0;
|
hdr.unknown004 = 0;
|
||||||
|
|||||||
+135
-60
@@ -433,7 +433,9 @@ namespace RoF2
|
|||||||
VARSTRUCT_ENCODE_TYPE(uint32, eq, i.item_icon);
|
VARSTRUCT_ENCODE_TYPE(uint32, eq, i.item_icon);
|
||||||
VARSTRUCT_SKIP_TYPE(uint32, eq);
|
VARSTRUCT_SKIP_TYPE(uint32, eq);
|
||||||
}
|
}
|
||||||
|
|
||||||
dest->QueuePacket(outapp.get());
|
dest->QueuePacket(outapp.get());
|
||||||
|
safe_delete(in);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
@@ -468,8 +470,8 @@ namespace RoF2
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto p_size = 41 * results.size() + name_size + 14;
|
auto p_size = 41 * results.size() + name_size + 14;
|
||||||
auto buffer = std::make_unique<char[]>(p_size);
|
auto buffer = new char[p_size];
|
||||||
auto bufptr = buffer.get();
|
auto bufptr = buffer;
|
||||||
|
|
||||||
VARSTRUCT_ENCODE_TYPE(uint32, bufptr, 0);
|
VARSTRUCT_ENCODE_TYPE(uint32, bufptr, 0);
|
||||||
VARSTRUCT_ENCODE_TYPE(uint16, bufptr, results[0].trader_zone_id);
|
VARSTRUCT_ENCODE_TYPE(uint16, bufptr, results[0].trader_zone_id);
|
||||||
@@ -487,10 +489,11 @@ namespace RoF2
|
|||||||
VARSTRUCT_ENCODE_TYPE(uint32, bufptr, i.item_stat); //itemstat
|
VARSTRUCT_ENCODE_TYPE(uint32, bufptr, i.item_stat); //itemstat
|
||||||
}
|
}
|
||||||
|
|
||||||
safe_delete(in->pBuffer);
|
safe_delete_array(in->pBuffer);
|
||||||
in->size = p_size;
|
in->size = p_size;
|
||||||
in->pBuffer = (uchar *) buffer.get();
|
in->pBuffer = (uchar*)buffer;
|
||||||
dest->QueuePacket(in);
|
dest->QueuePacket(in);
|
||||||
|
safe_delete(in);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -500,21 +503,22 @@ namespace RoF2
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case WelcomeMessage: {
|
case WelcomeMessage: {
|
||||||
auto buffer = std::make_unique<char[]>(sizeof(structs::BazaarWelcome_Struct));
|
auto buffer = new char[sizeof(structs::BazaarWelcome_Struct)];
|
||||||
auto emu = (BazaarWelcome_Struct *) in->pBuffer;
|
auto emu = (BazaarWelcome_Struct *) in->pBuffer;
|
||||||
auto eq = (structs::BazaarWelcome_Struct *) buffer.get();
|
auto eq = (structs::BazaarWelcome_Struct *) buffer;
|
||||||
|
|
||||||
eq->action = structs::RoF2BazaarTraderBuyerActions::WelcomeMessage;
|
eq->action = structs::RoF2BazaarTraderBuyerActions::WelcomeMessage;
|
||||||
eq->num_of_traders = emu->traders;
|
eq->num_of_traders = emu->traders;
|
||||||
eq->num_of_items = emu->items;
|
eq->num_of_items = emu->items;
|
||||||
|
|
||||||
safe_delete(in->pBuffer);
|
safe_delete_array(in->pBuffer);
|
||||||
in->SetOpcode(OP_TraderShop);
|
in->SetOpcode(OP_TraderShop);
|
||||||
in->size = sizeof(structs::BazaarWelcome_Struct);
|
in->size = sizeof(structs::BazaarWelcome_Struct);
|
||||||
in->pBuffer = (uchar *) buffer.get();
|
in->pBuffer = (uchar *)buffer;
|
||||||
|
|
||||||
LogTrading("(RoF2) WelcomeMessage action <green>[{}]", action);
|
LogTrading("(RoF2) WelcomeMessage action <green>[{}]", action);
|
||||||
dest->QueuePacket(in);
|
dest->QueuePacket(in);
|
||||||
|
safe_delete(in);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -587,15 +591,17 @@ namespace RoF2
|
|||||||
eq->entity_id = emu->entity_id;
|
eq->entity_id = emu->entity_id;
|
||||||
eq->trader_id = emu->trader_id;
|
eq->trader_id = emu->trader_id;
|
||||||
eq->zone_id = emu->zone_id;
|
eq->zone_id = emu->zone_id;
|
||||||
|
eq->zone_instance_id = emu->zone_instance_id;
|
||||||
strn0cpy(eq->trader_name, emu->trader_name, sizeof(eq->trader_name));
|
strn0cpy(eq->trader_name, emu->trader_name, sizeof(eq->trader_name));
|
||||||
|
|
||||||
LogTrading(
|
LogTrading(
|
||||||
"(RoF2) AddTraderToBazaarWindow action <green>[{}] trader_id <green>[{}] entity_id <green>[{}] zone_id <green>[{}]",
|
"(RoF2) AddTraderToBazaarWindow action <green>[{}] trader_id <green>[{}] entity_id <green>[{}] "
|
||||||
|
"zone_id <green>[{}] zone_instance_id <green>[{}]",
|
||||||
eq->action,
|
eq->action,
|
||||||
eq->trader_id,
|
eq->trader_id,
|
||||||
eq->entity_id,
|
eq->entity_id,
|
||||||
eq->zone_id
|
eq->zone_id,
|
||||||
);
|
eq->zone_instance_id);
|
||||||
dest->FastQueuePacket(&outapp);
|
dest->FastQueuePacket(&outapp);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -890,7 +896,9 @@ namespace RoF2
|
|||||||
VARSTRUCT_ENCODE_TYPE(uint16, eq, b.buyer_zone_instance_id);
|
VARSTRUCT_ENCODE_TYPE(uint16, eq, b.buyer_zone_instance_id);
|
||||||
VARSTRUCT_ENCODE_STRING(eq, b.buyer_name.c_str());
|
VARSTRUCT_ENCODE_STRING(eq, b.buyer_name.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
dest->QueuePacket(outapp.get());
|
dest->QueuePacket(outapp.get());
|
||||||
|
safe_delete(inapp);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Barter_RemoveFromMerchantWindow: {
|
case Barter_RemoveFromMerchantWindow: {
|
||||||
@@ -961,6 +969,7 @@ namespace RoF2
|
|||||||
VARSTRUCT_ENCODE_TYPE(uint32, eq, blsi.seller_quantity);
|
VARSTRUCT_ENCODE_TYPE(uint32, eq, blsi.seller_quantity);
|
||||||
|
|
||||||
dest->QueuePacket(outapp.get());
|
dest->QueuePacket(outapp.get());
|
||||||
|
safe_delete(inapp);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
@@ -1341,6 +1350,58 @@ namespace RoF2
|
|||||||
dest->FastQueuePacket(&in, ack_req);
|
dest->FastQueuePacket(&in, ack_req);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ENCODE(OP_EvolveItem)
|
||||||
|
{
|
||||||
|
EQApplicationPacket *in = *p;
|
||||||
|
*p = nullptr;
|
||||||
|
|
||||||
|
auto action = *reinterpret_cast<uint32 *>(in->pBuffer);
|
||||||
|
|
||||||
|
switch (action) {
|
||||||
|
case EvolvingItems::Actions::TRANSFER_WINDOW_DETAILS: {
|
||||||
|
auto emu = reinterpret_cast<EvolveItemMessaging *>(in->pBuffer);
|
||||||
|
|
||||||
|
EvolveXPWindowSend e{};
|
||||||
|
EQ::Util::MemoryStreamReader ss(emu->serialized_data, in->size - sizeof(emu->action));
|
||||||
|
cereal::BinaryInputArchive ar(ss);
|
||||||
|
ar(e);
|
||||||
|
|
||||||
|
auto item_1 = static_cast<const EQ::ItemInstance *>(reinterpret_cast<EQ::InternalSerializedItem_Struct
|
||||||
|
*>(e.serialize_item_1.data())->inst);
|
||||||
|
auto item_2 = static_cast<const EQ::ItemInstance *>(reinterpret_cast<EQ::InternalSerializedItem_Struct
|
||||||
|
*>(e.serialize_item_2.data())->inst);
|
||||||
|
|
||||||
|
EQ::OutBuffer ob;
|
||||||
|
|
||||||
|
SerializeItem(ob, item_1, 0, 0, ItemPacketMerchant);
|
||||||
|
SerializeItem(ob, item_2, 0, 0, ItemPacketMerchant);
|
||||||
|
|
||||||
|
auto out = std::make_unique<EQApplicationPacket>(
|
||||||
|
OP_EvolveItem,
|
||||||
|
sizeof(EvolveXPWindowSendDetails_Struct) + ob.size()
|
||||||
|
);
|
||||||
|
auto data = reinterpret_cast<EvolveXPWindowSendDetails_Struct *>(out->pBuffer);
|
||||||
|
|
||||||
|
data->action = e.action;
|
||||||
|
data->compatibility = e.compatibility;
|
||||||
|
data->max_transfer_level = e.max_transfer_level;
|
||||||
|
data->item1_unique_id = e.item1_unique_id;
|
||||||
|
data->item2_unique_id = e.item2_unique_id;
|
||||||
|
data->item1_present = e.item1_present;
|
||||||
|
data->item2_present = e.item2_present;
|
||||||
|
|
||||||
|
memcpy(data->serialize_data, ob.str().data(), ob.size());
|
||||||
|
dest->QueuePacket(out.get());
|
||||||
|
safe_delete(in);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
dest->FastQueuePacket(&in);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ENCODE(OP_ExpansionInfo)
|
ENCODE(OP_ExpansionInfo)
|
||||||
{
|
{
|
||||||
ENCODE_LENGTH_EXACT(ExpansionInfo_Struct);
|
ENCODE_LENGTH_EXACT(ExpansionInfo_Struct);
|
||||||
@@ -1843,11 +1904,11 @@ namespace RoF2
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto outapp = new EQApplicationPacket(OP_GuildsList);
|
safe_delete_array(in->pBuffer);
|
||||||
outapp->size = packet_size;
|
|
||||||
outapp->pBuffer = buffer;
|
|
||||||
|
|
||||||
dest->FastQueuePacket(&outapp);
|
in->pBuffer = buffer;
|
||||||
|
in->size = packet_size;
|
||||||
|
dest->FastQueuePacket(&in);
|
||||||
}
|
}
|
||||||
|
|
||||||
ENCODE(OP_GuildTributeDonateItem)
|
ENCODE(OP_GuildTributeDonateItem)
|
||||||
@@ -2044,6 +2105,33 @@ namespace RoF2
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ENCODE(OP_ItemPreviewRequest)
|
||||||
|
{
|
||||||
|
EQApplicationPacket* in = *p;
|
||||||
|
*p = nullptr;
|
||||||
|
|
||||||
|
uchar* in_buf = in->pBuffer;
|
||||||
|
|
||||||
|
auto int_item = (EQ::InternalSerializedItem_Struct*) in_buf;
|
||||||
|
|
||||||
|
EQ::OutBuffer buf;
|
||||||
|
EQ::OutBuffer::pos_type last_pos = buf.tellp();
|
||||||
|
|
||||||
|
SerializeItem(buf, (const EQ::ItemInstance*) int_item->inst, int_item->slot_id, 0, ItemPacketInvalid);
|
||||||
|
if (buf.tellp() == last_pos) {
|
||||||
|
LogNetcode("RoF2::ENCODE(OP_ItemPreviewRequest) Serialization failed");
|
||||||
|
safe_delete_array(in_buf);
|
||||||
|
safe_delete(in);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
in->size = buf.size();
|
||||||
|
in->pBuffer = buf.detach();
|
||||||
|
|
||||||
|
safe_delete_array(in_buf);
|
||||||
|
dest->FastQueuePacket(&in, ack_req);
|
||||||
|
}
|
||||||
|
|
||||||
ENCODE(OP_ItemVerifyReply)
|
ENCODE(OP_ItemVerifyReply)
|
||||||
{
|
{
|
||||||
ENCODE_LENGTH_EXACT(ItemVerifyReply_Struct);
|
ENCODE_LENGTH_EXACT(ItemVerifyReply_Struct);
|
||||||
@@ -2680,7 +2768,7 @@ namespace RoF2
|
|||||||
{
|
{
|
||||||
float instrument_mod = 0.0f;
|
float instrument_mod = 0.0f;
|
||||||
uint8 effect_type = emu->buffs[r].effect_type;
|
uint8 effect_type = emu->buffs[r].effect_type;
|
||||||
uint32 player_id = emu->buffs[r].player_id;
|
uint32 player_id = emu->buffs[r].player_id;;
|
||||||
|
|
||||||
if (emu->buffs[r].spellid != 0xFFFF && emu->buffs[r].spellid != 0)
|
if (emu->buffs[r].spellid != 0xFFFF && emu->buffs[r].spellid != 0)
|
||||||
{
|
{
|
||||||
@@ -3603,21 +3691,6 @@ namespace RoF2
|
|||||||
FINISH_ENCODE();
|
FINISH_ENCODE();
|
||||||
}
|
}
|
||||||
|
|
||||||
ENCODE(OP_ShopRequest)
|
|
||||||
{
|
|
||||||
ENCODE_LENGTH_EXACT(MerchantClick_Struct);
|
|
||||||
SETUP_DIRECT_ENCODE(MerchantClick_Struct, structs::MerchantClick_Struct);
|
|
||||||
|
|
||||||
OUT(npc_id);
|
|
||||||
OUT(player_id);
|
|
||||||
OUT(command);
|
|
||||||
OUT(rate);
|
|
||||||
OUT(tab_display);
|
|
||||||
eq->unknown02 = emu->unknown020;
|
|
||||||
|
|
||||||
FINISH_ENCODE();
|
|
||||||
}
|
|
||||||
|
|
||||||
ENCODE(OP_SkillUpdate)
|
ENCODE(OP_SkillUpdate)
|
||||||
{
|
{
|
||||||
ENCODE_LENGTH_EXACT(SkillUpdate_Struct);
|
ENCODE_LENGTH_EXACT(SkillUpdate_Struct);
|
||||||
@@ -6008,21 +6081,6 @@ namespace RoF2
|
|||||||
FINISH_DIRECT_DECODE();
|
FINISH_DIRECT_DECODE();
|
||||||
}
|
}
|
||||||
|
|
||||||
DECODE(OP_ShopRequest)
|
|
||||||
{
|
|
||||||
DECODE_LENGTH_EXACT(structs::MerchantClick_Struct);
|
|
||||||
SETUP_DIRECT_DECODE(MerchantClick_Struct, structs::MerchantClick_Struct);
|
|
||||||
|
|
||||||
IN(npc_id);
|
|
||||||
IN(player_id);
|
|
||||||
IN(command);
|
|
||||||
IN(rate);
|
|
||||||
IN(tab_display);
|
|
||||||
emu->unknown020 = 0;
|
|
||||||
|
|
||||||
FINISH_DIRECT_DECODE();
|
|
||||||
}
|
|
||||||
|
|
||||||
DECODE(OP_Save)
|
DECODE(OP_Save)
|
||||||
{
|
{
|
||||||
DECODE_LENGTH_EXACT(structs::Save_Struct);
|
DECODE_LENGTH_EXACT(structs::Save_Struct);
|
||||||
@@ -6248,6 +6306,11 @@ namespace RoF2
|
|||||||
FINISH_DIRECT_DECODE();
|
FINISH_DIRECT_DECODE();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case structs::RoF2BazaarTraderBuyerActions::FirstOpenSearch: {
|
||||||
|
__packet->SetOpcode(OP_BazaarSearch);
|
||||||
|
LogTrading("(RoF2) First time opening Bazaar Search since zoning. Action <green>[{}]", action);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case structs::RoF2BazaarTraderBuyerActions::WelcomeMessage: {
|
case structs::RoF2BazaarTraderBuyerActions::WelcomeMessage: {
|
||||||
__packet->SetOpcode(OP_BazaarSearch);
|
__packet->SetOpcode(OP_BazaarSearch);
|
||||||
LogTrading("(RoF2) WelcomeMessage action <green>[{}]", action);
|
LogTrading("(RoF2) WelcomeMessage action <green>[{}]", action);
|
||||||
@@ -6388,9 +6451,18 @@ namespace RoF2
|
|||||||
//sprintf(hdr.unknown000, "06e0002Y1W00");
|
//sprintf(hdr.unknown000, "06e0002Y1W00");
|
||||||
strn0cpy(hdr.unknown000, fmt::format("{:016}\0", inst->GetSerialNumber()).c_str(),sizeof(hdr.unknown000));
|
strn0cpy(hdr.unknown000, fmt::format("{:016}\0", inst->GetSerialNumber()).c_str(),sizeof(hdr.unknown000));
|
||||||
|
|
||||||
hdr.stacksize =
|
hdr.stacksize = 1;
|
||||||
item->ID == PARCEL_MONEY_ITEM_ID ? inst->GetPrice() : (inst->IsStackable() ? ((inst->GetCharges() > 1000)
|
|
||||||
? 0xFFFFFFFF : inst->GetCharges()) : 1);
|
if (item->ID == PARCEL_MONEY_ITEM_ID) {
|
||||||
|
hdr.stacksize = inst->GetPrice();
|
||||||
|
} else if (inst->IsStackable()) {
|
||||||
|
if (inst->GetCharges() > std::numeric_limits<int16>::max()) {
|
||||||
|
hdr.stacksize = std::numeric_limits<uint32>::max();
|
||||||
|
} else {
|
||||||
|
hdr.stacksize = inst->GetCharges();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
hdr.unknown004 = 0;
|
hdr.unknown004 = 0;
|
||||||
|
|
||||||
structs::InventorySlot_Struct slot_id{};
|
structs::InventorySlot_Struct slot_id{};
|
||||||
@@ -6412,6 +6484,11 @@ namespace RoF2
|
|||||||
hdr.scaled_value = (inst->IsScaling() ? (inst->GetExp() / 100) : 0);
|
hdr.scaled_value = (inst->IsScaling() ? (inst->GetExp() / 100) : 0);
|
||||||
hdr.instance_id = (inst->GetMerchantSlot() ? inst->GetMerchantSlot() : inst->GetSerialNumber());
|
hdr.instance_id = (inst->GetMerchantSlot() ? inst->GetMerchantSlot() : inst->GetSerialNumber());
|
||||||
hdr.parcel_item_id = packet_type == ItemPacketParcel ? inst->GetID() : 0;
|
hdr.parcel_item_id = packet_type == ItemPacketParcel ? inst->GetID() : 0;
|
||||||
|
if (item->EvolvingItem) {
|
||||||
|
hdr.instance_id = inst->GetEvolveUniqueID() & 0xFFFFFFFF; //lower dword
|
||||||
|
hdr.parcel_item_id = inst->GetEvolveUniqueID() >> 32; //upper dword
|
||||||
|
}
|
||||||
|
|
||||||
hdr.last_cast_time = inst->GetRecastTimestamp();
|
hdr.last_cast_time = inst->GetRecastTimestamp();
|
||||||
hdr.charges = (inst->IsStackable() ? (item->MaxCharges ? 1 : 0) : ((inst->GetCharges() > 254)
|
hdr.charges = (inst->IsStackable() ? (item->MaxCharges ? 1 : 0) : ((inst->GetCharges() > 254)
|
||||||
? 0xFFFFFFFF
|
? 0xFFFFFFFF
|
||||||
@@ -6425,18 +6502,15 @@ namespace RoF2
|
|||||||
ob.write((const char*)&hdr, sizeof(RoF2::structs::ItemSerializationHeader));
|
ob.write((const char*)&hdr, sizeof(RoF2::structs::ItemSerializationHeader));
|
||||||
|
|
||||||
if (item->EvolvingItem > 0) {
|
if (item->EvolvingItem > 0) {
|
||||||
RoF2::structs::EvolvingItem evotop;
|
RoF2::structs::EvolvingItem_Struct evotop;
|
||||||
|
|
||||||
evotop.unknown001 = 0;
|
evotop.final_item_id = inst->GetEvolveFinalItemID();
|
||||||
evotop.unknown002 = 0;
|
evotop.evolve_level = item->EvolvingLevel;
|
||||||
evotop.unknown003 = 0;
|
evotop.progress = inst->GetEvolveProgression();
|
||||||
evotop.unknown004 = 0;
|
evotop.activated = inst->GetEvolveActivated();
|
||||||
evotop.evoLevel = item->EvolvingLevel;
|
evotop.evolve_max_level = item->EvolvingMax;
|
||||||
evotop.progress = 0;
|
|
||||||
evotop.Activated = 1;
|
|
||||||
evotop.evomaxlevel = item->EvolvingMax;
|
|
||||||
|
|
||||||
ob.write((const char*)&evotop, sizeof(RoF2::structs::EvolvingItem));
|
ob.write((const char*)&evotop, sizeof(RoF2::structs::EvolvingItem_Struct));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -6810,12 +6884,13 @@ namespace RoF2
|
|||||||
iqbs.Heirloom = 0;
|
iqbs.Heirloom = 0;
|
||||||
iqbs.Placeable = 0;
|
iqbs.Placeable = 0;
|
||||||
iqbs.unknown28 = -1;
|
iqbs.unknown28 = -1;
|
||||||
|
iqbs.unknown29 = packet_type == ItemPacketInvalid ? 0xFF : 0;
|
||||||
iqbs.unknown30 = -1;
|
iqbs.unknown30 = -1;
|
||||||
iqbs.NoZone = 0;
|
iqbs.NoZone = 0;
|
||||||
iqbs.NoGround = 0;
|
iqbs.NoGround = 0;
|
||||||
iqbs.unknown37a = 0; // (guessed position) New to RoF2
|
iqbs.unknown37a = 0; // (guessed position) New to RoF2
|
||||||
iqbs.unknown38 = 0;
|
iqbs.unknown38 = 0;
|
||||||
iqbs.unknown39 = 1;
|
iqbs.unknown39 = packet_type == ItemPacketInvalid ? 0 : 1;;
|
||||||
|
|
||||||
ob.write((const char*)&iqbs, sizeof(RoF2::structs::ItemQuaternaryBodyStruct));
|
ob.write((const char*)&iqbs, sizeof(RoF2::structs::ItemQuaternaryBodyStruct));
|
||||||
|
|
||||||
|
|||||||
@@ -272,6 +272,7 @@ namespace RoF2
|
|||||||
|
|
||||||
const size_t SAY_LINK_BODY_SIZE = 56;
|
const size_t SAY_LINK_BODY_SIZE = 56;
|
||||||
const uint32 MAX_GUILD_ID = 50000;
|
const uint32 MAX_GUILD_ID = 50000;
|
||||||
|
const uint32 MAX_BAZAAR_TRADERS = 600;
|
||||||
|
|
||||||
} /*constants*/
|
} /*constants*/
|
||||||
|
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ E(OP_DzMemberListName)
|
|||||||
E(OP_DzMemberListStatus)
|
E(OP_DzMemberListStatus)
|
||||||
E(OP_DzSetLeaderName)
|
E(OP_DzSetLeaderName)
|
||||||
E(OP_Emote)
|
E(OP_Emote)
|
||||||
|
E(OP_EvolveItem)
|
||||||
E(OP_ExpansionInfo)
|
E(OP_ExpansionInfo)
|
||||||
E(OP_FormattedMessage)
|
E(OP_FormattedMessage)
|
||||||
E(OP_GMLastName)
|
E(OP_GMLastName)
|
||||||
@@ -91,6 +92,7 @@ E(OP_InspectBuffs)
|
|||||||
E(OP_InspectRequest)
|
E(OP_InspectRequest)
|
||||||
E(OP_ItemLinkResponse)
|
E(OP_ItemLinkResponse)
|
||||||
E(OP_ItemPacket)
|
E(OP_ItemPacket)
|
||||||
|
E(OP_ItemPreviewRequest)
|
||||||
E(OP_ItemVerifyReply)
|
E(OP_ItemVerifyReply)
|
||||||
E(OP_LeadershipExpUpdate)
|
E(OP_LeadershipExpUpdate)
|
||||||
E(OP_LogServer)
|
E(OP_LogServer)
|
||||||
@@ -118,7 +120,6 @@ E(OP_SendZonepoints)
|
|||||||
E(OP_SetGuildRank)
|
E(OP_SetGuildRank)
|
||||||
E(OP_ShopPlayerBuy)
|
E(OP_ShopPlayerBuy)
|
||||||
E(OP_ShopPlayerSell)
|
E(OP_ShopPlayerSell)
|
||||||
E(OP_ShopRequest)
|
|
||||||
E(OP_SkillUpdate)
|
E(OP_SkillUpdate)
|
||||||
E(OP_SomeItemPacketMaybe)
|
E(OP_SomeItemPacketMaybe)
|
||||||
E(OP_SpawnAppearance)
|
E(OP_SpawnAppearance)
|
||||||
@@ -204,7 +205,6 @@ D(OP_Save)
|
|||||||
D(OP_SetServerFilter)
|
D(OP_SetServerFilter)
|
||||||
D(OP_ShopPlayerBuy)
|
D(OP_ShopPlayerBuy)
|
||||||
D(OP_ShopPlayerSell)
|
D(OP_ShopPlayerSell)
|
||||||
D(OP_ShopRequest)
|
|
||||||
D(OP_ShopSendParcel)
|
D(OP_ShopSendParcel)
|
||||||
D(OP_Trader)
|
D(OP_Trader)
|
||||||
D(OP_TraderBuy)
|
D(OP_TraderBuy)
|
||||||
|
|||||||
@@ -3119,7 +3119,8 @@ enum RoF2BazaarTraderBuyerActions {
|
|||||||
BazaarInspect = 18,
|
BazaarInspect = 18,
|
||||||
ClickTrader = 28,
|
ClickTrader = 28,
|
||||||
ItemMove = 19,
|
ItemMove = 19,
|
||||||
ReconcileItems = 20
|
ReconcileItems = 20,
|
||||||
|
FirstOpenSearch = 26
|
||||||
};
|
};
|
||||||
|
|
||||||
enum RoF2BuyerActions {
|
enum RoF2BuyerActions {
|
||||||
@@ -4745,15 +4746,12 @@ struct ItemSerializationHeader
|
|||||||
uint8 isEvolving;
|
uint8 isEvolving;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct EvolvingItem {
|
struct EvolvingItem_Struct {
|
||||||
uint8 unknown001;
|
uint32 final_item_id;
|
||||||
uint8 unknown002;
|
int32 evolve_level;
|
||||||
uint8 unknown003;
|
|
||||||
uint8 unknown004;
|
|
||||||
int32 evoLevel;
|
|
||||||
double progress;
|
double progress;
|
||||||
uint8 Activated;
|
uint8 activated;
|
||||||
int32 evomaxlevel;
|
int32 evolve_max_level;
|
||||||
uint8 unknown005[4];
|
uint8 unknown005[4];
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -5427,6 +5425,32 @@ struct Parcel_Struct
|
|||||||
};
|
};
|
||||||
}; /*structs*/
|
}; /*structs*/
|
||||||
|
|
||||||
|
struct EvolveItemToggle_Struct {
|
||||||
|
uint32 action;
|
||||||
|
uint32 unknown_004;
|
||||||
|
uint64 unique_id;
|
||||||
|
uint32 percentage;
|
||||||
|
uint32 activated;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct EvolveXPWindowReceive_Struct {
|
||||||
|
uint32 action;
|
||||||
|
uint32 unknown_004;
|
||||||
|
uint64 item1_unique_id;
|
||||||
|
uint64 item2_unique_id;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct EvolveXPWindowSendDetails_Struct {
|
||||||
|
/*000*/ uint32 action;
|
||||||
|
/*004*/ uint64 item1_unique_id;
|
||||||
|
/*012*/ uint64 item2_unique_id;
|
||||||
|
/*020*/ uint32 compatibility;
|
||||||
|
/*024*/ uint32 max_transfer_level;
|
||||||
|
/*028*/ uint8 item1_present;
|
||||||
|
/*029*/ uint8 item2_present;
|
||||||
|
/*030*/ char serialize_data[];
|
||||||
|
};
|
||||||
|
|
||||||
}; /*RoF2*/
|
}; /*RoF2*/
|
||||||
|
|
||||||
#endif /*COMMON_ROF2_STRUCTS_H*/
|
#endif /*COMMON_ROF2_STRUCTS_H*/
|
||||||
|
|||||||
+48
-62
@@ -5,31 +5,19 @@
|
|||||||
#include "strings.h"
|
#include "strings.h"
|
||||||
|
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
|
|
||||||
namespace fs = std::filesystem;
|
namespace fs = std::filesystem;
|
||||||
|
|
||||||
inline std::string striptrailingslash(const std::string &file_path)
|
|
||||||
{
|
|
||||||
if (file_path.back() == '/' || file_path.back() == '\\') {
|
|
||||||
return file_path.substr(0, file_path.length() - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
return file_path;
|
|
||||||
}
|
|
||||||
|
|
||||||
void PathManager::LoadPaths()
|
void PathManager::LoadPaths()
|
||||||
{
|
{
|
||||||
m_server_path = File::FindEqemuConfigPath();
|
m_server_path = File::FindEqemuConfigPath();
|
||||||
|
|
||||||
if (!m_server_path.empty()) {
|
|
||||||
std::filesystem::current_path(m_server_path);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_server_path.empty()) {
|
if (m_server_path.empty()) {
|
||||||
LogInfo("Failed to load server path");
|
LogInfo("Failed to load server path");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LogInfo("server [{}]", m_server_path);
|
std::filesystem::current_path(m_server_path);
|
||||||
|
|
||||||
if (!EQEmuConfig::LoadConfig()) {
|
if (!EQEmuConfig::LoadConfig()) {
|
||||||
LogError("Failed to load eqemu config");
|
LogError("Failed to load eqemu config");
|
||||||
@@ -38,66 +26,64 @@ void PathManager::LoadPaths()
|
|||||||
|
|
||||||
const auto c = EQEmuConfig::get();
|
const auto c = EQEmuConfig::get();
|
||||||
|
|
||||||
// maps
|
auto resolve_path = [&](const std::string& dir, const std::vector<std::string>& fallback_dirs = {}) -> std::string {
|
||||||
if (File::Exists(fs::path{m_server_path + "/" + c->MapDir}.string())) {
|
// relative
|
||||||
m_maps_path = fs::relative(fs::path{m_server_path + "/" + c->MapDir}).string();
|
if (File::Exists((fs::path{m_server_path} / dir).string())) {
|
||||||
}
|
return fs::relative(fs::path{m_server_path} / dir).lexically_normal().string();
|
||||||
else if (File::Exists(fs::path{m_server_path + "/maps"}.string())) {
|
|
||||||
m_maps_path = fs::relative(fs::path{m_server_path + "/maps"}).string();
|
|
||||||
}
|
|
||||||
else if (File::Exists(fs::path{m_server_path + "/Maps"}.string())) {
|
|
||||||
m_maps_path = fs::relative(fs::path{m_server_path + "/Maps"}).string();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// quests
|
// absolute
|
||||||
if (File::Exists(fs::path{m_server_path + "/" + c->QuestDir}.string())) {
|
if (File::Exists(fs::path{dir}.string())) {
|
||||||
m_quests_path = fs::relative(fs::path{m_server_path + "/" + c->QuestDir}).string();
|
return fs::absolute(fs::path{dir}).string();
|
||||||
}
|
}
|
||||||
|
|
||||||
// plugins
|
// fallback search options if specified
|
||||||
if (File::Exists(fs::path{m_server_path + "/" + c->PluginDir}.string())) {
|
for (const auto& fallback : fallback_dirs) {
|
||||||
m_plugins_path = fs::relative(fs::path{m_server_path + "/" + c->PluginDir}).string();
|
if (File::Exists((fs::path{m_server_path} / fallback).string())) {
|
||||||
|
return fs::relative(fs::path{m_server_path} / fallback).lexically_normal().string();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// lua_modules
|
// if all else fails, just set it to the config value
|
||||||
if (File::Exists(fs::path{m_server_path + "/" + c->LuaModuleDir}.string())) {
|
return dir;
|
||||||
m_lua_modules_path = fs::relative(fs::path{m_server_path + "/" + c->LuaModuleDir}).string();
|
};
|
||||||
}
|
|
||||||
|
|
||||||
// lua mods
|
m_maps_path = resolve_path(c->MapDir, {"maps", "Maps"});
|
||||||
if (File::Exists(fs::path{ m_server_path + "/mods" }.string())) {
|
m_quests_path = resolve_path(c->QuestDir);
|
||||||
m_lua_mods_path = fs::relative(fs::path{ m_server_path + "/mods" }).string();
|
m_plugins_path = resolve_path(c->PluginDir);
|
||||||
}
|
m_lua_modules_path = resolve_path(c->LuaModuleDir);
|
||||||
|
m_lua_mods_path = resolve_path("mods");
|
||||||
|
m_patch_path = resolve_path(c->PatchDir);
|
||||||
|
m_opcode_path = resolve_path(c->OpcodeDir);
|
||||||
|
m_shared_memory_path = resolve_path(c->SharedMemDir);
|
||||||
|
m_log_path = resolve_path(c->LogDir, {"logs"});
|
||||||
|
|
||||||
// patches
|
// Log all paths in a loop
|
||||||
if (File::Exists(fs::path{m_server_path + "/" + c->PatchDir}.string())) {
|
std::vector<std::pair<std::string, std::string>> paths = {
|
||||||
m_patch_path = fs::relative(fs::path{m_server_path + "/" + c->PatchDir}).string();
|
{"server", m_server_path},
|
||||||
}
|
{"logs", m_log_path},
|
||||||
|
{"lua mods", m_lua_mods_path},
|
||||||
|
{"lua_modules", m_lua_modules_path},
|
||||||
|
{"maps", m_maps_path},
|
||||||
|
{"patches", m_patch_path},
|
||||||
|
{"opcode", m_opcode_path},
|
||||||
|
{"plugins", m_plugins_path},
|
||||||
|
{"quests", m_quests_path},
|
||||||
|
{"shared_memory", m_shared_memory_path}
|
||||||
|
};
|
||||||
|
|
||||||
// patches
|
constexpr int name_width = 15;
|
||||||
if (File::Exists(fs::path{ m_server_path + "/" + c->OpcodeDir }.string())) {
|
constexpr int path_width = 0;
|
||||||
m_opcode_path = fs::relative(fs::path{ m_server_path + "/" + c->OpcodeDir }).string();
|
constexpr int break_length = 70;
|
||||||
}
|
|
||||||
|
|
||||||
// shared_memory_path
|
std::cout << std::endl;
|
||||||
if (File::Exists(fs::path{m_server_path + "/" + c->SharedMemDir}.string())) {
|
LogInfo("{}", Strings::Repeat("-", break_length));
|
||||||
m_shared_memory_path = fs::relative(fs::path{ m_server_path + "/" + c->SharedMemDir }).string();
|
for (const auto& [name, in_path] : paths) {
|
||||||
|
if (!in_path.empty()) {
|
||||||
|
LogInfo("{:>{}} > [{:<{}}]", name, name_width, in_path, path_width);
|
||||||
}
|
}
|
||||||
|
|
||||||
// logging path
|
|
||||||
if (File::Exists(fs::path{m_server_path + "/" + c->LogDir}.string())) {
|
|
||||||
m_log_path = fs::relative(fs::path{m_server_path + "/" + c->LogDir}).string();
|
|
||||||
}
|
}
|
||||||
|
LogInfo("{}", Strings::Repeat("-", break_length));
|
||||||
LogInfo("logs path [{}]", m_log_path);
|
|
||||||
LogInfo("lua mods path [{}]", m_lua_mods_path);
|
|
||||||
LogInfo("lua_modules path [{}]", m_lua_modules_path);
|
|
||||||
LogInfo("maps path [{}]", m_maps_path);
|
|
||||||
LogInfo("patches path [{}]", m_patch_path);
|
|
||||||
LogInfo("opcode path [{}]", m_opcode_path);
|
|
||||||
LogInfo("plugins path [{}]", m_plugins_path);
|
|
||||||
LogInfo("quests path [{}]", m_quests_path);
|
|
||||||
LogInfo("shared_memory path [{}]", m_shared_memory_path);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string &PathManager::GetServerPath() const
|
const std::string &PathManager::GetServerPath() const
|
||||||
|
|||||||
@@ -49,23 +49,23 @@ public:
|
|||||||
std::string field;
|
std::string field;
|
||||||
|
|
||||||
switch (theme_id) {
|
switch (theme_id) {
|
||||||
case LDoNThemes::GUK: {
|
case LDoNTheme::GUK: {
|
||||||
field = "guk_";
|
field = "guk_";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case LDoNThemes::MIR: {
|
case LDoNTheme::MIR: {
|
||||||
field = "mir_";
|
field = "mir_";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case LDoNThemes::MMC: {
|
case LDoNTheme::MMC: {
|
||||||
field = "mmc_";
|
field = "mmc_";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case LDoNThemes::RUJ: {
|
case LDoNTheme::RUJ: {
|
||||||
field = "ruj_";
|
field = "ruj_";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case LDoNThemes::TAK: {
|
case LDoNTheme::TAK: {
|
||||||
field = "tak_";
|
field = "tak_";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,475 @@
|
|||||||
|
/**
|
||||||
|
* DO NOT MODIFY THIS FILE
|
||||||
|
*
|
||||||
|
* This repository was automatically generated and is NOT to be modified directly.
|
||||||
|
* Any repository modifications are meant to be made to the repository extending the base.
|
||||||
|
* Any modifications to base repositories are to be made by the generator only
|
||||||
|
*
|
||||||
|
* @generator ./utils/scripts/generators/repository-generator.pl
|
||||||
|
* @docs https://docs.eqemu.io/developer/repositories
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef EQEMU_BASE_CHARACTER_EVOLVING_ITEMS_REPOSITORY_H
|
||||||
|
#define EQEMU_BASE_CHARACTER_EVOLVING_ITEMS_REPOSITORY_H
|
||||||
|
|
||||||
|
#include "../../database.h"
|
||||||
|
#include "../../strings.h"
|
||||||
|
#include <ctime>
|
||||||
|
|
||||||
|
class BaseCharacterEvolvingItemsRepository {
|
||||||
|
public:
|
||||||
|
struct CharacterEvolvingItems {
|
||||||
|
uint64_t id;
|
||||||
|
uint32_t character_id;
|
||||||
|
uint32_t item_id;
|
||||||
|
uint8_t activated;
|
||||||
|
uint8_t equipped;
|
||||||
|
int64_t current_amount;
|
||||||
|
double progression;
|
||||||
|
uint32_t final_item_id;
|
||||||
|
time_t deleted_at;
|
||||||
|
};
|
||||||
|
|
||||||
|
static std::string PrimaryKey()
|
||||||
|
{
|
||||||
|
return std::string("id");
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> Columns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"id",
|
||||||
|
"character_id",
|
||||||
|
"item_id",
|
||||||
|
"activated",
|
||||||
|
"equipped",
|
||||||
|
"current_amount",
|
||||||
|
"progression",
|
||||||
|
"final_item_id",
|
||||||
|
"deleted_at",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> SelectColumns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"id",
|
||||||
|
"character_id",
|
||||||
|
"item_id",
|
||||||
|
"activated",
|
||||||
|
"equipped",
|
||||||
|
"current_amount",
|
||||||
|
"progression",
|
||||||
|
"final_item_id",
|
||||||
|
"UNIX_TIMESTAMP(deleted_at)",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string ColumnsRaw()
|
||||||
|
{
|
||||||
|
return std::string(Strings::Implode(", ", Columns()));
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string SelectColumnsRaw()
|
||||||
|
{
|
||||||
|
return std::string(Strings::Implode(", ", SelectColumns()));
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string TableName()
|
||||||
|
{
|
||||||
|
return std::string("character_evolving_items");
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string BaseSelect()
|
||||||
|
{
|
||||||
|
return fmt::format(
|
||||||
|
"SELECT {} FROM {}",
|
||||||
|
SelectColumnsRaw(),
|
||||||
|
TableName()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string BaseInsert()
|
||||||
|
{
|
||||||
|
return fmt::format(
|
||||||
|
"INSERT INTO {} ({}) ",
|
||||||
|
TableName(),
|
||||||
|
ColumnsRaw()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static CharacterEvolvingItems NewEntity()
|
||||||
|
{
|
||||||
|
CharacterEvolvingItems e{};
|
||||||
|
|
||||||
|
e.id = 0;
|
||||||
|
e.character_id = 0;
|
||||||
|
e.item_id = 0;
|
||||||
|
e.activated = 0;
|
||||||
|
e.equipped = 0;
|
||||||
|
e.current_amount = 0;
|
||||||
|
e.progression = 0;
|
||||||
|
e.final_item_id = 0;
|
||||||
|
e.deleted_at = 0;
|
||||||
|
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
static CharacterEvolvingItems GetCharacterEvolvingItems(
|
||||||
|
const std::vector<CharacterEvolvingItems> &character_evolving_itemss,
|
||||||
|
int character_evolving_items_id
|
||||||
|
)
|
||||||
|
{
|
||||||
|
for (auto &character_evolving_items : character_evolving_itemss) {
|
||||||
|
if (character_evolving_items.id == character_evolving_items_id) {
|
||||||
|
return character_evolving_items;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return NewEntity();
|
||||||
|
}
|
||||||
|
|
||||||
|
static CharacterEvolvingItems FindOne(
|
||||||
|
Database& db,
|
||||||
|
int character_evolving_items_id
|
||||||
|
)
|
||||||
|
{
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{} WHERE {} = {} LIMIT 1",
|
||||||
|
BaseSelect(),
|
||||||
|
PrimaryKey(),
|
||||||
|
character_evolving_items_id
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
auto row = results.begin();
|
||||||
|
if (results.RowCount() == 1) {
|
||||||
|
CharacterEvolvingItems e{};
|
||||||
|
|
||||||
|
e.id = row[0] ? strtoull(row[0], nullptr, 10) : 0;
|
||||||
|
e.character_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||||
|
e.item_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||||
|
e.activated = row[3] ? static_cast<uint8_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||||
|
e.equipped = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||||
|
e.current_amount = row[5] ? strtoll(row[5], nullptr, 10) : 0;
|
||||||
|
e.progression = row[6] ? strtod(row[6], nullptr) : 0;
|
||||||
|
e.final_item_id = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
|
||||||
|
e.deleted_at = strtoll(row[8] ? row[8] : "-1", nullptr, 10);
|
||||||
|
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NewEntity();
|
||||||
|
}
|
||||||
|
|
||||||
|
static int DeleteOne(
|
||||||
|
Database& db,
|
||||||
|
int character_evolving_items_id
|
||||||
|
)
|
||||||
|
{
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"DELETE FROM {} WHERE {} = {}",
|
||||||
|
TableName(),
|
||||||
|
PrimaryKey(),
|
||||||
|
character_evolving_items_id
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() ? results.RowsAffected() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int UpdateOne(
|
||||||
|
Database& db,
|
||||||
|
const CharacterEvolvingItems &e
|
||||||
|
)
|
||||||
|
{
|
||||||
|
std::vector<std::string> v;
|
||||||
|
|
||||||
|
auto columns = Columns();
|
||||||
|
|
||||||
|
v.push_back(columns[1] + " = " + std::to_string(e.character_id));
|
||||||
|
v.push_back(columns[2] + " = " + std::to_string(e.item_id));
|
||||||
|
v.push_back(columns[3] + " = " + std::to_string(e.activated));
|
||||||
|
v.push_back(columns[4] + " = " + std::to_string(e.equipped));
|
||||||
|
v.push_back(columns[5] + " = " + std::to_string(e.current_amount));
|
||||||
|
v.push_back(columns[6] + " = " + std::to_string(e.progression));
|
||||||
|
v.push_back(columns[7] + " = " + std::to_string(e.final_item_id));
|
||||||
|
v.push_back(columns[8] + " = FROM_UNIXTIME(" + (e.deleted_at > 0 ? std::to_string(e.deleted_at) : "null") + ")");
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"UPDATE {} SET {} WHERE {} = {}",
|
||||||
|
TableName(),
|
||||||
|
Strings::Implode(", ", v),
|
||||||
|
PrimaryKey(),
|
||||||
|
e.id
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() ? results.RowsAffected() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static CharacterEvolvingItems InsertOne(
|
||||||
|
Database& db,
|
||||||
|
CharacterEvolvingItems e
|
||||||
|
)
|
||||||
|
{
|
||||||
|
std::vector<std::string> v;
|
||||||
|
|
||||||
|
v.push_back(std::to_string(e.id));
|
||||||
|
v.push_back(std::to_string(e.character_id));
|
||||||
|
v.push_back(std::to_string(e.item_id));
|
||||||
|
v.push_back(std::to_string(e.activated));
|
||||||
|
v.push_back(std::to_string(e.equipped));
|
||||||
|
v.push_back(std::to_string(e.current_amount));
|
||||||
|
v.push_back(std::to_string(e.progression));
|
||||||
|
v.push_back(std::to_string(e.final_item_id));
|
||||||
|
v.push_back("FROM_UNIXTIME(" + (e.deleted_at > 0 ? std::to_string(e.deleted_at) : "null") + ")");
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{} VALUES ({})",
|
||||||
|
BaseInsert(),
|
||||||
|
Strings::Implode(",", v)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (results.Success()) {
|
||||||
|
e.id = results.LastInsertedID();
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
e = NewEntity();
|
||||||
|
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int InsertMany(
|
||||||
|
Database& db,
|
||||||
|
const std::vector<CharacterEvolvingItems> &entries
|
||||||
|
)
|
||||||
|
{
|
||||||
|
std::vector<std::string> insert_chunks;
|
||||||
|
|
||||||
|
for (auto &e: entries) {
|
||||||
|
std::vector<std::string> v;
|
||||||
|
|
||||||
|
v.push_back(std::to_string(e.id));
|
||||||
|
v.push_back(std::to_string(e.character_id));
|
||||||
|
v.push_back(std::to_string(e.item_id));
|
||||||
|
v.push_back(std::to_string(e.activated));
|
||||||
|
v.push_back(std::to_string(e.equipped));
|
||||||
|
v.push_back(std::to_string(e.current_amount));
|
||||||
|
v.push_back(std::to_string(e.progression));
|
||||||
|
v.push_back(std::to_string(e.final_item_id));
|
||||||
|
v.push_back("FROM_UNIXTIME(" + (e.deleted_at > 0 ? std::to_string(e.deleted_at) : "null") + ")");
|
||||||
|
|
||||||
|
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<std::string> v;
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{} VALUES {}",
|
||||||
|
BaseInsert(),
|
||||||
|
Strings::Implode(",", insert_chunks)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() ? results.RowsAffected() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::vector<CharacterEvolvingItems> All(Database& db)
|
||||||
|
{
|
||||||
|
std::vector<CharacterEvolvingItems> all_entries;
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{}",
|
||||||
|
BaseSelect()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
all_entries.reserve(results.RowCount());
|
||||||
|
|
||||||
|
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||||
|
CharacterEvolvingItems e{};
|
||||||
|
|
||||||
|
e.id = row[0] ? strtoull(row[0], nullptr, 10) : 0;
|
||||||
|
e.character_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||||
|
e.item_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||||
|
e.activated = row[3] ? static_cast<uint8_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||||
|
e.equipped = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||||
|
e.current_amount = row[5] ? strtoll(row[5], nullptr, 10) : 0;
|
||||||
|
e.progression = row[6] ? strtod(row[6], nullptr) : 0;
|
||||||
|
e.final_item_id = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
|
||||||
|
e.deleted_at = strtoll(row[8] ? row[8] : "-1", nullptr, 10);
|
||||||
|
|
||||||
|
all_entries.push_back(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return all_entries;
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::vector<CharacterEvolvingItems> GetWhere(Database& db, const std::string &where_filter)
|
||||||
|
{
|
||||||
|
std::vector<CharacterEvolvingItems> all_entries;
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{} WHERE {}",
|
||||||
|
BaseSelect(),
|
||||||
|
where_filter
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
all_entries.reserve(results.RowCount());
|
||||||
|
|
||||||
|
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||||
|
CharacterEvolvingItems e{};
|
||||||
|
|
||||||
|
e.id = row[0] ? strtoull(row[0], nullptr, 10) : 0;
|
||||||
|
e.character_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||||
|
e.item_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||||
|
e.activated = row[3] ? static_cast<uint8_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||||
|
e.equipped = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||||
|
e.current_amount = row[5] ? strtoll(row[5], nullptr, 10) : 0;
|
||||||
|
e.progression = row[6] ? strtod(row[6], nullptr) : 0;
|
||||||
|
e.final_item_id = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
|
||||||
|
e.deleted_at = strtoll(row[8] ? row[8] : "-1", nullptr, 10);
|
||||||
|
|
||||||
|
all_entries.push_back(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return all_entries;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int DeleteWhere(Database& db, const std::string &where_filter)
|
||||||
|
{
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"DELETE FROM {} WHERE {}",
|
||||||
|
TableName(),
|
||||||
|
where_filter
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() ? results.RowsAffected() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int Truncate(Database& db)
|
||||||
|
{
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"TRUNCATE TABLE {}",
|
||||||
|
TableName()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() ? results.RowsAffected() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int64 GetMaxId(Database& db)
|
||||||
|
{
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"SELECT COALESCE(MAX({}), 0) FROM {}",
|
||||||
|
PrimaryKey(),
|
||||||
|
TableName()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() && results.begin()[0] ? strtoll(results.begin()[0], nullptr, 10) : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int64 Count(Database& db, const std::string &where_filter = "")
|
||||||
|
{
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"SELECT COUNT(*) FROM {} {}",
|
||||||
|
TableName(),
|
||||||
|
(where_filter.empty() ? "" : "WHERE " + where_filter)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() && results.begin()[0] ? strtoll(results.begin()[0], nullptr, 10) : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string BaseReplace()
|
||||||
|
{
|
||||||
|
return fmt::format(
|
||||||
|
"REPLACE INTO {} ({}) ",
|
||||||
|
TableName(),
|
||||||
|
ColumnsRaw()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int ReplaceOne(
|
||||||
|
Database& db,
|
||||||
|
const CharacterEvolvingItems &e
|
||||||
|
)
|
||||||
|
{
|
||||||
|
std::vector<std::string> v;
|
||||||
|
|
||||||
|
v.push_back(std::to_string(e.id));
|
||||||
|
v.push_back(std::to_string(e.character_id));
|
||||||
|
v.push_back(std::to_string(e.item_id));
|
||||||
|
v.push_back(std::to_string(e.activated));
|
||||||
|
v.push_back(std::to_string(e.equipped));
|
||||||
|
v.push_back(std::to_string(e.current_amount));
|
||||||
|
v.push_back(std::to_string(e.progression));
|
||||||
|
v.push_back(std::to_string(e.final_item_id));
|
||||||
|
v.push_back("FROM_UNIXTIME(" + (e.deleted_at > 0 ? std::to_string(e.deleted_at) : "null") + ")");
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{} VALUES ({})",
|
||||||
|
BaseReplace(),
|
||||||
|
Strings::Implode(",", v)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() ? results.RowsAffected() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int ReplaceMany(
|
||||||
|
Database& db,
|
||||||
|
const std::vector<CharacterEvolvingItems> &entries
|
||||||
|
)
|
||||||
|
{
|
||||||
|
std::vector<std::string> insert_chunks;
|
||||||
|
|
||||||
|
for (auto &e: entries) {
|
||||||
|
std::vector<std::string> v;
|
||||||
|
|
||||||
|
v.push_back(std::to_string(e.id));
|
||||||
|
v.push_back(std::to_string(e.character_id));
|
||||||
|
v.push_back(std::to_string(e.item_id));
|
||||||
|
v.push_back(std::to_string(e.activated));
|
||||||
|
v.push_back(std::to_string(e.equipped));
|
||||||
|
v.push_back(std::to_string(e.current_amount));
|
||||||
|
v.push_back(std::to_string(e.progression));
|
||||||
|
v.push_back(std::to_string(e.final_item_id));
|
||||||
|
v.push_back("FROM_UNIXTIME(" + (e.deleted_at > 0 ? std::to_string(e.deleted_at) : "null") + ")");
|
||||||
|
|
||||||
|
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<std::string> v;
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{} VALUES {}",
|
||||||
|
BaseReplace(),
|
||||||
|
Strings::Implode(",", insert_chunks)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() ? results.RowsAffected() : 0);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif //EQEMU_BASE_CHARACTER_EVOLVING_ITEMS_REPOSITORY_H
|
||||||
@@ -0,0 +1,451 @@
|
|||||||
|
/**
|
||||||
|
* DO NOT MODIFY THIS FILE
|
||||||
|
*
|
||||||
|
* This repository was automatically generated and is NOT to be modified directly.
|
||||||
|
* Any repository modifications are meant to be made to the repository extending the base.
|
||||||
|
* Any modifications to base repositories are to be made by the generator only
|
||||||
|
*
|
||||||
|
* @generator ./utils/scripts/generators/repository-generator.pl
|
||||||
|
* @docs https://docs.eqemu.io/developer/repositories
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef EQEMU_BASE_ITEMS_EVOLVING_DETAILS_REPOSITORY_H
|
||||||
|
#define EQEMU_BASE_ITEMS_EVOLVING_DETAILS_REPOSITORY_H
|
||||||
|
|
||||||
|
#include "../../database.h"
|
||||||
|
#include "../../strings.h"
|
||||||
|
#include <ctime>
|
||||||
|
|
||||||
|
class BaseItemsEvolvingDetailsRepository {
|
||||||
|
public:
|
||||||
|
struct ItemsEvolvingDetails {
|
||||||
|
uint32_t id;
|
||||||
|
uint32_t item_evo_id;
|
||||||
|
uint32_t item_evolve_level;
|
||||||
|
uint32_t item_id;
|
||||||
|
uint32_t type;
|
||||||
|
uint32_t sub_type;
|
||||||
|
int64_t required_amount;
|
||||||
|
};
|
||||||
|
|
||||||
|
static std::string PrimaryKey()
|
||||||
|
{
|
||||||
|
return std::string("id");
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> Columns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"id",
|
||||||
|
"item_evo_id",
|
||||||
|
"item_evolve_level",
|
||||||
|
"item_id",
|
||||||
|
"type",
|
||||||
|
"sub_type",
|
||||||
|
"required_amount",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> SelectColumns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"id",
|
||||||
|
"item_evo_id",
|
||||||
|
"item_evolve_level",
|
||||||
|
"item_id",
|
||||||
|
"type",
|
||||||
|
"sub_type",
|
||||||
|
"required_amount",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string ColumnsRaw()
|
||||||
|
{
|
||||||
|
return std::string(Strings::Implode(", ", Columns()));
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string SelectColumnsRaw()
|
||||||
|
{
|
||||||
|
return std::string(Strings::Implode(", ", SelectColumns()));
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string TableName()
|
||||||
|
{
|
||||||
|
return std::string("items_evolving_details");
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string BaseSelect()
|
||||||
|
{
|
||||||
|
return fmt::format(
|
||||||
|
"SELECT {} FROM {}",
|
||||||
|
SelectColumnsRaw(),
|
||||||
|
TableName()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string BaseInsert()
|
||||||
|
{
|
||||||
|
return fmt::format(
|
||||||
|
"INSERT INTO {} ({}) ",
|
||||||
|
TableName(),
|
||||||
|
ColumnsRaw()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static ItemsEvolvingDetails NewEntity()
|
||||||
|
{
|
||||||
|
ItemsEvolvingDetails e{};
|
||||||
|
|
||||||
|
e.id = 0;
|
||||||
|
e.item_evo_id = 0;
|
||||||
|
e.item_evolve_level = 0;
|
||||||
|
e.item_id = 0;
|
||||||
|
e.type = 0;
|
||||||
|
e.sub_type = 0;
|
||||||
|
e.required_amount = 0;
|
||||||
|
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
static ItemsEvolvingDetails GetItemsEvolvingDetails(
|
||||||
|
const std::vector<ItemsEvolvingDetails> &items_evolving_detailss,
|
||||||
|
int items_evolving_details_id
|
||||||
|
)
|
||||||
|
{
|
||||||
|
for (auto &items_evolving_details : items_evolving_detailss) {
|
||||||
|
if (items_evolving_details.id == items_evolving_details_id) {
|
||||||
|
return items_evolving_details;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return NewEntity();
|
||||||
|
}
|
||||||
|
|
||||||
|
static ItemsEvolvingDetails FindOne(
|
||||||
|
Database& db,
|
||||||
|
int items_evolving_details_id
|
||||||
|
)
|
||||||
|
{
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{} WHERE {} = {} LIMIT 1",
|
||||||
|
BaseSelect(),
|
||||||
|
PrimaryKey(),
|
||||||
|
items_evolving_details_id
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
auto row = results.begin();
|
||||||
|
if (results.RowCount() == 1) {
|
||||||
|
ItemsEvolvingDetails e{};
|
||||||
|
|
||||||
|
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||||
|
e.item_evo_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||||
|
e.item_evolve_level = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||||
|
e.item_id = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||||
|
e.type = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||||
|
e.sub_type = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
|
||||||
|
e.required_amount = row[6] ? strtoll(row[6], nullptr, 10) : 0;
|
||||||
|
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NewEntity();
|
||||||
|
}
|
||||||
|
|
||||||
|
static int DeleteOne(
|
||||||
|
Database& db,
|
||||||
|
int items_evolving_details_id
|
||||||
|
)
|
||||||
|
{
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"DELETE FROM {} WHERE {} = {}",
|
||||||
|
TableName(),
|
||||||
|
PrimaryKey(),
|
||||||
|
items_evolving_details_id
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() ? results.RowsAffected() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int UpdateOne(
|
||||||
|
Database& db,
|
||||||
|
const ItemsEvolvingDetails &e
|
||||||
|
)
|
||||||
|
{
|
||||||
|
std::vector<std::string> v;
|
||||||
|
|
||||||
|
auto columns = Columns();
|
||||||
|
|
||||||
|
v.push_back(columns[1] + " = " + std::to_string(e.item_evo_id));
|
||||||
|
v.push_back(columns[2] + " = " + std::to_string(e.item_evolve_level));
|
||||||
|
v.push_back(columns[3] + " = " + std::to_string(e.item_id));
|
||||||
|
v.push_back(columns[4] + " = " + std::to_string(e.type));
|
||||||
|
v.push_back(columns[5] + " = " + std::to_string(e.sub_type));
|
||||||
|
v.push_back(columns[6] + " = " + std::to_string(e.required_amount));
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"UPDATE {} SET {} WHERE {} = {}",
|
||||||
|
TableName(),
|
||||||
|
Strings::Implode(", ", v),
|
||||||
|
PrimaryKey(),
|
||||||
|
e.id
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() ? results.RowsAffected() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static ItemsEvolvingDetails InsertOne(
|
||||||
|
Database& db,
|
||||||
|
ItemsEvolvingDetails e
|
||||||
|
)
|
||||||
|
{
|
||||||
|
std::vector<std::string> v;
|
||||||
|
|
||||||
|
v.push_back(std::to_string(e.id));
|
||||||
|
v.push_back(std::to_string(e.item_evo_id));
|
||||||
|
v.push_back(std::to_string(e.item_evolve_level));
|
||||||
|
v.push_back(std::to_string(e.item_id));
|
||||||
|
v.push_back(std::to_string(e.type));
|
||||||
|
v.push_back(std::to_string(e.sub_type));
|
||||||
|
v.push_back(std::to_string(e.required_amount));
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{} VALUES ({})",
|
||||||
|
BaseInsert(),
|
||||||
|
Strings::Implode(",", v)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (results.Success()) {
|
||||||
|
e.id = results.LastInsertedID();
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
e = NewEntity();
|
||||||
|
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int InsertMany(
|
||||||
|
Database& db,
|
||||||
|
const std::vector<ItemsEvolvingDetails> &entries
|
||||||
|
)
|
||||||
|
{
|
||||||
|
std::vector<std::string> insert_chunks;
|
||||||
|
|
||||||
|
for (auto &e: entries) {
|
||||||
|
std::vector<std::string> v;
|
||||||
|
|
||||||
|
v.push_back(std::to_string(e.id));
|
||||||
|
v.push_back(std::to_string(e.item_evo_id));
|
||||||
|
v.push_back(std::to_string(e.item_evolve_level));
|
||||||
|
v.push_back(std::to_string(e.item_id));
|
||||||
|
v.push_back(std::to_string(e.type));
|
||||||
|
v.push_back(std::to_string(e.sub_type));
|
||||||
|
v.push_back(std::to_string(e.required_amount));
|
||||||
|
|
||||||
|
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<std::string> v;
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{} VALUES {}",
|
||||||
|
BaseInsert(),
|
||||||
|
Strings::Implode(",", insert_chunks)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() ? results.RowsAffected() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::vector<ItemsEvolvingDetails> All(Database& db)
|
||||||
|
{
|
||||||
|
std::vector<ItemsEvolvingDetails> all_entries;
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{}",
|
||||||
|
BaseSelect()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
all_entries.reserve(results.RowCount());
|
||||||
|
|
||||||
|
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||||
|
ItemsEvolvingDetails e{};
|
||||||
|
|
||||||
|
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||||
|
e.item_evo_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||||
|
e.item_evolve_level = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||||
|
e.item_id = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||||
|
e.type = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||||
|
e.sub_type = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
|
||||||
|
e.required_amount = row[6] ? strtoll(row[6], nullptr, 10) : 0;
|
||||||
|
|
||||||
|
all_entries.push_back(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return all_entries;
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::vector<ItemsEvolvingDetails> GetWhere(Database& db, const std::string &where_filter)
|
||||||
|
{
|
||||||
|
std::vector<ItemsEvolvingDetails> all_entries;
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{} WHERE {}",
|
||||||
|
BaseSelect(),
|
||||||
|
where_filter
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
all_entries.reserve(results.RowCount());
|
||||||
|
|
||||||
|
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||||
|
ItemsEvolvingDetails e{};
|
||||||
|
|
||||||
|
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||||
|
e.item_evo_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||||
|
e.item_evolve_level = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||||
|
e.item_id = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||||
|
e.type = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||||
|
e.sub_type = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
|
||||||
|
e.required_amount = row[6] ? strtoll(row[6], nullptr, 10) : 0;
|
||||||
|
|
||||||
|
all_entries.push_back(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return all_entries;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int DeleteWhere(Database& db, const std::string &where_filter)
|
||||||
|
{
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"DELETE FROM {} WHERE {}",
|
||||||
|
TableName(),
|
||||||
|
where_filter
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() ? results.RowsAffected() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int Truncate(Database& db)
|
||||||
|
{
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"TRUNCATE TABLE {}",
|
||||||
|
TableName()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() ? results.RowsAffected() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int64 GetMaxId(Database& db)
|
||||||
|
{
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"SELECT COALESCE(MAX({}), 0) FROM {}",
|
||||||
|
PrimaryKey(),
|
||||||
|
TableName()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() && results.begin()[0] ? strtoll(results.begin()[0], nullptr, 10) : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int64 Count(Database& db, const std::string &where_filter = "")
|
||||||
|
{
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"SELECT COUNT(*) FROM {} {}",
|
||||||
|
TableName(),
|
||||||
|
(where_filter.empty() ? "" : "WHERE " + where_filter)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() && results.begin()[0] ? strtoll(results.begin()[0], nullptr, 10) : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string BaseReplace()
|
||||||
|
{
|
||||||
|
return fmt::format(
|
||||||
|
"REPLACE INTO {} ({}) ",
|
||||||
|
TableName(),
|
||||||
|
ColumnsRaw()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int ReplaceOne(
|
||||||
|
Database& db,
|
||||||
|
const ItemsEvolvingDetails &e
|
||||||
|
)
|
||||||
|
{
|
||||||
|
std::vector<std::string> v;
|
||||||
|
|
||||||
|
v.push_back(std::to_string(e.id));
|
||||||
|
v.push_back(std::to_string(e.item_evo_id));
|
||||||
|
v.push_back(std::to_string(e.item_evolve_level));
|
||||||
|
v.push_back(std::to_string(e.item_id));
|
||||||
|
v.push_back(std::to_string(e.type));
|
||||||
|
v.push_back(std::to_string(e.sub_type));
|
||||||
|
v.push_back(std::to_string(e.required_amount));
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{} VALUES ({})",
|
||||||
|
BaseReplace(),
|
||||||
|
Strings::Implode(",", v)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() ? results.RowsAffected() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int ReplaceMany(
|
||||||
|
Database& db,
|
||||||
|
const std::vector<ItemsEvolvingDetails> &entries
|
||||||
|
)
|
||||||
|
{
|
||||||
|
std::vector<std::string> insert_chunks;
|
||||||
|
|
||||||
|
for (auto &e: entries) {
|
||||||
|
std::vector<std::string> v;
|
||||||
|
|
||||||
|
v.push_back(std::to_string(e.id));
|
||||||
|
v.push_back(std::to_string(e.item_evo_id));
|
||||||
|
v.push_back(std::to_string(e.item_evolve_level));
|
||||||
|
v.push_back(std::to_string(e.item_id));
|
||||||
|
v.push_back(std::to_string(e.type));
|
||||||
|
v.push_back(std::to_string(e.sub_type));
|
||||||
|
v.push_back(std::to_string(e.required_amount));
|
||||||
|
|
||||||
|
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<std::string> v;
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{} VALUES {}",
|
||||||
|
BaseReplace(),
|
||||||
|
Strings::Implode(",", insert_chunks)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() ? results.RowsAffected() : 0);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif //EQEMU_BASE_ITEMS_EVOLVING_DETAILS_REPOSITORY_H
|
||||||
@@ -28,13 +28,14 @@ public:
|
|||||||
uint32_t aug_slot_4;
|
uint32_t aug_slot_4;
|
||||||
uint32_t aug_slot_5;
|
uint32_t aug_slot_5;
|
||||||
uint32_t aug_slot_6;
|
uint32_t aug_slot_6;
|
||||||
int32_t item_sn;
|
uint32_t item_sn;
|
||||||
int32_t item_charges;
|
int32_t item_charges;
|
||||||
uint64_t item_cost;
|
uint32_t item_cost;
|
||||||
uint8_t slot_id;
|
uint8_t slot_id;
|
||||||
uint32_t char_entity_id;
|
uint32_t char_entity_id;
|
||||||
uint32_t char_zone_id;
|
uint32_t char_zone_id;
|
||||||
int8_t active_transaction;
|
int32_t char_zone_instance_id;
|
||||||
|
uint8_t active_transaction;
|
||||||
};
|
};
|
||||||
|
|
||||||
static std::string PrimaryKey()
|
static std::string PrimaryKey()
|
||||||
@@ -60,6 +61,7 @@ public:
|
|||||||
"slot_id",
|
"slot_id",
|
||||||
"char_entity_id",
|
"char_entity_id",
|
||||||
"char_zone_id",
|
"char_zone_id",
|
||||||
|
"char_zone_instance_id",
|
||||||
"active_transaction",
|
"active_transaction",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -82,6 +84,7 @@ public:
|
|||||||
"slot_id",
|
"slot_id",
|
||||||
"char_entity_id",
|
"char_entity_id",
|
||||||
"char_zone_id",
|
"char_zone_id",
|
||||||
|
"char_zone_instance_id",
|
||||||
"active_transaction",
|
"active_transaction",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -138,6 +141,7 @@ public:
|
|||||||
e.slot_id = 0;
|
e.slot_id = 0;
|
||||||
e.char_entity_id = 0;
|
e.char_entity_id = 0;
|
||||||
e.char_zone_id = 0;
|
e.char_zone_id = 0;
|
||||||
|
e.char_zone_instance_id = 0;
|
||||||
e.active_transaction = 0;
|
e.active_transaction = 0;
|
||||||
|
|
||||||
return e;
|
return e;
|
||||||
@@ -184,13 +188,14 @@ public:
|
|||||||
e.aug_slot_4 = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0;
|
e.aug_slot_4 = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0;
|
||||||
e.aug_slot_5 = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
|
e.aug_slot_5 = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
|
||||||
e.aug_slot_6 = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
|
e.aug_slot_6 = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
|
||||||
e.item_sn = row[9] ? static_cast<int32_t>(atoi(row[9])) : 0;
|
e.item_sn = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
|
||||||
e.item_charges = row[10] ? static_cast<int32_t>(atoi(row[10])) : 0;
|
e.item_charges = row[10] ? static_cast<int32_t>(atoi(row[10])) : 0;
|
||||||
e.item_cost = row[11] ? strtoull(row[11], nullptr, 10) : 0;
|
e.item_cost = row[11] ? static_cast<uint32_t>(strtoul(row[11], nullptr, 10)) : 0;
|
||||||
e.slot_id = row[12] ? static_cast<uint8_t>(strtoul(row[12], nullptr, 10)) : 0;
|
e.slot_id = row[12] ? static_cast<uint8_t>(strtoul(row[12], nullptr, 10)) : 0;
|
||||||
e.char_entity_id = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 0;
|
e.char_entity_id = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 0;
|
||||||
e.char_zone_id = row[14] ? static_cast<uint32_t>(strtoul(row[14], nullptr, 10)) : 0;
|
e.char_zone_id = row[14] ? static_cast<uint32_t>(strtoul(row[14], nullptr, 10)) : 0;
|
||||||
e.active_transaction = row[15] ? static_cast<int8_t>(atoi(row[15])) : 0;
|
e.char_zone_instance_id = row[15] ? static_cast<int32_t>(atoi(row[15])) : 0;
|
||||||
|
e.active_transaction = row[16] ? static_cast<uint8_t>(strtoul(row[16], nullptr, 10)) : 0;
|
||||||
|
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
@@ -238,7 +243,8 @@ public:
|
|||||||
v.push_back(columns[12] + " = " + std::to_string(e.slot_id));
|
v.push_back(columns[12] + " = " + std::to_string(e.slot_id));
|
||||||
v.push_back(columns[13] + " = " + std::to_string(e.char_entity_id));
|
v.push_back(columns[13] + " = " + std::to_string(e.char_entity_id));
|
||||||
v.push_back(columns[14] + " = " + std::to_string(e.char_zone_id));
|
v.push_back(columns[14] + " = " + std::to_string(e.char_zone_id));
|
||||||
v.push_back(columns[15] + " = " + std::to_string(e.active_transaction));
|
v.push_back(columns[15] + " = " + std::to_string(e.char_zone_instance_id));
|
||||||
|
v.push_back(columns[16] + " = " + std::to_string(e.active_transaction));
|
||||||
|
|
||||||
auto results = db.QueryDatabase(
|
auto results = db.QueryDatabase(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
@@ -275,6 +281,7 @@ public:
|
|||||||
v.push_back(std::to_string(e.slot_id));
|
v.push_back(std::to_string(e.slot_id));
|
||||||
v.push_back(std::to_string(e.char_entity_id));
|
v.push_back(std::to_string(e.char_entity_id));
|
||||||
v.push_back(std::to_string(e.char_zone_id));
|
v.push_back(std::to_string(e.char_zone_id));
|
||||||
|
v.push_back(std::to_string(e.char_zone_instance_id));
|
||||||
v.push_back(std::to_string(e.active_transaction));
|
v.push_back(std::to_string(e.active_transaction));
|
||||||
|
|
||||||
auto results = db.QueryDatabase(
|
auto results = db.QueryDatabase(
|
||||||
@@ -320,6 +327,7 @@ public:
|
|||||||
v.push_back(std::to_string(e.slot_id));
|
v.push_back(std::to_string(e.slot_id));
|
||||||
v.push_back(std::to_string(e.char_entity_id));
|
v.push_back(std::to_string(e.char_entity_id));
|
||||||
v.push_back(std::to_string(e.char_zone_id));
|
v.push_back(std::to_string(e.char_zone_id));
|
||||||
|
v.push_back(std::to_string(e.char_zone_instance_id));
|
||||||
v.push_back(std::to_string(e.active_transaction));
|
v.push_back(std::to_string(e.active_transaction));
|
||||||
|
|
||||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||||
@@ -363,13 +371,14 @@ public:
|
|||||||
e.aug_slot_4 = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0;
|
e.aug_slot_4 = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0;
|
||||||
e.aug_slot_5 = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
|
e.aug_slot_5 = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
|
||||||
e.aug_slot_6 = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
|
e.aug_slot_6 = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
|
||||||
e.item_sn = row[9] ? static_cast<int32_t>(atoi(row[9])) : 0;
|
e.item_sn = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
|
||||||
e.item_charges = row[10] ? static_cast<int32_t>(atoi(row[10])) : 0;
|
e.item_charges = row[10] ? static_cast<int32_t>(atoi(row[10])) : 0;
|
||||||
e.item_cost = row[11] ? strtoull(row[11], nullptr, 10) : 0;
|
e.item_cost = row[11] ? static_cast<uint32_t>(strtoul(row[11], nullptr, 10)) : 0;
|
||||||
e.slot_id = row[12] ? static_cast<uint8_t>(strtoul(row[12], nullptr, 10)) : 0;
|
e.slot_id = row[12] ? static_cast<uint8_t>(strtoul(row[12], nullptr, 10)) : 0;
|
||||||
e.char_entity_id = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 0;
|
e.char_entity_id = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 0;
|
||||||
e.char_zone_id = row[14] ? static_cast<uint32_t>(strtoul(row[14], nullptr, 10)) : 0;
|
e.char_zone_id = row[14] ? static_cast<uint32_t>(strtoul(row[14], nullptr, 10)) : 0;
|
||||||
e.active_transaction = row[15] ? static_cast<int8_t>(atoi(row[15])) : 0;
|
e.char_zone_instance_id = row[15] ? static_cast<int32_t>(atoi(row[15])) : 0;
|
||||||
|
e.active_transaction = row[16] ? static_cast<uint8_t>(strtoul(row[16], nullptr, 10)) : 0;
|
||||||
|
|
||||||
all_entries.push_back(e);
|
all_entries.push_back(e);
|
||||||
}
|
}
|
||||||
@@ -403,13 +412,14 @@ public:
|
|||||||
e.aug_slot_4 = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0;
|
e.aug_slot_4 = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0;
|
||||||
e.aug_slot_5 = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
|
e.aug_slot_5 = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
|
||||||
e.aug_slot_6 = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
|
e.aug_slot_6 = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
|
||||||
e.item_sn = row[9] ? static_cast<int32_t>(atoi(row[9])) : 0;
|
e.item_sn = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
|
||||||
e.item_charges = row[10] ? static_cast<int32_t>(atoi(row[10])) : 0;
|
e.item_charges = row[10] ? static_cast<int32_t>(atoi(row[10])) : 0;
|
||||||
e.item_cost = row[11] ? strtoull(row[11], nullptr, 10) : 0;
|
e.item_cost = row[11] ? static_cast<uint32_t>(strtoul(row[11], nullptr, 10)) : 0;
|
||||||
e.slot_id = row[12] ? static_cast<uint8_t>(strtoul(row[12], nullptr, 10)) : 0;
|
e.slot_id = row[12] ? static_cast<uint8_t>(strtoul(row[12], nullptr, 10)) : 0;
|
||||||
e.char_entity_id = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 0;
|
e.char_entity_id = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 0;
|
||||||
e.char_zone_id = row[14] ? static_cast<uint32_t>(strtoul(row[14], nullptr, 10)) : 0;
|
e.char_zone_id = row[14] ? static_cast<uint32_t>(strtoul(row[14], nullptr, 10)) : 0;
|
||||||
e.active_transaction = row[15] ? static_cast<int8_t>(atoi(row[15])) : 0;
|
e.char_zone_instance_id = row[15] ? static_cast<int32_t>(atoi(row[15])) : 0;
|
||||||
|
e.active_transaction = row[16] ? static_cast<uint8_t>(strtoul(row[16], nullptr, 10)) : 0;
|
||||||
|
|
||||||
all_entries.push_back(e);
|
all_entries.push_back(e);
|
||||||
}
|
}
|
||||||
@@ -499,6 +509,7 @@ public:
|
|||||||
v.push_back(std::to_string(e.slot_id));
|
v.push_back(std::to_string(e.slot_id));
|
||||||
v.push_back(std::to_string(e.char_entity_id));
|
v.push_back(std::to_string(e.char_entity_id));
|
||||||
v.push_back(std::to_string(e.char_zone_id));
|
v.push_back(std::to_string(e.char_zone_id));
|
||||||
|
v.push_back(std::to_string(e.char_zone_instance_id));
|
||||||
v.push_back(std::to_string(e.active_transaction));
|
v.push_back(std::to_string(e.active_transaction));
|
||||||
|
|
||||||
auto results = db.QueryDatabase(
|
auto results = db.QueryDatabase(
|
||||||
@@ -537,6 +548,7 @@ public:
|
|||||||
v.push_back(std::to_string(e.slot_id));
|
v.push_back(std::to_string(e.slot_id));
|
||||||
v.push_back(std::to_string(e.char_entity_id));
|
v.push_back(std::to_string(e.char_entity_id));
|
||||||
v.push_back(std::to_string(e.char_zone_id));
|
v.push_back(std::to_string(e.char_zone_id));
|
||||||
|
v.push_back(std::to_string(e.char_zone_instance_id));
|
||||||
v.push_back(std::to_string(e.active_transaction));
|
v.push_back(std::to_string(e.active_transaction));
|
||||||
|
|
||||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||||
|
|||||||
@@ -117,6 +117,7 @@ public:
|
|||||||
int32_t min_lava_damage;
|
int32_t min_lava_damage;
|
||||||
uint8_t idle_when_empty;
|
uint8_t idle_when_empty;
|
||||||
uint32_t seconds_before_idle;
|
uint32_t seconds_before_idle;
|
||||||
|
int32_t shard_at_player_count;
|
||||||
};
|
};
|
||||||
|
|
||||||
static std::string PrimaryKey()
|
static std::string PrimaryKey()
|
||||||
@@ -225,6 +226,7 @@ public:
|
|||||||
"min_lava_damage",
|
"min_lava_damage",
|
||||||
"idle_when_empty",
|
"idle_when_empty",
|
||||||
"seconds_before_idle",
|
"seconds_before_idle",
|
||||||
|
"shard_at_player_count",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -329,6 +331,7 @@ public:
|
|||||||
"min_lava_damage",
|
"min_lava_damage",
|
||||||
"idle_when_empty",
|
"idle_when_empty",
|
||||||
"seconds_before_idle",
|
"seconds_before_idle",
|
||||||
|
"shard_at_player_count",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -467,6 +470,7 @@ public:
|
|||||||
e.min_lava_damage = 10;
|
e.min_lava_damage = 10;
|
||||||
e.idle_when_empty = 1;
|
e.idle_when_empty = 1;
|
||||||
e.seconds_before_idle = 60;
|
e.seconds_before_idle = 60;
|
||||||
|
e.shard_at_player_count = 0;
|
||||||
|
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
@@ -601,6 +605,7 @@ public:
|
|||||||
e.min_lava_damage = row[95] ? static_cast<int32_t>(atoi(row[95])) : 10;
|
e.min_lava_damage = row[95] ? static_cast<int32_t>(atoi(row[95])) : 10;
|
||||||
e.idle_when_empty = row[96] ? static_cast<uint8_t>(strtoul(row[96], nullptr, 10)) : 1;
|
e.idle_when_empty = row[96] ? static_cast<uint8_t>(strtoul(row[96], nullptr, 10)) : 1;
|
||||||
e.seconds_before_idle = row[97] ? static_cast<uint32_t>(strtoul(row[97], nullptr, 10)) : 60;
|
e.seconds_before_idle = row[97] ? static_cast<uint32_t>(strtoul(row[97], nullptr, 10)) : 60;
|
||||||
|
e.shard_at_player_count = row[98] ? static_cast<int32_t>(atoi(row[98])) : 0;
|
||||||
|
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
@@ -731,6 +736,7 @@ public:
|
|||||||
v.push_back(columns[95] + " = " + std::to_string(e.min_lava_damage));
|
v.push_back(columns[95] + " = " + std::to_string(e.min_lava_damage));
|
||||||
v.push_back(columns[96] + " = " + std::to_string(e.idle_when_empty));
|
v.push_back(columns[96] + " = " + std::to_string(e.idle_when_empty));
|
||||||
v.push_back(columns[97] + " = " + std::to_string(e.seconds_before_idle));
|
v.push_back(columns[97] + " = " + std::to_string(e.seconds_before_idle));
|
||||||
|
v.push_back(columns[98] + " = " + std::to_string(e.shard_at_player_count));
|
||||||
|
|
||||||
auto results = db.QueryDatabase(
|
auto results = db.QueryDatabase(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
@@ -850,6 +856,7 @@ public:
|
|||||||
v.push_back(std::to_string(e.min_lava_damage));
|
v.push_back(std::to_string(e.min_lava_damage));
|
||||||
v.push_back(std::to_string(e.idle_when_empty));
|
v.push_back(std::to_string(e.idle_when_empty));
|
||||||
v.push_back(std::to_string(e.seconds_before_idle));
|
v.push_back(std::to_string(e.seconds_before_idle));
|
||||||
|
v.push_back(std::to_string(e.shard_at_player_count));
|
||||||
|
|
||||||
auto results = db.QueryDatabase(
|
auto results = db.QueryDatabase(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
@@ -977,6 +984,7 @@ public:
|
|||||||
v.push_back(std::to_string(e.min_lava_damage));
|
v.push_back(std::to_string(e.min_lava_damage));
|
||||||
v.push_back(std::to_string(e.idle_when_empty));
|
v.push_back(std::to_string(e.idle_when_empty));
|
||||||
v.push_back(std::to_string(e.seconds_before_idle));
|
v.push_back(std::to_string(e.seconds_before_idle));
|
||||||
|
v.push_back(std::to_string(e.shard_at_player_count));
|
||||||
|
|
||||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||||
}
|
}
|
||||||
@@ -1108,6 +1116,7 @@ public:
|
|||||||
e.min_lava_damage = row[95] ? static_cast<int32_t>(atoi(row[95])) : 10;
|
e.min_lava_damage = row[95] ? static_cast<int32_t>(atoi(row[95])) : 10;
|
||||||
e.idle_when_empty = row[96] ? static_cast<uint8_t>(strtoul(row[96], nullptr, 10)) : 1;
|
e.idle_when_empty = row[96] ? static_cast<uint8_t>(strtoul(row[96], nullptr, 10)) : 1;
|
||||||
e.seconds_before_idle = row[97] ? static_cast<uint32_t>(strtoul(row[97], nullptr, 10)) : 60;
|
e.seconds_before_idle = row[97] ? static_cast<uint32_t>(strtoul(row[97], nullptr, 10)) : 60;
|
||||||
|
e.shard_at_player_count = row[98] ? static_cast<int32_t>(atoi(row[98])) : 0;
|
||||||
|
|
||||||
all_entries.push_back(e);
|
all_entries.push_back(e);
|
||||||
}
|
}
|
||||||
@@ -1230,6 +1239,7 @@ public:
|
|||||||
e.min_lava_damage = row[95] ? static_cast<int32_t>(atoi(row[95])) : 10;
|
e.min_lava_damage = row[95] ? static_cast<int32_t>(atoi(row[95])) : 10;
|
||||||
e.idle_when_empty = row[96] ? static_cast<uint8_t>(strtoul(row[96], nullptr, 10)) : 1;
|
e.idle_when_empty = row[96] ? static_cast<uint8_t>(strtoul(row[96], nullptr, 10)) : 1;
|
||||||
e.seconds_before_idle = row[97] ? static_cast<uint32_t>(strtoul(row[97], nullptr, 10)) : 60;
|
e.seconds_before_idle = row[97] ? static_cast<uint32_t>(strtoul(row[97], nullptr, 10)) : 60;
|
||||||
|
e.shard_at_player_count = row[98] ? static_cast<int32_t>(atoi(row[98])) : 0;
|
||||||
|
|
||||||
all_entries.push_back(e);
|
all_entries.push_back(e);
|
||||||
}
|
}
|
||||||
@@ -1402,6 +1412,7 @@ public:
|
|||||||
v.push_back(std::to_string(e.min_lava_damage));
|
v.push_back(std::to_string(e.min_lava_damage));
|
||||||
v.push_back(std::to_string(e.idle_when_empty));
|
v.push_back(std::to_string(e.idle_when_empty));
|
||||||
v.push_back(std::to_string(e.seconds_before_idle));
|
v.push_back(std::to_string(e.seconds_before_idle));
|
||||||
|
v.push_back(std::to_string(e.shard_at_player_count));
|
||||||
|
|
||||||
auto results = db.QueryDatabase(
|
auto results = db.QueryDatabase(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
@@ -1522,6 +1533,7 @@ public:
|
|||||||
v.push_back(std::to_string(e.min_lava_damage));
|
v.push_back(std::to_string(e.min_lava_damage));
|
||||||
v.push_back(std::to_string(e.idle_when_empty));
|
v.push_back(std::to_string(e.idle_when_empty));
|
||||||
v.push_back(std::to_string(e.seconds_before_idle));
|
v.push_back(std::to_string(e.seconds_before_idle));
|
||||||
|
v.push_back(std::to_string(e.shard_at_player_count));
|
||||||
|
|
||||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,6 +80,93 @@ public:
|
|||||||
|
|
||||||
return l.empty() ? CharacterDataRepository::NewEntity() : l.front();
|
return l.empty() ? CharacterDataRepository::NewEntity() : l.front();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct InstancePlayerCount {
|
||||||
|
int32_t instance_id;
|
||||||
|
uint32_t zone_id;
|
||||||
|
uint32_t player_count;
|
||||||
|
};
|
||||||
|
|
||||||
|
static std::vector<InstancePlayerCount> GetInstanceZonePlayerCounts(Database& db, int zone_id) {
|
||||||
|
std::vector<InstancePlayerCount> zone_player_counts;
|
||||||
|
|
||||||
|
uint64_t shard_instance_duration = 3155760000;
|
||||||
|
|
||||||
|
auto query = fmt::format(SQL(
|
||||||
|
SELECT
|
||||||
|
zone_id,
|
||||||
|
0 AS instance_id,
|
||||||
|
COUNT(id) AS player_count
|
||||||
|
FROM
|
||||||
|
character_data
|
||||||
|
WHERE
|
||||||
|
zone_instance = 0
|
||||||
|
AND zone_id = {}
|
||||||
|
AND last_login >= UNIX_TIMESTAMP(NOW()) - 600
|
||||||
|
GROUP BY
|
||||||
|
zone_id
|
||||||
|
ORDER BY
|
||||||
|
zone_id, player_count DESC
|
||||||
|
), zone_id);
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(query);
|
||||||
|
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||||
|
InstancePlayerCount e{};
|
||||||
|
e.zone_id = std::stoi(row[0]);
|
||||||
|
e.instance_id = 0;
|
||||||
|
e.player_count = std::stoi(row[2]);
|
||||||
|
zone_player_counts.push_back(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (zone_player_counts.empty()) {
|
||||||
|
InstancePlayerCount e{};
|
||||||
|
e.zone_id = zone_id;
|
||||||
|
e.instance_id = 0;
|
||||||
|
e.player_count = 0;
|
||||||
|
zone_player_counts.push_back(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// duration 3155760000 is for shards explicitly
|
||||||
|
query = fmt::format(
|
||||||
|
SQL(
|
||||||
|
SELECT
|
||||||
|
i.id AS instance_id,
|
||||||
|
i.zone AS zone_id,
|
||||||
|
COUNT(c.id) AS player_count
|
||||||
|
FROM
|
||||||
|
instance_list i
|
||||||
|
LEFT JOIN
|
||||||
|
character_data c
|
||||||
|
ON
|
||||||
|
i.zone = c.zone_id
|
||||||
|
AND i.id = c.zone_instance
|
||||||
|
AND c.last_login >= UNIX_TIMESTAMP(NOW()) - 600
|
||||||
|
AND (i.start_time + i.duration >= UNIX_TIMESTAMP(NOW()) OR i.never_expires = 0)
|
||||||
|
AND i.duration = {}
|
||||||
|
WHERE
|
||||||
|
i.zone IS NOT NULL AND i.zone = {}
|
||||||
|
GROUP BY
|
||||||
|
i.id, i.zone, i.version
|
||||||
|
ORDER BY
|
||||||
|
i.id ASC;
|
||||||
|
), shard_instance_duration, zone_id
|
||||||
|
);
|
||||||
|
|
||||||
|
results = db.QueryDatabase(query);
|
||||||
|
if (!results.Success() || results.RowCount() == 0) {
|
||||||
|
return zone_player_counts;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||||
|
InstancePlayerCount e{};
|
||||||
|
e.instance_id = std::stoi(row[0]);
|
||||||
|
e.zone_id = std::stoi(row[1]);
|
||||||
|
e.player_count = std::stoi(row[2]);
|
||||||
|
zone_player_counts.push_back(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return zone_player_counts;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //EQEMU_CHARACTER_DATA_REPOSITORY_H
|
#endif //EQEMU_CHARACTER_DATA_REPOSITORY_H
|
||||||
|
|||||||
@@ -0,0 +1,66 @@
|
|||||||
|
#ifndef EQEMU_CHARACTER_EVOLVING_ITEMS_REPOSITORY_H
|
||||||
|
#define EQEMU_CHARACTER_EVOLVING_ITEMS_REPOSITORY_H
|
||||||
|
|
||||||
|
#include "../database.h"
|
||||||
|
#include "../strings.h"
|
||||||
|
#include "base/base_character_evolving_items_repository.h"
|
||||||
|
|
||||||
|
#include <boost/tuple/tuple_comparison.hpp>
|
||||||
|
|
||||||
|
class CharacterEvolvingItemsRepository: public BaseCharacterEvolvingItemsRepository {
|
||||||
|
public:
|
||||||
|
// Custom extended repository methods here
|
||||||
|
|
||||||
|
static CharacterEvolvingItems SetCurrentAmountAndProgression(Database& db, const uint64 id, const uint64 amount, const double progression)
|
||||||
|
{
|
||||||
|
auto e = FindOne(db, id);
|
||||||
|
if (e.id == 0) {
|
||||||
|
return NewEntity();
|
||||||
|
}
|
||||||
|
|
||||||
|
e.current_amount = amount;
|
||||||
|
e.progression = progression;
|
||||||
|
e.deleted_at = 0;
|
||||||
|
UpdateOne(db, e);
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
static CharacterEvolvingItems SetEquipped(Database& db, const uint64 id, const bool equipped)
|
||||||
|
{
|
||||||
|
auto e = FindOne(db, id);
|
||||||
|
if (e.id == 0) {
|
||||||
|
return NewEntity();
|
||||||
|
}
|
||||||
|
|
||||||
|
e.equipped = equipped;
|
||||||
|
e.deleted_at = 0;
|
||||||
|
UpdateOne(db, e);
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
static CharacterEvolvingItems SoftDelete(Database& db, const uint64 id)
|
||||||
|
{
|
||||||
|
auto e = FindOne(db, id);
|
||||||
|
if (e.id == 0) {
|
||||||
|
return NewEntity();
|
||||||
|
}
|
||||||
|
|
||||||
|
e.deleted_at = time(nullptr);
|
||||||
|
UpdateOne(db, e);
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool UpdateCharID(Database &db, const uint64 id, const uint32 to_char_id)
|
||||||
|
{
|
||||||
|
auto e = FindOne(db, id);
|
||||||
|
if (e.id == 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
e.character_id = to_char_id;
|
||||||
|
e.deleted_at = 0;
|
||||||
|
return UpdateOne(db, e);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif //EQEMU_CHARACTER_EVOLVING_ITEMS_REPOSITORY_H
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
#ifndef EQEMU_ITEMS_EVOLVING_DETAILS_REPOSITORY_H
|
||||||
|
#define EQEMU_ITEMS_EVOLVING_DETAILS_REPOSITORY_H
|
||||||
|
|
||||||
|
#include "../database.h"
|
||||||
|
#include "../strings.h"
|
||||||
|
#include "base/base_items_evolving_details_repository.h"
|
||||||
|
|
||||||
|
class ItemsEvolvingDetailsRepository: public BaseItemsEvolvingDetailsRepository {
|
||||||
|
public:
|
||||||
|
// Custom extended repository methods here
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif //EQEMU_ITEMS_EVOLVING_DETAILS_REPOSITORY_H
|
||||||
@@ -12,10 +12,12 @@
|
|||||||
|
|
||||||
class TraderRepository : public BaseTraderRepository {
|
class TraderRepository : public BaseTraderRepository {
|
||||||
public:
|
public:
|
||||||
|
static constexpr uint32 TRADER_CONVERT_ID = 4000000000;
|
||||||
|
|
||||||
struct DistinctTraders_Struct {
|
struct DistinctTraders_Struct {
|
||||||
uint32 trader_id;
|
uint32 trader_id;
|
||||||
uint32 zone_id;
|
uint32 zone_id;
|
||||||
|
uint32 zone_instance_id;
|
||||||
uint32 entity_id;
|
uint32 entity_id;
|
||||||
std::string trader_name;
|
std::string trader_name;
|
||||||
};
|
};
|
||||||
@@ -35,18 +37,28 @@ public:
|
|||||||
GetBazaarSearchResults(
|
GetBazaarSearchResults(
|
||||||
SharedDatabase &db,
|
SharedDatabase &db,
|
||||||
BazaarSearchCriteria_Struct search,
|
BazaarSearchCriteria_Struct search,
|
||||||
uint32 char_zone_id
|
uint32 char_zone_id,
|
||||||
|
int32 char_zone_instance_id
|
||||||
);
|
);
|
||||||
|
|
||||||
static BulkTraders_Struct GetDistinctTraders(Database &db)
|
static BulkTraders_Struct GetDistinctTraders(
|
||||||
|
Database &db,
|
||||||
|
uint32 char_zone_instance_id,
|
||||||
|
uint32 max_results = std::numeric_limits<uint32>::max()
|
||||||
|
)
|
||||||
{
|
{
|
||||||
BulkTraders_Struct all_entries{};
|
BulkTraders_Struct all_entries{};
|
||||||
std::vector<DistinctTraders_Struct> distinct_traders;
|
std::vector<DistinctTraders_Struct> distinct_traders;
|
||||||
|
|
||||||
auto results = db.QueryDatabase(
|
auto results = db.QueryDatabase(fmt::format(
|
||||||
"SELECT DISTINCT(t.char_id), t.char_zone_id, t.char_entity_id, c.name "
|
"SELECT DISTINCT(t.char_id), t.char_zone_id, t.char_zone_instance_id, t.char_entity_id, c.name "
|
||||||
"FROM trader AS t "
|
"FROM trader AS t "
|
||||||
"JOIN character_data AS c ON t.char_id = c.id;"
|
"JOIN character_data AS c ON t.char_id = c.id "
|
||||||
|
"WHERE t.char_zone_instance_id = {} "
|
||||||
|
"ORDER BY t.char_zone_instance_id ASC "
|
||||||
|
"LIMIT {}",
|
||||||
|
char_zone_instance_id,
|
||||||
|
max_results)
|
||||||
);
|
);
|
||||||
|
|
||||||
distinct_traders.reserve(results.RowCount());
|
distinct_traders.reserve(results.RowCount());
|
||||||
@@ -56,8 +68,9 @@ public:
|
|||||||
|
|
||||||
e.trader_id = Strings::ToInt(row[0]);
|
e.trader_id = Strings::ToInt(row[0]);
|
||||||
e.zone_id = Strings::ToInt(row[1]);
|
e.zone_id = Strings::ToInt(row[1]);
|
||||||
e.entity_id = Strings::ToInt(row[2]);
|
e.zone_instance_id = Strings::ToInt(row[2]);
|
||||||
e.trader_name = row[3] ? row[3] : "";
|
e.entity_id = Strings::ToInt(row[3]);
|
||||||
|
e.trader_name = row[4] ? row[4] : "";
|
||||||
all_entries.name_length += e.trader_name.length() + 1;
|
all_entries.name_length += e.trader_name.length() + 1;
|
||||||
|
|
||||||
all_entries.traders.push_back(e);
|
all_entries.traders.push_back(e);
|
||||||
@@ -221,6 +234,37 @@ public:
|
|||||||
|
|
||||||
return DeleteWhere(db, fmt::format("`id` IN({})", Strings::Implode(",", delete_ids)));
|
return DeleteWhere(db, fmt::format("`id` IN({})", Strings::Implode(",", delete_ids)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static DistinctTraders_Struct GetTraderByInstanceAndSerialnumber(
|
||||||
|
Database &db,
|
||||||
|
uint32 instance_id,
|
||||||
|
const char *serial_number
|
||||||
|
)
|
||||||
|
{
|
||||||
|
DistinctTraders_Struct trader{};
|
||||||
|
|
||||||
|
auto query = fmt::format(
|
||||||
|
"SELECT t.id, t.char_id, c.name "
|
||||||
|
"FROM trader AS t "
|
||||||
|
"JOIN character_data AS c ON c.id = t.char_id "
|
||||||
|
"WHERE t.char_zone_id = 151 AND t.char_zone_instance_id = {} AND t.item_sn = {} LIMIT 1",
|
||||||
|
instance_id,
|
||||||
|
serial_number
|
||||||
|
);
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(query);
|
||||||
|
|
||||||
|
if (results.RowCount() == 0) {
|
||||||
|
return trader;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto row = results.begin();
|
||||||
|
std::string name = row[2];
|
||||||
|
trader.trader_id = Strings::ToUnsignedInt(row[1]);
|
||||||
|
trader.trader_name = row[2] ? row[2] : "";
|
||||||
|
|
||||||
|
return trader;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //EQEMU_TRADER_REPOSITORY_H
|
#endif //EQEMU_TRADER_REPOSITORY_H
|
||||||
|
|||||||
+14
-1
@@ -340,7 +340,9 @@ RULE_STRING(World, Rules, "", "Server Rules, change from empty to have this be u
|
|||||||
RULE_BOOL(World, EnableAutoLogin, false, "Enables or disables auto login of characters, allowing people to log characters in directly from loginserver to ingame")
|
RULE_BOOL(World, EnableAutoLogin, false, "Enables or disables auto login of characters, allowing people to log characters in directly from loginserver to ingame")
|
||||||
RULE_BOOL(World, EnablePVPRegions, true, "Enables or disables PVP Regions automatically setting your PVP flag")
|
RULE_BOOL(World, EnablePVPRegions, true, "Enables or disables PVP Regions automatically setting your PVP flag")
|
||||||
RULE_STRING(World, SupportedClients, "", "Comma-delimited list of clients to restrict to. Supported values are Titanium | SoF | SoD | UF | RoF | RoF2. Example: Titanium,RoF2")
|
RULE_STRING(World, SupportedClients, "", "Comma-delimited list of clients to restrict to. Supported values are Titanium | SoF | SoD | UF | RoF | RoF2. Example: Titanium,RoF2")
|
||||||
RULE_INT(World, Id, 100, "Used by later clients to create GUIDs, expected to be Unique to the world but ultimately not that important")
|
RULE_STRING(World, CustomFilesKey, "", "Enable if the server requires custom files and sends a key to validate. Empty string to disable. Example: eqcustom_v1")
|
||||||
|
RULE_STRING(World, CustomFilesUrl, "github.com/knervous/eqnexus/releases", "URL to display at character select if client is missing custom files")
|
||||||
|
RULE_INT(World, CustomFilesAdminLevel, 20, "Admin level at which custom file key is not required when CustomFilesKey is specified")
|
||||||
RULE_CATEGORY_END()
|
RULE_CATEGORY_END()
|
||||||
|
|
||||||
RULE_CATEGORY(Zone)
|
RULE_CATEGORY(Zone)
|
||||||
@@ -370,6 +372,9 @@ RULE_INT(Zone, FishingChance, 399, "Chance of fishing from zone table vs global
|
|||||||
RULE_BOOL(Zone, AllowCrossZoneSpellsOnBots, false, "Set to true to allow cross zone spells (cast/remove) to affect bots")
|
RULE_BOOL(Zone, AllowCrossZoneSpellsOnBots, false, "Set to true to allow cross zone spells (cast/remove) to affect bots")
|
||||||
RULE_BOOL(Zone, AllowCrossZoneSpellsOnMercs, false, "Set to true to allow cross zone spells (cast/remove) to affect mercenaries")
|
RULE_BOOL(Zone, AllowCrossZoneSpellsOnMercs, false, "Set to true to allow cross zone spells (cast/remove) to affect mercenaries")
|
||||||
RULE_BOOL(Zone, AllowCrossZoneSpellsOnPets, false, "Set to true to allow cross zone spells (cast/remove) to affect pets")
|
RULE_BOOL(Zone, AllowCrossZoneSpellsOnPets, false, "Set to true to allow cross zone spells (cast/remove) to affect pets")
|
||||||
|
RULE_BOOL(Zone, ZoneShardQuestMenuOnly, false, "Set to true if you only want quests to show the zone shard menu")
|
||||||
|
RULE_BOOL(Zone, AkkadiusTempPerformanceFeatureFlag, true, "Enable or disable the Akkadius Temp Performance Feature Flag")
|
||||||
|
RULE_BOOL(Zone, EnableEntityClipping, true, "Enable or disable visual entity clipping server side")
|
||||||
RULE_CATEGORY_END()
|
RULE_CATEGORY_END()
|
||||||
|
|
||||||
RULE_CATEGORY(Map)
|
RULE_CATEGORY(Map)
|
||||||
@@ -827,6 +832,7 @@ RULE_REAL(Bazaar, ParcelDeliveryCostMod, 0.20, "Cost of parcel delivery for a ba
|
|||||||
RULE_INT(Bazaar, VoucherDeliveryCost, 200, "Number of vouchers for direct delivery for a bazaar purchase. Default is 200 vouchers. RoF+ Only.")
|
RULE_INT(Bazaar, VoucherDeliveryCost, 200, "Number of vouchers for direct delivery for a bazaar purchase. Default is 200 vouchers. RoF+ Only.")
|
||||||
RULE_BOOL(Bazaar, EnableParcelDelivery, true, "Enable bazaar purchases via parcel delivery. Default is True.")
|
RULE_BOOL(Bazaar, EnableParcelDelivery, true, "Enable bazaar purchases via parcel delivery. Default is True.")
|
||||||
RULE_INT(Bazaar, MaxBuyerInventorySearchResults, 200, "Maximum number of search results when a Buyer searches the global item list. Default is 200. RoF+ Only.")
|
RULE_INT(Bazaar, MaxBuyerInventorySearchResults, 200, "Maximum number of search results when a Buyer searches the global item list. Default is 200. RoF+ Only.")
|
||||||
|
RULE_BOOL(Bazaar, UseAlternateBazaarSearch, false, "Allows the bazaar search window to search across bazaar shards. Default is false.")
|
||||||
RULE_CATEGORY_END()
|
RULE_CATEGORY_END()
|
||||||
|
|
||||||
RULE_CATEGORY(Mail)
|
RULE_CATEGORY(Mail)
|
||||||
@@ -1035,6 +1041,13 @@ RULE_INT(Parcel, ParcelMaxItems, 50, "The maximum number of parcels a player is
|
|||||||
RULE_INT(Parcel, ParcelPruneDelay, 30, "The number of days after which a parcel is deleted. Items are lost!")
|
RULE_INT(Parcel, ParcelPruneDelay, 30, "The number of days after which a parcel is deleted. Items are lost!")
|
||||||
RULE_CATEGORY_END()
|
RULE_CATEGORY_END()
|
||||||
|
|
||||||
|
RULE_CATEGORY(EvolvingItems)
|
||||||
|
RULE_REAL(EvolvingItems, PercentOfSoloExperience, 0.1, "Percentage of solo experience allocated to evolving items that require experience.")
|
||||||
|
RULE_REAL(EvolvingItems, PercentOfGroupExperience, 0.1, "Percentage of group experience allocated to evolving items that require experience.")
|
||||||
|
RULE_REAL(EvolvingItems, PercentOfRaidExperience, 0.1, "Percentage of solo experience allocated to evolving items that require experience.")
|
||||||
|
RULE_INT(EvolvingItems, DelayUponEquipping, 30000, "Delay in ms before an evolving item will earn rewards after equipping. Default is 30000ms or 30s.")
|
||||||
|
RULE_CATEGORY_END()
|
||||||
|
|
||||||
#undef RULE_CATEGORY
|
#undef RULE_CATEGORY
|
||||||
#undef RULE_INT
|
#undef RULE_INT
|
||||||
#undef RULE_REAL
|
#undef RULE_REAL
|
||||||
|
|||||||
@@ -319,8 +319,6 @@
|
|||||||
// player events
|
// player events
|
||||||
#define ServerOP_PlayerEvent 0x5100
|
#define ServerOP_PlayerEvent 0x5100
|
||||||
|
|
||||||
#define ServerOP_DataBucketCacheUpdate 0x5200
|
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
CZUpdateType_Character,
|
CZUpdateType_Character,
|
||||||
CZUpdateType_Group,
|
CZUpdateType_Group,
|
||||||
|
|||||||
+68
-12
@@ -37,11 +37,13 @@
|
|||||||
#include "strings.h"
|
#include "strings.h"
|
||||||
#include "eqemu_config.h"
|
#include "eqemu_config.h"
|
||||||
#include "data_verification.h"
|
#include "data_verification.h"
|
||||||
|
#include "evolving_items.h"
|
||||||
#include "repositories/criteria/content_filter_criteria.h"
|
#include "repositories/criteria/content_filter_criteria.h"
|
||||||
#include "repositories/account_repository.h"
|
#include "repositories/account_repository.h"
|
||||||
#include "repositories/faction_association_repository.h"
|
#include "repositories/faction_association_repository.h"
|
||||||
#include "repositories/starting_items_repository.h"
|
#include "repositories/starting_items_repository.h"
|
||||||
#include "path_manager.h"
|
#include "path_manager.h"
|
||||||
|
#include "../zone/client.h"
|
||||||
#include "repositories/loottable_repository.h"
|
#include "repositories/loottable_repository.h"
|
||||||
#include "repositories/character_item_recast_repository.h"
|
#include "repositories/character_item_recast_repository.h"
|
||||||
#include "repositories/character_corpses_repository.h"
|
#include "repositories/character_corpses_repository.h"
|
||||||
@@ -645,15 +647,23 @@ bool SharedDatabase::GetSharedBank(uint32 id, EQ::InventoryProfile *inv, bool is
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Overloaded: Retrieve character inventory based on character id (zone entry)
|
// Overloaded: Retrieve character inventory based on character id (zone entry)
|
||||||
bool SharedDatabase::GetInventory(uint32 char_id, EQ::InventoryProfile *inv)
|
//bool SharedDatabase::GetInventory(uint32 char_id, EQ::InventoryProfile *inv)
|
||||||
|
bool SharedDatabase::GetInventory(Client *c)
|
||||||
{
|
{
|
||||||
if (!char_id || !inv)
|
if (!c) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32 char_id = c->CharacterID();
|
||||||
|
EQ::InventoryProfile &inv = c->GetInv();
|
||||||
|
|
||||||
// Retrieve character inventory
|
// Retrieve character inventory
|
||||||
auto results = InventoryRepository::GetWhere(*this, fmt::format("`charid` = '{}' ORDER BY `slotid`;", char_id));
|
auto results = InventoryRepository::GetWhere(*this, fmt::format("`charid` = '{}' ORDER BY `slotid`", char_id));
|
||||||
|
auto e_results = CharacterEvolvingItemsRepository::GetWhere(
|
||||||
|
*this, fmt::format("`char_id` = '{}' AND `deleted_at` IS NULL", char_id)
|
||||||
|
);
|
||||||
|
|
||||||
if (results.empty()) {
|
if (results.empty()) {
|
||||||
LogError("Error loading inventory for char_id {} from the database.", char_id);
|
LogError("Error loading inventory for char_id {} from the database.", char_id);
|
||||||
return false;
|
return false;
|
||||||
@@ -667,8 +677,8 @@ bool SharedDatabase::GetInventory(uint32 char_id, EQ::InventoryProfile *inv)
|
|||||||
|
|
||||||
const auto timestamps = GetItemRecastTimestamps(char_id);
|
const auto timestamps = GetItemRecastTimestamps(char_id);
|
||||||
auto cv_conflict = false;
|
auto cv_conflict = false;
|
||||||
const auto pmask = inv->GetLookup()->PossessionsBitmask;
|
const auto pmask = inv.GetLookup()->PossessionsBitmask;
|
||||||
const auto bank_size = inv->GetLookup()->InventoryTypeSize.Bank;
|
const auto bank_size = inv.GetLookup()->InventoryTypeSize.Bank;
|
||||||
|
|
||||||
std::vector<InventoryRepository::Inventory> queue{};
|
std::vector<InventoryRepository::Inventory> queue{};
|
||||||
for (auto &row: results) {
|
for (auto &row: results) {
|
||||||
@@ -785,9 +795,55 @@ bool SharedDatabase::GetInventory(uint32 char_id, EQ::InventoryProfile *inv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (item->EvolvingItem) {
|
||||||
|
if (slot_id >= EQ::invslot::EQUIPMENT_BEGIN && slot_id <= EQ::invslot::EQUIPMENT_END) {
|
||||||
|
inst->SetEvolveEquipped(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
auto t = std::ranges::find_if(
|
||||||
|
e_results.cbegin(),
|
||||||
|
e_results.cend(),
|
||||||
|
[&](const CharacterEvolvingItemsRepository::CharacterEvolvingItems &x) {
|
||||||
|
return x.item_id == item_id;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
if (t == std::end(e_results)) {
|
||||||
|
auto e = CharacterEvolvingItemsRepository::NewEntity();
|
||||||
|
|
||||||
|
e.character_id = char_id;
|
||||||
|
e.item_id = item_id;
|
||||||
|
e.equipped = inst->GetEvolveEquipped();
|
||||||
|
e.final_item_id = evolving_items_manager.GetFinalItemID(*inst);
|
||||||
|
|
||||||
|
auto r = CharacterEvolvingItemsRepository::InsertOne(*this, e);
|
||||||
|
e.id = r.id;
|
||||||
|
e_results.push_back(e);
|
||||||
|
|
||||||
|
inst->SetEvolveUniqueID(e.id);
|
||||||
|
inst->SetEvolveCharID(e.character_id);
|
||||||
|
inst->SetEvolveItemID(e.item_id);
|
||||||
|
inst->SetEvolveActivated(e.activated);
|
||||||
|
inst->SetEvolveEquipped(e.equipped);
|
||||||
|
inst->SetEvolveCurrentAmount(e.current_amount);
|
||||||
|
inst->CalculateEvolveProgression();
|
||||||
|
inst->SetEvolveFinalItemID(e.final_item_id);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
inst->SetEvolveUniqueID(t->id);
|
||||||
|
inst->SetEvolveCharID(t->character_id);
|
||||||
|
inst->SetEvolveItemID(t->item_id);
|
||||||
|
inst->SetEvolveActivated(t->activated);
|
||||||
|
inst->SetEvolveEquipped(t->equipped);
|
||||||
|
inst->SetEvolveCurrentAmount(t->current_amount);
|
||||||
|
inst->CalculateEvolveProgression();
|
||||||
|
inst->SetEvolveFinalItemID(t->final_item_id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int16 put_slot_id;
|
int16 put_slot_id;
|
||||||
if (slot_id >= 8000 && slot_id <= 8999) {
|
if (slot_id >= 8000 && slot_id <= 8999) {
|
||||||
put_slot_id = inv->PushCursor(*inst);
|
put_slot_id = inv.PushCursor(*inst);
|
||||||
}
|
}
|
||||||
else if (slot_id >= 3111 && slot_id <= 3179) {
|
else if (slot_id >= 3111 && slot_id <= 3179) {
|
||||||
// Admins: please report any occurrences of this error
|
// Admins: please report any occurrences of this error
|
||||||
@@ -797,10 +853,10 @@ bool SharedDatabase::GetInventory(uint32 char_id, EQ::InventoryProfile *inv)
|
|||||||
item_id,
|
item_id,
|
||||||
slot_id
|
slot_id
|
||||||
);
|
);
|
||||||
put_slot_id = inv->PushCursor(*inst);
|
put_slot_id = inv.PushCursor(*inst);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
put_slot_id = inv->PutItem(slot_id, *inst);
|
put_slot_id = inv.PutItem(slot_id, *inst);
|
||||||
}
|
}
|
||||||
|
|
||||||
row.guid = inst->GetSerialNumber();
|
row.guid = inst->GetSerialNumber();
|
||||||
@@ -825,8 +881,8 @@ bool SharedDatabase::GetInventory(uint32 char_id, EQ::InventoryProfile *inv)
|
|||||||
"ClientVersion/Expansion conflict during inventory load at zone entry for [{}] (charid: [{}], inver: [{}], gmi: [{}])",
|
"ClientVersion/Expansion conflict during inventory load at zone entry for [{}] (charid: [{}], inver: [{}], gmi: [{}])",
|
||||||
char_name,
|
char_name,
|
||||||
char_id,
|
char_id,
|
||||||
EQ::versions::MobVersionName(inv->InventoryVersion()),
|
EQ::versions::MobVersionName(inv.InventoryVersion()),
|
||||||
(inv->GMInventory() ? "true" : "false")
|
(inv.GMInventory() ? "true" : "false")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -837,7 +893,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, EQ::InventoryProfile *inv)
|
|||||||
EQ::ItemInstance::ClearGUIDMap();
|
EQ::ItemInstance::ClearGUIDMap();
|
||||||
|
|
||||||
// Retrieve shared inventory
|
// Retrieve shared inventory
|
||||||
return GetSharedBank(char_id, inv, true);
|
return GetSharedBank(char_id, &inv, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Overloaded: Retrieve character inventory based on account_id and character name (char select)
|
// Overloaded: Retrieve character inventory based on account_id and character name (char select)
|
||||||
|
|||||||
+3
-1
@@ -28,6 +28,8 @@
|
|||||||
#include "fixed_memory_variable_hash_set.h"
|
#include "fixed_memory_variable_hash_set.h"
|
||||||
#include "say_link.h"
|
#include "say_link.h"
|
||||||
#include "repositories/command_subsettings_repository.h"
|
#include "repositories/command_subsettings_repository.h"
|
||||||
|
#include "repositories/items_evolving_details_repository.h"
|
||||||
|
#include "../common/repositories/character_evolving_items_repository.h"
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <map>
|
#include <map>
|
||||||
@@ -103,7 +105,7 @@ public:
|
|||||||
bool GetSharedBank(uint32 id, EQ::InventoryProfile *inv, bool is_charid);
|
bool GetSharedBank(uint32 id, EQ::InventoryProfile *inv, bool is_charid);
|
||||||
int32 GetSharedPlatinum(uint32 account_id);
|
int32 GetSharedPlatinum(uint32 account_id);
|
||||||
bool SetSharedPlatinum(uint32 account_id, int32 amount_to_add);
|
bool SetSharedPlatinum(uint32 account_id, int32 amount_to_add);
|
||||||
bool GetInventory(uint32 char_id, EQ::InventoryProfile *inv);
|
bool GetInventory(Client* c);
|
||||||
bool GetInventory(uint32 account_id, char *name, EQ::InventoryProfile *inv); // deprecated
|
bool GetInventory(uint32 account_id, char *name, EQ::InventoryProfile *inv); // deprecated
|
||||||
std::map<uint32, uint32> GetItemRecastTimestamps(uint32 char_id);
|
std::map<uint32, uint32> GetItemRecastTimestamps(uint32 char_id);
|
||||||
uint32 GetItemRecastTimestamp(uint32 char_id, uint32 recast_type);
|
uint32 GetItemRecastTimestamp(uint32 char_id, uint32 recast_type);
|
||||||
|
|||||||
@@ -86,6 +86,9 @@ struct BenchTimer
|
|||||||
void reset() { start_time = clock::now(); }
|
void reset() { start_time = clock::now(); }
|
||||||
// this is seconds
|
// this is seconds
|
||||||
double elapsed() { return std::chrono::duration<double> (clock::now() - start_time).count(); }
|
double elapsed() { return std::chrono::duration<double> (clock::now() - start_time).count(); }
|
||||||
|
std::chrono::milliseconds::rep elapsedMilliseconds() { return std::chrono::duration_cast<std::chrono::milliseconds>(clock::now() - start_time).count(); }
|
||||||
|
std::chrono::microseconds::rep elapsedMicroseconds() { return std::chrono::duration_cast<std::chrono::microseconds>(clock::now() - start_time).count(); }
|
||||||
|
std::chrono::nanoseconds::rep elapsedNanoseconds() { return std::chrono::duration_cast<std::chrono::nanoseconds>(clock::now() - start_time).count(); }
|
||||||
private:
|
private:
|
||||||
std::chrono::time_point<std::chrono::high_resolution_clock> start_time;
|
std::chrono::time_point<std::chrono::high_resolution_clock> start_time;
|
||||||
};
|
};
|
||||||
|
|||||||
+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 "22.60.0-dev" // always append -dev to the current version for custom-builds
|
#define CURRENT_VERSION "22.61.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 9285
|
#define CURRENT_BINARY_DATABASE_VERSION 9290
|
||||||
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9045
|
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9045
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -679,7 +679,7 @@ int ZoneStore::GetZoneNPCMaximumAggroDistance(uint32 zone_id, int version)
|
|||||||
uint32 ZoneStore::GetZoneMaximumMovementUpdateRange(uint32 zone_id, int version)
|
uint32 ZoneStore::GetZoneMaximumMovementUpdateRange(uint32 zone_id, int version)
|
||||||
{
|
{
|
||||||
const auto& z = GetZoneVersionWithFallback(zone_id, version);
|
const auto& z = GetZoneVersionWithFallback(zone_id, version);
|
||||||
return z ? z->max_movement_update_range : DEFAULT_ZONE_MAX_MOVEMENT_UPDATE_RANGE;
|
return z ? z->npc_update_range : DEFAULT_ZONE_MAX_MOVEMENT_UPDATE_RANGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int8 ZoneStore::GetZoneMinimumExpansion(uint32 zone_id, int version)
|
int8 ZoneStore::GetZoneMinimumExpansion(uint32 zone_id, int version)
|
||||||
|
|||||||
+3
-25
@@ -573,13 +573,10 @@ void Client::SendExpansionPacketData(PlayerLoginReply_Struct& plrs)
|
|||||||
{
|
{
|
||||||
SerializeBuffer buf;
|
SerializeBuffer buf;
|
||||||
//from eqlsstr_us.txt id of each expansion, excluding 'Everquest'
|
//from eqlsstr_us.txt id of each expansion, excluding 'Everquest'
|
||||||
int ExpansionLookup[30] = { 3007, 3008, 3009, 3010, 3012,
|
int ExpansionLookup[20] = { 3007, 3008, 3009, 3010, 3012,
|
||||||
3014, 3031, 3033, 3036, 3040,
|
3014, 3031, 3033, 3036, 3040,
|
||||||
3045, 3046, 3047, 3514, 3516,
|
3045, 3046, 3047, 3514, 3516,
|
||||||
3518, 3520, 3522, 3524, 3526,
|
3518, 3520, 3522, 3524 };
|
||||||
3528, 3530, 3532, 3534, 3535,
|
|
||||||
3536, 3537, 3538, 3539, 3540
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
if (server.options.IsDisplayExpansions()) {
|
if (server.options.IsDisplayExpansions()) {
|
||||||
@@ -587,26 +584,7 @@ void Client::SendExpansionPacketData(PlayerLoginReply_Struct& plrs)
|
|||||||
int32_t expansion = server.options.GetMaxExpansions();
|
int32_t expansion = server.options.GetMaxExpansions();
|
||||||
int32_t owned_expansion = (expansion << 1) | 1;
|
int32_t owned_expansion = (expansion << 1) | 1;
|
||||||
|
|
||||||
if (m_client_version == cv_laurion) {
|
if (m_client_version == cv_sod) {
|
||||||
buf.WriteInt32(0x00);
|
|
||||||
buf.WriteInt32(0x00);
|
|
||||||
buf.WriteInt16(0x00);
|
|
||||||
buf.WriteInt32(30);
|
|
||||||
|
|
||||||
for (int i = 0; i < 30; i++)
|
|
||||||
{
|
|
||||||
buf.WriteUInt32(i + 1);
|
|
||||||
buf.WriteUInt8(1);
|
|
||||||
buf.WriteInt32(ExpansionLookup[i]);
|
|
||||||
buf.WriteInt32(6046);
|
|
||||||
buf.WriteUInt32(0xFFFFFFFF);
|
|
||||||
buf.WriteUInt32(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
auto out = std::make_unique<EQApplicationPacket>(OP_LoginExpansionPacketData, buf);
|
|
||||||
m_connection->QueuePacket(out.get());
|
|
||||||
}
|
|
||||||
else if (m_client_version == cv_sod) {
|
|
||||||
|
|
||||||
// header info of packet. Requires OP_LoginExpansionPacketData=0x0031 to be in login_opcodes_sod.conf
|
// header info of packet. Requires OP_LoginExpansionPacketData=0x0031 to be in login_opcodes_sod.conf
|
||||||
buf.WriteInt32(0x00);
|
buf.WriteInt32(0x00);
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ void CheckSoDOpcodeFile(const std::string& path) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CheckLaurionOpcodeFile(const std::string& path) {
|
void CheckLarionOpcodeFile(const std::string& path) {
|
||||||
if (File::Exists(path)) {
|
if (File::Exists(path)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -158,40 +158,40 @@ ClientManager::ClientManager()
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
int laurion_port = server.config.GetVariableInt("client_configuration", "laurion_port", 15900);
|
int larion_port = server.config.GetVariableInt("client_configuration", "larion_port", 15900);
|
||||||
|
|
||||||
EQStreamManagerInterfaceOptions laurion_opts(laurion_port, false, false);
|
EQStreamManagerInterfaceOptions larion_opts(larion_port, false, false);
|
||||||
|
|
||||||
laurion_stream = new EQ::Net::EQStreamManager(laurion_opts);
|
larion_stream = new EQ::Net::EQStreamManager(larion_opts);
|
||||||
laurion_ops = new RegularOpcodeManager;
|
larion_ops = new RegularOpcodeManager;
|
||||||
|
|
||||||
opcodes_path = fmt::format(
|
opcodes_path = fmt::format(
|
||||||
"{}/{}",
|
"{}/{}",
|
||||||
path.GetOpcodePath(),
|
path.GetOpcodePath(),
|
||||||
"login_opcodes_laurion.conf"
|
"login_opcodes_larion.conf"
|
||||||
);
|
);
|
||||||
|
|
||||||
CheckLaurionOpcodeFile(opcodes_path);
|
CheckLarionOpcodeFile(opcodes_path);
|
||||||
|
|
||||||
if (!laurion_ops->LoadOpcodes(opcodes_path.c_str())) {
|
if (!larion_ops->LoadOpcodes(opcodes_path.c_str())) {
|
||||||
LogError(
|
LogError(
|
||||||
"ClientManager fatal error: couldn't load opcodes for Laurion file [{0}]",
|
"ClientManager fatal error: couldn't load opcodes for Larion file [{0}]",
|
||||||
server.config.GetVariableString("client_configuration", "laurion_opcodes", "login_opcodes.conf")
|
server.config.GetVariableString("client_configuration", "larion_opcodes", "login_opcodes.conf")
|
||||||
);
|
);
|
||||||
|
|
||||||
run_server = false;
|
run_server = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
laurion_stream->OnNewConnection(
|
larion_stream->OnNewConnection(
|
||||||
[this](std::shared_ptr<EQ::Net::EQStream> stream) {
|
[this](std::shared_ptr<EQ::Net::EQStream> stream) {
|
||||||
LogInfo(
|
LogInfo(
|
||||||
"New Laurion client connection from [{0}:{1}]",
|
"New Larion client connection from [{0}:{1}]",
|
||||||
long2ip(stream->GetRemoteIP()),
|
long2ip(stream->GetRemoteIP()),
|
||||||
stream->GetRemotePort()
|
stream->GetRemotePort()
|
||||||
);
|
);
|
||||||
|
|
||||||
stream->SetOpcodeManager(&laurion_ops);
|
stream->SetOpcodeManager(&larion_ops);
|
||||||
Client* c = new Client(stream, cv_laurion);
|
Client* c = new Client(stream, cv_larion);
|
||||||
clients.push_back(c);
|
clients.push_back(c);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -55,8 +55,8 @@ private:
|
|||||||
EQ::Net::EQStreamManager *titanium_stream;
|
EQ::Net::EQStreamManager *titanium_stream;
|
||||||
OpcodeManager *sod_ops;
|
OpcodeManager *sod_ops;
|
||||||
EQ::Net::EQStreamManager *sod_stream;
|
EQ::Net::EQStreamManager *sod_stream;
|
||||||
OpcodeManager *laurion_ops;
|
OpcodeManager *larion_ops;
|
||||||
EQ::Net::EQStreamManager* laurion_stream;
|
EQ::Net::EQStreamManager* larion_stream;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ struct PlayEverquestResponse_Struct {
|
|||||||
enum LSClientVersion {
|
enum LSClientVersion {
|
||||||
cv_titanium,
|
cv_titanium,
|
||||||
cv_sod,
|
cv_sod,
|
||||||
cv_laurion
|
cv_larion
|
||||||
};
|
};
|
||||||
|
|
||||||
enum LSClientStatus {
|
enum LSClientStatus {
|
||||||
|
|||||||
@@ -51,12 +51,6 @@ WorldServer::WorldServer(std::shared_ptr<EQ::Net::ServertalkServerConnection> wo
|
|||||||
ServerOP_LSAccountUpdate,
|
ServerOP_LSAccountUpdate,
|
||||||
std::bind(&WorldServer::ProcessLSAccountUpdate, this, std::placeholders::_1, std::placeholders::_2)
|
std::bind(&WorldServer::ProcessLSAccountUpdate, this, std::placeholders::_1, std::placeholders::_2)
|
||||||
);
|
);
|
||||||
|
|
||||||
m_keepalive = std::make_unique<EQ::Timer>(
|
|
||||||
1000,
|
|
||||||
true,
|
|
||||||
std::bind(&WorldServer::OnKeepAlive, this, std::placeholders::_1)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
WorldServer::~WorldServer() = default;
|
WorldServer::~WorldServer() = default;
|
||||||
@@ -977,7 +971,8 @@ bool WorldServer::ValidateWorldServerAdminLogin(
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldServer::SerializeForClientServerListLegacy(class SerializeBuffer& out, bool use_local_ip) const {
|
void WorldServer::SerializeForClientServerList(SerializeBuffer& out, bool use_local_ip, LSClientVersion version) const
|
||||||
|
{
|
||||||
// see LoginClientServerData_Struct
|
// see LoginClientServerData_Struct
|
||||||
if (use_local_ip) {
|
if (use_local_ip) {
|
||||||
out.WriteString(GetLocalIP());
|
out.WriteString(GetLocalIP());
|
||||||
@@ -986,6 +981,10 @@ void WorldServer::SerializeForClientServerListLegacy(class SerializeBuffer& out,
|
|||||||
out.WriteString(GetRemoteIP());
|
out.WriteString(GetRemoteIP());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (version == cv_larion) {
|
||||||
|
out.WriteUInt32(9000);
|
||||||
|
}
|
||||||
|
|
||||||
switch (GetServerListID()) {
|
switch (GetServerListID()) {
|
||||||
case LS::ServerType::Legends:
|
case LS::ServerType::Legends:
|
||||||
out.WriteInt32(LS::ServerTypeFlags::Legends);
|
out.WriteInt32(LS::ServerTypeFlags::Legends);
|
||||||
@@ -997,8 +996,15 @@ void WorldServer::SerializeForClientServerListLegacy(class SerializeBuffer& out,
|
|||||||
out.WriteInt32(LS::ServerTypeFlags::Standard);
|
out.WriteInt32(LS::ServerTypeFlags::Standard);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (version == cv_larion) {
|
||||||
|
auto server_id = GetServerId();
|
||||||
|
//if this is 0, the client will not show the server in the list
|
||||||
|
out.WriteUInt32(1);
|
||||||
|
out.WriteUInt32(server_id);
|
||||||
|
}
|
||||||
|
else {
|
||||||
out.WriteUInt32(GetServerId());
|
out.WriteUInt32(GetServerId());
|
||||||
|
}
|
||||||
|
|
||||||
out.WriteString(GetServerLongName());
|
out.WriteString(GetServerLongName());
|
||||||
out.WriteString("us"); // country code
|
out.WriteString("us"); // country code
|
||||||
@@ -1020,61 +1026,6 @@ void WorldServer::SerializeForClientServerListLegacy(class SerializeBuffer& out,
|
|||||||
out.WriteUInt32(GetPlayersOnline());
|
out.WriteUInt32(GetPlayersOnline());
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldServer::SerializeForClientServerListLaurion(class SerializeBuffer& out, bool use_local_ip) const {
|
|
||||||
if (use_local_ip) {
|
|
||||||
out.WriteString(GetLocalIP());
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
out.WriteString(GetRemoteIP());
|
|
||||||
}
|
|
||||||
|
|
||||||
out.WriteUInt32(9000);
|
|
||||||
out.WriteUInt32(0);
|
|
||||||
|
|
||||||
uint32_t flags = 32; //all servers i saw had this set
|
|
||||||
switch (GetServerListID()) {
|
|
||||||
case LS::ServerType::Legends:
|
|
||||||
flags += LS::ServerTypeFlags::Legends;
|
|
||||||
break;
|
|
||||||
case LS::ServerType::Preferred:
|
|
||||||
flags += LS::ServerTypeFlags::Preferred;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
flags += LS::ServerTypeFlags::Standard;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
out.WriteUInt32(flags);
|
|
||||||
out.WriteUInt32(GetServerId());
|
|
||||||
out.WriteString(GetServerLongName());
|
|
||||||
out.WriteString("EN");
|
|
||||||
out.WriteString("US");
|
|
||||||
|
|
||||||
if (GetStatus() < 0) {
|
|
||||||
if (GetZonesBooted() == 0) {
|
|
||||||
out.WriteInt32(LS::ServerStatusFlags::Down);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
out.WriteInt32(LS::ServerStatusFlags::Locked);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
out.WriteInt32(LS::ServerStatusFlags::Up);
|
|
||||||
}
|
|
||||||
|
|
||||||
out.WriteUInt32(GetPlayersOnline());
|
|
||||||
}
|
|
||||||
|
|
||||||
void WorldServer::SerializeForClientServerList(SerializeBuffer& out, bool use_local_ip, LSClientVersion version) const
|
|
||||||
{
|
|
||||||
if (version == cv_laurion) {
|
|
||||||
SerializeForClientServerListLaurion(out, use_local_ip);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
SerializeForClientServerListLegacy(out, use_local_ip);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param in_server_list_id
|
* @param in_server_list_id
|
||||||
* @return
|
* @return
|
||||||
@@ -1350,12 +1301,6 @@ const std::string &WorldServer::GetVersion() const
|
|||||||
return m_version;
|
return m_version;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldServer::OnKeepAlive(EQ::Timer *t)
|
|
||||||
{
|
|
||||||
ServerPacket pack(ServerOP_KeepAlive, 0);
|
|
||||||
m_connection->SendPacket(&pack);
|
|
||||||
}
|
|
||||||
|
|
||||||
void WorldServer::FormatWorldServerName(char *name, int8 server_list_type)
|
void WorldServer::FormatWorldServerName(char *name, int8 server_list_type)
|
||||||
{
|
{
|
||||||
std::string server_long_name = name;
|
std::string server_long_name = name;
|
||||||
|
|||||||
@@ -149,10 +149,7 @@ public:
|
|||||||
|
|
||||||
bool HandleNewLoginserverRegisteredOnly(Database::DbWorldRegistration &world_registration);
|
bool HandleNewLoginserverRegisteredOnly(Database::DbWorldRegistration &world_registration);
|
||||||
bool HandleNewLoginserverInfoUnregisteredAllowed(Database::DbWorldRegistration &world_registration);
|
bool HandleNewLoginserverInfoUnregisteredAllowed(Database::DbWorldRegistration &world_registration);
|
||||||
private:
|
|
||||||
void SerializeForClientServerListLegacy(class SerializeBuffer& out, bool use_local_ip) const;
|
|
||||||
void SerializeForClientServerListLaurion(class SerializeBuffer& out, bool use_local_ip) const;
|
|
||||||
public:
|
|
||||||
void SerializeForClientServerList(class SerializeBuffer& out, bool use_local_ip, LSClientVersion version) const;
|
void SerializeForClientServerList(class SerializeBuffer& out, bool use_local_ip, LSClientVersion version) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -190,13 +187,6 @@ private:
|
|||||||
bool m_is_server_logged_in;
|
bool m_is_server_logged_in;
|
||||||
bool m_is_server_trusted;
|
bool m_is_server_trusted;
|
||||||
|
|
||||||
/**
|
|
||||||
* Keepalive
|
|
||||||
* @param t
|
|
||||||
*/
|
|
||||||
void OnKeepAlive(EQ::Timer *t);
|
|
||||||
std::unique_ptr<EQ::Timer> m_keepalive;
|
|
||||||
|
|
||||||
static void FormatWorldServerName(char *name, int8 server_list_type);
|
static void FormatWorldServerName(char *name, int8 server_list_type);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "eqemu-server",
|
"name": "eqemu-server",
|
||||||
"version": "22.60.0",
|
"version": "22.61.0",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/EQEmu/Server.git"
|
"url": "https://github.com/EQEmu/Server.git"
|
||||||
|
|||||||
@@ -33,12 +33,14 @@
|
|||||||
#include "../common/zone_store.h"
|
#include "../common/zone_store.h"
|
||||||
#include "../common/path_manager.h"
|
#include "../common/path_manager.h"
|
||||||
#include "../common/events/player_event_logs.h"
|
#include "../common/events/player_event_logs.h"
|
||||||
|
#include "../common/evolving_items.h"
|
||||||
|
|
||||||
EQEmuLogSys LogSys;
|
EQEmuLogSys LogSys;
|
||||||
WorldContentService content_service;
|
WorldContentService content_service;
|
||||||
ZoneStore zone_store;
|
ZoneStore zone_store;
|
||||||
PathManager path;
|
PathManager path;
|
||||||
PlayerEventLogs player_event_logs;
|
PlayerEventLogs player_event_logs;
|
||||||
|
EvolvingItemsManager evolving_items_manager;
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WINDOWS
|
||||||
#include <direct.h>
|
#include <direct.h>
|
||||||
|
|||||||
@@ -1,699 +0,0 @@
|
|||||||
# ShowEQ Import Notes:
|
|
||||||
# ZERO THE FILE first
|
|
||||||
# perl -pi -e 's/0x[0-9a-fA-F]{4}/0x0000/g' opcodes.conf
|
|
||||||
# Unknown Mapping:
|
|
||||||
# OP_Action2 -> OP_Damage
|
|
||||||
# OP_EnvDamage -> OP_Damage ---> might have been a one time mistake
|
|
||||||
# Name Differences:
|
|
||||||
# OP_CancelInvite -> OP_GroupCancelInvite
|
|
||||||
# OP_GMFind -> OP_FindPersonRequest
|
|
||||||
# OP_CommonMessage -> OP_ChannelMessage
|
|
||||||
|
|
||||||
OP_Unknown=0x0000
|
|
||||||
OP_ExploreUnknown=0x0000 # used for unknown explorer
|
|
||||||
|
|
||||||
# world packets
|
|
||||||
# Required to reach Char Select:
|
|
||||||
OP_SendLoginInfo=0x2fca
|
|
||||||
OP_ApproveWorld=0x0000
|
|
||||||
OP_LogServer=0x6d4d
|
|
||||||
OP_SendCharInfo=0x832
|
|
||||||
OP_ExpansionInfo=0x066d
|
|
||||||
OP_EnterWorld=0x6691
|
|
||||||
OP_PostEnterWorld=0x2062
|
|
||||||
OP_World_Client_CRC1=0x74c8
|
|
||||||
OP_World_Client_CRC2=0x3984
|
|
||||||
OP_World_Client_CRC3=0x6516
|
|
||||||
OP_SendSpellChecksum=0x0000
|
|
||||||
OP_SendSkillCapsChecksum=0x0000
|
|
||||||
|
|
||||||
# Character Select Related:
|
|
||||||
OP_SendMaxCharacters=0x13af
|
|
||||||
OP_SendMembership=0x2aca
|
|
||||||
OP_SendMembershipDetails=0x2608
|
|
||||||
OP_CharacterCreateRequest=0x2df4
|
|
||||||
OP_CharacterCreate=0x6a3c
|
|
||||||
OP_DeleteCharacter=x67d7
|
|
||||||
OP_RandomNameGenerator=0x49d9
|
|
||||||
OP_ApproveName=0x11e5
|
|
||||||
OP_MOTD=0x0be4
|
|
||||||
OP_SetChatServer=0x0000
|
|
||||||
OP_SetChatServer2=0x2726
|
|
||||||
OP_ZoneServerInfo=0x2273
|
|
||||||
OP_WorldComplete=0x195c
|
|
||||||
OP_WorldUnknown001=0x2049
|
|
||||||
OP_FloatListThing=0x66fd
|
|
||||||
|
|
||||||
# Reasons for Disconnect:
|
|
||||||
OP_ZoneUnavail=0x582d
|
|
||||||
OP_WorldClientReady=0x7ed8
|
|
||||||
OP_CharacterStillInZone=0x0000
|
|
||||||
OP_WorldChecksumFailure=0x0000
|
|
||||||
OP_WorldLoginFailed=0x0000
|
|
||||||
OP_WorldLogout=0x0000
|
|
||||||
OP_WorldLevelTooHigh=0x0000
|
|
||||||
OP_CharInacessable=0x0000
|
|
||||||
OP_UserCompInfo=0x0000
|
|
||||||
OP_SendExeChecksum=0x0000
|
|
||||||
OP_SendBaseDataChecksum=0x0000
|
|
||||||
|
|
||||||
# Zone in opcodes
|
|
||||||
OP_AckPacket=0x77c9
|
|
||||||
OP_ZoneEntry=0x784a
|
|
||||||
OP_ReqNewZone=0x3895
|
|
||||||
OP_NewZone=0x4341
|
|
||||||
OP_ZoneSpawns=0x17d9
|
|
||||||
OP_PlayerProfile=0x1c76
|
|
||||||
OP_TimeOfDay=0x3736
|
|
||||||
OP_LevelUpdate=0x0eb2
|
|
||||||
OP_Stamina=0x1563
|
|
||||||
OP_RequestClientZoneChange=0x0191
|
|
||||||
OP_ZoneChange=0x17a3
|
|
||||||
OP_LockoutTimerInfo=0x0000
|
|
||||||
OP_ZoneServerReady=0x0000
|
|
||||||
OP_ZoneInUnknown=0x0000
|
|
||||||
OP_LogoutReply=0x0000
|
|
||||||
OP_PreLogoutReply=0x0000
|
|
||||||
|
|
||||||
# Required to fully log in
|
|
||||||
OP_SpawnAppearance=0x4eb0
|
|
||||||
OP_ChangeSize=0x2fdc
|
|
||||||
OP_Weather=0x6fe6
|
|
||||||
OP_ReqClientSpawn=0x6732
|
|
||||||
OP_SpawnDoor=0x4273
|
|
||||||
OP_GroundSpawn=0x49c5
|
|
||||||
OP_SendZonepoints=0x279f
|
|
||||||
OP_BlockedBuffs=0x4fdb
|
|
||||||
OP_RemoveBlockedBuffs=0x53cd
|
|
||||||
OP_ClearBlockedBuffs=0x5752
|
|
||||||
OP_WorldObjectsSent=0x2879
|
|
||||||
OP_SendExpZonein=0x02b4
|
|
||||||
OP_SendAATable=0x5f30
|
|
||||||
OP_ClearAA=0x3498
|
|
||||||
OP_ClearLeadershipAbilities=0x0000 #removed; leadership abilities are baked in and always on
|
|
||||||
OP_RespondAA=0x4c67
|
|
||||||
OP_UpdateAA=0x3b30
|
|
||||||
OP_SendAAStats=0x7d65 #i'll be honest i think this was removed at some point but this is the op at the spot in the list
|
|
||||||
OP_AAExpUpdate=0x642f #need to look into whether this has changed; exp did
|
|
||||||
OP_ExpUpdate=0x611d
|
|
||||||
OP_HPUpdate=0x775c
|
|
||||||
OP_ManaChange=0x700f
|
|
||||||
OP_TGB=0x0000 #removed; tgb is baked in and always on
|
|
||||||
OP_SpecialMesg=0x7d93
|
|
||||||
OP_CharInventory=0x21d6
|
|
||||||
OP_WearChange=0x44c0
|
|
||||||
OP_ClientUpdate=0x3a4b
|
|
||||||
OP_ClientReady=0x0831
|
|
||||||
OP_SetServerFilter=0x6b7f
|
|
||||||
|
|
||||||
# Guild Opcodes
|
|
||||||
OP_GuildsList=0x0000
|
|
||||||
OP_GuildMemberList=0x0000
|
|
||||||
OP_GuildMOTD=0x0000
|
|
||||||
OP_GetGuildMOTD=0x0000
|
|
||||||
OP_GetGuildMOTDReply=0x0000
|
|
||||||
OP_GuildMemberUpdate=0x0000
|
|
||||||
OP_GuildInvite=0x0000
|
|
||||||
OP_GuildRemove=0x0000
|
|
||||||
OP_GuildPeace=0x0000
|
|
||||||
OP_SetGuildMOTD=0x0000
|
|
||||||
OP_GuildWar=0x0000
|
|
||||||
OP_GuildLeader=0x0000
|
|
||||||
OP_GuildDelete=0x0000
|
|
||||||
OP_GuildInviteAccept=0x0000
|
|
||||||
OP_GuildDemote=0x0000
|
|
||||||
OP_GuildPromote=0x0000
|
|
||||||
OP_GuildPublicNote=0x0000
|
|
||||||
OP_GuildManageBanker=0x0000
|
|
||||||
OP_GuildBank=0x0000
|
|
||||||
OP_GuildBankItemList=0x0000
|
|
||||||
OP_SetGuildRank=0x0000
|
|
||||||
OP_GuildUpdate=0x0000
|
|
||||||
OP_GuildStatus=0x0000
|
|
||||||
OP_GuildCreate=0x0000
|
|
||||||
OP_GuildOpenGuildWindow=0x0000
|
|
||||||
OP_GuildMemberLevel=0x0000
|
|
||||||
OP_GuildMemberRankAltBanker=0x0000
|
|
||||||
OP_GuildMemberPublicNote=0x0000
|
|
||||||
OP_GuildMemberAdd=0x0000
|
|
||||||
OP_GuildMemberRename=0x0000
|
|
||||||
OP_GuildMemberDelete=0x0000
|
|
||||||
OP_GuildMemberDetails=0x0000
|
|
||||||
OP_GuildRenameGuild=0x0000
|
|
||||||
OP_LFGuild=0x0000
|
|
||||||
OP_GuildDeleteGuild=0x0000
|
|
||||||
|
|
||||||
# GM/Guide Opcodes
|
|
||||||
OP_GMServers=0x0000
|
|
||||||
OP_GMBecomeNPC=0x0000
|
|
||||||
OP_GMZoneRequest=0x0000
|
|
||||||
OP_GMZoneRequest2=0x0000
|
|
||||||
OP_GMGoto=0x0000
|
|
||||||
OP_GMSearchCorpse=0x0000
|
|
||||||
OP_GMHideMe=0x0000
|
|
||||||
OP_GMDelCorpse=0x0000
|
|
||||||
OP_GMApproval=0x0000
|
|
||||||
OP_GMToggle=0x0000
|
|
||||||
OP_GMSummon=0x0000
|
|
||||||
OP_GMEmoteZone=0x0000
|
|
||||||
OP_GMEmoteWorld=0x0000
|
|
||||||
OP_GMFind=0x0000
|
|
||||||
OP_GMKick=0x0000
|
|
||||||
OP_GMKill=0x0000
|
|
||||||
OP_GMNameChange=0x0000
|
|
||||||
OP_GMLastName=0x0000
|
|
||||||
|
|
||||||
# Misc Opcodes
|
|
||||||
OP_QueryUCSServerStatus=0x2570
|
|
||||||
OP_InspectRequest=0x0000
|
|
||||||
OP_InspectAnswer=0x0000
|
|
||||||
OP_InspectMessageUpdate=0x0000
|
|
||||||
OP_BeginCast=0x31f9
|
|
||||||
OP_ColoredText=0x0f3c
|
|
||||||
OP_ConsentResponse=0x3229
|
|
||||||
OP_MemorizeSpell=0x1d31
|
|
||||||
OP_LinkedReuse=0x7a8e
|
|
||||||
OP_SwapSpell=0x63c7
|
|
||||||
OP_CastSpell=0x325b
|
|
||||||
OP_Consider=0x53e3
|
|
||||||
OP_FormattedMessage=0x7f7f
|
|
||||||
OP_SimpleMessage=0x1943
|
|
||||||
OP_Buff=0x6ce5
|
|
||||||
OP_Illusion=0x5a3f
|
|
||||||
OP_MoneyOnCorpse=0x39d3
|
|
||||||
OP_RandomReply=0x6603
|
|
||||||
OP_DenyResponse=0x3f2c
|
|
||||||
OP_SkillUpdate=0x6735
|
|
||||||
OP_GMTrainSkillConfirm=0x6fbc
|
|
||||||
OP_RandomReq=0x528a
|
|
||||||
OP_Death=0x429a
|
|
||||||
OP_GMTraining=0x7c7a
|
|
||||||
OP_GMEndTraining=0x3ec6
|
|
||||||
OP_GMTrainSkill=0x54e1
|
|
||||||
OP_Animation=0x79c7
|
|
||||||
OP_Begging=0x7ded
|
|
||||||
OP_Consent=0x44fc
|
|
||||||
OP_ConsentDeny=0x3df9
|
|
||||||
OP_AutoFire=0x5280
|
|
||||||
OP_PetCommands=0x0000
|
|
||||||
OP_PetCommandState=0x0000
|
|
||||||
OP_PetHoTT=0x0000
|
|
||||||
OP_DeleteSpell=0x4281
|
|
||||||
OP_Surname=0x0000
|
|
||||||
OP_ClearSurname=0x0000
|
|
||||||
OP_FaceChange=0x0000
|
|
||||||
OP_SetFace=0x0000
|
|
||||||
OP_SenseHeading=0x6fcf
|
|
||||||
OP_Action=0x4c13
|
|
||||||
OP_ConsiderCorpse=0x6092
|
|
||||||
OP_HideCorpse=0x3f5c
|
|
||||||
OP_CorpseDrag=0x234d
|
|
||||||
OP_CorpseDrop=0x4342
|
|
||||||
OP_Bug=0x770b
|
|
||||||
OP_Feedback=0x0000
|
|
||||||
OP_Report=0x5bcf
|
|
||||||
OP_Damage=0x7d07
|
|
||||||
OP_ChannelMessage=0x6adc
|
|
||||||
OP_Assist=0x51f1
|
|
||||||
OP_AssistGroup=0x3f23
|
|
||||||
OP_MoveCoin=0x4e6a
|
|
||||||
OP_ZonePlayerToBind=0x5643
|
|
||||||
OP_KeyRing=0x0000
|
|
||||||
OP_WhoAllRequest=0x2a09
|
|
||||||
OP_WhoAllResponse=0x6404
|
|
||||||
OP_FriendsWho=0x75a2
|
|
||||||
OP_ConfirmDelete=0x4dd0
|
|
||||||
OP_Logout=0x771d
|
|
||||||
OP_Rewind=0x2b19
|
|
||||||
OP_TargetCommand=0x3b18
|
|
||||||
OP_Hide=0x1cdf
|
|
||||||
OP_Jump=0x6fa0
|
|
||||||
OP_Camp=0x326f
|
|
||||||
OP_Emote=0x0000
|
|
||||||
OP_SetRunMode=0x1449
|
|
||||||
OP_BankerChange=0x2a33
|
|
||||||
OP_TargetMouse=0x5741
|
|
||||||
OP_MobHealth=0x5b77
|
|
||||||
OP_InitialMobHealth=0x0000 # Unused?
|
|
||||||
OP_TargetHoTT=0x0000
|
|
||||||
OP_TargetBuffs=0x0000
|
|
||||||
OP_XTargetResponse=0x0000
|
|
||||||
OP_XTargetRequest=0x0000
|
|
||||||
OP_XTargetAutoAddHaters=0x0000
|
|
||||||
OP_XTargetOpen=0x0000
|
|
||||||
OP_XTargetOpenResponse=0x0000
|
|
||||||
OP_BuffCreate=0x27a1
|
|
||||||
OP_BuffRemoveRequest=0x4507
|
|
||||||
OP_DeleteSpawn=0x7712
|
|
||||||
OP_AutoAttack=0x3f03
|
|
||||||
OP_AutoAttack2=0x1c31
|
|
||||||
OP_Consume=0x5ef7
|
|
||||||
OP_MoveItem=0x11e3
|
|
||||||
OP_MoveMultipleItems=0x5205
|
|
||||||
OP_DeleteItem=0x0150
|
|
||||||
OP_DeleteCharge=0x1b7e
|
|
||||||
OP_ItemPacket=0x7d43
|
|
||||||
OP_ItemLinkResponse=0x0000
|
|
||||||
OP_ItemLinkClick=0x0000
|
|
||||||
OP_ItemPreview=0x0000
|
|
||||||
OP_NewSpawn=0x3ea8
|
|
||||||
OP_Track=0x5351
|
|
||||||
OP_TrackTarget=0x611a
|
|
||||||
OP_TrackUnknown=0x2c7a
|
|
||||||
OP_ClickDoor=0x733c
|
|
||||||
OP_MoveDoor=0x567c
|
|
||||||
OP_RemoveAllDoors=0x73e8
|
|
||||||
OP_EnvDamage=0x1ffd
|
|
||||||
OP_BoardBoat=0x7015
|
|
||||||
OP_LeaveBoat=0x2486
|
|
||||||
OP_ControlBoat=0x166f
|
|
||||||
OP_Forage=0x4c52
|
|
||||||
OP_SafeFallSuccess=0x6690
|
|
||||||
OP_RezzComplete=0x0000
|
|
||||||
OP_RezzRequest=0x0000
|
|
||||||
OP_RezzAnswer=0x0000
|
|
||||||
OP_Shielding=0x0000
|
|
||||||
OP_RequestDuel=0x0000
|
|
||||||
OP_MobRename=0x0000
|
|
||||||
OP_AugmentItem=0x3a1b
|
|
||||||
OP_WeaponEquip1=0x0000
|
|
||||||
OP_PlayerStateAdd=0x2178
|
|
||||||
OP_PlayerStateRemove=0x178e
|
|
||||||
OP_ApplyPoison=0x55b9
|
|
||||||
OP_Save=0x6da2
|
|
||||||
OP_TestBuff=0x0000
|
|
||||||
OP_CustomTitles=0x0000
|
|
||||||
OP_Split=0x7f6e
|
|
||||||
OP_YellForHelp=0x5fc9
|
|
||||||
OP_LoadSpellSet=0x0000
|
|
||||||
OP_Bandolier=0x0000
|
|
||||||
OP_PotionBelt=0x0000
|
|
||||||
OP_DuelDecline=0x0000
|
|
||||||
OP_DuelAccept=0x0000
|
|
||||||
OP_SaveOnZoneReq=0x3bfe
|
|
||||||
OP_ReadBook=0x51af
|
|
||||||
OP_Dye=0x0000
|
|
||||||
OP_InterruptCast=0x1d71
|
|
||||||
OP_AAAction=0x71BB
|
|
||||||
OP_LeadershipExpToggle=0x0000 #removed, these act as if all purchased now
|
|
||||||
OP_LeadershipExpUpdate=0x0000 #removed, these act as if all purchased now
|
|
||||||
OP_PurchaseLeadershipAA=0x0000 #removed, these act as if all purchased now
|
|
||||||
OP_UpdateLeadershipAA=0x0000 #removed, these act as if all purchased now
|
|
||||||
OP_MarkNPC=0x0000
|
|
||||||
OP_ClearNPCMarks=0x0000
|
|
||||||
OP_DelegateAbility=0x0000
|
|
||||||
OP_SetGroupTarget=0x0000
|
|
||||||
OP_Charm=0x66bb
|
|
||||||
OP_Stun=0x34be
|
|
||||||
OP_SendFindableNPCs=0x0000
|
|
||||||
OP_FindPersonRequest=0x0000
|
|
||||||
OP_FindPersonReply=0x0000
|
|
||||||
OP_Sound=0x2fa8
|
|
||||||
OP_CashReward=0x5e23
|
|
||||||
OP_PetBuffWindow=0x0000
|
|
||||||
OP_LevelAppearance=0x5d24
|
|
||||||
OP_Translocate=0x2772
|
|
||||||
OP_Sacrifice=0x2cbf
|
|
||||||
OP_PopupResponse=0x6be9
|
|
||||||
OP_OnLevelMessage=0x2a41
|
|
||||||
OP_AugmentInfo=0x2e11
|
|
||||||
OP_Petition=0x0000
|
|
||||||
OP_SomeItemPacketMaybe=0x0000
|
|
||||||
OP_PVPStats=0x0000
|
|
||||||
OP_PVPLeaderBoardRequest=0x0000
|
|
||||||
OP_PVPLeaderBoardReply=0x0000
|
|
||||||
OP_PVPLeaderBoardDetailsRequest=0x0000
|
|
||||||
OP_PVPLeaderBoardDetailsReply=0x0000
|
|
||||||
OP_RestState=0x0a92
|
|
||||||
OP_RespawnWindow=0x55ed
|
|
||||||
OP_LDoNButton=0x0000
|
|
||||||
OP_SetStartCity=0x0000
|
|
||||||
OP_VoiceMacroIn=0x703f
|
|
||||||
OP_VoiceMacroOut=0x72d1
|
|
||||||
OP_ItemViewUnknown=0x0000
|
|
||||||
OP_VetRewardsAvaliable=0x0000
|
|
||||||
OP_VetClaimRequest=0x0000
|
|
||||||
OP_VetClaimReply=0x0000
|
|
||||||
OP_DisciplineUpdate=0x6ce4
|
|
||||||
OP_DisciplineTimer=0x7436
|
|
||||||
OP_BecomeCorpse=0x0000 # Unused?
|
|
||||||
OP_Action2=0x0000 # Unused?
|
|
||||||
OP_MobUpdate=0x0000
|
|
||||||
OP_NPCMoveUpdate=0x0000
|
|
||||||
OP_CameraEffect=0x2f01
|
|
||||||
OP_SpellEffect=0x7378
|
|
||||||
OP_AddNimbusEffect=0x069f
|
|
||||||
OP_RemoveNimbusEffect=0x19ee
|
|
||||||
OP_AltCurrency=0x0000
|
|
||||||
OP_AltCurrencyMerchantRequest=0x0000
|
|
||||||
OP_AltCurrencyMerchantReply=0x0000
|
|
||||||
OP_AltCurrencyPurchase=0x0000
|
|
||||||
OP_AltCurrencySell=0x0000
|
|
||||||
OP_AltCurrencySellSelection=0x0000
|
|
||||||
OP_AltCurrencyReclaim=0x0000
|
|
||||||
OP_CrystalCountUpdate=0x0000
|
|
||||||
OP_CrystalCreate=0x0000
|
|
||||||
OP_CrystalReclaim=0x0000
|
|
||||||
OP_Untargetable=0x026f
|
|
||||||
OP_IncreaseStats=0x1005
|
|
||||||
OP_Weblink=0x16a3
|
|
||||||
OP_OpenContainer=0x6758
|
|
||||||
OP_Marquee=0x6bca
|
|
||||||
OP_ItemRecastDelay=0x547a
|
|
||||||
#OP_OpenInventory=0x0000 # Likely does not exist in RoF -U
|
|
||||||
OP_ResetAA=0x53c0
|
|
||||||
OP_Fling=0x3731
|
|
||||||
OP_CancelSneakHide=0x7452
|
|
||||||
OP_AggroMeterLockTarget=0x0000
|
|
||||||
OP_AggroMeterTargetInfo=0x0000
|
|
||||||
OP_AggroMeterUpdate=0x0000
|
|
||||||
OP_UnderWorld=0x4ca9 # clients sends up when they detect an underworld issue, might be useful for cheat detection
|
|
||||||
OP_KickPlayers=0x7154
|
|
||||||
OP_BookButton=0x014d
|
|
||||||
|
|
||||||
# Expeditions
|
|
||||||
OP_DzQuit=0x0000
|
|
||||||
OP_DzListTimers=0x0000
|
|
||||||
OP_DzAddPlayer=0x0000
|
|
||||||
OP_DzRemovePlayer=0x0000
|
|
||||||
OP_DzSwapPlayer=0x0000
|
|
||||||
OP_DzMakeLeader=0x0000
|
|
||||||
OP_DzPlayerList=0x0000
|
|
||||||
OP_DzExpeditionInvite=0x0000
|
|
||||||
OP_DzExpeditionInviteResponse=0x0000
|
|
||||||
OP_DzExpeditionInfo=0x0000
|
|
||||||
OP_DzExpeditionLockoutTimers=0x0000
|
|
||||||
OP_DzMemberList=0x0000
|
|
||||||
OP_DzMemberListName=0x0000
|
|
||||||
OP_DzMemberListStatus=0x0000
|
|
||||||
OP_DzSetLeaderName=0x0000
|
|
||||||
OP_DzExpeditionEndsWarning=0x0000
|
|
||||||
OP_DzCompass=0x0000
|
|
||||||
OP_DzChooseZone=0x0000
|
|
||||||
OP_DzChooseZoneReply=0x0000
|
|
||||||
|
|
||||||
# New Opcodes
|
|
||||||
OP_SpawnPositionUpdate=0x0000 # Actually OP_MobUpdate ?
|
|
||||||
OP_ManaUpdate=0x0000
|
|
||||||
OP_EnduranceUpdate=0x0000
|
|
||||||
OP_MobManaUpdate=0x0000
|
|
||||||
OP_MobEnduranceUpdate=0x0000
|
|
||||||
|
|
||||||
# Mercenary Opcodes
|
|
||||||
OP_MercenaryDataUpdateRequest=0x0000
|
|
||||||
OP_MercenaryDataUpdate=0x0000
|
|
||||||
OP_MercenaryDataRequest=0x0000
|
|
||||||
OP_MercenaryDataResponse=0x0000
|
|
||||||
OP_MercenaryHire=0x0000
|
|
||||||
OP_MercenaryDismiss=0x0000
|
|
||||||
OP_MercenaryTimerRequest=0x0000
|
|
||||||
OP_MercenaryTimer=0x0000
|
|
||||||
OP_MercenaryUnknown1=0x0000
|
|
||||||
OP_MercenaryCommand=0x0000
|
|
||||||
OP_MercenarySuspendRequest=0x0000
|
|
||||||
OP_MercenarySuspendResponse=0x0000
|
|
||||||
OP_MercenaryUnsuspendResponse=0x0000
|
|
||||||
|
|
||||||
# Looting
|
|
||||||
OP_LootRequest=0x60e5
|
|
||||||
OP_EndLootRequest=0x35f6
|
|
||||||
OP_LootItem=0x0856
|
|
||||||
OP_LootComplete=0x1f5e
|
|
||||||
|
|
||||||
# bazaar trader stuff:
|
|
||||||
OP_BazaarSearch=0x0000
|
|
||||||
OP_TraderDelItem=0x0000
|
|
||||||
OP_BecomeTrader=0x0000
|
|
||||||
OP_TraderShop=0x0000
|
|
||||||
OP_TraderBulkSend=0x0000
|
|
||||||
OP_Trader=0x0000
|
|
||||||
OP_Barter=0x0000
|
|
||||||
OP_BuyerItems=0x0000
|
|
||||||
OP_TraderBuy=0x0000
|
|
||||||
OP_ShopItem=0x0000
|
|
||||||
OP_BazaarInspect=0x0000
|
|
||||||
OP_Bazaar=0x0000
|
|
||||||
OP_TraderItemUpdate=0x0000
|
|
||||||
|
|
||||||
# pc/npc trading
|
|
||||||
OP_TradeRequest=0x7066
|
|
||||||
OP_TradeAcceptClick=0x34ad
|
|
||||||
OP_TradeRequestAck=0x1c6b
|
|
||||||
OP_TradeCoins=0x44fe
|
|
||||||
OP_FinishTrade=0x0ec6
|
|
||||||
OP_CancelTrade=0x5839
|
|
||||||
OP_TradeMoneyUpdate=0x5fb3
|
|
||||||
OP_MoneyUpdate=0x70bb
|
|
||||||
OP_TradeBusy=0x109f
|
|
||||||
|
|
||||||
# Sent after canceling trade or after closing tradeskill object
|
|
||||||
OP_FinishWindow=0x50d4
|
|
||||||
OP_FinishWindow2=0x6b03
|
|
||||||
|
|
||||||
# Sent on Live for what seems to be item existance verification
|
|
||||||
# Ex. Before Right Click Effect happens from items
|
|
||||||
OP_ItemVerifyRequest=0x2003
|
|
||||||
OP_ItemVerifyReply=0x43d0
|
|
||||||
|
|
||||||
OP_ItemAdvancedLoreText=0x0000
|
|
||||||
|
|
||||||
# merchant stuff
|
|
||||||
OP_ShopPlayerSell=0x6489
|
|
||||||
OP_ShopRequest=0x840
|
|
||||||
OP_ShopEnd=0x74bb
|
|
||||||
OP_ShopEndConfirm=0x2ed1
|
|
||||||
OP_ShopPlayerBuy=0x625e
|
|
||||||
OP_ShopDelItem=0x4ce4
|
|
||||||
OP_ShopSendParcel=0x0f16
|
|
||||||
OP_ShopDeleteParcel=0x4e2a
|
|
||||||
OP_ShopRetrieveParcel=0x27d1
|
|
||||||
OP_ShopParcelIcon=0x4f27
|
|
||||||
|
|
||||||
# tradeskill stuff:
|
|
||||||
OP_ClickObject=0x687e
|
|
||||||
OP_ClickObjectAction=0x110f
|
|
||||||
OP_ClearObject=0x6155
|
|
||||||
OP_RecipeDetails=0x01e7
|
|
||||||
OP_RecipesFavorite=0x0495
|
|
||||||
OP_RecipesSearch=0x2f4e
|
|
||||||
OP_RecipeReply=0x2cd2
|
|
||||||
OP_RecipeAutoCombine=0x5dba
|
|
||||||
OP_TradeSkillCombine=0x4ed8
|
|
||||||
|
|
||||||
# Tribute Packets:
|
|
||||||
OP_TributeUpdate=0x0000
|
|
||||||
OP_TributeTimer=0x0000
|
|
||||||
OP_SendTributes=0x0000
|
|
||||||
OP_RequestGuildTributes=0x0000
|
|
||||||
OP_TributeInfo=0x0000
|
|
||||||
OP_OpenTributeMaster=0x0000
|
|
||||||
OP_SelectTribute=0x0000
|
|
||||||
OP_TributeItem=0x0000
|
|
||||||
OP_TributeMoney=0x0000
|
|
||||||
OP_TributeToggle=0x0000
|
|
||||||
OP_TributePointUpdate=0x0000
|
|
||||||
OP_TributeNPC=0x0000
|
|
||||||
OP_GuildTributeInfo=0x0000
|
|
||||||
OP_OpenTributeReply=0x0000
|
|
||||||
OP_GuildTributeStatus=0x0000
|
|
||||||
OP_GuildSaveActiveTributes=0x0000
|
|
||||||
OP_GuildSendActiveTributes=0x0000
|
|
||||||
OP_GuildTributeToggleReq=0x0000
|
|
||||||
OP_GuildTributeToggleReply=0x0000
|
|
||||||
OP_GuildTributeFavorAndTimer=0x0000
|
|
||||||
OP_GuildTributeDonateItem=0x0000
|
|
||||||
OP_GuildTributeDonatePlat=0x0000
|
|
||||||
OP_GuildSelectTribute=0x0000
|
|
||||||
OP_GuildModifyBenefits=0x0000
|
|
||||||
OP_GuildOptInOut=0x0000
|
|
||||||
OP_SendGuildTributes=0x0000
|
|
||||||
OP_OpenGuildTributeMaster=0x0000
|
|
||||||
|
|
||||||
# Adventure packets:
|
|
||||||
OP_LeaveAdventure=0x0000
|
|
||||||
OP_AdventureFinish=0x0000
|
|
||||||
OP_AdventureInfoRequest=0x0000
|
|
||||||
OP_AdventureInfo=0x0000
|
|
||||||
OP_AdventureRequest=0x0000
|
|
||||||
OP_AdventureDetails=0x0000
|
|
||||||
OP_AdventureData=0x0000
|
|
||||||
OP_AdventureUpdate=0x0000
|
|
||||||
OP_AdventureMerchantRequest=0x0000
|
|
||||||
OP_AdventureMerchantResponse=0x0000
|
|
||||||
OP_AdventureMerchantPurchase=0x0000
|
|
||||||
OP_AdventureMerchantSell=0x0000
|
|
||||||
OP_AdventurePointsUpdate=0x0000
|
|
||||||
OP_AdventureStatsRequest=0x0000
|
|
||||||
OP_AdventureStatsReply=0x0000
|
|
||||||
OP_AdventureLeaderboardRequest=0x0000
|
|
||||||
OP_AdventureLeaderboardReply=0x0000
|
|
||||||
|
|
||||||
# Group Opcodes
|
|
||||||
OP_GroupDisband=0x78ef
|
|
||||||
OP_GroupInvite=0x1d90
|
|
||||||
OP_GroupFollow=0x0000
|
|
||||||
OP_GroupUpdate=0x0000
|
|
||||||
OP_GroupUpdateB=0x0000
|
|
||||||
OP_GroupCancelInvite=0x0000
|
|
||||||
OP_GroupAcknowledge=0x0000
|
|
||||||
OP_GroupDelete=0x0000
|
|
||||||
OP_CancelInvite=0x0000
|
|
||||||
OP_GroupFollow2=0x0000
|
|
||||||
OP_GroupInvite2=0x1e7e
|
|
||||||
OP_GroupDisbandYou=0x0000
|
|
||||||
OP_GroupDisbandOther=0x0000
|
|
||||||
OP_GroupLeaderChange=0x0000
|
|
||||||
OP_GroupRoles=0x0000
|
|
||||||
OP_GroupMakeLeader=0x0000
|
|
||||||
OP_DoGroupLeadershipAbility=0x0000
|
|
||||||
OP_GroupLeadershipAAUpdate=0x0000 # removed these act as if you have always purchased them
|
|
||||||
OP_GroupMentor=0x0000
|
|
||||||
OP_InspectBuffs=0x0000
|
|
||||||
|
|
||||||
# LFG/LFP Opcodes
|
|
||||||
OP_LFGCommand=0x0000
|
|
||||||
OP_LFGGetMatchesRequest=0x0000
|
|
||||||
OP_LFGGetMatchesResponse=0x0000
|
|
||||||
OP_LFPGetMatchesRequest=0x0000
|
|
||||||
OP_LFPGetMatchesResponse=0x0000
|
|
||||||
OP_LFPCommand=0x0000
|
|
||||||
OP_LFGAppearance=0x0000
|
|
||||||
OP_LFGResponse=0x0000
|
|
||||||
|
|
||||||
# Raid Opcodes
|
|
||||||
OP_RaidInvite=0x0000
|
|
||||||
OP_RaidUpdate=0x0000
|
|
||||||
OP_RaidJoin=0x0000
|
|
||||||
OP_RaidDelegateAbility=0x0000
|
|
||||||
OP_MarkRaidNPC=0x0000
|
|
||||||
OP_RaidClearNPCMarks=0x0000
|
|
||||||
|
|
||||||
# Button-push commands
|
|
||||||
OP_Taunt=0x5064
|
|
||||||
OP_CombatAbility=0xbf
|
|
||||||
OP_SenseTraps=0x579c
|
|
||||||
OP_PickPocket=0x53d1
|
|
||||||
OP_DisarmTraps=0x21bf
|
|
||||||
OP_Disarm=0x31e9
|
|
||||||
OP_Sneak=0x78a7
|
|
||||||
OP_Fishing=0x57cc
|
|
||||||
OP_InstillDoubt=0x57cc
|
|
||||||
OP_FeignDeath=0x14b8
|
|
||||||
OP_Mend=0x6b8
|
|
||||||
OP_Bind_Wound=0x650e
|
|
||||||
OP_LDoNOpen=0x448
|
|
||||||
OP_LDoNPickLock=0x61c8
|
|
||||||
OP_LDoNInspect=0xc1c
|
|
||||||
|
|
||||||
# Task packets
|
|
||||||
OP_TaskDescription=0x0000
|
|
||||||
OP_TaskActivity=0x0000
|
|
||||||
OP_CompletedTasks=0x0000
|
|
||||||
OP_TaskActivityComplete=0x0000
|
|
||||||
OP_AcceptNewTask=0x0000
|
|
||||||
OP_CancelTask=0x0000
|
|
||||||
OP_AvaliableTask=0x0000
|
|
||||||
OP_TaskHistoryRequest=0x0000
|
|
||||||
OP_TaskHistoryReply=0x0000
|
|
||||||
OP_DeclineAllTasks=0x0000
|
|
||||||
OP_TaskRequestTimer=0x0000
|
|
||||||
OP_TaskSelectWindow=0x0000
|
|
||||||
|
|
||||||
# Shared Tasks
|
|
||||||
OP_SharedTaskMemberList=0x0000 #
|
|
||||||
OP_SharedTaskRemovePlayer=0x0000 # /taskremoveplayer
|
|
||||||
OP_SharedTaskAddPlayer=0x0000 # /taskaddplayer
|
|
||||||
OP_SharedTaskMakeLeader=0x0000 # /taskmakeleader
|
|
||||||
OP_SharedTaskInvite=0x0000 # Dialog window
|
|
||||||
OP_SharedTaskInviteResponse=0x0000 # Dialog window response
|
|
||||||
OP_SharedTaskAcceptNew=0x0000 #
|
|
||||||
OP_SharedTaskMemberChange=0x0000 #
|
|
||||||
OP_TaskTimers=0x0000 # /tasktimers
|
|
||||||
OP_SharedTaskQuit=0x0000 # /taskquit
|
|
||||||
OP_SharedTaskSelectWindow=0x0000
|
|
||||||
OP_SharedTaskPlayerList=0x0000 # /taskplayerlist
|
|
||||||
|
|
||||||
# Title opcodes
|
|
||||||
OP_NewTitlesAvailable=0x0000
|
|
||||||
OP_RequestTitles=0x0000
|
|
||||||
OP_SendTitleList=0x0000
|
|
||||||
OP_SetTitle=0x0000
|
|
||||||
OP_SetTitleReply=0x0000
|
|
||||||
|
|
||||||
# mail opcodes
|
|
||||||
OP_Command=0x0000
|
|
||||||
OP_MailboxHeader=0x0000
|
|
||||||
OP_MailHeader=0x0000
|
|
||||||
OP_MailBody=0x0000
|
|
||||||
OP_NewMail=0x0000
|
|
||||||
OP_SentConfirm=0x0000
|
|
||||||
|
|
||||||
########### Below this point should not be needed ###########
|
|
||||||
|
|
||||||
# This section are all unknown in Titanium
|
|
||||||
OP_ForceFindPerson=0x0000
|
|
||||||
OP_LocInfo=0x0000
|
|
||||||
OP_ReloadUI=0x0000
|
|
||||||
OP_ItemName=0x0000
|
|
||||||
OP_ItemLinkText=0x0000
|
|
||||||
OP_MultiLineMsg=0x0000
|
|
||||||
OP_MendHPUpdate=0x0000
|
|
||||||
OP_TargetReject=0x0000
|
|
||||||
OP_SafePoint=0x0000
|
|
||||||
OP_ApproveZone=0x0000
|
|
||||||
OP_ZoneComplete=0x0000
|
|
||||||
OP_ClientError=0x0000
|
|
||||||
OP_DumpName=0x0000
|
|
||||||
OP_Heartbeat=0x0000
|
|
||||||
OP_CrashDump=0x0000
|
|
||||||
OP_LoginComplete=0x0000
|
|
||||||
|
|
||||||
# discovered opcodes not yet used:
|
|
||||||
OP_PickLockSuccess=0x0000
|
|
||||||
OP_PlayMP3=0x6451
|
|
||||||
OP_ReclaimCrystals=0x0000
|
|
||||||
OP_DynamicWall=0x0000
|
|
||||||
OP_OpenDiscordMerchant=0x0000
|
|
||||||
OP_DiscordMerchantInventory=0x0000
|
|
||||||
OP_GiveMoney=0x0000
|
|
||||||
OP_RequestKnowledgeBase=0x0000
|
|
||||||
OP_KnowledgeBase=0x0000
|
|
||||||
OP_SlashAdventure=0x0000 # /adventure
|
|
||||||
OP_BecomePVPPrompt=0x0000
|
|
||||||
OP_MoveLogRequest=0x0000 # gone I think
|
|
||||||
OP_MoveLogDisregard=0x0000 # gone I think
|
|
||||||
|
|
||||||
# named unknowns, to make looking for real unknown easier
|
|
||||||
OP_AnnoyingZoneUnknown=0x0000
|
|
||||||
OP_Some6ByteHPUpdate=0x0000 #seems to happen when you target group members
|
|
||||||
OP_QueryResponseThing=0x0000
|
|
||||||
|
|
||||||
|
|
||||||
# realityincarnate: these are just here to stop annoying several thousand byte packet dumps
|
|
||||||
#OP_LoginUnknown1=0x0000 # OP_SendSpellChecksum
|
|
||||||
#OP_LoginUnknown2=0x0000 # OP_SendSkillCapsChecksum
|
|
||||||
|
|
||||||
# Petition Opcodes
|
|
||||||
OP_PetitionSearch=0x0000 #search term for petition
|
|
||||||
OP_PetitionSearchResults=0x0000 #(list of?) matches from search
|
|
||||||
OP_PetitionSearchText=0x0000 #text results of search
|
|
||||||
|
|
||||||
OP_PetitionUpdate=0x0000
|
|
||||||
OP_PetitionCheckout=0x0000
|
|
||||||
OP_PetitionCheckIn=0x0000
|
|
||||||
OP_PetitionQue=0x0000
|
|
||||||
OP_PetitionUnCheckout=0x0000
|
|
||||||
OP_PetitionDelete=0x0000
|
|
||||||
OP_DeletePetition=0x0000
|
|
||||||
OP_PetitionResolve=0x0000
|
|
||||||
OP_PDeletePetition=0x0000
|
|
||||||
OP_PetitionBug=0x0000
|
|
||||||
OP_PetitionRefresh=0x0000
|
|
||||||
OP_PetitionCheckout2=0x0000
|
|
||||||
OP_PetitionViewPetition=0x0000
|
|
||||||
|
|
||||||
#aura related
|
|
||||||
OP_UpdateAura=0x0000
|
|
||||||
OP_RemoveTrap=0x0000
|
|
||||||
|
|
||||||
OP_Fingerprint=0x7a5b
|
|
||||||
@@ -261,6 +261,7 @@ OP_ItemPacket=0x368e
|
|||||||
OP_ItemLinkResponse=0x70c0
|
OP_ItemLinkResponse=0x70c0
|
||||||
OP_ItemLinkClick=0x4cef
|
OP_ItemLinkClick=0x4cef
|
||||||
OP_ItemPreview=0x6b5c
|
OP_ItemPreview=0x6b5c
|
||||||
|
OP_ItemPreviewRequest=0x7f80
|
||||||
OP_NewSpawn=0x6097
|
OP_NewSpawn=0x6097
|
||||||
OP_Track=0x17e5
|
OP_Track=0x17e5
|
||||||
OP_TrackTarget=0x695e
|
OP_TrackTarget=0x695e
|
||||||
@@ -728,3 +729,9 @@ OP_InitialHPUpdate=0x0000
|
|||||||
#aura related
|
#aura related
|
||||||
OP_UpdateAura=0x1456
|
OP_UpdateAura=0x1456
|
||||||
OP_RemoveTrap=0x71da
|
OP_RemoveTrap=0x71da
|
||||||
|
|
||||||
|
OP_PickZoneWindow=0x72d8
|
||||||
|
OP_PickZone=0xaaba
|
||||||
|
|
||||||
|
#evolve item related
|
||||||
|
OP_EvolveItem=0x7cfb
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ require (
|
|||||||
require (
|
require (
|
||||||
github.com/golang/protobuf v1.3.2 // indirect
|
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.21.0 // indirect
|
golang.org/x/crypto v0.31.0 // indirect
|
||||||
golang.org/x/net v0.23.0 // indirect
|
golang.org/x/net v0.23.0 // indirect
|
||||||
google.golang.org/appengine v1.6.7 // indirect
|
google.golang.org/appengine v1.6.7 // indirect
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD
|
|||||||
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
|
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
|
||||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||||
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||||
golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA=
|
golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U=
|
||||||
golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs=
|
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
|
||||||
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.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
|
golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
|
||||||
|
|||||||
@@ -1556,7 +1556,7 @@ RoF2 Built May 10 2013 23:30:08
|
|||||||
0x10e0
|
0x10e0
|
||||||
0x7452
|
0x7452
|
||||||
0x6d9f
|
0x6d9f
|
||||||
0x7f80
|
0x7f80 OP_ItemPreviewRequest
|
||||||
0xb07f
|
0xb07f
|
||||||
0x6b5c OP_ItemPreview
|
0x6b5c OP_ItemPreview
|
||||||
0x02b4
|
0x02b4
|
||||||
|
|||||||
@@ -1,388 +0,0 @@
|
|||||||
## Ignore Visual Studio temporary files, build results, and
|
|
||||||
## files generated by popular Visual Studio add-ons.
|
|
||||||
##
|
|
||||||
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
|
|
||||||
|
|
||||||
# User-specific files
|
|
||||||
*.rsuser
|
|
||||||
*.suo
|
|
||||||
*.user
|
|
||||||
*.userosscache
|
|
||||||
*.sln.docstates
|
|
||||||
|
|
||||||
# User-specific files (MonoDevelop/Xamarin Studio)
|
|
||||||
*.userprefs
|
|
||||||
|
|
||||||
# Mono auto generated files
|
|
||||||
mono_crash.*
|
|
||||||
|
|
||||||
# Build results
|
|
||||||
[Dd]ebug/
|
|
||||||
[Dd]ebugPublic/
|
|
||||||
[Rr]elease/
|
|
||||||
[Rr]eleases/
|
|
||||||
x64/
|
|
||||||
x86/
|
|
||||||
[Ww][Ii][Nn]32/
|
|
||||||
[Aa][Rr][Mm]/
|
|
||||||
[Aa][Rr][Mm]64/
|
|
||||||
bld/
|
|
||||||
[Bb]in/
|
|
||||||
[Oo]bj/
|
|
||||||
[Ll]og/
|
|
||||||
[Ll]ogs/
|
|
||||||
|
|
||||||
# Visual Studio 2015/2017 cache/options directory
|
|
||||||
.vs/
|
|
||||||
# Uncomment if you have tasks that create the project's static files in wwwroot
|
|
||||||
#wwwroot/
|
|
||||||
|
|
||||||
# Visual Studio 2017 auto generated files
|
|
||||||
Generated\ Files/
|
|
||||||
|
|
||||||
# MSTest test Results
|
|
||||||
[Tt]est[Rr]esult*/
|
|
||||||
[Bb]uild[Ll]og.*
|
|
||||||
|
|
||||||
# NUnit
|
|
||||||
*.VisualState.xml
|
|
||||||
TestResult.xml
|
|
||||||
nunit-*.xml
|
|
||||||
|
|
||||||
# Build Results of an ATL Project
|
|
||||||
[Dd]ebugPS/
|
|
||||||
[Rr]eleasePS/
|
|
||||||
dlldata.c
|
|
||||||
|
|
||||||
# Benchmark Results
|
|
||||||
BenchmarkDotNet.Artifacts/
|
|
||||||
|
|
||||||
# .NET Core
|
|
||||||
project.lock.json
|
|
||||||
project.fragment.lock.json
|
|
||||||
artifacts/
|
|
||||||
|
|
||||||
# ASP.NET Scaffolding
|
|
||||||
ScaffoldingReadMe.txt
|
|
||||||
|
|
||||||
# StyleCop
|
|
||||||
StyleCopReport.xml
|
|
||||||
|
|
||||||
# Files built by Visual Studio
|
|
||||||
*_i.c
|
|
||||||
*_p.c
|
|
||||||
*_h.h
|
|
||||||
*.ilk
|
|
||||||
*.meta
|
|
||||||
*.obj
|
|
||||||
*.iobj
|
|
||||||
*.pch
|
|
||||||
*.pdb
|
|
||||||
*.ipdb
|
|
||||||
*.pgc
|
|
||||||
*.pgd
|
|
||||||
*.rsp
|
|
||||||
*.sbr
|
|
||||||
*.tlb
|
|
||||||
*.tli
|
|
||||||
*.tlh
|
|
||||||
*.tmp
|
|
||||||
*.tmp_proj
|
|
||||||
*_wpftmp.csproj
|
|
||||||
*.log
|
|
||||||
*.tlog
|
|
||||||
*.vspscc
|
|
||||||
*.vssscc
|
|
||||||
.builds
|
|
||||||
*.pidb
|
|
||||||
*.svclog
|
|
||||||
*.scc
|
|
||||||
|
|
||||||
# Chutzpah Test files
|
|
||||||
_Chutzpah*
|
|
||||||
|
|
||||||
# Visual C++ cache files
|
|
||||||
ipch/
|
|
||||||
*.aps
|
|
||||||
*.ncb
|
|
||||||
*.opendb
|
|
||||||
*.opensdf
|
|
||||||
*.sdf
|
|
||||||
*.cachefile
|
|
||||||
*.VC.db
|
|
||||||
*.VC.VC.opendb
|
|
||||||
|
|
||||||
# Visual Studio profiler
|
|
||||||
*.psess
|
|
||||||
*.vsp
|
|
||||||
*.vspx
|
|
||||||
*.sap
|
|
||||||
|
|
||||||
# Visual Studio Trace Files
|
|
||||||
*.e2e
|
|
||||||
|
|
||||||
# TFS 2012 Local Workspace
|
|
||||||
$tf/
|
|
||||||
|
|
||||||
# Guidance Automation Toolkit
|
|
||||||
*.gpState
|
|
||||||
|
|
||||||
# ReSharper is a .NET coding add-in
|
|
||||||
_ReSharper*/
|
|
||||||
*.[Rr]e[Ss]harper
|
|
||||||
*.DotSettings.user
|
|
||||||
|
|
||||||
# TeamCity is a build add-in
|
|
||||||
_TeamCity*
|
|
||||||
|
|
||||||
# DotCover is a Code Coverage Tool
|
|
||||||
*.dotCover
|
|
||||||
|
|
||||||
# AxoCover is a Code Coverage Tool
|
|
||||||
.axoCover/*
|
|
||||||
!.axoCover/settings.json
|
|
||||||
|
|
||||||
# Coverlet is a free, cross platform Code Coverage Tool
|
|
||||||
coverage*.json
|
|
||||||
coverage*.xml
|
|
||||||
coverage*.info
|
|
||||||
|
|
||||||
# Visual Studio code coverage results
|
|
||||||
*.coverage
|
|
||||||
*.coveragexml
|
|
||||||
|
|
||||||
# NCrunch
|
|
||||||
_NCrunch_*
|
|
||||||
.*crunch*.local.xml
|
|
||||||
nCrunchTemp_*
|
|
||||||
|
|
||||||
# MightyMoose
|
|
||||||
*.mm.*
|
|
||||||
AutoTest.Net/
|
|
||||||
|
|
||||||
# Web workbench (sass)
|
|
||||||
.sass-cache/
|
|
||||||
|
|
||||||
# Installshield output folder
|
|
||||||
[Ee]xpress/
|
|
||||||
|
|
||||||
# DocProject is a documentation generator add-in
|
|
||||||
DocProject/buildhelp/
|
|
||||||
DocProject/Help/*.HxT
|
|
||||||
DocProject/Help/*.HxC
|
|
||||||
DocProject/Help/*.hhc
|
|
||||||
DocProject/Help/*.hhk
|
|
||||||
DocProject/Help/*.hhp
|
|
||||||
DocProject/Help/Html2
|
|
||||||
DocProject/Help/html
|
|
||||||
|
|
||||||
# Click-Once directory
|
|
||||||
publish/
|
|
||||||
|
|
||||||
# Publish Web Output
|
|
||||||
*.[Pp]ublish.xml
|
|
||||||
*.azurePubxml
|
|
||||||
# Note: Comment the next line if you want to checkin your web deploy settings,
|
|
||||||
# but database connection strings (with potential passwords) will be unencrypted
|
|
||||||
*.pubxml
|
|
||||||
*.publishproj
|
|
||||||
|
|
||||||
# Microsoft Azure Web App publish settings. Comment the next line if you want to
|
|
||||||
# checkin your Azure Web App publish settings, but sensitive information contained
|
|
||||||
# in these scripts will be unencrypted
|
|
||||||
PublishScripts/
|
|
||||||
|
|
||||||
# NuGet Packages
|
|
||||||
*.nupkg
|
|
||||||
# NuGet Symbol Packages
|
|
||||||
*.snupkg
|
|
||||||
# The packages folder can be ignored because of Package Restore
|
|
||||||
**/[Pp]ackages/*
|
|
||||||
# except build/, which is used as an MSBuild target.
|
|
||||||
!**/[Pp]ackages/build/
|
|
||||||
# Uncomment if necessary however generally it will be regenerated when needed
|
|
||||||
#!**/[Pp]ackages/repositories.config
|
|
||||||
# NuGet v3's project.json files produces more ignorable files
|
|
||||||
*.nuget.props
|
|
||||||
*.nuget.targets
|
|
||||||
|
|
||||||
# Nuget personal access tokens and Credentials
|
|
||||||
nuget.config
|
|
||||||
|
|
||||||
# Microsoft Azure Build Output
|
|
||||||
csx/
|
|
||||||
*.build.csdef
|
|
||||||
|
|
||||||
# Microsoft Azure Emulator
|
|
||||||
ecf/
|
|
||||||
rcf/
|
|
||||||
|
|
||||||
# Windows Store app package directories and files
|
|
||||||
AppPackages/
|
|
||||||
BundleArtifacts/
|
|
||||||
Package.StoreAssociation.xml
|
|
||||||
_pkginfo.txt
|
|
||||||
*.appx
|
|
||||||
*.appxbundle
|
|
||||||
*.appxupload
|
|
||||||
|
|
||||||
# Visual Studio cache files
|
|
||||||
# files ending in .cache can be ignored
|
|
||||||
*.[Cc]ache
|
|
||||||
# but keep track of directories ending in .cache
|
|
||||||
!?*.[Cc]ache/
|
|
||||||
|
|
||||||
# Others
|
|
||||||
ClientBin/
|
|
||||||
~$*
|
|
||||||
*~
|
|
||||||
*.dbmdl
|
|
||||||
*.dbproj.schemaview
|
|
||||||
*.jfm
|
|
||||||
*.pfx
|
|
||||||
*.publishsettings
|
|
||||||
orleans.codegen.cs
|
|
||||||
|
|
||||||
# Including strong name files can present a security risk
|
|
||||||
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
|
|
||||||
#*.snk
|
|
||||||
|
|
||||||
# Since there are multiple workflows, uncomment next line to ignore bower_components
|
|
||||||
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
|
|
||||||
#bower_components/
|
|
||||||
|
|
||||||
# RIA/Silverlight projects
|
|
||||||
Generated_Code/
|
|
||||||
|
|
||||||
# Backup & report files from converting an old project file
|
|
||||||
# to a newer Visual Studio version. Backup files are not needed,
|
|
||||||
# because we have git ;-)
|
|
||||||
_UpgradeReport_Files/
|
|
||||||
Backup*/
|
|
||||||
UpgradeLog*.XML
|
|
||||||
UpgradeLog*.htm
|
|
||||||
ServiceFabricBackup/
|
|
||||||
*.rptproj.bak
|
|
||||||
|
|
||||||
# SQL Server files
|
|
||||||
*.mdf
|
|
||||||
*.ldf
|
|
||||||
*.ndf
|
|
||||||
|
|
||||||
# Business Intelligence projects
|
|
||||||
*.rdl.data
|
|
||||||
*.bim.layout
|
|
||||||
*.bim_*.settings
|
|
||||||
*.rptproj.rsuser
|
|
||||||
*- [Bb]ackup.rdl
|
|
||||||
*- [Bb]ackup ([0-9]).rdl
|
|
||||||
*- [Bb]ackup ([0-9][0-9]).rdl
|
|
||||||
|
|
||||||
# Microsoft Fakes
|
|
||||||
FakesAssemblies/
|
|
||||||
|
|
||||||
# GhostDoc plugin setting file
|
|
||||||
*.GhostDoc.xml
|
|
||||||
|
|
||||||
# Node.js Tools for Visual Studio
|
|
||||||
.ntvs_analysis.dat
|
|
||||||
node_modules/
|
|
||||||
|
|
||||||
# Visual Studio 6 build log
|
|
||||||
*.plg
|
|
||||||
|
|
||||||
# Visual Studio 6 workspace options file
|
|
||||||
*.opt
|
|
||||||
|
|
||||||
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
|
|
||||||
*.vbw
|
|
||||||
|
|
||||||
# Visual Studio LightSwitch build output
|
|
||||||
**/*.HTMLClient/GeneratedArtifacts
|
|
||||||
**/*.DesktopClient/GeneratedArtifacts
|
|
||||||
**/*.DesktopClient/ModelManifest.xml
|
|
||||||
**/*.Server/GeneratedArtifacts
|
|
||||||
**/*.Server/ModelManifest.xml
|
|
||||||
_Pvt_Extensions
|
|
||||||
|
|
||||||
# Paket dependency manager
|
|
||||||
.paket/paket.exe
|
|
||||||
paket-files/
|
|
||||||
|
|
||||||
# FAKE - F# Make
|
|
||||||
.fake/
|
|
||||||
|
|
||||||
# CodeRush personal settings
|
|
||||||
.cr/personal
|
|
||||||
|
|
||||||
# Python Tools for Visual Studio (PTVS)
|
|
||||||
__pycache__/
|
|
||||||
*.pyc
|
|
||||||
|
|
||||||
# Cake - Uncomment if you are using it
|
|
||||||
# tools/**
|
|
||||||
# !tools/packages.config
|
|
||||||
|
|
||||||
# Tabs Studio
|
|
||||||
*.tss
|
|
||||||
|
|
||||||
# Telerik's JustMock configuration file
|
|
||||||
*.jmconfig
|
|
||||||
|
|
||||||
# BizTalk build output
|
|
||||||
*.btp.cs
|
|
||||||
*.btm.cs
|
|
||||||
*.odx.cs
|
|
||||||
*.xsd.cs
|
|
||||||
|
|
||||||
# OpenCover UI analysis results
|
|
||||||
OpenCover/
|
|
||||||
|
|
||||||
# Azure Stream Analytics local run output
|
|
||||||
ASALocalRun/
|
|
||||||
|
|
||||||
# MSBuild Binary and Structured Log
|
|
||||||
*.binlog
|
|
||||||
|
|
||||||
# NVidia Nsight GPU debugger configuration file
|
|
||||||
*.nvuser
|
|
||||||
|
|
||||||
# MFractors (Xamarin productivity tool) working folder
|
|
||||||
.mfractor/
|
|
||||||
|
|
||||||
# Local History for Visual Studio
|
|
||||||
.localhistory/
|
|
||||||
|
|
||||||
# BeatPulse healthcheck temp database
|
|
||||||
healthchecksdb
|
|
||||||
|
|
||||||
# Backup folder for Package Reference Convert tool in Visual Studio 2017
|
|
||||||
MigrationBackup/
|
|
||||||
|
|
||||||
# Ionide (cross platform F# VS Code tools) working folder
|
|
||||||
.ionide/
|
|
||||||
|
|
||||||
# Fody - auto-generated XML schema
|
|
||||||
FodyWeavers.xsd
|
|
||||||
|
|
||||||
# VS Code files for those working on multiple tools
|
|
||||||
.vscode/*
|
|
||||||
!.vscode/settings.json
|
|
||||||
!.vscode/tasks.json
|
|
||||||
!.vscode/launch.json
|
|
||||||
!.vscode/extensions.json
|
|
||||||
*.code-workspace
|
|
||||||
|
|
||||||
# Local History for Visual Studio Code
|
|
||||||
.history/
|
|
||||||
|
|
||||||
# Windows Installer files from build outputs
|
|
||||||
*.cab
|
|
||||||
*.msi
|
|
||||||
*.msix
|
|
||||||
*.msm
|
|
||||||
*.msp
|
|
||||||
|
|
||||||
# JetBrains Rider
|
|
||||||
.idea/
|
|
||||||
*.sln.iml
|
|
||||||
@@ -1,621 +0,0 @@
|
|||||||
using Ionic.Zlib;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace StreamParser.Common.Daybreak
|
|
||||||
{
|
|
||||||
public class Connection : IConnection
|
|
||||||
{
|
|
||||||
private class EncodeType
|
|
||||||
{
|
|
||||||
public const int None = 0;
|
|
||||||
public const int Compression = 1;
|
|
||||||
public const int XOR = 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
private enum SequenceOrder
|
|
||||||
{
|
|
||||||
Past,
|
|
||||||
Current,
|
|
||||||
Future
|
|
||||||
}
|
|
||||||
|
|
||||||
private readonly IParser _owner;
|
|
||||||
private readonly IPAddress _srcAddr;
|
|
||||||
private readonly int _srcPort;
|
|
||||||
private readonly IPAddress _dstAddr;
|
|
||||||
private readonly int _dstPort;
|
|
||||||
private readonly Util.Crc32 _crc_generator = new Util.Crc32();
|
|
||||||
private readonly Guid _id = Guid.NewGuid();
|
|
||||||
private uint _connect_code = 0;
|
|
||||||
private int _encode_key = 0;
|
|
||||||
private int _crc_bytes = 0;
|
|
||||||
private int[] _encode_pass = new int[2] { 0, 0 };
|
|
||||||
private ConnectionStream[] _client_streams = new ConnectionStream[4] {
|
|
||||||
new ConnectionStream(),
|
|
||||||
new ConnectionStream(),
|
|
||||||
new ConnectionStream(),
|
|
||||||
new ConnectionStream()
|
|
||||||
};
|
|
||||||
private ConnectionStream[] _server_streams = new ConnectionStream[4] {
|
|
||||||
new ConnectionStream(),
|
|
||||||
new ConnectionStream(),
|
|
||||||
new ConnectionStream(),
|
|
||||||
new ConnectionStream()
|
|
||||||
};
|
|
||||||
|
|
||||||
public IConnection.OnPacketRecvHandler OnPacketRecv { get; set; }
|
|
||||||
|
|
||||||
public IPAddress ClientAddress => _srcAddr;
|
|
||||||
public int ClientPort => _srcPort;
|
|
||||||
public IPAddress ServerAddress => _dstAddr;
|
|
||||||
public int ServerPort => _dstPort;
|
|
||||||
public Guid Id => _id;
|
|
||||||
|
|
||||||
public ConnectionType ConnectionType {
|
|
||||||
get
|
|
||||||
{
|
|
||||||
//World servers used to be coded to always be 9000 but live started using dynamic ports
|
|
||||||
//I've seen from 9000 to 9008 on live
|
|
||||||
if (_dstPort >= 9000 && _dstPort <= 9010)
|
|
||||||
{
|
|
||||||
return ConnectionType.World;
|
|
||||||
}
|
|
||||||
else if (_encode_pass[0] == EncodeType.None && _encode_pass[1] == EncodeType.None)
|
|
||||||
{
|
|
||||||
return ConnectionType.Login;
|
|
||||||
}
|
|
||||||
else if (_encode_pass[0] == EncodeType.XOR && _encode_pass[1] == EncodeType.None)
|
|
||||||
{
|
|
||||||
return ConnectionType.Chat;
|
|
||||||
}
|
|
||||||
else if (_encode_pass[0] == EncodeType.Compression && _encode_pass[1] == EncodeType.None)
|
|
||||||
{
|
|
||||||
return ConnectionType.Zone;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ConnectionType.Unknown;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Connection(IParser owner, IPAddress srcAddr, int srcPort, IPAddress dstAddr, int dstPort)
|
|
||||||
{
|
|
||||||
_owner = owner;
|
|
||||||
_srcAddr = srcAddr;
|
|
||||||
_srcPort = srcPort;
|
|
||||||
_dstAddr = dstAddr;
|
|
||||||
_dstPort = dstPort;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ProcessPacket(IPAddress srcAddr, int srcPort, DateTime packetTime, ReadOnlySpan<byte> data)
|
|
||||||
{
|
|
||||||
if (data.Length < 1)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var opcode = data[1];
|
|
||||||
if (data[0] == 0 && (opcode == Opcode.KeepAlive || opcode == Opcode.OutboundPing))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (PacketCanBeDecoded(data))
|
|
||||||
{
|
|
||||||
if (!ValidateCRC(data))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_encode_pass[0] == EncodeType.None && _encode_pass[1] == EncodeType.None)
|
|
||||||
{
|
|
||||||
ProcessDecodedPacket(srcAddr, srcPort, packetTime, data.Slice(0, data.Length - _crc_bytes));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//unfortunately we can't avoid a copy here
|
|
||||||
var temp = data.Slice(0, data.Length - _crc_bytes).ToArray();
|
|
||||||
for (int i = 1; i >= 0; --i)
|
|
||||||
{
|
|
||||||
switch(_encode_pass[i])
|
|
||||||
{
|
|
||||||
case EncodeType.Compression:
|
|
||||||
if(temp[0] == 0)
|
|
||||||
{
|
|
||||||
temp = Decompress(temp, 2, temp.Length - 2);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
temp = Decompress(temp, 1, temp.Length - 1);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case EncodeType.XOR:
|
|
||||||
if (temp[0] == 0)
|
|
||||||
{
|
|
||||||
temp = Decode(temp, 2, temp.Length - 2);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
temp = Decode(temp, 1, temp.Length - 1);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ProcessDecodedPacket(srcAddr, srcPort, packetTime, temp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ProcessDecodedPacket(srcAddr, srcPort, packetTime, data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ProcessDecodedPacket(IPAddress srcAddr, int srcPort, DateTime packetTime, ReadOnlySpan<byte> data)
|
|
||||||
{
|
|
||||||
if (data.Length < 1)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (data[0] == 0)
|
|
||||||
{
|
|
||||||
if (data.Length < 2)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var opcode = data[1];
|
|
||||||
switch (opcode)
|
|
||||||
{
|
|
||||||
case Opcode.SessionResponse:
|
|
||||||
if (_connect_code == 0)
|
|
||||||
{
|
|
||||||
//if(data.Length != 21)
|
|
||||||
//{
|
|
||||||
// return;
|
|
||||||
//}
|
|
||||||
|
|
||||||
_connect_code = BitConverter.ToUInt32(data.Slice(2, 4));
|
|
||||||
_encode_key = IPAddress.NetworkToHostOrder(BitConverter.ToInt32(data.Slice(6, 4)));
|
|
||||||
_crc_bytes = data[10];
|
|
||||||
_encode_pass[0] = data[11];
|
|
||||||
_encode_pass[1] = data[12];
|
|
||||||
_owner.OnNewConnection?.Invoke(this, packetTime);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case Opcode.SessionDisconnect:
|
|
||||||
if(_connect_code != 0)
|
|
||||||
{
|
|
||||||
_connect_code = 0;
|
|
||||||
_encode_key = 0;
|
|
||||||
_crc_bytes = 0;
|
|
||||||
_encode_pass[0] = 0;
|
|
||||||
_encode_pass[1] = 0;
|
|
||||||
_owner.OnLostConnection?.Invoke(this, packetTime);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case Opcode.Combined:
|
|
||||||
{
|
|
||||||
int current = 2;
|
|
||||||
int end = data.Length;
|
|
||||||
while (current < end)
|
|
||||||
{
|
|
||||||
byte subpacket_length = data[current];
|
|
||||||
current += 1;
|
|
||||||
|
|
||||||
if (end < current + subpacket_length)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var subpacket = data.Slice(current, subpacket_length);
|
|
||||||
ProcessDecodedPacket(srcAddr, srcPort, packetTime, subpacket);
|
|
||||||
current += subpacket_length;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case Opcode.AppCombined:
|
|
||||||
{
|
|
||||||
int current = 2;
|
|
||||||
int end = data.Length;
|
|
||||||
while (current < end)
|
|
||||||
{
|
|
||||||
int subpacket_length = 0;
|
|
||||||
if (data[current] == 0xff)
|
|
||||||
{
|
|
||||||
if (end < current + 3)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (data[current + 1] == 0xff && data[current + 2] == 0xff)
|
|
||||||
{
|
|
||||||
if (end < current + 7)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
subpacket_length =
|
|
||||||
((data[current + 3]) << 24) |
|
|
||||||
((data[current + 4]) << 16) |
|
|
||||||
((data[current + 5]) << 8) |
|
|
||||||
(data[current + 6]);
|
|
||||||
|
|
||||||
current += 7;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
subpacket_length =
|
|
||||||
((data[current + 1]) << 8) |
|
|
||||||
(data[current + 2]);
|
|
||||||
|
|
||||||
current += 3;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
subpacket_length = data[current];
|
|
||||||
current += 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
var subpacket = data.Slice(current, subpacket_length);
|
|
||||||
ProcessDecodedPacket(srcAddr, srcPort, packetTime, subpacket);
|
|
||||||
current += subpacket_length;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case Opcode.Packet:
|
|
||||||
case Opcode.Packet2:
|
|
||||||
case Opcode.Packet3:
|
|
||||||
case Opcode.Packet4:
|
|
||||||
{
|
|
||||||
var stream_id = opcode - Opcode.Packet;
|
|
||||||
var stream = FindStream(srcAddr, srcPort, stream_id);
|
|
||||||
var sequence = (ushort)IPAddress.NetworkToHostOrder(BitConverter.ToInt16(data.Slice(2, 2)));
|
|
||||||
var order = CompareSequence(stream.Sequence, sequence);
|
|
||||||
if (order == SequenceOrder.Future)
|
|
||||||
{
|
|
||||||
if (!stream.PacketQueue.ContainsKey(sequence))
|
|
||||||
{
|
|
||||||
stream.PacketQueue.Add(sequence, new ConnectionStream.QueuedPacket
|
|
||||||
{
|
|
||||||
Data = data.ToArray(),
|
|
||||||
PacketTime = packetTime
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (order == SequenceOrder.Current)
|
|
||||||
{
|
|
||||||
if (stream.PacketQueue.ContainsKey(sequence))
|
|
||||||
{
|
|
||||||
stream.PacketQueue.Remove(sequence);
|
|
||||||
}
|
|
||||||
|
|
||||||
stream.Sequence++;
|
|
||||||
ProcessDecodedPacket(srcAddr, srcPort, packetTime, data.Slice(4));
|
|
||||||
ProcessQueue(srcAddr, srcPort, stream_id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case Opcode.Fragment:
|
|
||||||
case Opcode.Fragment2:
|
|
||||||
case Opcode.Fragment3:
|
|
||||||
case Opcode.Fragment4:
|
|
||||||
{
|
|
||||||
var stream_id = opcode - Opcode.Fragment;
|
|
||||||
var stream = FindStream(srcAddr, srcPort, stream_id);
|
|
||||||
var sequence = (ushort)IPAddress.NetworkToHostOrder(BitConverter.ToInt16(data.Slice(2, 2)));
|
|
||||||
var order = CompareSequence(stream.Sequence, sequence);
|
|
||||||
if (order == SequenceOrder.Future)
|
|
||||||
{
|
|
||||||
if (!stream.PacketQueue.ContainsKey(sequence))
|
|
||||||
{
|
|
||||||
stream.PacketQueue.Add(sequence, new ConnectionStream.QueuedPacket
|
|
||||||
{
|
|
||||||
Data = data.ToArray(),
|
|
||||||
PacketTime = packetTime
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (order == SequenceOrder.Current)
|
|
||||||
{
|
|
||||||
if (stream.PacketQueue.ContainsKey(sequence))
|
|
||||||
{
|
|
||||||
stream.PacketQueue.Remove(sequence);
|
|
||||||
}
|
|
||||||
|
|
||||||
stream.Sequence++;
|
|
||||||
|
|
||||||
if (stream.TotalFragmentedBytes == 0)
|
|
||||||
{
|
|
||||||
stream.TotalFragmentedBytes = (uint)IPAddress.NetworkToHostOrder(BitConverter.ToInt32(data.Slice(4, 4)));
|
|
||||||
stream.CurrentFragmentedBytes = (uint)(data.Length - 8);
|
|
||||||
|
|
||||||
if(stream.FragmentBuffer == null || stream.FragmentBuffer.Length < (stream.TotalFragmentedBytes + 512))
|
|
||||||
{
|
|
||||||
stream.FragmentBuffer = new byte[stream.TotalFragmentedBytes + 512];
|
|
||||||
}
|
|
||||||
|
|
||||||
var target = stream.FragmentBuffer.AsSpan();
|
|
||||||
data.Slice(8).CopyTo(target);
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
var target = stream.FragmentBuffer.AsSpan((int)stream.CurrentFragmentedBytes);
|
|
||||||
data.Slice(4).CopyTo(target);
|
|
||||||
|
|
||||||
stream.CurrentFragmentedBytes += (uint)(data.Length - 4);
|
|
||||||
|
|
||||||
if (stream.CurrentFragmentedBytes >= stream.TotalFragmentedBytes)
|
|
||||||
{
|
|
||||||
ProcessDecodedPacket(srcAddr, srcPort, packetTime,
|
|
||||||
stream.FragmentBuffer.AsSpan(0, (int)stream.TotalFragmentedBytes));
|
|
||||||
stream.CurrentFragmentedBytes = 0;
|
|
||||||
stream.TotalFragmentedBytes = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ProcessQueue(srcAddr, srcPort, stream_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case Opcode.Padding:
|
|
||||||
OnPacketRecv?.Invoke(this, GetDirection(srcAddr, srcPort), packetTime, data.Slice(1));
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
OnPacketRecv?.Invoke(this, GetDirection(srcAddr, srcPort), packetTime, data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ProcessQueue(IPAddress srcAddr, int srcPort, int stream_id)
|
|
||||||
{
|
|
||||||
var stream = FindStream(srcAddr, srcPort, stream_id);
|
|
||||||
var sequence = stream.Sequence;
|
|
||||||
|
|
||||||
//try to get the current sequence in the queue, if it exists then process it
|
|
||||||
ConnectionStream.QueuedPacket value;
|
|
||||||
if(stream.PacketQueue.TryGetValue(sequence, out value))
|
|
||||||
{
|
|
||||||
ProcessDecodedPacket(srcAddr, srcPort, value.PacketTime, value.Data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool Match(IPAddress srcAddr, int srcPort, IPAddress dstAddr, int dstPort)
|
|
||||||
{
|
|
||||||
var p1 = _srcAddr.Equals(srcAddr) && _srcPort == srcPort && _dstAddr.Equals(dstAddr) && _dstPort == dstPort;
|
|
||||||
var p2 = _srcAddr.Equals(dstAddr) && _srcPort == dstPort && _dstAddr.Equals(srcAddr) && _dstPort == srcPort;
|
|
||||||
return p1 || p2;
|
|
||||||
}
|
|
||||||
|
|
||||||
private SequenceOrder CompareSequence(ushort expected, ushort actual)
|
|
||||||
{
|
|
||||||
int diff = (int)actual - (int)expected;
|
|
||||||
|
|
||||||
if (diff == 0)
|
|
||||||
{
|
|
||||||
return SequenceOrder.Current;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (diff > 0)
|
|
||||||
{
|
|
||||||
if (diff > 10000)
|
|
||||||
{
|
|
||||||
return SequenceOrder.Past;
|
|
||||||
}
|
|
||||||
|
|
||||||
return SequenceOrder.Future;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (diff < -10000)
|
|
||||||
{
|
|
||||||
return SequenceOrder.Future;
|
|
||||||
}
|
|
||||||
|
|
||||||
return SequenceOrder.Past;
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool PacketCanBeDecoded(ReadOnlySpan<byte> p)
|
|
||||||
{
|
|
||||||
if (p.Length < 2)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (p[0] != 0)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
var opcode = p[1];
|
|
||||||
|
|
||||||
if (opcode == Opcode.SessionRequest || opcode == Opcode.SessionResponse || opcode == Opcode.OutOfSession)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool ValidateCRC(ReadOnlySpan<byte> p)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (_crc_bytes == 0)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
int actual = 0;
|
|
||||||
int calculated = _crc_generator.Calculate(p.Slice(0, p.Length - _crc_bytes), _encode_key);
|
|
||||||
switch (_crc_bytes)
|
|
||||||
{
|
|
||||||
case 2:
|
|
||||||
actual = IPAddress.NetworkToHostOrder(BitConverter.ToInt16(p.Slice(p.Length - 2, 2))) & 0xFFFF;
|
|
||||||
calculated = calculated & 0xFFFF;
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
actual = IPAddress.NetworkToHostOrder(BitConverter.ToInt32(p.Slice(p.Length - 4, 4)));
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return actual == calculated;
|
|
||||||
} catch(Exception ex)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private byte[] Decompress(byte[] p, int offset, int length)
|
|
||||||
{
|
|
||||||
if (length < 2)
|
|
||||||
{
|
|
||||||
return p;
|
|
||||||
}
|
|
||||||
|
|
||||||
Span<byte> header = p.AsSpan(0, offset);
|
|
||||||
byte flag = p[offset];
|
|
||||||
Span<byte> payload = p.AsSpan(offset + 1, length - 1);
|
|
||||||
|
|
||||||
if (flag == 0x5a)
|
|
||||||
{
|
|
||||||
var pl = payload.ToArray();
|
|
||||||
var inflated = Inflate(payload.ToArray());
|
|
||||||
byte[] ret = new byte[offset + inflated.Length];
|
|
||||||
Array.Copy(p, 0, ret, 0, offset);
|
|
||||||
Array.Copy(inflated, 0, ret, offset, inflated.Length);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
else if (flag == 0xa5)
|
|
||||||
{
|
|
||||||
byte[] ret = new byte[offset + length - 1];
|
|
||||||
Array.Copy(p, 0, ret, 0, offset);
|
|
||||||
Array.Copy(p, offset + 1, ret, offset, length - 1);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return p;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private byte[] Inflate(byte[] p)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
using (var out_stream = new MemoryStream())
|
|
||||||
{
|
|
||||||
using (var in_stream = new MemoryStream(p))
|
|
||||||
{
|
|
||||||
var buffer = new byte[512];
|
|
||||||
using (var zs = new ZlibStream(in_stream, CompressionMode.Decompress))
|
|
||||||
{
|
|
||||||
int r = 0;
|
|
||||||
do
|
|
||||||
{
|
|
||||||
r = zs.Read(buffer, 0, 512);
|
|
||||||
out_stream.Write(buffer, 0, r);
|
|
||||||
} while (r == 512);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var ret = out_stream.ToArray();
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private byte[] Decode(byte[] p, int offset, int length)
|
|
||||||
{
|
|
||||||
int key = _encode_key;
|
|
||||||
Span<byte> buffer = p.AsSpan(offset, length);
|
|
||||||
int i = 0;
|
|
||||||
for (i = 0; i + 4 <= length; i += 4)
|
|
||||||
{
|
|
||||||
int pt = BitConverter.ToInt32(buffer.Slice(i)) ^ key;
|
|
||||||
key = BitConverter.ToInt32(buffer.Slice(i));
|
|
||||||
|
|
||||||
if(BitConverter.TryWriteBytes(buffer.Slice(i), pt) == false)
|
|
||||||
{
|
|
||||||
throw new Exception("Error writing bytes back in decode.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
byte kc = (byte)(key & 0xFF);
|
|
||||||
for (; i < length; i++)
|
|
||||||
{
|
|
||||||
buffer[i] = (byte)(buffer[i] ^ kc);
|
|
||||||
}
|
|
||||||
|
|
||||||
return p;
|
|
||||||
}
|
|
||||||
|
|
||||||
private Direction GetDirection(IPAddress srcAddr, int srcPort)
|
|
||||||
{
|
|
||||||
if(srcAddr.Equals(_srcAddr) && srcPort == _srcPort)
|
|
||||||
{
|
|
||||||
return Direction.ClientToServer;
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
return Direction.ServerToClient;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private ConnectionStream FindStream(IPAddress srcAddr, int srcPort, int index)
|
|
||||||
{
|
|
||||||
if (index < 0 || index > 3)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
var dir = GetDirection(srcAddr, srcPort);
|
|
||||||
|
|
||||||
if(dir == Direction.ClientToServer)
|
|
||||||
{
|
|
||||||
return _client_streams[index];
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
return _server_streams[index];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private class ConnectionStream
|
|
||||||
{
|
|
||||||
public class QueuedPacket
|
|
||||||
{
|
|
||||||
public byte[] Data { get; set; }
|
|
||||||
public DateTime PacketTime { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public ConnectionStream()
|
|
||||||
{
|
|
||||||
Sequence = 0;
|
|
||||||
CurrentFragmentedBytes = 0;
|
|
||||||
TotalFragmentedBytes = 0;
|
|
||||||
FragmentBuffer = null;
|
|
||||||
PacketQueue = new Dictionary<ushort, QueuedPacket>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public ushort Sequence { get; set; }
|
|
||||||
public uint CurrentFragmentedBytes { get; set; }
|
|
||||||
public uint TotalFragmentedBytes { get; set; }
|
|
||||||
public byte[] FragmentBuffer { get; set; }
|
|
||||||
public Dictionary<ushort, QueuedPacket> PacketQueue { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,114 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace StreamParser.Common.Daybreak
|
|
||||||
{
|
|
||||||
public ref struct GamePacket
|
|
||||||
{
|
|
||||||
private readonly ReadOnlySpan<byte> _data;
|
|
||||||
|
|
||||||
public GamePacket(ReadOnlySpan<byte> data)
|
|
||||||
{
|
|
||||||
_data = data;
|
|
||||||
}
|
|
||||||
|
|
||||||
public readonly override string ToString()
|
|
||||||
{
|
|
||||||
return ToString(16);
|
|
||||||
}
|
|
||||||
|
|
||||||
public readonly string ToString(int columns)
|
|
||||||
{
|
|
||||||
int rows = _data.Length / columns;
|
|
||||||
if (_data.Length % columns != 0)
|
|
||||||
{
|
|
||||||
rows += 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int expected = (10 + columns * 4) * rows;
|
|
||||||
var sb = new StringBuilder(expected);
|
|
||||||
|
|
||||||
for(var i = 0; i < rows; ++i)
|
|
||||||
{
|
|
||||||
sb.AppendFormat("{0} |", (i * columns).ToString("X5"));
|
|
||||||
|
|
||||||
for(var j = 0; j < columns; ++j)
|
|
||||||
{
|
|
||||||
var index = (i * 16) + j;
|
|
||||||
if (index >= _data.Length)
|
|
||||||
{
|
|
||||||
sb.Append(" ");
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
var c = _data[index];
|
|
||||||
sb.AppendFormat("{0,3}", c.ToString("X2"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sb.Append(" | ");
|
|
||||||
|
|
||||||
for (var j = 0; j < columns; ++j)
|
|
||||||
{
|
|
||||||
var index = (i * 16) + j;
|
|
||||||
if (index >= _data.Length)
|
|
||||||
{
|
|
||||||
sb.Append(" ");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
var c = _data[index];
|
|
||||||
var ch = (char)c;
|
|
||||||
if (char.IsLetterOrDigit(ch) || char.IsPunctuation(ch) || char.IsSymbol(ch) || (ch == ' '))
|
|
||||||
{
|
|
||||||
sb.Append(ch);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
sb.Append(".");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sb.AppendLine();
|
|
||||||
}
|
|
||||||
|
|
||||||
return sb.ToString();
|
|
||||||
}
|
|
||||||
|
|
||||||
public readonly string ToModelString(int max_taken, bool hex)
|
|
||||||
{
|
|
||||||
int expected = Math.Min(_data.Length, max_taken) * (hex ? 2 : 1);
|
|
||||||
if(expected <= 0)
|
|
||||||
{
|
|
||||||
return string.Empty;
|
|
||||||
}
|
|
||||||
|
|
||||||
var sb = new StringBuilder(expected);
|
|
||||||
|
|
||||||
for(var i = 0; i < Math.Min(_data.Length, max_taken); ++i)
|
|
||||||
{
|
|
||||||
var c = _data[i];
|
|
||||||
if(hex)
|
|
||||||
{
|
|
||||||
sb.Append(c.ToString("X2"));
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
var ch = (char)c;
|
|
||||||
if (char.IsLetterOrDigit(ch) || char.IsPunctuation(ch) || char.IsSymbol(ch) || (ch == ' '))
|
|
||||||
{
|
|
||||||
sb.Append(ch);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
sb.Append(".");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return sb.ToString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace StreamParser.Common.Daybreak
|
|
||||||
{
|
|
||||||
public enum Direction
|
|
||||||
{
|
|
||||||
ClientToServer,
|
|
||||||
ServerToClient
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum ConnectionType
|
|
||||||
{
|
|
||||||
Unknown,
|
|
||||||
Login,
|
|
||||||
World,
|
|
||||||
Chat,
|
|
||||||
Zone
|
|
||||||
}
|
|
||||||
|
|
||||||
public interface IConnection
|
|
||||||
{
|
|
||||||
delegate void OnPacketRecvHandler(Connection connection, Direction direction, DateTime packetTime, ReadOnlySpan<byte> data);
|
|
||||||
OnPacketRecvHandler OnPacketRecv { get; set; }
|
|
||||||
|
|
||||||
void ProcessPacket(IPAddress srcAddr, int srcPort, DateTime packetTime, ReadOnlySpan<byte> data);
|
|
||||||
bool Match(IPAddress srcAddr, int srcPort, IPAddress dstAddr, int dstPort);
|
|
||||||
|
|
||||||
ConnectionType ConnectionType { get; }
|
|
||||||
IPAddress ClientAddress { get; }
|
|
||||||
int ClientPort { get; }
|
|
||||||
IPAddress ServerAddress { get; }
|
|
||||||
int ServerPort { get; }
|
|
||||||
Guid Id { get; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace StreamParser.Common.Daybreak
|
|
||||||
{
|
|
||||||
public interface IParser
|
|
||||||
{
|
|
||||||
delegate void ConnectionHandler(IConnection connection, DateTime connectionTime);
|
|
||||||
ConnectionHandler OnNewConnection { get; set; }
|
|
||||||
ConnectionHandler OnLostConnection { get; set; }
|
|
||||||
void Parse(string filename);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace StreamParser.Common.Daybreak
|
|
||||||
{
|
|
||||||
public class Opcode
|
|
||||||
{
|
|
||||||
public const byte Padding = 0;
|
|
||||||
public const byte SessionRequest = 1;
|
|
||||||
public const byte SessionResponse = 2;
|
|
||||||
public const byte Combined = 3;
|
|
||||||
public const byte SessionDisconnect = 5;
|
|
||||||
public const byte KeepAlive = 6;
|
|
||||||
public const byte SessionStatRequest = 7;
|
|
||||||
public const byte SessionStatResponse = 8;
|
|
||||||
public const byte Packet = 9;
|
|
||||||
public const byte Packet2 = 10;
|
|
||||||
public const byte Packet3 = 11;
|
|
||||||
public const byte Packet4 = 12;
|
|
||||||
public const byte Fragment = 13;
|
|
||||||
public const byte Fragment2 = 14;
|
|
||||||
public const byte Fragment3 = 15;
|
|
||||||
public const byte Fragment4 = 16;
|
|
||||||
public const byte OutOfOrderAck = 17;
|
|
||||||
public const byte OutOfOrderAck2 = 18;
|
|
||||||
public const byte OutOfOrderAck3 = 19;
|
|
||||||
public const byte OutOfOrderAck4 = 20;
|
|
||||||
public const byte Ack = 21;
|
|
||||||
public const byte Ack2 = 22;
|
|
||||||
public const byte Ack3 = 23;
|
|
||||||
public const byte Ack4 = 22;
|
|
||||||
public const byte AppCombined = 25;
|
|
||||||
public const byte OutboundPing = 28;
|
|
||||||
public const byte OutOfSession = 29;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,115 +0,0 @@
|
|||||||
using Microsoft.Extensions.Logging;
|
|
||||||
using SharpPcap;
|
|
||||||
using SharpPcap.LibPcap;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace StreamParser.Common.Daybreak
|
|
||||||
{
|
|
||||||
public class Parser : IParser
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Dependencies
|
|
||||||
*/
|
|
||||||
private readonly ILogger<Parser> _logger;
|
|
||||||
private readonly List<IConnection> _connections = new List<IConnection>();
|
|
||||||
|
|
||||||
public IParser.ConnectionHandler OnNewConnection { get; set; }
|
|
||||||
public IParser.ConnectionHandler OnLostConnection { get; set; }
|
|
||||||
|
|
||||||
public Parser(ILogger<Parser> logger)
|
|
||||||
{
|
|
||||||
_logger = logger;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Parse(string filename)
|
|
||||||
{
|
|
||||||
ICaptureDevice device = null;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
device = new CaptureFileReaderDevice(filename);
|
|
||||||
device.Open();
|
|
||||||
|
|
||||||
device.OnPacketArrival += new PacketArrivalEventHandler(OnPacketCapture);
|
|
||||||
|
|
||||||
device.Capture();
|
|
||||||
device.Close();
|
|
||||||
} catch(Exception ex)
|
|
||||||
{
|
|
||||||
_logger.LogError(ex, "Error reading device capture.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnPacketCapture(object sender, PacketCapture capture)
|
|
||||||
{
|
|
||||||
var raw = capture.GetPacket();
|
|
||||||
if (raw.LinkLayerType == PacketDotNet.LinkLayers.Ethernet || raw.LinkLayerType == PacketDotNet.LinkLayers.Null)
|
|
||||||
{
|
|
||||||
var packet = PacketDotNet.Packet.ParsePacket(raw.LinkLayerType, raw.Data);
|
|
||||||
var ipPacket = packet.Extract<PacketDotNet.IPv4Packet>();
|
|
||||||
var udpPacket = packet.Extract<PacketDotNet.UdpPacket>();
|
|
||||||
|
|
||||||
if (ipPacket != null && udpPacket != null)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
ProcessPacket(ipPacket.SourceAddress,
|
|
||||||
udpPacket.SourcePort,
|
|
||||||
ipPacket.DestinationAddress,
|
|
||||||
udpPacket.DestinationPort,
|
|
||||||
raw.Timeval.Date,
|
|
||||||
udpPacket.PayloadData);
|
|
||||||
} catch(Exception ex)
|
|
||||||
{
|
|
||||||
_logger.LogError(ex, "Error processing packet");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ProcessPacket(IPAddress srcAddr, int srcPort, IPAddress dstAddr, int dstPort, DateTime packetTime, ReadOnlySpan<byte> data)
|
|
||||||
{
|
|
||||||
if(data.Length < 2)
|
|
||||||
{
|
|
||||||
_logger.LogTrace("Tossing packet, {0} was less than minimum packet size", data.Length);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var c = FindConnection(srcAddr, srcPort, dstAddr, dstPort);
|
|
||||||
|
|
||||||
if(c != null)
|
|
||||||
{
|
|
||||||
c.ProcessPacket(srcAddr, srcPort, packetTime, data);
|
|
||||||
}
|
|
||||||
else if (data[0] == 0 && data[1] == Opcode.SessionRequest)
|
|
||||||
{
|
|
||||||
if(data.Length != 24)
|
|
||||||
{
|
|
||||||
_logger.LogTrace("Tossing packet, {0} was not the right size for a SessionRequest", data.Length);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
c = new Connection(this, srcAddr, srcPort, dstAddr, dstPort);
|
|
||||||
_connections.Add(c);
|
|
||||||
c.ProcessPacket(srcAddr, srcPort, packetTime, data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private IConnection FindConnection(IPAddress srcAddr, int srcPort, IPAddress dstAddr, int dstPort)
|
|
||||||
{
|
|
||||||
foreach (var c in _connections)
|
|
||||||
{
|
|
||||||
if (c.Match(srcAddr, srcPort, dstAddr, dstPort))
|
|
||||||
{
|
|
||||||
return c;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,103 +0,0 @@
|
|||||||
using System;
|
|
||||||
|
|
||||||
namespace StreamParser.Common.Util
|
|
||||||
{
|
|
||||||
public class Crc32
|
|
||||||
{
|
|
||||||
private uint[] _encodeTable =
|
|
||||||
{
|
|
||||||
0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA,
|
|
||||||
0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3,
|
|
||||||
0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988,
|
|
||||||
0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91,
|
|
||||||
0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE,
|
|
||||||
0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7,
|
|
||||||
0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC,
|
|
||||||
0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5,
|
|
||||||
0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172,
|
|
||||||
0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B,
|
|
||||||
0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940,
|
|
||||||
0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59,
|
|
||||||
0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116,
|
|
||||||
0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F,
|
|
||||||
0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924,
|
|
||||||
0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D,
|
|
||||||
0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A,
|
|
||||||
0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433,
|
|
||||||
0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818,
|
|
||||||
0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01,
|
|
||||||
0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E,
|
|
||||||
0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457,
|
|
||||||
0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C,
|
|
||||||
0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65,
|
|
||||||
0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2,
|
|
||||||
0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB,
|
|
||||||
0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0,
|
|
||||||
0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9,
|
|
||||||
0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086,
|
|
||||||
0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F,
|
|
||||||
0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4,
|
|
||||||
0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD,
|
|
||||||
0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A,
|
|
||||||
0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683,
|
|
||||||
0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8,
|
|
||||||
0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1,
|
|
||||||
0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE,
|
|
||||||
0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7,
|
|
||||||
0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC,
|
|
||||||
0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5,
|
|
||||||
0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252,
|
|
||||||
0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B,
|
|
||||||
0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60,
|
|
||||||
0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79,
|
|
||||||
0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236,
|
|
||||||
0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F,
|
|
||||||
0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04,
|
|
||||||
0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D,
|
|
||||||
0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A,
|
|
||||||
0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713,
|
|
||||||
0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38,
|
|
||||||
0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21,
|
|
||||||
0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E,
|
|
||||||
0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777,
|
|
||||||
0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C,
|
|
||||||
0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45,
|
|
||||||
0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2,
|
|
||||||
0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB,
|
|
||||||
0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0,
|
|
||||||
0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9,
|
|
||||||
0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6,
|
|
||||||
0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF,
|
|
||||||
0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94,
|
|
||||||
0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D
|
|
||||||
};
|
|
||||||
|
|
||||||
public int Calculate(ReadOnlySpan<byte> data)
|
|
||||||
{
|
|
||||||
uint crc = 0xffffffff;
|
|
||||||
|
|
||||||
for (int i = 0; i < data.Length; ++i)
|
|
||||||
{
|
|
||||||
crc = ((crc >> 8) & 0x00FFFFFF) ^ _encodeTable[(crc ^ data[i]) & 0x000000FF];
|
|
||||||
}
|
|
||||||
|
|
||||||
return (int)~crc;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int Calculate(ReadOnlySpan<byte> data, int key)
|
|
||||||
{
|
|
||||||
uint crc = 0xffffffff;
|
|
||||||
for (int i = 0; i < 4; ++i)
|
|
||||||
{
|
|
||||||
crc = ((crc >> 8) & 0x00FFFFFF) ^ _encodeTable[(crc ^ ((key >> (i * 8)) & 0xff)) & 0x000000FF];
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < data.Length; ++i)
|
|
||||||
{
|
|
||||||
crc = ((crc >> 8) & 0x00FFFFFF) ^ _encodeTable[(crc ^ data[i]) & 0x000000FF];
|
|
||||||
}
|
|
||||||
|
|
||||||
return (int)~crc;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
|
||||||
<RootNamespace>StreamParser.Common</RootNamespace>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="Iconic.Zlib.Netstandard" Version="1.0.0" />
|
|
||||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.1" />
|
|
||||||
<PackageReference Include="SharpPcap" Version="6.3.0" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
|
||||||
# Visual Studio Version 16
|
|
||||||
VisualStudioVersion = 16.6.30114.105
|
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "stream_parser", "stream_parser\stream_parser.csproj", "{A5662497-4771-4A00-92E7-E7790CEB20E9}"
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "common", "common\common.csproj", "{FC625344-C003-4602-A571-D8811CF5B37A}"
|
|
||||||
EndProject
|
|
||||||
Global
|
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
|
||||||
Debug|Any CPU = Debug|Any CPU
|
|
||||||
Debug|x64 = Debug|x64
|
|
||||||
Debug|x86 = Debug|x86
|
|
||||||
Release|Any CPU = Release|Any CPU
|
|
||||||
Release|x64 = Release|x64
|
|
||||||
Release|x86 = Release|x86
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
|
||||||
{A5662497-4771-4A00-92E7-E7790CEB20E9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{A5662497-4771-4A00-92E7-E7790CEB20E9}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{A5662497-4771-4A00-92E7-E7790CEB20E9}.Debug|x64.ActiveCfg = Debug|Any CPU
|
|
||||||
{A5662497-4771-4A00-92E7-E7790CEB20E9}.Debug|x64.Build.0 = Debug|Any CPU
|
|
||||||
{A5662497-4771-4A00-92E7-E7790CEB20E9}.Debug|x86.ActiveCfg = Debug|Any CPU
|
|
||||||
{A5662497-4771-4A00-92E7-E7790CEB20E9}.Debug|x86.Build.0 = Debug|Any CPU
|
|
||||||
{A5662497-4771-4A00-92E7-E7790CEB20E9}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{A5662497-4771-4A00-92E7-E7790CEB20E9}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{A5662497-4771-4A00-92E7-E7790CEB20E9}.Release|x64.ActiveCfg = Release|Any CPU
|
|
||||||
{A5662497-4771-4A00-92E7-E7790CEB20E9}.Release|x64.Build.0 = Release|Any CPU
|
|
||||||
{A5662497-4771-4A00-92E7-E7790CEB20E9}.Release|x86.ActiveCfg = Release|Any CPU
|
|
||||||
{A5662497-4771-4A00-92E7-E7790CEB20E9}.Release|x86.Build.0 = Release|Any CPU
|
|
||||||
{FC625344-C003-4602-A571-D8811CF5B37A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{FC625344-C003-4602-A571-D8811CF5B37A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{FC625344-C003-4602-A571-D8811CF5B37A}.Debug|x64.ActiveCfg = Debug|Any CPU
|
|
||||||
{FC625344-C003-4602-A571-D8811CF5B37A}.Debug|x64.Build.0 = Debug|Any CPU
|
|
||||||
{FC625344-C003-4602-A571-D8811CF5B37A}.Debug|x86.ActiveCfg = Debug|Any CPU
|
|
||||||
{FC625344-C003-4602-A571-D8811CF5B37A}.Debug|x86.Build.0 = Debug|Any CPU
|
|
||||||
{FC625344-C003-4602-A571-D8811CF5B37A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{FC625344-C003-4602-A571-D8811CF5B37A}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{FC625344-C003-4602-A571-D8811CF5B37A}.Release|x64.ActiveCfg = Release|Any CPU
|
|
||||||
{FC625344-C003-4602-A571-D8811CF5B37A}.Release|x64.Build.0 = Release|Any CPU
|
|
||||||
{FC625344-C003-4602-A571-D8811CF5B37A}.Release|x86.ActiveCfg = Release|Any CPU
|
|
||||||
{FC625344-C003-4602-A571-D8811CF5B37A}.Release|x86.Build.0 = Release|Any CPU
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
|
||||||
HideSolutionNode = FALSE
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
|
||||||
SolutionGuid = {89CDF826-F878-4BF4-8583-B9E66FE8B61D}
|
|
||||||
EndGlobalSection
|
|
||||||
EndGlobal
|
|
||||||
@@ -1,337 +0,0 @@
|
|||||||
using Microsoft.Extensions.Hosting;
|
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
using StreamParser.Common.Daybreak;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
|
||||||
using System.Net;
|
|
||||||
using System.Threading;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using CommandLine;
|
|
||||||
using System.Globalization;
|
|
||||||
using Org.BouncyCastle.Crypto.Engines;
|
|
||||||
using Org.BouncyCastle.Crypto.Modes;
|
|
||||||
using Org.BouncyCastle.Crypto;
|
|
||||||
using Org.BouncyCastle.Crypto.Parameters;
|
|
||||||
using Ionic.Zlib;
|
|
||||||
|
|
||||||
namespace StreamParser
|
|
||||||
{
|
|
||||||
public class ConsoleHostedService : IHostedService
|
|
||||||
{
|
|
||||||
private class ParsedPacket {
|
|
||||||
public byte[] Data { get; set; }
|
|
||||||
public Direction Direction { get; set; }
|
|
||||||
public DateTime Time { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
private class ParsedConnection
|
|
||||||
{
|
|
||||||
public IPAddress ClientAddress { get; set; }
|
|
||||||
public int ClientPort { get; set; }
|
|
||||||
public IPAddress ServerAddress { get; set; }
|
|
||||||
public int ServerPort { get; set; }
|
|
||||||
public ConnectionType ConnectionType { get; set; }
|
|
||||||
public List<ParsedPacket> Packets { get; set; }
|
|
||||||
public DateTime ConnectedTime { get; set; }
|
|
||||||
public DateTime? DisconnectedTime { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
private readonly ILogger<ConsoleHostedService> _logger;
|
|
||||||
private readonly IHostApplicationLifetime _applicationLifetime;
|
|
||||||
private readonly IParser _parser;
|
|
||||||
private readonly Dictionary<Guid, ParsedConnection> _connections = new Dictionary<Guid, ParsedConnection>();
|
|
||||||
|
|
||||||
public ConsoleHostedService(ILogger<ConsoleHostedService> logger,
|
|
||||||
IHostApplicationLifetime applicationLifetime,
|
|
||||||
IParser parser)
|
|
||||||
{
|
|
||||||
_logger = logger;
|
|
||||||
_applicationLifetime = applicationLifetime;
|
|
||||||
_parser = parser;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Task StartAsync(CancellationToken cancellationToken)
|
|
||||||
{
|
|
||||||
_applicationLifetime.ApplicationStarted.Register(() =>
|
|
||||||
{
|
|
||||||
var args = Environment.GetCommandLineArgs();
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
CommandLine.Parser.Default.ParseArguments<ConsoleHostedServiceOptions>(args)
|
|
||||||
.WithParsed<ConsoleHostedServiceOptions>(o =>
|
|
||||||
{
|
|
||||||
_parser.OnNewConnection += OnNewConnection;
|
|
||||||
_parser.OnLostConnection += OnLostConnection;
|
|
||||||
|
|
||||||
foreach (var f in o.Input)
|
|
||||||
{
|
|
||||||
_logger.LogInformation("Parsing {0}...", f);
|
|
||||||
_parser.Parse(f);
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (var c in _connections)
|
|
||||||
{
|
|
||||||
if (c.Value.ConnectionType == ConnectionType.Unknown && !o.DumpUnknownStreams)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (o.Text)
|
|
||||||
{
|
|
||||||
DumpConnectionToTextFile(c.Value, o.Output, o.Decrypt, o.DecompressOpcodes);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
_applicationLifetime.StopApplication();
|
|
||||||
})
|
|
||||||
.WithNotParsed<ConsoleHostedServiceOptions>(e =>
|
|
||||||
{
|
|
||||||
bool stops_processing = false;
|
|
||||||
foreach (var err in e)
|
|
||||||
{
|
|
||||||
stops_processing = stops_processing || err.StopsProcessing || err is MissingRequiredOptionError;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (stops_processing)
|
|
||||||
{
|
|
||||||
_applicationLifetime.StopApplication();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
catch(Exception ex)
|
|
||||||
{
|
|
||||||
_logger.LogError(ex, "Error parsing command line arguments");
|
|
||||||
_applicationLifetime.StopApplication();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return Task.CompletedTask;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Task StopAsync(CancellationToken cancellationToken)
|
|
||||||
{
|
|
||||||
return Task.CompletedTask;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnNewConnection(IConnection connection, DateTime connectionTime)
|
|
||||||
{
|
|
||||||
_logger.LogTrace("New connection {0}:{1} <-> {2}:{3} of type {4}",
|
|
||||||
connection.ClientAddress,
|
|
||||||
connection.ClientPort,
|
|
||||||
connection.ServerAddress,
|
|
||||||
connection.ServerPort,
|
|
||||||
connection.ConnectionType);
|
|
||||||
connection.OnPacketRecv += OnPacketRecv;
|
|
||||||
|
|
||||||
_connections.Add(connection.Id, new ParsedConnection
|
|
||||||
{
|
|
||||||
ClientAddress = connection.ClientAddress,
|
|
||||||
ClientPort = connection.ClientPort,
|
|
||||||
ServerAddress = connection.ServerAddress,
|
|
||||||
ServerPort = connection.ServerPort,
|
|
||||||
ConnectionType = connection.ConnectionType,
|
|
||||||
Packets = new List<ParsedPacket>(),
|
|
||||||
ConnectedTime = connectionTime,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnLostConnection(IConnection connection, DateTime connectionTime)
|
|
||||||
{
|
|
||||||
_logger.LogTrace("Lost connection {0}:{1} <-> {2}:{3}",
|
|
||||||
connection.ClientAddress,
|
|
||||||
connection.ClientPort,
|
|
||||||
connection.ServerAddress,
|
|
||||||
connection.ServerPort);
|
|
||||||
connection.OnPacketRecv -= OnPacketRecv;
|
|
||||||
|
|
||||||
var parsedConnection = _connections.GetValueOrDefault(connection.Id);
|
|
||||||
parsedConnection.DisconnectedTime = connectionTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnPacketRecv(IConnection connection, Direction direction, DateTime packetTime, ReadOnlySpan<byte> data)
|
|
||||||
{
|
|
||||||
var parsedConnection = _connections.GetValueOrDefault(connection.Id);
|
|
||||||
parsedConnection.Packets.Add(new ParsedPacket
|
|
||||||
{
|
|
||||||
Data = data.ToArray(),
|
|
||||||
Direction = direction,
|
|
||||||
Time = packetTime
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void DumpConnectionToTextFile(ParsedConnection c, string output, bool decrypt, IEnumerable<int> decompressOpcodes)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var path = output + string.Format("{0}-{1}.txt", c.ConnectionType.ToString().ToLower(), c.ConnectedTime.ToString("yyyyMMddHHmmssfff"));
|
|
||||||
if (File.Exists(path))
|
|
||||||
{
|
|
||||||
File.Delete(path);
|
|
||||||
}
|
|
||||||
|
|
||||||
File.AppendAllText(path, string.Format("### type: {0}\n", c.ConnectionType));
|
|
||||||
File.AppendAllText(path, string.Format("### started: {0}\n", c.ConnectedTime.ToString("s")));
|
|
||||||
File.AppendAllText(path, string.Format("### ended: {0}\n", c.DisconnectedTime.HasValue ? c.DisconnectedTime.Value.ToString("s") : "unknown"));
|
|
||||||
File.AppendAllText(path, string.Format("### client: {0}:{1}\n", c.ClientAddress.ToString(), c.ClientPort));
|
|
||||||
File.AppendAllText(path, string.Format("### server: {0}:{1}\n\n", c.ServerAddress.ToString(), c.ServerPort));
|
|
||||||
|
|
||||||
foreach(var p in c.Packets)
|
|
||||||
{
|
|
||||||
ReadOnlySpan<byte> data = p.Data;
|
|
||||||
string dir = p.Direction == Direction.ClientToServer ? "Client -> Server" : "Server -> Client";
|
|
||||||
|
|
||||||
switch (c.ConnectionType)
|
|
||||||
{
|
|
||||||
case ConnectionType.Login:
|
|
||||||
{
|
|
||||||
int opcode = BitConverter.ToUInt16(data.Slice(0, 2));
|
|
||||||
{
|
|
||||||
File.AppendAllText(path,
|
|
||||||
string.Format("{0} [Opcode: 0x{1}, Size: {2}] ({3})\n", dir, opcode.ToString("X4"), data.Length - 2, p.Time.ToString("s")));
|
|
||||||
|
|
||||||
var gp = new GamePacket(data.Slice(2));
|
|
||||||
File.AppendAllText(path, string.Format("{0}\n", gp.ToString()));
|
|
||||||
|
|
||||||
if(decrypt && opcode == 2 || opcode == 24)
|
|
||||||
{
|
|
||||||
var encrypted_block = data.Slice(12, data.Length - 12);
|
|
||||||
var dec = EQDecrypt(encrypted_block);
|
|
||||||
|
|
||||||
if(dec != null)
|
|
||||||
{
|
|
||||||
File.AppendAllText(path, string.Format("[Decrypted Data, Offset: {0}, Size: {1}]\n", 10, dec.Length));
|
|
||||||
gp = new GamePacket(dec);
|
|
||||||
File.AppendAllText(path, string.Format("{0}\n", gp.ToString()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case ConnectionType.Chat:
|
|
||||||
{
|
|
||||||
int opcode = data[0];
|
|
||||||
File.AppendAllText(path,
|
|
||||||
string.Format("{0} [Opcode: 0x{1}, Size: {2}] ({3})\n", dir, opcode.ToString("X2"), data.Length - 1, p.Time.ToString("s")));
|
|
||||||
|
|
||||||
var gp = new GamePacket(data.Slice(1));
|
|
||||||
File.AppendAllText(path, string.Format("{0}\n", gp.ToString()));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
bool reported_decompressed = false;
|
|
||||||
int opcode = BitConverter.ToUInt16(data.Slice(0, 2));
|
|
||||||
foreach (var decompressOpcode in decompressOpcodes)
|
|
||||||
{
|
|
||||||
if (opcode == decompressOpcode && data.Length > 12)
|
|
||||||
{
|
|
||||||
if (data[10] == 0x78 && data[11] == 0xDA)
|
|
||||||
{
|
|
||||||
var totalLen = BitConverter.ToInt32(data.Slice(6, 4));
|
|
||||||
if (totalLen > 0)
|
|
||||||
{
|
|
||||||
var decompressed = Inflate(data.Slice(10));
|
|
||||||
if(decompressed != null)
|
|
||||||
{
|
|
||||||
var decompressed_gp = new GamePacket(decompressed);
|
|
||||||
File.AppendAllText(path,
|
|
||||||
string.Format("{0} [Opcode: 0x{1}, Size (decompressed): {2}] ({3})\n", dir, opcode.ToString("X4"), totalLen, p.Time.ToString("s")));
|
|
||||||
|
|
||||||
File.AppendAllText(path, string.Format("{0}\n", decompressed_gp.ToString()));
|
|
||||||
reported_decompressed = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (data[6] == 0x78 && data[7] == 0xDA)
|
|
||||||
{
|
|
||||||
var totalLen = BitConverter.ToInt32(data.Slice(2, 4));
|
|
||||||
if (totalLen > 0)
|
|
||||||
{
|
|
||||||
var decompressed = Inflate(data.Slice(6));
|
|
||||||
if (decompressed != null)
|
|
||||||
{
|
|
||||||
File.AppendAllText(path,
|
|
||||||
string.Format("{0} [Opcode: 0x{1}, Size (decompressed): {2}] ({3})\n", dir, opcode.ToString("X4"), totalLen, p.Time.ToString("s")));
|
|
||||||
|
|
||||||
var decompressed_gp = new GamePacket(decompressed);
|
|
||||||
File.AppendAllText(path, string.Format("{0}\n", decompressed_gp.ToString()));
|
|
||||||
reported_decompressed = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!reported_decompressed)
|
|
||||||
{
|
|
||||||
File.AppendAllText(path,
|
|
||||||
string.Format("{0} [Opcode: 0x{1}, Size: {2}] ({3})\n", dir, opcode.ToString("X4"), data.Length - 2, p.Time.ToString("s")));
|
|
||||||
var gp = new GamePacket(data.Slice(2));
|
|
||||||
File.AppendAllText(path, string.Format("{0}\n", gp.ToString()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch(Exception ex)
|
|
||||||
{
|
|
||||||
_logger.LogError(ex, "Error dumping connection {0} to txt file", c.ConnectedTime.ToString("s"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private byte[] Inflate(ReadOnlySpan<byte> data)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
using (var out_stream = new MemoryStream())
|
|
||||||
using (var in_stream = new MemoryStream(data.ToArray()))
|
|
||||||
{
|
|
||||||
const int bufferLen = 4096;
|
|
||||||
var buffer = new byte[bufferLen];
|
|
||||||
using (var zs = new ZlibStream(in_stream, CompressionMode.Decompress))
|
|
||||||
{
|
|
||||||
int r = 0;
|
|
||||||
do
|
|
||||||
{
|
|
||||||
r = zs.Read(buffer, 0, bufferLen);
|
|
||||||
out_stream.Write(buffer, 0, r);
|
|
||||||
} while (r == bufferLen);
|
|
||||||
}
|
|
||||||
|
|
||||||
var ret = out_stream.ToArray();
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
_logger.LogError(ex, "Error inflating data");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private byte[] EQDecrypt(ReadOnlySpan<byte> data)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var desEngine = new DesEngine();
|
|
||||||
var cbcBlockCipher = new CbcBlockCipher(desEngine);
|
|
||||||
var bufferedBlockCipher = new BufferedBlockCipher(cbcBlockCipher);
|
|
||||||
bufferedBlockCipher.Init(false, new ParametersWithIV(new KeyParameter(new byte[16]), new byte[8]));
|
|
||||||
var cipherData = new byte[bufferedBlockCipher.GetOutputSize(data.Length)];
|
|
||||||
var outputLength = bufferedBlockCipher.ProcessBytes(data.ToArray(), 0, data.Length, cipherData, 0);
|
|
||||||
bufferedBlockCipher.DoFinal(cipherData, outputLength);
|
|
||||||
return cipherData;
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
_logger.LogError(ex, "Error decrypting EQ Datablock");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
using CommandLine;
|
|
||||||
|
|
||||||
namespace StreamParser
|
|
||||||
{
|
|
||||||
public class ConsoleHostedServiceOptions
|
|
||||||
{
|
|
||||||
[Option("input", Required = true, HelpText = "Input pcap files to be processed.")]
|
|
||||||
public IEnumerable<string> Input { get; set; }
|
|
||||||
|
|
||||||
[Option("output", Default = "output/", HelpText = "Directory to put output files")]
|
|
||||||
public string Output { get; set; }
|
|
||||||
|
|
||||||
[Option("text", Default = true, HelpText = "Dump connections to text files.")]
|
|
||||||
public bool Text { get; set; }
|
|
||||||
|
|
||||||
[Option("binary", Default = false, HelpText = "Dump connections to binary files.")]
|
|
||||||
public bool Binary { get; set; }
|
|
||||||
|
|
||||||
[Option("decrypt", Default = false, HelpText = "Decrypt the \"Encrypted\" packets.")]
|
|
||||||
public bool Decrypt { get; set; }
|
|
||||||
|
|
||||||
[Option("decompress", Default = null, HelpText = "Which opcodes to attempt to decompress")]
|
|
||||||
public IEnumerable<int> DecompressOpcodes { get; set; }
|
|
||||||
|
|
||||||
[Option("enable-unknown-streams", Default = false, HelpText = "Enable dumping of unknown streams; they will be skipped otherwise.")]
|
|
||||||
public bool DumpUnknownStreams { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
using Microsoft.Extensions.DependencyInjection;
|
|
||||||
using Microsoft.Extensions.Hosting;
|
|
||||||
using StreamParser.Common.Daybreak;
|
|
||||||
using System;
|
|
||||||
|
|
||||||
namespace StreamParser
|
|
||||||
{
|
|
||||||
class Program
|
|
||||||
{
|
|
||||||
static void Main(string[] args)
|
|
||||||
{
|
|
||||||
CreateHostBuilder(args).Build().Run();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static IHostBuilder CreateHostBuilder(string[] args)
|
|
||||||
{
|
|
||||||
return Host.CreateDefaultBuilder(args)
|
|
||||||
.ConfigureServices((hostContext, services) =>
|
|
||||||
{
|
|
||||||
services.AddScoped<IParser, Parser>();
|
|
||||||
services.AddHostedService<ConsoleHostedService>();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
{
|
|
||||||
"profiles": {
|
|
||||||
"stream_parser": {
|
|
||||||
"commandName": "Project",
|
|
||||||
"commandLineArgs": "--input input/cap_login_to_zone_10_16_2024.pcap --output output_test/ --binary --decrypt --decompress 16742 168 30346",
|
|
||||||
"workingDirectory": "E:\\Projects\\stream_parser\\stream_parser\\bin\\Debug\\net6.0\\"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<OutputType>Exe</OutputType>
|
|
||||||
<TargetFramework>net8.0</TargetFramework>
|
|
||||||
<RootNamespace>StreamParser</RootNamespace>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
|
||||||
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="CommandLineParser" Version="2.9.1" />
|
|
||||||
<PackageReference Include="CsvHelper" Version="33.0.1" />
|
|
||||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.1" />
|
|
||||||
<PackageReference Include="Portable.BouncyCastle" Version="1.9.0" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\common\common.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
||||||
@@ -12,12 +12,12 @@ void WorldserverCLI::CopyCharacter(int argc, char **argv, argh::parser &cmd, std
|
|||||||
};
|
};
|
||||||
std::vector<std::string> options = {};
|
std::vector<std::string> options = {};
|
||||||
|
|
||||||
|
EQEmuCommand::ValidateCmdInput(arguments, options, cmd, argc, argv);
|
||||||
|
|
||||||
if (cmd[{"-h", "--help"}]) {
|
if (cmd[{"-h", "--help"}]) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmuCommand::ValidateCmdInput(arguments, options, cmd, argc, argv);
|
|
||||||
|
|
||||||
std::string source_character_name = cmd(2).str();
|
std::string source_character_name = cmd(2).str();
|
||||||
std::string destination_character_name = cmd(3).str();
|
std::string destination_character_name = cmd(3).str();
|
||||||
std::string destination_account_name = cmd(4).str();
|
std::string destination_account_name = cmd(4).str();
|
||||||
|
|||||||
+11
-3
@@ -541,6 +541,17 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app)
|
|||||||
skip_char_info = true;
|
skip_char_info = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const auto& custom_files_key = RuleS(World, CustomFilesKey);
|
||||||
|
if (!skip_char_info && !custom_files_key.empty() && cle->Admin() < RuleI(World, CustomFilesAdminLevel)) {
|
||||||
|
// Modified clients can utilize this unused block in login_info to send custom payloads on login
|
||||||
|
// which indicates they are using custom client files with the correct version, based on key payload.
|
||||||
|
const auto client_key = std::string(reinterpret_cast<char*>(login_info->unknown064));
|
||||||
|
if (custom_files_key != client_key) {
|
||||||
|
std::string message = fmt::format("Missing Files [{}]", RuleS(World, CustomFilesUrl) );
|
||||||
|
SendUnsupportedClientPacket(message);
|
||||||
|
skip_char_info = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!skip_char_info) {
|
if (!skip_char_info) {
|
||||||
SendExpansionInfo();
|
SendExpansionInfo();
|
||||||
@@ -1209,11 +1220,8 @@ bool Client::Process() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(connect.Check()){
|
if(connect.Check()){
|
||||||
if (!(m_ClientVersionBit & EQ::versions::maskLaurionAndLater)) {
|
|
||||||
SendGuildList();// Send OPCode: OP_GuildsList
|
SendGuildList();// Send OPCode: OP_GuildsList
|
||||||
SendApproveWorld();
|
SendApproveWorld();
|
||||||
}
|
|
||||||
|
|
||||||
connect.Disable();
|
connect.Disable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -595,11 +595,6 @@ bool LoginServer::Connect()
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_keepalive = std::make_unique<EQ::Timer>(
|
|
||||||
1000,
|
|
||||||
true,
|
|
||||||
std::bind(&LoginServer::OnKeepAlive, this, std::placeholders::_1));
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -716,8 +711,3 @@ void LoginServer::SendAccountUpdate(ServerPacket *pack)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoginServer::OnKeepAlive(EQ::Timer *t)
|
|
||||||
{
|
|
||||||
ServerPacket pack(ServerOP_KeepAlive, 0);
|
|
||||||
SendPacket(&pack);
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ private:
|
|||||||
void ProcessLSRemoteAddr(uint16_t opcode, EQ::Net::Packet &p);
|
void ProcessLSRemoteAddr(uint16_t opcode, EQ::Net::Packet &p);
|
||||||
void ProcessLSAccountUpdate(uint16_t opcode, EQ::Net::Packet &p);
|
void ProcessLSAccountUpdate(uint16_t opcode, EQ::Net::Packet &p);
|
||||||
|
|
||||||
void OnKeepAlive(EQ::Timer *t);
|
|
||||||
std::unique_ptr<EQ::Timer> m_keepalive;
|
std::unique_ptr<EQ::Timer> m_keepalive;
|
||||||
|
|
||||||
std::unique_ptr<EQ::Net::ServertalkClient> m_client;
|
std::unique_ptr<EQ::Net::ServertalkClient> m_client;
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user