Compare commits

..

99 Commits

Author SHA1 Message Date
Chris Miles b23bc83f0f Merge pull request #1018 from EQEmu/feature/generated-repositories
Code Generated Repositories
2020-04-06 02:24:43 -05:00
Akkadius 700d062606 Fix windows compile 2020-04-06 01:51:58 -05:00
Akkadius 867ff3dcfa Add constructor to world content service 2020-04-06 00:22:52 -05:00
Akkadius a19bb7b544 Merge branch 'feature/peq-expansions' of https://github.com/EQEmu/Server into feature/generated-repositories 2020-04-05 23:21:21 -05:00
Akkadius 723a3aa18e Update cmake lists [skip ci] 2020-04-05 23:18:32 -05:00
Akkadius be57c57029 More adjustments [skip ci[ 2020-04-05 23:11:25 -05:00
Akkadius 725ad9ddf5 Fix comment formatting [skip ci] 2020-04-05 22:23:29 -05:00
Akkadius c978ca65a4 Split repositories out between a base immutable repository (that does not change) and an extended repository of which developers can add more custom methods to 2020-04-05 22:19:36 -05:00
Akkadius 0cce61e85d Filter GetZoneCFG [skip ci] 2020-04-05 20:11:05 -05:00
Akkadius c8722ea789 Filter start_zones [skip ci] 2020-04-05 19:58:04 -05:00
Akkadius 2f4a217f7a Filter zone_points [skip ci] 2020-04-05 19:49:04 -05:00
Akkadius 9aac84a405 filter traps [skip ci] 2020-04-05 19:45:45 -05:00
Akkadius 91c874a310 Filter starting_items [skip ci] 2020-04-05 19:43:09 -05:00
Akkadius 9fbcd99be2 Filter ground spawns [skip ci] 2020-04-05 19:40:40 -05:00
Akkadius 68a2af1bce Filter forage [skip ci] 2020-04-05 19:37:00 -05:00
Akkadius dadd674b63 Filter fishing [skip ci] 2020-04-05 19:30:02 -05:00
Akkadius f7d4e51da9 Filter global_loot [skip ci] 2020-04-05 19:20:50 -05:00
Akkadius 152d985821 Filter loot tables and drops [skip ci] 2020-04-05 19:01:45 -05:00
Akkadius 6e3922b7cc Filter merchants [skip ci] 2020-04-05 18:50:30 -05:00
Akkadius 9a90bdf91a Filter tradeskills [skip ci] 2020-04-05 18:40:19 -05:00
Akkadius 17e9198a58 Another typo fix [skip ci] 2020-04-04 21:38:05 -05:00
Akkadius e17bd303b8 Fix typos to stop triggering Secrets [skip ci] 2020-04-04 18:00:48 -05:00
Akkadius be8a6b6af4 Add spawn expansion filtering 2020-04-04 06:08:56 -05:00
Akkadius 80baf1b9ed Filter objects by expansion 2020-04-04 05:59:20 -05:00
Akkadius 8a711f3c64 Expansion filtering for doors 2020-04-04 05:51:21 -05:00
Akkadius c1e58673b2 Add expansion gating for zoning 2020-04-04 05:36:18 -05:00
Akkadius fe7e850a04 Return blank string values for string entries that return back null 2020-04-04 04:48:46 -05:00
Akkadius 15c9b64120 Add GetWhere and DeleteWhere repository methods 2020-04-04 04:44:39 -05:00
Akkadius cc8aa354f1 Add string_id define [skip ci] 2020-04-04 04:15:43 -05:00
Akkadius 33bf20a037 Merge branch 'feature/multi-tenancy' of https://github.com/EQEmu/Server into feature/peq-expansions 2020-04-04 03:56:44 -05:00
Akkadius bcef171cf9 Fix for tradeskill query [skip ci] 2020-04-04 03:55:53 -05:00
Akkadius 9faae00d15 Update cmake lists [skip ci] 2020-04-04 02:59:48 -05:00
Akkadius 0552582274 Use double quotes in strings [skip ci] 2020-04-04 02:56:14 -05:00
Akkadius 376c123fa1 More table exclusions [skip ci] 2020-04-04 02:39:15 -05:00
Akkadius 80fb204f39 More repository comb-throughs [skip ci] 2020-04-04 02:34:34 -05:00
Akkadius 826f0418f7 More float fixes [skip ci] 2020-04-04 02:27:27 -05:00
Akkadius a824ddec44 Fix float types, remove some errant table repositories [skip ci] 2020-04-04 02:26:30 -05:00
Akkadius 9e27ffacff Add tables to ignore list that do not follow typical table conventions 2020-04-04 02:13:47 -05:00
Akkadius 3aaa5020b1 Fix repository struct defaults for varchar | text 2020-04-04 02:04:48 -05:00
Akkadius d691db6621 Add repositories to cmakelists [skip ci] 2020-04-03 03:31:38 -05:00
Akkadius 82b017887d Upload generated repositories 2020-04-03 02:49:40 -05:00
Akkadius 494811c04b Update repository-generator.pl 2020-04-03 02:41:44 -05:00
Akkadius cbd2336442 Update repository generator to check for schema [skip ci] 2020-04-03 02:38:37 -05:00
Akkadius 3c9fe45af5 Update repository generator 2020-04-03 01:58:06 -05:00
Akkadius f984bd2faf Update instance list repository with auto generated code 2020-04-03 01:34:54 -05:00
Akkadius fe718a6a1d Create repository.template 2020-04-03 01:34:43 -05:00
Akkadius 9e910ad90a Create repository-generator.pl 2020-04-03 01:34:37 -05:00
Akkadius c0c1b5e678 Move doc parser scripts to new generator folder 2020-04-03 01:34:31 -05:00
Akkadius 94ab6499c8 Create account_repository.h 2020-04-03 01:17:09 -05:00
Akkadius 1650a466a1 Add instance list repository; split repository cmake config 2020-04-02 19:38:26 -05:00
Akkadius 459303c0fe Hide test: command from the help output (Developer testing) [skip ci] 2020-04-02 15:58:37 -05:00
Akkadius 72b1e58edb Groundwork for world content service and content filtering 2020-04-01 06:07:44 -05:00
Akkadius 58534dea16 Some cleanup [skip ci] 2020-04-01 00:57:34 -05:00
Akkadius 7d8347a556 Update world item instance references [skip ci] 2020-03-31 03:28:35 -05:00
Akkadius 3b9016f503 More faction calls [skip ci] 2020-03-31 02:56:48 -05:00
Akkadius 63eca22aac Get factions fully moved over [skip ci] 2020-03-31 02:49:42 -05:00
Akkadius dae20afcba Fix character creation tenancy operations 2020-03-31 01:49:42 -05:00
Akkadius 019735c654 Keeps spawns from doing individual loads and prefer bulk loading [skip ci] 2020-03-30 23:25:32 -05:00
Akkadius 0c3dd7dc93 Update zone.cpp [skip ci] 2020-03-30 21:33:11 -05:00
Akkadius 79dbddd56e Decouple temporary merchant list call [skip ci] 2020-03-30 21:32:59 -05:00
Akkadius 43716332aa Bulk load grids at repop and zone init instead of 2 costly individual selects per NPC, create repositories to decouple database logic from business logic 2020-03-30 05:49:43 -05:00
Akkadius 128cc458fd Separate tradeskill queries to not be cross-boundary, clean up logic 2020-03-30 04:29:52 -05:00
Akkadius e9b361445f Add give item saylinks to #fi #itemsearch 2020-03-30 04:28:54 -05:00
Akkadius 6127baf12a Update schema [skip ci] 2020-03-29 20:16:17 -05:00
Akkadius 8effd671c5 Second pass through tables [skip ci] 2020-03-22 03:27:44 -05:00
Akkadius 06a51f555e Fix some stragglers 2020-03-12 03:15:14 -05:00
Akkadius 3dc227e8cc Update schema [skip ci] 2020-03-12 02:53:19 -05:00
Akkadius 4375e51431 Push up schema notes [skip ci] 2020-03-12 02:42:04 -05:00
Akkadius d360c60289 Migrate ldon traps and #hotfix [skip ci] 2020-03-12 02:40:04 -05:00
Akkadius 951a77716c Migrate NPC spells, emotes, merchantlist [skip ci] 2020-03-12 02:34:02 -05:00
Akkadius ca49f3902f Migrate getZoneX calls and npc types calls [skip ci] 2020-03-12 02:27:09 -05:00
Akkadius b22d8f6148 Migrate objects and pets [skip ci] 2020-03-12 01:47:40 -05:00
Akkadius a37260fec5 Port import and eport client files to use content database connection [skip ci] 2020-03-12 01:32:25 -05:00
Akkadius ea98a71f22 client_files/export main formatting [skip ci] 2020-03-12 01:24:35 -05:00
Akkadius 7ee28d6361 Migrate shared memory to use content database source; add logic in DB::core to prevent double freeing [skip ci] 2020-03-12 01:23:06 -05:00
Akkadius 49d835165c Shared memory formatting main.cpp [skip ci] 2020-03-12 00:01:30 -05:00
Akkadius 286c08b8d5 Migrate spawn tables [skip ci] 2020-03-12 00:00:39 -05:00
Akkadius 9048265283 Migrate horses [skip ci] 2020-03-11 23:29:54 -05:00
Akkadius 4b55438b3a Migrate ground_spawns [skip ci] 2020-03-11 23:29:24 -05:00
Akkadius 26b24c02f1 Simplify connection logic 2020-03-11 04:23:44 -05:00
Akkadius 6af1ae32ae Migrate grids [skip ci] 2020-03-11 04:10:21 -05:00
Akkadius 262432f504 Migrate start_zones [skip ci] 2020-03-11 03:58:30 -05:00
Akkadius 3a09197d77 Migrate zone [skip ci] 2020-03-11 03:55:44 -05:00
Akkadius 8d21225eb3 Migrate veteran_reward_templates [skip ci] 2020-03-11 03:43:16 -05:00
Akkadius 4b2fe732d2 Migrate tributes [skip ci] 2020-03-11 03:41:58 -05:00
Akkadius f5cba5ecab Migrate tradeskills and traps [skip ci] 2020-03-11 03:41:09 -05:00
Akkadius df66c75df2 Migrate global_loot [skip ci] 2020-03-11 03:31:20 -05:00
Akkadius b3e4d90e4f Migrate tasks [skip ci] 2020-03-11 03:31:06 -05:00
Akkadius 0d270fdac7 Migrate forage [skip ci] 2020-03-11 03:30:52 -05:00
Akkadius ed06129f9d Migrate fishing [skip ci] 2020-03-11 03:24:21 -05:00
Akkadius ec5be4985e Migrate factions [skip ci] 2020-03-11 03:22:36 -05:00
Akkadius c98d2743c5 Migrate doors [skip ci] 2020-03-11 03:20:38 -05:00
Akkadius 7c2a3f602c Migrate char_create_combinations [skip ci] 2020-03-11 03:12:53 -05:00
Akkadius 13e8199298 Migrate books [skip ci] 2020-03-11 03:10:40 -05:00
Akkadius 1737ef605c Migrate blocked_spells [skip ci] 2020-03-11 03:09:59 -05:00
Akkadius 8e441f006e Migrate auras [skip ci] 2020-03-11 03:06:40 -05:00
Akkadius 91ca5dcade Migrate alternate_currency [skip ci] 2020-03-11 03:02:41 -05:00
Akkadius 7cf52d467e Migrate adventure database calls [skip ci] 2020-03-11 03:00:08 -05:00
Akkadius dde9b98e4f Beginning of multi-tenancy work 2020-03-11 02:43:21 -05:00
616 changed files with 89159 additions and 9984 deletions
+1 -17
View File
@@ -37,20 +37,4 @@ perl/
submodules/*
cmake-build-debug/
.nfs.*
# Visual Studio and CMAKE Generated Files
/.vs/
*.vcxproj
*.vcxproj.filters
*.vcxproj.user
*.cmake
*.ilk
*.pdb
*.sln
*.dir/
libs/
bin/
/Win32
/x64
/client_files/**/CMakeFiles/
.nfs.*
+3 -6
View File
@@ -1,4 +1,4 @@
CMAKE_MINIMUM_REQUIRED(VERSION 3.8)
CMAKE_MINIMUM_REQUIRED(VERSION 3.2)
SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/" ${CMAKE_MODULE_PATH})
@@ -12,7 +12,7 @@ IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build." FORCE)
ENDIF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_CXX_STANDARD 17)
SET(CMAKE_CXX_STANDARD 11)
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
SET(CMAKE_CXX_EXTENSIONS OFF)
@@ -328,10 +328,7 @@ IF(UNIX)
IF(NOT DARWIN)
SET(SERVER_LIBS ${SERVER_LIBS} "rt")
ENDIF()
# Freebsd provides uuids in the C library
IF(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
SET(SERVER_LIBS ${SERVER_LIBS} "uuid")
ENDIF()
SET(SERVER_LIBS ${SERVER_LIBS} "uuid")
ENDIF()
IF(EQEMU_BUILD_LOGIN AND NOT TLS_LIBRARY_ENABLED)
+3 -3
View File
@@ -1,7 +1,7 @@
# EQEmulator Core Server
|Travis CI (Linux)|Appveyor (Windows x86) |Appveyor (Windows x64) |
|Travis CI (Linux)|Appveyor w/ Bots (Windows) |Appveyor w/o Bots (Windows) |
|:---:|:---:|:---:|
|[![Linux CI](https://travis-ci.org/EQEmu/Server.svg?branch=master)](https://travis-ci.org/EQEmu/Server) |[![Build status](https://ci.appveyor.com/api/projects/status/v3utuu0dttm2cqd0?svg=true)](https://ci.appveyor.com/project/KimLS/server) |[![Build status](https://ci.appveyor.com/api/projects/status/scr25kmntx36c1ub?svg=true)](https://ci.appveyor.com/project/KimLS/server-87crp) |
|[![Linux CI](https://travis-ci.org/EQEmu/Server.svg?branch=master)](https://travis-ci.org/EQEmu/Server) |[![Build status](https://ci.appveyor.com/api/projects/status/scr25kmntx36c1ub/branch/master?svg=true)](https://ci.appveyor.com/project/KimLS/server-87crp/branch/master) |[![Build status](https://ci.appveyor.com/api/projects/status/mdwbr4o9l6mxqofj/branch/master?svg=true)](https://ci.appveyor.com/project/KimLS/server-w0pq2/branch/master) |
***
@@ -52,7 +52,7 @@ forum, although pull requests will be much quicker and easier on all parties.
## Resources
- [EQEmulator Forums](http://www.eqemulator.org/forums)
- [EQEmulator Wiki](https://eqemu.gitbook.io/)
- [EQEmulator Wiki](https://github.com/EQEmu/Server/wiki)
## Related Repositories
* [ProjectEQ Quests](https://github.com/ProjectEQ/projecteqquests)
+119 -76
View File
@@ -26,21 +26,24 @@
#include "../../common/crash.h"
#include "../../common/rulesys.h"
#include "../../common/string_util.h"
#include "../../common/content/world_content_service.h"
EQEmuLogSys LogSys;
WorldContentService content_service;
void ExportSpells(SharedDatabase *db);
void ExportSkillCaps(SharedDatabase *db);
void ExportBaseData(SharedDatabase *db);
void ExportDBStrings(SharedDatabase *db);
int main(int argc, char **argv) {
int main(int argc, char **argv)
{
RegisterExecutablePlatform(ExePlatformClientExport);
LogSys.LoadLogSettingsDefaults();
set_exception_handler();
LogInfo("Client Files Export Utility");
if(!EQEmuConfig::LoadConfig()) {
if (!EQEmuConfig::LoadConfig()) {
LogError("Unable to load configuration file");
return 1;
}
@@ -48,14 +51,38 @@ int main(int argc, char **argv) {
auto Config = EQEmuConfig::get();
SharedDatabase database;
SharedDatabase content_db;
LogInfo("Connecting to database");
if(!database.Connect(Config->DatabaseHost.c_str(), Config->DatabaseUsername.c_str(),
Config->DatabasePassword.c_str(), Config->DatabaseDB.c_str(), Config->DatabasePort)) {
if (!database.Connect(
Config->DatabaseHost.c_str(),
Config->DatabaseUsername.c_str(),
Config->DatabasePassword.c_str(),
Config->DatabaseDB.c_str(),
Config->DatabasePort
)) {
LogError("Unable to connect to the database, cannot continue without a database connection");
return 1;
}
/* Register Log System and Settings */
/**
* Multi-tenancy: Content database
*/
if (!Config->ContentDbHost.empty()) {
if (!content_db.Connect(
Config->ContentDbHost.c_str() ,
Config->ContentDbUsername.c_str(),
Config->ContentDbPassword.c_str(),
Config->ContentDbName.c_str(),
Config->ContentDbPort
)) {
LogError("Cannot continue without a content database connection");
return 1;
}
} else {
content_db.SetMysql(database.getMySQL());
}
database.LoadLogSettings(LogSys.log_settings);
LogSys.StartFileLogs();
@@ -66,15 +93,15 @@ int main(int argc, char **argv) {
}
if (arg_1 == "spells") {
ExportSpells(&database);
ExportSpells(&content_db);
return 0;
}
if (arg_1 == "skills") {
ExportSkillCaps(&database);
ExportSkillCaps(&content_db);
return 0;
}
if (arg_1 == "basedata") {
ExportBaseData(&database);
ExportBaseData(&content_db);
return 0;
}
if (arg_1 == "dbstring") {
@@ -82,9 +109,9 @@ int main(int argc, char **argv) {
return 0;
}
ExportSpells(&database);
ExportSkillCaps(&database);
ExportBaseData(&database);
ExportSpells(&content_db);
ExportSkillCaps(&content_db);
ExportBaseData(&content_db);
ExportDBStrings(&database);
LogSys.CloseFileLogs();
@@ -92,93 +119,105 @@ int main(int argc, char **argv) {
return 0;
}
void ExportSpells(SharedDatabase *db) {
void ExportSpells(SharedDatabase *db)
{
LogInfo("Exporting Spells");
FILE *f = fopen("export/spells_us.txt", "w");
if(!f) {
if (!f) {
LogError("Unable to open export/spells_us.txt to write, skipping.");
return;
}
const std::string query = "SELECT * FROM spells_new ORDER BY id";
auto results = db->QueryDatabase(query);
const std::string query = "SELECT * FROM spells_new ORDER BY id";
auto results = db->QueryDatabase(query);
if(results.Success()) {
for (auto row = results.begin(); row != results.end(); ++row) {
std::string line;
unsigned int fields = results.ColumnCount();
for(unsigned int i = 0; i < fields; ++i) {
if(i != 0) {
if (results.Success()) {
for (auto row = results.begin(); row != results.end(); ++row) {
std::string line;
unsigned int fields = results.ColumnCount();
for (unsigned int i = 0; i < fields; ++i) {
if (i != 0) {
line.push_back('^');
}
if(row[i] != nullptr) {
if (row[i] != nullptr) {
line += row[i];
}
}
fprintf(f, "%s\n", line.c_str());
}
} else {
}
else {
}
fclose(f);
}
bool SkillUsable(SharedDatabase *db, int skill_id, int class_id) {
bool SkillUsable(SharedDatabase *db, int skill_id, int class_id)
{
bool res = false;
std::string query = StringFormat("SELECT max(cap) FROM skill_caps WHERE class=%d AND skillID=%d",
class_id, skill_id);
auto results = db->QueryDatabase(query);
if(!results.Success()) {
return false;
}
std::string query = StringFormat(
"SELECT max(cap) FROM skill_caps WHERE class=%d AND skillID=%d",
class_id, skill_id
);
auto results = db->QueryDatabase(query);
if (!results.Success()) {
return false;
}
if (results.RowCount() == 0)
return false;
if (results.RowCount() == 0) {
return false;
}
auto row = results.begin();
if(row[0] && atoi(row[0]) > 0)
return true;
auto row = results.begin();
if (row[0] && atoi(row[0]) > 0) {
return true;
}
return false;
return false;
}
int GetSkill(SharedDatabase *db, int skill_id, int class_id, int level) {
int GetSkill(SharedDatabase *db, int skill_id, int class_id, int level)
{
std::string query = StringFormat("SELECT cap FROM skill_caps WHERE class=%d AND skillID=%d AND level=%d",
class_id, skill_id, level);
auto results = db->QueryDatabase(query);
if (!results.Success()) {
return 0;
}
std::string query = StringFormat(
"SELECT cap FROM skill_caps WHERE class=%d AND skillID=%d AND level=%d",
class_id, skill_id, level
);
auto results = db->QueryDatabase(query);
if (!results.Success()) {
return 0;
}
if (results.RowCount() == 0)
return 0;
if (results.RowCount() == 0) {
return 0;
}
auto row = results.begin();
auto row = results.begin();
return atoi(row[0]);
}
void ExportSkillCaps(SharedDatabase *db) {
void ExportSkillCaps(SharedDatabase *db)
{
LogInfo("Exporting Skill Caps");
FILE *f = fopen("export/SkillCaps.txt", "w");
if(!f) {
if (!f) {
LogError("Unable to open export/SkillCaps.txt to write, skipping.");
return;
}
for(int cl = 1; cl <= 16; ++cl) {
for(int skill = 0; skill <= 77; ++skill) {
if(SkillUsable(db, skill, cl)) {
int previous_cap = 0;
for(int level = 1; level <= 100; ++level) {
for (int cl = 1; cl <= 16; ++cl) {
for (int skill = 0; skill <= 77; ++skill) {
if (SkillUsable(db, skill, cl)) {
int previous_cap = 0;
for (int level = 1; level <= 100; ++level) {
int cap = GetSkill(db, skill, cl, level);
if(cap < previous_cap) {
if (cap < previous_cap) {
cap = previous_cap;
}
@@ -192,26 +231,28 @@ void ExportSkillCaps(SharedDatabase *db) {
fclose(f);
}
void ExportBaseData(SharedDatabase *db) {
void ExportBaseData(SharedDatabase *db)
{
LogInfo("Exporting Base Data");
FILE *f = fopen("export/BaseData.txt", "w");
if(!f) {
if (!f) {
LogError("Unable to open export/BaseData.txt to write, skipping.");
return;
}
const std::string query = "SELECT * FROM base_data ORDER BY level, class";
auto results = db->QueryDatabase(query);
if(results.Success()) {
for (auto row = results.begin();row != results.end();++row) {
std::string line;
unsigned int fields = results.ColumnCount();
for(unsigned int rowIndex = 0; rowIndex < fields; ++rowIndex) {
if(rowIndex != 0)
const std::string query = "SELECT * FROM base_data ORDER BY level, class";
auto results = db->QueryDatabase(query);
if (results.Success()) {
for (auto row = results.begin(); row != results.end(); ++row) {
std::string line;
unsigned int fields = results.ColumnCount();
for (unsigned int rowIndex = 0; rowIndex < fields; ++rowIndex) {
if (rowIndex != 0) {
line.push_back('^');
}
if(row[rowIndex] != nullptr) {
if (row[rowIndex] != nullptr) {
line += row[rowIndex];
}
}
@@ -223,27 +264,29 @@ void ExportBaseData(SharedDatabase *db) {
fclose(f);
}
void ExportDBStrings(SharedDatabase *db) {
void ExportDBStrings(SharedDatabase *db)
{
LogInfo("Exporting DB Strings");
FILE *f = fopen("export/dbstr_us.txt", "w");
if(!f) {
if (!f) {
LogError("Unable to open export/dbstr_us.txt to write, skipping.");
return;
}
fprintf(f, "Major^Minor^String(New)\n");
const std::string query = "SELECT * FROM db_str ORDER BY id, type";
auto results = db->QueryDatabase(query);
if(results.Success()) {
for(auto row = results.begin(); row != results.end(); ++row) {
std::string line;
unsigned int fields = results.ColumnCount();
for(unsigned int rowIndex = 0; rowIndex < fields; ++rowIndex) {
if(rowIndex != 0)
const std::string query = "SELECT * FROM db_str ORDER BY id, type";
auto results = db->QueryDatabase(query);
if (results.Success()) {
for (auto row = results.begin(); row != results.end(); ++row) {
std::string line;
unsigned int fields = results.ColumnCount();
for (unsigned int rowIndex = 0; rowIndex < fields; ++rowIndex) {
if (rowIndex != 0) {
line.push_back('^');
}
if(row[rowIndex] != nullptr) {
if (row[rowIndex] != nullptr) {
line += row[rowIndex];
}
}
+36 -10
View File
@@ -24,8 +24,10 @@
#include "../../common/crash.h"
#include "../../common/rulesys.h"
#include "../../common/string_util.h"
#include "../../common/content/world_content_service.h"
EQEmuLogSys LogSys;
WorldContentService content_service;
void ImportSpells(SharedDatabase *db);
void ImportSkillCaps(SharedDatabase *db);
@@ -46,24 +48,48 @@ int main(int argc, char **argv) {
auto Config = EQEmuConfig::get();
SharedDatabase database;
SharedDatabase content_db;
LogInfo("Connecting to database");
if(!database.Connect(Config->DatabaseHost.c_str(), Config->DatabaseUsername.c_str(),
Config->DatabasePassword.c_str(), Config->DatabaseDB.c_str(), Config->DatabasePort)) {
LogError("Unable to connect to the database, cannot continue without a "
"database connection");
if (!database.Connect(
Config->DatabaseHost.c_str(),
Config->DatabaseUsername.c_str(),
Config->DatabasePassword.c_str(),
Config->DatabaseDB.c_str(),
Config->DatabasePort
)) {
LogError("Unable to connect to the database, cannot continue without a database connection");
return 1;
}
/**
* Multi-tenancy: Content database
*/
if (!Config->ContentDbHost.empty()) {
if (!content_db.Connect(
Config->ContentDbHost.c_str() ,
Config->ContentDbUsername.c_str(),
Config->ContentDbPassword.c_str(),
Config->ContentDbName.c_str(),
Config->ContentDbPort
)) {
LogError("Cannot continue without a content database connection");
return 1;
}
} else {
content_db.SetMysql(database.getMySQL());
}
database.LoadLogSettings(LogSys.log_settings);
LogSys.StartFileLogs();
ImportSpells(&database);
ImportSkillCaps(&database);
ImportBaseData(&database);
ImportSpells(&content_db);
ImportSkillCaps(&content_db);
ImportBaseData(&content_db);
ImportDBStrings(&database);
LogSys.CloseFileLogs();
return 0;
}
@@ -300,10 +326,10 @@ void ImportDBStrings(SharedDatabase *db) {
std::string sql;
int id, type;
std::string value;
id = atoi(split[0].c_str());
type = atoi(split[1].c_str());
if(split.size() >= 3) {
value = ::EscapeString(split[2]);
}
+342 -1
View File
@@ -6,6 +6,7 @@ SET(common_sources
cli/eqemu_command_handler.cpp
compression.cpp
condition.cpp
content/world_content_service.cpp
crash.cpp
crc16.cpp
crc32.cpp
@@ -108,6 +109,345 @@ SET(common_sources
util/directory.cpp
util/uuid.cpp)
SET(repositories
# Criteria
repositories/criteria/content_filter_criteria.h
# Base Repositories
repositories/base/base_aa_ability_repository.h
repositories/base/base_aa_ranks_repository.h
repositories/base/base_aa_rank_effects_repository.h
repositories/base/base_aa_rank_prereqs_repository.h
repositories/base/base_account_repository.h
repositories/base/base_account_flags_repository.h
repositories/base/base_account_ip_repository.h
repositories/base/base_account_rewards_repository.h
repositories/base/base_adventure_details_repository.h
repositories/base/base_adventure_members_repository.h
repositories/base/base_adventure_stats_repository.h
repositories/base/base_adventure_template_repository.h
repositories/base/base_adventure_template_entry_repository.h
repositories/base/base_adventure_template_entry_flavor_repository.h
repositories/base/base_alternate_currency_repository.h
repositories/base/base_auras_repository.h
repositories/base/base_banned_ips_repository.h
repositories/base/base_base_data_repository.h
repositories/base/base_blocked_spells_repository.h
repositories/base/base_books_repository.h
repositories/base/base_bugs_repository.h
repositories/base/base_bug_reports_repository.h
repositories/base/base_buyer_repository.h
repositories/base/base_character_activities_repository.h
repositories/base/base_character_alternate_abilities_repository.h
repositories/base/base_character_alt_currency_repository.h
repositories/base/base_character_auras_repository.h
repositories/base/base_character_bandolier_repository.h
repositories/base/base_character_bind_repository.h
repositories/base/base_character_buffs_repository.h
repositories/base/base_character_corpses_repository.h
repositories/base/base_character_corpse_items_repository.h
repositories/base/base_character_currency_repository.h
repositories/base/base_character_data_repository.h
repositories/base/base_character_disciplines_repository.h
repositories/base/base_character_inspect_messages_repository.h
repositories/base/base_character_item_recast_repository.h
repositories/base/base_character_languages_repository.h
repositories/base/base_character_leadership_abilities_repository.h
repositories/base/base_character_material_repository.h
repositories/base/base_character_memmed_spells_repository.h
repositories/base/base_character_pet_buffs_repository.h
repositories/base/base_character_pet_info_repository.h
repositories/base/base_character_pet_inventory_repository.h
repositories/base/base_character_potionbelt_repository.h
repositories/base/base_character_skills_repository.h
repositories/base/base_character_spells_repository.h
repositories/base/base_character_tasks_repository.h
repositories/base/base_character_tribute_repository.h
repositories/base/base_char_create_combinations_repository.h
repositories/base/base_char_create_point_allocations_repository.h
repositories/base/base_char_recipe_list_repository.h
repositories/base/base_chatchannels_repository.h
repositories/base/base_command_settings_repository.h
repositories/base/base_completed_tasks_repository.h
repositories/base/base_data_buckets_repository.h
repositories/base/base_db_str_repository.h
repositories/base/base_discovered_items_repository.h
repositories/base/base_doors_repository.h
repositories/base/base_eventlog_repository.h
repositories/base/base_faction_base_data_repository.h
repositories/base/base_faction_list_repository.h
repositories/base/base_faction_list_mod_repository.h
repositories/base/base_faction_values_repository.h
repositories/base/base_fishing_repository.h
repositories/base/base_forage_repository.h
repositories/base/base_friends_repository.h
repositories/base/base_global_loot_repository.h
repositories/base/base_gm_ips_repository.h
repositories/base/base_goallists_repository.h
repositories/base/base_graveyard_repository.h
repositories/base/base_grid_repository.h
repositories/base/base_grid_entries_repository.h
repositories/base/base_ground_spawns_repository.h
repositories/base/base_group_id_repository.h
repositories/base/base_group_leaders_repository.h
repositories/base/base_guilds_repository.h
repositories/base/base_guild_members_repository.h
repositories/base/base_guild_ranks_repository.h
repositories/base/base_guild_relations_repository.h
repositories/base/base_hackers_repository.h
repositories/base/base_horses_repository.h
repositories/base/base_instance_list_repository.h
repositories/base/base_instance_list_player_repository.h
repositories/base/base_inventory_repository.h
repositories/base/base_inventory_snapshots_repository.h
repositories/base/base_ip_exemptions_repository.h
repositories/base/base_items_repository.h
repositories/base/base_item_tick_repository.h
repositories/base/base_launcher_repository.h
repositories/base/base_launcher_zones_repository.h
repositories/base/base_ldon_trap_entries_repository.h
repositories/base/base_ldon_trap_templates_repository.h
repositories/base/base_level_exp_mods_repository.h
repositories/base/base_lfguild_repository.h
repositories/base/base_login_accounts_repository.h
repositories/base/base_login_api_tokens_repository.h
repositories/base/base_login_server_admins_repository.h
repositories/base/base_login_server_list_types_repository.h
repositories/base/base_login_world_servers_repository.h
repositories/base/base_logsys_categories_repository.h
repositories/base/base_lootdrop_repository.h
repositories/base/base_lootdrop_entries_repository.h
repositories/base/base_loottable_repository.h
repositories/base/base_loottable_entries_repository.h
repositories/base/base_mail_repository.h
repositories/base/base_merchantlist_repository.h
repositories/base/base_merchantlist_temp_repository.h
repositories/base/base_name_filter_repository.h
repositories/base/base_npc_emotes_repository.h
repositories/base/base_npc_faction_repository.h
repositories/base/base_npc_faction_entries_repository.h
repositories/base/base_npc_scale_global_base_repository.h
repositories/base/base_npc_spells_repository.h
repositories/base/base_npc_spells_effects_repository.h
repositories/base/base_npc_spells_effects_entries_repository.h
repositories/base/base_npc_spells_entries_repository.h
repositories/base/base_npc_types_repository.h
repositories/base/base_npc_types_tint_repository.h
repositories/base/base_object_repository.h
repositories/base/base_object_contents_repository.h
repositories/base/base_perl_event_export_settings_repository.h
repositories/base/base_petitions_repository.h
repositories/base/base_pets_repository.h
repositories/base/base_pets_equipmentset_repository.h
repositories/base/base_pets_equipmentset_entries_repository.h
repositories/base/base_player_titlesets_repository.h
repositories/base/base_proximities_repository.h
repositories/base/base_quest_globals_repository.h
repositories/base/base_raid_details_repository.h
repositories/base/base_raid_members_repository.h
repositories/base/base_reports_repository.h
repositories/base/base_respawn_times_repository.h
repositories/base/base_rule_sets_repository.h
repositories/base/base_rule_values_repository.h
repositories/base/base_saylink_repository.h
repositories/base/base_skill_caps_repository.h
repositories/base/base_spawn2_repository.h
repositories/base/base_spawnentry_repository.h
repositories/base/base_spawngroup_repository.h
repositories/base/base_spawn_conditions_repository.h
repositories/base/base_spawn_condition_values_repository.h
repositories/base/base_spawn_events_repository.h
repositories/base/base_spells_new_repository.h
repositories/base/base_spell_buckets_repository.h
repositories/base/base_spell_globals_repository.h
repositories/base/base_starting_items_repository.h
repositories/base/base_start_zones_repository.h
repositories/base/base_tasks_repository.h
repositories/base/base_tasksets_repository.h
repositories/base/base_task_activities_repository.h
repositories/base/base_timers_repository.h
repositories/base/base_titles_repository.h
repositories/base/base_trader_repository.h
repositories/base/base_tradeskill_recipe_repository.h
repositories/base/base_tradeskill_recipe_entries_repository.h
repositories/base/base_traps_repository.h
repositories/base/base_tributes_repository.h
repositories/base/base_tribute_levels_repository.h
repositories/base/base_variables_repository.h
repositories/base/base_veteran_reward_templates_repository.h
repositories/base/base_zone_repository.h
repositories/base/base_zone_points_repository.h
# Extended Repositories
repositories/aa_ability_repository.h
repositories/aa_ranks_repository.h
repositories/aa_rank_effects_repository.h
repositories/aa_rank_prereqs_repository.h
repositories/account_repository.h
repositories/account_flags_repository.h
repositories/account_ip_repository.h
repositories/account_rewards_repository.h
repositories/adventure_details_repository.h
repositories/adventure_members_repository.h
repositories/adventure_stats_repository.h
repositories/adventure_template_repository.h
repositories/adventure_template_entry_repository.h
repositories/adventure_template_entry_flavor_repository.h
repositories/alternate_currency_repository.h
repositories/auras_repository.h
repositories/banned_ips_repository.h
repositories/base_data_repository.h
repositories/blocked_spells_repository.h
repositories/books_repository.h
repositories/bugs_repository.h
repositories/bug_reports_repository.h
repositories/buyer_repository.h
repositories/character_activities_repository.h
repositories/character_alternate_abilities_repository.h
repositories/character_alt_currency_repository.h
repositories/character_auras_repository.h
repositories/character_bandolier_repository.h
repositories/character_bind_repository.h
repositories/character_buffs_repository.h
repositories/character_corpses_repository.h
repositories/character_corpse_items_repository.h
repositories/character_currency_repository.h
repositories/character_data_repository.h
repositories/character_disciplines_repository.h
repositories/character_inspect_messages_repository.h
repositories/character_item_recast_repository.h
repositories/character_languages_repository.h
repositories/character_leadership_abilities_repository.h
repositories/character_material_repository.h
repositories/character_memmed_spells_repository.h
repositories/character_pet_buffs_repository.h
repositories/character_pet_info_repository.h
repositories/character_pet_inventory_repository.h
repositories/character_potionbelt_repository.h
repositories/character_skills_repository.h
repositories/character_spells_repository.h
repositories/character_tasks_repository.h
repositories/character_tribute_repository.h
repositories/char_create_combinations_repository.h
repositories/char_create_point_allocations_repository.h
repositories/char_recipe_list_repository.h
repositories/chatchannels_repository.h
repositories/command_settings_repository.h
repositories/completed_tasks_repository.h
repositories/data_buckets_repository.h
repositories/db_str_repository.h
repositories/discovered_items_repository.h
repositories/doors_repository.h
repositories/eventlog_repository.h
repositories/faction_base_data_repository.h
repositories/faction_list_repository.h
repositories/faction_list_mod_repository.h
repositories/faction_values_repository.h
repositories/fishing_repository.h
repositories/forage_repository.h
repositories/friends_repository.h
repositories/global_loot_repository.h
repositories/gm_ips_repository.h
repositories/goallists_repository.h
repositories/graveyard_repository.h
repositories/grid_repository.h
repositories/grid_entries_repository.h
repositories/ground_spawns_repository.h
repositories/group_id_repository.h
repositories/group_leaders_repository.h
repositories/guilds_repository.h
repositories/guild_members_repository.h
repositories/guild_ranks_repository.h
repositories/guild_relations_repository.h
repositories/hackers_repository.h
repositories/horses_repository.h
repositories/instance_list_repository.h
repositories/instance_list_player_repository.h
repositories/inventory_repository.h
repositories/inventory_snapshots_repository.h
repositories/ip_exemptions_repository.h
repositories/items_repository.h
repositories/item_tick_repository.h
repositories/launcher_repository.h
repositories/launcher_zones_repository.h
repositories/ldon_trap_entries_repository.h
repositories/ldon_trap_templates_repository.h
repositories/level_exp_mods_repository.h
repositories/lfguild_repository.h
repositories/login_accounts_repository.h
repositories/login_api_tokens_repository.h
repositories/login_server_admins_repository.h
repositories/login_server_list_types_repository.h
repositories/login_world_servers_repository.h
repositories/logsys_categories_repository.h
repositories/lootdrop_repository.h
repositories/lootdrop_entries_repository.h
repositories/loottable_repository.h
repositories/loottable_entries_repository.h
repositories/mail_repository.h
repositories/merchantlist_repository.h
repositories/merchantlist_temp_repository.h
repositories/name_filter_repository.h
repositories/npc_emotes_repository.h
repositories/npc_faction_repository.h
repositories/npc_faction_entries_repository.h
repositories/npc_scale_global_base_repository.h
repositories/npc_spells_repository.h
repositories/npc_spells_effects_repository.h
repositories/npc_spells_effects_entries_repository.h
repositories/npc_spells_entries_repository.h
repositories/npc_types_repository.h
repositories/npc_types_tint_repository.h
repositories/object_repository.h
repositories/object_contents_repository.h
repositories/perl_event_export_settings_repository.h
repositories/petitions_repository.h
repositories/pets_repository.h
repositories/pets_equipmentset_repository.h
repositories/pets_equipmentset_entries_repository.h
repositories/player_titlesets_repository.h
repositories/proximities_repository.h
repositories/quest_globals_repository.h
repositories/raid_details_repository.h
repositories/raid_members_repository.h
repositories/reports_repository.h
repositories/respawn_times_repository.h
repositories/rule_sets_repository.h
repositories/rule_values_repository.h
repositories/saylink_repository.h
repositories/skill_caps_repository.h
repositories/spawn2_repository.h
repositories/spawnentry_repository.h
repositories/spawngroup_repository.h
repositories/spawn_conditions_repository.h
repositories/spawn_condition_values_repository.h
repositories/spawn_events_repository.h
repositories/spells_new_repository.h
repositories/spell_buckets_repository.h
repositories/spell_globals_repository.h
repositories/starting_items_repository.h
repositories/start_zones_repository.h
repositories/tasks_repository.h
repositories/tasksets_repository.h
repositories/task_activities_repository.h
repositories/timers_repository.h
repositories/titles_repository.h
repositories/trader_repository.h
repositories/tradeskill_recipe_repository.h
repositories/tradeskill_recipe_entries_repository.h
repositories/traps_repository.h
repositories/tributes_repository.h
repositories/tribute_levels_repository.h
repositories/variables_repository.h
repositories/veteran_reward_templates_repository.h
repositories/zone_repository.h
repositories/zone_points_repository.h
# Non-Comformative
repositories/character_recipe_list_repository.h
)
SET(common_headers
any.h
base_packet.h
@@ -116,6 +456,7 @@ SET(common_headers
classes.h
compression.h
condition.h
content/world_content_service.h
crash.h
crc16.h
crc32.h
@@ -380,7 +721,7 @@ SOURCE_GROUP(Util FILES
INCLUDE_DIRECTORIES(Patches SocketLib StackWalker)
ADD_LIBRARY(common ${common_sources} ${common_headers})
ADD_LIBRARY(common ${common_sources} ${common_headers} ${repositories})
IF(UNIX)
SET_SOURCE_FILES_PROPERTIES("SocketLib/Mime.cpp" PROPERTY COMPILE_FLAGS -Wno-unused-result)
+2 -2
View File
@@ -24,7 +24,7 @@
* DEALINGS IN THE SOFTWARE.
*/
// EQ::Any is a modified version of Boost::Any and as such retains the Boost licensing.
// EQEmu::Any is a modified version of Boost::Any and as such retains the Boost licensing.
#ifndef EQEMU_COMMON_ANY_H
#define EQEMU_COMMON_ANY_H
@@ -32,7 +32,7 @@
#include <algorithm>
#include <typeinfo>
namespace EQ
namespace EQEmu
{
class Any
{
+5
View File
@@ -168,6 +168,11 @@ namespace EQEmuCommand {
* Print section header
*/
std::string command_prefix = it.first.substr(0, it.first.find(":"));
if (command_prefix.find("test") != std::string::npos) {
continue;
}
if (command_section != command_prefix) {
command_section = command_prefix;
std::cout << termcolor::reset << command_prefix << std::endl;
+1 -1
View File
@@ -3,7 +3,7 @@
#include <string.h>
#include <zlib.h>
namespace EQ
namespace EQEmu
{
uint32 EstimateDeflateBuffer(uint32 len) {
z_stream zstream;
+1 -1
View File
@@ -1,6 +1,6 @@
#pragma once
namespace EQ
namespace EQEmu
{
uint32 EstimateDeflateBuffer(uint32 len);
uint32 DeflateData(const char *buffer, uint32 len, char *out_buffer, uint32 out_len_max);
+46
View File
@@ -0,0 +1,46 @@
/**
* EQEmulator: Everquest Server Emulator
* Copyright (C) 2001-2019 EQEmulator Development Team (https://github.com/EQEmu/Server)
*
* 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 "world_content_service.h"
WorldContentService::WorldContentService()
{
SetCurrentExpansion(0);
}
int WorldContentService::GetCurrentExpansion() const
{
return current_expansion;
}
void WorldContentService::SetCurrentExpansion(int current_expansion)
{
WorldContentService::current_expansion = current_expansion;
}
const std::vector<std::string> &WorldContentService::GetContentFlags() const
{
return content_flags;
}
void WorldContentService::SetContentFlags(std::vector<std::string> content_flags)
{
WorldContentService::content_flags = content_flags;
}
+167
View File
@@ -0,0 +1,167 @@
/**
* EQEmulator: Everquest Server Emulator
* Copyright (C) 2001-2019 EQEmulator Development Team (https://github.com/EQEmu/Server)
*
* 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 EQEMU_WORLD_CONTENT_SERVICE_H
#define EQEMU_WORLD_CONTENT_SERVICE_H
#include <string>
#include <vector>
namespace Expansion {
enum ExpansionNumber {
Classic = 0,
TheRuinsOfKunark,
TheScarsOfVelious,
TheShadowsOfLuclin,
ThePlanesOfPower,
TheLegacyOfYkesha,
LostDungeonsOfNorrath,
GatesOfDiscord,
OmensOfWar,
DragonsOfNorrath,
DepthsOfDarkhollow,
ProphecyOfRo,
TheSerpentsSpine,
TheBuriedSea,
SecretsOfFaydwer,
SeedsOfDestruction,
Underfoot,
HouseOfThule,
VeilOfAlaris,
RainOfFear,
CallOfTheForsaken,
TheDarkendSea,
TheBrokenMirror,
EmpiresOfKunark,
RingOfScale,
TheBurningLands,
TormentOfVelious,
MaxId
};
/**
* If you add to this, make sure you update LogCategory
*/
static const char *ExpansionName[ExpansionNumber::MaxId] = {
"Classic",
"The Ruins of Kunark",
"The Scars of Velious",
"The Shadows of Luclin",
"The Planes of Power",
"The Legacy of Ykesha",
"Lost Dungeons of Norrath",
"Gates of Discord",
"Omens of War",
"Dragons of Norrath",
"Depths of Darkhollow",
"Prophecy of Ro",
"The Serpent's Spine",
"The Buried Sea",
"Secrets of Faydwer",
"Seeds of Destruction",
"Underfoot",
"House of Thule",
"Veil of Alaris",
"Rain of Fear",
"Call of the Forsaken",
"The Darkened Sea",
"The Broken Mirror",
"Empires of Kunark",
"Ring of Scale",
"The Burning Lands",
"Torment of Velious",
};
}
class WorldContentService {
public:
WorldContentService();
int GetCurrentExpansion() const;
void SetCurrentExpansion(int current_expansion);
bool IsClassicEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::Classic; }
bool IsTheRuinsOfKunarkEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheRuinsOfKunark; }
bool IsTheScarsOfVeliousEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheScarsOfVelious; }
bool IsTheShadowsOfLuclinEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheShadowsOfLuclin; }
bool IsThePlanesOfPowerEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::ThePlanesOfPower; }
bool IsTheLegacyOfYkeshaEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheLegacyOfYkesha; }
bool IsLostDungeonsOfNorrathEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::LostDungeonsOfNorrath; }
bool IsGatesOfDiscordEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::GatesOfDiscord; }
bool IsOmensOfWarEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::OmensOfWar; }
bool IsDragonsOfNorrathEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::DragonsOfNorrath; }
bool IsDepthsOfDarkhollowEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::DepthsOfDarkhollow; }
bool IsProphecyOfRoEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::ProphecyOfRo; }
bool IsTheSerpentsSpineEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheSerpentsSpine; }
bool IsTheBuriedSeaEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheBuriedSea; }
bool IsSecretsOfFaydwerEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::SecretsOfFaydwer; }
bool IsSeedsOfDestructionEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::SeedsOfDestruction; }
bool IsUnderfootEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::Underfoot; }
bool IsHouseOfThuleEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::HouseOfThule; }
bool IsVeilOfAlarisEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::VeilOfAlaris; }
bool IsRainOfFearEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::RainOfFear; }
bool IsCallOfTheForsakenEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::CallOfTheForsaken; }
bool IsTheDarkendSeaEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheDarkendSea; }
bool IsTheBrokenMirrorEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheBrokenMirror; }
bool IsEmpiresOfKunarkEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::EmpiresOfKunark; }
bool IsRingOfScaleEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::RingOfScale; }
bool IsTheBurningLandsEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheBurningLands; }
bool IsTormentOfVeliousEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TormentOfVelious; }
bool IsCurrentExpansionClassic() { return current_expansion == Expansion::ExpansionNumber::Classic; }
bool IsCurrentExpansionTheRuinsOfKunark() { return current_expansion == Expansion::ExpansionNumber::TheRuinsOfKunark; }
bool IsCurrentExpansionTheScarsOfVelious() { return current_expansion == Expansion::ExpansionNumber::TheScarsOfVelious; }
bool IsCurrentExpansionTheShadowsOfLuclin() { return current_expansion == Expansion::ExpansionNumber::TheShadowsOfLuclin; }
bool IsCurrentExpansionThePlanesOfPower() { return current_expansion == Expansion::ExpansionNumber::ThePlanesOfPower; }
bool IsCurrentExpansionTheLegacyOfYkesha() { return current_expansion == Expansion::ExpansionNumber::TheLegacyOfYkesha; }
bool IsCurrentExpansionLostDungeonsOfNorrath() { return current_expansion == Expansion::ExpansionNumber::LostDungeonsOfNorrath; }
bool IsCurrentExpansionGatesOfDiscord() { return current_expansion == Expansion::ExpansionNumber::GatesOfDiscord; }
bool IsCurrentExpansionOmensOfWar() { return current_expansion == Expansion::ExpansionNumber::OmensOfWar; }
bool IsCurrentExpansionDragonsOfNorrath() { return current_expansion == Expansion::ExpansionNumber::DragonsOfNorrath; }
bool IsCurrentExpansionDepthsOfDarkhollow() { return current_expansion == Expansion::ExpansionNumber::DepthsOfDarkhollow; }
bool IsCurrentExpansionProphecyOfRo() { return current_expansion == Expansion::ExpansionNumber::ProphecyOfRo; }
bool IsCurrentExpansionTheSerpentsSpine() { return current_expansion == Expansion::ExpansionNumber::TheSerpentsSpine; }
bool IsCurrentExpansionTheBuriedSea() { return current_expansion == Expansion::ExpansionNumber::TheBuriedSea; }
bool IsCurrentExpansionSecretsOfFaydwer() { return current_expansion == Expansion::ExpansionNumber::SecretsOfFaydwer; }
bool IsCurrentExpansionSeedsOfDestruction() { return current_expansion == Expansion::ExpansionNumber::SeedsOfDestruction; }
bool IsCurrentExpansionUnderfoot() { return current_expansion == Expansion::ExpansionNumber::Underfoot; }
bool IsCurrentExpansionHouseOfThule() { return current_expansion == Expansion::ExpansionNumber::HouseOfThule; }
bool IsCurrentExpansionVeilOfAlaris() { return current_expansion == Expansion::ExpansionNumber::VeilOfAlaris; }
bool IsCurrentExpansionRainOfFear() { return current_expansion == Expansion::ExpansionNumber::RainOfFear; }
bool IsCurrentExpansionCallOfTheForsaken() { return current_expansion == Expansion::ExpansionNumber::CallOfTheForsaken; }
bool IsCurrentExpansionTheDarkendSea() { return current_expansion == Expansion::ExpansionNumber::TheDarkendSea; }
bool IsCurrentExpansionTheBrokenMirror() { return current_expansion == Expansion::ExpansionNumber::TheBrokenMirror; }
bool IsCurrentExpansionEmpiresOfKunark() { return current_expansion == Expansion::ExpansionNumber::EmpiresOfKunark; }
bool IsCurrentExpansionRingOfScale() { return current_expansion == Expansion::ExpansionNumber::RingOfScale; }
bool IsCurrentExpansionTheBurningLands() { return current_expansion == Expansion::ExpansionNumber::TheBurningLands; }
bool IsCurrentExpansionTormentOfVelious() { return current_expansion == Expansion::ExpansionNumber::TormentOfVelious; }
private:
int current_expansion;
std::vector<std::string> content_flags;
public:
const std::vector<std::string> &GetContentFlags() const;
void SetContentFlags(std::vector<std::string> content_flags);
};
extern WorldContentService content_service;
#endif //EQEMU_WORLD_CONTENT_SERVICE_H
-5
View File
@@ -118,11 +118,6 @@ void set_exception_handler() {
#include <unistd.h>
#include <sys/fcntl.h>
#ifdef __FreeBSD__
#include <signal.h>
#include <sys/stat.h>
#endif
void print_trace()
{
auto uid = geteuid();
+1 -1
View File
@@ -23,7 +23,7 @@
#include <algorithm>
#include <cmath>
namespace EQ {
namespace EQEmu {
template<typename T>
T Clamp(const T &value, const T &lower, const T &upper)
{
+3 -91
View File
@@ -750,61 +750,6 @@ bool Database::SaveCharacterCreate(uint32 character_id, uint32 account_id, Playe
return true;
}
/* This only for new Character creation storing */
bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, EQ::InventoryProfile* inv) {
uint32 charid = 0;
char zone[50];
float x, y, z;
charid = GetCharacterID(pp->name);
if(!charid) {
LogError("StoreCharacter: no character id");
return false;
}
const char *zname = GetZoneName(pp->zone_id);
if(zname == nullptr) {
/* Zone not in the DB, something to prevent crash... */
strn0cpy(zone, "qeynos", 49);
pp->zone_id = 1;
}
else{ strn0cpy(zone, zname, 49); }
x = pp->x;
y = pp->y;
z = pp->z;
/* Saves Player Profile Data */
SaveCharacterCreate(charid, account_id, pp);
/* Insert starting inventory... */
std::string invquery;
for (int16 i = EQ::invslot::EQUIPMENT_BEGIN; i <= EQ::invbag::BANK_BAGS_END;) {
const EQ::ItemInstance* newinv = inv->GetItem(i);
if (newinv) {
invquery = StringFormat("INSERT INTO `inventory` (charid, slotid, itemid, charges, color) VALUES (%u, %i, %u, %i, %u)",
charid, i, newinv->GetItem()->ID, newinv->GetCharges(), newinv->GetColor());
auto results = QueryDatabase(invquery);
}
if (i == EQ::invslot::slotCursor) {
i = EQ::invbag::GENERAL_BAGS_BEGIN;
continue;
}
else if (i == EQ::invbag::CURSOR_BAG_END) {
i = EQ::invslot::BANK_BEGIN;
continue;
}
else if (i == EQ::invslot::BANK_END) {
i = EQ::invbag::BANK_BAGS_BEGIN;
continue;
}
i++;
}
return true;
}
uint32 Database::GetCharacterID(const char *name) {
std::string query = StringFormat("SELECT `id` FROM `character_data` WHERE `name` = '%s'", name);
auto results = QueryDatabase(query);
@@ -925,38 +870,6 @@ void Database::GetCharName(uint32 char_id, char* name) {
}
}
const char* Database::GetCharNameByID(uint32 char_id) {
std::string query = fmt::format("SELECT `name` FROM `character_data` WHERE id = {}", char_id);
auto results = QueryDatabase(query);
if (!results.Success()) {
return "";
}
if (results.RowCount() == 0) {
return "";
}
auto row = results.begin();
return row[0];
}
const char* Database::GetNPCNameByID(uint32 npc_id) {
std::string query = fmt::format("SELECT `name` FROM `npc_types` WHERE id = {}", npc_id);
auto results = QueryDatabase(query);
if (!results.Success()) {
return "";
}
if (results.RowCount() == 0) {
return "";
}
auto row = results.begin();
return row[0];
}
bool Database::LoadVariables() {
auto results = QueryDatabase(StringFormat("SELECT varname, value, unix_timestamp() FROM variables where unix_timestamp(ts) >= %d", varcache.last_update));
@@ -1162,9 +1075,9 @@ uint32 Database::GetZoneID(const char* zonename) {
if (zonename == nullptr)
return 0;
for (auto iter = zonename_array.begin(); iter != zonename_array.end(); ++iter)
if (strcasecmp(iter->second.c_str(), zonename) == 0)
return iter->first;
for (auto & iter : zonename_array)
if (strcasecmp(iter.second.c_str(), zonename) == 0)
return iter.first;
return 0;
}
@@ -2405,4 +2318,3 @@ int Database::GetInstanceID(uint32 char_id, uint32 zone_id) {
return 0;
}
+5 -8
View File
@@ -40,7 +40,7 @@
class MySQLRequestResult;
class Client;
namespace EQ
namespace EQEmu
{
class InventoryProfile;
}
@@ -115,7 +115,6 @@ public:
bool SaveCharacterCreate(uint32 character_id, uint32 account_id, PlayerProfile_Struct* pp);
bool SetHackerFlag(const char* accountname, const char* charactername, const char* hacked);
bool SetMQDetectionFlag(const char* accountname, const char* charactername, const char* hacked, const char* zone);
bool StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, EQ::InventoryProfile* inv);
bool UpdateName(const char* oldname, const char* newname);
/* General Information Queries */
@@ -138,8 +137,6 @@ public:
void GetAccountName(uint32 accountid, char* name, uint32* oLSAccountID = 0);
void GetCharName(uint32 char_id, char* name);
const char *GetCharNameByID(uint32 char_id);
const char *GetNPCNameByID(uint32 npc_id);
void LoginIP(uint32 AccountID, const char* LoginIP);
/* Instancing */
@@ -196,19 +193,19 @@ public:
void GetAccountFromID(uint32 id, char* oAccountName, int16* oStatus);
void SetAgreementFlag(uint32 acctid);
int GetIPExemption(std::string account_ip);
int GetInstanceID(uint32 char_id, uint32 zone_id);
/* Groups */
char* GetGroupLeaderForLogin(const char* name,char* leaderbuf);
char* GetGroupLeadershipInfo(uint32 gid, char* leaderbuf, char* maintank = nullptr, char* assist = nullptr, char* puller = nullptr, char *marknpc = nullptr, char *mentoree = nullptr, int *mentor_percent = nullptr, GroupLeadershipAA_Struct* GLAA = nullptr);
uint32 GetGroupID(const char* name);
void ClearGroup(uint32 gid = 0);
void ClearGroupLeader(uint32 gid = 0);
void SetGroupID(const char* name, uint32 id, uint32 charid, uint32 ismerc = false);
+3 -6
View File
@@ -50,11 +50,7 @@ std::string DatabaseDumpService::execute(const std::string &cmd, bool return_res
const char *file_name = "db-exec-result.txt";
if (return_result) {
#ifdef _WINDOWS
std::system((cmd + " > " + file_name + " 2>&1").c_str());
#else
std::system((cmd + " > " + file_name).c_str());
#endif
}
else {
std::system((cmd).c_str());
@@ -99,7 +95,7 @@ bool DatabaseDumpService::IsTarAvailable()
*/
bool DatabaseDumpService::Is7ZipAvailable()
{
std::string version_output = execute("7z --help");
std::string version_output = execute("7z -help");
return version_output.find("7-Zip") != std::string::npos;
}
@@ -400,8 +396,9 @@ void DatabaseDumpService::Dump()
else if (Is7ZipAvailable()) {
execute(
fmt::format(
"7z a -t7z {}.zip {}.sql",
"7z a -t7z {}.zip -C {} {}.sql",
GetDumpFileNameWithPath(),
GetSetDumpPath(),
GetDumpFileNameWithPath()
)
);
+4 -4
View File
@@ -189,7 +189,7 @@ namespace Convert {
/*002*/ uint32 HP;
/*006*/ uint32 Mana;
/*010*/ Convert::SpellBuff_Struct Buffs[BUFF_COUNT];
/*510*/ uint32 Items[EQ::textures::materialCount];
/*510*/ uint32 Items[EQEmu::textures::materialCount];
/*546*/ char Name[64];
/*610*/
};
@@ -230,9 +230,9 @@ namespace Convert {
/*0304*/ uint8 ability_time_minutes;
/*0305*/ uint8 ability_time_hours; //place holder
/*0306*/ uint8 unknown0306[6]; // @bp Spacer/Flag?
/*0312*/ uint32 item_material[EQ::textures::materialCount]; // Item texture/material of worn/held items
/*0312*/ uint32 item_material[EQEmu::textures::materialCount]; // Item texture/material of worn/held items
/*0348*/ uint8 unknown0348[44];
/*0392*/ Convert::Color_Struct item_tint[EQ::textures::materialCount];
/*0392*/ Convert::Color_Struct item_tint[EQEmu::textures::materialCount];
/*0428*/ Convert::AA_Array aa_array[MAX_PP_AA_ARRAY];
/*2348*/ float unknown2384; //seen ~128, ~47
/*2352*/ char servername[32]; // length probably not right
@@ -1396,7 +1396,7 @@ bool Database::CheckDatabaseConvertPPDeblob(){
if (rquery != ""){ results = QueryDatabase(rquery); }
/* Run Material Color Convert */
first_entry = 0; rquery = "";
for (i = EQ::textures::textureBegin; i < EQ::textures::materialCount; i++){
for (i = EQEmu::textures::textureBegin; i < EQEmu::textures::materialCount; i++){
if (pp->item_tint[i].color > 0){
if (first_entry != 1){
rquery = StringFormat("REPLACE INTO `character_material` (id, slot, blue, green, red, use_tint, color) VALUES (%u, %u, %u, %u, %u, %u, %u)", character_id, i, pp->item_tint[i].rgb.blue, pp->item_tint[i].rgb.green, pp->item_tint[i].rgb.red, pp->item_tint[i].rgb.use_tint, pp->item_tint[i].color);
+54 -105
View File
@@ -97,53 +97,42 @@ bool Database::CheckInstanceExists(uint16 instance_id) {
bool Database::CheckInstanceExpired(uint16 instance_id)
{
int32 start_time = 0;
int32 duration = 0;
int32 start_time = 0;
int32 duration = 0;
uint32 never_expires = 0;
std::string query = StringFormat(
"SELECT start_time, duration, never_expires FROM instance_list WHERE id=%u",
instance_id
);
std::string query = StringFormat("SELECT start_time, duration, never_expires FROM instance_list WHERE id=%u", instance_id);
auto results = QueryDatabase(query);
if (!results.Success()) {
if (!results.Success())
return true;
}
if (results.RowCount() == 0) {
if (results.RowCount() == 0)
return true;
}
auto row = results.begin();
start_time = atoi(row[0]);
duration = atoi(row[1]);
start_time = atoi(row[0]);
duration = atoi(row[1]);
never_expires = atoi(row[2]);
if (never_expires == 1) {
if (never_expires == 1)
return false;
}
timeval tv{};
timeval tv;
gettimeofday(&tv, nullptr);
return (start_time + duration) <= tv.tv_sec;
if ((start_time + duration) <= tv.tv_sec)
return true;
return false;
}
bool Database::CreateInstance(uint16 instance_id, uint32 zone_id, uint32 version, uint32 duration)
{
std::string query = StringFormat(
"INSERT INTO instance_list (id, zone, version, start_time, duration)"
" values (%u, %u, %u, UNIX_TIMESTAMP(), %u)",
instance_id,
zone_id,
version,
duration
);
std::string query = StringFormat("INSERT INTO instance_list (id, zone, version, start_time, duration)"
" values(%lu, %lu, %lu, UNIX_TIMESTAMP(), %lu)",
(unsigned long)instance_id, (unsigned long)zone_id, (unsigned long)version, (unsigned long)duration);
auto results = QueryDatabase(query);
return results.Success();
@@ -151,84 +140,66 @@ bool Database::CreateInstance(uint16 instance_id, uint32 zone_id, uint32 version
bool Database::GetUnusedInstanceID(uint16 &instance_id)
{
uint32 max_reserved_instance_id = RuleI(Instances, ReservedInstances);
uint32 max = 32000;
std::string query = StringFormat(
"SELECT IFNULL(MAX(id),%u)+1 FROM instance_list WHERE id > %u",
max_reserved_instance_id,
max_reserved_instance_id
);
if (RuleB(Instances, RecycleInstanceIds)) {
query = (
SQL(
SELECT i.id + 1 AS next_available
FROM instance_list i
LEFT JOIN instance_list i2 ON i2.id = i.id + 1
WHERE i2.id IS NULL
ORDER BY i.id
LIMIT 0, 1;
)
);
}
uint32 count = RuleI(Zone, ReservedInstances);
uint32 max = 65535;
std::string query = StringFormat("SELECT IFNULL(MAX(id),%u)+1 FROM instance_list WHERE id > %u", count, count);
auto results = QueryDatabase(query);
if (!results.Success()) {
if (!results.Success())
{
instance_id = 0;
return false;
}
if (results.RowCount() == 0) {
instance_id = max_reserved_instance_id;
return true;
if (results.RowCount() == 0)
{
instance_id = 0;
return false;
}
auto row = results.begin();
if (atoi(row[0]) <= max) {
if (atoi(row[0]) <= max)
{
instance_id = atoi(row[0]);
return true;
}
if (instance_id < max_reserved_instance_id) {
instance_id = max_reserved_instance_id;
return true;
}
query = StringFormat("SELECT id FROM instance_list where id > %u ORDER BY id", max_reserved_instance_id);
query = StringFormat("SELECT id FROM instance_list where id > %u ORDER BY id", count);
results = QueryDatabase(query);
if (!results.Success()) {
if (!results.Success())
{
instance_id = 0;
return false;
}
if (results.RowCount() == 0) {
if (results.RowCount() == 0)
{
instance_id = 0;
return false;
}
max_reserved_instance_id++;
for (auto row = results.begin(); row != results.end(); ++row) {
if (max_reserved_instance_id < atoi(row[0])) {
instance_id = max_reserved_instance_id;
count++;
for (auto row = results.begin(); row != results.end(); ++row)
{
if (count < atoi(row[0]))
{
instance_id = count;
return true;
}
if (max_reserved_instance_id > max) {
if (count > max)
{
instance_id = 0;
return false;
}
max_reserved_instance_id++;
count++;
}
instance_id = max_reserved_instance_id;
instance_id = count;
return true;
}
@@ -501,21 +472,18 @@ void Database::AssignRaidToInstance(uint32 raid_id, uint32 instance_id)
}
void Database::BuryCorpsesInInstance(uint16 instance_id) {
std::string query = StringFormat(
"UPDATE `character_corpses` "
"SET `is_buried` = 1, "
"`instance_id` = 0 "
"WHERE "
"`instance_id` = %u ",
instance_id
);
auto results = QueryDatabase(query);
QueryDatabase(
fmt::format(
"UPDATE character_corpses SET is_buried = 1, instance_id = 0 WHERE instance_id = {}",
instance_id
)
);
}
void Database::DeleteInstance(uint16 instance_id)
{
std::string query;
std::string query = StringFormat("DELETE FROM instance_list WHERE id=%u", instance_id);
QueryDatabase(query);
query = StringFormat("DELETE FROM instance_list_player WHERE id=%u", instance_id);
QueryDatabase(query);
@@ -576,36 +544,17 @@ void Database::GetCharactersInInstance(uint16 instance_id, std::list<uint32> &ch
void Database::PurgeExpiredInstances()
{
/**
* Delay purging by a day so that we can continue using adjacent free instance id's
* from the table without risking the chance we immediately re-allocate a zone that freshly expired but
* has not been fully de-allocated
*/
std::string query =
SQL(
SELECT
id
FROM
instance_list
where
(start_time + duration) <= (UNIX_TIMESTAMP() - 86400)
and never_expires = 0
);
std::string query("SELECT id FROM instance_list where (start_time+duration) <= UNIX_TIMESTAMP() and never_expires = 0");
auto results = QueryDatabase(query);
if (!results.Success()) {
if (!results.Success())
return;
}
if (results.RowCount() == 0) {
if (results.RowCount() == 0)
return;
}
for (auto row = results.begin(); row != results.end(); ++row) {
for (auto row = results.begin(); row != results.end(); ++row)
DeleteInstance(atoi(row[0]));
}
}
void Database::SetInstanceDuration(uint16 instance_id, uint32 new_duration)
@@ -613,4 +562,4 @@ void Database::SetInstanceDuration(uint16 instance_id, uint32 new_duration)
std::string query = StringFormat("UPDATE `instance_list` SET start_time=UNIX_TIMESTAMP(), "
"duration=%u WHERE id=%u", new_duration, instance_id);
auto results = QueryDatabase(query);
}
}
+2 -13
View File
@@ -166,16 +166,12 @@ namespace DatabaseSchema {
{
return {
"aa_ability",
"aa_actions",
"aa_effects",
"aa_rank_effects",
"aa_rank_prereqs",
"aa_ranks",
"aa_required_level_cost",
"adventure_template",
"adventure_template_entry",
"adventure_template_entry_flavor",
"altadv_vars",
"alternate_currency",
"auras",
"base_data",
@@ -183,13 +179,10 @@ namespace DatabaseSchema {
"books",
"char_create_combinations",
"char_create_point_allocations",
"class_skill",
"damageshieldtypes",
"doors",
"faction_base_data",
"faction_list",
"faction_list_mod",
"fear_hints",
"fishing",
"forage",
"global_loot",
@@ -199,7 +192,6 @@ namespace DatabaseSchema {
"grid_entries",
"ground_spawns",
"horses",
"instance_list",
"items",
"ldon_trap_entries",
"ldon_trap_templates",
@@ -217,17 +209,14 @@ namespace DatabaseSchema {
"npc_spells_effects_entries",
"npc_spells_entries",
"npc_types",
"npc_types_metadata",
"npc_types_tint",
"object",
"pets",
"pets_equipmentset",
"pets_equipmentset_entries",
"proximities",
"races",
"skill_caps",
"spawn2",
"spawn_condition_values",
"spawn_conditions",
"spawn_events",
"spawnentry",
@@ -246,8 +235,6 @@ namespace DatabaseSchema {
"veteran_reward_templates",
"zone",
"zone_points",
"zone_server",
"zoneserver_auth",
};
}
@@ -265,6 +252,7 @@ namespace DatabaseSchema {
"eqtime",
"launcher",
"launcher_zones",
"spawn_condition_values",
"level_exp_mods",
"logsys_categories",
"name_filter",
@@ -321,6 +309,7 @@ namespace DatabaseSchema {
"group_leaders",
"hackers",
"ip_exemptions",
"instance_list",
"item_tick",
"lfguild",
"merchantlist_temp",
+35 -10
View File
@@ -35,17 +35,27 @@
DBcore::DBcore()
{
mysql_init(&mysql);
pHost = 0;
pUser = 0;
pPassword = 0;
pDatabase = 0;
pCompress = false;
pSSL = false;
pStatus = Closed;
pHost = nullptr;
pUser = nullptr;
pPassword = nullptr;
pDatabase = nullptr;
pCompress = false;
pSSL = false;
pStatus = Closed;
}
DBcore::~DBcore()
{
/**
* This prevents us from doing a double free in multi-tenancy setups where we
* are re-using the default database connection pointer when we dont have an
* external configuration setup ex: (content_database)
*/
std::string mysql_connection_host = mysql.host;
if (GetOriginHost() != mysql_connection_host) {
return;
}
mysql_close(&mysql);
safe_delete_array(pHost);
safe_delete_array(pUser);
@@ -81,6 +91,8 @@ MySQLRequestResult DBcore::QueryDatabase(const char *query, uint32 querylen, boo
Open();
}
// request query. != 0 indicates some kind of error.
if (mysql_real_query(&mysql, query, querylen) != 0) {
unsigned int errorNumber = mysql_errno(&mysql);
@@ -244,6 +256,10 @@ bool DBcore::Open(uint32 *errnum, char *errbuf)
}
if (mysql_real_connect(&mysql, pHost, pUser, pPassword, pDatabase, pPort, 0, flags)) {
pStatus = Connected;
std::string connected_origin_host = pHost;
SetOriginHost(connected_origin_host);
return true;
}
else {
@@ -258,8 +274,17 @@ bool DBcore::Open(uint32 *errnum, char *errbuf)
}
}
void DBcore::SetMysql(MYSQL *mysql)
{
DBcore::mysql = *mysql;
}
const std::string &DBcore::GetOriginHost() const
{
return origin_host;
}
void DBcore::SetOriginHost(const std::string &origin_host)
{
DBcore::origin_host = origin_host;
}
+40 -21
View File
@@ -2,8 +2,8 @@
#define DBCORE_H
#ifdef _WINDOWS
#include <winsock2.h>
#include <windows.h>
#include <winsock2.h>
#include <windows.h>
#endif
#include "../common/mutex.h"
@@ -15,36 +15,55 @@
class DBcore {
public:
enum eStatus { Closed, Connected, Error };
enum eStatus {
Closed, Connected, Error
};
DBcore();
~DBcore();
eStatus GetStatus() { return pStatus; }
MySQLRequestResult QueryDatabase(const char* query, uint32 querylen, bool retryOnFailureOnce = true);
MySQLRequestResult QueryDatabase(std::string query, bool retryOnFailureOnce = true);
eStatus GetStatus() { return pStatus; }
MySQLRequestResult QueryDatabase(const char *query, uint32 querylen, bool retryOnFailureOnce = true);
MySQLRequestResult QueryDatabase(std::string query, bool retryOnFailureOnce = true);
void TransactionBegin();
void TransactionCommit();
void TransactionRollback();
uint32 DoEscapeString(char* tobuf, const char* frombuf, uint32 fromlen);
void ping();
MYSQL* getMySQL(){ return &mysql; }
uint32 DoEscapeString(char *tobuf, const char *frombuf, uint32 fromlen);
void ping();
MYSQL *getMySQL() { return &mysql; }
void SetMysql(MYSQL *mysql);
const std::string &GetOriginHost() const;
void SetOriginHost(const std::string &origin_host);
protected:
bool Open(const char* iHost, const char* iUser, const char* iPassword, const char* iDatabase, uint32 iPort, uint32* errnum = 0, char* errbuf = 0, bool iCompress = false, bool iSSL = false);
private:
bool Open(uint32* errnum = 0, char* errbuf = 0);
bool Open(
const char *iHost,
const char *iUser,
const char *iPassword,
const char *iDatabase,
uint32 iPort,
uint32 *errnum = 0,
char *errbuf = 0,
bool iCompress = false,
bool iSSL = false
);
MYSQL mysql;
Mutex MDatabase;
private:
bool Open(uint32 *errnum = nullptr, char *errbuf = nullptr);
MYSQL mysql;
Mutex MDatabase;
eStatus pStatus;
char* pHost;
char* pUser;
char* pPassword;
char* pDatabase;
bool pCompress;
uint32 pPort;
bool pSSL;
std::string origin_host;
char *pHost;
char *pUser;
char *pPassword;
char *pDatabase;
bool pCompress;
uint32 pPort;
bool pSSL;
};
+3 -3
View File
@@ -20,7 +20,7 @@
#include "deity.h"
EQ::deity::DeityTypeBit EQ::deity::ConvertDeityTypeToDeityTypeBit(DeityType deity_type)
EQEmu::deity::DeityTypeBit EQEmu::deity::ConvertDeityTypeToDeityTypeBit(DeityType deity_type)
{
switch (deity_type) {
case DeityBertoxxulous:
@@ -63,7 +63,7 @@ EQ::deity::DeityTypeBit EQ::deity::ConvertDeityTypeToDeityTypeBit(DeityType deit
};
}
EQ::deity::DeityType EQ::deity::ConvertDeityTypeBitToDeityType(DeityTypeBit deity_type_bit)
EQEmu::deity::DeityType EQEmu::deity::ConvertDeityTypeBitToDeityType(DeityTypeBit deity_type_bit)
{
switch (deity_type_bit) {
case bit_DeityAgnostic:
@@ -105,7 +105,7 @@ EQ::deity::DeityType EQ::deity::ConvertDeityTypeBitToDeityType(DeityTypeBit deit
};
}
const char* EQ::deity::DeityName(DeityType deity_type)
const char* EQEmu::deity::DeityName(DeityType deity_type)
{
switch (deity_type) {
case DeityBertoxxulous:
+1 -1
View File
@@ -23,7 +23,7 @@
#include "types.h"
namespace EQ
namespace EQEmu
{
namespace deity {
enum DeityType {
+7 -7
View File
@@ -20,7 +20,7 @@
#include "emu_constants.h"
int16 EQ::invtype::GetInvTypeSize(int16 inv_type) {
int16 EQEmu::invtype::GetInvTypeSize(int16 inv_type) {
static const int16 local_array[] = {
POSSESSIONS_SIZE,
BANK_SIZE,
@@ -55,7 +55,7 @@ int16 EQ::invtype::GetInvTypeSize(int16 inv_type) {
return local_array[inv_type];
}
const char* EQ::bug::CategoryIDToCategoryName(CategoryID category_id) {
const char* EQEmu::bug::CategoryIDToCategoryName(CategoryID category_id) {
switch (category_id) {
case catVideo:
return "Video";
@@ -87,7 +87,7 @@ const char* EQ::bug::CategoryIDToCategoryName(CategoryID category_id) {
}
}
EQ::bug::CategoryID EQ::bug::CategoryNameToCategoryID(const char* category_name) {
EQEmu::bug::CategoryID EQEmu::bug::CategoryNameToCategoryID(const char* category_name) {
if (!category_name)
return catOther;
@@ -119,7 +119,7 @@ EQ::bug::CategoryID EQ::bug::CategoryNameToCategoryID(const char* category_name)
return catOther;
}
const char *EQ::constants::GetStanceName(StanceType stance_type) {
const char *EQEmu::constants::GetStanceName(StanceType stance_type) {
switch (stance_type) {
case stanceUnknown:
return "Unknown";
@@ -146,9 +146,9 @@ const char *EQ::constants::GetStanceName(StanceType stance_type) {
}
}
int EQ::constants::ConvertStanceTypeToIndex(StanceType stance_type) {
if (stance_type >= EQ::constants::stancePassive && stance_type <= EQ::constants::stanceBurnAE)
return (stance_type - EQ::constants::stancePassive);
int EQEmu::constants::ConvertStanceTypeToIndex(StanceType stance_type) {
if (stance_type >= EQEmu::constants::stancePassive && stance_type <= EQEmu::constants::stanceBurnAE)
return (stance_type - EQEmu::constants::stancePassive);
return 0;
}
+3 -3
View File
@@ -27,7 +27,7 @@
// local definitions are the result of using hybrid-client or server-only values and methods
namespace EQ
namespace EQEmu
{
using RoF2::IINVALID;
using RoF2::INULL;
@@ -193,7 +193,7 @@ namespace EQ
} // namespace invaug
namespace constants {
const EQ::versions::ClientVersion CHARACTER_CREATION_CLIENT = EQ::versions::ClientVersion::Titanium;
const EQEmu::versions::ClientVersion CHARACTER_CREATION_CLIENT = EQEmu::versions::ClientVersion::Titanium;
using RoF2::constants::EXPANSION;
using RoF2::constants::EXPANSION_BIT;
@@ -332,6 +332,6 @@ namespace EQ
/* hack list to prevent circular references
eq_limits.h:EQ::inventory::LookupEntry::InventoryTypeSize[n];
eq_limits.h:EQEmu::inventory::LookupEntry::InventoryTypeSize[n];
*/
+31 -31
View File
@@ -21,7 +21,7 @@
#include "emu_constants.h"
bool EQ::versions::IsValidClientVersion(ClientVersion client_version)
bool EQEmu::versions::IsValidClientVersion(ClientVersion client_version)
{
if (client_version <= ClientVersion::Unknown || client_version > LastClientVersion)
return false;
@@ -29,7 +29,7 @@ bool EQ::versions::IsValidClientVersion(ClientVersion client_version)
return true;
}
EQ::versions::ClientVersion EQ::versions::ValidateClientVersion(ClientVersion client_version)
EQEmu::versions::ClientVersion EQEmu::versions::ValidateClientVersion(ClientVersion client_version)
{
if (client_version <= ClientVersion::Unknown || client_version > LastClientVersion)
return ClientVersion::Unknown;
@@ -37,7 +37,7 @@ EQ::versions::ClientVersion EQ::versions::ValidateClientVersion(ClientVersion cl
return client_version;
}
const char* EQ::versions::ClientVersionName(ClientVersion client_version)
const char* EQEmu::versions::ClientVersionName(ClientVersion client_version)
{
switch (client_version) {
case ClientVersion::Unknown:
@@ -61,7 +61,7 @@ const char* EQ::versions::ClientVersionName(ClientVersion client_version)
};
}
uint32 EQ::versions::ConvertClientVersionToClientVersionBit(ClientVersion client_version)
uint32 EQEmu::versions::ConvertClientVersionToClientVersionBit(ClientVersion client_version)
{
switch (client_version) {
case ClientVersion::Titanium:
@@ -81,7 +81,7 @@ uint32 EQ::versions::ConvertClientVersionToClientVersionBit(ClientVersion client
}
}
EQ::versions::ClientVersion EQ::versions::ConvertClientVersionBitToClientVersion(uint32 client_version_bit)
EQEmu::versions::ClientVersion EQEmu::versions::ConvertClientVersionBitToClientVersion(uint32 client_version_bit)
{
switch (client_version_bit) {
case ((uint32)1 << (static_cast<unsigned int>(ClientVersion::Titanium) - 1)) :
@@ -101,7 +101,7 @@ EQ::versions::ClientVersion EQ::versions::ConvertClientVersionBitToClientVersion
}
}
bool EQ::versions::IsValidMobVersion(MobVersion mob_version)
bool EQEmu::versions::IsValidMobVersion(MobVersion mob_version)
{
if (mob_version <= MobVersion::Unknown || mob_version > LastMobVersion)
return false;
@@ -109,7 +109,7 @@ bool EQ::versions::IsValidMobVersion(MobVersion mob_version)
return true;
}
bool EQ::versions::IsValidPCMobVersion(MobVersion mob_version)
bool EQEmu::versions::IsValidPCMobVersion(MobVersion mob_version)
{
if (mob_version <= MobVersion::Unknown || mob_version > LastPCMobVersion)
return false;
@@ -117,7 +117,7 @@ bool EQ::versions::IsValidPCMobVersion(MobVersion mob_version)
return true;
}
bool EQ::versions::IsValidNonPCMobVersion(MobVersion mob_version)
bool EQEmu::versions::IsValidNonPCMobVersion(MobVersion mob_version)
{
if (mob_version <= LastPCMobVersion || mob_version > LastNonPCMobVersion)
return false;
@@ -125,7 +125,7 @@ bool EQ::versions::IsValidNonPCMobVersion(MobVersion mob_version)
return true;
}
bool EQ::versions::IsValidOfflinePCMobVersion(MobVersion mob_version)
bool EQEmu::versions::IsValidOfflinePCMobVersion(MobVersion mob_version)
{
if (mob_version <= LastNonPCMobVersion || mob_version > LastOfflinePCMobVersion)
return false;
@@ -133,7 +133,7 @@ bool EQ::versions::IsValidOfflinePCMobVersion(MobVersion mob_version)
return true;
}
EQ::versions::MobVersion EQ::versions::ValidateMobVersion(MobVersion mob_version)
EQEmu::versions::MobVersion EQEmu::versions::ValidateMobVersion(MobVersion mob_version)
{
if (mob_version <= MobVersion::Unknown || mob_version > LastMobVersion)
return MobVersion::Unknown;
@@ -141,7 +141,7 @@ EQ::versions::MobVersion EQ::versions::ValidateMobVersion(MobVersion mob_version
return mob_version;
}
EQ::versions::MobVersion EQ::versions::ValidatePCMobVersion(MobVersion mob_version)
EQEmu::versions::MobVersion EQEmu::versions::ValidatePCMobVersion(MobVersion mob_version)
{
if (mob_version <= MobVersion::Unknown || mob_version > LastPCMobVersion)
return MobVersion::Unknown;
@@ -149,7 +149,7 @@ EQ::versions::MobVersion EQ::versions::ValidatePCMobVersion(MobVersion mob_versi
return mob_version;
}
EQ::versions::MobVersion EQ::versions::ValidateNonPCMobVersion(MobVersion mob_version)
EQEmu::versions::MobVersion EQEmu::versions::ValidateNonPCMobVersion(MobVersion mob_version)
{
if (mob_version <= LastPCMobVersion || mob_version > LastNonPCMobVersion)
return MobVersion::Unknown;
@@ -157,7 +157,7 @@ EQ::versions::MobVersion EQ::versions::ValidateNonPCMobVersion(MobVersion mob_ve
return mob_version;
}
EQ::versions::MobVersion EQ::versions::ValidateOfflinePCMobVersion(MobVersion mob_version)
EQEmu::versions::MobVersion EQEmu::versions::ValidateOfflinePCMobVersion(MobVersion mob_version)
{
if (mob_version <= LastNonPCMobVersion || mob_version > LastOfflinePCMobVersion)
return MobVersion::Unknown;
@@ -165,7 +165,7 @@ EQ::versions::MobVersion EQ::versions::ValidateOfflinePCMobVersion(MobVersion mo
return mob_version;
}
const char* EQ::versions::MobVersionName(MobVersion mob_version)
const char* EQEmu::versions::MobVersionName(MobVersion mob_version)
{
switch (mob_version) {
case MobVersion::Unknown:
@@ -217,7 +217,7 @@ const char* EQ::versions::MobVersionName(MobVersion mob_version)
};
}
EQ::versions::ClientVersion EQ::versions::ConvertMobVersionToClientVersion(MobVersion mob_version)
EQEmu::versions::ClientVersion EQEmu::versions::ConvertMobVersionToClientVersion(MobVersion mob_version)
{
switch (mob_version) {
case MobVersion::Unknown:
@@ -240,7 +240,7 @@ EQ::versions::ClientVersion EQ::versions::ConvertMobVersionToClientVersion(MobVe
}
}
EQ::versions::MobVersion EQ::versions::ConvertClientVersionToMobVersion(ClientVersion client_version)
EQEmu::versions::MobVersion EQEmu::versions::ConvertClientVersionToMobVersion(ClientVersion client_version)
{
switch (client_version) {
case ClientVersion::Unknown:
@@ -263,7 +263,7 @@ EQ::versions::MobVersion EQ::versions::ConvertClientVersionToMobVersion(ClientVe
}
}
EQ::versions::MobVersion EQ::versions::ConvertPCMobVersionToOfflinePCMobVersion(MobVersion mob_version)
EQEmu::versions::MobVersion EQEmu::versions::ConvertPCMobVersionToOfflinePCMobVersion(MobVersion mob_version)
{
switch (mob_version) {
case MobVersion::Titanium:
@@ -283,7 +283,7 @@ EQ::versions::MobVersion EQ::versions::ConvertPCMobVersionToOfflinePCMobVersion(
}
}
EQ::versions::MobVersion EQ::versions::ConvertOfflinePCMobVersionToPCMobVersion(MobVersion mob_version)
EQEmu::versions::MobVersion EQEmu::versions::ConvertOfflinePCMobVersionToPCMobVersion(MobVersion mob_version)
{
switch (mob_version) {
case MobVersion::OfflineTitanium:
@@ -303,7 +303,7 @@ EQ::versions::MobVersion EQ::versions::ConvertOfflinePCMobVersionToPCMobVersion(
}
}
EQ::versions::ClientVersion EQ::versions::ConvertOfflinePCMobVersionToClientVersion(MobVersion mob_version)
EQEmu::versions::ClientVersion EQEmu::versions::ConvertOfflinePCMobVersionToClientVersion(MobVersion mob_version)
{
switch (mob_version) {
case MobVersion::OfflineTitanium:
@@ -323,7 +323,7 @@ EQ::versions::ClientVersion EQ::versions::ConvertOfflinePCMobVersionToClientVers
}
}
EQ::versions::MobVersion EQ::versions::ConvertClientVersionToOfflinePCMobVersion(ClientVersion client_version)
EQEmu::versions::MobVersion EQEmu::versions::ConvertClientVersionToOfflinePCMobVersion(ClientVersion client_version)
{
switch (client_version) {
case ClientVersion::Titanium:
@@ -343,7 +343,7 @@ EQ::versions::MobVersion EQ::versions::ConvertClientVersionToOfflinePCMobVersion
}
}
const char* EQ::expansions::ExpansionName(Expansion expansion)
const char* EQEmu::expansions::ExpansionName(Expansion expansion)
{
switch (expansion) {
case Expansion::EverQuest:
@@ -393,12 +393,12 @@ const char* EQ::expansions::ExpansionName(Expansion expansion)
}
}
const char* EQ::expansions::ExpansionName(uint32 expansion_bit)
const char* EQEmu::expansions::ExpansionName(uint32 expansion_bit)
{
return ExpansionName(ConvertExpansionBitToExpansion(expansion_bit));
}
uint32 EQ::expansions::ConvertExpansionToExpansionBit(Expansion expansion)
uint32 EQEmu::expansions::ConvertExpansionToExpansionBit(Expansion expansion)
{
switch (expansion) {
case Expansion::RoK:
@@ -446,7 +446,7 @@ uint32 EQ::expansions::ConvertExpansionToExpansionBit(Expansion expansion)
}
}
EQ::expansions::Expansion EQ::expansions::ConvertExpansionBitToExpansion(uint32 expansion_bit)
EQEmu::expansions::Expansion EQEmu::expansions::ConvertExpansionBitToExpansion(uint32 expansion_bit)
{
switch (expansion_bit) {
case bitRoK:
@@ -494,7 +494,7 @@ EQ::expansions::Expansion EQ::expansions::ConvertExpansionBitToExpansion(uint32
}
}
uint32 EQ::expansions::ConvertExpansionToExpansionsMask(Expansion expansion)
uint32 EQEmu::expansions::ConvertExpansionToExpansionsMask(Expansion expansion)
{
switch (expansion) {
case Expansion::RoK:
@@ -542,17 +542,17 @@ uint32 EQ::expansions::ConvertExpansionToExpansionsMask(Expansion expansion)
}
}
EQ::expansions::Expansion EQ::expansions::ConvertClientVersionToExpansion(versions::ClientVersion client_version)
EQEmu::expansions::Expansion EQEmu::expansions::ConvertClientVersionToExpansion(versions::ClientVersion client_version)
{
return EQ::constants::StaticLookup(client_version)->Expansion;
return EQEmu::constants::StaticLookup(client_version)->Expansion;
}
uint32 EQ::expansions::ConvertClientVersionToExpansionBit(versions::ClientVersion client_version)
uint32 EQEmu::expansions::ConvertClientVersionToExpansionBit(versions::ClientVersion client_version)
{
return EQ::constants::StaticLookup(client_version)->ExpansionBit;
return EQEmu::constants::StaticLookup(client_version)->ExpansionBit;
}
uint32 EQ::expansions::ConvertClientVersionToExpansionsMask(versions::ClientVersion client_version)
uint32 EQEmu::expansions::ConvertClientVersionToExpansionsMask(versions::ClientVersion client_version)
{
return EQ::constants::StaticLookup(client_version)->ExpansionsMask;
return EQEmu::constants::StaticLookup(client_version)->ExpansionsMask;
}
+1 -1
View File
@@ -25,7 +25,7 @@
#include <stdlib.h>
namespace EQ
namespace EQEmu
{
namespace versions {
enum class ClientVersion : uint32 {
+1 -1
View File
@@ -318,7 +318,7 @@ static const uint8 DamageTypeUnknown = 0xFF;
**
** (indexed by 'Skill' of SkillUseTypes)
*/
static const uint8 SkillDamageTypes[EQ::skills::HIGHEST_SKILL + 1] = // change to _SkillServerArraySize once activated
static const uint8 SkillDamageTypes[EQEmu::skills::HIGHEST_SKILL + 1] = // change to _SkillServerArraySize once activated
{
/*1HBlunt*/ 0,
/*1HSlashing*/ 1,
+168 -168
View File
@@ -25,7 +25,7 @@
static bool global_dictionary_init = false;
void EQ::InitializeDynamicLookups() {
void EQEmu::InitializeDynamicLookups() {
if (global_dictionary_init == true)
return;
@@ -37,12 +37,12 @@ void EQ::InitializeDynamicLookups() {
global_dictionary_init = true;
}
static std::unique_ptr<EQ::constants::LookupEntry> constants_dynamic_nongm_lookup_entries[EQ::versions::ClientVersionCount];
static std::unique_ptr<EQ::constants::LookupEntry> constants_dynamic_gm_lookup_entries[EQ::versions::ClientVersionCount];
static const EQ::constants::LookupEntry constants_static_lookup_entries[EQ::versions::ClientVersionCount] =
static std::unique_ptr<EQEmu::constants::LookupEntry> constants_dynamic_nongm_lookup_entries[EQEmu::versions::ClientVersionCount];
static std::unique_ptr<EQEmu::constants::LookupEntry> constants_dynamic_gm_lookup_entries[EQEmu::versions::ClientVersionCount];
static const EQEmu::constants::LookupEntry constants_static_lookup_entries[EQEmu::versions::ClientVersionCount] =
{
/*[ClientVersion::Unknown] =*/
EQ::constants::LookupEntry(
EQEmu::constants::LookupEntry(
ClientUnknown::constants::EXPANSION,
ClientUnknown::constants::EXPANSION_BIT,
ClientUnknown::constants::EXPANSIONS_MASK,
@@ -50,7 +50,7 @@ static const EQ::constants::LookupEntry constants_static_lookup_entries[EQ::vers
ClientUnknown::INULL
),
/*[ClientVersion::Client62] =*/
EQ::constants::LookupEntry(
EQEmu::constants::LookupEntry(
Client62::constants::EXPANSION,
Client62::constants::EXPANSION_BIT,
Client62::constants::EXPANSIONS_MASK,
@@ -58,7 +58,7 @@ static const EQ::constants::LookupEntry constants_static_lookup_entries[EQ::vers
Client62::INULL
),
/*[ClientVersion::Titanium] =*/
EQ::constants::LookupEntry(
EQEmu::constants::LookupEntry(
Titanium::constants::EXPANSION,
Titanium::constants::EXPANSION_BIT,
Titanium::constants::EXPANSIONS_MASK,
@@ -66,7 +66,7 @@ static const EQ::constants::LookupEntry constants_static_lookup_entries[EQ::vers
Titanium::constants::SAY_LINK_BODY_SIZE
),
/*[ClientVersion::SoF] =*/
EQ::constants::LookupEntry(
EQEmu::constants::LookupEntry(
SoF::constants::EXPANSION,
SoF::constants::EXPANSION_BIT,
SoF::constants::EXPANSIONS_MASK,
@@ -74,7 +74,7 @@ static const EQ::constants::LookupEntry constants_static_lookup_entries[EQ::vers
SoF::constants::SAY_LINK_BODY_SIZE
),
/*[ClientVersion::SoD] =*/
EQ::constants::LookupEntry(
EQEmu::constants::LookupEntry(
SoD::constants::EXPANSION,
SoD::constants::EXPANSION_BIT,
SoD::constants::EXPANSIONS_MASK,
@@ -82,7 +82,7 @@ static const EQ::constants::LookupEntry constants_static_lookup_entries[EQ::vers
SoD::constants::SAY_LINK_BODY_SIZE
),
/*[ClientVersion::UF] =*/
EQ::constants::LookupEntry(
EQEmu::constants::LookupEntry(
UF::constants::EXPANSION,
UF::constants::EXPANSION_BIT,
UF::constants::EXPANSIONS_MASK,
@@ -90,7 +90,7 @@ static const EQ::constants::LookupEntry constants_static_lookup_entries[EQ::vers
UF::constants::SAY_LINK_BODY_SIZE
),
/*[ClientVersion::RoF] =*/
EQ::constants::LookupEntry(
EQEmu::constants::LookupEntry(
RoF::constants::EXPANSION,
RoF::constants::EXPANSION_BIT,
RoF::constants::EXPANSIONS_MASK,
@@ -98,7 +98,7 @@ static const EQ::constants::LookupEntry constants_static_lookup_entries[EQ::vers
RoF::constants::SAY_LINK_BODY_SIZE
),
/*[ClientVersion::RoF2] =*/
EQ::constants::LookupEntry(
EQEmu::constants::LookupEntry(
RoF2::constants::EXPANSION,
RoF2::constants::EXPANSION_BIT,
RoF2::constants::EXPANSIONS_MASK,
@@ -108,7 +108,7 @@ static const EQ::constants::LookupEntry constants_static_lookup_entries[EQ::vers
};
static bool constants_dictionary_init = false;
void EQ::constants::InitializeDynamicLookups() {
void EQEmu::constants::InitializeDynamicLookups() {
if (constants_dictionary_init == true)
return;
constants_dictionary_init = true;
@@ -119,7 +119,7 @@ void EQ::constants::InitializeDynamicLookups() {
// use static references for now
}
const EQ::constants::LookupEntry* EQ::constants::DynamicLookup(versions::ClientVersion client_version, bool gm_flag)
const EQEmu::constants::LookupEntry* EQEmu::constants::DynamicLookup(versions::ClientVersion client_version, bool gm_flag)
{
if (gm_flag)
return DynamicGMLookup(client_version);
@@ -127,7 +127,7 @@ const EQ::constants::LookupEntry* EQ::constants::DynamicLookup(versions::ClientV
return DynamicNonGMLookup(client_version);
}
const EQ::constants::LookupEntry* EQ::constants::DynamicNonGMLookup(versions::ClientVersion client_version)
const EQEmu::constants::LookupEntry* EQEmu::constants::DynamicNonGMLookup(versions::ClientVersion client_version)
{
client_version = versions::ValidateClientVersion(client_version);
if (constants_dynamic_nongm_lookup_entries[static_cast<int>(client_version)])
@@ -136,7 +136,7 @@ const EQ::constants::LookupEntry* EQ::constants::DynamicNonGMLookup(versions::Cl
return &constants_static_lookup_entries[static_cast<int>(client_version)];
}
const EQ::constants::LookupEntry* EQ::constants::DynamicGMLookup(versions::ClientVersion client_version)
const EQEmu::constants::LookupEntry* EQEmu::constants::DynamicGMLookup(versions::ClientVersion client_version)
{
client_version = versions::ValidateClientVersion(client_version);
if (constants_dynamic_gm_lookup_entries[static_cast<int>(client_version)])
@@ -145,18 +145,18 @@ const EQ::constants::LookupEntry* EQ::constants::DynamicGMLookup(versions::Clien
return &constants_static_lookup_entries[static_cast<int>(client_version)];
}
const EQ::constants::LookupEntry* EQ::constants::StaticLookup(versions::ClientVersion client_version)
const EQEmu::constants::LookupEntry* EQEmu::constants::StaticLookup(versions::ClientVersion client_version)
{
return &constants_static_lookup_entries[static_cast<int>(versions::ValidateClientVersion(client_version))];
}
static std::unique_ptr<EQ::inventory::LookupEntry> inventory_dynamic_nongm_lookup_entries[EQ::versions::MobVersionCount];
static std::unique_ptr<EQ::inventory::LookupEntry> inventory_dynamic_gm_lookup_entries[EQ::versions::MobVersionCount];
static const EQ::inventory::LookupEntry inventory_static_lookup_entries[EQ::versions::MobVersionCount] =
static std::unique_ptr<EQEmu::inventory::LookupEntry> inventory_dynamic_nongm_lookup_entries[EQEmu::versions::MobVersionCount];
static std::unique_ptr<EQEmu::inventory::LookupEntry> inventory_dynamic_gm_lookup_entries[EQEmu::versions::MobVersionCount];
static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu::versions::MobVersionCount] =
{
/*[MobVersion::Unknown] =*/
EQ::inventory::LookupEntry(
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
EQEmu::inventory::LookupEntry(
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
ClientUnknown::INULL, ClientUnknown::INULL, ClientUnknown::INULL,
ClientUnknown::INULL, ClientUnknown::INULL, ClientUnknown::INULL,
ClientUnknown::INULL, ClientUnknown::INULL, ClientUnknown::INULL,
@@ -182,8 +182,8 @@ static const EQ::inventory::LookupEntry inventory_static_lookup_entries[EQ::vers
false
),
/*[MobVersion::Client62] =*/
EQ::inventory::LookupEntry(
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
EQEmu::inventory::LookupEntry(
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
Client62::INULL, Client62::INULL, Client62::INULL,
Client62::INULL, Client62::INULL, Client62::INULL,
Client62::INULL, Client62::INULL, Client62::INULL,
@@ -209,9 +209,9 @@ static const EQ::inventory::LookupEntry inventory_static_lookup_entries[EQ::vers
false
),
/*[MobVersion::Titanium] =*/
EQ::inventory::LookupEntry(
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
EQ::invtype::POSSESSIONS_SIZE, Titanium::invtype::BANK_SIZE, Titanium::invtype::SHARED_BANK_SIZE,
EQEmu::inventory::LookupEntry(
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
EQEmu::invtype::POSSESSIONS_SIZE, Titanium::invtype::BANK_SIZE, Titanium::invtype::SHARED_BANK_SIZE,
Titanium::invtype::TRADE_SIZE, Titanium::invtype::WORLD_SIZE, Titanium::invtype::LIMBO_SIZE,
Titanium::invtype::TRIBUTE_SIZE, Titanium::INULL, Titanium::invtype::GUILD_TRIBUTE_SIZE,
Titanium::invtype::MERCHANT_SIZE, Titanium::INULL, Titanium::invtype::CORPSE_SIZE,
@@ -236,9 +236,9 @@ static const EQ::inventory::LookupEntry inventory_static_lookup_entries[EQ::vers
Titanium::inventory::AllowOverLevelEquipment
),
/*[MobVersion::SoF] =*/
EQ::inventory::LookupEntry(
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
EQ::invtype::POSSESSIONS_SIZE, SoF::invtype::BANK_SIZE, SoF::invtype::SHARED_BANK_SIZE,
EQEmu::inventory::LookupEntry(
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
EQEmu::invtype::POSSESSIONS_SIZE, SoF::invtype::BANK_SIZE, SoF::invtype::SHARED_BANK_SIZE,
SoF::invtype::TRADE_SIZE, SoF::invtype::WORLD_SIZE, SoF::invtype::LIMBO_SIZE,
SoF::invtype::TRIBUTE_SIZE, SoF::INULL, SoF::invtype::GUILD_TRIBUTE_SIZE,
SoF::invtype::MERCHANT_SIZE, SoF::INULL, SoF::invtype::CORPSE_SIZE,
@@ -263,9 +263,9 @@ static const EQ::inventory::LookupEntry inventory_static_lookup_entries[EQ::vers
SoF::inventory::AllowOverLevelEquipment
),
/*[MobVersion::SoD] =*/
EQ::inventory::LookupEntry(
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
EQ::invtype::POSSESSIONS_SIZE, SoD::invtype::BANK_SIZE, SoD::invtype::SHARED_BANK_SIZE,
EQEmu::inventory::LookupEntry(
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
EQEmu::invtype::POSSESSIONS_SIZE, SoD::invtype::BANK_SIZE, SoD::invtype::SHARED_BANK_SIZE,
SoD::invtype::TRADE_SIZE, SoD::invtype::WORLD_SIZE, SoD::invtype::LIMBO_SIZE,
SoD::invtype::TRIBUTE_SIZE, SoD::INULL, SoD::invtype::GUILD_TRIBUTE_SIZE,
SoD::invtype::MERCHANT_SIZE, SoD::INULL, SoD::invtype::CORPSE_SIZE,
@@ -290,9 +290,9 @@ static const EQ::inventory::LookupEntry inventory_static_lookup_entries[EQ::vers
SoD::inventory::AllowOverLevelEquipment
),
/*[MobVersion::UF] =*/
EQ::inventory::LookupEntry(
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
EQ::invtype::POSSESSIONS_SIZE, UF::invtype::BANK_SIZE, UF::invtype::SHARED_BANK_SIZE,
EQEmu::inventory::LookupEntry(
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
EQEmu::invtype::POSSESSIONS_SIZE, UF::invtype::BANK_SIZE, UF::invtype::SHARED_BANK_SIZE,
UF::invtype::TRADE_SIZE, UF::invtype::WORLD_SIZE, UF::invtype::LIMBO_SIZE,
UF::invtype::TRIBUTE_SIZE, UF::INULL, UF::invtype::GUILD_TRIBUTE_SIZE,
UF::invtype::MERCHANT_SIZE, UF::INULL, UF::invtype::CORPSE_SIZE,
@@ -317,9 +317,9 @@ static const EQ::inventory::LookupEntry inventory_static_lookup_entries[EQ::vers
UF::inventory::AllowOverLevelEquipment
),
/*[MobVersion::RoF] =*/
EQ::inventory::LookupEntry(
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
EQ::invtype::POSSESSIONS_SIZE, RoF::invtype::BANK_SIZE, RoF::invtype::SHARED_BANK_SIZE,
EQEmu::inventory::LookupEntry(
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
EQEmu::invtype::POSSESSIONS_SIZE, RoF::invtype::BANK_SIZE, RoF::invtype::SHARED_BANK_SIZE,
RoF::invtype::TRADE_SIZE, RoF::invtype::WORLD_SIZE, RoF::invtype::LIMBO_SIZE,
RoF::invtype::TRIBUTE_SIZE, RoF::invtype::TROPHY_TRIBUTE_SIZE, RoF::invtype::GUILD_TRIBUTE_SIZE,
RoF::invtype::MERCHANT_SIZE, RoF::invtype::DELETED_SIZE, RoF::invtype::CORPSE_SIZE,
@@ -344,9 +344,9 @@ static const EQ::inventory::LookupEntry inventory_static_lookup_entries[EQ::vers
RoF::inventory::AllowOverLevelEquipment
),
/*[MobVersion::RoF2] =*/
EQ::inventory::LookupEntry(
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
EQ::invtype::POSSESSIONS_SIZE, RoF2::invtype::BANK_SIZE, RoF2::invtype::SHARED_BANK_SIZE,
EQEmu::inventory::LookupEntry(
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
EQEmu::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,
@@ -371,9 +371,9 @@ static const EQ::inventory::LookupEntry inventory_static_lookup_entries[EQ::vers
RoF2::inventory::AllowOverLevelEquipment
),
/*[MobVersion::NPC] =*/
EQ::inventory::LookupEntry(
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
EQ::invtype::POSSESSIONS_SIZE, EntityLimits::NPC::INULL, EntityLimits::NPC::INULL,
EQEmu::inventory::LookupEntry(
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
EQEmu::invtype::POSSESSIONS_SIZE, EntityLimits::NPC::INULL, EntityLimits::NPC::INULL,
EntityLimits::NPC::invtype::TRADE_SIZE, EntityLimits::NPC::INULL, EntityLimits::NPC::INULL,
EntityLimits::NPC::INULL, EntityLimits::NPC::INULL, EntityLimits::NPC::INULL,
EntityLimits::NPC::INULL, EntityLimits::NPC::INULL, EntityLimits::NPC::INULL, /*InvTypeCorpseSize,*/
@@ -389,8 +389,8 @@ static const EQ::inventory::LookupEntry inventory_static_lookup_entries[EQ::vers
EntityLimits::NPC::INULL,
EntityLimits::NPC::INULL,
EntityLimits::NPC::INULL,
0, //EQ::inventory::ContainerCount, /*ItemBagSize,*/
0, //EQ::inventory::SocketCount, /*ItemAugSize,*/
0, //EQEmu::inventory::ContainerCount, /*ItemBagSize,*/
0, //EQEmu::inventory::SocketCount, /*ItemAugSize,*/
false,
false,
@@ -398,9 +398,9 @@ static const EQ::inventory::LookupEntry inventory_static_lookup_entries[EQ::vers
false
),
/*[MobVersion::NPCMerchant] =*/
EQ::inventory::LookupEntry(
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
EQ::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::NPCMerchant::INULL, EntityLimits::NPCMerchant::INULL,
EQEmu::inventory::LookupEntry(
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
EQEmu::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::NPCMerchant::INULL, EntityLimits::NPCMerchant::INULL,
EntityLimits::NPCMerchant::invtype::TRADE_SIZE, EntityLimits::NPCMerchant::INULL, EntityLimits::NPCMerchant::INULL,
EntityLimits::NPCMerchant::INULL, EntityLimits::NPCMerchant::INULL, EntityLimits::NPCMerchant::INULL,
EntityLimits::NPCMerchant::INULL, EntityLimits::NPCMerchant::INULL, EntityLimits::NPCMerchant::INULL, /*InvTypeCorpseSize,*/
@@ -416,8 +416,8 @@ static const EQ::inventory::LookupEntry inventory_static_lookup_entries[EQ::vers
EntityLimits::NPCMerchant::INULL,
EntityLimits::NPCMerchant::INULL,
EntityLimits::NPCMerchant::INULL,
0, //EQ::inventory::ContainerCount, /*ItemBagSize,*/
0, //EQ::inventory::SocketCount, /*ItemAugSize,*/
0, //EQEmu::inventory::ContainerCount, /*ItemBagSize,*/
0, //EQEmu::inventory::SocketCount, /*ItemAugSize,*/
false,
false,
@@ -425,9 +425,9 @@ static const EQ::inventory::LookupEntry inventory_static_lookup_entries[EQ::vers
false
),
/*[MobVersion::Merc] =*/
EQ::inventory::LookupEntry(
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
EQ::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::Merc::INULL, EntityLimits::Merc::INULL,
EQEmu::inventory::LookupEntry(
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
EQEmu::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::Merc::INULL, EntityLimits::Merc::INULL,
EntityLimits::Merc::invtype::TRADE_SIZE, EntityLimits::Merc::INULL, EntityLimits::Merc::INULL,
EntityLimits::Merc::INULL, EntityLimits::Merc::INULL, EntityLimits::Merc::INULL,
EntityLimits::Merc::INULL, EntityLimits::Merc::INULL, EntityLimits::Merc::INULL, /*InvTypeCorpseSize,*/
@@ -443,8 +443,8 @@ static const EQ::inventory::LookupEntry inventory_static_lookup_entries[EQ::vers
EntityLimits::Merc::INULL,
EntityLimits::Merc::INULL,
EntityLimits::Merc::INULL,
0, //EQ::inventory::ContainerCount, /*ItemBagSize,*/
0, //EQ::inventory::SocketCount, /*ItemAugSize,*/
0, //EQEmu::inventory::ContainerCount, /*ItemBagSize,*/
0, //EQEmu::inventory::SocketCount, /*ItemAugSize,*/
false,
false,
@@ -452,9 +452,9 @@ static const EQ::inventory::LookupEntry inventory_static_lookup_entries[EQ::vers
false
),
/*[MobVersion::Bot] =*/
EQ::inventory::LookupEntry(
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
EQ::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::Bot::INULL, EntityLimits::Bot::INULL,
EQEmu::inventory::LookupEntry(
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
EQEmu::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::Bot::INULL, EntityLimits::Bot::INULL,
EntityLimits::Bot::invtype::TRADE_SIZE, EntityLimits::Bot::INULL, EntityLimits::Bot::INULL,
EntityLimits::Bot::INULL, EntityLimits::Bot::INULL, EntityLimits::Bot::INULL,
EntityLimits::Bot::INULL, EntityLimits::Bot::INULL, EntityLimits::Bot::INULL, /*InvTypeCorpseSize,*/
@@ -470,8 +470,8 @@ static const EQ::inventory::LookupEntry inventory_static_lookup_entries[EQ::vers
EntityLimits::Bot::invslot::CURSOR_BITMASK,
EntityLimits::Bot::invslot::POSSESSIONS_BITMASK,
EntityLimits::Bot::INULL,
0, //EQ::inventory::ContainerCount, /*ItemBagSize,*/
EQ::invaug::SOCKET_COUNT, //EQ::inventory::SocketCount, /*ItemAugSize,*/
0, //EQEmu::inventory::ContainerCount, /*ItemBagSize,*/
EQEmu::invaug::SOCKET_COUNT, //EQEmu::inventory::SocketCount, /*ItemAugSize,*/
false,
false,
@@ -479,9 +479,9 @@ static const EQ::inventory::LookupEntry inventory_static_lookup_entries[EQ::vers
false
),
/*[MobVersion::ClientPet] =*/
EQ::inventory::LookupEntry(
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
EQ::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::ClientPet::INULL, EntityLimits::ClientPet::INULL,
EQEmu::inventory::LookupEntry(
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
EQEmu::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::ClientPet::INULL, EntityLimits::ClientPet::INULL,
EntityLimits::ClientPet::invtype::TRADE_SIZE, EntityLimits::ClientPet::INULL, EntityLimits::ClientPet::INULL,
EntityLimits::ClientPet::INULL, EntityLimits::ClientPet::INULL, EntityLimits::ClientPet::INULL,
EntityLimits::ClientPet::INULL, EntityLimits::ClientPet::INULL, EntityLimits::ClientPet::INULL, /*InvTypeCorpseSize,*/
@@ -497,8 +497,8 @@ static const EQ::inventory::LookupEntry inventory_static_lookup_entries[EQ::vers
EntityLimits::ClientPet::INULL,
EntityLimits::ClientPet::INULL,
EntityLimits::ClientPet::INULL,
0, //EQ::inventory::ContainerCount, /*ItemBagSize,*/
0, //EQ::inventory::SocketCount, /*ItemAugSize,*/
0, //EQEmu::inventory::ContainerCount, /*ItemBagSize,*/
0, //EQEmu::inventory::SocketCount, /*ItemAugSize,*/
false,
false,
@@ -506,9 +506,9 @@ static const EQ::inventory::LookupEntry inventory_static_lookup_entries[EQ::vers
false
),
/*[MobVersion::NPCPet] =*/
EQ::inventory::LookupEntry(
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
EQ::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::NPCPet::INULL, EntityLimits::NPCPet::INULL,
EQEmu::inventory::LookupEntry(
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
EQEmu::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::NPCPet::INULL, EntityLimits::NPCPet::INULL,
EntityLimits::NPCPet::invtype::TRADE_SIZE, EntityLimits::NPCPet::INULL, EntityLimits::NPCPet::INULL,
EntityLimits::NPCPet::INULL, EntityLimits::NPCPet::INULL, EntityLimits::NPCPet::INULL,
EntityLimits::NPCPet::INULL, EntityLimits::NPCPet::INULL, EntityLimits::NPCPet::INULL, /*InvTypeCorpseSize,*/
@@ -524,8 +524,8 @@ static const EQ::inventory::LookupEntry inventory_static_lookup_entries[EQ::vers
EntityLimits::NPCPet::INULL,
EntityLimits::NPCPet::INULL,
EntityLimits::NPCPet::INULL,
0, //EQ::inventory::ContainerCount, /*ItemBagSize,*/
0, //EQ::inventory::SocketCount, /*ItemAugSize,*/
0, //EQEmu::inventory::ContainerCount, /*ItemBagSize,*/
0, //EQEmu::inventory::SocketCount, /*ItemAugSize,*/
false,
false,
@@ -533,9 +533,9 @@ static const EQ::inventory::LookupEntry inventory_static_lookup_entries[EQ::vers
false
),
/*[MobVersion::MercPet] =*/
EQ::inventory::LookupEntry(
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
EQ::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::MercPet::INULL, EntityLimits::MercPet::INULL,
EQEmu::inventory::LookupEntry(
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
EQEmu::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::MercPet::INULL, EntityLimits::MercPet::INULL,
EntityLimits::MercPet::invtype::TRADE_SIZE, EntityLimits::MercPet::INULL, EntityLimits::MercPet::INULL,
EntityLimits::MercPet::INULL, EntityLimits::MercPet::INULL, EntityLimits::MercPet::INULL,
EntityLimits::MercPet::INULL, EntityLimits::MercPet::INULL, EntityLimits::MercPet::INULL, /*InvTypeCorpseSize,*/
@@ -551,8 +551,8 @@ static const EQ::inventory::LookupEntry inventory_static_lookup_entries[EQ::vers
EntityLimits::MercPet::INULL,
EntityLimits::MercPet::INULL,
EntityLimits::MercPet::INULL,
0, //EQ::inventory::ContainerCount, /*ItemBagSize,*/
0, //EQ::inventory::SocketCount, /*ItemAugSize,*/
0, //EQEmu::inventory::ContainerCount, /*ItemBagSize,*/
0, //EQEmu::inventory::SocketCount, /*ItemAugSize,*/
false,
false,
@@ -560,9 +560,9 @@ static const EQ::inventory::LookupEntry inventory_static_lookup_entries[EQ::vers
false
),
/*[MobVersion::BotPet] =*/
EQ::inventory::LookupEntry(
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
EQ::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::BotPet::INULL, EntityLimits::BotPet::INULL,
EQEmu::inventory::LookupEntry(
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
EQEmu::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::BotPet::INULL, EntityLimits::BotPet::INULL,
EntityLimits::BotPet::invtype::TRADE_SIZE, EntityLimits::BotPet::INULL, EntityLimits::BotPet::INULL,
EntityLimits::BotPet::INULL, EntityLimits::BotPet::INULL, EntityLimits::BotPet::INULL,
EntityLimits::BotPet::INULL, EntityLimits::BotPet::INULL, EntityLimits::BotPet::INULL, /*InvTypeCorpseSize,*/
@@ -578,8 +578,8 @@ static const EQ::inventory::LookupEntry inventory_static_lookup_entries[EQ::vers
EntityLimits::BotPet::INULL,
EntityLimits::BotPet::INULL,
EntityLimits::BotPet::INULL,
0, //EQ::inventory::ContainerCount, /*ItemBagSize,*/
0, //EQ::inventory::SocketCount, /*ItemAugSize,*/
0, //EQEmu::inventory::ContainerCount, /*ItemBagSize,*/
0, //EQEmu::inventory::SocketCount, /*ItemAugSize,*/
false,
false,
@@ -587,8 +587,8 @@ static const EQ::inventory::LookupEntry inventory_static_lookup_entries[EQ::vers
false
),
/*[MobVersion::OfflineTitanium] =*/
EQ::inventory::LookupEntry(
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
EQEmu::inventory::LookupEntry(
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
Titanium::INULL, Titanium::INULL, Titanium::INULL,
Titanium::invtype::TRADE_SIZE, Titanium::INULL, Titanium::INULL,
Titanium::INULL, Titanium::INULL, Titanium::INULL,
@@ -614,8 +614,8 @@ static const EQ::inventory::LookupEntry inventory_static_lookup_entries[EQ::vers
false
),
/*[MobVersion::OfflineSoF] =*/
EQ::inventory::LookupEntry(
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
EQEmu::inventory::LookupEntry(
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
SoF::INULL, SoF::INULL, SoF::INULL,
SoF::invtype::TRADE_SIZE, SoF::INULL, SoF::INULL,
SoF::INULL, SoF::INULL, SoF::INULL,
@@ -641,8 +641,8 @@ static const EQ::inventory::LookupEntry inventory_static_lookup_entries[EQ::vers
false
),
/*[MobVersion::OfflineSoD] =*/
EQ::inventory::LookupEntry(
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
EQEmu::inventory::LookupEntry(
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
SoD::INULL, SoD::INULL, SoD::INULL,
SoD::invtype::TRADE_SIZE, SoD::INULL, SoD::INULL,
SoD::INULL, SoD::INULL, SoD::INULL,
@@ -668,8 +668,8 @@ static const EQ::inventory::LookupEntry inventory_static_lookup_entries[EQ::vers
false
),
/*[MobVersion::OfflineUF] =*/
EQ::inventory::LookupEntry(
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
EQEmu::inventory::LookupEntry(
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
UF::INULL, UF::INULL, UF::INULL,
UF::invtype::TRADE_SIZE, UF::INULL, UF::INULL,
UF::INULL, UF::INULL, UF::INULL,
@@ -695,8 +695,8 @@ static const EQ::inventory::LookupEntry inventory_static_lookup_entries[EQ::vers
false
),
/*[MobVersion::OfflineRoF] =*/
EQ::inventory::LookupEntry(
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
EQEmu::inventory::LookupEntry(
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
RoF::INULL, RoF::INULL, RoF::INULL,
RoF::invtype::TRADE_SIZE, RoF::INULL, RoF::INULL,
RoF::INULL, RoF::INULL, RoF::INULL,
@@ -722,8 +722,8 @@ static const EQ::inventory::LookupEntry inventory_static_lookup_entries[EQ::vers
false
),
/*[MobVersion::OfflineRoF2] =*/
EQ::inventory::LookupEntry(
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
EQEmu::inventory::LookupEntry(
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
RoF2::INULL, RoF2::INULL, RoF2::INULL,
RoF2::invtype::TRADE_SIZE, RoF2::INULL, RoF2::INULL,
RoF2::INULL, RoF2::INULL, RoF2::INULL,
@@ -751,7 +751,7 @@ static const EQ::inventory::LookupEntry inventory_static_lookup_entries[EQ::vers
};
static bool inventory_dictionary_init = false;
void EQ::inventory::InitializeDynamicLookups() {
void EQEmu::inventory::InitializeDynamicLookups() {
if (inventory_dictionary_init == true)
return;
inventory_dictionary_init = true;
@@ -774,9 +774,9 @@ void EQ::inventory::InitializeDynamicLookups() {
const uint32 dynamic_check_mask =
(
EQ::expansions::bitPoR |
EQ::expansions::bitTBS |
EQ::expansions::bitHoT
EQEmu::expansions::bitPoR |
EQEmu::expansions::bitTBS |
EQEmu::expansions::bitHoT
);
// if all of the above expansion bits are present, then static references will suffice
@@ -784,7 +784,7 @@ void EQ::inventory::InitializeDynamicLookups() {
return;
// Dynamic Lookups (promotive methodology) (all mob versions allowed)
for (uint32 iter = static_cast<uint32>(EQ::versions::MobVersion::Unknown); iter <= static_cast<uint32>(EQ::versions::LastPCMobVersion); ++iter) {
for (uint32 iter = static_cast<uint32>(EQEmu::versions::MobVersion::Unknown); iter <= static_cast<uint32>(EQEmu::versions::LastPCMobVersion); ++iter) {
// no need to dynamic this condition since it is the lowest compatibility standard
if ((dynamic_check_mask & ~constants_static_lookup_entries[iter].ExpansionsMask) == dynamic_check_mask)
continue;
@@ -803,21 +803,21 @@ void EQ::inventory::InitializeDynamicLookups() {
inventory_dynamic_nongm_lookup_entries[iter]->PossessionsBitmask = 0; // we'll fix later
inventory_dynamic_nongm_lookup_entries[iter]->CorpseBitmask = 0; // we'll fix later
if (RuleI(World, ExpansionSettings) & EQ::expansions::bitPoR) {
if (RuleI(World, ExpansionSettings) & EQEmu::expansions::bitPoR) {
// update bank size
if (constants_static_lookup_entries[iter].ExpansionsMask & EQ::expansions::bitPoR)
if (constants_static_lookup_entries[iter].ExpansionsMask & EQEmu::expansions::bitPoR)
inventory_dynamic_nongm_lookup_entries[iter]->InventoryTypeSize.Bank = SoF::invtype::BANK_SIZE;
}
if (RuleI(World, ExpansionSettings) & EQ::expansions::bitTBS) {
if (RuleI(World, ExpansionSettings) & EQEmu::expansions::bitTBS) {
// update power source
if (constants_static_lookup_entries[iter].ExpansionsMask & EQ::expansions::bitTBS)
if (constants_static_lookup_entries[iter].ExpansionsMask & EQEmu::expansions::bitTBS)
inventory_dynamic_nongm_lookup_entries[iter]->EquipmentBitmask = SoF::invslot::EQUIPMENT_BITMASK;
}
if (RuleI(World, ExpansionSettings) & EQ::expansions::bitHoT) {
if (RuleI(World, ExpansionSettings) & EQEmu::expansions::bitHoT) {
// update general size
if (constants_static_lookup_entries[iter].ExpansionsMask & EQ::expansions::bitHoT)
if (constants_static_lookup_entries[iter].ExpansionsMask & EQEmu::expansions::bitHoT)
inventory_dynamic_nongm_lookup_entries[iter]->GeneralBitmask = RoF::invslot::GENERAL_BITMASK;
}
@@ -841,7 +841,7 @@ void EQ::inventory::InitializeDynamicLookups() {
}
// Dynamic GM Lookups (demotive methodology) (client-linked mob versions only)
for (uint32 iter = static_cast<uint32>(EQ::versions::MobVersion::Unknown); iter <= static_cast<uint32>(EQ::versions::LastPCMobVersion); ++iter) {
for (uint32 iter = static_cast<uint32>(EQEmu::versions::MobVersion::Unknown); iter <= static_cast<uint32>(EQEmu::versions::LastPCMobVersion); ++iter) {
// no need to dynamic this condition since it is the lowest compatibility standard
if ((dynamic_check_mask & ~constants_static_lookup_entries[iter].ExpansionsMask) == dynamic_check_mask)
continue;
@@ -869,13 +869,13 @@ void EQ::inventory::InitializeDynamicLookups() {
inventory_dynamic_gm_lookup_entries[iter]->PossessionsBitmask = 0; // we'll fix later
inventory_dynamic_gm_lookup_entries[iter]->CorpseBitmask = 0; // we'll fix later
if (~RuleI(World, ExpansionSettings) & EQ::expansions::bitPoR) {
if (~RuleI(World, ExpansionSettings) & EQEmu::expansions::bitPoR) {
// update bank size
if (constants_static_lookup_entries[iter].ExpansionsMask & EQ::expansions::bitPoR)
if (constants_static_lookup_entries[iter].ExpansionsMask & EQEmu::expansions::bitPoR)
inventory_dynamic_gm_lookup_entries[iter]->InventoryTypeSize.Bank = Titanium::invtype::BANK_SIZE;
}
if (~RuleI(World, ExpansionSettings) & EQ::expansions::bitTBS) {
if (~RuleI(World, ExpansionSettings) & EQEmu::expansions::bitTBS) {
// update power source
switch (iter) {
case versions::bitUF:
@@ -890,7 +890,7 @@ void EQ::inventory::InitializeDynamicLookups() {
}
}
if (~RuleI(World, ExpansionSettings) & EQ::expansions::bitHoT) {
if (~RuleI(World, ExpansionSettings) & EQEmu::expansions::bitHoT) {
// update general size
switch (iter) {
case versions::bitUF:
@@ -927,7 +927,7 @@ void EQ::inventory::InitializeDynamicLookups() {
// only client versions that require a change from their static definitions have been given a dynamic (gm) lookup entry
}
const EQ::inventory::LookupEntry* EQ::inventory::DynamicLookup(versions::MobVersion mob_version, bool gm_flag)
const EQEmu::inventory::LookupEntry* EQEmu::inventory::DynamicLookup(versions::MobVersion mob_version, bool gm_flag)
{
if (gm_flag)
return DynamicGMLookup(mob_version);
@@ -935,7 +935,7 @@ const EQ::inventory::LookupEntry* EQ::inventory::DynamicLookup(versions::MobVers
return DynamicNonGMLookup(mob_version);
}
const EQ::inventory::LookupEntry* EQ::inventory::DynamicNonGMLookup(versions::MobVersion mob_version)
const EQEmu::inventory::LookupEntry* EQEmu::inventory::DynamicNonGMLookup(versions::MobVersion mob_version)
{
mob_version = versions::ValidateMobVersion(mob_version);
if (inventory_dynamic_nongm_lookup_entries[static_cast<int>(mob_version)])
@@ -944,7 +944,7 @@ const EQ::inventory::LookupEntry* EQ::inventory::DynamicNonGMLookup(versions::Mo
return &inventory_static_lookup_entries[static_cast<int>(mob_version)];
}
const EQ::inventory::LookupEntry* EQ::inventory::DynamicGMLookup(versions::MobVersion mob_version)
const EQEmu::inventory::LookupEntry* EQEmu::inventory::DynamicGMLookup(versions::MobVersion mob_version)
{
mob_version = versions::ValidateMobVersion(mob_version);
if (inventory_dynamic_gm_lookup_entries[static_cast<int>(mob_version)])
@@ -953,107 +953,107 @@ const EQ::inventory::LookupEntry* EQ::inventory::DynamicGMLookup(versions::MobVe
return &inventory_static_lookup_entries[static_cast<int>(mob_version)];
}
const EQ::inventory::LookupEntry* EQ::inventory::StaticLookup(versions::MobVersion mob_version)
const EQEmu::inventory::LookupEntry* EQEmu::inventory::StaticLookup(versions::MobVersion mob_version)
{
return &inventory_static_lookup_entries[static_cast<int>(versions::ValidateMobVersion(mob_version))];
}
static std::unique_ptr<EQ::behavior::LookupEntry> behavior_dynamic_nongm_lookup_entries[EQ::versions::MobVersionCount];
static std::unique_ptr<EQ::behavior::LookupEntry> behavior_dynamic_gm_lookup_entries[EQ::versions::MobVersionCount];
static const EQ::behavior::LookupEntry behavior_static_lookup_entries[EQ::versions::MobVersionCount] =
static std::unique_ptr<EQEmu::behavior::LookupEntry> behavior_dynamic_nongm_lookup_entries[EQEmu::versions::MobVersionCount];
static std::unique_ptr<EQEmu::behavior::LookupEntry> behavior_dynamic_gm_lookup_entries[EQEmu::versions::MobVersionCount];
static const EQEmu::behavior::LookupEntry behavior_static_lookup_entries[EQEmu::versions::MobVersionCount] =
{
/*[MobVersion::Unknown] =*/
EQ::behavior::LookupEntry(
EQEmu::behavior::LookupEntry(
true
),
/*[MobVersion::Client62] =*/
EQ::behavior::LookupEntry(
EQEmu::behavior::LookupEntry(
true
),
/*[MobVersion::Titanium] =*/
EQ::behavior::LookupEntry(
EQEmu::behavior::LookupEntry(
Titanium::behavior::CoinHasWeight
),
/*[MobVersion::SoF] =*/
EQ::behavior::LookupEntry(
EQEmu::behavior::LookupEntry(
SoF::behavior::CoinHasWeight
),
/*[MobVersion::SoD] =*/
EQ::behavior::LookupEntry(
EQEmu::behavior::LookupEntry(
SoD::behavior::CoinHasWeight
),
/*[MobVersion::UF] =*/
EQ::behavior::LookupEntry(
EQEmu::behavior::LookupEntry(
UF::behavior::CoinHasWeight
),
/*[MobVersion::RoF] =*/
EQ::behavior::LookupEntry(
EQEmu::behavior::LookupEntry(
RoF::behavior::CoinHasWeight
),
/*[MobVersion::RoF2] =*/
EQ::behavior::LookupEntry(
EQEmu::behavior::LookupEntry(
RoF2::behavior::CoinHasWeight
),
/*[MobVersion::NPC] =*/
EQ::behavior::LookupEntry(
EQ::behavior::CoinHasWeight
EQEmu::behavior::LookupEntry(
EQEmu::behavior::CoinHasWeight
),
/*[MobVersion::NPCMerchant] =*/
EQ::behavior::LookupEntry(
EQ::behavior::CoinHasWeight
EQEmu::behavior::LookupEntry(
EQEmu::behavior::CoinHasWeight
),
/*[MobVersion::Merc] =*/
EQ::behavior::LookupEntry(
EQ::behavior::CoinHasWeight
EQEmu::behavior::LookupEntry(
EQEmu::behavior::CoinHasWeight
),
/*[MobVersion::Bot] =*/
EQ::behavior::LookupEntry(
EQ::behavior::CoinHasWeight
EQEmu::behavior::LookupEntry(
EQEmu::behavior::CoinHasWeight
),
/*[MobVersion::ClientPet] =*/
EQ::behavior::LookupEntry(
EQ::behavior::CoinHasWeight
EQEmu::behavior::LookupEntry(
EQEmu::behavior::CoinHasWeight
),
/*[MobVersion::NPCPet] =*/
EQ::behavior::LookupEntry(
EQ::behavior::CoinHasWeight
EQEmu::behavior::LookupEntry(
EQEmu::behavior::CoinHasWeight
),
/*[MobVersion::MercPet] =*/
EQ::behavior::LookupEntry(
EQ::behavior::CoinHasWeight
EQEmu::behavior::LookupEntry(
EQEmu::behavior::CoinHasWeight
),
/*[MobVersion::BotPet] =*/
EQ::behavior::LookupEntry(
EQ::behavior::CoinHasWeight
EQEmu::behavior::LookupEntry(
EQEmu::behavior::CoinHasWeight
),
/*[MobVersion::OfflineTitanium] =*/
EQ::behavior::LookupEntry(
EQEmu::behavior::LookupEntry(
Titanium::behavior::CoinHasWeight
),
/*[MobVersion::OfflineSoF] =*/
EQ::behavior::LookupEntry(
EQEmu::behavior::LookupEntry(
SoF::behavior::CoinHasWeight
),
/*[MobVersion::OfflineSoD] =*/
EQ::behavior::LookupEntry(
EQEmu::behavior::LookupEntry(
SoD::behavior::CoinHasWeight
),
/*[MobVersion::OfflineUF] =*/
EQ::behavior::LookupEntry(
EQEmu::behavior::LookupEntry(
UF::behavior::CoinHasWeight
),
/*[MobVersion::OfflineRoF] =*/
EQ::behavior::LookupEntry(
EQEmu::behavior::LookupEntry(
RoF::behavior::CoinHasWeight
),
/*[MobVersion::OfflineRoF2] =*/
EQ::behavior::LookupEntry(
EQEmu::behavior::LookupEntry(
RoF2::behavior::CoinHasWeight
)
};
static bool behavior_dictionary_init = false;
void EQ::behavior::InitializeDynamicLookups() {
void EQEmu::behavior::InitializeDynamicLookups() {
if (behavior_dictionary_init == true)
return;
behavior_dictionary_init = true;
@@ -1064,7 +1064,7 @@ void EQ::behavior::InitializeDynamicLookups() {
// use static references for now
}
const EQ::behavior::LookupEntry* EQ::behavior::DynamicLookup(versions::MobVersion mob_version, bool gm_flag)
const EQEmu::behavior::LookupEntry* EQEmu::behavior::DynamicLookup(versions::MobVersion mob_version, bool gm_flag)
{
if (gm_flag)
return DynamicGMLookup(mob_version);
@@ -1072,7 +1072,7 @@ const EQ::behavior::LookupEntry* EQ::behavior::DynamicLookup(versions::MobVersio
return DynamicNonGMLookup(mob_version);
}
const EQ::behavior::LookupEntry* EQ::behavior::DynamicNonGMLookup(versions::MobVersion mob_version)
const EQEmu::behavior::LookupEntry* EQEmu::behavior::DynamicNonGMLookup(versions::MobVersion mob_version)
{
mob_version = versions::ValidateMobVersion(mob_version);
if (behavior_dynamic_nongm_lookup_entries[static_cast<int>(mob_version)])
@@ -1081,7 +1081,7 @@ const EQ::behavior::LookupEntry* EQ::behavior::DynamicNonGMLookup(versions::MobV
return &behavior_static_lookup_entries[static_cast<int>(mob_version)];
}
const EQ::behavior::LookupEntry* EQ::behavior::DynamicGMLookup(versions::MobVersion mob_version)
const EQEmu::behavior::LookupEntry* EQEmu::behavior::DynamicGMLookup(versions::MobVersion mob_version)
{
mob_version = versions::ValidateMobVersion(mob_version);
if (behavior_dynamic_gm_lookup_entries[static_cast<int>(mob_version)])
@@ -1090,17 +1090,17 @@ const EQ::behavior::LookupEntry* EQ::behavior::DynamicGMLookup(versions::MobVers
return &behavior_static_lookup_entries[static_cast<int>(mob_version)];
}
const EQ::behavior::LookupEntry* EQ::behavior::StaticLookup(versions::MobVersion mob_version)
const EQEmu::behavior::LookupEntry* EQEmu::behavior::StaticLookup(versions::MobVersion mob_version)
{
return &behavior_static_lookup_entries[static_cast<int>(versions::ValidateMobVersion(mob_version))];
}
static std::unique_ptr<EQ::spells::LookupEntry> spells_dynamic_nongm_lookup_entries[EQ::versions::ClientVersionCount];
static std::unique_ptr<EQ::spells::LookupEntry> spells_dynamic_gm_lookup_entries[EQ::versions::ClientVersionCount];
static const EQ::spells::LookupEntry spells_static_lookup_entries[EQ::versions::ClientVersionCount] =
static std::unique_ptr<EQEmu::spells::LookupEntry> spells_dynamic_nongm_lookup_entries[EQEmu::versions::ClientVersionCount];
static std::unique_ptr<EQEmu::spells::LookupEntry> spells_dynamic_gm_lookup_entries[EQEmu::versions::ClientVersionCount];
static const EQEmu::spells::LookupEntry spells_static_lookup_entries[EQEmu::versions::ClientVersionCount] =
{
/*[ClientVersion::Unknown] =*/
EQ::spells::LookupEntry(
EQEmu::spells::LookupEntry(
ClientUnknown::INULL,
ClientUnknown::INULL,
ClientUnknown::INULL,
@@ -1113,7 +1113,7 @@ static const EQ::spells::LookupEntry spells_static_lookup_entries[EQ::versions::
ClientUnknown::INULL
),
/*[ClientVersion::Client62] =*/
EQ::spells::LookupEntry(
EQEmu::spells::LookupEntry(
Client62::INULL,
Client62::INULL,
Client62::INULL,
@@ -1126,7 +1126,7 @@ static const EQ::spells::LookupEntry spells_static_lookup_entries[EQ::versions::
Client62::INULL
),
/*[ClientVersion::Titanium] =*/
EQ::spells::LookupEntry(
EQEmu::spells::LookupEntry(
Titanium::spells::SPELL_ID_MAX,
Titanium::spells::SPELLBOOK_SIZE,
Titanium::spells::SPELL_GEM_COUNT,
@@ -1139,7 +1139,7 @@ static const EQ::spells::LookupEntry spells_static_lookup_entries[EQ::versions::
Titanium::spells::MERC_BUFFS
),
/*[ClientVersion::SoF] =*/
EQ::spells::LookupEntry(
EQEmu::spells::LookupEntry(
SoF::spells::SPELL_ID_MAX,
SoF::spells::SPELLBOOK_SIZE,
SoF::spells::SPELL_GEM_COUNT,
@@ -1152,7 +1152,7 @@ static const EQ::spells::LookupEntry spells_static_lookup_entries[EQ::versions::
SoF::spells::MERC_BUFFS
),
/*[ClientVersion::SoD] =*/
EQ::spells::LookupEntry(
EQEmu::spells::LookupEntry(
SoD::spells::SPELL_ID_MAX,
SoD::spells::SPELLBOOK_SIZE,
SoD::spells::SPELL_GEM_COUNT,
@@ -1165,7 +1165,7 @@ static const EQ::spells::LookupEntry spells_static_lookup_entries[EQ::versions::
SoD::spells::MERC_BUFFS
),
/*[ClientVersion::UF] =*/
EQ::spells::LookupEntry(
EQEmu::spells::LookupEntry(
UF::spells::SPELL_ID_MAX,
UF::spells::SPELLBOOK_SIZE,
UF::spells::SPELL_GEM_COUNT,
@@ -1178,7 +1178,7 @@ static const EQ::spells::LookupEntry spells_static_lookup_entries[EQ::versions::
UF::spells::MERC_BUFFS
),
/*[ClientVersion::RoF] =*/
EQ::spells::LookupEntry(
EQEmu::spells::LookupEntry(
RoF::spells::SPELL_ID_MAX,
RoF::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
@@ -1191,7 +1191,7 @@ static const EQ::spells::LookupEntry spells_static_lookup_entries[EQ::versions::
RoF::spells::MERC_BUFFS
),
/*[ClientVersion::RoF2] =*/
EQ::spells::LookupEntry(
EQEmu::spells::LookupEntry(
RoF2::spells::SPELL_ID_MAX,
RoF2::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
@@ -1206,7 +1206,7 @@ static const EQ::spells::LookupEntry spells_static_lookup_entries[EQ::versions::
};
static bool spells_dictionary_init = false;
void EQ::spells::InitializeDynamicLookups() {
void EQEmu::spells::InitializeDynamicLookups() {
if (spells_dictionary_init == true)
return;
spells_dictionary_init = true;
@@ -1217,7 +1217,7 @@ void EQ::spells::InitializeDynamicLookups() {
// use static references for now
}
const EQ::spells::LookupEntry* EQ::spells::DynamicLookup(versions::ClientVersion client_version, bool gm_flag)
const EQEmu::spells::LookupEntry* EQEmu::spells::DynamicLookup(versions::ClientVersion client_version, bool gm_flag)
{
if (gm_flag)
return DynamicGMLookup(client_version);
@@ -1225,7 +1225,7 @@ const EQ::spells::LookupEntry* EQ::spells::DynamicLookup(versions::ClientVersion
return DynamicNonGMLookup(client_version);
}
const EQ::spells::LookupEntry* EQ::spells::DynamicNonGMLookup(versions::ClientVersion client_version)
const EQEmu::spells::LookupEntry* EQEmu::spells::DynamicNonGMLookup(versions::ClientVersion client_version)
{
client_version = versions::ValidateClientVersion(client_version);
if (spells_dynamic_nongm_lookup_entries[static_cast<int>(client_version)])
@@ -1234,7 +1234,7 @@ const EQ::spells::LookupEntry* EQ::spells::DynamicNonGMLookup(versions::ClientVe
return &spells_static_lookup_entries[static_cast<int>(client_version)];
}
const EQ::spells::LookupEntry* EQ::spells::DynamicGMLookup(versions::ClientVersion client_version)
const EQEmu::spells::LookupEntry* EQEmu::spells::DynamicGMLookup(versions::ClientVersion client_version)
{
client_version = versions::ValidateClientVersion(client_version);
if (spells_dynamic_gm_lookup_entries[static_cast<int>(client_version)])
@@ -1243,7 +1243,7 @@ const EQ::spells::LookupEntry* EQ::spells::DynamicGMLookup(versions::ClientVersi
return &spells_static_lookup_entries[static_cast<int>(client_version)];
}
const EQ::spells::LookupEntry* EQ::spells::StaticLookup(versions::ClientVersion client_version)
const EQEmu::spells::LookupEntry* EQEmu::spells::StaticLookup(versions::ClientVersion client_version)
{
return &spells_static_lookup_entries[static_cast<int>(versions::ValidateClientVersion(client_version))];
}
+10 -10
View File
@@ -31,13 +31,13 @@
#include "../common/patches/rof2_limits.h"
namespace EQ
namespace EQEmu
{
void InitializeDynamicLookups();
namespace constants {
struct LookupEntry {
EQ::expansions::Expansion Expansion;
EQEmu::expansions::Expansion Expansion;
uint32 ExpansionBit;
uint32 ExpansionsMask;
int16 CharacterCreationLimit;
@@ -45,7 +45,7 @@ namespace EQ
LookupEntry(const LookupEntry *lookup_entry) { }
LookupEntry(
EQ::expansions::Expansion Expansion,
EQEmu::expansions::Expansion Expansion,
uint32 ExpansionBit,
uint32 ExpansionsMask,
int16 CharacterCreationLimit,
@@ -111,7 +111,7 @@ namespace EQ
union {
InventoryTypeSize_Struct InventoryTypeSize;
int16 InventoryTypeSizeArray[25]; // should reflect EQ::invtype::TYPE_COUNT referenced in emu_constants.h
int16 InventoryTypeSizeArray[25]; // should reflect EQEmu::invtype::TYPE_COUNT referenced in emu_constants.h
};
uint64 EquipmentBitmask;
@@ -244,9 +244,9 @@ namespace ClientUnknown
const int16 INULL = 0;
namespace constants {
const EQ::expansions::Expansion EXPANSION = EQ::expansions::Expansion::EverQuest;
const uint32 EXPANSION_BIT = EQ::expansions::bitEverQuest;
const uint32 EXPANSIONS_MASK = EQ::expansions::maskEverQuest;
const EQEmu::expansions::Expansion EXPANSION = EQEmu::expansions::Expansion::EverQuest;
const uint32 EXPANSION_BIT = EQEmu::expansions::bitEverQuest;
const uint32 EXPANSIONS_MASK = EQEmu::expansions::maskEverQuest;
} // namespace constants
@@ -258,9 +258,9 @@ namespace Client62
const int16 INULL = 0;
namespace constants {
const EQ::expansions::Expansion EXPANSION = EQ::expansions::Expansion::EverQuest;
const uint32 EXPANSION_BIT = EQ::expansions::bitEverQuest;
const uint32 EXPANSIONS_MASK = EQ::expansions::maskEverQuest;
const EQEmu::expansions::Expansion EXPANSION = EQEmu::expansions::Expansion::EverQuest;
const uint32 EXPANSION_BIT = EQEmu::expansions::bitEverQuest;
const uint32 EXPANSIONS_MASK = EQEmu::expansions::maskEverQuest;
} // namespace constants
+25 -25
View File
@@ -129,7 +129,7 @@ struct LDoNTrapTemplate
// All clients translate the character select information to some degree
struct CharSelectEquip : EQ::textures::Texture_Struct, EQ::textures::Tint_Struct {};
struct CharSelectEquip : EQEmu::textures::Texture_Struct, EQEmu::textures::Tint_Struct {};
// RoF2-based hybrid struct
struct CharacterSelectEntry_Struct
@@ -144,7 +144,7 @@ struct CharacterSelectEntry_Struct
uint16 Instance;
uint8 Gender;
uint8 Face;
CharSelectEquip Equip[EQ::textures::materialCount];
CharSelectEquip Equip[EQEmu::textures::materialCount];
uint8 Unknown15; // Seen FF
uint8 Unknown19; // Seen FF
uint32 DrakkinTattoo;
@@ -253,7 +253,7 @@ struct Spawn_Struct {
/*0189*/ uint32 petOwnerId; // If this is a pet, the spawn id of owner
/*0193*/ uint8 guildrank; // 0=normal, 1=officer, 2=leader
/*0194*/ uint8 unknown0194[3];
/*0197*/ EQ::TextureProfile equipment;
/*0197*/ EQEmu::TextureProfile equipment;
/*0233*/ float runspeed; // Speed when running
/*0036*/ uint8 afk; // 0=no, 1=afk
/*0238*/ uint32 guildID; // Current guild
@@ -284,7 +284,7 @@ union
/*0340*/ uint32 spawnId; // Spawn Id
/*0344*/ float bounding_radius; // used in melee, overrides calc
/*0347*/ uint8 IsMercenary;
/*0348*/ EQ::TintProfile equipment_tint;
/*0348*/ EQEmu::TintProfile equipment_tint;
/*0384*/ uint8 lfg; // 0=off, 1=lfg on
/*0385*/
@@ -736,7 +736,7 @@ struct BandolierItem_Struct
struct Bandolier_Struct
{
char Name[32];
BandolierItem_Struct Items[EQ::profile::BANDOLIER_ITEM_COUNT];
BandolierItem_Struct Items[EQEmu::profile::BANDOLIER_ITEM_COUNT];
};
//len = 72
@@ -750,7 +750,7 @@ struct PotionBeltItem_Struct
//len = 288
struct PotionBelt_Struct
{
PotionBeltItem_Struct Items[EQ::profile::POTION_BELT_SIZE];
PotionBeltItem_Struct Items[EQEmu::profile::POTION_BELT_SIZE];
};
struct MovePotionToBelt_Struct
@@ -841,7 +841,7 @@ struct SuspendedMinion_Struct
/*002*/ uint32 HP;
/*006*/ uint32 Mana;
/*010*/ SpellBuff_Struct Buffs[BUFF_COUNT];
/*510*/ EQ::TextureMaterialProfile Items;
/*510*/ EQEmu::TextureMaterialProfile Items;
/*546*/ char Name[64];
/*610*/
};
@@ -933,7 +933,7 @@ struct PlayerProfile_Struct
/*0245*/ uint8 guildbanker;
/*0246*/ uint8 unknown0246[6]; //
/*0252*/ uint32 intoxication;
/*0256*/ uint32 spellSlotRefresh[EQ::spells::SPELL_GEM_COUNT]; //in ms
/*0256*/ uint32 spellSlotRefresh[EQEmu::spells::SPELL_GEM_COUNT]; //in ms
/*0292*/ uint32 abilitySlotRefresh;
/*0296*/ uint8 haircolor; // Player hair color
/*0297*/ uint8 beardcolor; // Player beard color
@@ -946,9 +946,9 @@ struct PlayerProfile_Struct
/*0304*/ uint8 ability_time_minutes;
/*0305*/ uint8 ability_time_hours; //place holder
/*0306*/ uint8 unknown0306[6]; // @bp Spacer/Flag?
/*0312*/ EQ::TextureMaterialProfile item_material; // Item texture/material of worn/held items
/*0312*/ EQEmu::TextureMaterialProfile item_material; // Item texture/material of worn/held items
/*0348*/ uint8 unknown0348[44];
/*0392*/ EQ::TintProfile item_tint;
/*0392*/ EQEmu::TintProfile item_tint;
/*0428*/ AA_Array aa_array[MAX_PP_AA_ARRAY];
/*2348*/ float unknown2384; //seen ~128, ~47
/*2352*/ char servername[32]; // length probably not right
@@ -972,9 +972,9 @@ struct PlayerProfile_Struct
/*2505*/ uint8 unknown2541[47]; // ?
/*2552*/ uint8 languages[MAX_PP_LANGUAGE];
/*2580*/ uint8 unknown2616[4];
/*2584*/ uint32 spell_book[EQ::spells::SPELLBOOK_SIZE];
/*2584*/ uint32 spell_book[EQEmu::spells::SPELLBOOK_SIZE];
/*4504*/ uint8 unknown4540[128]; // Was [428] all 0xff
/*4632*/ uint32 mem_spells[EQ::spells::SPELL_GEM_COUNT];
/*4632*/ uint32 mem_spells[EQEmu::spells::SPELL_GEM_COUNT];
/*4668*/ uint8 unknown4704[32]; //
/*4700*/ float y; // Player y position
/*4704*/ float x; // Player x position
@@ -1050,7 +1050,7 @@ struct PlayerProfile_Struct
/*7212*/ uint32 tribute_points;
/*7216*/ uint32 unknown7252;
/*7220*/ uint32 tribute_active; //1=active
/*7224*/ Tribute_Struct tributes[EQ::invtype::TRIBUTE_SIZE];
/*7224*/ Tribute_Struct tributes[EQEmu::invtype::TRIBUTE_SIZE];
/*7264*/ Disciplines_Struct disciplines;
/*7664*/ uint32 recastTimers[MAX_RECAST_TYPES]; // Timers (GMT of last use)
/*7744*/ char unknown7780[160];
@@ -1077,7 +1077,7 @@ struct PlayerProfile_Struct
/*12800*/ uint32 expAA;
/*12804*/ uint32 aapoints; //avaliable, unspent
/*12808*/ uint8 unknown12844[36];
/*12844*/ Bandolier_Struct bandoliers[EQ::profile::BANDOLIERS_SIZE];
/*12844*/ Bandolier_Struct bandoliers[EQEmu::profile::BANDOLIERS_SIZE];
/*14124*/ uint8 unknown14160[4506];
/*18630*/ SuspendedMinion_Struct SuspendedMinion; // No longer in use
/*19240*/ uint32 timeentitledonaccount;
@@ -1095,16 +1095,16 @@ struct PlayerProfile_Struct
/*19568*/
// All player profile packets are translated and this overhead is ignored in out-bound packets
PlayerProfile_Struct() : m_player_profile_version(EQ::versions::MobVersion::Unknown) { }
PlayerProfile_Struct() : m_player_profile_version(EQEmu::versions::MobVersion::Unknown) { }
EQ::versions::MobVersion PlayerProfileVersion() { return m_player_profile_version; }
void SetPlayerProfileVersion(EQ::versions::MobVersion mob_version) { m_player_profile_version = EQ::versions::ValidateMobVersion(mob_version); }
void SetPlayerProfileVersion(EQ::versions::ClientVersion client_version) { SetPlayerProfileVersion(EQ::versions::ConvertClientVersionToMobVersion(client_version)); }
EQEmu::versions::MobVersion PlayerProfileVersion() { return m_player_profile_version; }
void SetPlayerProfileVersion(EQEmu::versions::MobVersion mob_version) { m_player_profile_version = EQEmu::versions::ValidateMobVersion(mob_version); }
void SetPlayerProfileVersion(EQEmu::versions::ClientVersion client_version) { SetPlayerProfileVersion(EQEmu::versions::ConvertClientVersionToMobVersion(client_version)); }
private:
// No need for gm flag since pp already has one
// No need for lookup pointer since this struct is not tied to any one system
EQ::versions::MobVersion m_player_profile_version;
EQEmu::versions::MobVersion m_player_profile_version;
};
@@ -1215,7 +1215,7 @@ struct WearChange_Struct {
/*010*/ uint32 elite_material; // 1 for Drakkin Elite Material
/*014*/ uint32 hero_forge_model; // New to VoA
/*018*/ uint32 unknown18; // New to RoF
/*022*/ EQ::textures::Tint_Struct color;
/*022*/ EQEmu::textures::Tint_Struct color;
/*026*/ uint8 wear_slot_id;
/*027*/
};
@@ -2123,7 +2123,7 @@ struct AdventureLeaderboard_Struct
/*struct Item_Shop_Struct {
uint16 merchantid;
uint8 itemtype;
EQ::ItemData item;
EQEmu::ItemData item;
uint8 iss_unknown001[6];
};*/
@@ -2149,7 +2149,7 @@ struct Illusion_Struct { //size: 256 - SoF
/*092*/ uint32 drakkin_heritage; //
/*096*/ uint32 drakkin_tattoo; //
/*100*/ uint32 drakkin_details; //
/*104*/ EQ::TintProfile armor_tint; //
/*104*/ EQEmu::TintProfile armor_tint; //
/*140*/ uint8 eyecolor1; // Field Not Identified in any Illusion Struct
/*141*/ uint8 eyecolor2; // Field Not Identified in any Illusion Struct
/*142*/ uint8 unknown138[114]; //
@@ -3489,8 +3489,8 @@ struct SelectTributeReply_Struct {
struct TributeInfo_Struct {
uint32 active; //0 == inactive, 1 == active
uint32 tributes[EQ::invtype::TRIBUTE_SIZE]; //-1 == NONE
uint32 tiers[EQ::invtype::TRIBUTE_SIZE]; //all 00's
uint32 tributes[EQEmu::invtype::TRIBUTE_SIZE]; //-1 == NONE
uint32 tiers[EQEmu::invtype::TRIBUTE_SIZE]; //all 00's
uint32 tribute_master_id;
};
@@ -4401,7 +4401,7 @@ struct AnnoyingZoneUnknown_Struct {
};
struct LoadSpellSet_Struct {
uint32 spell[EQ::spells::SPELL_GEM_COUNT]; // 0xFFFFFFFF if no action, slot number if to unmem starting at 0
uint32 spell[EQEmu::spells::SPELL_GEM_COUNT]; // 0xFFFFFFFF if no action, slot number if to unmem starting at 0
uint32 unknown; //there seems to be an extra field in this packet...
};
+1 -1
View File
@@ -100,7 +100,7 @@ public:
virtual MatchState CheckSignature(const Signature *sig) { return MatchFailed; }
virtual EQStreamState GetState() = 0;
virtual void SetOpcodeManager(OpcodeManager **opm) = 0;
virtual const EQ::versions::ClientVersion ClientVersion() const { return EQ::versions::ClientVersion::Unknown; }
virtual const EQEmu::versions::ClientVersion ClientVersion() const { return EQEmu::versions::ClientVersion::Unknown; }
virtual Stats GetStats() const = 0;
virtual void ResetStats() = 0;
virtual EQStreamManagerInterface* GetManager() const = 0;
+1 -1
View File
@@ -22,7 +22,7 @@ std::string EQStreamProxy::Describe() const {
return(m_structs->Describe());
}
const EQ::versions::ClientVersion EQStreamProxy::ClientVersion() const
const EQEmu::versions::ClientVersion EQStreamProxy::ClientVersion() const
{
return m_structs->ClientVersion();
}
+1 -1
View File
@@ -28,7 +28,7 @@ public:
virtual void RemoveData();
virtual bool CheckState(EQStreamState state);
virtual std::string Describe() const;
virtual const EQ::versions::ClientVersion ClientVersion() const;
virtual const EQEmu::versions::ClientVersion ClientVersion() const;
virtual EQStreamState GetState();
virtual void SetOpcodeManager(OpcodeManager **opm);
virtual Stats GetStats() const;
+9
View File
@@ -104,6 +104,15 @@ void EQEmuConfig::parse_config()
DatabasePort = atoi(_root["server"]["database"].get("port", "3306").asString().c_str());
DatabaseDB = _root["server"]["database"].get("db", "eq").asString();
/**
* Content Database
*/
ContentDbUsername = _root["server"]["content_database"].get("username", "").asString();
ContentDbPassword = _root["server"]["content_database"].get("password", "").asString();
ContentDbHost = _root["server"]["content_database"].get("host", "").asString();
ContentDbPort = atoi(_root["server"]["content_database"].get("port", 0).asString().c_str());
ContentDbName = _root["server"]["content_database"].get("db", "").asString();
/**
* QS
*/
+7
View File
@@ -74,6 +74,13 @@ class EQEmuConfig
std::string DatabaseDB;
uint16 DatabasePort;
// From <content_database/>
std::string ContentDbHost;
std::string ContentDbUsername;
std::string ContentDbPassword;
std::string ContentDbName;
uint16 ContentDbPort;
// From <qsdatabase> // QueryServ
std::string QSDatabaseHost;
std::string QSDatabaseUsername;
+1 -1
View File
@@ -18,7 +18,7 @@
#include "eqemu_exception.h"
namespace EQ
namespace EQEmu
{
Exception::Exception(const char* name, const std::string& description, const char* file, long line)
: line_(line),
+2 -2
View File
@@ -22,7 +22,7 @@
#include <sstream>
#include <exception>
namespace EQ
namespace EQEmu
{
//! EQEmu Exception Class
/*!
@@ -104,7 +104,7 @@ namespace EQ
} // EQEmu
#ifndef EQ_EXCEPT
#define EQ_EXCEPT(n, d) throw EQ::Exception(n, d, __FILE__, __LINE__)
#define EQ_EXCEPT(n, d) throw EQEmu::Exception(n, d, __FILE__, __LINE__)
#endif
#endif
+2
View File
@@ -115,6 +115,7 @@ namespace Logs {
Flee,
Aura,
HotReload,
Merchants,
MaxCategoryID /* Don't Remove this */
};
@@ -189,6 +190,7 @@ namespace Logs {
"Flee",
"Aura",
"HotReload",
"Merchants",
};
}
+16
View File
@@ -571,6 +571,16 @@
OutF(LogSys, Logs::Detail, Logs::HotReload, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogMerchants(message, ...) do {\
if (LogSys.log_settings[Logs::Merchants].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::Merchants, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogMerchantsDetail(message, ...) do {\
if (LogSys.log_settings[Logs::Merchants].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::Merchants, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define Log(debug_level, log_category, message, ...) do {\
if (LogSys.log_settings[log_category].is_category_enabled == 1)\
LogSys.Out(debug_level, log_category, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
@@ -910,6 +920,12 @@
#define LogHotReloadDetail(message, ...) do {\
} while (0)
#define LogMerchants(message, ...) do {\
} while (0)
#define LogMerchantsDetail(message, ...) do {\
} while (0)
#define Log(debug_level, log_category, message, ...) do {\
} while (0)
-4
View File
@@ -25,10 +25,6 @@ namespace EQ
uv_run(&m_loop, UV_RUN_DEFAULT);
}
void Shutdown() {
uv_stop(&m_loop);
}
uv_loop_t* Handle() { return &m_loop; }
private:
+3 -3
View File
@@ -8,7 +8,7 @@ namespace EQ {
class Task
{
public:
typedef std::function<void(const EQ::Any&)> ResolveFn;
typedef std::function<void(const EQEmu::Any&)> ResolveFn;
typedef std::function<void(const std::exception&)> RejectFn;
typedef std::function<void()> FinallyFn;
typedef std::function<void(ResolveFn, RejectFn)> TaskFn;
@@ -19,7 +19,7 @@ namespace EQ {
RejectFn on_catch;
FinallyFn on_finally;
bool has_result;
EQ::Any result;
EQEmu::Any result;
bool has_error;
std::exception error;
};
@@ -63,7 +63,7 @@ namespace EQ {
uv_queue_work(EventLoop::Get().Handle(), m_work, [](uv_work_t* req) {
TaskBaton *baton = (TaskBaton*)req->data;
baton->fn([baton](const EQ::Any& result) {
baton->fn([baton](const EQEmu::Any& result) {
baton->has_error = false;
baton->has_result = true;
baton->result = result;
+1 -1
View File
@@ -40,7 +40,7 @@ struct ExtendedProfile_Struct {
uint16 old_pet_hp; /* Not Used */
uint16 old_pet_mana; /* Not Used */
SpellBuff_Struct pet_buffs[BUFF_COUNT]; /* Not Used */
EQ::TextureMaterialProfile pet_items; /* Not Used */
EQEmu::TextureMaterialProfile pet_items; /* Not Used */
char merc_name[64]; /* Used */
uint32 aa_effects; /* Used */
+1 -1
View File
@@ -23,7 +23,7 @@
#include "eqemu_exception.h"
#include "types.h"
namespace EQ {
namespace EQEmu {
/*! Simple HashSet designed to be used in fixed memory that may be difficult to use an
allocator for (shared memory), we assume all keys are unsigned int
+1 -1
View File
@@ -23,7 +23,7 @@
#include "eqemu_exception.h"
#include "types.h"
namespace EQ {
namespace EQEmu {
/*! Simple HashSet designed to be used in fixed memory that may be difficult to use an
allocator for (shared memory), we assume all keys are unsigned int, values are a pointer and size
+97 -97
View File
@@ -33,7 +33,7 @@
#include <iostream>
std::list<EQ::ItemInstance*> dirty_inst;
std::list<EQEmu::ItemInstance*> dirty_inst;
//
@@ -48,50 +48,50 @@ ItemInstQueue::~ItemInstQueue()
}
// Put item onto back of queue
void ItemInstQueue::push(EQ::ItemInstance* inst)
void ItemInstQueue::push(EQEmu::ItemInstance* inst)
{
m_list.push_back(inst);
}
// Put item onto front of queue
void ItemInstQueue::push_front(EQ::ItemInstance* inst)
void ItemInstQueue::push_front(EQEmu::ItemInstance* inst)
{
m_list.push_front(inst);
}
// Remove item from front of queue
EQ::ItemInstance* ItemInstQueue::pop()
EQEmu::ItemInstance* ItemInstQueue::pop()
{
if (m_list.empty())
return nullptr;
EQ::ItemInstance* inst = m_list.front();
EQEmu::ItemInstance* inst = m_list.front();
m_list.pop_front();
return inst;
}
// Remove item from back of queue
EQ::ItemInstance* ItemInstQueue::pop_back()
EQEmu::ItemInstance* ItemInstQueue::pop_back()
{
if (m_list.empty())
return nullptr;
EQ::ItemInstance* inst = m_list.back();
EQEmu::ItemInstance* inst = m_list.back();
m_list.pop_back();
return inst;
}
// Look at item at front of queue
EQ::ItemInstance* ItemInstQueue::peek_front() const
EQEmu::ItemInstance* ItemInstQueue::peek_front() const
{
return (m_list.empty()) ? nullptr : m_list.front();
}
//
// class EQ::InventoryProfile
// class EQEmu::InventoryProfile
//
EQ::InventoryProfile::~InventoryProfile()
EQEmu::InventoryProfile::~InventoryProfile()
{
for (auto iter = m_worn.begin(); iter != m_worn.end(); ++iter) {
safe_delete(iter->second);
@@ -119,18 +119,18 @@ EQ::InventoryProfile::~InventoryProfile()
m_trade.clear();
}
void EQ::InventoryProfile::SetInventoryVersion(versions::MobVersion inventory_version) {
void EQEmu::InventoryProfile::SetInventoryVersion(versions::MobVersion inventory_version) {
m_mob_version = versions::ValidateMobVersion(inventory_version);
SetGMInventory(m_gm_inventory);
}
void EQ::InventoryProfile::SetGMInventory(bool gmi_flag) {
void EQEmu::InventoryProfile::SetGMInventory(bool gmi_flag) {
m_gm_inventory = gmi_flag;
m_lookup = inventory::DynamicLookup(m_mob_version, gmi_flag);
}
void EQ::InventoryProfile::CleanDirty() {
void EQEmu::InventoryProfile::CleanDirty() {
auto iter = dirty_inst.begin();
while (iter != dirty_inst.end()) {
delete (*iter);
@@ -139,14 +139,14 @@ void EQ::InventoryProfile::CleanDirty() {
dirty_inst.clear();
}
void EQ::InventoryProfile::MarkDirty(ItemInstance *inst) {
void EQEmu::InventoryProfile::MarkDirty(ItemInstance *inst) {
if (inst) {
dirty_inst.push_back(inst);
}
}
// Retrieve item at specified slot; returns false if item not found
EQ::ItemInstance* EQ::InventoryProfile::GetItem(int16 slot_id) const
EQEmu::ItemInstance* EQEmu::InventoryProfile::GetItem(int16 slot_id) const
{
ItemInstance* result = nullptr;
@@ -219,31 +219,31 @@ EQ::ItemInstance* EQ::InventoryProfile::GetItem(int16 slot_id) const
}
// Retrieve item at specified position within bag
EQ::ItemInstance* EQ::InventoryProfile::GetItem(int16 slot_id, uint8 bagidx) const
EQEmu::ItemInstance* EQEmu::InventoryProfile::GetItem(int16 slot_id, uint8 bagidx) const
{
return GetItem(InventoryProfile::CalcSlotId(slot_id, bagidx));
}
// Put an item snto specified slot
int16 EQ::InventoryProfile::PutItem(int16 slot_id, const ItemInstance& inst)
int16 EQEmu::InventoryProfile::PutItem(int16 slot_id, const ItemInstance& inst)
{
if (slot_id <= EQ::invslot::POSSESSIONS_END && slot_id >= EQ::invslot::POSSESSIONS_BEGIN) {
if (slot_id <= EQEmu::invslot::POSSESSIONS_END && slot_id >= EQEmu::invslot::POSSESSIONS_BEGIN) {
if ((((uint64)1 << slot_id) & m_lookup->PossessionsBitmask) == 0)
return EQ::invslot::SLOT_INVALID;
return EQEmu::invslot::SLOT_INVALID;
}
else if (slot_id <= EQ::invbag::GENERAL_BAGS_END && slot_id >= EQ::invbag::GENERAL_BAGS_BEGIN) {
auto temp_slot = EQ::invslot::GENERAL_BEGIN + ((slot_id - EQ::invbag::GENERAL_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT);
else if (slot_id <= EQEmu::invbag::GENERAL_BAGS_END && slot_id >= EQEmu::invbag::GENERAL_BAGS_BEGIN) {
auto temp_slot = EQEmu::invslot::GENERAL_BEGIN + ((slot_id - EQEmu::invbag::GENERAL_BAGS_BEGIN) / EQEmu::invbag::SLOT_COUNT);
if ((((uint64)1 << temp_slot) & m_lookup->PossessionsBitmask) == 0)
return EQ::invslot::SLOT_INVALID;
return EQEmu::invslot::SLOT_INVALID;
}
else if (slot_id <= EQ::invslot::BANK_END && slot_id >= EQ::invslot::BANK_BEGIN) {
if ((slot_id - EQ::invslot::BANK_BEGIN) >= m_lookup->InventoryTypeSize.Bank)
return EQ::invslot::SLOT_INVALID;
else if (slot_id <= EQEmu::invslot::BANK_END && slot_id >= EQEmu::invslot::BANK_BEGIN) {
if ((slot_id - EQEmu::invslot::BANK_BEGIN) >= m_lookup->InventoryTypeSize.Bank)
return EQEmu::invslot::SLOT_INVALID;
}
else if (slot_id <= EQ::invbag::BANK_BAGS_END && slot_id >= EQ::invbag::BANK_BAGS_BEGIN) {
auto temp_slot = (slot_id - EQ::invbag::BANK_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT;
else if (slot_id <= EQEmu::invbag::BANK_BAGS_END && slot_id >= EQEmu::invbag::BANK_BAGS_BEGIN) {
auto temp_slot = (slot_id - EQEmu::invbag::BANK_BAGS_BEGIN) / EQEmu::invbag::SLOT_COUNT;
if (temp_slot >= m_lookup->InventoryTypeSize.Bank)
return EQ::invslot::SLOT_INVALID;
return EQEmu::invslot::SLOT_INVALID;
}
// Clean up item already in slot (if exists)
@@ -259,17 +259,17 @@ int16 EQ::InventoryProfile::PutItem(int16 slot_id, const ItemInstance& inst)
return _PutItem(slot_id, inst.Clone());
}
int16 EQ::InventoryProfile::PushCursor(const ItemInstance &inst) {
int16 EQEmu::InventoryProfile::PushCursor(const ItemInstance &inst) {
m_cursor.push(inst.Clone());
return invslot::slotCursor;
}
EQ::ItemInstance* EQ::InventoryProfile::GetCursorItem() {
EQEmu::ItemInstance* EQEmu::InventoryProfile::GetCursorItem() {
return m_cursor.peek_front();
}
// Swap items in inventory
bool EQ::InventoryProfile::SwapItem(
bool EQEmu::InventoryProfile::SwapItem(
int16 source_slot,
int16 destination_slot,
SwapItemFailState &fail_state,
@@ -280,54 +280,54 @@ bool EQ::InventoryProfile::SwapItem(
) {
fail_state = swapInvalid;
if (source_slot <= EQ::invslot::POSSESSIONS_END && source_slot >= EQ::invslot::POSSESSIONS_BEGIN) {
if (source_slot <= EQEmu::invslot::POSSESSIONS_END && source_slot >= EQEmu::invslot::POSSESSIONS_BEGIN) {
if ((((uint64) 1 << source_slot) & m_lookup->PossessionsBitmask) == 0) {
fail_state = swapNotAllowed;
return false;
}
}
else if (source_slot <= EQ::invbag::GENERAL_BAGS_END && source_slot >= EQ::invbag::GENERAL_BAGS_BEGIN) {
auto temp_slot = EQ::invslot::GENERAL_BEGIN + ((source_slot - EQ::invbag::GENERAL_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT);
else if (source_slot <= EQEmu::invbag::GENERAL_BAGS_END && source_slot >= EQEmu::invbag::GENERAL_BAGS_BEGIN) {
auto temp_slot = EQEmu::invslot::GENERAL_BEGIN + ((source_slot - EQEmu::invbag::GENERAL_BAGS_BEGIN) / EQEmu::invbag::SLOT_COUNT);
if ((((uint64)1 << temp_slot) & m_lookup->PossessionsBitmask) == 0) {
fail_state = swapNotAllowed;
return false;
}
}
else if (source_slot <= EQ::invslot::BANK_END && source_slot >= EQ::invslot::BANK_BEGIN) {
if ((source_slot - EQ::invslot::BANK_BEGIN) >= m_lookup->InventoryTypeSize.Bank) {
else if (source_slot <= EQEmu::invslot::BANK_END && source_slot >= EQEmu::invslot::BANK_BEGIN) {
if ((source_slot - EQEmu::invslot::BANK_BEGIN) >= m_lookup->InventoryTypeSize.Bank) {
fail_state = swapNotAllowed;
return false;
}
}
else if (source_slot <= EQ::invbag::BANK_BAGS_END && source_slot >= EQ::invbag::BANK_BAGS_BEGIN) {
auto temp_slot = (source_slot - EQ::invbag::BANK_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT;
else if (source_slot <= EQEmu::invbag::BANK_BAGS_END && source_slot >= EQEmu::invbag::BANK_BAGS_BEGIN) {
auto temp_slot = (source_slot - EQEmu::invbag::BANK_BAGS_BEGIN) / EQEmu::invbag::SLOT_COUNT;
if (temp_slot >= m_lookup->InventoryTypeSize.Bank) {
fail_state = swapNotAllowed;
return false;
}
}
if (destination_slot <= EQ::invslot::POSSESSIONS_END && destination_slot >= EQ::invslot::POSSESSIONS_BEGIN) {
if (destination_slot <= EQEmu::invslot::POSSESSIONS_END && destination_slot >= EQEmu::invslot::POSSESSIONS_BEGIN) {
if ((((uint64)1 << destination_slot) & m_lookup->PossessionsBitmask) == 0) {
fail_state = swapNotAllowed;
return false;
}
}
else if (destination_slot <= EQ::invbag::GENERAL_BAGS_END && destination_slot >= EQ::invbag::GENERAL_BAGS_BEGIN) {
auto temp_slot = EQ::invslot::GENERAL_BEGIN + ((destination_slot - EQ::invbag::GENERAL_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT);
else if (destination_slot <= EQEmu::invbag::GENERAL_BAGS_END && destination_slot >= EQEmu::invbag::GENERAL_BAGS_BEGIN) {
auto temp_slot = EQEmu::invslot::GENERAL_BEGIN + ((destination_slot - EQEmu::invbag::GENERAL_BAGS_BEGIN) / EQEmu::invbag::SLOT_COUNT);
if ((((uint64)1 << temp_slot) & m_lookup->PossessionsBitmask) == 0) {
fail_state = swapNotAllowed;
return false;
}
}
else if (destination_slot <= EQ::invslot::BANK_END && destination_slot >= EQ::invslot::BANK_BEGIN) {
if ((destination_slot - EQ::invslot::BANK_BEGIN) >= m_lookup->InventoryTypeSize.Bank) {
else if (destination_slot <= EQEmu::invslot::BANK_END && destination_slot >= EQEmu::invslot::BANK_BEGIN) {
if ((destination_slot - EQEmu::invslot::BANK_BEGIN) >= m_lookup->InventoryTypeSize.Bank) {
fail_state = swapNotAllowed;
return false;
}
}
else if (destination_slot <= EQ::invbag::BANK_BAGS_END && destination_slot >= EQ::invbag::BANK_BAGS_BEGIN) {
auto temp_slot = (destination_slot - EQ::invbag::BANK_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT;
else if (destination_slot <= EQEmu::invbag::BANK_BAGS_END && destination_slot >= EQEmu::invbag::BANK_BAGS_BEGIN) {
auto temp_slot = (destination_slot - EQEmu::invbag::BANK_BAGS_BEGIN) / EQEmu::invbag::SLOT_COUNT;
if (temp_slot >= m_lookup->InventoryTypeSize.Bank) {
fail_state = swapNotAllowed;
return false;
@@ -399,7 +399,7 @@ bool EQ::InventoryProfile::SwapItem(
}
// Remove item from inventory (with memory delete)
bool EQ::InventoryProfile::DeleteItem(int16 slot_id, uint8 quantity) {
bool EQEmu::InventoryProfile::DeleteItem(int16 slot_id, uint8 quantity) {
// Pop item out of inventory map (or queue)
ItemInstance *item_to_delete = PopItem(slot_id);
@@ -434,7 +434,7 @@ bool EQ::InventoryProfile::DeleteItem(int16 slot_id, uint8 quantity) {
}
// Checks All items in a bag for No Drop
bool EQ::InventoryProfile::CheckNoDrop(int16 slot_id, bool recurse)
bool EQEmu::InventoryProfile::CheckNoDrop(int16 slot_id, bool recurse)
{
ItemInstance* inst = GetItem(slot_id);
if (!inst)
@@ -445,7 +445,7 @@ bool EQ::InventoryProfile::CheckNoDrop(int16 slot_id, bool recurse)
// Remove item from bucket without memory delete
// Returns item pointer if full delete was successful
EQ::ItemInstance* EQ::InventoryProfile::PopItem(int16 slot_id)
EQEmu::ItemInstance* EQEmu::InventoryProfile::PopItem(int16 slot_id)
{
ItemInstance* p = nullptr;
@@ -488,7 +488,7 @@ EQ::ItemInstance* EQ::InventoryProfile::PopItem(int16 slot_id)
return p;
}
bool EQ::InventoryProfile::HasSpaceForItem(const ItemData *ItemToTry, int16 Quantity) {
bool EQEmu::InventoryProfile::HasSpaceForItem(const ItemData *ItemToTry, int16 Quantity) {
if (ItemToTry->Stackable) {
@@ -592,7 +592,7 @@ bool EQ::InventoryProfile::HasSpaceForItem(const ItemData *ItemToTry, int16 Quan
//This function has a flaw in that it only returns the last stack that it looked at
//when quantity is greater than 1 and not all of quantity can be found in 1 stack.
int16 EQ::InventoryProfile::HasItem(uint32 item_id, uint8 quantity, uint8 where)
int16 EQEmu::InventoryProfile::HasItem(uint32 item_id, uint8 quantity, uint8 where)
{
int16 slot_id = INVALID_INDEX;
@@ -642,7 +642,7 @@ int16 EQ::InventoryProfile::HasItem(uint32 item_id, uint8 quantity, uint8 where)
}
//this function has the same quantity flaw mentioned above in HasItem()
int16 EQ::InventoryProfile::HasItemByUse(uint8 use, uint8 quantity, uint8 where)
int16 EQEmu::InventoryProfile::HasItemByUse(uint8 use, uint8 quantity, uint8 where)
{
int16 slot_id = INVALID_INDEX;
@@ -688,7 +688,7 @@ int16 EQ::InventoryProfile::HasItemByUse(uint8 use, uint8 quantity, uint8 where)
return slot_id;
}
int16 EQ::InventoryProfile::HasItemByLoreGroup(uint32 loregroup, uint8 where)
int16 EQEmu::InventoryProfile::HasItemByLoreGroup(uint32 loregroup, uint8 where)
{
int16 slot_id = INVALID_INDEX;
@@ -736,7 +736,7 @@ int16 EQ::InventoryProfile::HasItemByLoreGroup(uint32 loregroup, uint8 where)
// Locate an available inventory slot
// Returns slot_id when there's one available, else SLOT_INVALID
int16 EQ::InventoryProfile::FindFreeSlot(bool for_bag, bool try_cursor, uint8 min_size, bool is_arrow)
int16 EQEmu::InventoryProfile::FindFreeSlot(bool for_bag, bool try_cursor, uint8 min_size, bool is_arrow)
{
// Check basic inventory
for (int16 i = invslot::GENERAL_BEGIN; i <= invslot::GENERAL_END; i++) {
@@ -786,7 +786,7 @@ int16 EQ::InventoryProfile::FindFreeSlot(bool for_bag, bool try_cursor, uint8 mi
}
// This is a mix of HasSpaceForItem and FindFreeSlot..due to existing coding behavior, it was better to add a new helper function...
int16 EQ::InventoryProfile::FindFreeSlotForTradeItem(const ItemInstance* inst, int16 general_start, uint8 bag_start) {
int16 EQEmu::InventoryProfile::FindFreeSlotForTradeItem(const ItemInstance* inst, int16 general_start, uint8 bag_start) {
// Do not arbitrarily use this function..it is designed for use with Client::ResetTrade() and Client::FinishTrade().
// If you have a need, use it..but, understand it is not a suitable replacement for InventoryProfile::FindFreeSlot().
//
@@ -924,7 +924,7 @@ int16 EQ::InventoryProfile::FindFreeSlotForTradeItem(const ItemInstance* inst, i
}
// Opposite of below: Get parent bag slot_id from a slot inside of bag
int16 EQ::InventoryProfile::CalcSlotId(int16 slot_id) {
int16 EQEmu::InventoryProfile::CalcSlotId(int16 slot_id) {
int16 parent_slot_id = INVALID_INDEX;
// this is not a bag range... using this risks over-writing existing items
@@ -952,7 +952,7 @@ int16 EQ::InventoryProfile::CalcSlotId(int16 slot_id) {
}
// Calculate slot_id for an item within a bag
int16 EQ::InventoryProfile::CalcSlotId(int16 bagslot_id, uint8 bagidx) {
int16 EQEmu::InventoryProfile::CalcSlotId(int16 bagslot_id, uint8 bagidx) {
if (!InventoryProfile::SupportsContainers(bagslot_id))
return INVALID_INDEX;
@@ -977,7 +977,7 @@ int16 EQ::InventoryProfile::CalcSlotId(int16 bagslot_id, uint8 bagidx) {
return slot_id;
}
uint8 EQ::InventoryProfile::CalcBagIdx(int16 slot_id) {
uint8 EQEmu::InventoryProfile::CalcBagIdx(int16 slot_id) {
uint8 index = 0;
// this is not a bag range... using this risks over-writing existing items
@@ -1006,7 +1006,7 @@ uint8 EQ::InventoryProfile::CalcBagIdx(int16 slot_id) {
return index;
}
int16 EQ::InventoryProfile::CalcSlotFromMaterial(uint8 material)
int16 EQEmu::InventoryProfile::CalcSlotFromMaterial(uint8 material)
{
switch (material)
{
@@ -1033,7 +1033,7 @@ int16 EQ::InventoryProfile::CalcSlotFromMaterial(uint8 material)
}
}
uint8 EQ::InventoryProfile::CalcMaterialFromSlot(int16 equipslot)
uint8 EQEmu::InventoryProfile::CalcMaterialFromSlot(int16 equipslot)
{
switch (equipslot)
{
@@ -1061,7 +1061,7 @@ uint8 EQ::InventoryProfile::CalcMaterialFromSlot(int16 equipslot)
}
}
bool EQ::InventoryProfile::CanItemFitInContainer(const ItemData *ItemToTry, const ItemData *Container) {
bool EQEmu::InventoryProfile::CanItemFitInContainer(const ItemData *ItemToTry, const ItemData *Container) {
if (!ItemToTry || !Container)
return false;
@@ -1078,7 +1078,7 @@ bool EQ::InventoryProfile::CanItemFitInContainer(const ItemData *ItemToTry, cons
return true;
}
bool EQ::InventoryProfile::SupportsClickCasting(int16 slot_id)
bool EQEmu::InventoryProfile::SupportsClickCasting(int16 slot_id)
{
// there are a few non-potion items that identify as ItemTypePotion..so, we still need to ubiquitously include the equipment range
if (slot_id >= invslot::EQUIPMENT_BEGIN && slot_id <= invslot::EQUIPMENT_END) {
@@ -1095,7 +1095,7 @@ bool EQ::InventoryProfile::SupportsClickCasting(int16 slot_id)
return false;
}
bool EQ::InventoryProfile::SupportsPotionBeltCasting(int16 slot_id)
bool EQEmu::InventoryProfile::SupportsPotionBeltCasting(int16 slot_id)
{
// does this have the same criteria as 'SupportsClickCasting' above? (bag clicking per client)
if (slot_id >= invslot::EQUIPMENT_BEGIN && slot_id <= invslot::EQUIPMENT_END) {
@@ -1112,7 +1112,7 @@ bool EQ::InventoryProfile::SupportsPotionBeltCasting(int16 slot_id)
}
// Test whether a given slot can support a container item
bool EQ::InventoryProfile::SupportsContainers(int16 slot_id)
bool EQEmu::InventoryProfile::SupportsContainers(int16 slot_id)
{
if ((slot_id == invslot::slotCursor) ||
(slot_id >= invslot::GENERAL_BEGIN && slot_id <= invslot::GENERAL_END) ||
@@ -1126,7 +1126,7 @@ bool EQ::InventoryProfile::SupportsContainers(int16 slot_id)
return false;
}
int EQ::InventoryProfile::GetSlotByItemInst(ItemInstance *inst) {
int EQEmu::InventoryProfile::GetSlotByItemInst(ItemInstance *inst) {
if (!inst)
return INVALID_INDEX;
@@ -1162,7 +1162,7 @@ int EQ::InventoryProfile::GetSlotByItemInst(ItemInstance *inst) {
return INVALID_INDEX;
}
uint8 EQ::InventoryProfile::FindBrightestLightType()
uint8 EQEmu::InventoryProfile::FindBrightestLightType()
{
uint8 brightest_light_type = 0;
@@ -1213,7 +1213,7 @@ uint8 EQ::InventoryProfile::FindBrightestLightType()
return brightest_light_type;
}
void EQ::InventoryProfile::dumpEntireInventory() {
void EQEmu::InventoryProfile::dumpEntireInventory() {
dumpWornItems();
dumpInventory();
@@ -1223,29 +1223,29 @@ void EQ::InventoryProfile::dumpEntireInventory() {
std::cout << std::endl;
}
void EQ::InventoryProfile::dumpWornItems() {
void EQEmu::InventoryProfile::dumpWornItems() {
std::cout << "Worn items:" << std::endl;
dumpItemCollection(m_worn);
}
void EQ::InventoryProfile::dumpInventory() {
void EQEmu::InventoryProfile::dumpInventory() {
std::cout << "Inventory items:" << std::endl;
dumpItemCollection(m_inv);
}
void EQ::InventoryProfile::dumpBankItems() {
void EQEmu::InventoryProfile::dumpBankItems() {
std::cout << "Bank items:" << std::endl;
dumpItemCollection(m_bank);
}
void EQ::InventoryProfile::dumpSharedBankItems() {
void EQEmu::InventoryProfile::dumpSharedBankItems() {
std::cout << "Shared Bank items:" << std::endl;
dumpItemCollection(m_shbank);
}
int EQ::InventoryProfile::GetSlotByItemInstCollection(const std::map<int16, ItemInstance*> &collection, ItemInstance *inst) {
int EQEmu::InventoryProfile::GetSlotByItemInstCollection(const std::map<int16, ItemInstance*> &collection, ItemInstance *inst) {
for (auto iter = collection.begin(); iter != collection.end(); ++iter) {
ItemInstance *t_inst = iter->second;
if (t_inst == inst) {
@@ -1261,10 +1261,10 @@ int EQ::InventoryProfile::GetSlotByItemInstCollection(const std::map<int16, Item
}
}
return EQ::invslot::SLOT_INVALID;
return EQEmu::invslot::SLOT_INVALID;
}
void EQ::InventoryProfile::dumpItemCollection(const std::map<int16, ItemInstance*> &collection)
void EQEmu::InventoryProfile::dumpItemCollection(const std::map<int16, ItemInstance*> &collection)
{
for (auto it = collection.cbegin(); it != collection.cend(); ++it) {
auto inst = it->second;
@@ -1278,7 +1278,7 @@ void EQ::InventoryProfile::dumpItemCollection(const std::map<int16, ItemInstance
}
}
void EQ::InventoryProfile::dumpBagContents(ItemInstance *inst, std::map<int16, ItemInstance*>::const_iterator *it)
void EQEmu::InventoryProfile::dumpBagContents(ItemInstance *inst, std::map<int16, ItemInstance*>::const_iterator *it)
{
if (!inst || !inst->IsClassBag())
return;
@@ -1297,14 +1297,14 @@ void EQ::InventoryProfile::dumpBagContents(ItemInstance *inst, std::map<int16, I
}
// Internal Method: Retrieves item within an inventory bucket
EQ::ItemInstance* EQ::InventoryProfile::_GetItem(const std::map<int16, ItemInstance*>& bucket, int16 slot_id) const
EQEmu::ItemInstance* EQEmu::InventoryProfile::_GetItem(const std::map<int16, ItemInstance*>& bucket, int16 slot_id) const
{
if (slot_id <= EQ::invslot::POSSESSIONS_END && slot_id >= EQ::invslot::POSSESSIONS_BEGIN) {
if (slot_id <= EQEmu::invslot::POSSESSIONS_END && slot_id >= EQEmu::invslot::POSSESSIONS_BEGIN) {
if ((((uint64)1 << slot_id) & m_lookup->PossessionsBitmask) == 0)
return nullptr;
}
else if (slot_id <= EQ::invslot::BANK_END && slot_id >= EQ::invslot::BANK_BEGIN) {
if (slot_id - EQ::invslot::BANK_BEGIN >= m_lookup->InventoryTypeSize.Bank)
else if (slot_id <= EQEmu::invslot::BANK_END && slot_id >= EQEmu::invslot::BANK_BEGIN) {
if (slot_id - EQEmu::invslot::BANK_BEGIN >= m_lookup->InventoryTypeSize.Bank)
return nullptr;
}
@@ -1319,7 +1319,7 @@ EQ::ItemInstance* EQ::InventoryProfile::_GetItem(const std::map<int16, ItemInsta
// Internal Method: "put" item into bucket, without regard for what is currently in bucket
// Assumes item has already been allocated
int16 EQ::InventoryProfile::_PutItem(int16 slot_id, ItemInstance* inst)
int16 EQEmu::InventoryProfile::_PutItem(int16 slot_id, ItemInstance* inst)
{
// What happens here when we _PutItem(MainCursor)? Bad things..really bad things...
//
@@ -1356,7 +1356,7 @@ int16 EQ::InventoryProfile::_PutItem(int16 slot_id, ItemInstance* inst)
result = slot_id;
}
else if (slot_id >= invslot::BANK_BEGIN && slot_id <= invslot::BANK_END) {
if (slot_id - EQ::invslot::BANK_BEGIN < m_lookup->InventoryTypeSize.Bank) {
if (slot_id - EQEmu::invslot::BANK_BEGIN < m_lookup->InventoryTypeSize.Bank) {
m_bank[slot_id] = inst;
result = slot_id;
}
@@ -1389,17 +1389,17 @@ int16 EQ::InventoryProfile::_PutItem(int16 slot_id, ItemInstance* inst)
}
// Internal Method: Checks an inventory bucket for a particular item
int16 EQ::InventoryProfile::_HasItem(std::map<int16, ItemInstance*>& bucket, uint32 item_id, uint8 quantity)
int16 EQEmu::InventoryProfile::_HasItem(std::map<int16, ItemInstance*>& bucket, uint32 item_id, uint8 quantity)
{
uint32 quantity_found = 0;
for (auto iter = bucket.begin(); iter != bucket.end(); ++iter) {
if (iter->first <= EQ::invslot::POSSESSIONS_END && iter->first >= EQ::invslot::POSSESSIONS_BEGIN) {
if (iter->first <= EQEmu::invslot::POSSESSIONS_END && iter->first >= EQEmu::invslot::POSSESSIONS_BEGIN) {
if ((((uint64)1 << iter->first) & m_lookup->PossessionsBitmask) == 0)
continue;
}
else if (iter->first <= EQ::invslot::BANK_END && iter->first >= EQ::invslot::BANK_BEGIN) {
if (iter->first - EQ::invslot::BANK_BEGIN >= m_lookup->InventoryTypeSize.Bank)
else if (iter->first <= EQEmu::invslot::BANK_END && iter->first >= EQEmu::invslot::BANK_BEGIN) {
if (iter->first - EQEmu::invslot::BANK_BEGIN >= m_lookup->InventoryTypeSize.Bank)
continue;
}
@@ -1440,7 +1440,7 @@ int16 EQ::InventoryProfile::_HasItem(std::map<int16, ItemInstance*>& bucket, uin
}
// Internal Method: Checks an inventory queue type bucket for a particular item
int16 EQ::InventoryProfile::_HasItem(ItemInstQueue& iqueue, uint32 item_id, uint8 quantity)
int16 EQEmu::InventoryProfile::_HasItem(ItemInstQueue& iqueue, uint32 item_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
@@ -1491,17 +1491,17 @@ int16 EQ::InventoryProfile::_HasItem(ItemInstQueue& iqueue, uint32 item_id, uint
}
// Internal Method: Checks an inventory bucket for a particular item
int16 EQ::InventoryProfile::_HasItemByUse(std::map<int16, ItemInstance*>& bucket, uint8 use, uint8 quantity)
int16 EQEmu::InventoryProfile::_HasItemByUse(std::map<int16, ItemInstance*>& bucket, uint8 use, uint8 quantity)
{
uint32 quantity_found = 0;
for (auto iter = bucket.begin(); iter != bucket.end(); ++iter) {
if (iter->first <= EQ::invslot::POSSESSIONS_END && iter->first >= EQ::invslot::POSSESSIONS_BEGIN) {
if (iter->first <= EQEmu::invslot::POSSESSIONS_END && iter->first >= EQEmu::invslot::POSSESSIONS_BEGIN) {
if ((((uint64)1 << iter->first) & m_lookup->PossessionsBitmask) == 0)
continue;
}
else if (iter->first <= EQ::invslot::BANK_END && iter->first >= EQ::invslot::BANK_BEGIN) {
if (iter->first - EQ::invslot::BANK_BEGIN >= m_lookup->InventoryTypeSize.Bank)
else if (iter->first <= EQEmu::invslot::BANK_END && iter->first >= EQEmu::invslot::BANK_BEGIN) {
if (iter->first - EQEmu::invslot::BANK_BEGIN >= m_lookup->InventoryTypeSize.Bank)
continue;
}
@@ -1532,7 +1532,7 @@ int16 EQ::InventoryProfile::_HasItemByUse(std::map<int16, ItemInstance*>& bucket
}
// Internal Method: Checks an inventory queue type bucket for a particular item
int16 EQ::InventoryProfile::_HasItemByUse(ItemInstQueue& iqueue, uint8 use, uint8 quantity)
int16 EQEmu::InventoryProfile::_HasItemByUse(ItemInstQueue& iqueue, uint8 use, uint8 quantity)
{
uint32 quantity_found = 0;
@@ -1566,15 +1566,15 @@ int16 EQ::InventoryProfile::_HasItemByUse(ItemInstQueue& iqueue, uint8 use, uint
return INVALID_INDEX;
}
int16 EQ::InventoryProfile::_HasItemByLoreGroup(std::map<int16, ItemInstance*>& bucket, uint32 loregroup)
int16 EQEmu::InventoryProfile::_HasItemByLoreGroup(std::map<int16, ItemInstance*>& bucket, uint32 loregroup)
{
for (auto iter = bucket.begin(); iter != bucket.end(); ++iter) {
if (iter->first <= EQ::invslot::POSSESSIONS_END && iter->first >= EQ::invslot::POSSESSIONS_BEGIN) {
if (iter->first <= EQEmu::invslot::POSSESSIONS_END && iter->first >= EQEmu::invslot::POSSESSIONS_BEGIN) {
if ((((uint64)1 << iter->first) & m_lookup->PossessionsBitmask) == 0)
continue;
}
else if (iter->first <= EQ::invslot::BANK_END && iter->first >= EQ::invslot::BANK_BEGIN) {
if (iter->first - EQ::invslot::BANK_BEGIN >= m_lookup->InventoryTypeSize.Bank)
else if (iter->first <= EQEmu::invslot::BANK_END && iter->first >= EQEmu::invslot::BANK_BEGIN) {
if (iter->first - EQEmu::invslot::BANK_BEGIN >= m_lookup->InventoryTypeSize.Bank)
continue;
}
@@ -1611,11 +1611,11 @@ int16 EQ::InventoryProfile::_HasItemByLoreGroup(std::map<int16, ItemInstance*>&
}
}
return EQ::invslot::SLOT_INVALID;
return EQEmu::invslot::SLOT_INVALID;
}
// Internal Method: Checks an inventory queue type bucket for a particular item
int16 EQ::InventoryProfile::_HasItemByLoreGroup(ItemInstQueue& iqueue, uint32 loregroup)
int16 EQEmu::InventoryProfile::_HasItemByLoreGroup(ItemInstQueue& iqueue, uint32 loregroup)
{
for (auto iter = iqueue.cbegin(); iter != iqueue.cend(); ++iter) {
auto inst = *iter;
@@ -1654,5 +1654,5 @@ int16 EQ::InventoryProfile::_HasItemByLoreGroup(ItemInstQueue& iqueue, uint32 lo
break;
}
return EQ::invslot::SLOT_INVALID;
return EQEmu::invslot::SLOT_INVALID;
}
+10 -10
View File
@@ -52,30 +52,30 @@ public:
// Public Methods
/////////////////////////
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<EQEmu::ItemInstance*>::const_iterator cbegin() { return m_list.cbegin(); }
inline std::list<EQEmu::ItemInstance*>::const_iterator cend() { return m_list.cend(); }
inline int size() { return static_cast<int>(m_list.size()); } // TODO: change to size_t
inline bool empty() { return m_list.empty(); }
void push(EQ::ItemInstance* inst);
void push_front(EQ::ItemInstance* inst);
EQ::ItemInstance* pop();
EQ::ItemInstance* pop_back();
EQ::ItemInstance* peek_front() const;
void push(EQEmu::ItemInstance* inst);
void push_front(EQEmu::ItemInstance* inst);
EQEmu::ItemInstance* pop();
EQEmu::ItemInstance* pop_back();
EQEmu::ItemInstance* peek_front() const;
protected:
/////////////////////////
// Protected Members
/////////////////////////
std::list<EQ::ItemInstance*> m_list;
std::list<EQEmu::ItemInstance*> m_list;
};
// ########################################
// Class: EQ::InventoryProfile
// Class: EQEmu::InventoryProfile
// Character inventory
namespace EQ
namespace EQEmu
{
class InventoryProfile
{
+31 -31
View File
@@ -22,7 +22,7 @@
#include "string_util.h"
int8 EQ::inventory::ConvertEquipmentIndexToTextureIndex(int16 slot_index)
int8 EQEmu::inventory::ConvertEquipmentIndexToTextureIndex(int16 slot_index)
{
switch (slot_index) {
case invslot::slotHead:
@@ -48,7 +48,7 @@ int8 EQ::inventory::ConvertEquipmentIndexToTextureIndex(int16 slot_index)
}
}
int8 EQ::inventory::ConvertEquipmentSlotToTextureIndex(const InventorySlot& inventory_slot)
int8 EQEmu::inventory::ConvertEquipmentSlotToTextureIndex(const InventorySlot& inventory_slot)
{
if ((!inventory_slot.Typeless() && !inventory_slot.IsTypeIndex(invtype::typePossessions)) || !inventory_slot.IsContainerIndex(invbag::SLOT_INVALID) || !inventory_slot.IsSocketIndex(invaug::SOCKET_INVALID))
return textures::textureInvalid;
@@ -56,7 +56,7 @@ int8 EQ::inventory::ConvertEquipmentSlotToTextureIndex(const InventorySlot& inve
return ConvertEquipmentIndexToTextureIndex(inventory_slot.SlotIndex());
}
int16 EQ::inventory::ConvertTextureIndexToEquipmentIndex(int8 texture_index)
int16 EQEmu::inventory::ConvertTextureIndexToEquipmentIndex(int8 texture_index)
{
switch (texture_index) {
case textures::armorHead:
@@ -82,7 +82,7 @@ int16 EQ::inventory::ConvertTextureIndexToEquipmentIndex(int8 texture_index)
}
}
bool EQ::InventorySlot::IsValidSlot() const
bool EQEmu::InventorySlot::IsValidSlot() const
{
if (_typeless)
return false;
@@ -100,7 +100,7 @@ bool EQ::InventorySlot::IsValidSlot() const
return true;
}
bool EQ::InventorySlot::IsDeleteSlot() const
bool EQEmu::InventorySlot::IsDeleteSlot() const
{
if (_typeless)
return (_slot_index == invslot::SLOT_INVALID && _container_index == invbag::SLOT_INVALID && _socket_index == invaug::SOCKET_INVALID);
@@ -108,7 +108,7 @@ bool EQ::InventorySlot::IsDeleteSlot() const
return (_type_index == invtype::TYPE_INVALID && _slot_index == invslot::SLOT_INVALID && _container_index == invbag::SLOT_INVALID && _socket_index == invaug::SOCKET_INVALID);
}
bool EQ::InventorySlot::IsEquipmentIndex(int16 slot_index)
bool EQEmu::InventorySlot::IsEquipmentIndex(int16 slot_index)
{
if (slot_index < invslot::EQUIPMENT_BEGIN || slot_index > invslot::EQUIPMENT_END)
return false;
@@ -116,7 +116,7 @@ bool EQ::InventorySlot::IsEquipmentIndex(int16 slot_index)
return true;
}
bool EQ::InventorySlot::IsGeneralIndex(int16 slot_index)
bool EQEmu::InventorySlot::IsGeneralIndex(int16 slot_index)
{
if (slot_index < invslot::GENERAL_BEGIN || slot_index > invslot::GENERAL_END)
return false;
@@ -124,7 +124,7 @@ bool EQ::InventorySlot::IsGeneralIndex(int16 slot_index)
return true;
}
bool EQ::InventorySlot::IsCursorIndex(int16 slot_index)
bool EQEmu::InventorySlot::IsCursorIndex(int16 slot_index)
{
if (slot_index == invslot::slotCursor)
return true;
@@ -132,7 +132,7 @@ bool EQ::InventorySlot::IsCursorIndex(int16 slot_index)
return false;
}
bool EQ::InventorySlot::IsWeaponIndex(int16 slot_index)
bool EQEmu::InventorySlot::IsWeaponIndex(int16 slot_index)
{
if (slot_index == invslot::slotPrimary || slot_index == invslot::slotSecondary || slot_index == invslot::slotRange)
return true;
@@ -140,7 +140,7 @@ bool EQ::InventorySlot::IsWeaponIndex(int16 slot_index)
return false;
}
bool EQ::InventorySlot::IsTextureIndex(int16 slot_index)
bool EQEmu::InventorySlot::IsTextureIndex(int16 slot_index)
{
switch (slot_index) {
case invslot::slotHead:
@@ -158,7 +158,7 @@ bool EQ::InventorySlot::IsTextureIndex(int16 slot_index)
}
}
bool EQ::InventorySlot::IsTintableIndex(int16 slot_index)
bool EQEmu::InventorySlot::IsTintableIndex(int16 slot_index)
{
switch (slot_index) {
case invslot::slotHead:
@@ -174,7 +174,7 @@ bool EQ::InventorySlot::IsTintableIndex(int16 slot_index)
}
}
bool EQ::InventorySlot::IsEquipmentSlot() const
bool EQEmu::InventorySlot::IsEquipmentSlot() const
{
if (!_typeless && (_type_index != invtype::typePossessions))
return false;
@@ -185,7 +185,7 @@ bool EQ::InventorySlot::IsEquipmentSlot() const
return IsEquipmentIndex(_slot_index);
}
bool EQ::InventorySlot::IsGeneralSlot() const
bool EQEmu::InventorySlot::IsGeneralSlot() const
{
if (!_typeless && (_type_index != invtype::typePossessions))
return false;
@@ -196,7 +196,7 @@ bool EQ::InventorySlot::IsGeneralSlot() const
return IsGeneralIndex(_socket_index);
}
bool EQ::InventorySlot::IsCursorSlot() const
bool EQEmu::InventorySlot::IsCursorSlot() const
{
if (!_typeless && (_type_index != invtype::typePossessions))
return false;
@@ -207,7 +207,7 @@ bool EQ::InventorySlot::IsCursorSlot() const
return IsCursorIndex(_slot_index);
}
bool EQ::InventorySlot::IsWeaponSlot() const
bool EQEmu::InventorySlot::IsWeaponSlot() const
{
if (!_typeless && (_type_index != invtype::typePossessions))
return false;
@@ -218,7 +218,7 @@ bool EQ::InventorySlot::IsWeaponSlot() const
return IsWeaponIndex(_slot_index);
}
bool EQ::InventorySlot::IsTextureSlot() const
bool EQEmu::InventorySlot::IsTextureSlot() const
{
if (!_typeless && (_type_index != invtype::typePossessions))
return false;
@@ -229,7 +229,7 @@ bool EQ::InventorySlot::IsTextureSlot() const
return IsTextureIndex(_slot_index);
}
bool EQ::InventorySlot::IsTintableSlot() const
bool EQEmu::InventorySlot::IsTintableSlot() const
{
if (!_typeless && (_type_index != invtype::typePossessions))
return false;
@@ -240,7 +240,7 @@ bool EQ::InventorySlot::IsTintableSlot() const
return IsTintableIndex(_slot_index);
}
bool EQ::InventorySlot::IsSlot() const
bool EQEmu::InventorySlot::IsSlot() const
{
if (!_typeless && (_type_index == invtype::TYPE_INVALID))
return false;
@@ -254,7 +254,7 @@ bool EQ::InventorySlot::IsSlot() const
return true;
}
bool EQ::InventorySlot::IsSlotSocket() const
bool EQEmu::InventorySlot::IsSlotSocket() const
{
if (!_typeless && (_type_index == invtype::TYPE_INVALID))
return false;
@@ -268,7 +268,7 @@ bool EQ::InventorySlot::IsSlotSocket() const
return true;
}
bool EQ::InventorySlot::IsContainer() const
bool EQEmu::InventorySlot::IsContainer() const
{
if (!_typeless && (_type_index == invtype::TYPE_INVALID))
return false;
@@ -282,7 +282,7 @@ bool EQ::InventorySlot::IsContainer() const
return true;
}
bool EQ::InventorySlot::IsContainerSocket() const
bool EQEmu::InventorySlot::IsContainerSocket() const
{
if (!_typeless && (_type_index == invtype::TYPE_INVALID))
return false;
@@ -296,12 +296,12 @@ bool EQ::InventorySlot::IsContainerSocket() const
return true;
}
EQ::InventorySlot EQ::InventorySlot::ToTopOwner() const
EQEmu::InventorySlot EQEmu::InventorySlot::ToTopOwner() const
{
return InventorySlot(_type_index, _slot_index);
}
EQ::InventorySlot EQ::InventorySlot::ToOwner() const
EQEmu::InventorySlot EQEmu::InventorySlot::ToOwner() const
{
if (IsSlot() || IsSlotSocket() || IsContainer())
return InventorySlot(_type_index, _slot_index);
@@ -312,17 +312,17 @@ EQ::InventorySlot EQ::InventorySlot::ToOwner() const
return InventorySlot();
}
const std::string EQ::InventorySlot::ToString() const
const std::string EQEmu::InventorySlot::ToString() const
{
return StringFormat("(%i%s, %i, %i, %i)", _type_index, (_typeless ? " [typeless]" : ""), _slot_index, _container_index, _socket_index);
}
const std::string EQ::InventorySlot::ToName() const
const std::string EQEmu::InventorySlot::ToName() const
{
return StringFormat("InventorySlot - _type_index: %i%s, _slot_index: %i, _container_index: %i, _socket_index: %i", _type_index, (_typeless ? " [typeless]" : ""), _slot_index, _container_index, _socket_index);
}
void EQ::InventorySlot::SetInvalidSlot()
void EQEmu::InventorySlot::SetInvalidSlot()
{
_type_index = invtype::TYPE_INVALID;
_slot_index = invslot::SLOT_INVALID;
@@ -330,7 +330,7 @@ void EQ::InventorySlot::SetInvalidSlot()
_socket_index = invaug::SOCKET_INVALID;
}
//bool EQ::InventorySlot::IsBonusIndex(int16 slot_index)
//bool EQEmu::InventorySlot::IsBonusIndex(int16 slot_index)
//{
// if ((slot_index >= inventory::EquipmentBegin) && (slot_index <= inventory::EquipmentEnd) && (slot_index != inventory::slotAmmo))
// return true;
@@ -338,7 +338,7 @@ void EQ::InventorySlot::SetInvalidSlot()
// return false;
//}
//bool EQ::InventorySlot::IsBonusSlot() const
//bool EQEmu::InventorySlot::IsBonusSlot() const
//{
// if ((_type_index != inventory::typePossessions) || (_container_index != inventory::containerInvalid) || (_socket_index != inventory::socketInvalid))
// return false;
@@ -346,7 +346,7 @@ void EQ::InventorySlot::SetInvalidSlot()
// return IsBonusIndex(_slot_index);
//}
bool inventory_slot_typeless_lessthan(const EQ::InventorySlot& lhs, const EQ::InventorySlot& rhs)
bool inventory_slot_typeless_lessthan(const EQEmu::InventorySlot& lhs, const EQEmu::InventorySlot& rhs)
{
if (lhs.SlotIndex() < rhs.SlotIndex())
return true;
@@ -360,7 +360,7 @@ bool inventory_slot_typeless_lessthan(const EQ::InventorySlot& lhs, const EQ::In
return false;
}
bool EQ::InventorySlot::operator<(const InventorySlot& rhs) const
bool EQEmu::InventorySlot::operator<(const InventorySlot& rhs) const
{
if (Typeless() || rhs.Typeless())
return inventory_slot_typeless_lessthan(*this, rhs);
@@ -380,7 +380,7 @@ bool EQ::InventorySlot::operator<(const InventorySlot& rhs) const
return false;
}
bool EQ::operator==(const InventorySlot& lhs, const InventorySlot& rhs)
bool EQEmu::operator==(const InventorySlot& lhs, const InventorySlot& rhs)
{
if (lhs.Typeless() || rhs.Typeless())
return ((lhs.SlotIndex() == rhs.SlotIndex()) && (lhs.ContainerIndex() == rhs.ContainerIndex()) && (lhs.SocketIndex() == rhs.SocketIndex()));
+1 -1
View File
@@ -23,7 +23,7 @@
#include "emu_constants.h"
namespace EQ
namespace EQEmu
{
class InventorySlot;
+1 -1
View File
@@ -31,7 +31,7 @@
#include "eqemu_exception.h"
#include "eqemu_config.h"
namespace EQ {
namespace EQEmu {
struct IPCMutex::Implementation {
#ifdef _WINDOWS
HANDLE mut_;
+1 -1
View File
@@ -21,7 +21,7 @@
#include <string>
namespace EQ {
namespace EQEmu {
//! Interprocess Named Binary Semaphore (Mutex)
/*!
+10 -10
View File
@@ -23,7 +23,7 @@
//#include "deity.h"
uint32 EQ::item::ConvertAugTypeToAugTypeBit(uint8 aug_type)
uint32 EQEmu::item::ConvertAugTypeToAugTypeBit(uint8 aug_type)
{
switch (aug_type) {
case AugTypeGeneralSingleStat:
@@ -95,7 +95,7 @@ uint32 EQ::item::ConvertAugTypeToAugTypeBit(uint8 aug_type)
}
}
uint8 EQ::item::ConvertAugTypeBitToAugType(uint32 aug_type_bit)
uint8 EQEmu::item::ConvertAugTypeBitToAugType(uint32 aug_type_bit)
{
switch (aug_type_bit) {
case bit_AugTypeGeneralSingleStat:
@@ -167,7 +167,7 @@ uint8 EQ::item::ConvertAugTypeBitToAugType(uint32 aug_type_bit)
}
}
bool EQ::ItemData::IsEquipable(uint16 race_id, uint16 class_id) const
bool EQEmu::ItemData::IsEquipable(uint16 race_id, uint16 class_id) const
{
if (!(Races & GetPlayerRaceBit(race_id)))
return false;
@@ -178,37 +178,37 @@ bool EQ::ItemData::IsEquipable(uint16 race_id, uint16 class_id) const
return true;
}
bool EQ::ItemData::IsClassCommon() const
bool EQEmu::ItemData::IsClassCommon() const
{
return (ItemClass == item::ItemClassCommon);
}
bool EQ::ItemData::IsClassBag() const
bool EQEmu::ItemData::IsClassBag() const
{
return (ItemClass == item::ItemClassBag);
}
bool EQ::ItemData::IsClassBook() const
bool EQEmu::ItemData::IsClassBook() const
{
return (ItemClass == item::ItemClassBook);
}
bool EQ::ItemData::IsType1HWeapon() const
bool EQEmu::ItemData::IsType1HWeapon() const
{
return ((ItemType == item::ItemType1HBlunt) || (ItemType == item::ItemType1HSlash) || (ItemType == item::ItemType1HPiercing) || (ItemType == item::ItemTypeMartial));
}
bool EQ::ItemData::IsType2HWeapon() const
bool EQEmu::ItemData::IsType2HWeapon() const
{
return ((ItemType == item::ItemType2HBlunt) || (ItemType == item::ItemType2HSlash) || (ItemType == item::ItemType2HPiercing));
}
bool EQ::ItemData::IsTypeShield() const
bool EQEmu::ItemData::IsTypeShield() const
{
return (ItemType == item::ItemTypeShield);
}
bool EQ::ItemData::CheckLoreConflict(const ItemData* l_item, const ItemData* r_item)
bool EQEmu::ItemData::CheckLoreConflict(const ItemData* l_item, const ItemData* r_item)
{
if (!l_item || !r_item)
return false;
+1 -2
View File
@@ -47,7 +47,7 @@
#include "emu_constants.h"
namespace EQ
namespace EQEmu
{
namespace item {
enum ItemClass {
@@ -434,7 +434,6 @@ namespace EQ
//uint32 Unk054;
int16 MaxCharges; // Maximum charges items can hold: -1 if not a chargeable item
uint8 ItemType; // Item Type/Skill (itemClass* from above)
int32 SubType; // Some items have sub types that can be used for other things (unbreakable fishing poles, SE_FFItemClass)
uint8 Material; // Item material type
uint32 HerosForgeModel;// Hero's Forge Armor Model Type (2-13?)
float SellRate; // Sell rate
-1
View File
@@ -203,4 +203,3 @@ F(procname)
F(wornname)
F(focusname)
F(scrollname)
F(subtype)
+109 -109
View File
@@ -54,9 +54,9 @@ static inline int32 GetNextItemInstSerialNumber() {
}
//
// class EQ::ItemInstance
// class EQEmu::ItemInstance
//
EQ::ItemInstance::ItemInstance(const ItemData* item, int16 charges) {
EQEmu::ItemInstance::ItemInstance(const ItemData* item, int16 charges) {
m_use_type = ItemInstNormal;
if(item) {
m_item = new ItemData(*item);
@@ -87,7 +87,7 @@ EQ::ItemInstance::ItemInstance(const ItemData* item, int16 charges) {
m_new_id_file = 0;
}
EQ::ItemInstance::ItemInstance(SharedDatabase *db, uint32 item_id, int16 charges) {
EQEmu::ItemInstance::ItemInstance(SharedDatabase *db, uint32 item_id, int16 charges) {
m_use_type = ItemInstNormal;
m_item = db->GetItem(item_id);
if(m_item) {
@@ -121,7 +121,7 @@ EQ::ItemInstance::ItemInstance(SharedDatabase *db, uint32 item_id, int16 charges
m_new_id_file = 0;
}
EQ::ItemInstance::ItemInstance(ItemInstTypes use_type) {
EQEmu::ItemInstance::ItemInstance(ItemInstTypes use_type) {
m_use_type = use_type;
m_item = nullptr;
m_charges = 0;
@@ -143,8 +143,8 @@ EQ::ItemInstance::ItemInstance(ItemInstTypes use_type) {
m_new_id_file = 0;
}
// Make a copy of an EQ::ItemInstance object
EQ::ItemInstance::ItemInstance(const ItemInstance& copy)
// Make a copy of an EQEmu::ItemInstance object
EQEmu::ItemInstance::ItemInstance(const ItemInstance& copy)
{
m_use_type=copy.m_use_type;
if(copy.m_item)
@@ -202,7 +202,7 @@ EQ::ItemInstance::ItemInstance(const ItemInstance& copy)
}
// Clean up container contents
EQ::ItemInstance::~ItemInstance()
EQEmu::ItemInstance::~ItemInstance()
{
Clear();
safe_delete(m_item);
@@ -211,7 +211,7 @@ EQ::ItemInstance::~ItemInstance()
}
// Query item type
bool EQ::ItemInstance::IsType(item::ItemClass item_class) const
bool EQEmu::ItemInstance::IsType(item::ItemClass item_class) const
{
// IsType(<ItemClassTypes>) does not protect against 'm_item = nullptr'
@@ -225,23 +225,23 @@ bool EQ::ItemInstance::IsType(item::ItemClass item_class) const
return (m_item->ItemClass == item_class);
}
bool EQ::ItemInstance::IsClassCommon() const
bool EQEmu::ItemInstance::IsClassCommon() const
{
return (m_item && m_item->IsClassCommon());
}
bool EQ::ItemInstance::IsClassBag() const
bool EQEmu::ItemInstance::IsClassBag() const
{
return (m_item && m_item->IsClassBag());
}
bool EQ::ItemInstance::IsClassBook() const
bool EQEmu::ItemInstance::IsClassBook() const
{
return (m_item && m_item->IsClassBook());
}
// Is item stackable?
bool EQ::ItemInstance::IsStackable() const
bool EQEmu::ItemInstance::IsStackable() const
{
if (!m_item)
return false;
@@ -249,7 +249,7 @@ bool EQ::ItemInstance::IsStackable() const
return m_item->Stackable;
}
bool EQ::ItemInstance::IsCharged() const
bool EQEmu::ItemInstance::IsCharged() const
{
if (!m_item)
return false;
@@ -261,7 +261,7 @@ bool EQ::ItemInstance::IsCharged() const
}
// Can item be equipped?
bool EQ::ItemInstance::IsEquipable(uint16 race, uint16 class_) const
bool EQEmu::ItemInstance::IsEquipable(uint16 race, uint16 class_) const
{
if (!m_item || (m_item->Slots == 0))
return false;
@@ -270,18 +270,18 @@ bool EQ::ItemInstance::IsEquipable(uint16 race, uint16 class_) const
}
// Can equip at this slot?
bool EQ::ItemInstance::IsEquipable(int16 slot_id) const
bool EQEmu::ItemInstance::IsEquipable(int16 slot_id) const
{
if (!m_item)
return false;
if (slot_id < EQ::invslot::EQUIPMENT_BEGIN || slot_id > EQ::invslot::EQUIPMENT_END)
if (slot_id < EQEmu::invslot::EQUIPMENT_BEGIN || slot_id > EQEmu::invslot::EQUIPMENT_END)
return false;
return ((m_item->Slots & (1 << slot_id)) != 0);
}
bool EQ::ItemInstance::IsAugmentable() const
bool EQEmu::ItemInstance::IsAugmentable() const
{
if (!m_item)
return false;
@@ -294,7 +294,7 @@ bool EQ::ItemInstance::IsAugmentable() const
return false;
}
bool EQ::ItemInstance::AvailableWearSlot(uint32 aug_wear_slots) const {
bool EQEmu::ItemInstance::AvailableWearSlot(uint32 aug_wear_slots) const {
if (!m_item || !m_item->IsClassCommon())
return false;
@@ -306,10 +306,10 @@ bool EQ::ItemInstance::AvailableWearSlot(uint32 aug_wear_slots) const {
}
}
return (index <= EQ::invslot::EQUIPMENT_END);
return (index <= EQEmu::invslot::EQUIPMENT_END);
}
int8 EQ::ItemInstance::AvailableAugmentSlot(int32 augtype) const
int8 EQEmu::ItemInstance::AvailableAugmentSlot(int32 augtype) const
{
if (!m_item || !m_item->IsClassCommon())
return INVALID_INDEX;
@@ -324,7 +324,7 @@ int8 EQ::ItemInstance::AvailableAugmentSlot(int32 augtype) const
return (index <= invaug::SOCKET_END) ? index : INVALID_INDEX;
}
bool EQ::ItemInstance::IsAugmentSlotAvailable(int32 augtype, uint8 slot) const
bool EQEmu::ItemInstance::IsAugmentSlotAvailable(int32 augtype, uint8 slot) const
{
if (!m_item || !m_item->IsClassCommon())
return false;
@@ -336,7 +336,7 @@ bool EQ::ItemInstance::IsAugmentSlotAvailable(int32 augtype, uint8 slot) const
}
// Retrieve item inside container
EQ::ItemInstance* EQ::ItemInstance::GetItem(uint8 index) const
EQEmu::ItemInstance* EQEmu::ItemInstance::GetItem(uint8 index) const
{
auto it = m_contents.find(index);
if (it != m_contents.end()) {
@@ -346,7 +346,7 @@ EQ::ItemInstance* EQ::ItemInstance::GetItem(uint8 index) const
return nullptr;
}
uint32 EQ::ItemInstance::GetItemID(uint8 slot) const
uint32 EQEmu::ItemInstance::GetItemID(uint8 slot) const
{
ItemInstance *item = GetItem(slot);
if (item)
@@ -355,7 +355,7 @@ uint32 EQ::ItemInstance::GetItemID(uint8 slot) const
return 0;
}
void EQ::ItemInstance::PutItem(uint8 index, const ItemInstance& inst)
void EQEmu::ItemInstance::PutItem(uint8 index, const ItemInstance& inst)
{
// Clean up item already in slot (if exists)
DeleteItem(index);
@@ -365,7 +365,7 @@ void EQ::ItemInstance::PutItem(uint8 index, const ItemInstance& inst)
}
// Remove item inside container
void EQ::ItemInstance::DeleteItem(uint8 index)
void EQEmu::ItemInstance::DeleteItem(uint8 index)
{
ItemInstance* inst = PopItem(index);
safe_delete(inst);
@@ -373,7 +373,7 @@ void EQ::ItemInstance::DeleteItem(uint8 index)
// Remove item from container without memory delete
// Hands over memory ownership to client of this function call
EQ::ItemInstance* EQ::ItemInstance::PopItem(uint8 index)
EQEmu::ItemInstance* EQEmu::ItemInstance::PopItem(uint8 index)
{
auto iter = m_contents.find(index);
if (iter != m_contents.end()) {
@@ -386,7 +386,7 @@ EQ::ItemInstance* EQ::ItemInstance::PopItem(uint8 index)
}
// Remove all items from container
void EQ::ItemInstance::Clear()
void EQEmu::ItemInstance::Clear()
{
// Destroy container contents
for (auto iter = m_contents.begin(); iter != m_contents.end(); ++iter) {
@@ -396,7 +396,7 @@ void EQ::ItemInstance::Clear()
}
// Remove all items from container
void EQ::ItemInstance::ClearByFlags(byFlagSetting is_nodrop, byFlagSetting is_norent)
void EQEmu::ItemInstance::ClearByFlags(byFlagSetting is_nodrop, byFlagSetting is_norent)
{
// TODO: This needs work...
@@ -458,7 +458,7 @@ void EQ::ItemInstance::ClearByFlags(byFlagSetting is_nodrop, byFlagSetting is_no
}
}
uint8 EQ::ItemInstance::FirstOpenSlot() const
uint8 EQEmu::ItemInstance::FirstOpenSlot() const
{
if (!m_item)
return INVALID_INDEX;
@@ -472,7 +472,7 @@ uint8 EQ::ItemInstance::FirstOpenSlot() const
return (i < slots) ? i : INVALID_INDEX;
}
uint8 EQ::ItemInstance::GetTotalItemCount() const
uint8 EQEmu::ItemInstance::GetTotalItemCount() const
{
if (!m_item)
return 0;
@@ -486,7 +486,7 @@ uint8 EQ::ItemInstance::GetTotalItemCount() const
return item_count;
}
bool EQ::ItemInstance::IsNoneEmptyContainer()
bool EQEmu::ItemInstance::IsNoneEmptyContainer()
{
if (!m_item || !m_item->IsClassBag())
return false;
@@ -500,7 +500,7 @@ bool EQ::ItemInstance::IsNoneEmptyContainer()
}
// Retrieve augment inside item
EQ::ItemInstance* EQ::ItemInstance::GetAugment(uint8 slot) const
EQEmu::ItemInstance* EQEmu::ItemInstance::GetAugment(uint8 slot) const
{
if (m_item && m_item->IsClassCommon())
return GetItem(slot);
@@ -508,7 +508,7 @@ EQ::ItemInstance* EQ::ItemInstance::GetAugment(uint8 slot) const
return nullptr;
}
EQ::ItemInstance* EQ::ItemInstance::GetOrnamentationAug(int32 ornamentationAugtype) const
EQEmu::ItemInstance* EQEmu::ItemInstance::GetOrnamentationAug(int32 ornamentationAugtype) const
{
if (!m_item || !m_item->IsClassCommon()) { return nullptr; }
if (ornamentationAugtype == 0) { return nullptr; }
@@ -533,7 +533,7 @@ EQ::ItemInstance* EQ::ItemInstance::GetOrnamentationAug(int32 ornamentationAugty
return nullptr;
}
uint32 EQ::ItemInstance::GetOrnamentHeroModel(int32 material_slot) const {
uint32 EQEmu::ItemInstance::GetOrnamentHeroModel(int32 material_slot) const {
// Not a Hero Forge item.
if (m_ornament_hero_model == 0 || material_slot < 0)
return 0;
@@ -546,7 +546,7 @@ uint32 EQ::ItemInstance::GetOrnamentHeroModel(int32 material_slot) const {
return (m_ornament_hero_model * 100) + material_slot;
}
bool EQ::ItemInstance::UpdateOrnamentationInfo() {
bool EQEmu::ItemInstance::UpdateOrnamentationInfo() {
if (!m_item || !m_item->IsClassCommon())
return false;
@@ -582,7 +582,7 @@ bool EQ::ItemInstance::UpdateOrnamentationInfo() {
return ornamentSet;
}
bool EQ::ItemInstance::CanTransform(const ItemData *ItemToTry, const ItemData *Container, bool AllowAll) {
bool EQEmu::ItemInstance::CanTransform(const ItemData *ItemToTry, const ItemData *Container, bool AllowAll) {
if (!ItemToTry || !Container) return false;
if (ItemToTry->ItemType == item::ItemTypeArrow || strnlen(Container->CharmFile, 30) == 0)
@@ -629,7 +629,7 @@ bool EQ::ItemInstance::CanTransform(const ItemData *ItemToTry, const ItemData *C
return false;
}
uint32 EQ::ItemInstance::GetAugmentItemID(uint8 slot) const
uint32 EQEmu::ItemInstance::GetAugmentItemID(uint8 slot) const
{
if (!m_item || !m_item->IsClassCommon())
return 0;
@@ -638,7 +638,7 @@ uint32 EQ::ItemInstance::GetAugmentItemID(uint8 slot) const
}
// Add an augment to the item
void EQ::ItemInstance::PutAugment(uint8 slot, const ItemInstance& augment)
void EQEmu::ItemInstance::PutAugment(uint8 slot, const ItemInstance& augment)
{
if (!m_item || !m_item->IsClassCommon())
return;
@@ -646,7 +646,7 @@ void EQ::ItemInstance::PutAugment(uint8 slot, const ItemInstance& augment)
PutItem(slot, augment);
}
void EQ::ItemInstance::PutAugment(SharedDatabase *db, uint8 slot, uint32 item_id)
void EQEmu::ItemInstance::PutAugment(SharedDatabase *db, uint8 slot, uint32 item_id)
{
if (item_id == 0) { return; }
if (db == nullptr) { return; /* TODO: add log message for nullptr */ }
@@ -659,7 +659,7 @@ void EQ::ItemInstance::PutAugment(SharedDatabase *db, uint8 slot, uint32 item_id
}
// Remove augment from item and destroy it
void EQ::ItemInstance::DeleteAugment(uint8 index)
void EQEmu::ItemInstance::DeleteAugment(uint8 index)
{
if (!m_item || !m_item->IsClassCommon())
return;
@@ -668,7 +668,7 @@ void EQ::ItemInstance::DeleteAugment(uint8 index)
}
// Remove augment from item and return it
EQ::ItemInstance* EQ::ItemInstance::RemoveAugment(uint8 index)
EQEmu::ItemInstance* EQEmu::ItemInstance::RemoveAugment(uint8 index)
{
if (!m_item || !m_item->IsClassCommon())
return nullptr;
@@ -676,7 +676,7 @@ EQ::ItemInstance* EQ::ItemInstance::RemoveAugment(uint8 index)
return PopItem(index);
}
bool EQ::ItemInstance::IsAugmented()
bool EQEmu::ItemInstance::IsAugmented()
{
if (!m_item || !m_item->IsClassCommon())
return false;
@@ -690,7 +690,7 @@ bool EQ::ItemInstance::IsAugmented()
}
// Has attack/delay?
bool EQ::ItemInstance::IsWeapon() const
bool EQEmu::ItemInstance::IsWeapon() const
{
if (!m_item || !m_item->IsClassCommon())
return false;
@@ -701,7 +701,7 @@ bool EQ::ItemInstance::IsWeapon() const
return ((m_item->Damage != 0) && (m_item->Delay != 0));
}
bool EQ::ItemInstance::IsAmmo() const
bool EQEmu::ItemInstance::IsAmmo() const
{
if (!m_item)
return false;
@@ -717,7 +717,7 @@ bool EQ::ItemInstance::IsAmmo() const
}
const EQ::ItemData* EQ::ItemInstance::GetItem() const
const EQEmu::ItemData* EQEmu::ItemInstance::GetItem() const
{
if (!m_item)
return nullptr;
@@ -728,13 +728,13 @@ const EQ::ItemData* EQ::ItemInstance::GetItem() const
return m_item;
}
const EQ::ItemData* EQ::ItemInstance::GetUnscaledItem() const
const EQEmu::ItemData* EQEmu::ItemInstance::GetUnscaledItem() const
{
// No operator calls and defaults to nullptr
return m_item;
}
std::string EQ::ItemInstance::GetCustomDataString() const {
std::string EQEmu::ItemInstance::GetCustomDataString() const {
std::string ret_val;
auto iter = m_custom_data.begin();
while (iter != m_custom_data.end()) {
@@ -753,7 +753,7 @@ std::string EQ::ItemInstance::GetCustomDataString() const {
return ret_val;
}
std::string EQ::ItemInstance::GetCustomData(std::string identifier) {
std::string EQEmu::ItemInstance::GetCustomData(std::string identifier) {
std::map<std::string, std::string>::const_iterator iter = m_custom_data.find(identifier);
if (iter != m_custom_data.end()) {
return iter->second;
@@ -762,49 +762,49 @@ std::string EQ::ItemInstance::GetCustomData(std::string identifier) {
return "";
}
void EQ::ItemInstance::SetCustomData(std::string identifier, std::string value) {
void EQEmu::ItemInstance::SetCustomData(std::string identifier, std::string value) {
DeleteCustomData(identifier);
m_custom_data[identifier] = value;
}
void EQ::ItemInstance::SetCustomData(std::string identifier, int value) {
void EQEmu::ItemInstance::SetCustomData(std::string identifier, int value) {
DeleteCustomData(identifier);
std::stringstream ss;
ss << value;
m_custom_data[identifier] = ss.str();
}
void EQ::ItemInstance::SetCustomData(std::string identifier, float value) {
void EQEmu::ItemInstance::SetCustomData(std::string identifier, float value) {
DeleteCustomData(identifier);
std::stringstream ss;
ss << value;
m_custom_data[identifier] = ss.str();
}
void EQ::ItemInstance::SetCustomData(std::string identifier, bool value) {
void EQEmu::ItemInstance::SetCustomData(std::string identifier, bool value) {
DeleteCustomData(identifier);
std::stringstream ss;
ss << value;
m_custom_data[identifier] = ss.str();
}
void EQ::ItemInstance::DeleteCustomData(std::string identifier) {
void EQEmu::ItemInstance::DeleteCustomData(std::string identifier) {
auto iter = m_custom_data.find(identifier);
if (iter != m_custom_data.end()) {
m_custom_data.erase(iter);
}
}
// Clone a type of EQ::ItemInstance object
// Clone a type of EQEmu::ItemInstance object
// c++ doesn't allow a polymorphic copy constructor,
// so we have to resort to a polymorphic Clone()
EQ::ItemInstance* EQ::ItemInstance::Clone() const
EQEmu::ItemInstance* EQEmu::ItemInstance::Clone() const
{
// Pseudo-polymorphic copy constructor
return new ItemInstance(*this);
}
bool EQ::ItemInstance::IsSlotAllowed(int16 slot_id) const {
bool EQEmu::ItemInstance::IsSlotAllowed(int16 slot_id) const {
if (!m_item) { return false; }
else if (InventoryProfile::SupportsContainers(slot_id)) { return true; }
else if (m_item->Slots & (1 << slot_id)) { return true; }
@@ -812,7 +812,7 @@ bool EQ::ItemInstance::IsSlotAllowed(int16 slot_id) const {
else { return false; }
}
bool EQ::ItemInstance::IsDroppable(bool recurse) const
bool EQEmu::ItemInstance::IsDroppable(bool recurse) const
{
if (!m_item)
return false;
@@ -838,7 +838,7 @@ bool EQ::ItemInstance::IsDroppable(bool recurse) const
return true;
}
void EQ::ItemInstance::Initialize(SharedDatabase *db) {
void EQEmu::ItemInstance::Initialize(SharedDatabase *db) {
// if there's no actual item, don't do anything
if (!m_item)
return;
@@ -855,7 +855,7 @@ void EQ::ItemInstance::Initialize(SharedDatabase *db) {
}
}
void EQ::ItemInstance::ScaleItem() {
void EQEmu::ItemInstance::ScaleItem() {
if (!m_item)
return;
@@ -939,18 +939,18 @@ void EQ::ItemInstance::ScaleItem() {
m_scaledItem->CharmFileID = 0; // this stops the client from trying to scale the item itself.
}
bool EQ::ItemInstance::EvolveOnAllKills() const {
bool EQEmu::ItemInstance::EvolveOnAllKills() const {
return (m_evolveInfo && m_evolveInfo->AllKills);
}
int8 EQ::ItemInstance::GetMaxEvolveLvl() const {
int8 EQEmu::ItemInstance::GetMaxEvolveLvl() const {
if (m_evolveInfo)
return m_evolveInfo->MaxLvl;
else
return 0;
}
uint32 EQ::ItemInstance::GetKillsNeeded(uint8 currentlevel) {
uint32 EQEmu::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)
@@ -962,24 +962,24 @@ uint32 EQ::ItemInstance::GetKillsNeeded(uint8 currentlevel) {
return kills;
}
void EQ::ItemInstance::SetTimer(std::string name, uint32 time) {
void EQEmu::ItemInstance::SetTimer(std::string name, uint32 time) {
Timer t(time);
t.Start(time, false);
m_timers[name] = t;
}
void EQ::ItemInstance::StopTimer(std::string name) {
void EQEmu::ItemInstance::StopTimer(std::string name) {
auto iter = m_timers.find(name);
if(iter != m_timers.end()) {
m_timers.erase(iter);
}
}
void EQ::ItemInstance::ClearTimers() {
void EQEmu::ItemInstance::ClearTimers() {
m_timers.clear();
}
int EQ::ItemInstance::GetItemArmorClass(bool augments) const
int EQEmu::ItemInstance::GetItemArmorClass(bool augments) const
{
int ac = 0;
const auto item = GetItem();
@@ -993,7 +993,7 @@ int EQ::ItemInstance::GetItemArmorClass(bool augments) const
return ac;
}
int EQ::ItemInstance::GetItemElementalDamage(int &magic, int &fire, int &cold, int &poison, int &disease, int &chromatic, int &prismatic, int &physical, int &corruption, bool augments) const
int EQEmu::ItemInstance::GetItemElementalDamage(int &magic, int &fire, int &cold, int &poison, int &disease, int &chromatic, int &prismatic, int &physical, int &corruption, bool augments) const
{
const auto item = GetItem();
if (item) {
@@ -1035,7 +1035,7 @@ int EQ::ItemInstance::GetItemElementalDamage(int &magic, int &fire, int &cold, i
return magic + fire + cold + poison + disease + chromatic + prismatic + physical + corruption;
}
int EQ::ItemInstance::GetItemElementalFlag(bool augments) const
int EQEmu::ItemInstance::GetItemElementalFlag(bool augments) const
{
int flag = 0;
const auto item = GetItem();
@@ -1056,7 +1056,7 @@ int EQ::ItemInstance::GetItemElementalFlag(bool augments) const
return flag;
}
int EQ::ItemInstance::GetItemElementalDamage(bool augments) const
int EQEmu::ItemInstance::GetItemElementalDamage(bool augments) const
{
int damage = 0;
const auto item = GetItem();
@@ -1077,7 +1077,7 @@ int EQ::ItemInstance::GetItemElementalDamage(bool augments) const
return damage;
}
int EQ::ItemInstance::GetItemRecommendedLevel(bool augments) const
int EQEmu::ItemInstance::GetItemRecommendedLevel(bool augments) const
{
int level = 0;
const auto item = GetItem();
@@ -1099,7 +1099,7 @@ int EQ::ItemInstance::GetItemRecommendedLevel(bool augments) const
return level;
}
int EQ::ItemInstance::GetItemRequiredLevel(bool augments) const
int EQEmu::ItemInstance::GetItemRequiredLevel(bool augments) const
{
int level = 0;
const auto item = GetItem();
@@ -1121,7 +1121,7 @@ int EQ::ItemInstance::GetItemRequiredLevel(bool augments) const
return level;
}
int EQ::ItemInstance::GetItemWeaponDamage(bool augments) const
int EQEmu::ItemInstance::GetItemWeaponDamage(bool augments) const
{
int damage = 0;
const auto item = GetItem();
@@ -1137,7 +1137,7 @@ int EQ::ItemInstance::GetItemWeaponDamage(bool augments) const
return damage;
}
int EQ::ItemInstance::GetItemBackstabDamage(bool augments) const
int EQEmu::ItemInstance::GetItemBackstabDamage(bool augments) const
{
int damage = 0;
const auto item = GetItem();
@@ -1153,7 +1153,7 @@ int EQ::ItemInstance::GetItemBackstabDamage(bool augments) const
return damage;
}
int EQ::ItemInstance::GetItemBaneDamageBody(bool augments) const
int EQEmu::ItemInstance::GetItemBaneDamageBody(bool augments) const
{
int body = 0;
const auto item = GetItem();
@@ -1174,7 +1174,7 @@ int EQ::ItemInstance::GetItemBaneDamageBody(bool augments) const
return body;
}
int EQ::ItemInstance::GetItemBaneDamageRace(bool augments) const
int EQEmu::ItemInstance::GetItemBaneDamageRace(bool augments) const
{
int race = 0;
const auto item = GetItem();
@@ -1195,7 +1195,7 @@ int EQ::ItemInstance::GetItemBaneDamageRace(bool augments) const
return race;
}
int EQ::ItemInstance::GetItemBaneDamageBody(bodyType against, bool augments) const
int EQEmu::ItemInstance::GetItemBaneDamageBody(bodyType against, bool augments) const
{
int damage = 0;
const auto item = GetItem();
@@ -1212,7 +1212,7 @@ int EQ::ItemInstance::GetItemBaneDamageBody(bodyType against, bool augments) con
return damage;
}
int EQ::ItemInstance::GetItemBaneDamageRace(uint16 against, bool augments) const
int EQEmu::ItemInstance::GetItemBaneDamageRace(uint16 against, bool augments) const
{
int damage = 0;
const auto item = GetItem();
@@ -1229,7 +1229,7 @@ int EQ::ItemInstance::GetItemBaneDamageRace(uint16 against, bool augments) const
return damage;
}
int EQ::ItemInstance::GetItemMagical(bool augments) const
int EQEmu::ItemInstance::GetItemMagical(bool augments) const
{
const auto item = GetItem();
if (item) {
@@ -1245,7 +1245,7 @@ int EQ::ItemInstance::GetItemMagical(bool augments) const
return 0;
}
int EQ::ItemInstance::GetItemHP(bool augments) const
int EQEmu::ItemInstance::GetItemHP(bool augments) const
{
int hp = 0;
const auto item = GetItem();
@@ -1259,7 +1259,7 @@ int EQ::ItemInstance::GetItemHP(bool augments) const
return hp;
}
int EQ::ItemInstance::GetItemMana(bool augments) const
int EQEmu::ItemInstance::GetItemMana(bool augments) const
{
int mana = 0;
const auto item = GetItem();
@@ -1273,7 +1273,7 @@ int EQ::ItemInstance::GetItemMana(bool augments) const
return mana;
}
int EQ::ItemInstance::GetItemEndur(bool augments) const
int EQEmu::ItemInstance::GetItemEndur(bool augments) const
{
int endur = 0;
const auto item = GetItem();
@@ -1287,7 +1287,7 @@ int EQ::ItemInstance::GetItemEndur(bool augments) const
return endur;
}
int EQ::ItemInstance::GetItemAttack(bool augments) const
int EQEmu::ItemInstance::GetItemAttack(bool augments) const
{
int atk = 0;
const auto item = GetItem();
@@ -1301,7 +1301,7 @@ int EQ::ItemInstance::GetItemAttack(bool augments) const
return atk;
}
int EQ::ItemInstance::GetItemStr(bool augments) const
int EQEmu::ItemInstance::GetItemStr(bool augments) const
{
int str = 0;
const auto item = GetItem();
@@ -1315,7 +1315,7 @@ int EQ::ItemInstance::GetItemStr(bool augments) const
return str;
}
int EQ::ItemInstance::GetItemSta(bool augments) const
int EQEmu::ItemInstance::GetItemSta(bool augments) const
{
int sta = 0;
const auto item = GetItem();
@@ -1329,7 +1329,7 @@ int EQ::ItemInstance::GetItemSta(bool augments) const
return sta;
}
int EQ::ItemInstance::GetItemDex(bool augments) const
int EQEmu::ItemInstance::GetItemDex(bool augments) const
{
int total = 0;
const auto item = GetItem();
@@ -1343,7 +1343,7 @@ int EQ::ItemInstance::GetItemDex(bool augments) const
return total;
}
int EQ::ItemInstance::GetItemAgi(bool augments) const
int EQEmu::ItemInstance::GetItemAgi(bool augments) const
{
int total = 0;
const auto item = GetItem();
@@ -1357,7 +1357,7 @@ int EQ::ItemInstance::GetItemAgi(bool augments) const
return total;
}
int EQ::ItemInstance::GetItemInt(bool augments) const
int EQEmu::ItemInstance::GetItemInt(bool augments) const
{
int total = 0;
const auto item = GetItem();
@@ -1371,7 +1371,7 @@ int EQ::ItemInstance::GetItemInt(bool augments) const
return total;
}
int EQ::ItemInstance::GetItemWis(bool augments) const
int EQEmu::ItemInstance::GetItemWis(bool augments) const
{
int total = 0;
const auto item = GetItem();
@@ -1385,7 +1385,7 @@ int EQ::ItemInstance::GetItemWis(bool augments) const
return total;
}
int EQ::ItemInstance::GetItemCha(bool augments) const
int EQEmu::ItemInstance::GetItemCha(bool augments) const
{
int total = 0;
const auto item = GetItem();
@@ -1399,7 +1399,7 @@ int EQ::ItemInstance::GetItemCha(bool augments) const
return total;
}
int EQ::ItemInstance::GetItemMR(bool augments) const
int EQEmu::ItemInstance::GetItemMR(bool augments) const
{
int total = 0;
const auto item = GetItem();
@@ -1413,7 +1413,7 @@ int EQ::ItemInstance::GetItemMR(bool augments) const
return total;
}
int EQ::ItemInstance::GetItemFR(bool augments) const
int EQEmu::ItemInstance::GetItemFR(bool augments) const
{
int total = 0;
const auto item = GetItem();
@@ -1427,7 +1427,7 @@ int EQ::ItemInstance::GetItemFR(bool augments) const
return total;
}
int EQ::ItemInstance::GetItemCR(bool augments) const
int EQEmu::ItemInstance::GetItemCR(bool augments) const
{
int total = 0;
const auto item = GetItem();
@@ -1441,7 +1441,7 @@ int EQ::ItemInstance::GetItemCR(bool augments) const
return total;
}
int EQ::ItemInstance::GetItemPR(bool augments) const
int EQEmu::ItemInstance::GetItemPR(bool augments) const
{
int total = 0;
const auto item = GetItem();
@@ -1455,7 +1455,7 @@ int EQ::ItemInstance::GetItemPR(bool augments) const
return total;
}
int EQ::ItemInstance::GetItemDR(bool augments) const
int EQEmu::ItemInstance::GetItemDR(bool augments) const
{
int total = 0;
const auto item = GetItem();
@@ -1469,7 +1469,7 @@ int EQ::ItemInstance::GetItemDR(bool augments) const
return total;
}
int EQ::ItemInstance::GetItemCorrup(bool augments) const
int EQEmu::ItemInstance::GetItemCorrup(bool augments) const
{
int total = 0;
const auto item = GetItem();
@@ -1483,7 +1483,7 @@ int EQ::ItemInstance::GetItemCorrup(bool augments) const
return total;
}
int EQ::ItemInstance::GetItemHeroicStr(bool augments) const
int EQEmu::ItemInstance::GetItemHeroicStr(bool augments) const
{
int total = 0;
const auto item = GetItem();
@@ -1497,7 +1497,7 @@ int EQ::ItemInstance::GetItemHeroicStr(bool augments) const
return total;
}
int EQ::ItemInstance::GetItemHeroicSta(bool augments) const
int EQEmu::ItemInstance::GetItemHeroicSta(bool augments) const
{
int total = 0;
const auto item = GetItem();
@@ -1511,7 +1511,7 @@ int EQ::ItemInstance::GetItemHeroicSta(bool augments) const
return total;
}
int EQ::ItemInstance::GetItemHeroicDex(bool augments) const
int EQEmu::ItemInstance::GetItemHeroicDex(bool augments) const
{
int total = 0;
const auto item = GetItem();
@@ -1525,7 +1525,7 @@ int EQ::ItemInstance::GetItemHeroicDex(bool augments) const
return total;
}
int EQ::ItemInstance::GetItemHeroicAgi(bool augments) const
int EQEmu::ItemInstance::GetItemHeroicAgi(bool augments) const
{
int total = 0;
const auto item = GetItem();
@@ -1539,7 +1539,7 @@ int EQ::ItemInstance::GetItemHeroicAgi(bool augments) const
return total;
}
int EQ::ItemInstance::GetItemHeroicInt(bool augments) const
int EQEmu::ItemInstance::GetItemHeroicInt(bool augments) const
{
int total = 0;
const auto item = GetItem();
@@ -1553,7 +1553,7 @@ int EQ::ItemInstance::GetItemHeroicInt(bool augments) const
return total;
}
int EQ::ItemInstance::GetItemHeroicWis(bool augments) const
int EQEmu::ItemInstance::GetItemHeroicWis(bool augments) const
{
int total = 0;
const auto item = GetItem();
@@ -1567,7 +1567,7 @@ int EQ::ItemInstance::GetItemHeroicWis(bool augments) const
return total;
}
int EQ::ItemInstance::GetItemHeroicCha(bool augments) const
int EQEmu::ItemInstance::GetItemHeroicCha(bool augments) const
{
int total = 0;
const auto item = GetItem();
@@ -1581,7 +1581,7 @@ int EQ::ItemInstance::GetItemHeroicCha(bool augments) const
return total;
}
int EQ::ItemInstance::GetItemHeroicMR(bool augments) const
int EQEmu::ItemInstance::GetItemHeroicMR(bool augments) const
{
int total = 0;
const auto item = GetItem();
@@ -1595,7 +1595,7 @@ int EQ::ItemInstance::GetItemHeroicMR(bool augments) const
return total;
}
int EQ::ItemInstance::GetItemHeroicFR(bool augments) const
int EQEmu::ItemInstance::GetItemHeroicFR(bool augments) const
{
int total = 0;
const auto item = GetItem();
@@ -1609,7 +1609,7 @@ int EQ::ItemInstance::GetItemHeroicFR(bool augments) const
return total;
}
int EQ::ItemInstance::GetItemHeroicCR(bool augments) const
int EQEmu::ItemInstance::GetItemHeroicCR(bool augments) const
{
int total = 0;
const auto item = GetItem();
@@ -1623,7 +1623,7 @@ int EQ::ItemInstance::GetItemHeroicCR(bool augments) const
return total;
}
int EQ::ItemInstance::GetItemHeroicPR(bool augments) const
int EQEmu::ItemInstance::GetItemHeroicPR(bool augments) const
{
int total = 0;
const auto item = GetItem();
@@ -1637,7 +1637,7 @@ int EQ::ItemInstance::GetItemHeroicPR(bool augments) const
return total;
}
int EQ::ItemInstance::GetItemHeroicDR(bool augments) const
int EQEmu::ItemInstance::GetItemHeroicDR(bool augments) const
{
int total = 0;
const auto item = GetItem();
@@ -1651,7 +1651,7 @@ int EQ::ItemInstance::GetItemHeroicDR(bool augments) const
return total;
}
int EQ::ItemInstance::GetItemHeroicCorrup(bool augments) const
int EQEmu::ItemInstance::GetItemHeroicCorrup(bool augments) const
{
int total = 0;
const auto item = GetItem();
@@ -1665,7 +1665,7 @@ int EQ::ItemInstance::GetItemHeroicCorrup(bool augments) const
return total;
}
int EQ::ItemInstance::GetItemHaste(bool augments) const
int EQEmu::ItemInstance::GetItemHaste(bool augments) const
{
int total = 0;
const auto item = GetItem();
+6 -6
View File
@@ -38,7 +38,7 @@ class EvolveInfo; // Stores information about an evolving item family
#include <map>
// Specifies usage type for item inside EQ::ItemInstance
// Specifies usage type for item inside EQEmu::ItemInstance
enum ItemInstTypes
{
ItemInstNormal = 0,
@@ -54,11 +54,11 @@ typedef enum {
class SharedDatabase;
// ########################################
// Class: EQ::ItemInstance
// Class: EQEmu::ItemInstance
// Base class for an instance of an item
// An item instance encapsulates item data + data specific
// to an item instance (includes dye, augments, charges, etc)
namespace EQ
namespace EQEmu
{
class InventoryProfile;
@@ -222,7 +222,7 @@ namespace EQ
inline int32 GetSerialNumber() const { return m_SerialNumber; }
inline void SetSerialNumber(int32 id) { m_SerialNumber = id; }
std::map<std::string, ::Timer>& GetTimers() { return m_timers; }
std::map<std::string, Timer>& GetTimers() { return m_timers; }
void SetTimer(std::string name, uint32 time);
void StopTimer(std::string name);
void ClearTimers();
@@ -316,13 +316,13 @@ namespace EQ
// Items inside of this item (augs or contents);
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, ::Timer> m_timers;
std::map<std::string, Timer> m_timers;
};
}
class EvolveInfo {
public:
friend class EQ::ItemInstance;
friend class EQEmu::ItemInstance;
//temporary
uint16 LvlKills[9];
uint32 FirstItem;
+5 -5
View File
@@ -22,7 +22,7 @@
#include <string.h>
uint8 EQ::lightsource::TypeToLevel(uint8 light_type)
uint8 EQEmu::lightsource::TypeToLevel(uint8 light_type)
{
switch (light_type) {
case LightTypeGlobeOfStars:
@@ -55,7 +55,7 @@ uint8 EQ::lightsource::TypeToLevel(uint8 light_type)
}
}
bool EQ::lightsource::IsLevelGreater(uint8 left_type, uint8 right_type)
bool EQEmu::lightsource::IsLevelGreater(uint8 left_type, uint8 right_type)
{
static const uint8 light_levels[LightTypeCount] = {
LightLevelUnlit, /* LightTypeNone */
@@ -82,17 +82,17 @@ bool EQ::lightsource::IsLevelGreater(uint8 left_type, uint8 right_type)
return (light_levels[left_type] > light_levels[right_type]);
}
EQ::LightSource_Struct::LightSource_Struct()
EQEmu::LightSource_Struct::LightSource_Struct()
{
Clear();
}
void EQ::LightSource_Struct::Clear()
void EQEmu::LightSource_Struct::Clear()
{
memset(&Slot, 0, (sizeof(uint8) * lightsource::LightCount));
}
void EQ::LightSourceProfile::Clear()
void EQEmu::LightSourceProfile::Clear()
{
Type.Clear();
Level.Clear();
+1 -1
View File
@@ -23,7 +23,7 @@
#include "types.h"
namespace EQ
namespace EQEmu
{
namespace lightsource {
enum LightSlot {
+24 -24
View File
@@ -20,7 +20,7 @@
#include "memory_buffer.h"
EQ::MemoryBuffer::MemoryBuffer()
EQEmu::MemoryBuffer::MemoryBuffer()
{
buffer_ = nullptr;
size_ = 0;
@@ -29,7 +29,7 @@ EQ::MemoryBuffer::MemoryBuffer()
write_pos_ = 0;
}
EQ::MemoryBuffer::MemoryBuffer(size_t sz)
EQEmu::MemoryBuffer::MemoryBuffer(size_t sz)
{
buffer_ = nullptr;
size_ = 0;
@@ -39,7 +39,7 @@ EQ::MemoryBuffer::MemoryBuffer(size_t sz)
Resize(sz);
}
EQ::MemoryBuffer::MemoryBuffer(const MemoryBuffer &other)
EQEmu::MemoryBuffer::MemoryBuffer(const MemoryBuffer &other)
{
if(other.capacity_) {
buffer_ = new uchar[other.capacity_];
@@ -54,7 +54,7 @@ EQ::MemoryBuffer::MemoryBuffer(const MemoryBuffer &other)
read_pos_ = other.read_pos_;
}
EQ::MemoryBuffer::MemoryBuffer(MemoryBuffer &&other)
EQEmu::MemoryBuffer::MemoryBuffer(MemoryBuffer &&other)
{
uchar *tbuf = other.buffer_;
size_t tsz = other.size_;
@@ -75,7 +75,7 @@ EQ::MemoryBuffer::MemoryBuffer(MemoryBuffer &&other)
read_pos_ = tread_pos;
}
EQ::MemoryBuffer& EQ::MemoryBuffer::operator=(const MemoryBuffer &other)
EQEmu::MemoryBuffer& EQEmu::MemoryBuffer::operator=(const MemoryBuffer &other)
{
if(this == &other) {
return *this;
@@ -100,7 +100,7 @@ EQ::MemoryBuffer& EQ::MemoryBuffer::operator=(const MemoryBuffer &other)
return *this;
}
EQ::MemoryBuffer& EQ::MemoryBuffer::operator=(MemoryBuffer &&other)
EQEmu::MemoryBuffer& EQEmu::MemoryBuffer::operator=(MemoryBuffer &&other)
{
uchar *tbuf = other.buffer_;
size_t tsz = other.size_;
@@ -122,7 +122,7 @@ EQ::MemoryBuffer& EQ::MemoryBuffer::operator=(MemoryBuffer &&other)
return *this;
}
EQ::MemoryBuffer& EQ::MemoryBuffer::operator+=(const MemoryBuffer &rhs)
EQEmu::MemoryBuffer& EQEmu::MemoryBuffer::operator+=(const MemoryBuffer &rhs)
{
if(!rhs.buffer_) {
return *this;
@@ -142,52 +142,52 @@ EQ::MemoryBuffer& EQ::MemoryBuffer::operator+=(const MemoryBuffer &rhs)
return *this;
}
EQ::MemoryBuffer::~MemoryBuffer()
EQEmu::MemoryBuffer::~MemoryBuffer()
{
Clear();
}
uchar& EQ::MemoryBuffer::operator[](size_t pos)
uchar& EQEmu::MemoryBuffer::operator[](size_t pos)
{
return buffer_[pos];
}
const uchar& EQ::MemoryBuffer::operator[](size_t pos) const
const uchar& EQEmu::MemoryBuffer::operator[](size_t pos) const
{
return buffer_[pos];
}
bool EQ::MemoryBuffer::Empty()
bool EQEmu::MemoryBuffer::Empty()
{
return size_ == 0;
}
bool EQ::MemoryBuffer::Empty() const
bool EQEmu::MemoryBuffer::Empty() const
{
return size_ == 0;
}
size_t EQ::MemoryBuffer::Size()
size_t EQEmu::MemoryBuffer::Size()
{
return size_;
}
size_t EQ::MemoryBuffer::Size() const
size_t EQEmu::MemoryBuffer::Size() const
{
return size_;
}
size_t EQ::MemoryBuffer::Capacity()
size_t EQEmu::MemoryBuffer::Capacity()
{
return capacity_;
}
size_t EQ::MemoryBuffer::Capacity() const
size_t EQEmu::MemoryBuffer::Capacity() const
{
return capacity_;
}
void EQ::MemoryBuffer::Resize(size_t sz)
void EQEmu::MemoryBuffer::Resize(size_t sz)
{
if(!buffer_) {
size_t new_size = sz + 64;
@@ -213,7 +213,7 @@ void EQ::MemoryBuffer::Resize(size_t sz)
}
}
void EQ::MemoryBuffer::Clear()
void EQEmu::MemoryBuffer::Clear()
{
if(buffer_) {
delete[] buffer_;
@@ -226,14 +226,14 @@ void EQ::MemoryBuffer::Clear()
read_pos_ = 0;
}
void EQ::MemoryBuffer::Zero()
void EQEmu::MemoryBuffer::Zero()
{
if(buffer_) {
memset(buffer_, 0, capacity_);
}
}
void EQ::MemoryBuffer::Write(const char *val, size_t len)
void EQEmu::MemoryBuffer::Write(const char *val, size_t len)
{
size_t size_needed = write_pos_ + len;
Resize(size_needed);
@@ -242,20 +242,20 @@ void EQ::MemoryBuffer::Write(const char *val, size_t len)
write_pos_ += len;
}
void EQ::MemoryBuffer::Read(uchar *buf, size_t len)
void EQEmu::MemoryBuffer::Read(uchar *buf, size_t len)
{
memcpy(buf, &buffer_[read_pos_], len);
read_pos_ += len;
}
void EQ::MemoryBuffer::Read(char *str)
void EQEmu::MemoryBuffer::Read(char *str)
{
size_t len = strlen((const char*)&buffer_[read_pos_]);
memcpy(str, &buffer_[read_pos_], len);
read_pos_ += len;
}
void EQ::OutBuffer::overwrite(OutBuffer::pos_type position, const char *_Str, std::streamsize _Count)
void EQEmu::OutBuffer::overwrite(OutBuffer::pos_type position, const char *_Str, std::streamsize _Count)
{
auto last_pos = tellp();
seekp(position);
@@ -263,7 +263,7 @@ void EQ::OutBuffer::overwrite(OutBuffer::pos_type position, const char *_Str, st
seekp(last_pos);
}
uchar* EQ::OutBuffer::detach()
uchar* EQEmu::OutBuffer::detach()
{
size_t buffer_size = tellp();
if (buffer_size == 0)
+1 -1
View File
@@ -28,7 +28,7 @@
#include <sstream>
namespace EQ
namespace EQEmu
{
class MemoryBuffer {
public:
+1 -1
View File
@@ -33,7 +33,7 @@
#include <sys/stat.h>
#endif
namespace EQ {
namespace EQEmu {
struct MemoryMappedFile::Implementation {
#ifdef _WINDOWS
+1 -1
View File
@@ -22,7 +22,7 @@
#include <string>
#include "types.h"
namespace EQ {
namespace EQEmu {
//! Memory Backed Shared Memory
/*!
+6 -8
View File
@@ -605,8 +605,6 @@ void EQ::Net::DaybreakConnection::ProcessDecodedPacket(const Packet &p)
ProcessDecodedPacket(StaticPacket(current, subpacket_length));
current += subpacket_length;
}
break;
}
case OP_SessionRequest:
@@ -1103,7 +1101,7 @@ void EQ::Net::DaybreakConnection::ProcessResend(int stream)
InternalBufferedSend(p);
entry.second.last_sent = now;
entry.second.times_resent++;
entry.second.resend_delay = EQ::Clamp(entry.second.resend_delay * 2, m_owner->m_options.resend_delay_min, m_owner->m_options.resend_delay_max);
entry.second.resend_delay = EQEmu::Clamp(entry.second.resend_delay * 2, m_owner->m_options.resend_delay_min, m_owner->m_options.resend_delay_max);
resends++;
}
}
@@ -1132,7 +1130,7 @@ void EQ::Net::DaybreakConnection::ProcessResend(int stream)
InternalBufferedSend(p);
entry.second.last_sent = now;
entry.second.times_resent++;
entry.second.resend_delay = EQ::Clamp(entry.second.resend_delay * 2, m_owner->m_options.resend_delay_min, m_owner->m_options.resend_delay_max);
entry.second.resend_delay = EQEmu::Clamp(entry.second.resend_delay * 2, m_owner->m_options.resend_delay_min, m_owner->m_options.resend_delay_max);
resends++;
}
}
@@ -1184,7 +1182,7 @@ void EQ::Net::DaybreakConnection::OutOfOrderAck(int stream, uint16_t seq)
void EQ::Net::DaybreakConnection::UpdateDataBudget(double budget_add)
{
auto outgoing_data_rate = m_owner->m_options.outgoing_data_rate;
m_outgoing_budget = EQ::ClampUpper(m_outgoing_budget + budget_add, outgoing_data_rate);
m_outgoing_budget = EQEmu::ClampUpper(m_outgoing_budget + budget_add, outgoing_data_rate);
}
void EQ::Net::DaybreakConnection::SendAck(int stream_id, uint16_t seq)
@@ -1405,7 +1403,7 @@ void EQ::Net::DaybreakConnection::InternalQueuePacket(Packet &p, int stream_id,
sent.last_sent = Clock::now();
sent.first_sent = Clock::now();
sent.times_resent = 0;
sent.resend_delay = EQ::Clamp(
sent.resend_delay = EQEmu::Clamp(
static_cast<size_t>((m_rolling_ping * m_owner->m_options.resend_delay_factor) + m_owner->m_options.resend_delay_ms),
m_owner->m_options.resend_delay_min,
m_owner->m_options.resend_delay_max);
@@ -1437,7 +1435,7 @@ void EQ::Net::DaybreakConnection::InternalQueuePacket(Packet &p, int stream_id,
sent.last_sent = Clock::now();
sent.first_sent = Clock::now();
sent.times_resent = 0;
sent.resend_delay = EQ::Clamp(
sent.resend_delay = EQEmu::Clamp(
static_cast<size_t>((m_rolling_ping * m_owner->m_options.resend_delay_factor) + m_owner->m_options.resend_delay_ms),
m_owner->m_options.resend_delay_min,
m_owner->m_options.resend_delay_max);
@@ -1461,7 +1459,7 @@ void EQ::Net::DaybreakConnection::InternalQueuePacket(Packet &p, int stream_id,
sent.last_sent = Clock::now();
sent.first_sent = Clock::now();
sent.times_resent = 0;
sent.resend_delay = EQ::Clamp(
sent.resend_delay = EQEmu::Clamp(
static_cast<size_t>((m_rolling_ping * m_owner->m_options.resend_delay_factor) + m_owner->m_options.resend_delay_ms),
m_owner->m_options.resend_delay_min,
m_owner->m_options.resend_delay_max);
+1 -1
View File
@@ -318,7 +318,7 @@ namespace EQ
void Attach(uv_loop_t *loop);
void Detach();
EQ::Random m_rand;
EQEmu::Random m_rand;
uv_timer_t m_timer;
uv_udp_t m_socket;
uv_loop_t *m_attached;
+178 -185
View File
@@ -45,7 +45,7 @@ namespace RoF
static OpcodeManager *opcodes = nullptr;
static Strategy struct_strategy;
void SerializeItem(EQ::OutBuffer& ob, const EQ::ItemInstance *inst, int16 slot_id, uint8 depth, ItemPacketType packet_type);
void SerializeItem(EQEmu::OutBuffer& ob, const EQEmu::ItemInstance *inst, int16 slot_id, uint8 depth, ItemPacketType packet_type);
// server to client inventory location converters
static inline structs::InventorySlot_Struct ServerToRoFSlot(uint32 server_slot);
@@ -65,8 +65,8 @@ namespace RoF
// client to server say link converter
static inline void RoFToServerSayLink(std::string& serverSayLink, const std::string& rofSayLink);
static inline spells::CastingSlot ServerToRoFCastingSlot(EQ::spells::CastingSlot slot);
static inline EQ::spells::CastingSlot RoFToServerCastingSlot(spells::CastingSlot slot);
static inline spells::CastingSlot ServerToRoFCastingSlot(EQEmu::spells::CastingSlot slot);
static inline EQEmu::spells::CastingSlot RoFToServerCastingSlot(spells::CastingSlot slot);
static inline int ServerToRoFBuffSlot(int index);
static inline int RoFToServerBuffSlot(int index);
@@ -147,9 +147,9 @@ namespace RoF
return(r);
}
const EQ::versions::ClientVersion Strategy::ClientVersion() const
const EQEmu::versions::ClientVersion Strategy::ClientVersion() const
{
return EQ::versions::ClientVersion::RoF;
return EQEmu::versions::ClientVersion::RoF;
}
#include "ss_define.h"
@@ -193,7 +193,7 @@ namespace RoF
eq->unknown000 = 1;
OUT(npcid);
eq->inventory_slot = ServerToRoFTypelessSlot(emu->slot, EQ::invtype::typePossessions);
eq->inventory_slot = ServerToRoFTypelessSlot(emu->slot, EQEmu::invtype::typePossessions);
OUT(charges);
OUT(sell_price);
@@ -246,7 +246,7 @@ namespace RoF
SETUP_DIRECT_ENCODE(AltCurrencySellItem_Struct, structs::AltCurrencySellItem_Struct);
OUT(merchant_entity_id);
eq->inventory_slot = ServerToRoFTypelessSlot(emu->slot_id, EQ::invtype::typePossessions);
eq->inventory_slot = ServerToRoFTypelessSlot(emu->slot_id, EQEmu::invtype::typePossessions);
OUT(charges);
OUT(cost);
@@ -270,7 +270,7 @@ namespace RoF
ENCODE_LENGTH_EXACT(ApplyPoison_Struct);
SETUP_DIRECT_ENCODE(ApplyPoison_Struct, structs::ApplyPoison_Struct);
eq->inventory_slot = ServerToRoFTypelessSlot(emu->inventorySlot, EQ::invtype::typePossessions);
eq->inventory_slot = ServerToRoFTypelessSlot(emu->inventorySlot, EQEmu::invtype::typePossessions);
OUT(success);
FINISH_ENCODE();
@@ -502,7 +502,7 @@ namespace RoF
ENCODE_LENGTH_EXACT(CastSpell_Struct);
SETUP_DIRECT_ENCODE(CastSpell_Struct, structs::CastSpell_Struct);
eq->slot = static_cast<uint32>(ServerToRoFCastingSlot(static_cast<EQ::spells::CastingSlot>(emu->slot)));
eq->slot = static_cast<uint32>(ServerToRoFCastingSlot(static_cast<EQEmu::spells::CastingSlot>(emu->slot)));
OUT(spell_id);
eq->inventory_slot = ServerToRoFSlot(emu->inventoryslot);
@@ -570,24 +570,24 @@ namespace RoF
//store away the emu struct
uchar* __emu_buffer = in->pBuffer;
int item_count = in->size / sizeof(EQ::InternalSerializedItem_Struct);
if (!item_count || (in->size % sizeof(EQ::InternalSerializedItem_Struct)) != 0) {
int item_count = in->size / sizeof(EQEmu::InternalSerializedItem_Struct);
if (!item_count || (in->size % sizeof(EQEmu::InternalSerializedItem_Struct)) != 0) {
Log(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(EQ::InternalSerializedItem_Struct));
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(EQEmu::InternalSerializedItem_Struct));
delete in;
return;
}
EQ::InternalSerializedItem_Struct* eq = (EQ::InternalSerializedItem_Struct*)in->pBuffer;
EQEmu::InternalSerializedItem_Struct* eq = (EQEmu::InternalSerializedItem_Struct*)in->pBuffer;
EQ::OutBuffer ob;
EQ::OutBuffer::pos_type last_pos = ob.tellp();
EQEmu::OutBuffer ob;
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
ob.write((const char*)&item_count, sizeof(uint32));
for (int index = 0; index < item_count; ++index, ++eq) {
SerializeItem(ob, (const EQ::ItemInstance*)eq->inst, eq->slot_id, 0, ItemPacketCharInventory);
SerializeItem(ob, (const EQEmu::ItemInstance*)eq->inst, eq->slot_id, 0, ItemPacketCharInventory);
if (ob.tellp() == last_pos)
LogNetcode("RoF::ENCODE(OP_CharInventory) Serialization failed on item slot [{}] during OP_CharInventory. Item skipped", eq->slot_id);
@@ -1513,14 +1513,14 @@ namespace RoF
uchar* __emu_buffer = in->pBuffer;
ItemPacket_Struct* old_item_pkt = (ItemPacket_Struct*)__emu_buffer;
EQ::InternalSerializedItem_Struct* int_struct = (EQ::InternalSerializedItem_Struct*)(&__emu_buffer[4]);
EQEmu::InternalSerializedItem_Struct* int_struct = (EQEmu::InternalSerializedItem_Struct*)(&__emu_buffer[4]);
EQ::OutBuffer ob;
EQ::OutBuffer::pos_type last_pos = ob.tellp();
EQEmu::OutBuffer ob;
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
ob.write((const char*)__emu_buffer, 4);
SerializeItem(ob, (const EQ::ItemInstance*)int_struct->inst, int_struct->slot_id, 0, old_item_pkt->PacketType);
SerializeItem(ob, (const EQEmu::ItemInstance*)int_struct->inst, int_struct->slot_id, 0, old_item_pkt->PacketType);
if (ob.tellp() == last_pos) {
LogNetcode("RoF::ENCODE(OP_ItemPacket) Serialization failed on item slot [{}]", int_struct->slot_id);
delete in;
@@ -1957,7 +1957,7 @@ namespace RoF
outapp->WriteUInt32(22); // Equipment count
for (int r = EQ::textures::textureBegin; r < EQ::textures::materialCount; r++)
for (int r = EQEmu::textures::textureBegin; r < EQEmu::textures::materialCount; r++)
{
outapp->WriteUInt32(emu->item_material.Slot[r].Material);
outapp->WriteUInt32(0);
@@ -1977,9 +1977,9 @@ namespace RoF
outapp->WriteUInt32(0);
}
outapp->WriteUInt32(EQ::textures::materialCount); // Equipment2 count
outapp->WriteUInt32(EQEmu::textures::materialCount); // Equipment2 count
for (int r = EQ::textures::textureBegin; r < EQ::textures::materialCount; r++)
for (int r = EQEmu::textures::textureBegin; r < EQEmu::textures::materialCount; r++)
{
outapp->WriteUInt32(0);
outapp->WriteUInt32(0);
@@ -1988,7 +1988,7 @@ namespace RoF
outapp->WriteUInt32(0);
}
outapp->WriteUInt32(EQ::textures::materialCount); // Tint Count
outapp->WriteUInt32(EQEmu::textures::materialCount); // Tint Count
for (int r = 0; r < 7; r++)
{
@@ -1998,7 +1998,7 @@ namespace RoF
outapp->WriteUInt32(0);
outapp->WriteUInt32(0);
outapp->WriteUInt32(EQ::textures::materialCount); // Tint2 Count
outapp->WriteUInt32(EQEmu::textures::materialCount); // Tint2 Count
for (int r = 0; r < 7; r++)
{
@@ -2127,7 +2127,7 @@ namespace RoF
outapp->WriteUInt32(spells::SPELLBOOK_SIZE); // Spellbook slots
if (spells::SPELLBOOK_SIZE <= EQ::spells::SPELLBOOK_SIZE) {
if (spells::SPELLBOOK_SIZE <= EQEmu::spells::SPELLBOOK_SIZE) {
for (uint32 r = 0; r < spells::SPELLBOOK_SIZE; r++) {
if (emu->spell_book[r] <= spells::SPELL_ID_MAX)
outapp->WriteUInt32(emu->spell_book[r]);
@@ -2136,33 +2136,33 @@ namespace RoF
}
}
else {
for (uint32 r = 0; r < EQ::spells::SPELLBOOK_SIZE; r++) {
for (uint32 r = 0; r < EQEmu::spells::SPELLBOOK_SIZE; r++) {
if (emu->spell_book[r] <= spells::SPELL_ID_MAX)
outapp->WriteUInt32(emu->spell_book[r]);
else
outapp->WriteUInt32(0xFFFFFFFFU);
}
// invalidate the rest of the spellbook slots
for (uint32 r = EQ::spells::SPELLBOOK_SIZE; r < spells::SPELLBOOK_SIZE; r++) {
for (uint32 r = EQEmu::spells::SPELLBOOK_SIZE; r < spells::SPELLBOOK_SIZE; r++) {
outapp->WriteUInt32(0xFFFFFFFFU);
}
}
outapp->WriteUInt32(spells::SPELL_GEM_COUNT); // Memorised spell slots
for (uint32 r = 0; r < EQ::spells::SPELL_GEM_COUNT; r++) // first 12
for (uint32 r = 0; r < EQEmu::spells::SPELL_GEM_COUNT; r++) // first 12
{
outapp->WriteUInt32(emu->mem_spells[r]);
}
// zeroes for the rest of the slots -- the other 4 which don't work at all!
for (uint32 r = 0; r < spells::SPELL_GEM_COUNT - EQ::spells::SPELL_GEM_COUNT; r++)
for (uint32 r = 0; r < spells::SPELL_GEM_COUNT - EQEmu::spells::SPELL_GEM_COUNT; r++)
{
outapp->WriteUInt32(0xFFFFFFFFU);
}
outapp->WriteUInt32(13); // gem refresh count
for (uint32 r = 0; r < EQ::spells::SPELL_GEM_COUNT; r++)
for (uint32 r = 0; r < EQEmu::spells::SPELL_GEM_COUNT; r++)
{
outapp->WriteUInt32(emu->spellSlotRefresh[r]); // spell gem refresh
}
@@ -2251,7 +2251,7 @@ namespace RoF
outapp->WriteUInt32(profile::BANDOLIERS_SIZE);
// Copy bandoliers where server and client indices converge
for (uint32 r = 0; r < EQ::profile::BANDOLIERS_SIZE && r < profile::BANDOLIERS_SIZE; ++r) {
for (uint32 r = 0; r < EQEmu::profile::BANDOLIERS_SIZE && r < profile::BANDOLIERS_SIZE; ++r) {
outapp->WriteString(emu->bandoliers[r].Name);
for (uint32 j = 0; j < profile::BANDOLIER_ITEM_COUNT; ++j) { // Will need adjusting if 'server != client' is ever true
outapp->WriteString(emu->bandoliers[r].Items[j].Name);
@@ -2266,7 +2266,7 @@ namespace RoF
}
}
// Nullify bandoliers where server and client indices diverge, with a client bias
for (uint32 r = EQ::profile::BANDOLIERS_SIZE; r < profile::BANDOLIERS_SIZE; ++r) {
for (uint32 r = EQEmu::profile::BANDOLIERS_SIZE; r < profile::BANDOLIERS_SIZE; ++r) {
outapp->WriteString("");
for (uint32 j = 0; j < profile::BANDOLIER_ITEM_COUNT; ++j) { // Will need adjusting if 'server != client' is ever true
outapp->WriteString("");
@@ -2278,7 +2278,7 @@ namespace RoF
outapp->WriteUInt32(profile::POTION_BELT_SIZE);
// Copy potion belt where server and client indices converge
for (uint32 r = 0; r < EQ::profile::POTION_BELT_SIZE && r < profile::POTION_BELT_SIZE; ++r) {
for (uint32 r = 0; r < EQEmu::profile::POTION_BELT_SIZE && r < profile::POTION_BELT_SIZE; ++r) {
outapp->WriteString(emu->potionbelt.Items[r].Name);
outapp->WriteUInt32(emu->potionbelt.Items[r].ID);
if (emu->potionbelt.Items[r].Icon) {
@@ -2290,7 +2290,7 @@ namespace RoF
}
}
// Nullify potion belt where server and client indices diverge, with a client bias
for (uint32 r = EQ::profile::POTION_BELT_SIZE; r < profile::POTION_BELT_SIZE; ++r) {
for (uint32 r = EQEmu::profile::POTION_BELT_SIZE; r < profile::POTION_BELT_SIZE; ++r) {
outapp->WriteString("");
outapp->WriteUInt32(0);
outapp->WriteSInt32(-1);
@@ -2412,9 +2412,9 @@ namespace RoF
outapp->WriteUInt8(0); // Unknown
outapp->WriteUInt8(0); // Unknown
outapp->WriteUInt32(EQ::invtype::TRIBUTE_SIZE);
outapp->WriteUInt32(EQEmu::invtype::TRIBUTE_SIZE);
for (uint32 r = 0; r < EQ::invtype::TRIBUTE_SIZE; r++)
for (uint32 r = 0; r < EQEmu::invtype::TRIBUTE_SIZE; r++)
{
outapp->WriteUInt32(emu->tributes[r].tribute);
outapp->WriteUInt32(emu->tributes[r].tier);
@@ -2949,7 +2949,7 @@ namespace RoF
eq_cse->Gender = emu_cse->Gender;
eq_cse->Face = emu_cse->Face;
for (int equip_index = 0; equip_index < EQ::textures::materialCount; equip_index++) {
for (int equip_index = 0; equip_index < EQEmu::textures::materialCount; equip_index++) {
eq_cse->Equip[equip_index].Material = emu_cse->Equip[equip_index].Material;
eq_cse->Equip[equip_index].Unknown1 = emu_cse->Equip[equip_index].Unknown1;
eq_cse->Equip[equip_index].EliteMaterial = emu_cse->Equip[equip_index].EliteModel;
@@ -3066,7 +3066,7 @@ namespace RoF
SETUP_DIRECT_ENCODE(Merchant_Purchase_Struct, structs::Merchant_Purchase_Struct);
OUT(npcid);
eq->inventory_slot = ServerToRoFTypelessSlot(emu->itemslot, EQ::invtype::typePossessions);
eq->inventory_slot = ServerToRoFTypelessSlot(emu->itemslot, EQEmu::invtype::typePossessions);
//OUT(itemslot);
OUT(quantity);
OUT(price);
@@ -3980,7 +3980,7 @@ namespace RoF
if ((emu->NPC == 0) || (emu->race <= 12) || (emu->race == 128) || (emu->race == 130) || (emu->race == 330) || (emu->race == 522))
{
for (k = EQ::textures::textureBegin; k < EQ::textures::materialCount; ++k)
for (k = EQEmu::textures::textureBegin; k < EQEmu::textures::materialCount; ++k)
{
{
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->equipment_tint.Slot[k].Color);
@@ -3989,7 +3989,7 @@ namespace RoF
structs::Texture_Struct *Equipment = (structs::Texture_Struct *)Buffer;
for (k = EQ::textures::textureBegin; k < EQ::textures::materialCount; k++) {
for (k = EQEmu::textures::textureBegin; k < EQEmu::textures::materialCount; k++) {
Equipment[k].Material = emu->equipment.Slot[k].Material;
Equipment[k].Unknown1 = emu->equipment.Slot[k].Unknown1;
Equipment[k].EliteMaterial = emu->equipment.Slot[k].EliteModel;
@@ -3997,7 +3997,7 @@ namespace RoF
Equipment[k].Material2 = emu->equipment.Slot[k].Unknown2;
}
Buffer += (sizeof(structs::Texture_Struct) * EQ::textures::materialCount);
Buffer += (sizeof(structs::Texture_Struct) * EQEmu::textures::materialCount);
}
else
{
@@ -4714,7 +4714,7 @@ namespace RoF
IN(item_id);
int r;
for (r = EQ::invaug::SOCKET_BEGIN; r <= EQ::invaug::SOCKET_END; r++) {
for (r = EQEmu::invaug::SOCKET_BEGIN; r <= EQEmu::invaug::SOCKET_END; r++) {
IN(augments[r]);
}
IN(link_hash);
@@ -4739,7 +4739,7 @@ namespace RoF
DECODE_LENGTH_EXACT(structs::LoadSpellSet_Struct);
SETUP_DIRECT_DECODE(LoadSpellSet_Struct, structs::LoadSpellSet_Struct);
for (unsigned int i = 0; i < EQ::spells::SPELL_GEM_COUNT; ++i)
for (unsigned int i = 0; i < EQEmu::spells::SPELL_GEM_COUNT; ++i)
{
if (eq->spell[i] == 0)
emu->spell[i] = 0xFFFFFFFF;
@@ -5091,9 +5091,9 @@ namespace RoF
return NextItemInstSerialNumber;
}
void SerializeItem(EQ::OutBuffer& ob, const EQ::ItemInstance *inst, int16 slot_id_in, uint8 depth, ItemPacketType packet_type)
void SerializeItem(EQEmu::OutBuffer& ob, const EQEmu::ItemInstance *inst, int16 slot_id_in, uint8 depth, ItemPacketType packet_type)
{
const EQ::ItemData *item = inst->GetUnscaledItem();
const EQEmu::ItemData *item = inst->GetUnscaledItem();
RoF::structs::ItemSerializationHeader hdr;
@@ -5156,7 +5156,7 @@ namespace RoF
uint32 hero_model = 0;
if (inst->GetOrnamentationIDFile()) {
hero_model = inst->GetOrnamentHeroModel(EQ::InventoryProfile::CalcMaterialFromSlot(slot_id_in));
hero_model = inst->GetOrnamentHeroModel(EQEmu::InventoryProfile::CalcMaterialFromSlot(slot_id_in));
char tmp[30];
memset(tmp, 0x0, 30);
@@ -5356,12 +5356,6 @@ namespace RoF
itbs.no_transfer = item->NoTransfer;
itbs.expendablearrow = item->ExpendableArrow;
// Done to hack older clients to label expendable fishing poles as such
// July 28th, 2018 patch
if (item->ItemType == EQ::item::ItemTypeFishingPole && item->SubType == 0) {
itbs.expendablearrow = 1;
}
itbs.unknown8 = 0;
itbs.unknown9 = 0;
itbs.unknown10 = 0;
@@ -5510,35 +5504,34 @@ namespace RoF
iqbs.HealAmt = item->HealAmt;
iqbs.SpellDmg = item->SpellDmg;
iqbs.Clairvoyance = item->Clairvoyance;
iqbs.SubType = item->SubType;
iqbs.unknown28 = 0;
iqbs.unknown30 = 0;
iqbs.unknown39 = 1;
ob.write((const char*)&iqbs, sizeof(RoF::structs::ItemQuaternaryBodyStruct));
EQ::OutBuffer::pos_type count_pos = ob.tellp();
EQEmu::OutBuffer::pos_type count_pos = ob.tellp();
uint32 subitem_count = 0;
ob.write((const char*)&subitem_count, sizeof(uint32));
// moved outside of loop since it is not modified within that scope
int16 SubSlotNumber = EQ::invbag::SLOT_INVALID;
int16 SubSlotNumber = EQEmu::invbag::SLOT_INVALID;
if (slot_id_in <= EQ::invslot::GENERAL_END && slot_id_in >= EQ::invslot::GENERAL_BEGIN)
SubSlotNumber = EQ::invbag::GENERAL_BAGS_BEGIN + ((slot_id_in - EQ::invslot::GENERAL_BEGIN) * EQ::invbag::SLOT_COUNT);
else if (slot_id_in == EQ::invslot::slotCursor)
SubSlotNumber = EQ::invbag::CURSOR_BAG_BEGIN;
else if (slot_id_in <= EQ::invslot::BANK_END && slot_id_in >= EQ::invslot::BANK_BEGIN)
SubSlotNumber = EQ::invbag::BANK_BAGS_BEGIN + ((slot_id_in - EQ::invslot::BANK_BEGIN) * EQ::invbag::SLOT_COUNT);
else if (slot_id_in <= EQ::invslot::SHARED_BANK_END && slot_id_in >= EQ::invslot::SHARED_BANK_BEGIN)
SubSlotNumber = EQ::invbag::SHARED_BANK_BAGS_BEGIN + ((slot_id_in - EQ::invslot::SHARED_BANK_BEGIN) * EQ::invbag::SLOT_COUNT);
if (slot_id_in <= EQEmu::invslot::GENERAL_END && slot_id_in >= EQEmu::invslot::GENERAL_BEGIN)
SubSlotNumber = EQEmu::invbag::GENERAL_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::GENERAL_BEGIN) * EQEmu::invbag::SLOT_COUNT);
else if (slot_id_in == EQEmu::invslot::slotCursor)
SubSlotNumber = EQEmu::invbag::CURSOR_BAG_BEGIN;
else if (slot_id_in <= EQEmu::invslot::BANK_END && slot_id_in >= EQEmu::invslot::BANK_BEGIN)
SubSlotNumber = EQEmu::invbag::BANK_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::BANK_BEGIN) * EQEmu::invbag::SLOT_COUNT);
else if (slot_id_in <= EQEmu::invslot::SHARED_BANK_END && slot_id_in >= EQEmu::invslot::SHARED_BANK_BEGIN)
SubSlotNumber = EQEmu::invbag::SHARED_BANK_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::SHARED_BANK_BEGIN) * EQEmu::invbag::SLOT_COUNT);
else
SubSlotNumber = slot_id_in; // not sure if this is the best way to handle this..leaving for now
if (SubSlotNumber != EQ::invbag::SLOT_INVALID) {
for (uint32 index = EQ::invbag::SLOT_BEGIN; index <= EQ::invbag::SLOT_END; ++index) {
EQ::ItemInstance* sub = inst->GetItem(index);
if (SubSlotNumber != EQEmu::invbag::SLOT_INVALID) {
for (uint32 index = EQEmu::invbag::SLOT_BEGIN; index <= EQEmu::invbag::SLOT_END; ++index) {
EQEmu::ItemInstance* sub = inst->GetItem(index);
if (!sub)
continue;
@@ -5564,77 +5557,77 @@ namespace RoF
RoFSlot.AugIndex = invaug::SOCKET_INVALID;
RoFSlot.Unknown01 = INULL;
uint32 temp_slot = (uint32) EQ::invslot::SLOT_INVALID;
uint32 temp_slot = (uint32) EQEmu::invslot::SLOT_INVALID;
if (server_slot < EQ::invtype::POSSESSIONS_SIZE) {
if (server_slot < EQEmu::invtype::POSSESSIONS_SIZE) {
RoFSlot.Type = invtype::typePossessions;
RoFSlot.Slot = server_slot;
}
else if (server_slot <= EQ::invbag::CURSOR_BAG_END && server_slot >= EQ::invbag::GENERAL_BAGS_BEGIN) {
temp_slot = server_slot - EQ::invbag::GENERAL_BAGS_BEGIN;
else if (server_slot <= EQEmu::invbag::CURSOR_BAG_END && server_slot >= EQEmu::invbag::GENERAL_BAGS_BEGIN) {
temp_slot = server_slot - EQEmu::invbag::GENERAL_BAGS_BEGIN;
RoFSlot.Type = invtype::typePossessions;
RoFSlot.Slot = invslot::GENERAL_BEGIN + (temp_slot / EQ::invbag::SLOT_COUNT);
RoFSlot.SubIndex = temp_slot - ((RoFSlot.Slot - invslot::GENERAL_BEGIN) * EQ::invbag::SLOT_COUNT);
RoFSlot.Slot = invslot::GENERAL_BEGIN + (temp_slot / EQEmu::invbag::SLOT_COUNT);
RoFSlot.SubIndex = temp_slot - ((RoFSlot.Slot - invslot::GENERAL_BEGIN) * EQEmu::invbag::SLOT_COUNT);
}
else if (server_slot <= EQ::invslot::TRIBUTE_END && server_slot >= EQ::invslot::TRIBUTE_BEGIN) {
else if (server_slot <= EQEmu::invslot::TRIBUTE_END && server_slot >= EQEmu::invslot::TRIBUTE_BEGIN) {
RoFSlot.Type = invtype::typeTribute;
RoFSlot.Slot = server_slot - EQ::invslot::TRIBUTE_BEGIN;
RoFSlot.Slot = server_slot - EQEmu::invslot::TRIBUTE_BEGIN;
}
else if (server_slot <= EQ::invslot::GUILD_TRIBUTE_END && server_slot >= EQ::invslot::GUILD_TRIBUTE_BEGIN) {
else if (server_slot <= EQEmu::invslot::GUILD_TRIBUTE_END && server_slot >= EQEmu::invslot::GUILD_TRIBUTE_BEGIN) {
RoFSlot.Type = invtype::typeGuildTribute;
RoFSlot.Slot = server_slot - EQ::invslot::GUILD_TRIBUTE_BEGIN;
RoFSlot.Slot = server_slot - EQEmu::invslot::GUILD_TRIBUTE_BEGIN;
}
else if (server_slot == EQ::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
else if (server_slot == EQEmu::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
RoFSlot.Type = invtype::typeWorld;
}
else if (server_slot <= EQ::invslot::BANK_END && server_slot >= EQ::invslot::BANK_BEGIN) {
else if (server_slot <= EQEmu::invslot::BANK_END && server_slot >= EQEmu::invslot::BANK_BEGIN) {
RoFSlot.Type = invtype::typeBank;
RoFSlot.Slot = server_slot - EQ::invslot::BANK_BEGIN;
RoFSlot.Slot = server_slot - EQEmu::invslot::BANK_BEGIN;
}
else if (server_slot <= EQ::invbag::BANK_BAGS_END && server_slot >= EQ::invbag::BANK_BAGS_BEGIN) {
temp_slot = server_slot - EQ::invbag::BANK_BAGS_BEGIN;
else if (server_slot <= EQEmu::invbag::BANK_BAGS_END && server_slot >= EQEmu::invbag::BANK_BAGS_BEGIN) {
temp_slot = server_slot - EQEmu::invbag::BANK_BAGS_BEGIN;
RoFSlot.Type = invtype::typeBank;
RoFSlot.Slot = temp_slot / EQ::invbag::SLOT_COUNT;
RoFSlot.SubIndex = temp_slot - (RoFSlot.Slot * EQ::invbag::SLOT_COUNT);
RoFSlot.Slot = temp_slot / EQEmu::invbag::SLOT_COUNT;
RoFSlot.SubIndex = temp_slot - (RoFSlot.Slot * EQEmu::invbag::SLOT_COUNT);
}
else if (server_slot <= EQ::invslot::SHARED_BANK_END && server_slot >= EQ::invslot::SHARED_BANK_BEGIN) {
else if (server_slot <= EQEmu::invslot::SHARED_BANK_END && server_slot >= EQEmu::invslot::SHARED_BANK_BEGIN) {
RoFSlot.Type = invtype::typeSharedBank;
RoFSlot.Slot = server_slot - EQ::invslot::SHARED_BANK_BEGIN;
RoFSlot.Slot = server_slot - EQEmu::invslot::SHARED_BANK_BEGIN;
}
else if (server_slot <= EQ::invbag::SHARED_BANK_BAGS_END && server_slot >= EQ::invbag::SHARED_BANK_BAGS_BEGIN) {
temp_slot = server_slot - EQ::invbag::SHARED_BANK_BAGS_BEGIN;
else if (server_slot <= EQEmu::invbag::SHARED_BANK_BAGS_END && server_slot >= EQEmu::invbag::SHARED_BANK_BAGS_BEGIN) {
temp_slot = server_slot - EQEmu::invbag::SHARED_BANK_BAGS_BEGIN;
RoFSlot.Type = invtype::typeSharedBank;
RoFSlot.Slot = temp_slot / EQ::invbag::SLOT_COUNT;
RoFSlot.SubIndex = temp_slot - (RoFSlot.Slot * EQ::invbag::SLOT_COUNT);
RoFSlot.Slot = temp_slot / EQEmu::invbag::SLOT_COUNT;
RoFSlot.SubIndex = temp_slot - (RoFSlot.Slot * EQEmu::invbag::SLOT_COUNT);
}
else if (server_slot <= EQ::invslot::TRADE_END && server_slot >= EQ::invslot::TRADE_BEGIN) {
else if (server_slot <= EQEmu::invslot::TRADE_END && server_slot >= EQEmu::invslot::TRADE_BEGIN) {
RoFSlot.Type = invtype::typeTrade;
RoFSlot.Slot = server_slot - EQ::invslot::TRADE_BEGIN;
RoFSlot.Slot = server_slot - EQEmu::invslot::TRADE_BEGIN;
}
else if (server_slot <= EQ::invbag::TRADE_BAGS_END && server_slot >= EQ::invbag::TRADE_BAGS_BEGIN) {
temp_slot = server_slot - EQ::invbag::TRADE_BAGS_BEGIN;
else if (server_slot <= EQEmu::invbag::TRADE_BAGS_END && server_slot >= EQEmu::invbag::TRADE_BAGS_BEGIN) {
temp_slot = server_slot - EQEmu::invbag::TRADE_BAGS_BEGIN;
RoFSlot.Type = invtype::typeTrade;
RoFSlot.Slot = temp_slot / EQ::invbag::SLOT_COUNT;
RoFSlot.SubIndex = temp_slot - (RoFSlot.Slot * EQ::invbag::SLOT_COUNT);
RoFSlot.Slot = temp_slot / EQEmu::invbag::SLOT_COUNT;
RoFSlot.SubIndex = temp_slot - (RoFSlot.Slot * EQEmu::invbag::SLOT_COUNT);
}
else if (server_slot <= EQ::invslot::WORLD_END && server_slot >= EQ::invslot::WORLD_BEGIN) {
else if (server_slot <= EQEmu::invslot::WORLD_END && server_slot >= EQEmu::invslot::WORLD_BEGIN) {
RoFSlot.Type = invtype::typeWorld;
RoFSlot.Slot = server_slot - EQ::invslot::WORLD_BEGIN;
RoFSlot.Slot = server_slot - EQEmu::invslot::WORLD_BEGIN;
}
Log(Logs::Detail,
@@ -5683,7 +5676,7 @@ namespace RoF
{
uint32 RoFSlot = invslot::SLOT_INVALID;
if (server_corpse_slot <= EQ::invslot::CORPSE_END && server_corpse_slot >= EQ::invslot::CORPSE_BEGIN) {
if (server_corpse_slot <= EQEmu::invslot::CORPSE_END && server_corpse_slot >= EQEmu::invslot::CORPSE_BEGIN) {
RoFSlot = server_corpse_slot;
}
@@ -5700,18 +5693,18 @@ namespace RoF
RoFSlot.AugIndex = invaug::SOCKET_INVALID;
RoFSlot.Unknown01 = INULL;
uint32 TempSlot = EQ::invslot::SLOT_INVALID;
uint32 TempSlot = EQEmu::invslot::SLOT_INVALID;
if (server_type == EQ::invtype::typePossessions) {
if (server_slot < EQ::invtype::POSSESSIONS_SIZE) {
if (server_type == EQEmu::invtype::typePossessions) {
if (server_slot < EQEmu::invtype::POSSESSIONS_SIZE) {
RoFSlot.Slot = server_slot;
}
else if (server_slot <= EQ::invbag::CURSOR_BAG_END && server_slot >= EQ::invbag::GENERAL_BAGS_BEGIN) {
TempSlot = server_slot - EQ::invbag::GENERAL_BAGS_BEGIN;
else if (server_slot <= EQEmu::invbag::CURSOR_BAG_END && server_slot >= EQEmu::invbag::GENERAL_BAGS_BEGIN) {
TempSlot = server_slot - EQEmu::invbag::GENERAL_BAGS_BEGIN;
RoFSlot.Slot = invslot::GENERAL_BEGIN + (TempSlot / EQ::invbag::SLOT_COUNT);
RoFSlot.SubIndex = TempSlot - ((RoFSlot.Slot - invslot::GENERAL_BEGIN) * EQ::invbag::SLOT_COUNT);
RoFSlot.Slot = invslot::GENERAL_BEGIN + (TempSlot / EQEmu::invbag::SLOT_COUNT);
RoFSlot.SubIndex = TempSlot - ((RoFSlot.Slot - invslot::GENERAL_BEGIN) * EQEmu::invbag::SLOT_COUNT);
}
}
@@ -5732,12 +5725,12 @@ namespace RoF
rof_slot.AugIndex,
rof_slot.Unknown02,
rof_slot.Unknown01,
EQ::invslot::SLOT_INVALID);
EQEmu::invslot::SLOT_INVALID);
return EQ::invslot::SLOT_INVALID;
return EQEmu::invslot::SLOT_INVALID;
}
uint32 server_slot = EQ::invslot::SLOT_INVALID;
uint32 server_slot = EQEmu::invslot::SLOT_INVALID;
uint32 temp_slot = invslot::SLOT_INVALID;
switch (rof_slot.Type) {
@@ -5747,10 +5740,10 @@ namespace RoF
server_slot = rof_slot.Slot;
} else if (rof_slot.SubIndex >= invbag::SLOT_BEGIN && rof_slot.SubIndex <= invbag::SLOT_END) {
if (rof_slot.Slot < invslot::GENERAL_BEGIN)
return EQ::invslot::SLOT_INVALID;
return EQEmu::invslot::SLOT_INVALID;
temp_slot = (rof_slot.Slot - invslot::GENERAL_BEGIN) * invbag::SLOT_COUNT;
server_slot = EQ::invbag::GENERAL_BAGS_BEGIN + temp_slot + rof_slot.SubIndex;
server_slot = EQEmu::invbag::GENERAL_BAGS_BEGIN + temp_slot + rof_slot.SubIndex;
}
}
@@ -5759,10 +5752,10 @@ namespace RoF
case invtype::typeBank: {
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::BANK_SIZE) {
if (rof_slot.SubIndex == invbag::SLOT_INVALID) {
server_slot = EQ::invslot::BANK_BEGIN + rof_slot.Slot;
server_slot = EQEmu::invslot::BANK_BEGIN + rof_slot.Slot;
} else if (rof_slot.SubIndex >= invbag::SLOT_BEGIN && rof_slot.SubIndex <= invbag::SLOT_END) {
temp_slot = rof_slot.Slot * invbag::SLOT_COUNT;
server_slot = EQ::invbag::BANK_BAGS_BEGIN + temp_slot + rof_slot.SubIndex;
server_slot = EQEmu::invbag::BANK_BAGS_BEGIN + temp_slot + rof_slot.SubIndex;
}
}
@@ -5771,10 +5764,10 @@ namespace RoF
case invtype::typeSharedBank: {
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::SHARED_BANK_SIZE) {
if (rof_slot.SubIndex == invbag::SLOT_INVALID) {
server_slot = EQ::invslot::SHARED_BANK_BEGIN + rof_slot.Slot;
server_slot = EQEmu::invslot::SHARED_BANK_BEGIN + rof_slot.Slot;
} else if (rof_slot.SubIndex >= invbag::SLOT_BEGIN && rof_slot.SubIndex <= invbag::SLOT_END) {
temp_slot = rof_slot.Slot * invbag::SLOT_COUNT;
server_slot = EQ::invbag::SHARED_BANK_BAGS_BEGIN + temp_slot + rof_slot.SubIndex;
server_slot = EQEmu::invbag::SHARED_BANK_BAGS_BEGIN + temp_slot + rof_slot.SubIndex;
}
}
@@ -5783,10 +5776,10 @@ namespace RoF
case invtype::typeTrade: {
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::TRADE_SIZE) {
if (rof_slot.SubIndex == invbag::SLOT_INVALID) {
server_slot = EQ::invslot::TRADE_BEGIN + rof_slot.Slot;
server_slot = EQEmu::invslot::TRADE_BEGIN + rof_slot.Slot;
} else if (rof_slot.SubIndex >= invbag::SLOT_BEGIN && rof_slot.SubIndex <= invbag::SLOT_END) {
temp_slot = rof_slot.Slot * invbag::SLOT_COUNT;
server_slot = EQ::invbag::TRADE_BAGS_BEGIN + temp_slot + rof_slot.SubIndex;
server_slot = EQEmu::invbag::TRADE_BAGS_BEGIN + temp_slot + rof_slot.SubIndex;
}
}
@@ -5794,32 +5787,32 @@ namespace RoF
}
case invtype::typeWorld: {
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::WORLD_SIZE) {
server_slot = EQ::invslot::WORLD_BEGIN + rof_slot.Slot;
server_slot = EQEmu::invslot::WORLD_BEGIN + rof_slot.Slot;
}
else if (rof_slot.Slot == invslot::SLOT_INVALID) {
server_slot = EQ::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE;
server_slot = EQEmu::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE;
}
break;
}
case invtype::typeLimbo: {
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::LIMBO_SIZE) {
server_slot = EQ::invslot::slotCursor;
server_slot = EQEmu::invslot::slotCursor;
}
break;
}
case invtype::typeTribute: {
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::TRIBUTE_SIZE) {
server_slot = EQ::invslot::TRIBUTE_BEGIN + rof_slot.Slot;
server_slot = EQEmu::invslot::TRIBUTE_BEGIN + rof_slot.Slot;
}
break;
}
case invtype::typeGuildTribute: {
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::GUILD_TRIBUTE_SIZE) {
server_slot = EQ::invslot::GUILD_TRIBUTE_BEGIN + rof_slot.Slot;
server_slot = EQEmu::invslot::GUILD_TRIBUTE_BEGIN + rof_slot.Slot;
}
break;
@@ -5853,10 +5846,10 @@ namespace RoF
static inline uint32 RoFToServerCorpseSlot(structs::InventorySlot_Struct rof_corpse_slot)
{
uint32 server_slot = EQ::invslot::SLOT_INVALID;
uint32 server_slot = EQEmu::invslot::SLOT_INVALID;
if (rof_corpse_slot.Type != invtype::typeCorpse || rof_corpse_slot.SubIndex != invbag::SLOT_INVALID || rof_corpse_slot.AugIndex != invaug::SOCKET_INVALID) {
server_slot = EQ::invslot::SLOT_INVALID;
server_slot = EQEmu::invslot::SLOT_INVALID;
}
else {
@@ -5878,7 +5871,7 @@ namespace RoF
}
static inline uint32 RoFToServerCorpseMainSlot(uint32 rof_corpse_slot) {
uint32 server_slot = EQ::invslot::SLOT_INVALID;
uint32 server_slot = EQEmu::invslot::SLOT_INVALID;
if (rof_corpse_slot <= invslot::CORPSE_END && rof_corpse_slot >= invslot::CORPSE_BEGIN) {
server_slot = rof_corpse_slot;
@@ -5904,12 +5897,12 @@ namespace RoF
rof_slot.AugIndex,
rof_type,
rof_slot.Unknown01,
EQ::invslot::SLOT_INVALID);
EQEmu::invslot::SLOT_INVALID);
return (uint32) EQ::invslot::SLOT_INVALID;
return (uint32) EQEmu::invslot::SLOT_INVALID;
}
uint32 server_slot = EQ::invslot::SLOT_INVALID;
uint32 server_slot = EQEmu::invslot::SLOT_INVALID;
uint32 temp_slot = invslot::SLOT_INVALID;
switch (rof_type) {
@@ -5919,10 +5912,10 @@ namespace RoF
server_slot = rof_slot.Slot;
} else if (rof_slot.SubIndex >= invbag::SLOT_BEGIN && rof_slot.SubIndex <= invbag::SLOT_END) {
if (rof_slot.Slot < invslot::GENERAL_BEGIN)
return EQ::invslot::SLOT_INVALID;
return EQEmu::invslot::SLOT_INVALID;
temp_slot = (rof_slot.Slot - invslot::GENERAL_BEGIN) * invbag::SLOT_COUNT;
server_slot = EQ::invbag::GENERAL_BAGS_BEGIN + temp_slot + rof_slot.SubIndex;
server_slot = EQEmu::invbag::GENERAL_BAGS_BEGIN + temp_slot + rof_slot.SubIndex;
}
}
@@ -5931,10 +5924,10 @@ namespace RoF
case invtype::typeBank: {
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::BANK_SIZE) {
if (rof_slot.SubIndex == invbag::SLOT_INVALID) {
server_slot = EQ::invslot::BANK_BEGIN + rof_slot.Slot;
server_slot = EQEmu::invslot::BANK_BEGIN + rof_slot.Slot;
} else if (rof_slot.SubIndex >= invbag::SLOT_BEGIN && rof_slot.SubIndex <= invbag::SLOT_END) {
temp_slot = rof_slot.Slot * invbag::SLOT_COUNT;
server_slot = EQ::invbag::BANK_BAGS_BEGIN + temp_slot + rof_slot.SubIndex;
server_slot = EQEmu::invbag::BANK_BAGS_BEGIN + temp_slot + rof_slot.SubIndex;
}
}
@@ -5943,10 +5936,10 @@ namespace RoF
case invtype::typeSharedBank: {
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::SHARED_BANK_SIZE) {
if (rof_slot.SubIndex == invbag::SLOT_INVALID) {
server_slot = EQ::invslot::SHARED_BANK_BEGIN + rof_slot.Slot;
server_slot = EQEmu::invslot::SHARED_BANK_BEGIN + rof_slot.Slot;
} else if (rof_slot.SubIndex >= invbag::SLOT_BEGIN && rof_slot.SubIndex <= invbag::SLOT_END) {
temp_slot = rof_slot.Slot * invbag::SLOT_COUNT;
server_slot = EQ::invbag::SHARED_BANK_BAGS_BEGIN + temp_slot + rof_slot.SubIndex;
server_slot = EQEmu::invbag::SHARED_BANK_BAGS_BEGIN + temp_slot + rof_slot.SubIndex;
}
}
@@ -5955,10 +5948,10 @@ namespace RoF
case invtype::typeTrade: {
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::TRADE_SIZE) {
if (rof_slot.SubIndex == invbag::SLOT_INVALID) {
server_slot = EQ::invslot::TRADE_BEGIN + rof_slot.Slot;
server_slot = EQEmu::invslot::TRADE_BEGIN + rof_slot.Slot;
} else if (rof_slot.SubIndex >= invbag::SLOT_BEGIN && rof_slot.SubIndex <= invbag::SLOT_END) {
temp_slot = rof_slot.Slot * invbag::SLOT_COUNT;
server_slot = EQ::invbag::TRADE_BAGS_BEGIN + temp_slot + rof_slot.SubIndex;
server_slot = EQEmu::invbag::TRADE_BAGS_BEGIN + temp_slot + rof_slot.SubIndex;
}
}
@@ -5966,32 +5959,32 @@ namespace RoF
}
case invtype::typeWorld: {
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::WORLD_SIZE) {
server_slot = EQ::invslot::WORLD_BEGIN + rof_slot.Slot;
server_slot = EQEmu::invslot::WORLD_BEGIN + rof_slot.Slot;
}
else if (rof_slot.Slot == invslot::SLOT_INVALID) {
server_slot = EQ::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE;
server_slot = EQEmu::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE;
}
break;
}
case invtype::typeLimbo: {
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::LIMBO_SIZE) {
server_slot = EQ::invslot::slotCursor;
server_slot = EQEmu::invslot::slotCursor;
}
break;
}
case invtype::typeTribute: {
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::TRIBUTE_SIZE) {
server_slot = EQ::invslot::TRIBUTE_BEGIN + rof_slot.Slot;
server_slot = EQEmu::invslot::TRIBUTE_BEGIN + rof_slot.Slot;
}
break;
}
case invtype::typeGuildTribute: {
if (rof_slot.Slot >= invslot::SLOT_BEGIN && rof_slot.Slot < invtype::GUILD_TRIBUTE_SIZE) {
server_slot = EQ::invslot::GUILD_TRIBUTE_BEGIN + rof_slot.Slot;
server_slot = EQEmu::invslot::GUILD_TRIBUTE_BEGIN + rof_slot.Slot;
}
break;
@@ -6024,7 +6017,7 @@ namespace RoF
static inline void ServerToRoFSayLink(std::string& rofSayLink, const std::string& serverSayLink)
{
if ((constants::SAY_LINK_BODY_SIZE == EQ::constants::SAY_LINK_BODY_SIZE) || (serverSayLink.find('\x12') == std::string::npos)) {
if ((constants::SAY_LINK_BODY_SIZE == EQEmu::constants::SAY_LINK_BODY_SIZE) || (serverSayLink.find('\x12') == std::string::npos)) {
rofSayLink = serverSayLink;
return;
}
@@ -6033,7 +6026,7 @@ namespace RoF
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
if (segment_iter & 1) {
if (segments[segment_iter].length() <= EQ::constants::SAY_LINK_BODY_SIZE) {
if (segments[segment_iter].length() <= EQEmu::constants::SAY_LINK_BODY_SIZE) {
rofSayLink.append(segments[segment_iter]);
// TODO: log size mismatch error
continue;
@@ -6063,7 +6056,7 @@ namespace RoF
static inline void RoFToServerSayLink(std::string& serverSayLink, const std::string& rofSayLink)
{
if ((EQ::constants::SAY_LINK_BODY_SIZE == constants::SAY_LINK_BODY_SIZE) || (rofSayLink.find('\x12') == std::string::npos)) {
if ((EQEmu::constants::SAY_LINK_BODY_SIZE == constants::SAY_LINK_BODY_SIZE) || (rofSayLink.find('\x12') == std::string::npos)) {
serverSayLink = rofSayLink;
return;
}
@@ -6095,80 +6088,80 @@ namespace RoF
}
}
static inline spells::CastingSlot ServerToRoFCastingSlot(EQ::spells::CastingSlot slot)
static inline spells::CastingSlot ServerToRoFCastingSlot(EQEmu::spells::CastingSlot slot)
{
switch (slot) {
case EQ::spells::CastingSlot::Gem1:
case EQEmu::spells::CastingSlot::Gem1:
return spells::CastingSlot::Gem1;
case EQ::spells::CastingSlot::Gem2:
case EQEmu::spells::CastingSlot::Gem2:
return spells::CastingSlot::Gem2;
case EQ::spells::CastingSlot::Gem3:
case EQEmu::spells::CastingSlot::Gem3:
return spells::CastingSlot::Gem3;
case EQ::spells::CastingSlot::Gem4:
case EQEmu::spells::CastingSlot::Gem4:
return spells::CastingSlot::Gem4;
case EQ::spells::CastingSlot::Gem5:
case EQEmu::spells::CastingSlot::Gem5:
return spells::CastingSlot::Gem5;
case EQ::spells::CastingSlot::Gem6:
case EQEmu::spells::CastingSlot::Gem6:
return spells::CastingSlot::Gem6;
case EQ::spells::CastingSlot::Gem7:
case EQEmu::spells::CastingSlot::Gem7:
return spells::CastingSlot::Gem7;
case EQ::spells::CastingSlot::Gem8:
case EQEmu::spells::CastingSlot::Gem8:
return spells::CastingSlot::Gem8;
case EQ::spells::CastingSlot::Gem9:
case EQEmu::spells::CastingSlot::Gem9:
return spells::CastingSlot::Gem9;
case EQ::spells::CastingSlot::Gem10:
case EQEmu::spells::CastingSlot::Gem10:
return spells::CastingSlot::Gem10;
case EQ::spells::CastingSlot::Gem11:
case EQEmu::spells::CastingSlot::Gem11:
return spells::CastingSlot::Gem11;
case EQ::spells::CastingSlot::Gem12:
case EQEmu::spells::CastingSlot::Gem12:
return spells::CastingSlot::Gem12;
case EQ::spells::CastingSlot::Item:
case EQ::spells::CastingSlot::PotionBelt:
case EQEmu::spells::CastingSlot::Item:
case EQEmu::spells::CastingSlot::PotionBelt:
return spells::CastingSlot::Item;
case EQ::spells::CastingSlot::Discipline:
case EQEmu::spells::CastingSlot::Discipline:
return spells::CastingSlot::Discipline;
case EQ::spells::CastingSlot::AltAbility:
case EQEmu::spells::CastingSlot::AltAbility:
return spells::CastingSlot::AltAbility;
default: // we shouldn't have any issues with other slots ... just return something
return spells::CastingSlot::Discipline;
}
}
static inline EQ::spells::CastingSlot RoFToServerCastingSlot(spells::CastingSlot slot)
static inline EQEmu::spells::CastingSlot RoFToServerCastingSlot(spells::CastingSlot slot)
{
switch (slot) {
case spells::CastingSlot::Gem1:
return EQ::spells::CastingSlot::Gem1;
return EQEmu::spells::CastingSlot::Gem1;
case spells::CastingSlot::Gem2:
return EQ::spells::CastingSlot::Gem2;
return EQEmu::spells::CastingSlot::Gem2;
case spells::CastingSlot::Gem3:
return EQ::spells::CastingSlot::Gem3;
return EQEmu::spells::CastingSlot::Gem3;
case spells::CastingSlot::Gem4:
return EQ::spells::CastingSlot::Gem4;
return EQEmu::spells::CastingSlot::Gem4;
case spells::CastingSlot::Gem5:
return EQ::spells::CastingSlot::Gem5;
return EQEmu::spells::CastingSlot::Gem5;
case spells::CastingSlot::Gem6:
return EQ::spells::CastingSlot::Gem6;
return EQEmu::spells::CastingSlot::Gem6;
case spells::CastingSlot::Gem7:
return EQ::spells::CastingSlot::Gem7;
return EQEmu::spells::CastingSlot::Gem7;
case spells::CastingSlot::Gem8:
return EQ::spells::CastingSlot::Gem8;
return EQEmu::spells::CastingSlot::Gem8;
case spells::CastingSlot::Gem9:
return EQ::spells::CastingSlot::Gem9;
return EQEmu::spells::CastingSlot::Gem9;
case spells::CastingSlot::Gem10:
return EQ::spells::CastingSlot::Gem10;
return EQEmu::spells::CastingSlot::Gem10;
case spells::CastingSlot::Gem11:
return EQ::spells::CastingSlot::Gem11;
return EQEmu::spells::CastingSlot::Gem11;
case spells::CastingSlot::Gem12:
return EQ::spells::CastingSlot::Gem12;
return EQEmu::spells::CastingSlot::Gem12;
case spells::CastingSlot::Discipline:
return EQ::spells::CastingSlot::Discipline;
return EQEmu::spells::CastingSlot::Discipline;
case spells::CastingSlot::Item:
return EQ::spells::CastingSlot::Item;
return EQEmu::spells::CastingSlot::Item;
case spells::CastingSlot::AltAbility:
return EQ::spells::CastingSlot::AltAbility;
return EQEmu::spells::CastingSlot::AltAbility;
default: // we shouldn't have any issues with other slots ... just return something
return EQ::spells::CastingSlot::Discipline;
return EQEmu::spells::CastingSlot::Discipline;
}
}
@@ -6177,12 +6170,12 @@ namespace RoF
static inline int ServerToRoFBuffSlot(int index)
{
// we're a disc
if (index >= EQ::spells::LONG_BUFFS + EQ::spells::SHORT_BUFFS)
return index - EQ::spells::LONG_BUFFS - EQ::spells::SHORT_BUFFS +
if (index >= EQEmu::spells::LONG_BUFFS + EQEmu::spells::SHORT_BUFFS)
return index - EQEmu::spells::LONG_BUFFS - EQEmu::spells::SHORT_BUFFS +
spells::LONG_BUFFS + spells::SHORT_BUFFS;
// we're a song
if (index >= EQ::spells::LONG_BUFFS)
return index - EQ::spells::LONG_BUFFS + spells::LONG_BUFFS;
if (index >= EQEmu::spells::LONG_BUFFS)
return index - EQEmu::spells::LONG_BUFFS + spells::LONG_BUFFS;
// we're a normal buff
return index; // as long as we guard against bad slots server side, we should be fine
}
@@ -6191,11 +6184,11 @@ namespace RoF
{
// we're a disc
if (index >= spells::LONG_BUFFS + spells::SHORT_BUFFS)
return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQ::spells::LONG_BUFFS +
EQ::spells::SHORT_BUFFS;
return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQEmu::spells::LONG_BUFFS +
EQEmu::spells::SHORT_BUFFS;
// we're a song
if (index >= spells::LONG_BUFFS)
return index - spells::LONG_BUFFS + EQ::spells::LONG_BUFFS;
return index - spells::LONG_BUFFS + EQEmu::spells::LONG_BUFFS;
// we're a normal buff
return index; // as long as we guard against bad slots server side, we should be fine
}
+1 -1
View File
@@ -43,7 +43,7 @@ namespace RoF
protected:
virtual std::string Describe() const;
virtual const EQ::versions::ClientVersion ClientVersion() const;
virtual const EQEmu::versions::ClientVersion ClientVersion() const;
//magic macro to declare our opcode processors
#include "ss_declare.h"
+178 -185
View File
@@ -46,7 +46,7 @@ namespace RoF2
static OpcodeManager *opcodes = nullptr;
static Strategy struct_strategy;
void SerializeItem(EQ::OutBuffer& ob, const EQ::ItemInstance *inst, int16 slot_id, uint8 depth, ItemPacketType packet_type);
void SerializeItem(EQEmu::OutBuffer& ob, const EQEmu::ItemInstance *inst, int16 slot_id, uint8 depth, ItemPacketType packet_type);
// server to client inventory location converters
static inline structs::InventorySlot_Struct ServerToRoF2Slot(uint32 server_slot);
@@ -66,8 +66,8 @@ namespace RoF2
// client to server say link converter
static inline void RoF2ToServerSayLink(std::string &server_saylink, const std::string &rof2_saylink);
static inline spells::CastingSlot ServerToRoF2CastingSlot(EQ::spells::CastingSlot slot);
static inline EQ::spells::CastingSlot RoF2ToServerCastingSlot(spells::CastingSlot slot);
static inline spells::CastingSlot ServerToRoF2CastingSlot(EQEmu::spells::CastingSlot slot);
static inline EQEmu::spells::CastingSlot RoF2ToServerCastingSlot(spells::CastingSlot slot);
static inline int ServerToRoF2BuffSlot(int index);
static inline int RoF2ToServerBuffSlot(int index);
@@ -151,9 +151,9 @@ namespace RoF2
return(r);
}
const EQ::versions::ClientVersion Strategy::ClientVersion() const
const EQEmu::versions::ClientVersion Strategy::ClientVersion() const
{
return EQ::versions::ClientVersion::RoF2;
return EQEmu::versions::ClientVersion::RoF2;
}
#include "ss_define.h"
@@ -263,7 +263,7 @@ namespace RoF2
eq->unknown000 = 1;
OUT(npcid);
eq->inventory_slot = ServerToRoF2TypelessSlot(emu->slot, EQ::invtype::typePossessions);
eq->inventory_slot = ServerToRoF2TypelessSlot(emu->slot, EQEmu::invtype::typePossessions);
OUT(charges);
OUT(sell_price);
@@ -316,7 +316,7 @@ namespace RoF2
SETUP_DIRECT_ENCODE(AltCurrencySellItem_Struct, structs::AltCurrencySellItem_Struct);
OUT(merchant_entity_id);
eq->inventory_slot = ServerToRoF2TypelessSlot(emu->slot_id, EQ::invtype::typePossessions);
eq->inventory_slot = ServerToRoF2TypelessSlot(emu->slot_id, EQEmu::invtype::typePossessions);
OUT(charges);
OUT(cost);
@@ -340,7 +340,7 @@ namespace RoF2
ENCODE_LENGTH_EXACT(ApplyPoison_Struct);
SETUP_DIRECT_ENCODE(ApplyPoison_Struct, structs::ApplyPoison_Struct);
eq->inventorySlot = ServerToRoF2TypelessSlot(emu->inventorySlot, EQ::invtype::typePossessions);
eq->inventorySlot = ServerToRoF2TypelessSlot(emu->inventorySlot, EQEmu::invtype::typePossessions);
OUT(success);
FINISH_ENCODE();
@@ -571,7 +571,7 @@ namespace RoF2
ENCODE_LENGTH_EXACT(CastSpell_Struct);
SETUP_DIRECT_ENCODE(CastSpell_Struct, structs::CastSpell_Struct);
eq->slot = static_cast<uint32>(ServerToRoF2CastingSlot(static_cast<EQ::spells::CastingSlot>(emu->slot)));
eq->slot = static_cast<uint32>(ServerToRoF2CastingSlot(static_cast<EQEmu::spells::CastingSlot>(emu->slot)));
OUT(spell_id);
eq->inventory_slot = ServerToRoF2Slot(emu->inventoryslot);
@@ -639,24 +639,24 @@ namespace RoF2
//store away the emu struct
uchar* __emu_buffer = in->pBuffer;
int item_count = in->size / sizeof(EQ::InternalSerializedItem_Struct);
if (!item_count || (in->size % sizeof(EQ::InternalSerializedItem_Struct)) != 0) {
int item_count = in->size / sizeof(EQEmu::InternalSerializedItem_Struct);
if (!item_count || (in->size % sizeof(EQEmu::InternalSerializedItem_Struct)) != 0) {
Log(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(EQ::InternalSerializedItem_Struct));
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(EQEmu::InternalSerializedItem_Struct));
delete in;
return;
}
EQ::InternalSerializedItem_Struct* eq = (EQ::InternalSerializedItem_Struct*)in->pBuffer;
EQEmu::InternalSerializedItem_Struct* eq = (EQEmu::InternalSerializedItem_Struct*)in->pBuffer;
EQ::OutBuffer ob;
EQ::OutBuffer::pos_type last_pos = ob.tellp();
EQEmu::OutBuffer ob;
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
ob.write((const char*)&item_count, sizeof(uint32));
for (int index = 0; index < item_count; ++index, ++eq) {
SerializeItem(ob, (const EQ::ItemInstance*)eq->inst, eq->slot_id, 0, ItemPacketCharInventory);
SerializeItem(ob, (const EQEmu::ItemInstance*)eq->inst, eq->slot_id, 0, ItemPacketCharInventory);
if (ob.tellp() == last_pos)
LogNetcode("RoF2::ENCODE(OP_CharInventory) Serialization failed on item slot [{}] during OP_CharInventory. Item skipped", eq->slot_id);
@@ -1562,14 +1562,14 @@ namespace RoF2
uchar* __emu_buffer = in->pBuffer;
ItemPacket_Struct* old_item_pkt = (ItemPacket_Struct*)__emu_buffer;
EQ::InternalSerializedItem_Struct* int_struct = (EQ::InternalSerializedItem_Struct*)(&__emu_buffer[4]);
EQEmu::InternalSerializedItem_Struct* int_struct = (EQEmu::InternalSerializedItem_Struct*)(&__emu_buffer[4]);
EQ::OutBuffer ob;
EQ::OutBuffer::pos_type last_pos = ob.tellp();
EQEmu::OutBuffer ob;
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
ob.write((const char*)__emu_buffer, 4);
SerializeItem(ob, (const EQ::ItemInstance*)int_struct->inst, int_struct->slot_id, 0, old_item_pkt->PacketType);
SerializeItem(ob, (const EQEmu::ItemInstance*)int_struct->inst, int_struct->slot_id, 0, old_item_pkt->PacketType);
if (ob.tellp() == last_pos) {
LogNetcode("RoF2::ENCODE(OP_ItemPacket) Serialization failed on item slot [{}]", int_struct->slot_id);
delete in;
@@ -2014,7 +2014,7 @@ namespace RoF2
outapp->WriteUInt32(22); // Equipment count
for (int r = EQ::textures::textureBegin; r < EQ::textures::materialCount; r++)
for (int r = EQEmu::textures::textureBegin; r < EQEmu::textures::materialCount; r++)
{
outapp->WriteUInt32(emu->item_material.Slot[r].Material);
outapp->WriteUInt32(0);
@@ -2034,9 +2034,9 @@ namespace RoF2
outapp->WriteUInt32(0);
}
outapp->WriteUInt32(EQ::textures::materialCount); // Equipment2 count
outapp->WriteUInt32(EQEmu::textures::materialCount); // Equipment2 count
for (int r = EQ::textures::textureBegin; r < EQ::textures::materialCount; r++)
for (int r = EQEmu::textures::textureBegin; r < EQEmu::textures::materialCount; r++)
{
outapp->WriteUInt32(0);
outapp->WriteUInt32(0);
@@ -2045,7 +2045,7 @@ namespace RoF2
outapp->WriteUInt32(0);
}
outapp->WriteUInt32(EQ::textures::materialCount); // Tint Count
outapp->WriteUInt32(EQEmu::textures::materialCount); // Tint Count
for (int r = 0; r < 7; r++)
{
@@ -2055,7 +2055,7 @@ namespace RoF2
outapp->WriteUInt32(0);
outapp->WriteUInt32(0);
outapp->WriteUInt32(EQ::textures::materialCount); // Tint2 Count
outapp->WriteUInt32(EQEmu::textures::materialCount); // Tint2 Count
for (int r = 0; r < 7; r++)
{
@@ -2184,7 +2184,7 @@ namespace RoF2
outapp->WriteUInt32(spells::SPELLBOOK_SIZE); // Spellbook slots
if (spells::SPELLBOOK_SIZE <= EQ::spells::SPELLBOOK_SIZE) {
if (spells::SPELLBOOK_SIZE <= EQEmu::spells::SPELLBOOK_SIZE) {
for (uint32 r = 0; r < spells::SPELLBOOK_SIZE; r++) {
if (emu->spell_book[r] <= spells::SPELL_ID_MAX)
outapp->WriteUInt32(emu->spell_book[r]);
@@ -2193,33 +2193,33 @@ namespace RoF2
}
}
else {
for (uint32 r = 0; r < EQ::spells::SPELLBOOK_SIZE; r++) {
for (uint32 r = 0; r < EQEmu::spells::SPELLBOOK_SIZE; r++) {
if (emu->spell_book[r] <= spells::SPELL_ID_MAX)
outapp->WriteUInt32(emu->spell_book[r]);
else
outapp->WriteUInt32(0xFFFFFFFFU);
}
// invalidate the rest of the spellbook slots
for (uint32 r = EQ::spells::SPELLBOOK_SIZE; r < spells::SPELLBOOK_SIZE; r++) {
for (uint32 r = EQEmu::spells::SPELLBOOK_SIZE; r < spells::SPELLBOOK_SIZE; r++) {
outapp->WriteUInt32(0xFFFFFFFFU);
}
}
outapp->WriteUInt32(spells::SPELL_GEM_COUNT); // Memorised spell slots
for (uint32 r = 0; r < EQ::spells::SPELL_GEM_COUNT; r++) // write first 12
for (uint32 r = 0; r < EQEmu::spells::SPELL_GEM_COUNT; r++) // write first 12
{
outapp->WriteUInt32(emu->mem_spells[r]);
}
// zeroes for the rest of the slots the other 4, which actually don't work on the client at all :D
for (uint32 r = 0; r < spells::SPELL_GEM_COUNT - EQ::spells::SPELL_GEM_COUNT; r++)
for (uint32 r = 0; r < spells::SPELL_GEM_COUNT - EQEmu::spells::SPELL_GEM_COUNT; r++)
{
outapp->WriteUInt32(0xFFFFFFFFU);
}
outapp->WriteUInt32(13); // gem refresh counts
for (uint32 r = 0; r < EQ::spells::SPELL_GEM_COUNT; r++)
for (uint32 r = 0; r < EQEmu::spells::SPELL_GEM_COUNT; r++)
{
outapp->WriteUInt32(emu->spellSlotRefresh[r]); // spell gem refresh
}
@@ -2308,7 +2308,7 @@ namespace RoF2
outapp->WriteUInt32(profile::BANDOLIERS_SIZE);
// Copy bandoliers where server and client indices converge
for (uint32 r = 0; r < EQ::profile::BANDOLIERS_SIZE && r < profile::BANDOLIERS_SIZE; ++r) {
for (uint32 r = 0; r < EQEmu::profile::BANDOLIERS_SIZE && r < profile::BANDOLIERS_SIZE; ++r) {
outapp->WriteString(emu->bandoliers[r].Name);
for (uint32 j = 0; j < profile::BANDOLIER_ITEM_COUNT; ++j) { // Will need adjusting if 'server != client' is ever true
outapp->WriteString(emu->bandoliers[r].Items[j].Name);
@@ -2323,7 +2323,7 @@ namespace RoF2
}
}
// Nullify bandoliers where server and client indices diverge, with a client bias
for (uint32 r = EQ::profile::BANDOLIERS_SIZE; r < profile::BANDOLIERS_SIZE; ++r) {
for (uint32 r = EQEmu::profile::BANDOLIERS_SIZE; r < profile::BANDOLIERS_SIZE; ++r) {
outapp->WriteString("");
for (uint32 j = 0; j < profile::BANDOLIER_ITEM_COUNT; ++j) { // Will need adjusting if 'server != client' is ever true
outapp->WriteString("");
@@ -2335,7 +2335,7 @@ namespace RoF2
outapp->WriteUInt32(profile::POTION_BELT_SIZE);
// Copy potion belt where server and client indices converge
for (uint32 r = 0; r < EQ::profile::POTION_BELT_SIZE && r < profile::POTION_BELT_SIZE; ++r) {
for (uint32 r = 0; r < EQEmu::profile::POTION_BELT_SIZE && r < profile::POTION_BELT_SIZE; ++r) {
outapp->WriteString(emu->potionbelt.Items[r].Name);
outapp->WriteUInt32(emu->potionbelt.Items[r].ID);
if (emu->potionbelt.Items[r].Icon) {
@@ -2347,7 +2347,7 @@ namespace RoF2
}
}
// Nullify potion belt where server and client indices diverge, with a client bias
for (uint32 r = EQ::profile::POTION_BELT_SIZE; r < profile::POTION_BELT_SIZE; ++r) {
for (uint32 r = EQEmu::profile::POTION_BELT_SIZE; r < profile::POTION_BELT_SIZE; ++r) {
outapp->WriteString("");
outapp->WriteUInt32(0);
outapp->WriteSInt32(-1);
@@ -2464,9 +2464,9 @@ namespace RoF2
outapp->WriteUInt8(0); // Unknown
outapp->WriteUInt8(0); // Unknown
outapp->WriteUInt32(EQ::invtype::TRIBUTE_SIZE);
outapp->WriteUInt32(EQEmu::invtype::TRIBUTE_SIZE);
for (uint32 r = 0; r < EQ::invtype::TRIBUTE_SIZE; r++)
for (uint32 r = 0; r < EQEmu::invtype::TRIBUTE_SIZE; r++)
{
outapp->WriteUInt32(emu->tributes[r].tribute);
outapp->WriteUInt32(emu->tributes[r].tier);
@@ -3015,7 +3015,7 @@ namespace RoF2
eq_cse->Gender = emu_cse->Gender;
eq_cse->Face = emu_cse->Face;
for (int equip_index = 0; equip_index < EQ::textures::materialCount; equip_index++) {
for (int equip_index = 0; equip_index < EQEmu::textures::materialCount; equip_index++) {
eq_cse->Equip[equip_index].Material = emu_cse->Equip[equip_index].Material;
eq_cse->Equip[equip_index].Unknown1 = emu_cse->Equip[equip_index].Unknown1;
eq_cse->Equip[equip_index].EliteMaterial = emu_cse->Equip[equip_index].EliteModel;
@@ -3114,7 +3114,7 @@ namespace RoF2
SETUP_DIRECT_ENCODE(Merchant_Purchase_Struct, structs::Merchant_Purchase_Struct);
OUT(npcid);
eq->inventory_slot = ServerToRoF2TypelessSlot(emu->itemslot, EQ::invtype::typePossessions);
eq->inventory_slot = ServerToRoF2TypelessSlot(emu->itemslot, EQEmu::invtype::typePossessions);
//OUT(itemslot);
OUT(quantity);
OUT(price);
@@ -4183,7 +4183,7 @@ namespace RoF2
if ((emu->NPC == 0) || (emu->race <= 12) || (emu->race == 128) || (emu->race == 130) || (emu->race == 330) || (emu->race == 522))
{
for (k = EQ::textures::textureBegin; k < EQ::textures::materialCount; ++k)
for (k = EQEmu::textures::textureBegin; k < EQEmu::textures::materialCount; ++k)
{
{
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->equipment_tint.Slot[k].Color);
@@ -4192,7 +4192,7 @@ namespace RoF2
structs::Texture_Struct *Equipment = (structs::Texture_Struct *)Buffer;
for (k = EQ::textures::textureBegin; k < EQ::textures::materialCount; k++) {
for (k = EQEmu::textures::textureBegin; k < EQEmu::textures::materialCount; k++) {
Equipment[k].Material = emu->equipment.Slot[k].Material;
Equipment[k].Unknown1 = emu->equipment.Slot[k].Unknown1;
Equipment[k].EliteMaterial = emu->equipment.Slot[k].EliteModel;
@@ -4200,7 +4200,7 @@ namespace RoF2
Equipment[k].Material2 = emu->equipment.Slot[k].Unknown2;
}
Buffer += (sizeof(structs::Texture_Struct) * EQ::textures::materialCount);
Buffer += (sizeof(structs::Texture_Struct) * EQEmu::textures::materialCount);
}
else
{
@@ -4911,7 +4911,7 @@ namespace RoF2
IN(item_id);
int r;
for (r = EQ::invaug::SOCKET_BEGIN; r <= EQ::invaug::SOCKET_END; r++) {
for (r = EQEmu::invaug::SOCKET_BEGIN; r <= EQEmu::invaug::SOCKET_END; r++) {
IN(augments[r]);
}
IN(link_hash);
@@ -4936,7 +4936,7 @@ namespace RoF2
DECODE_LENGTH_EXACT(structs::LoadSpellSet_Struct);
SETUP_DIRECT_DECODE(LoadSpellSet_Struct, structs::LoadSpellSet_Struct);
for (unsigned int i = 0; i < EQ::spells::SPELL_GEM_COUNT; ++i)
for (unsigned int i = 0; i < EQEmu::spells::SPELL_GEM_COUNT; ++i)
{
if (eq->spell[i] == 0)
emu->spell[i] = 0xFFFFFFFF;
@@ -5346,9 +5346,9 @@ namespace RoF2
return NextItemInstSerialNumber;
}
void SerializeItem(EQ::OutBuffer& ob, const EQ::ItemInstance *inst, int16 slot_id_in, uint8 depth, ItemPacketType packet_type)
void SerializeItem(EQEmu::OutBuffer& ob, const EQEmu::ItemInstance *inst, int16 slot_id_in, uint8 depth, ItemPacketType packet_type)
{
const EQ::ItemData *item = inst->GetUnscaledItem();
const EQEmu::ItemData *item = inst->GetUnscaledItem();
RoF2::structs::ItemSerializationHeader hdr;
@@ -5411,7 +5411,7 @@ namespace RoF2
uint32 hero_model = 0;
if (inst->GetOrnamentationIDFile()) {
hero_model = inst->GetOrnamentHeroModel(EQ::InventoryProfile::CalcMaterialFromSlot(slot_id_in));
hero_model = inst->GetOrnamentHeroModel(EQEmu::InventoryProfile::CalcMaterialFromSlot(slot_id_in));
char tmp[30];
memset(tmp, 0x0, 30);
@@ -5611,12 +5611,6 @@ namespace RoF2
itbs.no_transfer = item->NoTransfer;
itbs.expendablearrow = item->ExpendableArrow;
// Done to hack older clients to label expendable fishing poles as such
// July 28th, 2018 patch
if (item->ItemType == EQ::item::ItemTypeFishingPole && item->SubType == 0) {
itbs.expendablearrow = 1;
}
itbs.unknown8 = 0;
itbs.unknown9 = 0;
itbs.unknown10 = 0;
@@ -5765,7 +5759,6 @@ namespace RoF2
iqbs.HealAmt = item->HealAmt;
iqbs.SpellDmg = item->SpellDmg;
iqbs.Clairvoyance = item->Clairvoyance;
iqbs.SubType = item->SubType;
//unknown18; //Power Source Capacity or evolve filename?
//evolve_string; // Some String, but being evolution related is just a guess
@@ -5782,28 +5775,28 @@ namespace RoF2
ob.write((const char*)&iqbs, sizeof(RoF2::structs::ItemQuaternaryBodyStruct));
EQ::OutBuffer::pos_type count_pos = ob.tellp();
EQEmu::OutBuffer::pos_type count_pos = ob.tellp();
uint32 subitem_count = 0;
ob.write((const char*)&subitem_count, sizeof(uint32));
// moved outside of loop since it is not modified within that scope
int16 SubSlotNumber = EQ::invbag::SLOT_INVALID;
int16 SubSlotNumber = EQEmu::invbag::SLOT_INVALID;
if (slot_id_in <= EQ::invslot::GENERAL_END && slot_id_in >= EQ::invslot::GENERAL_BEGIN)
SubSlotNumber = EQ::invbag::GENERAL_BAGS_BEGIN + ((slot_id_in - EQ::invslot::GENERAL_BEGIN) * EQ::invbag::SLOT_COUNT);
else if (slot_id_in == EQ::invslot::slotCursor)
SubSlotNumber = EQ::invbag::CURSOR_BAG_BEGIN;
else if (slot_id_in <= EQ::invslot::BANK_END && slot_id_in >= EQ::invslot::BANK_BEGIN)
SubSlotNumber = EQ::invbag::BANK_BAGS_BEGIN + ((slot_id_in - EQ::invslot::BANK_BEGIN) * EQ::invbag::SLOT_COUNT);
else if (slot_id_in <= EQ::invslot::SHARED_BANK_END && slot_id_in >= EQ::invslot::SHARED_BANK_BEGIN)
SubSlotNumber = EQ::invbag::SHARED_BANK_BAGS_BEGIN + ((slot_id_in - EQ::invslot::SHARED_BANK_BEGIN) * EQ::invbag::SLOT_COUNT);
if (slot_id_in <= EQEmu::invslot::GENERAL_END && slot_id_in >= EQEmu::invslot::GENERAL_BEGIN)
SubSlotNumber = EQEmu::invbag::GENERAL_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::GENERAL_BEGIN) * EQEmu::invbag::SLOT_COUNT);
else if (slot_id_in == EQEmu::invslot::slotCursor)
SubSlotNumber = EQEmu::invbag::CURSOR_BAG_BEGIN;
else if (slot_id_in <= EQEmu::invslot::BANK_END && slot_id_in >= EQEmu::invslot::BANK_BEGIN)
SubSlotNumber = EQEmu::invbag::BANK_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::BANK_BEGIN) * EQEmu::invbag::SLOT_COUNT);
else if (slot_id_in <= EQEmu::invslot::SHARED_BANK_END && slot_id_in >= EQEmu::invslot::SHARED_BANK_BEGIN)
SubSlotNumber = EQEmu::invbag::SHARED_BANK_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::SHARED_BANK_BEGIN) * EQEmu::invbag::SLOT_COUNT);
else
SubSlotNumber = slot_id_in; // not sure if this is the best way to handle this..leaving for now
if (SubSlotNumber != EQ::invbag::SLOT_INVALID) {
for (uint32 index = EQ::invbag::SLOT_BEGIN; index <= EQ::invbag::SLOT_END; ++index) {
EQ::ItemInstance* sub = inst->GetItem(index);
if (SubSlotNumber != EQEmu::invbag::SLOT_INVALID) {
for (uint32 index = EQEmu::invbag::SLOT_BEGIN; index <= EQEmu::invbag::SLOT_END; ++index) {
EQEmu::ItemInstance* sub = inst->GetItem(index);
if (!sub)
continue;
@@ -5828,77 +5821,77 @@ namespace RoF2
RoF2Slot.AugIndex = invaug::SOCKET_INVALID;
RoF2Slot.Unknown01 = INULL;
uint32 TempSlot = EQ::invslot::SLOT_INVALID;
uint32 TempSlot = EQEmu::invslot::SLOT_INVALID;
if (server_slot < EQ::invtype::POSSESSIONS_SIZE) {
if (server_slot < EQEmu::invtype::POSSESSIONS_SIZE) {
RoF2Slot.Type = invtype::typePossessions;
RoF2Slot.Slot = server_slot;
}
else if (server_slot <= EQ::invbag::CURSOR_BAG_END && server_slot >= EQ::invbag::GENERAL_BAGS_BEGIN) {
TempSlot = server_slot - EQ::invbag::GENERAL_BAGS_BEGIN;
else if (server_slot <= EQEmu::invbag::CURSOR_BAG_END && server_slot >= EQEmu::invbag::GENERAL_BAGS_BEGIN) {
TempSlot = server_slot - EQEmu::invbag::GENERAL_BAGS_BEGIN;
RoF2Slot.Type = invtype::typePossessions;
RoF2Slot.Slot = invslot::GENERAL_BEGIN + (TempSlot / EQ::invbag::SLOT_COUNT);
RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot - invslot::GENERAL_BEGIN) * EQ::invbag::SLOT_COUNT);
RoF2Slot.Slot = invslot::GENERAL_BEGIN + (TempSlot / EQEmu::invbag::SLOT_COUNT);
RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot - invslot::GENERAL_BEGIN) * EQEmu::invbag::SLOT_COUNT);
}
else if (server_slot <= EQ::invslot::TRIBUTE_END && server_slot >= EQ::invslot::TRIBUTE_BEGIN) {
else if (server_slot <= EQEmu::invslot::TRIBUTE_END && server_slot >= EQEmu::invslot::TRIBUTE_BEGIN) {
RoF2Slot.Type = invtype::typeTribute;
RoF2Slot.Slot = server_slot - EQ::invslot::TRIBUTE_BEGIN;
RoF2Slot.Slot = server_slot - EQEmu::invslot::TRIBUTE_BEGIN;
}
else if (server_slot <= EQ::invslot::GUILD_TRIBUTE_END && server_slot >= EQ::invslot::GUILD_TRIBUTE_BEGIN) {
else if (server_slot <= EQEmu::invslot::GUILD_TRIBUTE_END && server_slot >= EQEmu::invslot::GUILD_TRIBUTE_BEGIN) {
RoF2Slot.Type = invtype::typeGuildTribute;
RoF2Slot.Slot = server_slot - EQ::invslot::GUILD_TRIBUTE_BEGIN;
RoF2Slot.Slot = server_slot - EQEmu::invslot::GUILD_TRIBUTE_BEGIN;
}
else if (server_slot == EQ::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
else if (server_slot == EQEmu::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
RoF2Slot.Type = invtype::typeWorld;
}
else if (server_slot <= EQ::invslot::BANK_END && server_slot >= EQ::invslot::BANK_BEGIN) {
else if (server_slot <= EQEmu::invslot::BANK_END && server_slot >= EQEmu::invslot::BANK_BEGIN) {
RoF2Slot.Type = invtype::typeBank;
RoF2Slot.Slot = server_slot - EQ::invslot::BANK_BEGIN;
RoF2Slot.Slot = server_slot - EQEmu::invslot::BANK_BEGIN;
}
else if (server_slot <= EQ::invbag::BANK_BAGS_END && server_slot >= EQ::invbag::BANK_BAGS_BEGIN) {
TempSlot = server_slot - EQ::invbag::BANK_BAGS_BEGIN;
else if (server_slot <= EQEmu::invbag::BANK_BAGS_END && server_slot >= EQEmu::invbag::BANK_BAGS_BEGIN) {
TempSlot = server_slot - EQEmu::invbag::BANK_BAGS_BEGIN;
RoF2Slot.Type = invtype::typeBank;
RoF2Slot.Slot = TempSlot / EQ::invbag::SLOT_COUNT;
RoF2Slot.SubIndex = TempSlot - (RoF2Slot.Slot * EQ::invbag::SLOT_COUNT);
RoF2Slot.Slot = TempSlot / EQEmu::invbag::SLOT_COUNT;
RoF2Slot.SubIndex = TempSlot - (RoF2Slot.Slot * EQEmu::invbag::SLOT_COUNT);
}
else if (server_slot <= EQ::invslot::SHARED_BANK_END && server_slot >= EQ::invslot::SHARED_BANK_BEGIN) {
else if (server_slot <= EQEmu::invslot::SHARED_BANK_END && server_slot >= EQEmu::invslot::SHARED_BANK_BEGIN) {
RoF2Slot.Type = invtype::typeSharedBank;
RoF2Slot.Slot = server_slot - EQ::invslot::SHARED_BANK_BEGIN;
RoF2Slot.Slot = server_slot - EQEmu::invslot::SHARED_BANK_BEGIN;
}
else if (server_slot <= EQ::invbag::SHARED_BANK_BAGS_END && server_slot >= EQ::invbag::SHARED_BANK_BAGS_BEGIN) {
TempSlot = server_slot - EQ::invbag::SHARED_BANK_BAGS_BEGIN;
else if (server_slot <= EQEmu::invbag::SHARED_BANK_BAGS_END && server_slot >= EQEmu::invbag::SHARED_BANK_BAGS_BEGIN) {
TempSlot = server_slot - EQEmu::invbag::SHARED_BANK_BAGS_BEGIN;
RoF2Slot.Type = invtype::typeSharedBank;
RoF2Slot.Slot = TempSlot / EQ::invbag::SLOT_COUNT;
RoF2Slot.SubIndex = TempSlot - (RoF2Slot.Slot * EQ::invbag::SLOT_COUNT);
RoF2Slot.Slot = TempSlot / EQEmu::invbag::SLOT_COUNT;
RoF2Slot.SubIndex = TempSlot - (RoF2Slot.Slot * EQEmu::invbag::SLOT_COUNT);
}
else if (server_slot <= EQ::invslot::TRADE_END && server_slot >= EQ::invslot::TRADE_BEGIN) {
else if (server_slot <= EQEmu::invslot::TRADE_END && server_slot >= EQEmu::invslot::TRADE_BEGIN) {
RoF2Slot.Type = invtype::typeTrade;
RoF2Slot.Slot = server_slot - EQ::invslot::TRADE_BEGIN;
RoF2Slot.Slot = server_slot - EQEmu::invslot::TRADE_BEGIN;
}
else if (server_slot <= EQ::invbag::TRADE_BAGS_END && server_slot >= EQ::invbag::TRADE_BAGS_BEGIN) {
TempSlot = server_slot - EQ::invbag::TRADE_BAGS_BEGIN;
else if (server_slot <= EQEmu::invbag::TRADE_BAGS_END && server_slot >= EQEmu::invbag::TRADE_BAGS_BEGIN) {
TempSlot = server_slot - EQEmu::invbag::TRADE_BAGS_BEGIN;
RoF2Slot.Type = invtype::typeTrade;
RoF2Slot.Slot = TempSlot / EQ::invbag::SLOT_COUNT;
RoF2Slot.SubIndex = TempSlot - (RoF2Slot.Slot * EQ::invbag::SLOT_COUNT);
RoF2Slot.Slot = TempSlot / EQEmu::invbag::SLOT_COUNT;
RoF2Slot.SubIndex = TempSlot - (RoF2Slot.Slot * EQEmu::invbag::SLOT_COUNT);
}
else if (server_slot <= EQ::invslot::WORLD_END && server_slot >= EQ::invslot::WORLD_BEGIN) {
else if (server_slot <= EQEmu::invslot::WORLD_END && server_slot >= EQEmu::invslot::WORLD_BEGIN) {
RoF2Slot.Type = invtype::typeWorld;
RoF2Slot.Slot = server_slot - EQ::invslot::WORLD_BEGIN;
RoF2Slot.Slot = server_slot - EQEmu::invslot::WORLD_BEGIN;
}
Log(Logs::Detail, Logs::Netcode, "Convert Server Slot %i to RoF2 Slot [%i, %i, %i, %i] (unk2: %i, unk1: %i)",
@@ -5930,7 +5923,7 @@ namespace RoF2
{
uint32 RoF2Slot = invslot::SLOT_INVALID;
if (server_corpse_slot <= EQ::invslot::CORPSE_END && server_corpse_slot >= EQ::invslot::CORPSE_BEGIN) {
if (server_corpse_slot <= EQEmu::invslot::CORPSE_END && server_corpse_slot >= EQEmu::invslot::CORPSE_BEGIN) {
RoF2Slot = server_corpse_slot;
}
@@ -5947,18 +5940,18 @@ namespace RoF2
RoF2Slot.AugIndex = invaug::SOCKET_INVALID;
RoF2Slot.Unknown01 = INULL;
uint32 TempSlot = EQ::invslot::SLOT_INVALID;
uint32 TempSlot = EQEmu::invslot::SLOT_INVALID;
if (server_type == EQ::invtype::typePossessions) {
if (server_slot < EQ::invtype::POSSESSIONS_SIZE) {
if (server_type == EQEmu::invtype::typePossessions) {
if (server_slot < EQEmu::invtype::POSSESSIONS_SIZE) {
RoF2Slot.Slot = server_slot;
}
else if (server_slot <= EQ::invbag::CURSOR_BAG_END && server_slot >= EQ::invbag::GENERAL_BAGS_BEGIN) {
TempSlot = server_slot - EQ::invbag::GENERAL_BAGS_BEGIN;
else if (server_slot <= EQEmu::invbag::CURSOR_BAG_END && server_slot >= EQEmu::invbag::GENERAL_BAGS_BEGIN) {
TempSlot = server_slot - EQEmu::invbag::GENERAL_BAGS_BEGIN;
RoF2Slot.Slot = invslot::GENERAL_BEGIN + (TempSlot / EQ::invbag::SLOT_COUNT);
RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot - invslot::GENERAL_BEGIN) * EQ::invbag::SLOT_COUNT);
RoF2Slot.Slot = invslot::GENERAL_BEGIN + (TempSlot / EQEmu::invbag::SLOT_COUNT);
RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot - invslot::GENERAL_BEGIN) * EQEmu::invbag::SLOT_COUNT);
}
}
@@ -5972,12 +5965,12 @@ namespace RoF2
{
if (rof2_slot.AugIndex < invaug::SOCKET_INVALID || rof2_slot.AugIndex >= invaug::SOCKET_COUNT) {
Log(Logs::Detail, Logs::Netcode, "Convert RoF2 Slot [%i, %i, %i, %i] (unk2: %i, unk1: %i) to Server Slot %i",
rof2_slot.Type, rof2_slot.Slot, rof2_slot.SubIndex, rof2_slot.AugIndex, rof2_slot.Unknown02, rof2_slot.Unknown01, EQ::invslot::SLOT_INVALID);
rof2_slot.Type, rof2_slot.Slot, rof2_slot.SubIndex, rof2_slot.AugIndex, rof2_slot.Unknown02, rof2_slot.Unknown01, EQEmu::invslot::SLOT_INVALID);
return EQ::invslot::SLOT_INVALID;
return EQEmu::invslot::SLOT_INVALID;
}
uint32 server_slot = EQ::invslot::SLOT_INVALID;
uint32 server_slot = EQEmu::invslot::SLOT_INVALID;
uint32 temp_slot = invslot::SLOT_INVALID;
switch (rof2_slot.Type) {
@@ -5989,10 +5982,10 @@ namespace RoF2
else if (rof2_slot.SubIndex >= invbag::SLOT_BEGIN && rof2_slot.SubIndex <= invbag::SLOT_END) {
if (rof2_slot.Slot < invslot::GENERAL_BEGIN)
return EQ::invslot::SLOT_INVALID;
return EQEmu::invslot::SLOT_INVALID;
temp_slot = (rof2_slot.Slot - invslot::GENERAL_BEGIN) * invbag::SLOT_COUNT;
server_slot = EQ::invbag::GENERAL_BAGS_BEGIN + temp_slot + rof2_slot.SubIndex;
server_slot = EQEmu::invbag::GENERAL_BAGS_BEGIN + temp_slot + rof2_slot.SubIndex;
}
}
@@ -6001,12 +5994,12 @@ namespace RoF2
case invtype::typeBank: {
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::BANK_SIZE) {
if (rof2_slot.SubIndex == invbag::SLOT_INVALID) {
server_slot = EQ::invslot::BANK_BEGIN + rof2_slot.Slot;
server_slot = EQEmu::invslot::BANK_BEGIN + rof2_slot.Slot;
}
else if (rof2_slot.SubIndex >= invbag::SLOT_BEGIN && rof2_slot.SubIndex <= invbag::SLOT_END) {
temp_slot = rof2_slot.Slot * invbag::SLOT_COUNT;
server_slot = EQ::invbag::BANK_BAGS_BEGIN + temp_slot + rof2_slot.SubIndex;
server_slot = EQEmu::invbag::BANK_BAGS_BEGIN + temp_slot + rof2_slot.SubIndex;
}
}
@@ -6015,12 +6008,12 @@ namespace RoF2
case invtype::typeSharedBank: {
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::SHARED_BANK_SIZE) {
if (rof2_slot.SubIndex == invbag::SLOT_INVALID) {
server_slot = EQ::invslot::SHARED_BANK_BEGIN + rof2_slot.Slot;
server_slot = EQEmu::invslot::SHARED_BANK_BEGIN + rof2_slot.Slot;
}
else if (rof2_slot.SubIndex >= invbag::SLOT_BEGIN && rof2_slot.SubIndex <= invbag::SLOT_END) {
temp_slot = rof2_slot.Slot * invbag::SLOT_COUNT;
server_slot = EQ::invbag::SHARED_BANK_BAGS_BEGIN + temp_slot + rof2_slot.SubIndex;
server_slot = EQEmu::invbag::SHARED_BANK_BAGS_BEGIN + temp_slot + rof2_slot.SubIndex;
}
}
@@ -6029,12 +6022,12 @@ namespace RoF2
case invtype::typeTrade: {
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::TRADE_SIZE) {
if (rof2_slot.SubIndex == invbag::SLOT_INVALID) {
server_slot = EQ::invslot::TRADE_BEGIN + rof2_slot.Slot;
server_slot = EQEmu::invslot::TRADE_BEGIN + rof2_slot.Slot;
}
else if (rof2_slot.SubIndex >= invbag::SLOT_BEGIN && rof2_slot.SubIndex <= invbag::SLOT_END) {
temp_slot = rof2_slot.Slot * invbag::SLOT_COUNT;
server_slot = EQ::invbag::TRADE_BAGS_BEGIN + temp_slot + rof2_slot.SubIndex;
server_slot = EQEmu::invbag::TRADE_BAGS_BEGIN + temp_slot + rof2_slot.SubIndex;
}
}
@@ -6042,32 +6035,32 @@ namespace RoF2
}
case invtype::typeWorld: {
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::WORLD_SIZE) {
server_slot = EQ::invslot::WORLD_BEGIN + rof2_slot.Slot;
server_slot = EQEmu::invslot::WORLD_BEGIN + rof2_slot.Slot;
}
else if (rof2_slot.Slot == invslot::SLOT_INVALID) {
server_slot = EQ::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE;
server_slot = EQEmu::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE;
}
break;
}
case invtype::typeLimbo: {
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::LIMBO_SIZE) {
server_slot = EQ::invslot::slotCursor;
server_slot = EQEmu::invslot::slotCursor;
}
break;
}
case invtype::typeTribute: {
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::TRIBUTE_SIZE) {
server_slot = EQ::invslot::TRIBUTE_BEGIN + rof2_slot.Slot;
server_slot = EQEmu::invslot::TRIBUTE_BEGIN + rof2_slot.Slot;
}
break;
}
case invtype::typeGuildTribute: {
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::GUILD_TRIBUTE_SIZE) {
server_slot = EQ::invslot::GUILD_TRIBUTE_BEGIN + rof2_slot.Slot;
server_slot = EQEmu::invslot::GUILD_TRIBUTE_BEGIN + rof2_slot.Slot;
}
break;
@@ -6093,10 +6086,10 @@ namespace RoF2
static inline uint32 RoF2ToServerCorpseSlot(structs::InventorySlot_Struct rof2_corpse_slot)
{
uint32 ServerSlot = EQ::invslot::SLOT_INVALID;
uint32 ServerSlot = EQEmu::invslot::SLOT_INVALID;
if (rof2_corpse_slot.Type != invtype::typeCorpse || rof2_corpse_slot.SubIndex != invbag::SLOT_INVALID || rof2_corpse_slot.AugIndex != invaug::SOCKET_INVALID) {
ServerSlot = EQ::invslot::SLOT_INVALID;
ServerSlot = EQEmu::invslot::SLOT_INVALID;
}
else {
@@ -6111,7 +6104,7 @@ namespace RoF2
static inline uint32 RoF2ToServerCorpseMainSlot(uint32 rof2_corpse_slot)
{
uint32 ServerSlot = EQ::invslot::SLOT_INVALID;
uint32 ServerSlot = EQEmu::invslot::SLOT_INVALID;
if (rof2_corpse_slot <= invslot::CORPSE_END && rof2_corpse_slot >= invslot::CORPSE_BEGIN) {
ServerSlot = rof2_corpse_slot;
@@ -6126,12 +6119,12 @@ namespace RoF2
{
if (rof2_slot.AugIndex < invaug::SOCKET_INVALID || rof2_slot.AugIndex >= invaug::SOCKET_COUNT) {
Log(Logs::Detail, Logs::Netcode, "Convert RoF2 Typeless Slot [%i, %i, %i] (implied type: %i, unk1: %i) to Server Slot %i",
rof2_slot.Slot, rof2_slot.SubIndex, rof2_slot.AugIndex, rof2_type, rof2_slot.Unknown01, EQ::invslot::SLOT_INVALID);
rof2_slot.Slot, rof2_slot.SubIndex, rof2_slot.AugIndex, rof2_type, rof2_slot.Unknown01, EQEmu::invslot::SLOT_INVALID);
return EQ::invslot::SLOT_INVALID;
return EQEmu::invslot::SLOT_INVALID;
}
uint32 ServerSlot = EQ::invslot::SLOT_INVALID;
uint32 ServerSlot = EQEmu::invslot::SLOT_INVALID;
uint32 TempSlot = invslot::SLOT_INVALID;
switch (rof2_type) {
@@ -6143,10 +6136,10 @@ namespace RoF2
else if (rof2_slot.SubIndex >= invbag::SLOT_BEGIN && rof2_slot.SubIndex <= invbag::SLOT_END) {
if (rof2_slot.Slot < invslot::GENERAL_BEGIN)
return EQ::invslot::SLOT_INVALID;
return EQEmu::invslot::SLOT_INVALID;
TempSlot = (rof2_slot.Slot - invslot::GENERAL_BEGIN) * invbag::SLOT_COUNT;
ServerSlot = EQ::invbag::GENERAL_BAGS_BEGIN + TempSlot + rof2_slot.SubIndex;
ServerSlot = EQEmu::invbag::GENERAL_BAGS_BEGIN + TempSlot + rof2_slot.SubIndex;
}
}
@@ -6155,12 +6148,12 @@ namespace RoF2
case invtype::typeBank: {
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::BANK_SIZE) {
if (rof2_slot.SubIndex == invbag::SLOT_INVALID) {
ServerSlot = EQ::invslot::BANK_BEGIN + rof2_slot.Slot;
ServerSlot = EQEmu::invslot::BANK_BEGIN + rof2_slot.Slot;
}
else if (rof2_slot.SubIndex >= invbag::SLOT_BEGIN && rof2_slot.SubIndex <= invbag::SLOT_END) {
TempSlot = rof2_slot.Slot * invbag::SLOT_COUNT;
ServerSlot = EQ::invbag::BANK_BAGS_BEGIN + TempSlot + rof2_slot.SubIndex;
ServerSlot = EQEmu::invbag::BANK_BAGS_BEGIN + TempSlot + rof2_slot.SubIndex;
}
}
@@ -6169,12 +6162,12 @@ namespace RoF2
case invtype::typeSharedBank: {
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::SHARED_BANK_SIZE) {
if (rof2_slot.SubIndex == invbag::SLOT_INVALID) {
ServerSlot = EQ::invslot::SHARED_BANK_BEGIN + rof2_slot.Slot;
ServerSlot = EQEmu::invslot::SHARED_BANK_BEGIN + rof2_slot.Slot;
}
else if (rof2_slot.SubIndex >= invbag::SLOT_BEGIN && rof2_slot.SubIndex <= invbag::SLOT_END) {
TempSlot = rof2_slot.Slot * invbag::SLOT_COUNT;
ServerSlot = EQ::invbag::SHARED_BANK_BAGS_BEGIN + TempSlot + rof2_slot.SubIndex;
ServerSlot = EQEmu::invbag::SHARED_BANK_BAGS_BEGIN + TempSlot + rof2_slot.SubIndex;
}
}
@@ -6183,12 +6176,12 @@ namespace RoF2
case invtype::typeTrade: {
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::TRADE_SIZE) {
if (rof2_slot.SubIndex == invbag::SLOT_INVALID) {
ServerSlot = EQ::invslot::TRADE_BEGIN + rof2_slot.Slot;
ServerSlot = EQEmu::invslot::TRADE_BEGIN + rof2_slot.Slot;
}
else if (rof2_slot.SubIndex >= invbag::SLOT_BEGIN && rof2_slot.SubIndex <= invbag::SLOT_END) {
TempSlot = rof2_slot.Slot * invbag::SLOT_COUNT;
ServerSlot = EQ::invbag::TRADE_BAGS_BEGIN + TempSlot + rof2_slot.SubIndex;
ServerSlot = EQEmu::invbag::TRADE_BAGS_BEGIN + TempSlot + rof2_slot.SubIndex;
}
}
@@ -6196,32 +6189,32 @@ namespace RoF2
}
case invtype::typeWorld: {
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::WORLD_SIZE) {
ServerSlot = EQ::invslot::WORLD_BEGIN + rof2_slot.Slot;
ServerSlot = EQEmu::invslot::WORLD_BEGIN + rof2_slot.Slot;
}
else if (rof2_slot.Slot == invslot::SLOT_INVALID) {
ServerSlot = EQ::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE;
ServerSlot = EQEmu::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE;
}
break;
}
case invtype::typeLimbo: {
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::LIMBO_SIZE) {
ServerSlot = EQ::invslot::slotCursor;
ServerSlot = EQEmu::invslot::slotCursor;
}
break;
}
case invtype::typeTribute: {
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::TRIBUTE_SIZE) {
ServerSlot = EQ::invslot::TRIBUTE_BEGIN + rof2_slot.Slot;
ServerSlot = EQEmu::invslot::TRIBUTE_BEGIN + rof2_slot.Slot;
}
break;
}
case invtype::typeGuildTribute: {
if (rof2_slot.Slot >= invslot::SLOT_BEGIN && rof2_slot.Slot < invtype::GUILD_TRIBUTE_SIZE) {
ServerSlot = EQ::invslot::GUILD_TRIBUTE_BEGIN + rof2_slot.Slot;
ServerSlot = EQEmu::invslot::GUILD_TRIBUTE_BEGIN + rof2_slot.Slot;
}
break;
@@ -6247,7 +6240,7 @@ namespace RoF2
static inline void ServerToRoF2SayLink(std::string &rof2_saylink, const std::string &server_saylink)
{
if ((constants::SAY_LINK_BODY_SIZE == EQ::constants::SAY_LINK_BODY_SIZE) || (server_saylink.find('\x12') == std::string::npos)) {
if ((constants::SAY_LINK_BODY_SIZE == EQEmu::constants::SAY_LINK_BODY_SIZE) || (server_saylink.find('\x12') == std::string::npos)) {
rof2_saylink = server_saylink;
return;
}
@@ -6256,7 +6249,7 @@ namespace RoF2
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
if (segment_iter & 1) {
if (segments[segment_iter].length() <= EQ::constants::SAY_LINK_BODY_SIZE) {
if (segments[segment_iter].length() <= EQEmu::constants::SAY_LINK_BODY_SIZE) {
rof2_saylink.append(segments[segment_iter]);
// TODO: log size mismatch error
continue;
@@ -6279,7 +6272,7 @@ namespace RoF2
static inline void RoF2ToServerSayLink(std::string &server_saylink, const std::string &rof2_saylink)
{
if ((EQ::constants::SAY_LINK_BODY_SIZE == constants::SAY_LINK_BODY_SIZE) || (rof2_saylink.find('\x12') == std::string::npos)) {
if ((EQEmu::constants::SAY_LINK_BODY_SIZE == constants::SAY_LINK_BODY_SIZE) || (rof2_saylink.find('\x12') == std::string::npos)) {
server_saylink = rof2_saylink;
return;
}
@@ -6309,80 +6302,80 @@ namespace RoF2
}
}
static inline spells::CastingSlot ServerToRoF2CastingSlot(EQ::spells::CastingSlot slot)
static inline spells::CastingSlot ServerToRoF2CastingSlot(EQEmu::spells::CastingSlot slot)
{
switch (slot) {
case EQ::spells::CastingSlot::Gem1:
case EQEmu::spells::CastingSlot::Gem1:
return spells::CastingSlot::Gem1;
case EQ::spells::CastingSlot::Gem2:
case EQEmu::spells::CastingSlot::Gem2:
return spells::CastingSlot::Gem2;
case EQ::spells::CastingSlot::Gem3:
case EQEmu::spells::CastingSlot::Gem3:
return spells::CastingSlot::Gem3;
case EQ::spells::CastingSlot::Gem4:
case EQEmu::spells::CastingSlot::Gem4:
return spells::CastingSlot::Gem4;
case EQ::spells::CastingSlot::Gem5:
case EQEmu::spells::CastingSlot::Gem5:
return spells::CastingSlot::Gem5;
case EQ::spells::CastingSlot::Gem6:
case EQEmu::spells::CastingSlot::Gem6:
return spells::CastingSlot::Gem6;
case EQ::spells::CastingSlot::Gem7:
case EQEmu::spells::CastingSlot::Gem7:
return spells::CastingSlot::Gem7;
case EQ::spells::CastingSlot::Gem8:
case EQEmu::spells::CastingSlot::Gem8:
return spells::CastingSlot::Gem8;
case EQ::spells::CastingSlot::Gem9:
case EQEmu::spells::CastingSlot::Gem9:
return spells::CastingSlot::Gem9;
case EQ::spells::CastingSlot::Gem10:
case EQEmu::spells::CastingSlot::Gem10:
return spells::CastingSlot::Gem10;
case EQ::spells::CastingSlot::Gem11:
case EQEmu::spells::CastingSlot::Gem11:
return spells::CastingSlot::Gem11;
case EQ::spells::CastingSlot::Gem12:
case EQEmu::spells::CastingSlot::Gem12:
return spells::CastingSlot::Gem12;
case EQ::spells::CastingSlot::Item:
case EQ::spells::CastingSlot::PotionBelt:
case EQEmu::spells::CastingSlot::Item:
case EQEmu::spells::CastingSlot::PotionBelt:
return spells::CastingSlot::Item;
case EQ::spells::CastingSlot::Discipline:
case EQEmu::spells::CastingSlot::Discipline:
return spells::CastingSlot::Discipline;
case EQ::spells::CastingSlot::AltAbility:
case EQEmu::spells::CastingSlot::AltAbility:
return spells::CastingSlot::AltAbility;
default: // we shouldn't have any issues with other slots ... just return something
return spells::CastingSlot::Discipline;
}
}
static inline EQ::spells::CastingSlot RoF2ToServerCastingSlot(spells::CastingSlot slot)
static inline EQEmu::spells::CastingSlot RoF2ToServerCastingSlot(spells::CastingSlot slot)
{
switch (slot) {
case spells::CastingSlot::Gem1:
return EQ::spells::CastingSlot::Gem1;
return EQEmu::spells::CastingSlot::Gem1;
case spells::CastingSlot::Gem2:
return EQ::spells::CastingSlot::Gem2;
return EQEmu::spells::CastingSlot::Gem2;
case spells::CastingSlot::Gem3:
return EQ::spells::CastingSlot::Gem3;
return EQEmu::spells::CastingSlot::Gem3;
case spells::CastingSlot::Gem4:
return EQ::spells::CastingSlot::Gem4;
return EQEmu::spells::CastingSlot::Gem4;
case spells::CastingSlot::Gem5:
return EQ::spells::CastingSlot::Gem5;
return EQEmu::spells::CastingSlot::Gem5;
case spells::CastingSlot::Gem6:
return EQ::spells::CastingSlot::Gem6;
return EQEmu::spells::CastingSlot::Gem6;
case spells::CastingSlot::Gem7:
return EQ::spells::CastingSlot::Gem7;
return EQEmu::spells::CastingSlot::Gem7;
case spells::CastingSlot::Gem8:
return EQ::spells::CastingSlot::Gem8;
return EQEmu::spells::CastingSlot::Gem8;
case spells::CastingSlot::Gem9:
return EQ::spells::CastingSlot::Gem9;
return EQEmu::spells::CastingSlot::Gem9;
case spells::CastingSlot::Gem10:
return EQ::spells::CastingSlot::Gem10;
return EQEmu::spells::CastingSlot::Gem10;
case spells::CastingSlot::Gem11:
return EQ::spells::CastingSlot::Gem11;
return EQEmu::spells::CastingSlot::Gem11;
case spells::CastingSlot::Gem12:
return EQ::spells::CastingSlot::Gem12;
return EQEmu::spells::CastingSlot::Gem12;
case spells::CastingSlot::Discipline:
return EQ::spells::CastingSlot::Discipline;
return EQEmu::spells::CastingSlot::Discipline;
case spells::CastingSlot::Item:
return EQ::spells::CastingSlot::Item;
return EQEmu::spells::CastingSlot::Item;
case spells::CastingSlot::AltAbility:
return EQ::spells::CastingSlot::AltAbility;
return EQEmu::spells::CastingSlot::AltAbility;
default: // we shouldn't have any issues with other slots ... just return something
return EQ::spells::CastingSlot::Discipline;
return EQEmu::spells::CastingSlot::Discipline;
}
}
@@ -6391,12 +6384,12 @@ namespace RoF2
static inline int ServerToRoF2BuffSlot(int index)
{
// we're a disc
if (index >= EQ::spells::LONG_BUFFS + EQ::spells::SHORT_BUFFS)
return index - EQ::spells::LONG_BUFFS - EQ::spells::SHORT_BUFFS +
if (index >= EQEmu::spells::LONG_BUFFS + EQEmu::spells::SHORT_BUFFS)
return index - EQEmu::spells::LONG_BUFFS - EQEmu::spells::SHORT_BUFFS +
spells::LONG_BUFFS + spells::SHORT_BUFFS;
// we're a song
if (index >= EQ::spells::LONG_BUFFS)
return index - EQ::spells::LONG_BUFFS + spells::LONG_BUFFS;
if (index >= EQEmu::spells::LONG_BUFFS)
return index - EQEmu::spells::LONG_BUFFS + spells::LONG_BUFFS;
// we're a normal buff
return index; // as long as we guard against bad slots server side, we should be fine
}
@@ -6405,11 +6398,11 @@ namespace RoF2
{
// we're a disc
if (index >= spells::LONG_BUFFS + spells::SHORT_BUFFS)
return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQ::spells::LONG_BUFFS +
EQ::spells::SHORT_BUFFS;
return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQEmu::spells::LONG_BUFFS +
EQEmu::spells::SHORT_BUFFS;
// we're a song
if (index >= spells::LONG_BUFFS)
return index - spells::LONG_BUFFS + EQ::spells::LONG_BUFFS;
return index - spells::LONG_BUFFS + EQEmu::spells::LONG_BUFFS;
// we're a normal buff
return index; // as long as we guard against bad slots server side, we should be fine
}
+1 -1
View File
@@ -43,7 +43,7 @@ namespace RoF2
protected:
virtual std::string Describe() const;
virtual const EQ::versions::ClientVersion ClientVersion() const;
virtual const EQEmu::versions::ClientVersion ClientVersion() const;
//magic macro to declare our opcode processors
#include "ss_declare.h"
+15 -15
View File
@@ -31,7 +31,7 @@ namespace RoF2
const int16 INULL = 0;
namespace inventory {
inline EQ::versions::ClientVersion GetInventoryRef() { return EQ::versions::ClientVersion::RoF2; }
inline EQEmu::versions::ClientVersion GetInventoryRef() { return EQEmu::versions::ClientVersion::RoF2; }
const bool ConcatenateInvTypeLimbo = false;
@@ -43,7 +43,7 @@ namespace RoF2
} /*inventory*/
namespace invtype {
inline EQ::versions::ClientVersion GetInvTypeRef() { return EQ::versions::ClientVersion::RoF2; }
inline EQEmu::versions::ClientVersion GetInvTypeRef() { return EQEmu::versions::ClientVersion::RoF2; }
namespace enum_ {
enum InventoryTypes : int16 {
@@ -118,7 +118,7 @@ namespace RoF2
} /*invtype*/
namespace invslot {
inline EQ::versions::ClientVersion GetInvSlotRef() { return EQ::versions::ClientVersion::RoF2; }
inline EQEmu::versions::ClientVersion GetInvSlotRef() { return EQEmu::versions::ClientVersion::RoF2; }
namespace enum_ {
enum InventorySlots : int16 {
@@ -196,7 +196,7 @@ namespace RoF2
} /*invslot*/
namespace invbag {
inline EQ::versions::ClientVersion GetInvBagRef() { return EQ::versions::ClientVersion::RoF2; }
inline EQEmu::versions::ClientVersion GetInvBagRef() { return EQEmu::versions::ClientVersion::RoF2; }
const int16 SLOT_INVALID = IINVALID;
const int16 SLOT_BEGIN = INULL;
@@ -208,7 +208,7 @@ namespace RoF2
} /*invbag*/
namespace invaug {
inline EQ::versions::ClientVersion GetInvAugRef() { return EQ::versions::ClientVersion::RoF2; }
inline EQEmu::versions::ClientVersion GetInvAugRef() { return EQEmu::versions::ClientVersion::RoF2; }
const int16 SOCKET_INVALID = IINVALID;
const int16 SOCKET_BEGIN = INULL;
@@ -220,7 +220,7 @@ namespace RoF2
} /*invaug*/
namespace item {
inline EQ::versions::ClientVersion GetItemRef() { return EQ::versions::ClientVersion::RoF2; }
inline EQEmu::versions::ClientVersion GetItemRef() { return EQEmu::versions::ClientVersion::RoF2; }
//enum Unknown : int { // looks like item class..but, RoF has it too - nothing in UF-
// Unknown1 = 0,
@@ -249,7 +249,7 @@ namespace RoF2
} /*item*/
namespace profile {
inline EQ::versions::ClientVersion GetProfileRef() { return EQ::versions::ClientVersion::RoF2; }
inline EQEmu::versions::ClientVersion GetProfileRef() { return EQEmu::versions::ClientVersion::RoF2; }
const int16 BANDOLIERS_SIZE = 20; // number of bandolier instances
const int16 BANDOLIER_ITEM_COUNT = 4; // number of equipment slots in bandolier instance
@@ -261,11 +261,11 @@ namespace RoF2
} /*profile*/
namespace constants {
inline EQ::versions::ClientVersion GetConstantsRef() { return EQ::versions::ClientVersion::RoF2; }
inline EQEmu::versions::ClientVersion GetConstantsRef() { return EQEmu::versions::ClientVersion::RoF2; }
const EQ::expansions::Expansion EXPANSION = EQ::expansions::Expansion::RoF;
const uint32 EXPANSION_BIT = EQ::expansions::bitRoF;
const uint32 EXPANSIONS_MASK = EQ::expansions::maskRoF;
const EQEmu::expansions::Expansion EXPANSION = EQEmu::expansions::Expansion::RoF;
const uint32 EXPANSION_BIT = EQEmu::expansions::bitRoF;
const uint32 EXPANSIONS_MASK = EQEmu::expansions::maskRoF;
const size_t CHARACTER_CREATION_LIMIT = 12;
@@ -274,21 +274,21 @@ namespace RoF2
} /*constants*/
namespace behavior {
inline EQ::versions::ClientVersion GetBehaviorRef() { return EQ::versions::ClientVersion::RoF2; }
inline EQEmu::versions::ClientVersion GetBehaviorRef() { return EQEmu::versions::ClientVersion::RoF2; }
const bool CoinHasWeight = false;
} /*behavior*/
namespace skills {
inline EQ::versions::ClientVersion GetSkillsRef() { return EQ::versions::ClientVersion::RoF2; }
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::RoF2; }
const size_t LastUsableSkill = EQ::skills::Skill2HPiercing;
const size_t LastUsableSkill = EQEmu::skills::Skill2HPiercing;
} /*skills*/
namespace spells {
inline EQ::versions::ClientVersion GetSkillsRef() { return EQ::versions::ClientVersion::RoF2; }
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::RoF2; }
enum class CastingSlot : uint32 {
Gem1 = 0,
+5 -5
View File
@@ -190,7 +190,7 @@ struct TintProfile
Tint_Struct Primary;
Tint_Struct Secondary;
};
Tint_Struct Slot[EQ::textures::materialCount];
Tint_Struct Slot[EQEmu::textures::materialCount];
};
};
@@ -222,7 +222,7 @@ struct Texture_Struct
// Texture_Struct Primary;
// Texture_Struct Secondary;
// };
// Texture_Struct Slot[EQ::textures::TextureCount];
// Texture_Struct Slot[EQEmu::textures::TextureCount];
// };
//
// TextureProfile();
@@ -1113,7 +1113,7 @@ union
/*00184*/ Texture_Struct equipment[22]; // Total Slots
};
/*00624*/ uint32 equip2_count; // Seen 9
/*00628*/ Texture_Struct equipment2[EQ::textures::materialCount]; // Appears to be Visible slots, but all 0s
/*00628*/ Texture_Struct equipment2[EQEmu::textures::materialCount]; // Appears to be Visible slots, but all 0s
/*00808*/ uint32 tint_count; // Seen 9
/*00812*/ TintProfile item_tint; // RR GG BB 00
/*00848*/ uint32 tint_count2; // Seen 9
@@ -4804,8 +4804,8 @@ struct ItemQuaternaryBodyStruct
int32 HealAmt;
int32 SpellDmg;
int32 Clairvoyance;
int32 SubType;
uint8 evolve_string; // Some String, but being evolution related is just a guess
uint8 unknown18; //Power Source Capacity or evolve filename?
uint32 evolve_string; // Some String, but being evolution related is just a guess
uint8 unknown19;
uint16 unknown20;
uint8 unknown21;
+15 -15
View File
@@ -31,7 +31,7 @@ namespace RoF
const int16 INULL = 0;
namespace inventory {
inline EQ::versions::ClientVersion GetInventoryRef() { return EQ::versions::ClientVersion::RoF; }
inline EQEmu::versions::ClientVersion GetInventoryRef() { return EQEmu::versions::ClientVersion::RoF; }
const bool ConcatenateInvTypeLimbo = false;
@@ -43,7 +43,7 @@ namespace RoF
} /*inventory*/
namespace invtype {
inline EQ::versions::ClientVersion GetInvTypeRef() { return EQ::versions::ClientVersion::RoF; }
inline EQEmu::versions::ClientVersion GetInvTypeRef() { return EQEmu::versions::ClientVersion::RoF; }
namespace enum_ {
enum InventoryTypes : int16 {
@@ -116,7 +116,7 @@ namespace RoF
} /*invtype*/
namespace invslot {
inline EQ::versions::ClientVersion GetInvSlotRef() { return EQ::versions::ClientVersion::RoF; }
inline EQEmu::versions::ClientVersion GetInvSlotRef() { return EQEmu::versions::ClientVersion::RoF; }
namespace enum_ {
enum InventorySlots : int16 {
@@ -194,7 +194,7 @@ namespace RoF
} /*invslot*/
namespace invbag {
inline EQ::versions::ClientVersion GetInvBagRef() { return EQ::versions::ClientVersion::RoF; }
inline EQEmu::versions::ClientVersion GetInvBagRef() { return EQEmu::versions::ClientVersion::RoF; }
const int16 SLOT_INVALID = IINVALID;
const int16 SLOT_BEGIN = INULL;
@@ -206,7 +206,7 @@ namespace RoF
} /*invbag*/
namespace invaug {
inline EQ::versions::ClientVersion GetInvAugRef() { return EQ::versions::ClientVersion::RoF; }
inline EQEmu::versions::ClientVersion GetInvAugRef() { return EQEmu::versions::ClientVersion::RoF; }
const int16 SOCKET_INVALID = IINVALID;
const int16 SOCKET_BEGIN = INULL;
@@ -218,7 +218,7 @@ namespace RoF
} /*invaug*/
namespace item {
inline EQ::versions::ClientVersion GetItemRef() { return EQ::versions::ClientVersion::RoF; }
inline EQEmu::versions::ClientVersion GetItemRef() { return EQEmu::versions::ClientVersion::RoF; }
enum ItemPacketType : int {
ItemPacketMerchant = 100,
@@ -240,7 +240,7 @@ namespace RoF
} /*item*/
namespace profile {
inline EQ::versions::ClientVersion GetProfileRef() { return EQ::versions::ClientVersion::RoF; }
inline EQEmu::versions::ClientVersion GetProfileRef() { return EQEmu::versions::ClientVersion::RoF; }
const int16 BANDOLIERS_SIZE = 20; // number of bandolier instances
const int16 BANDOLIER_ITEM_COUNT = 4; // number of equipment slots in bandolier instance
@@ -252,11 +252,11 @@ namespace RoF
} /*profile*/
namespace constants {
inline EQ::versions::ClientVersion GetConstantsRef() { return EQ::versions::ClientVersion::RoF; }
inline EQEmu::versions::ClientVersion GetConstantsRef() { return EQEmu::versions::ClientVersion::RoF; }
const EQ::expansions::Expansion EXPANSION = EQ::expansions::Expansion::RoF;
const uint32 EXPANSION_BIT = EQ::expansions::bitRoF;
const uint32 EXPANSIONS_MASK = EQ::expansions::maskRoF;
const EQEmu::expansions::Expansion EXPANSION = EQEmu::expansions::Expansion::RoF;
const uint32 EXPANSION_BIT = EQEmu::expansions::bitRoF;
const uint32 EXPANSIONS_MASK = EQEmu::expansions::maskRoF;
const size_t CHARACTER_CREATION_LIMIT = 12;
@@ -265,21 +265,21 @@ namespace RoF
} /*constants*/
namespace behavior {
inline EQ::versions::ClientVersion GetBehaviorRef() { return EQ::versions::ClientVersion::RoF; }
inline EQEmu::versions::ClientVersion GetBehaviorRef() { return EQEmu::versions::ClientVersion::RoF; }
const bool CoinHasWeight = false;
} /*behavior*/
namespace skills {
inline EQ::versions::ClientVersion GetSkillsRef() { return EQ::versions::ClientVersion::RoF; }
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::RoF; }
const size_t LastUsableSkill = EQ::skills::SkillTripleAttack;
const size_t LastUsableSkill = EQEmu::skills::SkillTripleAttack;
} /*skills*/
namespace spells {
inline EQ::versions::ClientVersion GetSkillsRef() { return EQ::versions::ClientVersion::RoF; }
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::RoF; }
enum class CastingSlot : uint32 {
Gem1 = 0,
+4 -4
View File
@@ -190,7 +190,7 @@ struct TintProfile
Tint_Struct Primary;
Tint_Struct Secondary;
};
Tint_Struct Slot[EQ::textures::materialCount];
Tint_Struct Slot[EQEmu::textures::materialCount];
};
};
@@ -222,7 +222,7 @@ struct Texture_Struct
// Texture_Struct Primary;
// Texture_Struct Secondary;
// };
// Texture_Struct Slot[EQ::textures::TextureCount];
// Texture_Struct Slot[EQEmu::textures::TextureCount];
// };
//
// TextureProfile();
@@ -4744,8 +4744,8 @@ struct ItemQuaternaryBodyStruct
int32 HealAmt;
int32 SpellDmg;
int32 Clairvoyance;
int32 SubType;
uint8 evolve_string; // Some String, but being evolution related is just a guess
uint8 unknown18; //Power Source Capacity or evolve filename?
uint32 evolve_string; // Some String, but being evolution related is just a guess
uint8 unknown19;
uint32 unknown20; // Bard Stuff?
//uint32 unknown21;
+105 -111
View File
@@ -43,7 +43,7 @@ namespace SoD
static OpcodeManager *opcodes = nullptr;
static Strategy struct_strategy;
void SerializeItem(EQ::OutBuffer& ob, const EQ::ItemInstance *inst, int16 slot_id, uint8 depth);
void SerializeItem(EQEmu::OutBuffer& ob, const EQEmu::ItemInstance *inst, int16 slot_id, uint8 depth);
// server to client inventory location converters
static inline uint32 ServerToSoDSlot(uint32 server_slot);
@@ -59,8 +59,8 @@ namespace SoD
// client to server say link converter
static inline void SoDToServerSayLink(std::string &server_saylink, const std::string &sod_saylink);
static inline spells::CastingSlot ServerToSoDCastingSlot(EQ::spells::CastingSlot slot);
static inline EQ::spells::CastingSlot SoDToServerCastingSlot(spells::CastingSlot slot);
static inline spells::CastingSlot ServerToSoDCastingSlot(EQEmu::spells::CastingSlot slot);
static inline EQEmu::spells::CastingSlot SoDToServerCastingSlot(spells::CastingSlot slot);
static inline int ServerToSoDBuffSlot(int index);
static inline int SoDToServerBuffSlot(int index);
@@ -144,9 +144,9 @@ namespace SoD
return(r);
}
const EQ::versions::ClientVersion Strategy::ClientVersion() const
const EQEmu::versions::ClientVersion Strategy::ClientVersion() const
{
return EQ::versions::ClientVersion::SoD;
return EQEmu::versions::ClientVersion::SoD;
}
#include "ss_define.h"
@@ -381,24 +381,24 @@ namespace SoD
//store away the emu struct
uchar* __emu_buffer = in->pBuffer;
int item_count = in->size / sizeof(EQ::InternalSerializedItem_Struct);
if (!item_count || (in->size % sizeof(EQ::InternalSerializedItem_Struct)) != 0) {
int item_count = in->size / sizeof(EQEmu::InternalSerializedItem_Struct);
if (!item_count || (in->size % sizeof(EQEmu::InternalSerializedItem_Struct)) != 0) {
Log(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(EQ::InternalSerializedItem_Struct));
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(EQEmu::InternalSerializedItem_Struct));
delete in;
return;
}
EQ::InternalSerializedItem_Struct* eq = (EQ::InternalSerializedItem_Struct*)in->pBuffer;
EQEmu::InternalSerializedItem_Struct* eq = (EQEmu::InternalSerializedItem_Struct*)in->pBuffer;
EQ::OutBuffer ob;
EQ::OutBuffer::pos_type last_pos = ob.tellp();
EQEmu::OutBuffer ob;
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
ob.write((const char*)&item_count, sizeof(uint32));
for (int index = 0; index < item_count; ++index, ++eq) {
SerializeItem(ob, (const EQ::ItemInstance*)eq->inst, eq->slot_id, 0);
SerializeItem(ob, (const EQEmu::ItemInstance*)eq->inst, eq->slot_id, 0);
if (ob.tellp() == last_pos)
LogNetcode("SoD::ENCODE(OP_CharInventory) Serialization failed on item slot [{}] during OP_CharInventory. Item skipped", eq->slot_id);
@@ -1060,14 +1060,14 @@ namespace SoD
//store away the emu struct
uchar* __emu_buffer = in->pBuffer;
EQ::InternalSerializedItem_Struct* int_struct = (EQ::InternalSerializedItem_Struct*)(&__emu_buffer[4]);
EQEmu::InternalSerializedItem_Struct* int_struct = (EQEmu::InternalSerializedItem_Struct*)(&__emu_buffer[4]);
EQ::OutBuffer ob;
EQ::OutBuffer::pos_type last_pos = ob.tellp();
EQEmu::OutBuffer ob;
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
ob.write((const char*)__emu_buffer, 4);
SerializeItem(ob, (const EQ::ItemInstance*)int_struct->inst, int_struct->slot_id, 0);
SerializeItem(ob, (const EQEmu::ItemInstance*)int_struct->inst, int_struct->slot_id, 0);
if (ob.tellp() == last_pos) {
LogNetcode("SoD::ENCODE(OP_ItemPacket) Serialization failed on item slot [{}]", int_struct->slot_id);
delete in;
@@ -1463,7 +1463,7 @@ namespace SoD
OUT(hairstyle);
OUT(beard);
// OUT(unknown00178[10]);
for (r = EQ::textures::textureBegin; r < EQ::textures::materialCount; r++) {
for (r = EQEmu::textures::textureBegin; r < EQEmu::textures::materialCount; r++) {
eq->equipment.Slot[r].Material = emu->item_material.Slot[r].Material;
eq->equipment.Slot[r].Unknown1 = 0;
eq->equipment.Slot[r].EliteMaterial = 0;
@@ -1493,7 +1493,7 @@ namespace SoD
OUT(face);
// OUT(unknown02264[47]);
if (spells::SPELLBOOK_SIZE <= EQ::spells::SPELLBOOK_SIZE) {
if (spells::SPELLBOOK_SIZE <= EQEmu::spells::SPELLBOOK_SIZE) {
for (uint32 r = 0; r < spells::SPELLBOOK_SIZE; r++) {
if (emu->spell_book[r] <= spells::SPELL_ID_MAX)
eq->spell_book[r] = emu->spell_book[r];
@@ -1502,14 +1502,14 @@ namespace SoD
}
}
else {
for (uint32 r = 0; r < EQ::spells::SPELLBOOK_SIZE; r++) {
for (uint32 r = 0; r < EQEmu::spells::SPELLBOOK_SIZE; r++) {
if (emu->spell_book[r] <= spells::SPELL_ID_MAX)
eq->spell_book[r] = emu->spell_book[r];
else
eq->spell_book[r] = 0xFFFFFFFFU;
}
// invalidate the rest of the spellbook slots
memset(&eq->spell_book[EQ::spells::SPELLBOOK_SIZE], 0xFF, (sizeof(uint32) * (spells::SPELLBOOK_SIZE - EQ::spells::SPELLBOOK_SIZE)));
memset(&eq->spell_book[EQEmu::spells::SPELLBOOK_SIZE], 0xFF, (sizeof(uint32) * (spells::SPELLBOOK_SIZE - EQEmu::spells::SPELLBOOK_SIZE)));
}
// OUT(unknown4184[128]);
@@ -1553,7 +1553,7 @@ namespace SoD
// OUT(unknown06160[4]);
// Copy bandoliers where server and client indices converge
for (r = 0; r < EQ::profile::BANDOLIERS_SIZE && r < profile::BANDOLIERS_SIZE; ++r) {
for (r = 0; r < EQEmu::profile::BANDOLIERS_SIZE && r < profile::BANDOLIERS_SIZE; ++r) {
OUT_str(bandoliers[r].Name);
for (uint32 k = 0; k < profile::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
OUT(bandoliers[r].Items[k].ID);
@@ -1562,7 +1562,7 @@ namespace SoD
}
}
// Nullify bandoliers where server and client indices diverge, with a client bias
for (r = EQ::profile::BANDOLIERS_SIZE; r < profile::BANDOLIERS_SIZE; ++r) {
for (r = EQEmu::profile::BANDOLIERS_SIZE; r < profile::BANDOLIERS_SIZE; ++r) {
eq->bandoliers[r].Name[0] = '\0';
for (uint32 k = 0; k < profile::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
eq->bandoliers[r].Items[k].ID = 0;
@@ -1574,13 +1574,13 @@ namespace SoD
// OUT(unknown07444[5120]);
// Copy potion belt where server and client indices converge
for (r = 0; r < EQ::profile::POTION_BELT_SIZE && r < profile::POTION_BELT_SIZE; ++r) {
for (r = 0; r < EQEmu::profile::POTION_BELT_SIZE && r < profile::POTION_BELT_SIZE; ++r) {
OUT(potionbelt.Items[r].ID);
OUT(potionbelt.Items[r].Icon);
OUT_str(potionbelt.Items[r].Name);
}
// Nullify potion belt where server and client indices diverge, with a client bias
for (r = EQ::profile::POTION_BELT_SIZE; r < profile::POTION_BELT_SIZE; ++r) {
for (r = EQEmu::profile::POTION_BELT_SIZE; r < profile::POTION_BELT_SIZE; ++r) {
eq->potionbelt.Items[r].ID = 0;
eq->potionbelt.Items[r].Icon = 0;
eq->potionbelt.Items[r].Name[0] = '\0';
@@ -1923,7 +1923,7 @@ namespace SoD
eq_cse->HairColor = emu_cse->HairColor;
eq_cse->Face = emu_cse->Face;
for (int equip_index = EQ::textures::textureBegin; equip_index < EQ::textures::materialCount; equip_index++) {
for (int equip_index = EQEmu::textures::textureBegin; equip_index < EQEmu::textures::materialCount; equip_index++) {
eq_cse->Equip[equip_index].Material = emu_cse->Equip[equip_index].Material;
eq_cse->Equip[equip_index].Unknown1 = emu_cse->Equip[equip_index].Unknown1;
eq_cse->Equip[equip_index].EliteMaterial = emu_cse->Equip[equip_index].EliteModel;
@@ -2484,7 +2484,7 @@ namespace SoD
float SpawnSize = emu->size;
if (!((emu->NPC == 0) || (emu->race <= 12) || (emu->race == 128) || (emu->race == 130) || (emu->race == 330) || (emu->race == 522)))
{
PacketSize -= (sizeof(structs::Texture_Struct) * EQ::textures::materialCount);
PacketSize -= (sizeof(structs::Texture_Struct) * EQEmu::textures::materialCount);
if (emu->size == 0)
{
@@ -2681,7 +2681,7 @@ namespace SoD
if ((emu->NPC == 0) || (emu->race <= 12) || (emu->race == 128) || (emu->race == 130) || (emu->race == 330) || (emu->race == 522))
{
for (k = EQ::textures::textureBegin; k < EQ::textures::materialCount; ++k)
for (k = EQEmu::textures::textureBegin; k < EQEmu::textures::materialCount; ++k)
{
{
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->equipment_tint.Slot[k].Color);
@@ -2708,13 +2708,13 @@ namespace SoD
{
structs::Texture_Struct *Equipment = (structs::Texture_Struct *)Buffer;
for (k = EQ::textures::textureBegin; k < EQ::textures::materialCount; k++) {
for (k = EQEmu::textures::textureBegin; k < EQEmu::textures::materialCount; k++) {
Equipment[k].Material = emu->equipment.Slot[k].Material;
Equipment[k].Unknown1 = emu->equipment.Slot[k].Unknown1;
Equipment[k].EliteMaterial = emu->equipment.Slot[k].EliteModel;
}
Buffer += (sizeof(structs::Texture_Struct) * EQ::textures::materialCount);
Buffer += (sizeof(structs::Texture_Struct) * EQEmu::textures::materialCount);
}
if (strlen(emu->title))
{
@@ -3146,7 +3146,7 @@ namespace SoD
for (int i = 0; i < spells::SPELL_GEM_COUNT; ++i)
emu->spell[i] = eq->spell[i];
for (int i = spells::SPELL_GEM_COUNT; i < EQ::spells::SPELL_GEM_COUNT; ++i)
for (int i = spells::SPELL_GEM_COUNT; i < EQEmu::spells::SPELL_GEM_COUNT; ++i)
emu->spell[i] = 0xFFFFFFFF;
FINISH_DIRECT_DECODE();
@@ -3440,9 +3440,9 @@ namespace SoD
return NextItemInstSerialNumber;
}
void SerializeItem(EQ::OutBuffer& ob, const EQ::ItemInstance *inst, int16 slot_id_in, uint8 depth)
void SerializeItem(EQEmu::OutBuffer& ob, const EQEmu::ItemInstance *inst, int16 slot_id_in, uint8 depth)
{
const EQ::ItemData *item = inst->GetUnscaledItem();
const EQEmu::ItemData *item = inst->GetUnscaledItem();
SoD::structs::ItemSerializationHeader hdr;
@@ -3631,12 +3631,6 @@ namespace SoD
itbs.no_transfer = item->NoTransfer;
itbs.expendablearrow = item->ExpendableArrow;
// Done to hack older clients to label expendable fishing poles as such
// July 28th, 2018 patch
if (item->ItemType == EQ::item::ItemTypeFishingPole && item->SubType == 0) {
itbs.expendablearrow = 1;
}
ob.write((const char*)&itbs, sizeof(SoD::structs::ItemTertiaryBodyStruct));
// Effect Structures Broken down to allow variable length strings for effect names
@@ -3757,30 +3751,30 @@ namespace SoD
ob.write((const char*)&iqbs, sizeof(SoD::structs::ItemQuaternaryBodyStruct));
EQ::OutBuffer::pos_type count_pos = ob.tellp();
EQEmu::OutBuffer::pos_type count_pos = ob.tellp();
uint32 subitem_count = 0;
ob.write((const char*)&subitem_count, sizeof(uint32));
// moved outside of loop since it is not modified within that scope
int16 SubSlotNumber = EQ::invbag::SLOT_INVALID;
int16 SubSlotNumber = EQEmu::invbag::SLOT_INVALID;
if (slot_id_in <= EQ::invslot::slotGeneral8 && slot_id_in >= EQ::invslot::GENERAL_BEGIN)
SubSlotNumber = EQ::invbag::GENERAL_BAGS_BEGIN + ((slot_id_in - EQ::invslot::GENERAL_BEGIN) * EQ::invbag::SLOT_COUNT);
else if (slot_id_in <= EQ::invslot::GENERAL_END && slot_id_in >= EQ::invslot::slotGeneral9)
SubSlotNumber = EQ::invbag::SLOT_INVALID;
else if (slot_id_in == EQ::invslot::slotCursor)
SubSlotNumber = EQ::invbag::CURSOR_BAG_BEGIN;
else if (slot_id_in <= EQ::invslot::BANK_END && slot_id_in >= EQ::invslot::BANK_BEGIN)
SubSlotNumber = EQ::invbag::BANK_BAGS_BEGIN + ((slot_id_in - EQ::invslot::BANK_BEGIN) * EQ::invbag::SLOT_COUNT);
else if (slot_id_in <= EQ::invslot::SHARED_BANK_END && slot_id_in >= EQ::invslot::SHARED_BANK_BEGIN)
SubSlotNumber = EQ::invbag::SHARED_BANK_BAGS_BEGIN + ((slot_id_in - EQ::invslot::SHARED_BANK_BEGIN) * EQ::invbag::SLOT_COUNT);
if (slot_id_in <= EQEmu::invslot::slotGeneral8 && slot_id_in >= EQEmu::invslot::GENERAL_BEGIN)
SubSlotNumber = EQEmu::invbag::GENERAL_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::GENERAL_BEGIN) * EQEmu::invbag::SLOT_COUNT);
else if (slot_id_in <= EQEmu::invslot::GENERAL_END && slot_id_in >= EQEmu::invslot::slotGeneral9)
SubSlotNumber = EQEmu::invbag::SLOT_INVALID;
else if (slot_id_in == EQEmu::invslot::slotCursor)
SubSlotNumber = EQEmu::invbag::CURSOR_BAG_BEGIN;
else if (slot_id_in <= EQEmu::invslot::BANK_END && slot_id_in >= EQEmu::invslot::BANK_BEGIN)
SubSlotNumber = EQEmu::invbag::BANK_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::BANK_BEGIN) * EQEmu::invbag::SLOT_COUNT);
else if (slot_id_in <= EQEmu::invslot::SHARED_BANK_END && slot_id_in >= EQEmu::invslot::SHARED_BANK_BEGIN)
SubSlotNumber = EQEmu::invbag::SHARED_BANK_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::SHARED_BANK_BEGIN) * EQEmu::invbag::SLOT_COUNT);
else
SubSlotNumber = slot_id_in; // not sure if this is the best way to handle this..leaving for now
if (SubSlotNumber != EQ::invbag::SLOT_INVALID) {
for (uint32 index = EQ::invbag::SLOT_BEGIN; index <= EQ::invbag::SLOT_END; ++index) {
EQ::ItemInstance* sub = inst->GetItem(index);
if (SubSlotNumber != EQEmu::invbag::SLOT_INVALID) {
for (uint32 index = EQEmu::invbag::SLOT_BEGIN; index <= EQEmu::invbag::SLOT_END; ++index) {
EQEmu::ItemInstance* sub = inst->GetItem(index);
if (!sub)
continue;
@@ -3799,59 +3793,59 @@ namespace SoD
{
uint32 SoDSlot = invslot::SLOT_INVALID;
if (serverSlot <= EQ::invslot::slotGeneral8) {
if (serverSlot <= EQEmu::invslot::slotGeneral8) {
SoDSlot = serverSlot;
}
else if (serverSlot <= EQ::invslot::CORPSE_END && serverSlot >= EQ::invslot::slotCursor) {
else if (serverSlot <= EQEmu::invslot::CORPSE_END && serverSlot >= EQEmu::invslot::slotCursor) {
SoDSlot = serverSlot - 2;
}
else if (serverSlot <= EQ::invbag::GENERAL_BAGS_8_END && serverSlot >= EQ::invbag::GENERAL_BAGS_BEGIN) {
else if (serverSlot <= EQEmu::invbag::GENERAL_BAGS_8_END && serverSlot >= EQEmu::invbag::GENERAL_BAGS_BEGIN) {
SoDSlot = serverSlot + 11;
}
else if (serverSlot <= EQ::invbag::CURSOR_BAG_END && serverSlot >= EQ::invbag::CURSOR_BAG_BEGIN) {
else if (serverSlot <= EQEmu::invbag::CURSOR_BAG_END && serverSlot >= EQEmu::invbag::CURSOR_BAG_BEGIN) {
SoDSlot = serverSlot - 9;
}
else if (serverSlot <= EQ::invslot::TRIBUTE_END && serverSlot >= EQ::invslot::TRIBUTE_BEGIN) {
else if (serverSlot <= EQEmu::invslot::TRIBUTE_END && serverSlot >= EQEmu::invslot::TRIBUTE_BEGIN) {
SoDSlot = serverSlot;
}
else if (serverSlot <= EQ::invslot::GUILD_TRIBUTE_END && serverSlot >= EQ::invslot::GUILD_TRIBUTE_BEGIN) {
else if (serverSlot <= EQEmu::invslot::GUILD_TRIBUTE_END && serverSlot >= EQEmu::invslot::GUILD_TRIBUTE_BEGIN) {
SoDSlot = serverSlot;
}
else if (serverSlot == EQ::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
else if (serverSlot == EQEmu::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
SoDSlot = serverSlot;
}
else if (serverSlot <= EQ::invslot::BANK_END && serverSlot >= EQ::invslot::BANK_BEGIN) {
else if (serverSlot <= EQEmu::invslot::BANK_END && serverSlot >= EQEmu::invslot::BANK_BEGIN) {
SoDSlot = serverSlot;
}
else if (serverSlot <= EQ::invbag::BANK_BAGS_END && serverSlot >= EQ::invbag::BANK_BAGS_BEGIN) {
else if (serverSlot <= EQEmu::invbag::BANK_BAGS_END && serverSlot >= EQEmu::invbag::BANK_BAGS_BEGIN) {
SoDSlot = serverSlot + 1;
}
else if (serverSlot <= EQ::invslot::SHARED_BANK_END && serverSlot >= EQ::invslot::SHARED_BANK_BEGIN) {
else if (serverSlot <= EQEmu::invslot::SHARED_BANK_END && serverSlot >= EQEmu::invslot::SHARED_BANK_BEGIN) {
SoDSlot = serverSlot;
}
else if (serverSlot <= EQ::invbag::SHARED_BANK_BAGS_END && serverSlot >= EQ::invbag::SHARED_BANK_BAGS_BEGIN) {
else if (serverSlot <= EQEmu::invbag::SHARED_BANK_BAGS_END && serverSlot >= EQEmu::invbag::SHARED_BANK_BAGS_BEGIN) {
SoDSlot = serverSlot + 1;
}
else if (serverSlot <= EQ::invslot::TRADE_END && serverSlot >= EQ::invslot::TRADE_BEGIN) {
else if (serverSlot <= EQEmu::invslot::TRADE_END && serverSlot >= EQEmu::invslot::TRADE_BEGIN) {
SoDSlot = serverSlot;
}
else if (serverSlot <= EQ::invbag::TRADE_BAGS_END && serverSlot >= EQ::invbag::TRADE_BAGS_BEGIN) {
else if (serverSlot <= EQEmu::invbag::TRADE_BAGS_END && serverSlot >= EQEmu::invbag::TRADE_BAGS_BEGIN) {
SoDSlot = serverSlot;
}
else if (serverSlot <= EQ::invslot::WORLD_END && serverSlot >= EQ::invslot::WORLD_BEGIN) {
else if (serverSlot <= EQEmu::invslot::WORLD_END && serverSlot >= EQEmu::invslot::WORLD_BEGIN) {
SoDSlot = serverSlot;
}
@@ -3864,11 +3858,11 @@ namespace SoD
{
uint32 SoDSlot = invslot::SLOT_INVALID;
if (server_corpse_slot <= EQ::invslot::slotGeneral8 && server_corpse_slot >= EQ::invslot::slotGeneral1) {
if (server_corpse_slot <= EQEmu::invslot::slotGeneral8 && server_corpse_slot >= EQEmu::invslot::slotGeneral1) {
SoDSlot = server_corpse_slot;
}
else if (server_corpse_slot <= EQ::invslot::CORPSE_END && server_corpse_slot >= EQ::invslot::slotCursor) {
else if (server_corpse_slot <= EQEmu::invslot::CORPSE_END && server_corpse_slot >= EQEmu::invslot::slotCursor) {
SoDSlot = server_corpse_slot - 2;
}
@@ -3879,7 +3873,7 @@ namespace SoD
static inline uint32 SoDToServerSlot(uint32 sod_slot)
{
uint32 server_slot = EQ::invslot::SLOT_INVALID;
uint32 server_slot = EQEmu::invslot::SLOT_INVALID;
if (sod_slot <= invslot::slotGeneral8) {
server_slot = sod_slot;
@@ -3944,7 +3938,7 @@ namespace SoD
static inline uint32 SoDToServerCorpseSlot(uint32 sod_corpse_slot)
{
uint32 server_slot = EQ::invslot::SLOT_INVALID;
uint32 server_slot = EQEmu::invslot::SLOT_INVALID;
if (sod_corpse_slot <= invslot::slotGeneral8 && sod_corpse_slot >= invslot::slotGeneral1) {
server_slot = sod_corpse_slot;
@@ -3961,7 +3955,7 @@ namespace SoD
static inline void ServerToSoDSayLink(std::string &sod_saylink, const std::string &server_saylink)
{
if ((constants::SAY_LINK_BODY_SIZE == EQ::constants::SAY_LINK_BODY_SIZE) || (server_saylink.find('\x12') == std::string::npos)) {
if ((constants::SAY_LINK_BODY_SIZE == EQEmu::constants::SAY_LINK_BODY_SIZE) || (server_saylink.find('\x12') == std::string::npos)) {
sod_saylink = server_saylink;
return;
}
@@ -3970,7 +3964,7 @@ namespace SoD
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
if (segment_iter & 1) {
if (segments[segment_iter].length() <= EQ::constants::SAY_LINK_BODY_SIZE) {
if (segments[segment_iter].length() <= EQEmu::constants::SAY_LINK_BODY_SIZE) {
sod_saylink.append(segments[segment_iter]);
// TODO: log size mismatch error
continue;
@@ -4001,7 +3995,7 @@ namespace SoD
static inline void SoDToServerSayLink(std::string &server_saylink, const std::string &sod_saylink)
{
if ((EQ::constants::SAY_LINK_BODY_SIZE == constants::SAY_LINK_BODY_SIZE) || (sod_saylink.find('\x12') == std::string::npos)) {
if ((EQEmu::constants::SAY_LINK_BODY_SIZE == constants::SAY_LINK_BODY_SIZE) || (sod_saylink.find('\x12') == std::string::npos)) {
server_saylink = sod_saylink;
return;
}
@@ -4035,84 +4029,84 @@ namespace SoD
}
}
static inline spells::CastingSlot ServerToSoDCastingSlot(EQ::spells::CastingSlot slot)
static inline spells::CastingSlot ServerToSoDCastingSlot(EQEmu::spells::CastingSlot slot)
{
switch (slot) {
case EQ::spells::CastingSlot::Gem1:
case EQEmu::spells::CastingSlot::Gem1:
return spells::CastingSlot::Gem1;
case EQ::spells::CastingSlot::Gem2:
case EQEmu::spells::CastingSlot::Gem2:
return spells::CastingSlot::Gem2;
case EQ::spells::CastingSlot::Gem3:
case EQEmu::spells::CastingSlot::Gem3:
return spells::CastingSlot::Gem3;
case EQ::spells::CastingSlot::Gem4:
case EQEmu::spells::CastingSlot::Gem4:
return spells::CastingSlot::Gem4;
case EQ::spells::CastingSlot::Gem5:
case EQEmu::spells::CastingSlot::Gem5:
return spells::CastingSlot::Gem5;
case EQ::spells::CastingSlot::Gem6:
case EQEmu::spells::CastingSlot::Gem6:
return spells::CastingSlot::Gem6;
case EQ::spells::CastingSlot::Gem7:
case EQEmu::spells::CastingSlot::Gem7:
return spells::CastingSlot::Gem7;
case EQ::spells::CastingSlot::Gem8:
case EQEmu::spells::CastingSlot::Gem8:
return spells::CastingSlot::Gem8;
case EQ::spells::CastingSlot::Gem9:
case EQEmu::spells::CastingSlot::Gem9:
return spells::CastingSlot::Gem9;
case EQ::spells::CastingSlot::Gem10:
case EQEmu::spells::CastingSlot::Gem10:
return spells::CastingSlot::Gem10;
case EQ::spells::CastingSlot::Item:
case EQ::spells::CastingSlot::PotionBelt:
case EQEmu::spells::CastingSlot::Item:
case EQEmu::spells::CastingSlot::PotionBelt:
return spells::CastingSlot::Item;
case EQ::spells::CastingSlot::Discipline:
case EQEmu::spells::CastingSlot::Discipline:
return spells::CastingSlot::Discipline;
case EQ::spells::CastingSlot::AltAbility:
case EQEmu::spells::CastingSlot::AltAbility:
return spells::CastingSlot::AltAbility;
default: // we shouldn't have any issues with other slots ... just return something
return spells::CastingSlot::Discipline;
}
}
static inline EQ::spells::CastingSlot SoDToServerCastingSlot(spells::CastingSlot slot)
static inline EQEmu::spells::CastingSlot SoDToServerCastingSlot(spells::CastingSlot slot)
{
switch (slot) {
case spells::CastingSlot::Gem1:
return EQ::spells::CastingSlot::Gem1;
return EQEmu::spells::CastingSlot::Gem1;
case spells::CastingSlot::Gem2:
return EQ::spells::CastingSlot::Gem2;
return EQEmu::spells::CastingSlot::Gem2;
case spells::CastingSlot::Gem3:
return EQ::spells::CastingSlot::Gem3;
return EQEmu::spells::CastingSlot::Gem3;
case spells::CastingSlot::Gem4:
return EQ::spells::CastingSlot::Gem4;
return EQEmu::spells::CastingSlot::Gem4;
case spells::CastingSlot::Gem5:
return EQ::spells::CastingSlot::Gem5;
return EQEmu::spells::CastingSlot::Gem5;
case spells::CastingSlot::Gem6:
return EQ::spells::CastingSlot::Gem6;
return EQEmu::spells::CastingSlot::Gem6;
case spells::CastingSlot::Gem7:
return EQ::spells::CastingSlot::Gem7;
return EQEmu::spells::CastingSlot::Gem7;
case spells::CastingSlot::Gem8:
return EQ::spells::CastingSlot::Gem8;
return EQEmu::spells::CastingSlot::Gem8;
case spells::CastingSlot::Gem9:
return EQ::spells::CastingSlot::Gem9;
return EQEmu::spells::CastingSlot::Gem9;
case spells::CastingSlot::Gem10:
return EQ::spells::CastingSlot::Gem10;
return EQEmu::spells::CastingSlot::Gem10;
case spells::CastingSlot::Discipline:
return EQ::spells::CastingSlot::Discipline;
return EQEmu::spells::CastingSlot::Discipline;
case spells::CastingSlot::Item:
return EQ::spells::CastingSlot::Item;
return EQEmu::spells::CastingSlot::Item;
case spells::CastingSlot::AltAbility:
return EQ::spells::CastingSlot::AltAbility;
return EQEmu::spells::CastingSlot::AltAbility;
default: // we shouldn't have any issues with other slots ... just return something
return EQ::spells::CastingSlot::Discipline;
return EQEmu::spells::CastingSlot::Discipline;
}
}
static inline int ServerToSoDBuffSlot(int index)
{
// we're a disc
if (index >= EQ::spells::LONG_BUFFS + EQ::spells::SHORT_BUFFS)
return index - EQ::spells::LONG_BUFFS - EQ::spells::SHORT_BUFFS +
if (index >= EQEmu::spells::LONG_BUFFS + EQEmu::spells::SHORT_BUFFS)
return index - EQEmu::spells::LONG_BUFFS - EQEmu::spells::SHORT_BUFFS +
spells::LONG_BUFFS + spells::SHORT_BUFFS;
// we're a song
if (index >= EQ::spells::LONG_BUFFS)
return index - EQ::spells::LONG_BUFFS + spells::LONG_BUFFS;
if (index >= EQEmu::spells::LONG_BUFFS)
return index - EQEmu::spells::LONG_BUFFS + spells::LONG_BUFFS;
// we're a normal buff
return index; // as long as we guard against bad slots server side, we should be fine
}
@@ -4121,11 +4115,11 @@ namespace SoD
{
// we're a disc
if (index >= spells::LONG_BUFFS + spells::SHORT_BUFFS)
return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQ::spells::LONG_BUFFS +
EQ::spells::SHORT_BUFFS;
return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQEmu::spells::LONG_BUFFS +
EQEmu::spells::SHORT_BUFFS;
// we're a song
if (index >= spells::LONG_BUFFS)
return index - spells::LONG_BUFFS + EQ::spells::LONG_BUFFS;
return index - spells::LONG_BUFFS + EQEmu::spells::LONG_BUFFS;
// we're a normal buff
return index; // as long as we guard against bad slots server side, we should be fine
}
+1 -1
View File
@@ -43,7 +43,7 @@ namespace SoD
protected:
virtual std::string Describe() const;
virtual const EQ::versions::ClientVersion ClientVersion() const;
virtual const EQEmu::versions::ClientVersion ClientVersion() const;
//magic macro to declare our opcode processors
#include "ss_declare.h"
+15 -15
View File
@@ -31,7 +31,7 @@ namespace SoD
const int16 INULL = 0;
namespace inventory {
inline EQ::versions::ClientVersion GetInventoryRef() { return EQ::versions::ClientVersion::SoD; }
inline EQEmu::versions::ClientVersion GetInventoryRef() { return EQEmu::versions::ClientVersion::SoD; }
const bool ConcatenateInvTypeLimbo = true;
@@ -43,7 +43,7 @@ namespace SoD
} /*inventory*/
namespace invtype {
inline EQ::versions::ClientVersion GetInvTypeRef() { return EQ::versions::ClientVersion::SoD; }
inline EQEmu::versions::ClientVersion GetInvTypeRef() { return EQEmu::versions::ClientVersion::SoD; }
namespace enum_ {
enum InventoryTypes : int16 {
@@ -106,7 +106,7 @@ namespace SoD
} /*invtype*/
namespace invslot {
inline EQ::versions::ClientVersion GetInvSlotRef() { return EQ::versions::ClientVersion::SoD; }
inline EQEmu::versions::ClientVersion GetInvSlotRef() { return EQEmu::versions::ClientVersion::SoD; }
namespace enum_ {
enum InventorySlots : int16 {
@@ -205,7 +205,7 @@ namespace SoD
} /*invslot*/
namespace invbag {
inline EQ::versions::ClientVersion GetInvBagRef() { return EQ::versions::ClientVersion::SoD; }
inline EQEmu::versions::ClientVersion GetInvBagRef() { return EQEmu::versions::ClientVersion::SoD; }
const int16 SLOT_INVALID = IINVALID;
const int16 SLOT_BEGIN = INULL;
@@ -237,7 +237,7 @@ namespace SoD
} /*invbag*/
namespace invaug {
inline EQ::versions::ClientVersion GetInvAugRef() { return EQ::versions::ClientVersion::SoD; }
inline EQEmu::versions::ClientVersion GetInvAugRef() { return EQEmu::versions::ClientVersion::SoD; }
const int16 SOCKET_INVALID = IINVALID;
const int16 SOCKET_BEGIN = INULL;
@@ -249,7 +249,7 @@ namespace SoD
} /*invaug*/
namespace item {
inline EQ::versions::ClientVersion GetItemRef() { return EQ::versions::ClientVersion::SoD; }
inline EQEmu::versions::ClientVersion GetItemRef() { return EQEmu::versions::ClientVersion::SoD; }
enum ItemPacketType : int {
ItemPacketMerchant = 100,
@@ -267,7 +267,7 @@ namespace SoD
} /*item*/
namespace profile {
inline EQ::versions::ClientVersion GetProfileRef() { return EQ::versions::ClientVersion::SoD; }
inline EQEmu::versions::ClientVersion GetProfileRef() { return EQEmu::versions::ClientVersion::SoD; }
const int16 BANDOLIERS_SIZE = 20; // number of bandolier instances
const int16 BANDOLIER_ITEM_COUNT = 4; // number of equipment slots in bandolier instance
@@ -279,11 +279,11 @@ namespace SoD
} /*profile*/
namespace constants {
inline EQ::versions::ClientVersion GetConstantsRef() { return EQ::versions::ClientVersion::SoD; }
inline EQEmu::versions::ClientVersion GetConstantsRef() { return EQEmu::versions::ClientVersion::SoD; }
const EQ::expansions::Expansion EXPANSION = EQ::expansions::Expansion::SoD;
const uint32 EXPANSION_BIT = EQ::expansions::bitSoD;
const uint32 EXPANSIONS_MASK = EQ::expansions::maskSoD;
const EQEmu::expansions::Expansion EXPANSION = EQEmu::expansions::Expansion::SoD;
const uint32 EXPANSION_BIT = EQEmu::expansions::bitSoD;
const uint32 EXPANSIONS_MASK = EQEmu::expansions::maskSoD;
const size_t CHARACTER_CREATION_LIMIT = 12;
@@ -292,21 +292,21 @@ namespace SoD
} /*constants*/
namespace behavior {
inline EQ::versions::ClientVersion GetBehaviorRef() { return EQ::versions::ClientVersion::SoD; }
inline EQEmu::versions::ClientVersion GetBehaviorRef() { return EQEmu::versions::ClientVersion::SoD; }
const bool CoinHasWeight = false;
} /*behavior*/
namespace skills {
inline EQ::versions::ClientVersion GetSkillsRef() { return EQ::versions::ClientVersion::SoD; }
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::SoD; }
const size_t LastUsableSkill = EQ::skills::SkillTripleAttack;
const size_t LastUsableSkill = EQEmu::skills::SkillTripleAttack;
} /*skills*/
namespace spells {
inline EQ::versions::ClientVersion GetSkillsRef() { return EQ::versions::ClientVersion::SoD; }
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::SoD; }
enum class CastingSlot : uint32 {
Gem1 = 0,
+3 -3
View File
@@ -149,7 +149,7 @@ struct TintProfile
Tint_Struct Primary;
Tint_Struct Secondary;
};
Tint_Struct Slot[EQ::textures::materialCount];
Tint_Struct Slot[EQEmu::textures::materialCount];
};
};
@@ -178,7 +178,7 @@ struct TextureProfile
Texture_Struct Primary;
Texture_Struct Secondary;
};
Texture_Struct Slot[EQ::textures::materialCount];
Texture_Struct Slot[EQEmu::textures::materialCount];
};
TextureProfile();
@@ -195,7 +195,7 @@ struct CharacterSelectEntry_Struct
/*0000*/ uint8 Beard; //
/*0001*/ uint8 HairColor; //
/*0000*/ uint8 Face; //
/*0000*/ CharSelectEquip Equip[EQ::textures::materialCount];
/*0000*/ CharSelectEquip Equip[EQEmu::textures::materialCount];
/*0000*/ uint32 PrimaryIDFile; //
/*0000*/ uint32 SecondaryIDFile; //
/*0000*/ uint8 Unknown15; // 0xff
+105 -111
View File
@@ -43,7 +43,7 @@ namespace SoF
static OpcodeManager *opcodes = nullptr;
static Strategy struct_strategy;
void SerializeItem(EQ::OutBuffer& ob, const EQ::ItemInstance *inst, int16 slot_id, uint8 depth);
void SerializeItem(EQEmu::OutBuffer& ob, const EQEmu::ItemInstance *inst, int16 slot_id, uint8 depth);
// server to client inventory location converters
static inline uint32 ServerToSoFSlot(uint32 server_slot);
@@ -59,8 +59,8 @@ namespace SoF
// client to server say link converter
static inline void SoFToServerSayLink(std::string &server_saylink, const std::string &sof_saylink);
static inline spells::CastingSlot ServerToSoFCastingSlot(EQ::spells::CastingSlot slot);
static inline EQ::spells::CastingSlot SoFToServerCastingSlot(spells::CastingSlot slot, uint32 item_location);
static inline spells::CastingSlot ServerToSoFCastingSlot(EQEmu::spells::CastingSlot slot);
static inline EQEmu::spells::CastingSlot SoFToServerCastingSlot(spells::CastingSlot slot, uint32 item_location);
static inline int ServerToSoFBuffSlot(int index);
static inline int SoFToServerBuffSlot(int index);
@@ -142,9 +142,9 @@ namespace SoF
return(r);
}
const EQ::versions::ClientVersion Strategy::ClientVersion() const
const EQEmu::versions::ClientVersion Strategy::ClientVersion() const
{
return EQ::versions::ClientVersion::SoF;
return EQEmu::versions::ClientVersion::SoF;
}
#include "ss_define.h"
@@ -361,24 +361,24 @@ namespace SoF
//store away the emu struct
uchar* __emu_buffer = in->pBuffer;
int item_count = in->size / sizeof(EQ::InternalSerializedItem_Struct);
if (!item_count || (in->size % sizeof(EQ::InternalSerializedItem_Struct)) != 0) {
int item_count = in->size / sizeof(EQEmu::InternalSerializedItem_Struct);
if (!item_count || (in->size % sizeof(EQEmu::InternalSerializedItem_Struct)) != 0) {
Log(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(EQ::InternalSerializedItem_Struct));
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(EQEmu::InternalSerializedItem_Struct));
delete in;
return;
}
EQ::InternalSerializedItem_Struct* eq = (EQ::InternalSerializedItem_Struct*)in->pBuffer;
EQEmu::InternalSerializedItem_Struct* eq = (EQEmu::InternalSerializedItem_Struct*)in->pBuffer;
EQ::OutBuffer ob;
EQ::OutBuffer::pos_type last_pos = ob.tellp();
EQEmu::OutBuffer ob;
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
ob.write((const char*)&item_count, sizeof(uint32));
for (int index = 0; index < item_count; ++index, ++eq) {
SerializeItem(ob, (const EQ::ItemInstance*)eq->inst, eq->slot_id, 0);
SerializeItem(ob, (const EQEmu::ItemInstance*)eq->inst, eq->slot_id, 0);
if (ob.tellp() == last_pos)
LogNetcode("SoF::ENCODE(OP_CharInventory) Serialization failed on item slot [{}] during OP_CharInventory. Item skipped", eq->slot_id);
@@ -855,14 +855,14 @@ namespace SoF
//store away the emu struct
uchar* __emu_buffer = in->pBuffer;
EQ::InternalSerializedItem_Struct* int_struct = (EQ::InternalSerializedItem_Struct*)(&__emu_buffer[4]);
EQEmu::InternalSerializedItem_Struct* int_struct = (EQEmu::InternalSerializedItem_Struct*)(&__emu_buffer[4]);
EQ::OutBuffer ob;
EQ::OutBuffer::pos_type last_pos = ob.tellp();
EQEmu::OutBuffer ob;
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
ob.write((const char*)__emu_buffer, 4);
SerializeItem(ob, (const EQ::ItemInstance*)int_struct->inst, int_struct->slot_id, 0);
SerializeItem(ob, (const EQEmu::ItemInstance*)int_struct->inst, int_struct->slot_id, 0);
if (ob.tellp() == last_pos) {
LogNetcode("SoF::ENCODE(OP_ItemPacket) Serialization failed on item slot [{}]", int_struct->slot_id);
delete in;
@@ -956,7 +956,7 @@ namespace SoF
// Since HT/LoH are translated up, we need to translate down only for memSpellSpellbar case
if (emu->scribing == 3)
eq->slot = static_cast<uint32>(ServerToSoFCastingSlot(static_cast<EQ::spells::CastingSlot>(emu->slot)));
eq->slot = static_cast<uint32>(ServerToSoFCastingSlot(static_cast<EQEmu::spells::CastingSlot>(emu->slot)));
else
OUT(slot);
OUT(spell_id);
@@ -1130,7 +1130,7 @@ namespace SoF
OUT(hairstyle);
OUT(beard);
// OUT(unknown00178[10]);
for (r = EQ::textures::textureBegin; r < EQ::textures::materialCount; r++) {
for (r = EQEmu::textures::textureBegin; r < EQEmu::textures::materialCount; r++) {
eq->equipment.Slot[r].Material = emu->item_material.Slot[r].Material;
eq->equipment.Slot[r].Unknown1 = 0;
eq->equipment.Slot[r].EliteMaterial = 0;
@@ -1160,7 +1160,7 @@ namespace SoF
OUT(face);
// OUT(unknown02264[47]);
if (spells::SPELLBOOK_SIZE <= EQ::spells::SPELLBOOK_SIZE) {
if (spells::SPELLBOOK_SIZE <= EQEmu::spells::SPELLBOOK_SIZE) {
for (uint32 r = 0; r < spells::SPELLBOOK_SIZE; r++) {
if (emu->spell_book[r] <= spells::SPELL_ID_MAX)
eq->spell_book[r] = emu->spell_book[r];
@@ -1169,14 +1169,14 @@ namespace SoF
}
}
else {
for (uint32 r = 0; r < EQ::spells::SPELLBOOK_SIZE; r++) {
for (uint32 r = 0; r < EQEmu::spells::SPELLBOOK_SIZE; r++) {
if (emu->spell_book[r] <= spells::SPELL_ID_MAX)
eq->spell_book[r] = emu->spell_book[r];
else
eq->spell_book[r] = 0xFFFFFFFFU;
}
// invalidate the rest of the spellbook slots
memset(&eq->spell_book[EQ::spells::SPELLBOOK_SIZE], 0xFF, (sizeof(uint32) * (spells::SPELLBOOK_SIZE - EQ::spells::SPELLBOOK_SIZE)));
memset(&eq->spell_book[EQEmu::spells::SPELLBOOK_SIZE], 0xFF, (sizeof(uint32) * (spells::SPELLBOOK_SIZE - EQEmu::spells::SPELLBOOK_SIZE)));
}
// OUT(unknown4184[128]);
@@ -1223,7 +1223,7 @@ namespace SoF
// OUT(unknown06160[4]);
// Copy bandoliers where server and client indices converge
for (r = 0; r < EQ::profile::BANDOLIERS_SIZE && r < profile::BANDOLIERS_SIZE; ++r) {
for (r = 0; r < EQEmu::profile::BANDOLIERS_SIZE && r < profile::BANDOLIERS_SIZE; ++r) {
OUT_str(bandoliers[r].Name);
for (uint32 k = 0; k < profile::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
OUT(bandoliers[r].Items[k].ID);
@@ -1232,7 +1232,7 @@ namespace SoF
}
}
// Nullify bandoliers where server and client indices diverge, with a client bias
for (r = EQ::profile::BANDOLIERS_SIZE; r < profile::BANDOLIERS_SIZE; ++r) {
for (r = EQEmu::profile::BANDOLIERS_SIZE; r < profile::BANDOLIERS_SIZE; ++r) {
eq->bandoliers[r].Name[0] = '\0';
for (uint32 k = 0; k < profile::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
eq->bandoliers[r].Items[k].ID = 0;
@@ -1244,13 +1244,13 @@ namespace SoF
// OUT(unknown07444[5120]);
// Copy potion belt where server and client indices converge
for (r = 0; r < EQ::profile::POTION_BELT_SIZE && r < profile::POTION_BELT_SIZE; ++r) {
for (r = 0; r < EQEmu::profile::POTION_BELT_SIZE && r < profile::POTION_BELT_SIZE; ++r) {
OUT(potionbelt.Items[r].ID);
OUT(potionbelt.Items[r].Icon);
OUT_str(potionbelt.Items[r].Name);
}
// Nullify potion belt where server and client indices diverge, with a client bias
for (r = EQ::profile::POTION_BELT_SIZE; r < profile::POTION_BELT_SIZE; ++r) {
for (r = EQEmu::profile::POTION_BELT_SIZE; r < profile::POTION_BELT_SIZE; ++r) {
eq->potionbelt.Items[r].ID = 0;
eq->potionbelt.Items[r].Icon = 0;
eq->potionbelt.Items[r].Name[0] = '\0';
@@ -1593,7 +1593,7 @@ namespace SoF
eq_cse->HairColor = emu_cse->HairColor;
eq_cse->Face = emu_cse->Face;
for (int equip_index = EQ::textures::textureBegin; equip_index < EQ::textures::materialCount; equip_index++) {
for (int equip_index = EQEmu::textures::textureBegin; equip_index < EQEmu::textures::materialCount; equip_index++) {
eq_cse->Equip[equip_index].Material = emu_cse->Equip[equip_index].Material;
eq_cse->Equip[equip_index].Unknown1 = emu_cse->Equip[equip_index].Unknown1;
eq_cse->Equip[equip_index].EliteMaterial = emu_cse->Equip[equip_index].EliteModel;
@@ -2015,7 +2015,7 @@ namespace SoF
eq->deity = emu->deity;
eq->drakkin_heritage = emu->drakkin_heritage;
eq->gender = emu->gender;
for (k = EQ::textures::textureBegin; k < EQ::textures::materialCount; k++) {
for (k = EQEmu::textures::textureBegin; k < EQEmu::textures::materialCount; k++) {
eq->equipment.Slot[k].Material = emu->equipment.Slot[k].Material;
eq->equipment.Slot[k].Unknown1 = emu->equipment.Slot[k].Unknown1;
eq->equipment.Slot[k].EliteMaterial = emu->equipment.Slot[k].EliteModel;
@@ -2081,7 +2081,7 @@ namespace SoF
strcpy(eq->name, emu->name);
eq->petOwnerId = emu->petOwnerId;
eq->pvp = 0; // 0 = non-pvp colored name, 1 = red pvp name
for (k = EQ::textures::textureBegin; k < EQ::textures::materialCount; k++) {
for (k = EQEmu::textures::textureBegin; k < EQEmu::textures::materialCount; k++) {
eq->equipment_tint.Slot[k].Color = emu->equipment_tint.Slot[k].Color;
}
eq->anon = emu->anon;
@@ -2300,7 +2300,7 @@ namespace SoF
DECODE_LENGTH_EXACT(structs::BugReport_Struct);
SETUP_DIRECT_DECODE(BugReport_Struct, structs::BugReport_Struct);
emu->category_id = EQ::bug::CategoryNameToCategoryID(eq->category_name);
emu->category_id = EQEmu::bug::CategoryNameToCategoryID(eq->category_name);
memcpy(emu->category_name, eq, sizeof(structs::BugReport_Struct));
FINISH_DIRECT_DECODE();
@@ -2556,7 +2556,7 @@ namespace SoF
for (int i = 0; i < spells::SPELL_GEM_COUNT; ++i)
IN(spell[i]);
for (int i = spells::SPELL_GEM_COUNT; i < EQ::spells::SPELL_GEM_COUNT; ++i)
for (int i = spells::SPELL_GEM_COUNT; i < EQEmu::spells::SPELL_GEM_COUNT; ++i)
emu->spell[i] = 0xFFFFFFFF;
IN(unknown);
@@ -2838,9 +2838,9 @@ namespace SoF
return NextItemInstSerialNumber;
}
void SerializeItem(EQ::OutBuffer& ob, const EQ::ItemInstance *inst, int16 slot_id_in, uint8 depth)
void SerializeItem(EQEmu::OutBuffer& ob, const EQEmu::ItemInstance *inst, int16 slot_id_in, uint8 depth)
{
const EQ::ItemData *item = inst->GetUnscaledItem();
const EQEmu::ItemData *item = inst->GetUnscaledItem();
SoF::structs::ItemSerializationHeader hdr;
@@ -3028,12 +3028,6 @@ namespace SoF
itbs.no_transfer = item->NoTransfer;
itbs.expendablearrow = item->ExpendableArrow;
// Done to hack older clients to label expendable fishing poles as such
// July 28th, 2018 patch
if (item->ItemType == EQ::item::ItemTypeFishingPole && item->SubType == 0) {
itbs.expendablearrow = 1;
}
ob.write((const char*)&itbs, sizeof(SoF::structs::ItemTertiaryBodyStruct));
// Effect Structures Broken down to allow variable length strings for effect names
@@ -3153,30 +3147,30 @@ namespace SoF
ob.write((const char*)&iqbs, sizeof(SoF::structs::ItemQuaternaryBodyStruct));
EQ::OutBuffer::pos_type count_pos = ob.tellp();
EQEmu::OutBuffer::pos_type count_pos = ob.tellp();
uint32 subitem_count = 0;
ob.write((const char*)&subitem_count, sizeof(uint32));
// moved outside of loop since it is not modified within that scope
int16 SubSlotNumber = EQ::invbag::SLOT_INVALID;
int16 SubSlotNumber = EQEmu::invbag::SLOT_INVALID;
if (slot_id_in <= EQ::invslot::slotGeneral8 && slot_id_in >= EQ::invslot::GENERAL_BEGIN)
SubSlotNumber = EQ::invbag::GENERAL_BAGS_BEGIN + ((slot_id_in - EQ::invslot::GENERAL_BEGIN) * EQ::invbag::SLOT_COUNT);
else if (slot_id_in <= EQ::invslot::GENERAL_END && slot_id_in >= EQ::invslot::slotGeneral9)
SubSlotNumber = EQ::invbag::SLOT_INVALID;
else if (slot_id_in == EQ::invslot::slotCursor)
SubSlotNumber = EQ::invbag::CURSOR_BAG_BEGIN;
else if (slot_id_in <= EQ::invslot::BANK_END && slot_id_in >= EQ::invslot::BANK_BEGIN)
SubSlotNumber = EQ::invbag::BANK_BAGS_BEGIN + ((slot_id_in - EQ::invslot::BANK_BEGIN) * EQ::invbag::SLOT_COUNT);
else if (slot_id_in <= EQ::invslot::SHARED_BANK_END && slot_id_in >= EQ::invslot::SHARED_BANK_BEGIN)
SubSlotNumber = EQ::invbag::SHARED_BANK_BAGS_BEGIN + ((slot_id_in - EQ::invslot::SHARED_BANK_BEGIN) * EQ::invbag::SLOT_COUNT);
if (slot_id_in <= EQEmu::invslot::slotGeneral8 && slot_id_in >= EQEmu::invslot::GENERAL_BEGIN)
SubSlotNumber = EQEmu::invbag::GENERAL_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::GENERAL_BEGIN) * EQEmu::invbag::SLOT_COUNT);
else if (slot_id_in <= EQEmu::invslot::GENERAL_END && slot_id_in >= EQEmu::invslot::slotGeneral9)
SubSlotNumber = EQEmu::invbag::SLOT_INVALID;
else if (slot_id_in == EQEmu::invslot::slotCursor)
SubSlotNumber = EQEmu::invbag::CURSOR_BAG_BEGIN;
else if (slot_id_in <= EQEmu::invslot::BANK_END && slot_id_in >= EQEmu::invslot::BANK_BEGIN)
SubSlotNumber = EQEmu::invbag::BANK_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::BANK_BEGIN) * EQEmu::invbag::SLOT_COUNT);
else if (slot_id_in <= EQEmu::invslot::SHARED_BANK_END && slot_id_in >= EQEmu::invslot::SHARED_BANK_BEGIN)
SubSlotNumber = EQEmu::invbag::SHARED_BANK_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::SHARED_BANK_BEGIN) * EQEmu::invbag::SLOT_COUNT);
else
SubSlotNumber = slot_id_in; // not sure if this is the best way to handle this..leaving for now
if (SubSlotNumber != EQ::invbag::SLOT_INVALID) {
for (uint32 index = EQ::invbag::SLOT_BEGIN; index <= EQ::invbag::SLOT_END; ++index) {
EQ::ItemInstance* sub = inst->GetItem(index);
if (SubSlotNumber != EQEmu::invbag::SLOT_INVALID) {
for (uint32 index = EQEmu::invbag::SLOT_BEGIN; index <= EQEmu::invbag::SLOT_END; ++index) {
EQEmu::ItemInstance* sub = inst->GetItem(index);
if (!sub)
continue;
@@ -3195,59 +3189,59 @@ namespace SoF
{
uint32 sof_slot = invslot::SLOT_INVALID;
if (server_slot <= EQ::invslot::slotGeneral8) {
if (server_slot <= EQEmu::invslot::slotGeneral8) {
sof_slot = server_slot;
}
else if (server_slot <= EQ::invslot::CORPSE_END && server_slot >= EQ::invslot::slotCursor) {
else if (server_slot <= EQEmu::invslot::CORPSE_END && server_slot >= EQEmu::invslot::slotCursor) {
sof_slot = server_slot - 2;
}
else if (server_slot <= EQ::invbag::GENERAL_BAGS_8_END && server_slot >= EQ::invbag::GENERAL_BAGS_BEGIN) {
else if (server_slot <= EQEmu::invbag::GENERAL_BAGS_8_END && server_slot >= EQEmu::invbag::GENERAL_BAGS_BEGIN) {
sof_slot = server_slot + 11;
}
else if (server_slot <= EQ::invbag::CURSOR_BAG_END && server_slot >= EQ::invbag::CURSOR_BAG_BEGIN) {
else if (server_slot <= EQEmu::invbag::CURSOR_BAG_END && server_slot >= EQEmu::invbag::CURSOR_BAG_BEGIN) {
sof_slot = server_slot - 9;
}
else if (server_slot <= EQ::invslot::TRIBUTE_END && server_slot >= EQ::invslot::TRIBUTE_BEGIN) {
else if (server_slot <= EQEmu::invslot::TRIBUTE_END && server_slot >= EQEmu::invslot::TRIBUTE_BEGIN) {
sof_slot = server_slot;
}
else if (server_slot <= EQ::invslot::GUILD_TRIBUTE_END && server_slot >= EQ::invslot::GUILD_TRIBUTE_BEGIN) {
else if (server_slot <= EQEmu::invslot::GUILD_TRIBUTE_END && server_slot >= EQEmu::invslot::GUILD_TRIBUTE_BEGIN) {
sof_slot = server_slot;
}
else if (server_slot == EQ::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
else if (server_slot == EQEmu::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
sof_slot = server_slot;
}
else if (server_slot <= EQ::invslot::BANK_END && server_slot >= EQ::invslot::BANK_BEGIN) {
else if (server_slot <= EQEmu::invslot::BANK_END && server_slot >= EQEmu::invslot::BANK_BEGIN) {
sof_slot = server_slot;
}
else if (server_slot <= EQ::invbag::BANK_BAGS_END && server_slot >= EQ::invbag::BANK_BAGS_BEGIN) {
else if (server_slot <= EQEmu::invbag::BANK_BAGS_END && server_slot >= EQEmu::invbag::BANK_BAGS_BEGIN) {
sof_slot = server_slot + 1;
}
else if (server_slot <= EQ::invslot::SHARED_BANK_END && server_slot >= EQ::invslot::SHARED_BANK_BEGIN) {
else if (server_slot <= EQEmu::invslot::SHARED_BANK_END && server_slot >= EQEmu::invslot::SHARED_BANK_BEGIN) {
sof_slot = server_slot;
}
else if (server_slot <= EQ::invbag::SHARED_BANK_BAGS_END && server_slot >= EQ::invbag::SHARED_BANK_BAGS_BEGIN) {
else if (server_slot <= EQEmu::invbag::SHARED_BANK_BAGS_END && server_slot >= EQEmu::invbag::SHARED_BANK_BAGS_BEGIN) {
sof_slot = server_slot + 1;
}
else if (server_slot <= EQ::invslot::TRADE_END && server_slot >= EQ::invslot::TRADE_BEGIN) {
else if (server_slot <= EQEmu::invslot::TRADE_END && server_slot >= EQEmu::invslot::TRADE_BEGIN) {
sof_slot = server_slot;
}
else if (server_slot <= EQ::invbag::TRADE_BAGS_END && server_slot >= EQ::invbag::TRADE_BAGS_BEGIN) {
else if (server_slot <= EQEmu::invbag::TRADE_BAGS_END && server_slot >= EQEmu::invbag::TRADE_BAGS_BEGIN) {
sof_slot = server_slot;
}
else if (server_slot <= EQ::invslot::WORLD_END && server_slot >= EQ::invslot::WORLD_BEGIN) {
else if (server_slot <= EQEmu::invslot::WORLD_END && server_slot >= EQEmu::invslot::WORLD_BEGIN) {
sof_slot = server_slot;
}
@@ -3260,11 +3254,11 @@ namespace SoF
{
uint32 SoFSlot = invslot::SLOT_INVALID;
if (server_corpse_slot <= EQ::invslot::slotGeneral8 && server_corpse_slot >= EQ::invslot::slotGeneral1) {
if (server_corpse_slot <= EQEmu::invslot::slotGeneral8 && server_corpse_slot >= EQEmu::invslot::slotGeneral1) {
SoFSlot = server_corpse_slot;
}
else if (server_corpse_slot <= EQ::invslot::CORPSE_END && server_corpse_slot >= EQ::invslot::slotCursor) {
else if (server_corpse_slot <= EQEmu::invslot::CORPSE_END && server_corpse_slot >= EQEmu::invslot::slotCursor) {
SoFSlot = server_corpse_slot - 2;
}
@@ -3279,7 +3273,7 @@ namespace SoF
static inline uint32 SoFToServerSlot(uint32 sof_slot)
{
uint32 server_slot = EQ::invslot::SLOT_INVALID;
uint32 server_slot = EQEmu::invslot::SLOT_INVALID;
if (sof_slot <= invslot::slotGeneral8) {
server_slot = sof_slot;
@@ -3344,7 +3338,7 @@ namespace SoF
static inline uint32 SoFToServerCorpseSlot(uint32 sof_corpse_slot)
{
uint32 server_slot = EQ::invslot::SLOT_INVALID;
uint32 server_slot = EQEmu::invslot::SLOT_INVALID;
if (sof_corpse_slot <= invslot::slotGeneral8 && sof_corpse_slot >= invslot::slotGeneral1) {
server_slot = sof_corpse_slot;
@@ -3365,7 +3359,7 @@ namespace SoF
static inline void ServerToSoFSayLink(std::string &sof_saylink, const std::string &server_saylink)
{
if ((constants::SAY_LINK_BODY_SIZE == EQ::constants::SAY_LINK_BODY_SIZE) || (server_saylink.find('\x12') == std::string::npos)) {
if ((constants::SAY_LINK_BODY_SIZE == EQEmu::constants::SAY_LINK_BODY_SIZE) || (server_saylink.find('\x12') == std::string::npos)) {
sof_saylink = server_saylink;
return;
}
@@ -3374,7 +3368,7 @@ namespace SoF
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
if (segment_iter & 1) {
if (segments[segment_iter].length() <= EQ::constants::SAY_LINK_BODY_SIZE) {
if (segments[segment_iter].length() <= EQEmu::constants::SAY_LINK_BODY_SIZE) {
sof_saylink.append(segments[segment_iter]);
// TODO: log size mismatch error
continue;
@@ -3405,7 +3399,7 @@ namespace SoF
static inline void SoFToServerSayLink(std::string &server_saylink, const std::string &sof_saylink)
{
if ((EQ::constants::SAY_LINK_BODY_SIZE == constants::SAY_LINK_BODY_SIZE) || (sof_saylink.find('\x12') == std::string::npos)) {
if ((EQEmu::constants::SAY_LINK_BODY_SIZE == constants::SAY_LINK_BODY_SIZE) || (sof_saylink.find('\x12') == std::string::npos)) {
server_saylink = sof_saylink;
return;
}
@@ -3439,84 +3433,84 @@ namespace SoF
}
}
static inline spells::CastingSlot ServerToSoFCastingSlot(EQ::spells::CastingSlot slot) {
static inline spells::CastingSlot ServerToSoFCastingSlot(EQEmu::spells::CastingSlot slot) {
switch (slot) {
case EQ::spells::CastingSlot::Gem1:
case EQEmu::spells::CastingSlot::Gem1:
return spells::CastingSlot::Gem1;
case EQ::spells::CastingSlot::Gem2:
case EQEmu::spells::CastingSlot::Gem2:
return spells::CastingSlot::Gem2;
case EQ::spells::CastingSlot::Gem3:
case EQEmu::spells::CastingSlot::Gem3:
return spells::CastingSlot::Gem3;
case EQ::spells::CastingSlot::Gem4:
case EQEmu::spells::CastingSlot::Gem4:
return spells::CastingSlot::Gem4;
case EQ::spells::CastingSlot::Gem5:
case EQEmu::spells::CastingSlot::Gem5:
return spells::CastingSlot::Gem5;
case EQ::spells::CastingSlot::Gem6:
case EQEmu::spells::CastingSlot::Gem6:
return spells::CastingSlot::Gem6;
case EQ::spells::CastingSlot::Gem7:
case EQEmu::spells::CastingSlot::Gem7:
return spells::CastingSlot::Gem7;
case EQ::spells::CastingSlot::Gem8:
case EQEmu::spells::CastingSlot::Gem8:
return spells::CastingSlot::Gem8;
case EQ::spells::CastingSlot::Gem9:
case EQEmu::spells::CastingSlot::Gem9:
return spells::CastingSlot::Gem9;
case EQ::spells::CastingSlot::Item:
case EQEmu::spells::CastingSlot::Item:
return spells::CastingSlot::Item;
case EQ::spells::CastingSlot::PotionBelt:
case EQEmu::spells::CastingSlot::PotionBelt:
return spells::CastingSlot::PotionBelt;
case EQ::spells::CastingSlot::Discipline:
case EQEmu::spells::CastingSlot::Discipline:
return spells::CastingSlot::Discipline;
case EQ::spells::CastingSlot::AltAbility:
case EQEmu::spells::CastingSlot::AltAbility:
return spells::CastingSlot::AltAbility;
default: // we shouldn't have any issues with other slots ... just return something
return spells::CastingSlot::Discipline;
}
}
static inline EQ::spells::CastingSlot SoFToServerCastingSlot(spells::CastingSlot slot, uint32 item_location) {
static inline EQEmu::spells::CastingSlot SoFToServerCastingSlot(spells::CastingSlot slot, uint32 item_location) {
switch (slot) {
case spells::CastingSlot::Gem1:
return EQ::spells::CastingSlot::Gem1;
return EQEmu::spells::CastingSlot::Gem1;
case spells::CastingSlot::Gem2:
return EQ::spells::CastingSlot::Gem2;
return EQEmu::spells::CastingSlot::Gem2;
case spells::CastingSlot::Gem3:
return EQ::spells::CastingSlot::Gem3;
return EQEmu::spells::CastingSlot::Gem3;
case spells::CastingSlot::Gem4:
return EQ::spells::CastingSlot::Gem4;
return EQEmu::spells::CastingSlot::Gem4;
case spells::CastingSlot::Gem5:
return EQ::spells::CastingSlot::Gem5;
return EQEmu::spells::CastingSlot::Gem5;
case spells::CastingSlot::Gem6:
return EQ::spells::CastingSlot::Gem6;
return EQEmu::spells::CastingSlot::Gem6;
case spells::CastingSlot::Gem7:
return EQ::spells::CastingSlot::Gem7;
return EQEmu::spells::CastingSlot::Gem7;
case spells::CastingSlot::Gem8:
return EQ::spells::CastingSlot::Gem8;
return EQEmu::spells::CastingSlot::Gem8;
case spells::CastingSlot::Gem9:
return EQ::spells::CastingSlot::Gem9;
return EQEmu::spells::CastingSlot::Gem9;
case spells::CastingSlot::Ability:
return EQ::spells::CastingSlot::Ability;
return EQEmu::spells::CastingSlot::Ability;
// Tit uses 10 for item and discipline casting, but items have a valid location
case spells::CastingSlot::Item:
if (item_location == INVALID_INDEX)
return EQ::spells::CastingSlot::Discipline;
return EQEmu::spells::CastingSlot::Discipline;
else
return EQ::spells::CastingSlot::Item;
return EQEmu::spells::CastingSlot::Item;
case spells::CastingSlot::PotionBelt:
return EQ::spells::CastingSlot::PotionBelt;
return EQEmu::spells::CastingSlot::PotionBelt;
case spells::CastingSlot::AltAbility:
return EQ::spells::CastingSlot::AltAbility;
return EQEmu::spells::CastingSlot::AltAbility;
default: // we shouldn't have any issues with other slots ... just return something
return EQ::spells::CastingSlot::Discipline;
return EQEmu::spells::CastingSlot::Discipline;
}
}
static inline int ServerToSoFBuffSlot(int index) {
// we're a disc
if (index >= EQ::spells::LONG_BUFFS + EQ::spells::SHORT_BUFFS)
return index - EQ::spells::LONG_BUFFS - EQ::spells::SHORT_BUFFS +
if (index >= EQEmu::spells::LONG_BUFFS + EQEmu::spells::SHORT_BUFFS)
return index - EQEmu::spells::LONG_BUFFS - EQEmu::spells::SHORT_BUFFS +
spells::LONG_BUFFS + spells::SHORT_BUFFS;
// we're a song
if (index >= EQ::spells::LONG_BUFFS)
return index - EQ::spells::LONG_BUFFS + spells::LONG_BUFFS;
if (index >= EQEmu::spells::LONG_BUFFS)
return index - EQEmu::spells::LONG_BUFFS + spells::LONG_BUFFS;
// we're a normal buff
return index; // as long as we guard against bad slots server side, we should be fine
}
@@ -3525,11 +3519,11 @@ namespace SoF
{
// we're a disc
if (index >= spells::LONG_BUFFS + spells::SHORT_BUFFS)
return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQ::spells::LONG_BUFFS +
EQ::spells::SHORT_BUFFS;
return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQEmu::spells::LONG_BUFFS +
EQEmu::spells::SHORT_BUFFS;
// we're a song
if (index >= spells::LONG_BUFFS)
return index - spells::LONG_BUFFS + EQ::spells::LONG_BUFFS;
return index - spells::LONG_BUFFS + EQEmu::spells::LONG_BUFFS;
// we're a normal buff
return index; // as long as we guard against bad slots server side, we should be fine
}
+1 -1
View File
@@ -43,7 +43,7 @@ namespace SoF
protected:
virtual std::string Describe() const;
virtual const EQ::versions::ClientVersion ClientVersion() const;
virtual const EQEmu::versions::ClientVersion ClientVersion() const;
//magic macro to declare our opcode processors
#include "ss_declare.h"
+15 -15
View File
@@ -31,7 +31,7 @@ namespace SoF
const int16 INULL = 0;
namespace inventory {
inline EQ::versions::ClientVersion GetInventoryRef() { return EQ::versions::ClientVersion::SoF; }
inline EQEmu::versions::ClientVersion GetInventoryRef() { return EQEmu::versions::ClientVersion::SoF; }
const bool ConcatenateInvTypeLimbo = true;
@@ -43,7 +43,7 @@ namespace SoF
} /*inventory*/
namespace invtype {
inline EQ::versions::ClientVersion GetInvTypeRef() { return EQ::versions::ClientVersion::SoF; }
inline EQEmu::versions::ClientVersion GetInvTypeRef() { return EQEmu::versions::ClientVersion::SoF; }
namespace enum_ {
enum InventoryTypes : int16 {
@@ -106,7 +106,7 @@ namespace SoF
} /*invtype*/
namespace invslot {
inline EQ::versions::ClientVersion GetInvSlotRef() { return EQ::versions::ClientVersion::SoF; }
inline EQEmu::versions::ClientVersion GetInvSlotRef() { return EQEmu::versions::ClientVersion::SoF; }
namespace enum_ {
enum InventorySlots : int16 {
@@ -205,7 +205,7 @@ namespace SoF
} /*invslot*/
namespace invbag {
inline EQ::versions::ClientVersion GetInvBagRef() { return EQ::versions::ClientVersion::SoF; }
inline EQEmu::versions::ClientVersion GetInvBagRef() { return EQEmu::versions::ClientVersion::SoF; }
const int16 SLOT_INVALID = IINVALID;
const int16 SLOT_BEGIN = INULL;
@@ -237,7 +237,7 @@ namespace SoF
} /*invbag*/
namespace invaug {
inline EQ::versions::ClientVersion GetInvAugRef() { return EQ::versions::ClientVersion::SoF; }
inline EQEmu::versions::ClientVersion GetInvAugRef() { return EQEmu::versions::ClientVersion::SoF; }
const int16 SOCKET_INVALID = IINVALID;
const int16 SOCKET_BEGIN = INULL;
@@ -249,7 +249,7 @@ namespace SoF
} /*invaug*/
namespace item {
inline EQ::versions::ClientVersion GetItemRef() { return EQ::versions::ClientVersion::SoF; }
inline EQEmu::versions::ClientVersion GetItemRef() { return EQEmu::versions::ClientVersion::SoF; }
enum ItemPacketType : int {
ItemPacketMerchant = 100,
@@ -267,7 +267,7 @@ namespace SoF
} /*item*/
namespace profile {
inline EQ::versions::ClientVersion GetProfileRef() { return EQ::versions::ClientVersion::SoF; }
inline EQEmu::versions::ClientVersion GetProfileRef() { return EQEmu::versions::ClientVersion::SoF; }
const int16 BANDOLIERS_SIZE = 20; // number of bandolier instances
const int16 BANDOLIER_ITEM_COUNT = 4; // number of equipment slots in bandolier instance
@@ -279,11 +279,11 @@ namespace SoF
} /*profile*/
namespace constants {
inline EQ::versions::ClientVersion GetConstantsRef() { return EQ::versions::ClientVersion::SoF; }
inline EQEmu::versions::ClientVersion GetConstantsRef() { return EQEmu::versions::ClientVersion::SoF; }
const EQ::expansions::Expansion EXPANSION = EQ::expansions::Expansion::SoF;
const uint32 EXPANSION_BIT = EQ::expansions::bitSoF;
const uint32 EXPANSIONS_MASK = EQ::expansions::maskSoF;
const EQEmu::expansions::Expansion EXPANSION = EQEmu::expansions::Expansion::SoF;
const uint32 EXPANSION_BIT = EQEmu::expansions::bitSoF;
const uint32 EXPANSIONS_MASK = EQEmu::expansions::maskSoF;
const size_t CHARACTER_CREATION_LIMIT = 12;
@@ -292,21 +292,21 @@ namespace SoF
} /*constants*/
namespace behavior {
inline EQ::versions::ClientVersion GetBehaviorRef() { return EQ::versions::ClientVersion::SoF; }
inline EQEmu::versions::ClientVersion GetBehaviorRef() { return EQEmu::versions::ClientVersion::SoF; }
const bool CoinHasWeight = true;
} /*behavior*/
namespace skills {
inline EQ::versions::ClientVersion GetSkillsRef() { return EQ::versions::ClientVersion::SoF; }
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::SoF; }
const size_t LastUsableSkill = EQ::skills::SkillTripleAttack;
const size_t LastUsableSkill = EQEmu::skills::SkillTripleAttack;
} /*skills*/
namespace spells {
inline EQ::versions::ClientVersion GetSkillsRef() { return EQ::versions::ClientVersion::SoF; }
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::SoF; }
enum class CastingSlot : uint32 {
Gem1 = 0,
+3 -3
View File
@@ -168,7 +168,7 @@ struct TintProfile
Tint_Struct Primary;
Tint_Struct Secondary;
};
Tint_Struct Slot[EQ::textures::materialCount];
Tint_Struct Slot[EQEmu::textures::materialCount];
};
};
@@ -197,7 +197,7 @@ struct TextureProfile
Texture_Struct Primary;
Texture_Struct Secondary;
};
Texture_Struct Slot[EQ::textures::materialCount];
Texture_Struct Slot[EQEmu::textures::materialCount];
};
TextureProfile();
@@ -214,7 +214,7 @@ struct CharacterSelectEntry_Struct
/*0000*/ uint8 Beard; //
/*0001*/ uint8 HairColor; //
/*0000*/ uint8 Face; //
/*0000*/ CharSelectEquip Equip[EQ::textures::materialCount];
/*0000*/ CharSelectEquip Equip[EQEmu::textures::materialCount];
/*0000*/ uint32 PrimaryIDFile; //
/*0000*/ uint32 SecondaryIDFile; //
/*0000*/ uint8 Unknown15; // 0xff
+111 -111
View File
@@ -42,7 +42,7 @@ namespace Titanium
static OpcodeManager *opcodes = nullptr;
static Strategy struct_strategy;
void SerializeItem(EQ::OutBuffer& ob, const EQ::ItemInstance *inst, int16 slot_id_in, uint8 depth);
void SerializeItem(EQEmu::OutBuffer& ob, const EQEmu::ItemInstance *inst, int16 slot_id_in, uint8 depth);
// server to client inventory location converters
static inline int16 ServerToTitaniumSlot(uint32 server_slot);
@@ -58,8 +58,8 @@ namespace Titanium
// client to server say link converter
static inline void TitaniumToServerSayLink(std::string &server_saylink, const std::string &titanium_saylink);
static inline spells::CastingSlot ServerToTitaniumCastingSlot(EQ::spells::CastingSlot slot);
static inline EQ::spells::CastingSlot TitaniumToServerCastingSlot(spells::CastingSlot slot, uint32 item_location);
static inline spells::CastingSlot ServerToTitaniumCastingSlot(EQEmu::spells::CastingSlot slot);
static inline EQEmu::spells::CastingSlot TitaniumToServerCastingSlot(spells::CastingSlot slot, uint32 item_location);
static inline int ServerToTitaniumBuffSlot(int index);
static inline int TitaniumToServerBuffSlot(int index);
@@ -143,9 +143,9 @@ namespace Titanium
return(r);
}
const EQ::versions::ClientVersion Strategy::ClientVersion() const
const EQEmu::versions::ClientVersion Strategy::ClientVersion() const
{
return EQ::versions::ClientVersion::Titanium;
return EQEmu::versions::ClientVersion::Titanium;
}
#include "ss_define.h"
@@ -320,22 +320,22 @@ namespace Titanium
//store away the emu struct
uchar* __emu_buffer = in->pBuffer;
int itemcount = in->size / sizeof(EQ::InternalSerializedItem_Struct);
if (itemcount == 0 || (in->size % sizeof(EQ::InternalSerializedItem_Struct)) != 0) {
int itemcount = in->size / sizeof(EQEmu::InternalSerializedItem_Struct);
if (itemcount == 0 || (in->size % sizeof(EQEmu::InternalSerializedItem_Struct)) != 0) {
Log(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(EQ::InternalSerializedItem_Struct));
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(EQEmu::InternalSerializedItem_Struct));
delete in;
return;
}
EQ::InternalSerializedItem_Struct* eq = (EQ::InternalSerializedItem_Struct*)in->pBuffer;
EQEmu::InternalSerializedItem_Struct* eq = (EQEmu::InternalSerializedItem_Struct*)in->pBuffer;
//do the transform...
EQ::OutBuffer ob;
EQ::OutBuffer::pos_type last_pos = ob.tellp();
EQEmu::OutBuffer ob;
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
for (int r = 0; r < itemcount; r++, eq++) {
SerializeItem(ob, (const EQ::ItemInstance*)eq->inst, ServerToTitaniumSlot(eq->slot_id), 0);
SerializeItem(ob, (const EQEmu::ItemInstance*)eq->inst, ServerToTitaniumSlot(eq->slot_id), 0);
if (ob.tellp() == last_pos)
LogNetcode("Titanium::ENCODE(OP_CharInventory) Serialization failed on item slot [{}] during OP_CharInventory. Item skipped", eq->slot_id);
@@ -796,14 +796,14 @@ namespace Titanium
OUT(TargetID);
OUT(playerid);
for (int i = EQ::invslot::slotCharm; i <= EQ::invslot::slotWaist; ++i) {
for (int i = EQEmu::invslot::slotCharm; i <= EQEmu::invslot::slotWaist; ++i) {
strn0cpy(eq->itemnames[i], emu->itemnames[i], sizeof(eq->itemnames[i]));
OUT(itemicons[i]);
}
// move ammo down to last element in titanium array
strn0cpy(eq->itemnames[invslot::slotAmmo], emu->itemnames[EQ::invslot::slotAmmo], sizeof(eq->itemnames[invslot::slotAmmo]));
eq->itemicons[invslot::slotAmmo] = emu->itemicons[EQ::invslot::slotAmmo];
strn0cpy(eq->itemnames[invslot::slotAmmo], emu->itemnames[EQEmu::invslot::slotAmmo], sizeof(eq->itemnames[invslot::slotAmmo]));
eq->itemicons[invslot::slotAmmo] = emu->itemicons[EQEmu::invslot::slotAmmo];
strn0cpy(eq->text, emu->text, sizeof(eq->text));
@@ -832,14 +832,14 @@ namespace Titanium
//store away the emu struct
uchar* __emu_buffer = in->pBuffer;
EQ::InternalSerializedItem_Struct* int_struct = (EQ::InternalSerializedItem_Struct*)(&__emu_buffer[4]);
EQEmu::InternalSerializedItem_Struct* int_struct = (EQEmu::InternalSerializedItem_Struct*)(&__emu_buffer[4]);
EQ::OutBuffer ob;
EQ::OutBuffer::pos_type last_pos = ob.tellp();
EQEmu::OutBuffer ob;
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
ob.write((const char*)__emu_buffer, 4);
SerializeItem(ob, (const EQ::ItemInstance*)int_struct->inst, ServerToTitaniumSlot(int_struct->slot_id), 0);
SerializeItem(ob, (const EQEmu::ItemInstance*)int_struct->inst, ServerToTitaniumSlot(int_struct->slot_id), 0);
if (ob.tellp() == last_pos) {
LogNetcode("Titanium::ENCODE(OP_ItemPacket) Serialization failed on item slot [{}]", int_struct->slot_id);
delete in;
@@ -909,7 +909,7 @@ namespace Titanium
// Since HT/LoH are translated up, we need to translate down only for memSpellSpellbar case
if (emu->scribing == 3)
eq->slot = static_cast<uint32>(ServerToTitaniumCastingSlot(static_cast<EQ::spells::CastingSlot>(emu->slot)));
eq->slot = static_cast<uint32>(ServerToTitaniumCastingSlot(static_cast<EQEmu::spells::CastingSlot>(emu->slot)));
else
OUT(slot);
OUT(spell_id);
@@ -1009,7 +1009,7 @@ namespace Titanium
OUT(hairstyle);
OUT(beard);
// OUT(unknown00178[10]);
for (r = EQ::textures::textureBegin; r < EQ::textures::materialCount; r++) {
for (r = EQEmu::textures::textureBegin; r < EQEmu::textures::materialCount; r++) {
OUT(item_material.Slot[r].Material);
OUT(item_tint.Slot[r].Color);
}
@@ -1032,7 +1032,7 @@ namespace Titanium
OUT(face);
// OUT(unknown02264[47]);
if (spells::SPELLBOOK_SIZE <= EQ::spells::SPELLBOOK_SIZE) {
if (spells::SPELLBOOK_SIZE <= EQEmu::spells::SPELLBOOK_SIZE) {
for (uint32 r = 0; r < spells::SPELLBOOK_SIZE; r++) {
if (emu->spell_book[r] <= spells::SPELL_ID_MAX)
eq->spell_book[r] = emu->spell_book[r];
@@ -1041,14 +1041,14 @@ namespace Titanium
}
}
else {
for (uint32 r = 0; r < EQ::spells::SPELLBOOK_SIZE; r++) {
for (uint32 r = 0; r < EQEmu::spells::SPELLBOOK_SIZE; r++) {
if (emu->spell_book[r] <= spells::SPELL_ID_MAX)
eq->spell_book[r] = emu->spell_book[r];
else
eq->spell_book[r] = 0xFFFFFFFFU;
}
// invalidate the rest of the spellbook slots
memset(&eq->spell_book[EQ::spells::SPELLBOOK_SIZE], 0xFF, (sizeof(uint32) * (spells::SPELLBOOK_SIZE - EQ::spells::SPELLBOOK_SIZE)));
memset(&eq->spell_book[EQEmu::spells::SPELLBOOK_SIZE], 0xFF, (sizeof(uint32) * (spells::SPELLBOOK_SIZE - EQEmu::spells::SPELLBOOK_SIZE)));
}
// OUT(unknown4184[448]);
@@ -1092,7 +1092,7 @@ namespace Titanium
// OUT(unknown06160[4]);
// Copy bandoliers where server and client indices converge
for (r = 0; r < EQ::profile::BANDOLIERS_SIZE && r < profile::BANDOLIERS_SIZE; ++r) {
for (r = 0; r < EQEmu::profile::BANDOLIERS_SIZE && r < profile::BANDOLIERS_SIZE; ++r) {
OUT_str(bandoliers[r].Name);
for (uint32 k = 0; k < profile::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
OUT(bandoliers[r].Items[k].ID);
@@ -1101,7 +1101,7 @@ namespace Titanium
}
}
// Nullify bandoliers where server and client indices diverge, with a client bias
for (r = EQ::profile::BANDOLIERS_SIZE; r < profile::BANDOLIERS_SIZE; ++r) {
for (r = EQEmu::profile::BANDOLIERS_SIZE; r < profile::BANDOLIERS_SIZE; ++r) {
eq->bandoliers[r].Name[0] = '\0';
for (uint32 k = 0; k < profile::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
eq->bandoliers[r].Items[k].ID = 0;
@@ -1113,13 +1113,13 @@ namespace Titanium
// OUT(unknown07444[5120]);
// Copy potion belt where server and client indices converge
for (r = 0; r < EQ::profile::POTION_BELT_SIZE && r < profile::POTION_BELT_SIZE; ++r) {
for (r = 0; r < EQEmu::profile::POTION_BELT_SIZE && r < profile::POTION_BELT_SIZE; ++r) {
OUT(potionbelt.Items[r].ID);
OUT(potionbelt.Items[r].Icon);
OUT_str(potionbelt.Items[r].Name);
}
// Nullify potion belt where server and client indices diverge, with a client bias
for (r = EQ::profile::POTION_BELT_SIZE; r < profile::POTION_BELT_SIZE; ++r) {
for (r = EQEmu::profile::POTION_BELT_SIZE; r < profile::POTION_BELT_SIZE; ++r) {
eq->potionbelt.Items[r].ID = 0;
eq->potionbelt.Items[r].Icon = 0;
eq->potionbelt.Items[r].Name[0] = '\0';
@@ -1349,14 +1349,14 @@ namespace Titanium
if (eq->Race[char_index] > 473)
eq->Race[char_index] = 1;
for (int index = 0; index < EQ::textures::materialCount; ++index) {
for (int index = 0; index < EQEmu::textures::materialCount; ++index) {
eq->CS_Colors[char_index].Slot[index].Color = emu_cse->Equip[index].Color;
}
eq->BeardColor[char_index] = emu_cse->BeardColor;
eq->HairStyle[char_index] = emu_cse->HairStyle;
for (int index = 0; index < EQ::textures::materialCount; ++index) {
for (int index = 0; index < EQEmu::textures::materialCount; ++index) {
eq->Equip[char_index].Slot[index].Material = emu_cse->Equip[index].Material;
}
@@ -1386,14 +1386,14 @@ namespace Titanium
for (; char_index < 10; ++char_index) {
eq->Race[char_index] = 0;
for (int index = 0; index < EQ::textures::materialCount; ++index) {
for (int index = 0; index < EQEmu::textures::materialCount; ++index) {
eq->CS_Colors[char_index].Slot[index].Color = 0;
}
eq->BeardColor[char_index] = 0;
eq->HairStyle[char_index] = 0;
for (int index = 0; index < EQ::textures::materialCount; ++index) {
for (int index = 0; index < EQEmu::textures::materialCount; ++index) {
eq->Equip[char_index].Slot[index].Material = 0;
}
@@ -1717,7 +1717,7 @@ namespace Titanium
eq->petOwnerId = emu->petOwnerId;
eq->guildrank = emu->guildrank;
// eq->unknown0194[3] = emu->unknown0194[3];
for (k = EQ::textures::textureBegin; k < EQ::textures::materialCount; k++) {
for (k = EQEmu::textures::textureBegin; k < EQEmu::textures::materialCount; k++) {
eq->equipment.Slot[k].Material = emu->equipment.Slot[k].Material;
eq->equipment_tint.Slot[k].Color = emu->equipment_tint.Slot[k].Color;
}
@@ -1830,7 +1830,7 @@ namespace Titanium
DECODE_LENGTH_EXACT(structs::BugReport_Struct);
SETUP_DIRECT_DECODE(BugReport_Struct, structs::BugReport_Struct);
emu->category_id = EQ::bug::CategoryNameToCategoryID(eq->category_name);
emu->category_id = EQEmu::bug::CategoryNameToCategoryID(eq->category_name);
memcpy(emu->category_name, eq, sizeof(structs::BugReport_Struct));
FINISH_DIRECT_DECODE();
@@ -1993,12 +1993,12 @@ namespace Titanium
}
// move ammo up to last element in server array
strn0cpy(emu->itemnames[EQ::invslot::slotAmmo], eq->itemnames[invslot::slotAmmo], sizeof(emu->itemnames[EQ::invslot::slotAmmo]));
emu->itemicons[EQ::invslot::slotAmmo] = eq->itemicons[invslot::slotAmmo];
strn0cpy(emu->itemnames[EQEmu::invslot::slotAmmo], eq->itemnames[invslot::slotAmmo], sizeof(emu->itemnames[EQEmu::invslot::slotAmmo]));
emu->itemicons[EQEmu::invslot::slotAmmo] = eq->itemicons[invslot::slotAmmo];
// nullify power source element in server array
strn0cpy(emu->itemnames[EQ::invslot::slotPowerSource], "", sizeof(emu->itemnames[EQ::invslot::slotPowerSource]));
emu->itemicons[EQ::invslot::slotPowerSource] = 0xFFFFFFFF;
strn0cpy(emu->itemnames[EQEmu::invslot::slotPowerSource], "", sizeof(emu->itemnames[EQEmu::invslot::slotPowerSource]));
emu->itemicons[EQEmu::invslot::slotPowerSource] = 0xFFFFFFFF;
strn0cpy(emu->text, eq->text, sizeof(emu->text));
@@ -2053,7 +2053,7 @@ namespace Titanium
for (int i = 0; i < spells::SPELL_GEM_COUNT; ++i)
IN(spell[i]);
for (int i = spells::SPELL_GEM_COUNT; i < EQ::spells::SPELL_GEM_COUNT; ++i)
for (int i = spells::SPELL_GEM_COUNT; i < EQEmu::spells::SPELL_GEM_COUNT; ++i)
emu->spell[i] = 0xFFFFFFFF;
IN(unknown);
@@ -2273,9 +2273,9 @@ namespace Titanium
}
// file scope helper methods
void SerializeItem(EQ::OutBuffer& ob, const EQ::ItemInstance *inst, int16 slot_id_in, uint8 depth) {
void SerializeItem(EQEmu::OutBuffer& ob, const EQEmu::ItemInstance *inst, int16 slot_id_in, uint8 depth) {
const char *protection = "\\\\\\\\\\";
const EQ::ItemData *item = inst->GetUnscaledItem();
const EQEmu::ItemData *item = inst->GetUnscaledItem();
ob << StringFormat(
"%.*s%s",
@@ -2293,7 +2293,7 @@ namespace Titanium
ob << '|' << itoa((!inst->GetMerchantSlot() ? inst->GetSerialNumber()
: inst->GetMerchantSlot())); // merchant serial number
ob << '|' << itoa(inst->GetRecastTimestamp()); // recast timestamp
ob << '|' << itoa(((inst->IsStackable() ? ((inst->GetItem()->ItemType == EQ::item::ItemTypePotion) ? 1 : 0)
ob << '|' << itoa(((inst->IsStackable() ? ((inst->GetItem()->ItemType == EQEmu::item::ItemTypePotion) ? 1 : 0)
: inst->GetCharges()))); // charge count
ob << '|' << itoa((inst->IsAttuned() ? 1 : 0)); // inst attuned
ob << '|' << itoa(0); // unknown
@@ -2502,10 +2502,10 @@ namespace Titanium
ob << StringFormat("%.*s\"", depth, protection); // Quotes (and protection, if needed) around static data
// Sub data
for (int index = EQ::invbag::SLOT_BEGIN; index <= invbag::SLOT_END; ++index) {
for (int index = EQEmu::invbag::SLOT_BEGIN; index <= invbag::SLOT_END; ++index) {
ob << '|';
EQ::ItemInstance *sub = inst->GetItem(index);
EQEmu::ItemInstance *sub = inst->GetItem(index);
if (!sub)
continue;
@@ -2525,59 +2525,59 @@ namespace Titanium
static inline int16 ServerToTitaniumSlot(uint32 server_slot) {
int16 titanium_slot = invslot::SLOT_INVALID;
if (server_slot <= EQ::invslot::slotWaist) {
if (server_slot <= EQEmu::invslot::slotWaist) {
titanium_slot = server_slot;
}
else if (server_slot == EQ::invslot::slotAmmo) {
else if (server_slot == EQEmu::invslot::slotAmmo) {
titanium_slot = server_slot - 1;
}
else if (server_slot <= EQ::invslot::slotGeneral8 && server_slot >= EQ::invslot::slotGeneral1) {
else if (server_slot <= EQEmu::invslot::slotGeneral8 && server_slot >= EQEmu::invslot::slotGeneral1) {
titanium_slot = server_slot - 1;
}
else if (server_slot <= (EQ::invslot::POSSESSIONS_COUNT + EQ::invslot::slotWaist) &&
server_slot >= EQ::invslot::slotCursor) {
else if (server_slot <= (EQEmu::invslot::POSSESSIONS_COUNT + EQEmu::invslot::slotWaist) &&
server_slot >= EQEmu::invslot::slotCursor) {
titanium_slot = server_slot - 3;
}
else if (server_slot == (EQ::invslot::POSSESSIONS_COUNT + EQ::invslot::slotAmmo)) {
else if (server_slot == (EQEmu::invslot::POSSESSIONS_COUNT + EQEmu::invslot::slotAmmo)) {
titanium_slot = server_slot - 4;
}
else if (server_slot <= EQ::invbag::GENERAL_BAGS_8_END &&
server_slot >= EQ::invbag::GENERAL_BAGS_BEGIN) {
else if (server_slot <= EQEmu::invbag::GENERAL_BAGS_8_END &&
server_slot >= EQEmu::invbag::GENERAL_BAGS_BEGIN) {
titanium_slot = server_slot;
}
else if (server_slot <= EQ::invbag::CURSOR_BAG_END && server_slot >= EQ::invbag::CURSOR_BAG_BEGIN) {
else if (server_slot <= EQEmu::invbag::CURSOR_BAG_END && server_slot >= EQEmu::invbag::CURSOR_BAG_BEGIN) {
titanium_slot = server_slot - 20;
}
else if (server_slot <= EQ::invslot::TRIBUTE_END && server_slot >= EQ::invslot::TRIBUTE_BEGIN) {
else if (server_slot <= EQEmu::invslot::TRIBUTE_END && server_slot >= EQEmu::invslot::TRIBUTE_BEGIN) {
titanium_slot = server_slot;
}
else if (server_slot <= EQ::invslot::GUILD_TRIBUTE_END &&
server_slot >= EQ::invslot::GUILD_TRIBUTE_BEGIN) {
else if (server_slot <= EQEmu::invslot::GUILD_TRIBUTE_END &&
server_slot >= EQEmu::invslot::GUILD_TRIBUTE_BEGIN) {
titanium_slot = server_slot;
}
else if (server_slot == EQ::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
else if (server_slot == EQEmu::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
titanium_slot = server_slot;
}
else if (server_slot <= EQ::invslot::BANK_END && server_slot >= EQ::invslot::BANK_BEGIN) {
else if (server_slot <= EQEmu::invslot::BANK_END && server_slot >= EQEmu::invslot::BANK_BEGIN) {
titanium_slot = server_slot;
}
else if (server_slot <= EQ::invbag::BANK_BAGS_16_END && server_slot >= EQ::invbag::BANK_BAGS_BEGIN) {
else if (server_slot <= EQEmu::invbag::BANK_BAGS_16_END && server_slot >= EQEmu::invbag::BANK_BAGS_BEGIN) {
titanium_slot = server_slot;
}
else if (server_slot <= EQ::invslot::SHARED_BANK_END && server_slot >= EQ::invslot::SHARED_BANK_BEGIN) {
else if (server_slot <= EQEmu::invslot::SHARED_BANK_END && server_slot >= EQEmu::invslot::SHARED_BANK_BEGIN) {
titanium_slot = server_slot;
}
else if (server_slot <= EQ::invbag::SHARED_BANK_BAGS_END &&
server_slot >= EQ::invbag::SHARED_BANK_BAGS_BEGIN) {
else if (server_slot <= EQEmu::invbag::SHARED_BANK_BAGS_END &&
server_slot >= EQEmu::invbag::SHARED_BANK_BAGS_BEGIN) {
titanium_slot = server_slot;
}
else if (server_slot <= EQ::invslot::TRADE_END && server_slot >= EQ::invslot::TRADE_BEGIN) {
else if (server_slot <= EQEmu::invslot::TRADE_END && server_slot >= EQEmu::invslot::TRADE_BEGIN) {
titanium_slot = server_slot;
}
else if (server_slot <= EQ::invbag::TRADE_BAGS_END && server_slot >= EQ::invbag::TRADE_BAGS_BEGIN) {
else if (server_slot <= EQEmu::invbag::TRADE_BAGS_END && server_slot >= EQEmu::invbag::TRADE_BAGS_BEGIN) {
titanium_slot = server_slot;
}
else if (server_slot <= EQ::invslot::WORLD_END && server_slot >= EQ::invslot::WORLD_BEGIN) {
else if (server_slot <= EQEmu::invslot::WORLD_END && server_slot >= EQEmu::invslot::WORLD_BEGIN) {
titanium_slot = server_slot;
}
@@ -2590,16 +2590,16 @@ namespace Titanium
static inline int16 ServerToTitaniumCorpseSlot(uint32 server_corpse_slot) {
int16 titanium_slot = invslot::SLOT_INVALID;
if (server_corpse_slot <= EQ::invslot::slotGeneral8 && server_corpse_slot >= EQ::invslot::slotGeneral1) {
if (server_corpse_slot <= EQEmu::invslot::slotGeneral8 && server_corpse_slot >= EQEmu::invslot::slotGeneral1) {
titanium_slot = server_corpse_slot - 1;
}
else if (server_corpse_slot <= (EQ::invslot::POSSESSIONS_COUNT + EQ::invslot::slotWaist) &&
server_corpse_slot >= EQ::invslot::slotCursor) {
else if (server_corpse_slot <= (EQEmu::invslot::POSSESSIONS_COUNT + EQEmu::invslot::slotWaist) &&
server_corpse_slot >= EQEmu::invslot::slotCursor) {
titanium_slot = server_corpse_slot - 3;
}
else if (server_corpse_slot == (EQ::invslot::POSSESSIONS_COUNT + EQ::invslot::slotAmmo)) {
else if (server_corpse_slot == (EQEmu::invslot::POSSESSIONS_COUNT + EQEmu::invslot::slotAmmo)) {
titanium_slot = server_corpse_slot - 4;
}
@@ -2613,7 +2613,7 @@ namespace Titanium
}
static inline uint32 TitaniumToServerSlot(int16 titanium_slot) {
uint32 server_slot = EQ::invslot::SLOT_INVALID;
uint32 server_slot = EQEmu::invslot::SLOT_INVALID;
if (titanium_slot <= invslot::slotWaist) {
server_slot = titanium_slot;
@@ -2675,7 +2675,7 @@ namespace Titanium
static inline uint32 TitaniumToServerCorpseSlot(int16 titanium_corpse_slot)
{
uint32 server_slot = EQ::invslot::SLOT_INVALID;
uint32 server_slot = EQEmu::invslot::SLOT_INVALID;
if (titanium_corpse_slot <= invslot::slotGeneral8 && titanium_corpse_slot >= invslot::slotGeneral1) {
server_slot = titanium_corpse_slot + 1;
@@ -2696,7 +2696,7 @@ namespace Titanium
static inline void ServerToTitaniumSayLink(std::string &titanium_saylink, const std::string &server_saylink)
{
if ((constants::SAY_LINK_BODY_SIZE == EQ::constants::SAY_LINK_BODY_SIZE) || (server_saylink.find('\x12') == std::string::npos)) {
if ((constants::SAY_LINK_BODY_SIZE == EQEmu::constants::SAY_LINK_BODY_SIZE) || (server_saylink.find('\x12') == std::string::npos)) {
titanium_saylink = server_saylink;
return;
}
@@ -2705,7 +2705,7 @@ namespace Titanium
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
if (segment_iter & 1) {
if (segments[segment_iter].length() <= EQ::constants::SAY_LINK_BODY_SIZE) {
if (segments[segment_iter].length() <= EQEmu::constants::SAY_LINK_BODY_SIZE) {
titanium_saylink.append(segments[segment_iter]);
// TODO: log size mismatch error
continue;
@@ -2736,7 +2736,7 @@ namespace Titanium
static inline void TitaniumToServerSayLink(std::string &server_saylink, const std::string &titanium_saylink)
{
if ((EQ::constants::SAY_LINK_BODY_SIZE == constants::SAY_LINK_BODY_SIZE) || (titanium_saylink.find('\x12') == std::string::npos)) {
if ((EQEmu::constants::SAY_LINK_BODY_SIZE == constants::SAY_LINK_BODY_SIZE) || (titanium_saylink.find('\x12') == std::string::npos)) {
server_saylink = titanium_saylink;
return;
}
@@ -2772,85 +2772,85 @@ namespace Titanium
}
}
static inline spells::CastingSlot ServerToTitaniumCastingSlot(EQ::spells::CastingSlot slot) {
static inline spells::CastingSlot ServerToTitaniumCastingSlot(EQEmu::spells::CastingSlot slot) {
switch (slot) {
case EQ::spells::CastingSlot::Gem1:
case EQEmu::spells::CastingSlot::Gem1:
return spells::CastingSlot::Gem1;
case EQ::spells::CastingSlot::Gem2:
case EQEmu::spells::CastingSlot::Gem2:
return spells::CastingSlot::Gem2;
case EQ::spells::CastingSlot::Gem3:
case EQEmu::spells::CastingSlot::Gem3:
return spells::CastingSlot::Gem3;
case EQ::spells::CastingSlot::Gem4:
case EQEmu::spells::CastingSlot::Gem4:
return spells::CastingSlot::Gem4;
case EQ::spells::CastingSlot::Gem5:
case EQEmu::spells::CastingSlot::Gem5:
return spells::CastingSlot::Gem5;
case EQ::spells::CastingSlot::Gem6:
case EQEmu::spells::CastingSlot::Gem6:
return spells::CastingSlot::Gem6;
case EQ::spells::CastingSlot::Gem7:
case EQEmu::spells::CastingSlot::Gem7:
return spells::CastingSlot::Gem7;
case EQ::spells::CastingSlot::Gem8:
case EQEmu::spells::CastingSlot::Gem8:
return spells::CastingSlot::Gem8;
case EQ::spells::CastingSlot::Gem9:
case EQEmu::spells::CastingSlot::Gem9:
return spells::CastingSlot::Gem9;
case EQ::spells::CastingSlot::Item:
case EQEmu::spells::CastingSlot::Item:
return spells::CastingSlot::Item;
case EQ::spells::CastingSlot::PotionBelt:
case EQEmu::spells::CastingSlot::PotionBelt:
return spells::CastingSlot::PotionBelt;
case EQ::spells::CastingSlot::Discipline:
case EQEmu::spells::CastingSlot::Discipline:
return spells::CastingSlot::Discipline;
case EQ::spells::CastingSlot::AltAbility:
case EQEmu::spells::CastingSlot::AltAbility:
return spells::CastingSlot::AltAbility;
default: // we shouldn't have any issues with other slots ... just return something
return spells::CastingSlot::Discipline;
}
}
static inline EQ::spells::CastingSlot TitaniumToServerCastingSlot(spells::CastingSlot slot, uint32 item_location) {
static inline EQEmu::spells::CastingSlot TitaniumToServerCastingSlot(spells::CastingSlot slot, uint32 item_location) {
switch (slot) {
case spells::CastingSlot::Gem1:
return EQ::spells::CastingSlot::Gem1;
return EQEmu::spells::CastingSlot::Gem1;
case spells::CastingSlot::Gem2:
return EQ::spells::CastingSlot::Gem2;
return EQEmu::spells::CastingSlot::Gem2;
case spells::CastingSlot::Gem3:
return EQ::spells::CastingSlot::Gem3;
return EQEmu::spells::CastingSlot::Gem3;
case spells::CastingSlot::Gem4:
return EQ::spells::CastingSlot::Gem4;
return EQEmu::spells::CastingSlot::Gem4;
case spells::CastingSlot::Gem5:
return EQ::spells::CastingSlot::Gem5;
return EQEmu::spells::CastingSlot::Gem5;
case spells::CastingSlot::Gem6:
return EQ::spells::CastingSlot::Gem6;
return EQEmu::spells::CastingSlot::Gem6;
case spells::CastingSlot::Gem7:
return EQ::spells::CastingSlot::Gem7;
return EQEmu::spells::CastingSlot::Gem7;
case spells::CastingSlot::Gem8:
return EQ::spells::CastingSlot::Gem8;
return EQEmu::spells::CastingSlot::Gem8;
case spells::CastingSlot::Gem9:
return EQ::spells::CastingSlot::Gem9;
return EQEmu::spells::CastingSlot::Gem9;
case spells::CastingSlot::Ability:
return EQ::spells::CastingSlot::Ability;
return EQEmu::spells::CastingSlot::Ability;
// Tit uses 10 for item and discipline casting, but items have a valid location
case spells::CastingSlot::Item:
if (item_location == INVALID_INDEX)
return EQ::spells::CastingSlot::Discipline;
return EQEmu::spells::CastingSlot::Discipline;
else
return EQ::spells::CastingSlot::Item;
return EQEmu::spells::CastingSlot::Item;
case spells::CastingSlot::PotionBelt:
return EQ::spells::CastingSlot::PotionBelt;
return EQEmu::spells::CastingSlot::PotionBelt;
case spells::CastingSlot::AltAbility:
return EQ::spells::CastingSlot::AltAbility;
return EQEmu::spells::CastingSlot::AltAbility;
default: // we shouldn't have any issues with other slots ... just return something
return EQ::spells::CastingSlot::Discipline;
return EQEmu::spells::CastingSlot::Discipline;
}
}
static inline int ServerToTitaniumBuffSlot(int index)
{
// we're a disc
if (index >= EQ::spells::LONG_BUFFS + EQ::spells::SHORT_BUFFS)
return index - EQ::spells::LONG_BUFFS - EQ::spells::SHORT_BUFFS +
if (index >= EQEmu::spells::LONG_BUFFS + EQEmu::spells::SHORT_BUFFS)
return index - EQEmu::spells::LONG_BUFFS - EQEmu::spells::SHORT_BUFFS +
spells::LONG_BUFFS + spells::SHORT_BUFFS;
// we're a song
if (index >= EQ::spells::LONG_BUFFS)
return index - EQ::spells::LONG_BUFFS + spells::LONG_BUFFS;
if (index >= EQEmu::spells::LONG_BUFFS)
return index - EQEmu::spells::LONG_BUFFS + spells::LONG_BUFFS;
// we're a normal buff
return index; // as long as we guard against bad slots server side, we should be fine
}
@@ -2859,11 +2859,11 @@ namespace Titanium
{
// we're a disc
if (index >= spells::LONG_BUFFS + spells::SHORT_BUFFS)
return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQ::spells::LONG_BUFFS +
EQ::spells::SHORT_BUFFS;
return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQEmu::spells::LONG_BUFFS +
EQEmu::spells::SHORT_BUFFS;
// we're a song
if (index >= spells::LONG_BUFFS)
return index - spells::LONG_BUFFS + EQ::spells::LONG_BUFFS;
return index - spells::LONG_BUFFS + EQEmu::spells::LONG_BUFFS;
// we're a normal buff
return index; // as long as we guard against bad slots server side, we should be fine
}
+1 -1
View File
@@ -43,7 +43,7 @@ namespace Titanium
protected:
virtual std::string Describe() const;
virtual const EQ::versions::ClientVersion ClientVersion() const;
virtual const EQEmu::versions::ClientVersion ClientVersion() const;
//magic macro to declare our opcode processors
#include "ss_declare.h"
+15 -15
View File
@@ -31,7 +31,7 @@ namespace Titanium
const int16 INULL = 0;
namespace inventory {
inline EQ::versions::ClientVersion GetInventoryRef() { return EQ::versions::ClientVersion::Titanium; }
inline EQEmu::versions::ClientVersion GetInventoryRef() { return EQEmu::versions::ClientVersion::Titanium; }
const bool ConcatenateInvTypeLimbo = true;
@@ -43,7 +43,7 @@ namespace Titanium
} /*inventory*/
namespace invtype {
inline EQ::versions::ClientVersion GetInvTypeRef() { return EQ::versions::ClientVersion::Titanium; }
inline EQEmu::versions::ClientVersion GetInvTypeRef() { return EQEmu::versions::ClientVersion::Titanium; }
namespace enum_ {
enum InventoryTypes : int16 {
@@ -106,7 +106,7 @@ namespace Titanium
} /*invtype*/
namespace invslot {
inline EQ::versions::ClientVersion GetInvSlotRef() { return EQ::versions::ClientVersion::Titanium; }
inline EQEmu::versions::ClientVersion GetInvSlotRef() { return EQEmu::versions::ClientVersion::Titanium; }
namespace enum_ {
enum InventorySlots : int16 {
@@ -204,7 +204,7 @@ namespace Titanium
} /*invslot*/
namespace invbag {
inline EQ::versions::ClientVersion GetInvBagRef() { return EQ::versions::ClientVersion::Titanium; }
inline EQEmu::versions::ClientVersion GetInvBagRef() { return EQEmu::versions::ClientVersion::Titanium; }
const int16 SLOT_INVALID = IINVALID;
const int16 SLOT_BEGIN = INULL;
@@ -236,7 +236,7 @@ namespace Titanium
} /*invbag*/
namespace invaug {
inline EQ::versions::ClientVersion GetInvAugRef() { return EQ::versions::ClientVersion::Titanium; }
inline EQEmu::versions::ClientVersion GetInvAugRef() { return EQEmu::versions::ClientVersion::Titanium; }
const int16 SOCKET_INVALID = IINVALID;
const int16 SOCKET_BEGIN = INULL;
@@ -248,7 +248,7 @@ namespace Titanium
} /*invaug*/
namespace item {
inline EQ::versions::ClientVersion GetItemRef() { return EQ::versions::ClientVersion::Titanium; }
inline EQEmu::versions::ClientVersion GetItemRef() { return EQEmu::versions::ClientVersion::Titanium; }
enum ItemPacketType : int {
ItemPacketMerchant = 100,
@@ -266,7 +266,7 @@ namespace Titanium
} /*item*/
namespace profile {
inline EQ::versions::ClientVersion GetProfileRef() { return EQ::versions::ClientVersion::Titanium; }
inline EQEmu::versions::ClientVersion GetProfileRef() { return EQEmu::versions::ClientVersion::Titanium; }
const int16 BANDOLIERS_SIZE = 4; // number of bandolier instances
const int16 BANDOLIER_ITEM_COUNT = 4; // number of equipment slots in bandolier instance
@@ -278,11 +278,11 @@ namespace Titanium
} /*profile*/
namespace constants {
inline EQ::versions::ClientVersion GetConstantsRef() { return EQ::versions::ClientVersion::Titanium; }
inline EQEmu::versions::ClientVersion GetConstantsRef() { return EQEmu::versions::ClientVersion::Titanium; }
const EQ::expansions::Expansion EXPANSION = EQ::expansions::Expansion::DoD; // Someone had this as PoR in another section...
const uint32 EXPANSION_BIT = EQ::expansions::bitDoD;
const uint32 EXPANSIONS_MASK = EQ::expansions::maskDoD;
const EQEmu::expansions::Expansion EXPANSION = EQEmu::expansions::Expansion::DoD; // Someone had this as PoR in another section...
const uint32 EXPANSION_BIT = EQEmu::expansions::bitDoD;
const uint32 EXPANSIONS_MASK = EQEmu::expansions::maskDoD;
const size_t CHARACTER_CREATION_LIMIT = 8; // Hard-coded in client - DO NOT ALTER
@@ -291,21 +291,21 @@ namespace Titanium
} /*constants*/
namespace behavior {
inline EQ::versions::ClientVersion GetBehaviorRef() { return EQ::versions::ClientVersion::Titanium; }
inline EQEmu::versions::ClientVersion GetBehaviorRef() { return EQEmu::versions::ClientVersion::Titanium; }
const bool CoinHasWeight = true;
} /*behavior*/
namespace skills {
inline EQ::versions::ClientVersion GetSkillsRef() { return EQ::versions::ClientVersion::Titanium; }
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::Titanium; }
const size_t LastUsableSkill = EQ::skills::SkillFrenzy;
const size_t LastUsableSkill = EQEmu::skills::SkillFrenzy;
} /*skills*/
namespace spells {
inline EQ::versions::ClientVersion GetSkillsRef() { return EQ::versions::ClientVersion::Titanium; }
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::Titanium; }
enum class CastingSlot : uint32 {
Gem1 = 0,
+2 -2
View File
@@ -161,7 +161,7 @@ struct TintProfile {
Tint_Struct Primary;
Tint_Struct Secondary;
};
Tint_Struct Slot[EQ::textures::materialCount];
Tint_Struct Slot[EQEmu::textures::materialCount];
};
};
@@ -184,7 +184,7 @@ struct TextureProfile
Texture_Struct Primary;
Texture_Struct Secondary;
};
Texture_Struct Slot[EQ::textures::materialCount];
Texture_Struct Slot[EQEmu::textures::materialCount];
};
TextureProfile();
+111 -118
View File
@@ -43,7 +43,7 @@ namespace UF
static OpcodeManager *opcodes = nullptr;
static Strategy struct_strategy;
void SerializeItem(EQ::OutBuffer& ob, const EQ::ItemInstance *inst, int16 slot_id, uint8 depth);
void SerializeItem(EQEmu::OutBuffer& ob, const EQEmu::ItemInstance *inst, int16 slot_id, uint8 depth);
// server to client inventory location converters
static inline uint32 ServerToUFSlot(uint32 serverSlot);
@@ -59,8 +59,8 @@ namespace UF
// client to server say link converter
static inline void UFToServerSayLink(std::string& serverSayLink, const std::string& ufSayLink);
static inline spells::CastingSlot ServerToUFCastingSlot(EQ::spells::CastingSlot slot);
static inline EQ::spells::CastingSlot UFToServerCastingSlot(spells::CastingSlot slot);
static inline spells::CastingSlot ServerToUFCastingSlot(EQEmu::spells::CastingSlot slot);
static inline EQEmu::spells::CastingSlot UFToServerCastingSlot(spells::CastingSlot slot);
static inline int ServerToUFBuffSlot(int index);
static inline int UFToServerBuffSlot(int index);
@@ -144,9 +144,9 @@ namespace UF
return(r);
}
const EQ::versions::ClientVersion Strategy::ClientVersion() const
const EQEmu::versions::ClientVersion Strategy::ClientVersion() const
{
return EQ::versions::ClientVersion::UF;
return EQEmu::versions::ClientVersion::UF;
}
#include "ss_define.h"
@@ -501,24 +501,24 @@ namespace UF
//store away the emu struct
uchar* __emu_buffer = in->pBuffer;
int item_count = in->size / sizeof(EQ::InternalSerializedItem_Struct);
if (!item_count || (in->size % sizeof(EQ::InternalSerializedItem_Struct)) != 0) {
int item_count = in->size / sizeof(EQEmu::InternalSerializedItem_Struct);
if (!item_count || (in->size % sizeof(EQEmu::InternalSerializedItem_Struct)) != 0) {
Log(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(EQ::InternalSerializedItem_Struct));
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(EQEmu::InternalSerializedItem_Struct));
delete in;
return;
}
EQ::InternalSerializedItem_Struct* eq = (EQ::InternalSerializedItem_Struct*)in->pBuffer;
EQEmu::InternalSerializedItem_Struct* eq = (EQEmu::InternalSerializedItem_Struct*)in->pBuffer;
EQ::OutBuffer ob;
EQ::OutBuffer::pos_type last_pos = ob.tellp();
EQEmu::OutBuffer ob;
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
ob.write((const char*)&item_count, sizeof(uint32));
for (int index = 0; index < item_count; ++index, ++eq) {
SerializeItem(ob, (const EQ::ItemInstance*)eq->inst, eq->slot_id, 0);
SerializeItem(ob, (const EQEmu::ItemInstance*)eq->inst, eq->slot_id, 0);
if (ob.tellp() == last_pos)
LogNetcode("UF::ENCODE(OP_CharInventory) Serialization failed on item slot [{}] during OP_CharInventory. Item skipped", eq->slot_id);
@@ -1268,14 +1268,14 @@ namespace UF
//store away the emu struct
uchar* __emu_buffer = in->pBuffer;
EQ::InternalSerializedItem_Struct* int_struct = (EQ::InternalSerializedItem_Struct*)(&__emu_buffer[4]);
EQEmu::InternalSerializedItem_Struct* int_struct = (EQEmu::InternalSerializedItem_Struct*)(&__emu_buffer[4]);
EQ::OutBuffer ob;
EQ::OutBuffer::pos_type last_pos = ob.tellp();
EQEmu::OutBuffer ob;
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
ob.write((const char*)__emu_buffer, 4);
SerializeItem(ob, (const EQ::ItemInstance*)int_struct->inst, int_struct->slot_id, 0);
SerializeItem(ob, (const EQEmu::ItemInstance*)int_struct->inst, int_struct->slot_id, 0);
if (ob.tellp() == last_pos) {
LogNetcode("UF::ENCODE(OP_ItemPacket) Serialization failed on item slot [{}]", int_struct->slot_id);
delete in;
@@ -1693,7 +1693,7 @@ namespace UF
OUT(hairstyle);
OUT(beard);
// OUT(unknown00178[10]);
for (r = EQ::textures::textureBegin; r < EQ::textures::materialCount; r++) {
for (r = EQEmu::textures::textureBegin; r < EQEmu::textures::materialCount; r++) {
eq->equipment.Slot[r].Material = emu->item_material.Slot[r].Material;
eq->equipment.Slot[r].Unknown1 = 0;
eq->equipment.Slot[r].EliteMaterial = 0;
@@ -1725,7 +1725,7 @@ namespace UF
OUT(face);
// OUT(unknown02264[47]);
if (spells::SPELLBOOK_SIZE <= EQ::spells::SPELLBOOK_SIZE) {
if (spells::SPELLBOOK_SIZE <= EQEmu::spells::SPELLBOOK_SIZE) {
for (uint32 r = 0; r < spells::SPELLBOOK_SIZE; r++) {
if (emu->spell_book[r] <= spells::SPELL_ID_MAX)
eq->spell_book[r] = emu->spell_book[r];
@@ -1734,14 +1734,14 @@ namespace UF
}
}
else {
for (uint32 r = 0; r < EQ::spells::SPELLBOOK_SIZE; r++) {
for (uint32 r = 0; r < EQEmu::spells::SPELLBOOK_SIZE; r++) {
if (emu->spell_book[r] <= spells::SPELL_ID_MAX)
eq->spell_book[r] = emu->spell_book[r];
else
eq->spell_book[r] = 0xFFFFFFFFU;
}
// invalidate the rest of the spellbook slots
memset(&eq->spell_book[EQ::spells::SPELLBOOK_SIZE], 0xFF, (sizeof(uint32) * (spells::SPELLBOOK_SIZE - EQ::spells::SPELLBOOK_SIZE)));
memset(&eq->spell_book[EQEmu::spells::SPELLBOOK_SIZE], 0xFF, (sizeof(uint32) * (spells::SPELLBOOK_SIZE - EQEmu::spells::SPELLBOOK_SIZE)));
}
// OUT(unknown4184[128]);
@@ -1797,7 +1797,7 @@ namespace UF
// OUT(unknown06160[4]);
// Copy bandoliers where server and client indices converge
for (r = 0; r < EQ::profile::BANDOLIERS_SIZE && r < profile::BANDOLIERS_SIZE; ++r) {
for (r = 0; r < EQEmu::profile::BANDOLIERS_SIZE && r < profile::BANDOLIERS_SIZE; ++r) {
OUT_str(bandoliers[r].Name);
for (uint32 k = 0; k < profile::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
OUT(bandoliers[r].Items[k].ID);
@@ -1806,7 +1806,7 @@ namespace UF
}
}
// Nullify bandoliers where server and client indices diverge, with a client bias
for (r = EQ::profile::BANDOLIERS_SIZE; r < profile::BANDOLIERS_SIZE; ++r) {
for (r = EQEmu::profile::BANDOLIERS_SIZE; r < profile::BANDOLIERS_SIZE; ++r) {
eq->bandoliers[r].Name[0] = '\0';
for (uint32 k = 0; k < profile::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
eq->bandoliers[r].Items[k].ID = 0;
@@ -1818,13 +1818,13 @@ namespace UF
// OUT(unknown07444[5120]);
// Copy potion belt where server and client indices converge
for (r = 0; r < EQ::profile::POTION_BELT_SIZE && r < profile::POTION_BELT_SIZE; ++r) {
for (r = 0; r < EQEmu::profile::POTION_BELT_SIZE && r < profile::POTION_BELT_SIZE; ++r) {
OUT(potionbelt.Items[r].ID);
OUT(potionbelt.Items[r].Icon);
OUT_str(potionbelt.Items[r].Name);
}
// Nullify potion belt where server and client indices diverge, with a client bias
for (r = EQ::profile::POTION_BELT_SIZE; r < profile::POTION_BELT_SIZE; ++r) {
for (r = EQEmu::profile::POTION_BELT_SIZE; r < profile::POTION_BELT_SIZE; ++r) {
eq->potionbelt.Items[r].ID = 0;
eq->potionbelt.Items[r].Icon = 0;
eq->potionbelt.Items[r].Name[0] = '\0';
@@ -2196,7 +2196,7 @@ namespace UF
eq_cse->HairColor = emu_cse->HairColor;
eq_cse->Face = emu_cse->Face;
for (int equip_index = EQ::textures::textureBegin; equip_index < EQ::textures::materialCount; equip_index++) {
for (int equip_index = EQEmu::textures::textureBegin; equip_index < EQEmu::textures::materialCount; equip_index++) {
eq_cse->Equip[equip_index].Material = emu_cse->Equip[equip_index].Material;
eq_cse->Equip[equip_index].Unknown1 = emu_cse->Equip[equip_index].Unknown1;
eq_cse->Equip[equip_index].EliteMaterial = emu_cse->Equip[equip_index].EliteModel;
@@ -2755,7 +2755,7 @@ namespace UF
float SpawnSize = emu->size;
if (!((emu->NPC == 0) || (emu->race <= 12) || (emu->race == 128) || (emu->race == 130) || (emu->race == 330) || (emu->race == 522)))
{
PacketSize -= (sizeof(structs::Texture_Struct) * EQ::textures::materialCount);
PacketSize -= (sizeof(structs::Texture_Struct) * EQEmu::textures::materialCount);
if (emu->size == 0)
{
@@ -2954,7 +2954,7 @@ namespace UF
if ((emu->NPC == 0) || (emu->race <= 12) || (emu->race == 128) || (emu->race == 130) || (emu->race == 330) || (emu->race == 522))
{
for (k = EQ::textures::textureBegin; k < EQ::textures::materialCount; ++k)
for (k = EQEmu::textures::textureBegin; k < EQEmu::textures::materialCount; ++k)
{
{
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->equipment_tint.Slot[k].Color);
@@ -2990,7 +2990,7 @@ namespace UF
{
structs::Texture_Struct *Equipment = (structs::Texture_Struct *)Buffer;
for (k = EQ::textures::textureBegin; k < EQ::textures::materialCount; k++) {
for (k = EQEmu::textures::textureBegin; k < EQEmu::textures::materialCount; k++) {
if (emu->equipment.Slot[k].Material > 99999) {
Equipment[k].Material = 63;
} else {
@@ -3000,7 +3000,7 @@ namespace UF
Equipment[k].EliteMaterial = emu->equipment.Slot[k].EliteModel;
}
Buffer += (sizeof(structs::Texture_Struct) * EQ::textures::materialCount);
Buffer += (sizeof(structs::Texture_Struct) * EQEmu::textures::materialCount);
}
if (strlen(emu->title))
{
@@ -3498,7 +3498,7 @@ namespace UF
DECODE_LENGTH_EXACT(structs::LoadSpellSet_Struct);
SETUP_DIRECT_DECODE(LoadSpellSet_Struct, structs::LoadSpellSet_Struct);
for (unsigned int i = 0; i < EQ::spells::SPELL_GEM_COUNT; ++i)
for (unsigned int i = 0; i < EQEmu::spells::SPELL_GEM_COUNT; ++i)
if (eq->spell[i] == 0)
emu->spell[i] = 0xFFFFFFFF;
else
@@ -3737,9 +3737,9 @@ namespace UF
return NextItemInstSerialNumber;
}
void SerializeItem(EQ::OutBuffer& ob, const EQ::ItemInstance *inst, int16 slot_id_in, uint8 depth)
void SerializeItem(EQEmu::OutBuffer& ob, const EQEmu::ItemInstance *inst, int16 slot_id_in, uint8 depth)
{
const EQ::ItemData *item = inst->GetUnscaledItem();
const EQEmu::ItemData *item = inst->GetUnscaledItem();
UF::structs::ItemSerializationHeader hdr;
@@ -3783,7 +3783,7 @@ namespace UF
int ornamentationAugtype = RuleI(Character, OrnamentationAugmentType);
uint16 ornaIcon = 0;
if (inst->GetOrnamentationAug(ornamentationAugtype)) {
const EQ::ItemData *aug_weap = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem();
const EQEmu::ItemData *aug_weap = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem();
ornaIcon = aug_weap->Icon;
ob.write(aug_weap->IDFile, strlen(aug_weap->IDFile));
@@ -3966,12 +3966,6 @@ namespace UF
itbs.no_transfer = item->NoTransfer;
itbs.expendablearrow = item->ExpendableArrow;
// Done to hack older clients to label expendable fishing poles as such
// July 28th, 2018 patch
if (item->ItemType == EQ::item::ItemTypeFishingPole && item->SubType == 0) {
itbs.expendablearrow = 1;
}
ob.write((const char*)&itbs, sizeof(UF::structs::ItemTertiaryBodyStruct));
// Effect Structures Broken down to allow variable length strings for effect names
@@ -4112,34 +4106,33 @@ namespace UF
iqbs.HealAmt = item->HealAmt;
iqbs.SpellDmg = item->SpellDmg;
iqbs.Clairvoyance = item->Clairvoyance;
iqbs.SubType = item->SubType;
ob.write((const char*)&iqbs, sizeof(UF::structs::ItemQuaternaryBodyStruct));
EQ::OutBuffer::pos_type count_pos = ob.tellp();
EQEmu::OutBuffer::pos_type count_pos = ob.tellp();
uint32 subitem_count = 0;
ob.write((const char*)&subitem_count, sizeof(uint32));
// moved outside of loop since it is not modified within that scope
int16 SubSlotNumber = EQ::invbag::SLOT_INVALID;
int16 SubSlotNumber = EQEmu::invbag::SLOT_INVALID;
if (slot_id_in <= EQ::invslot::slotGeneral8 && slot_id_in >= EQ::invslot::GENERAL_BEGIN)
SubSlotNumber = EQ::invbag::GENERAL_BAGS_BEGIN + ((slot_id_in - EQ::invslot::GENERAL_BEGIN) * EQ::invbag::SLOT_COUNT);
else if (slot_id_in <= EQ::invslot::GENERAL_END && slot_id_in >= EQ::invslot::slotGeneral9)
SubSlotNumber = EQ::invbag::SLOT_INVALID;
else if (slot_id_in == EQ::invslot::slotCursor)
SubSlotNumber = EQ::invbag::CURSOR_BAG_BEGIN;
else if (slot_id_in <= EQ::invslot::BANK_END && slot_id_in >= EQ::invslot::BANK_BEGIN)
SubSlotNumber = EQ::invbag::BANK_BAGS_BEGIN + ((slot_id_in - EQ::invslot::BANK_BEGIN) * EQ::invbag::SLOT_COUNT);
else if (slot_id_in <= EQ::invslot::SHARED_BANK_END && slot_id_in >= EQ::invslot::SHARED_BANK_BEGIN)
SubSlotNumber = EQ::invbag::SHARED_BANK_BAGS_BEGIN + ((slot_id_in - EQ::invslot::SHARED_BANK_BEGIN) * EQ::invbag::SLOT_COUNT);
if (slot_id_in <= EQEmu::invslot::slotGeneral8 && slot_id_in >= EQEmu::invslot::GENERAL_BEGIN)
SubSlotNumber = EQEmu::invbag::GENERAL_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::GENERAL_BEGIN) * EQEmu::invbag::SLOT_COUNT);
else if (slot_id_in <= EQEmu::invslot::GENERAL_END && slot_id_in >= EQEmu::invslot::slotGeneral9)
SubSlotNumber = EQEmu::invbag::SLOT_INVALID;
else if (slot_id_in == EQEmu::invslot::slotCursor)
SubSlotNumber = EQEmu::invbag::CURSOR_BAG_BEGIN;
else if (slot_id_in <= EQEmu::invslot::BANK_END && slot_id_in >= EQEmu::invslot::BANK_BEGIN)
SubSlotNumber = EQEmu::invbag::BANK_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::BANK_BEGIN) * EQEmu::invbag::SLOT_COUNT);
else if (slot_id_in <= EQEmu::invslot::SHARED_BANK_END && slot_id_in >= EQEmu::invslot::SHARED_BANK_BEGIN)
SubSlotNumber = EQEmu::invbag::SHARED_BANK_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::SHARED_BANK_BEGIN) * EQEmu::invbag::SLOT_COUNT);
else
SubSlotNumber = slot_id_in; // not sure if this is the best way to handle this..leaving for now
if (SubSlotNumber != EQ::invbag::SLOT_INVALID) {
for (uint32 index = EQ::invbag::SLOT_BEGIN; index <= EQ::invbag::SLOT_END; ++index) {
EQ::ItemInstance* sub = inst->GetItem(index);
if (SubSlotNumber != EQEmu::invbag::SLOT_INVALID) {
for (uint32 index = EQEmu::invbag::SLOT_BEGIN; index <= EQEmu::invbag::SLOT_END; ++index) {
EQEmu::ItemInstance* sub = inst->GetItem(index);
if (!sub)
continue;
@@ -4158,59 +4151,59 @@ namespace UF
{
uint32 UFSlot = invslot::SLOT_INVALID;
if (serverSlot <= EQ::invslot::slotGeneral8) {
if (serverSlot <= EQEmu::invslot::slotGeneral8) {
UFSlot = serverSlot;
}
else if (serverSlot <= EQ::invslot::CORPSE_END && serverSlot >= EQ::invslot::slotCursor) {
else if (serverSlot <= EQEmu::invslot::CORPSE_END && serverSlot >= EQEmu::invslot::slotCursor) {
UFSlot = serverSlot - 2;
}
else if (serverSlot <= EQ::invbag::GENERAL_BAGS_8_END && serverSlot >= EQ::invbag::GENERAL_BAGS_BEGIN) {
else if (serverSlot <= EQEmu::invbag::GENERAL_BAGS_8_END && serverSlot >= EQEmu::invbag::GENERAL_BAGS_BEGIN) {
UFSlot = serverSlot + 11;
}
else if (serverSlot <= EQ::invbag::CURSOR_BAG_END && serverSlot >= EQ::invbag::CURSOR_BAG_BEGIN) {
else if (serverSlot <= EQEmu::invbag::CURSOR_BAG_END && serverSlot >= EQEmu::invbag::CURSOR_BAG_BEGIN) {
UFSlot = serverSlot - 9;
}
else if (serverSlot <= EQ::invslot::TRIBUTE_END && serverSlot >= EQ::invslot::TRIBUTE_BEGIN) {
else if (serverSlot <= EQEmu::invslot::TRIBUTE_END && serverSlot >= EQEmu::invslot::TRIBUTE_BEGIN) {
UFSlot = serverSlot;
}
else if (serverSlot <= EQ::invslot::GUILD_TRIBUTE_END && serverSlot >= EQ::invslot::GUILD_TRIBUTE_BEGIN) {
else if (serverSlot <= EQEmu::invslot::GUILD_TRIBUTE_END && serverSlot >= EQEmu::invslot::GUILD_TRIBUTE_BEGIN) {
UFSlot = serverSlot;
}
else if (serverSlot == EQ::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
else if (serverSlot == EQEmu::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
UFSlot = serverSlot;
}
else if (serverSlot <= EQ::invslot::BANK_END && serverSlot >= EQ::invslot::BANK_BEGIN) {
else if (serverSlot <= EQEmu::invslot::BANK_END && serverSlot >= EQEmu::invslot::BANK_BEGIN) {
UFSlot = serverSlot;
}
else if (serverSlot <= EQ::invbag::BANK_BAGS_END && serverSlot >= EQ::invbag::BANK_BAGS_BEGIN) {
else if (serverSlot <= EQEmu::invbag::BANK_BAGS_END && serverSlot >= EQEmu::invbag::BANK_BAGS_BEGIN) {
UFSlot = serverSlot + 1;
}
else if (serverSlot <= EQ::invslot::SHARED_BANK_END && serverSlot >= EQ::invslot::SHARED_BANK_BEGIN) {
else if (serverSlot <= EQEmu::invslot::SHARED_BANK_END && serverSlot >= EQEmu::invslot::SHARED_BANK_BEGIN) {
UFSlot = serverSlot;
}
else if (serverSlot <= EQ::invbag::SHARED_BANK_BAGS_END && serverSlot >= EQ::invbag::SHARED_BANK_BAGS_BEGIN) {
else if (serverSlot <= EQEmu::invbag::SHARED_BANK_BAGS_END && serverSlot >= EQEmu::invbag::SHARED_BANK_BAGS_BEGIN) {
UFSlot = serverSlot + 1;
}
else if (serverSlot <= EQ::invslot::TRADE_END && serverSlot >= EQ::invslot::TRADE_BEGIN) {
else if (serverSlot <= EQEmu::invslot::TRADE_END && serverSlot >= EQEmu::invslot::TRADE_BEGIN) {
UFSlot = serverSlot;
}
else if (serverSlot <= EQ::invbag::TRADE_BAGS_END && serverSlot >= EQ::invbag::TRADE_BAGS_BEGIN) {
else if (serverSlot <= EQEmu::invbag::TRADE_BAGS_END && serverSlot >= EQEmu::invbag::TRADE_BAGS_BEGIN) {
UFSlot = serverSlot;
}
else if (serverSlot <= EQ::invslot::WORLD_END && serverSlot >= EQ::invslot::WORLD_BEGIN) {
else if (serverSlot <= EQEmu::invslot::WORLD_END && serverSlot >= EQEmu::invslot::WORLD_BEGIN) {
UFSlot = serverSlot;
}
@@ -4223,11 +4216,11 @@ namespace UF
{
uint32 UFSlot = invslot::SLOT_INVALID;
if (serverCorpseSlot <= EQ::invslot::slotGeneral8 && serverCorpseSlot >= EQ::invslot::slotGeneral1) {
if (serverCorpseSlot <= EQEmu::invslot::slotGeneral8 && serverCorpseSlot >= EQEmu::invslot::slotGeneral1) {
UFSlot = serverCorpseSlot;
}
else if (serverCorpseSlot <= EQ::invslot::CORPSE_END && serverCorpseSlot >= EQ::invslot::slotCursor) {
else if (serverCorpseSlot <= EQEmu::invslot::CORPSE_END && serverCorpseSlot >= EQEmu::invslot::slotCursor) {
UFSlot = serverCorpseSlot - 2;
}
@@ -4238,7 +4231,7 @@ namespace UF
static inline uint32 UFToServerSlot(uint32 ufSlot)
{
uint32 ServerSlot = EQ::invslot::SLOT_INVALID;
uint32 ServerSlot = EQEmu::invslot::SLOT_INVALID;
if (ufSlot <= invslot::slotGeneral8) {
ServerSlot = ufSlot;
@@ -4303,7 +4296,7 @@ namespace UF
static inline uint32 UFToServerCorpseSlot(uint32 ufCorpseSlot)
{
uint32 ServerSlot = EQ::invslot::SLOT_INVALID;
uint32 ServerSlot = EQEmu::invslot::SLOT_INVALID;
if (ufCorpseSlot <= invslot::slotGeneral8 && ufCorpseSlot >= invslot::slotGeneral1) {
ServerSlot = ufCorpseSlot;
@@ -4320,7 +4313,7 @@ namespace UF
static inline void ServerToUFSayLink(std::string& ufSayLink, const std::string& serverSayLink)
{
if ((constants::SAY_LINK_BODY_SIZE == EQ::constants::SAY_LINK_BODY_SIZE) || (serverSayLink.find('\x12') == std::string::npos)) {
if ((constants::SAY_LINK_BODY_SIZE == EQEmu::constants::SAY_LINK_BODY_SIZE) || (serverSayLink.find('\x12') == std::string::npos)) {
ufSayLink = serverSayLink;
return;
}
@@ -4329,7 +4322,7 @@ namespace UF
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
if (segment_iter & 1) {
if (segments[segment_iter].length() <= EQ::constants::SAY_LINK_BODY_SIZE) {
if (segments[segment_iter].length() <= EQEmu::constants::SAY_LINK_BODY_SIZE) {
ufSayLink.append(segments[segment_iter]);
// TODO: log size mismatch error
continue;
@@ -4360,7 +4353,7 @@ namespace UF
static inline void UFToServerSayLink(std::string& serverSayLink, const std::string& ufSayLink)
{
if ((EQ::constants::SAY_LINK_BODY_SIZE == constants::SAY_LINK_BODY_SIZE) || (ufSayLink.find('\x12') == std::string::npos)) {
if ((EQEmu::constants::SAY_LINK_BODY_SIZE == constants::SAY_LINK_BODY_SIZE) || (ufSayLink.find('\x12') == std::string::npos)) {
serverSayLink = ufSayLink;
return;
}
@@ -4394,92 +4387,92 @@ namespace UF
}
}
static inline spells::CastingSlot ServerToUFCastingSlot(EQ::spells::CastingSlot slot)
static inline spells::CastingSlot ServerToUFCastingSlot(EQEmu::spells::CastingSlot slot)
{
switch (slot) {
case EQ::spells::CastingSlot::Gem1:
case EQEmu::spells::CastingSlot::Gem1:
return spells::CastingSlot::Gem1;
case EQ::spells::CastingSlot::Gem2:
case EQEmu::spells::CastingSlot::Gem2:
return spells::CastingSlot::Gem2;
case EQ::spells::CastingSlot::Gem3:
case EQEmu::spells::CastingSlot::Gem3:
return spells::CastingSlot::Gem3;
case EQ::spells::CastingSlot::Gem4:
case EQEmu::spells::CastingSlot::Gem4:
return spells::CastingSlot::Gem4;
case EQ::spells::CastingSlot::Gem5:
case EQEmu::spells::CastingSlot::Gem5:
return spells::CastingSlot::Gem5;
case EQ::spells::CastingSlot::Gem6:
case EQEmu::spells::CastingSlot::Gem6:
return spells::CastingSlot::Gem6;
case EQ::spells::CastingSlot::Gem7:
case EQEmu::spells::CastingSlot::Gem7:
return spells::CastingSlot::Gem7;
case EQ::spells::CastingSlot::Gem8:
case EQEmu::spells::CastingSlot::Gem8:
return spells::CastingSlot::Gem8;
case EQ::spells::CastingSlot::Gem9:
case EQEmu::spells::CastingSlot::Gem9:
return spells::CastingSlot::Gem9;
case EQ::spells::CastingSlot::Gem10:
case EQEmu::spells::CastingSlot::Gem10:
return spells::CastingSlot::Gem10;
case EQ::spells::CastingSlot::Gem11:
case EQEmu::spells::CastingSlot::Gem11:
return spells::CastingSlot::Gem11;
case EQ::spells::CastingSlot::Gem12:
case EQEmu::spells::CastingSlot::Gem12:
return spells::CastingSlot::Gem12;
case EQ::spells::CastingSlot::Item:
case EQ::spells::CastingSlot::PotionBelt:
case EQEmu::spells::CastingSlot::Item:
case EQEmu::spells::CastingSlot::PotionBelt:
return spells::CastingSlot::Item;
case EQ::spells::CastingSlot::Discipline:
case EQEmu::spells::CastingSlot::Discipline:
return spells::CastingSlot::Discipline;
case EQ::spells::CastingSlot::AltAbility:
case EQEmu::spells::CastingSlot::AltAbility:
return spells::CastingSlot::AltAbility;
default: // we shouldn't have any issues with other slots ... just return something
return spells::CastingSlot::Discipline;
}
}
static inline EQ::spells::CastingSlot UFToServerCastingSlot(spells::CastingSlot slot)
static inline EQEmu::spells::CastingSlot UFToServerCastingSlot(spells::CastingSlot slot)
{
switch (slot) {
case spells::CastingSlot::Gem1:
return EQ::spells::CastingSlot::Gem1;
return EQEmu::spells::CastingSlot::Gem1;
case spells::CastingSlot::Gem2:
return EQ::spells::CastingSlot::Gem2;
return EQEmu::spells::CastingSlot::Gem2;
case spells::CastingSlot::Gem3:
return EQ::spells::CastingSlot::Gem3;
return EQEmu::spells::CastingSlot::Gem3;
case spells::CastingSlot::Gem4:
return EQ::spells::CastingSlot::Gem4;
return EQEmu::spells::CastingSlot::Gem4;
case spells::CastingSlot::Gem5:
return EQ::spells::CastingSlot::Gem5;
return EQEmu::spells::CastingSlot::Gem5;
case spells::CastingSlot::Gem6:
return EQ::spells::CastingSlot::Gem6;
return EQEmu::spells::CastingSlot::Gem6;
case spells::CastingSlot::Gem7:
return EQ::spells::CastingSlot::Gem7;
return EQEmu::spells::CastingSlot::Gem7;
case spells::CastingSlot::Gem8:
return EQ::spells::CastingSlot::Gem8;
return EQEmu::spells::CastingSlot::Gem8;
case spells::CastingSlot::Gem9:
return EQ::spells::CastingSlot::Gem9;
return EQEmu::spells::CastingSlot::Gem9;
case spells::CastingSlot::Gem10:
return EQ::spells::CastingSlot::Gem10;
return EQEmu::spells::CastingSlot::Gem10;
case spells::CastingSlot::Gem11:
return EQ::spells::CastingSlot::Gem11;
return EQEmu::spells::CastingSlot::Gem11;
case spells::CastingSlot::Gem12:
return EQ::spells::CastingSlot::Gem12;
return EQEmu::spells::CastingSlot::Gem12;
case spells::CastingSlot::Discipline:
return EQ::spells::CastingSlot::Discipline;
return EQEmu::spells::CastingSlot::Discipline;
case spells::CastingSlot::Item:
return EQ::spells::CastingSlot::Item;
return EQEmu::spells::CastingSlot::Item;
case spells::CastingSlot::AltAbility:
return EQ::spells::CastingSlot::AltAbility;
return EQEmu::spells::CastingSlot::AltAbility;
default: // we shouldn't have any issues with other slots ... just return something
return EQ::spells::CastingSlot::Discipline;
return EQEmu::spells::CastingSlot::Discipline;
}
}
static inline int ServerToUFBuffSlot(int index)
{
// we're a disc
if (index >= EQ::spells::LONG_BUFFS + EQ::spells::SHORT_BUFFS)
return index - EQ::spells::LONG_BUFFS - EQ::spells::SHORT_BUFFS +
if (index >= EQEmu::spells::LONG_BUFFS + EQEmu::spells::SHORT_BUFFS)
return index - EQEmu::spells::LONG_BUFFS - EQEmu::spells::SHORT_BUFFS +
spells::LONG_BUFFS + spells::SHORT_BUFFS;
// we're a song
if (index >= EQ::spells::LONG_BUFFS)
return index - EQ::spells::LONG_BUFFS + spells::LONG_BUFFS;
if (index >= EQEmu::spells::LONG_BUFFS)
return index - EQEmu::spells::LONG_BUFFS + spells::LONG_BUFFS;
// we're a normal buff
return index; // as long as we guard against bad slots server side, we should be fine
}
@@ -4488,11 +4481,11 @@ namespace UF
{
// we're a disc
if (index >= spells::LONG_BUFFS + spells::SHORT_BUFFS)
return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQ::spells::LONG_BUFFS +
EQ::spells::SHORT_BUFFS;
return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQEmu::spells::LONG_BUFFS +
EQEmu::spells::SHORT_BUFFS;
// we're a song
if (index >= spells::LONG_BUFFS)
return index - spells::LONG_BUFFS + EQ::spells::LONG_BUFFS;
return index - spells::LONG_BUFFS + EQEmu::spells::LONG_BUFFS;
// we're a normal buff
return index; // as long as we guard against bad slots server side, we should be fine
}
+1 -1
View File
@@ -43,7 +43,7 @@ namespace UF
protected:
virtual std::string Describe() const;
virtual const EQ::versions::ClientVersion ClientVersion() const;
virtual const EQEmu::versions::ClientVersion ClientVersion() const;
//magic macro to declare our opcode processors
#include "ss_declare.h"
+15 -15
View File
@@ -31,7 +31,7 @@ namespace UF
const int16 INULL = 0;
namespace inventory {
inline EQ::versions::ClientVersion GetInventoryRef() { return EQ::versions::ClientVersion::UF; }
inline EQEmu::versions::ClientVersion GetInventoryRef() { return EQEmu::versions::ClientVersion::UF; }
const bool ConcatenateInvTypeLimbo = true;
@@ -43,7 +43,7 @@ namespace UF
} /*inventory*/
namespace invtype {
inline EQ::versions::ClientVersion GetInvTypeRef() { return EQ::versions::ClientVersion::UF; }
inline EQEmu::versions::ClientVersion GetInvTypeRef() { return EQEmu::versions::ClientVersion::UF; }
namespace enum_ {
enum InventoryTypes : int16 {
@@ -106,7 +106,7 @@ namespace UF
} /*invtype*/
namespace invslot {
inline EQ::versions::ClientVersion GetInvSlotRef() { return EQ::versions::ClientVersion::UF; }
inline EQEmu::versions::ClientVersion GetInvSlotRef() { return EQEmu::versions::ClientVersion::UF; }
namespace enum_ {
enum InventorySlots : int16 {
@@ -205,7 +205,7 @@ namespace UF
} /*invslot*/
namespace invbag {
inline EQ::versions::ClientVersion GetInvBagRef() { return EQ::versions::ClientVersion::UF; }
inline EQEmu::versions::ClientVersion GetInvBagRef() { return EQEmu::versions::ClientVersion::UF; }
const int16 SLOT_INVALID = IINVALID;
const int16 SLOT_BEGIN = INULL;
@@ -237,7 +237,7 @@ namespace UF
} /*invbag*/
namespace invaug {
inline EQ::versions::ClientVersion GetInvAugRef() { return EQ::versions::ClientVersion::UF; }
inline EQEmu::versions::ClientVersion GetInvAugRef() { return EQEmu::versions::ClientVersion::UF; }
const int16 SOCKET_INVALID = IINVALID;
const int16 SOCKET_BEGIN = INULL;
@@ -249,7 +249,7 @@ namespace UF
} /*invaug*/
namespace item {
inline EQ::versions::ClientVersion GetItemRef() { return EQ::versions::ClientVersion::UF; }
inline EQEmu::versions::ClientVersion GetItemRef() { return EQEmu::versions::ClientVersion::UF; }
enum ItemPacketType : int {
ItemPacketMerchant = 100,
@@ -268,7 +268,7 @@ namespace UF
} /*item*/
namespace profile {
inline EQ::versions::ClientVersion GetProfileRef() { return EQ::versions::ClientVersion::UF; }
inline EQEmu::versions::ClientVersion GetProfileRef() { return EQEmu::versions::ClientVersion::UF; }
const int16 BANDOLIERS_SIZE = 20; // number of bandolier instances
const int16 BANDOLIER_ITEM_COUNT = 4; // number of equipment slots in bandolier instance
@@ -280,11 +280,11 @@ namespace UF
} /*profile*/
namespace constants {
inline EQ::versions::ClientVersion GetConstantsRef() { return EQ::versions::ClientVersion::UF; }
inline EQEmu::versions::ClientVersion GetConstantsRef() { return EQEmu::versions::ClientVersion::UF; }
const EQ::expansions::Expansion EXPANSION = EQ::expansions::Expansion::UF;
const uint32 EXPANSION_BIT = EQ::expansions::bitUF;
const uint32 EXPANSIONS_MASK = EQ::expansions::maskUF;
const EQEmu::expansions::Expansion EXPANSION = EQEmu::expansions::Expansion::UF;
const uint32 EXPANSION_BIT = EQEmu::expansions::bitUF;
const uint32 EXPANSIONS_MASK = EQEmu::expansions::maskUF;
const size_t CHARACTER_CREATION_LIMIT = 12;
@@ -293,21 +293,21 @@ namespace UF
} /*constants*/
namespace behavior {
inline EQ::versions::ClientVersion GetBehaviorRef() { return EQ::versions::ClientVersion::UF; }
inline EQEmu::versions::ClientVersion GetBehaviorRef() { return EQEmu::versions::ClientVersion::UF; }
const bool CoinHasWeight = false;
} /*behavior*/
namespace skills {
inline EQ::versions::ClientVersion GetSkillsRef() { return EQ::versions::ClientVersion::UF; }
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::UF; }
const size_t LastUsableSkill = EQ::skills::SkillTripleAttack;
const size_t LastUsableSkill = EQEmu::skills::SkillTripleAttack;
} /*skills*/
namespace spells {
inline EQ::versions::ClientVersion GetSkillsRef() { return EQ::versions::ClientVersion::UF; }
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::UF; }
enum class CastingSlot : uint32 {
Gem1 = 0,
+5 -5
View File
@@ -149,7 +149,7 @@ struct TintProfile
Tint_Struct Primary;
Tint_Struct Secondary;
};
Tint_Struct Slot[EQ::textures::materialCount];
Tint_Struct Slot[EQEmu::textures::materialCount];
};
};
@@ -178,7 +178,7 @@ struct TextureProfile
Texture_Struct Primary;
Texture_Struct Secondary;
};
Texture_Struct Slot[EQ::textures::materialCount];
Texture_Struct Slot[EQEmu::textures::materialCount];
};
TextureProfile();
@@ -195,7 +195,7 @@ struct CharacterSelectEntry_Struct
/*0000*/ uint8 Beard; //
/*0001*/ uint8 HairColor; //
/*0000*/ uint8 Face; //
/*0000*/ CharSelectEquip Equip[EQ::textures::materialCount];
/*0000*/ CharSelectEquip Equip[EQEmu::textures::materialCount];
/*0000*/ uint32 PrimaryIDFile; //
/*0000*/ uint32 SecondaryIDFile; //
/*0000*/ uint8 Unknown15; // 0xff
@@ -4215,8 +4215,8 @@ struct ItemQuaternaryBodyStruct
int32 HealAmt;
int32 SpellDmg;
int32 Clairvoyance;
int32 SubType;
uint8 evolve_string; // Some String, but being evolution related is just a guess
uint8 unknown18; //Power Source Capacity or evolve filename?
uint32 evolve_string; // Some String, but being evolution related is just a guess
uint8 unknown19;
uint32 unknown20; // Bard Stuff?
uint32 unknown21;
-4
View File
@@ -24,10 +24,6 @@
#include <vector>
#include <map>
#ifdef __FreeBSD__
#include <unistd.h>
#endif
//I forced this object to become a singleton because it registers its
//signal handler for UNIX
class ProcLauncher {
+14 -14
View File
@@ -28,7 +28,7 @@
static std::list<std::string> profanity_list;
static bool update_originator_flag = false;
bool EQ::ProfanityManager::LoadProfanityList(DBcore *db) {
bool EQEmu::ProfanityManager::LoadProfanityList(DBcore *db) {
if (update_originator_flag == true) {
update_originator_flag = false;
return true;
@@ -40,7 +40,7 @@ bool EQ::ProfanityManager::LoadProfanityList(DBcore *db) {
return true;
}
bool EQ::ProfanityManager::UpdateProfanityList(DBcore *db) {
bool EQEmu::ProfanityManager::UpdateProfanityList(DBcore *db) {
if (!load_database_entries(db))
return false;
@@ -49,7 +49,7 @@ bool EQ::ProfanityManager::UpdateProfanityList(DBcore *db) {
return true;
}
bool EQ::ProfanityManager::DeleteProfanityList(DBcore *db) {
bool EQEmu::ProfanityManager::DeleteProfanityList(DBcore *db) {
if (!clear_database_entries(db))
return false;
@@ -58,7 +58,7 @@ bool EQ::ProfanityManager::DeleteProfanityList(DBcore *db) {
return true;
}
bool EQ::ProfanityManager::AddProfanity(DBcore *db, const char *profanity) {
bool EQEmu::ProfanityManager::AddProfanity(DBcore *db, const char *profanity) {
if (!db || !profanity)
return false;
@@ -86,7 +86,7 @@ bool EQ::ProfanityManager::AddProfanity(DBcore *db, const char *profanity) {
return true;
}
bool EQ::ProfanityManager::RemoveProfanity(DBcore *db, const char *profanity) {
bool EQEmu::ProfanityManager::RemoveProfanity(DBcore *db, const char *profanity) {
if (!db || !profanity)
return false;
@@ -111,7 +111,7 @@ bool EQ::ProfanityManager::RemoveProfanity(DBcore *db, const char *profanity) {
return true;
}
void EQ::ProfanityManager::RedactMessage(char *message) {
void EQEmu::ProfanityManager::RedactMessage(char *message) {
if (!message)
return;
@@ -142,7 +142,7 @@ void EQ::ProfanityManager::RedactMessage(char *message) {
}
}
void EQ::ProfanityManager::RedactMessage(std::string &message) {
void EQEmu::ProfanityManager::RedactMessage(std::string &message) {
if (message.length() < REDACTION_LENGTH_MIN || message.length() >= 4096)
return;
@@ -169,14 +169,14 @@ void EQ::ProfanityManager::RedactMessage(std::string &message) {
}
}
bool EQ::ProfanityManager::ContainsCensoredLanguage(const char *message) {
bool EQEmu::ProfanityManager::ContainsCensoredLanguage(const char *message) {
if (!message)
return false;
return ContainsCensoredLanguage(std::string(message));
}
bool EQ::ProfanityManager::ContainsCensoredLanguage(const std::string &message) {
bool EQEmu::ProfanityManager::ContainsCensoredLanguage(const std::string &message) {
if (message.length() < REDACTION_LENGTH_MIN || message.length() >= 4096)
return false;
@@ -192,15 +192,15 @@ bool EQ::ProfanityManager::ContainsCensoredLanguage(const std::string &message)
return false;
}
const std::list<std::string> &EQ::ProfanityManager::GetProfanityList() {
const std::list<std::string> &EQEmu::ProfanityManager::GetProfanityList() {
return profanity_list;
}
bool EQ::ProfanityManager::IsCensorshipActive() {
bool EQEmu::ProfanityManager::IsCensorshipActive() {
return (profanity_list.size() != 0);
}
bool EQ::ProfanityManager::load_database_entries(DBcore *db) {
bool EQEmu::ProfanityManager::load_database_entries(DBcore *db) {
if (!db)
return false;
@@ -223,7 +223,7 @@ bool EQ::ProfanityManager::load_database_entries(DBcore *db) {
return true;
}
bool EQ::ProfanityManager::clear_database_entries(DBcore *db) {
bool EQEmu::ProfanityManager::clear_database_entries(DBcore *db) {
if (!db)
return false;
@@ -237,7 +237,7 @@ bool EQ::ProfanityManager::clear_database_entries(DBcore *db) {
return true;
}
bool EQ::ProfanityManager::check_for_existing_entry(const char *profanity) {
bool EQEmu::ProfanityManager::check_for_existing_entry(const char *profanity) {
if (!profanity)
return false;
+1 -1
View File
@@ -26,7 +26,7 @@
class DBcore;
namespace EQ
namespace EQEmu
{
class ProfanityManager {
public:
+2 -2
View File
@@ -32,7 +32,7 @@
* Eventually this should be derived from an abstract base class
*/
namespace EQ {
namespace EQEmu {
class Random {
public:
// AKA old MakeRandomInt
@@ -80,7 +80,7 @@ namespace EQ {
{
static_assert(std::is_same<std::random_access_iterator_tag,
typename std::iterator_traits<RandomAccessIterator>::iterator_category>::value,
"EQ::Random::Shuffle requires random access iterators");
"EQEmu::Random::Shuffle requires random access iterators");
std::shuffle(first, last, m_gen);
}
@@ -0,0 +1,68 @@
/**
* EQEmulator: Everquest Server Emulator
* Copyright (C) 2001-2020 EQEmulator Development Team (https://github.com/EQEmu/Server)
*
* 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 EQEMU_AA_ABILITY_REPOSITORY_H
#define EQEMU_AA_ABILITY_REPOSITORY_H
#include "../database.h"
#include "../string_util.h"
#include "base/base_aa_ability_repository.h"
class AaAbilityRepository: public BaseAaAbilityRepository {
public:
/**
* This file was auto generated on Apr 5, 2020 and can be modified and extended upon
*
* Base repository methods are automatically
* generated in the "base" version of this repository. The base repository
* is immutable and to be left untouched, while methods in this class
* are used as extension methods for more specific persistence-layer
* accessors or mutators
*
* Base Methods (Subject to be expanded upon in time)
*
* InsertOne
* UpdateOne
* DeleteOne
* FindOne
* GetWhere(std::string where_filter)
* DeleteWhere(std::string where_filter)
* InsertMany
* All
*
* Example custom methods in a repository
*
* AaAbilityRepository::GetByZoneAndVersion(int zone_id, int zone_version)
* AaAbilityRepository::GetWhereNeverExpires()
* AaAbilityRepository::GetWhereXAndY()
* AaAbilityRepository::DeleteWhereXAndY()
*
* Most of the above could be covered by base methods, but if you as a developer
* find yourself re-using logic for other parts of the code, its best to just make a
* method that can be re-used easily elsewhere especially if it can use a base repository
* method and encapsulate filters there
*/
// Custom extended repository methods here
};
#endif //EQEMU_AA_ABILITY_REPOSITORY_H
@@ -0,0 +1,68 @@
/**
* EQEmulator: Everquest Server Emulator
* Copyright (C) 2001-2020 EQEmulator Development Team (https://github.com/EQEmu/Server)
*
* 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 EQEMU_AA_RANK_EFFECTS_REPOSITORY_H
#define EQEMU_AA_RANK_EFFECTS_REPOSITORY_H
#include "../database.h"
#include "../string_util.h"
#include "base/base_aa_rank_effects_repository.h"
class AaRankEffectsRepository: public BaseAaRankEffectsRepository {
public:
/**
* This file was auto generated on Apr 5, 2020 and can be modified and extended upon
*
* Base repository methods are automatically
* generated in the "base" version of this repository. The base repository
* is immutable and to be left untouched, while methods in this class
* are used as extension methods for more specific persistence-layer
* accessors or mutators
*
* Base Methods (Subject to be expanded upon in time)
*
* InsertOne
* UpdateOne
* DeleteOne
* FindOne
* GetWhere(std::string where_filter)
* DeleteWhere(std::string where_filter)
* InsertMany
* All
*
* Example custom methods in a repository
*
* AaRankEffectsRepository::GetByZoneAndVersion(int zone_id, int zone_version)
* AaRankEffectsRepository::GetWhereNeverExpires()
* AaRankEffectsRepository::GetWhereXAndY()
* AaRankEffectsRepository::DeleteWhereXAndY()
*
* Most of the above could be covered by base methods, but if you as a developer
* find yourself re-using logic for other parts of the code, its best to just make a
* method that can be re-used easily elsewhere especially if it can use a base repository
* method and encapsulate filters there
*/
// Custom extended repository methods here
};
#endif //EQEMU_AA_RANK_EFFECTS_REPOSITORY_H
@@ -0,0 +1,68 @@
/**
* EQEmulator: Everquest Server Emulator
* Copyright (C) 2001-2020 EQEmulator Development Team (https://github.com/EQEmu/Server)
*
* 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 EQEMU_AA_RANK_PREREQS_REPOSITORY_H
#define EQEMU_AA_RANK_PREREQS_REPOSITORY_H
#include "../database.h"
#include "../string_util.h"
#include "base/base_aa_rank_prereqs_repository.h"
class AaRankPrereqsRepository: public BaseAaRankPrereqsRepository {
public:
/**
* This file was auto generated on Apr 5, 2020 and can be modified and extended upon
*
* Base repository methods are automatically
* generated in the "base" version of this repository. The base repository
* is immutable and to be left untouched, while methods in this class
* are used as extension methods for more specific persistence-layer
* accessors or mutators
*
* Base Methods (Subject to be expanded upon in time)
*
* InsertOne
* UpdateOne
* DeleteOne
* FindOne
* GetWhere(std::string where_filter)
* DeleteWhere(std::string where_filter)
* InsertMany
* All
*
* Example custom methods in a repository
*
* AaRankPrereqsRepository::GetByZoneAndVersion(int zone_id, int zone_version)
* AaRankPrereqsRepository::GetWhereNeverExpires()
* AaRankPrereqsRepository::GetWhereXAndY()
* AaRankPrereqsRepository::DeleteWhereXAndY()
*
* Most of the above could be covered by base methods, but if you as a developer
* find yourself re-using logic for other parts of the code, its best to just make a
* method that can be re-used easily elsewhere especially if it can use a base repository
* method and encapsulate filters there
*/
// Custom extended repository methods here
};
#endif //EQEMU_AA_RANK_PREREQS_REPOSITORY_H
+68
View File
@@ -0,0 +1,68 @@
/**
* EQEmulator: Everquest Server Emulator
* Copyright (C) 2001-2020 EQEmulator Development Team (https://github.com/EQEmu/Server)
*
* 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 EQEMU_AA_RANKS_REPOSITORY_H
#define EQEMU_AA_RANKS_REPOSITORY_H
#include "../database.h"
#include "../string_util.h"
#include "base/base_aa_ranks_repository.h"
class AaRanksRepository: public BaseAaRanksRepository {
public:
/**
* This file was auto generated on Apr 5, 2020 and can be modified and extended upon
*
* Base repository methods are automatically
* generated in the "base" version of this repository. The base repository
* is immutable and to be left untouched, while methods in this class
* are used as extension methods for more specific persistence-layer
* accessors or mutators
*
* Base Methods (Subject to be expanded upon in time)
*
* InsertOne
* UpdateOne
* DeleteOne
* FindOne
* GetWhere(std::string where_filter)
* DeleteWhere(std::string where_filter)
* InsertMany
* All
*
* Example custom methods in a repository
*
* AaRanksRepository::GetByZoneAndVersion(int zone_id, int zone_version)
* AaRanksRepository::GetWhereNeverExpires()
* AaRanksRepository::GetWhereXAndY()
* AaRanksRepository::DeleteWhereXAndY()
*
* Most of the above could be covered by base methods, but if you as a developer
* find yourself re-using logic for other parts of the code, its best to just make a
* method that can be re-used easily elsewhere especially if it can use a base repository
* method and encapsulate filters there
*/
// Custom extended repository methods here
};
#endif //EQEMU_AA_RANKS_REPOSITORY_H
@@ -0,0 +1,68 @@
/**
* EQEmulator: Everquest Server Emulator
* Copyright (C) 2001-2020 EQEmulator Development Team (https://github.com/EQEmu/Server)
*
* 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 EQEMU_ACCOUNT_FLAGS_REPOSITORY_H
#define EQEMU_ACCOUNT_FLAGS_REPOSITORY_H
#include "../database.h"
#include "../string_util.h"
#include "base/base_account_flags_repository.h"
class AccountFlagsRepository: public BaseAccountFlagsRepository {
public:
/**
* This file was auto generated on Apr 5, 2020 and can be modified and extended upon
*
* Base repository methods are automatically
* generated in the "base" version of this repository. The base repository
* is immutable and to be left untouched, while methods in this class
* are used as extension methods for more specific persistence-layer
* accessors or mutators
*
* Base Methods (Subject to be expanded upon in time)
*
* InsertOne
* UpdateOne
* DeleteOne
* FindOne
* GetWhere(std::string where_filter)
* DeleteWhere(std::string where_filter)
* InsertMany
* All
*
* Example custom methods in a repository
*
* AccountFlagsRepository::GetByZoneAndVersion(int zone_id, int zone_version)
* AccountFlagsRepository::GetWhereNeverExpires()
* AccountFlagsRepository::GetWhereXAndY()
* AccountFlagsRepository::DeleteWhereXAndY()
*
* Most of the above could be covered by base methods, but if you as a developer
* find yourself re-using logic for other parts of the code, its best to just make a
* method that can be re-used easily elsewhere especially if it can use a base repository
* method and encapsulate filters there
*/
// Custom extended repository methods here
};
#endif //EQEMU_ACCOUNT_FLAGS_REPOSITORY_H
@@ -0,0 +1,68 @@
/**
* EQEmulator: Everquest Server Emulator
* Copyright (C) 2001-2020 EQEmulator Development Team (https://github.com/EQEmu/Server)
*
* 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 EQEMU_ACCOUNT_IP_REPOSITORY_H
#define EQEMU_ACCOUNT_IP_REPOSITORY_H
#include "../database.h"
#include "../string_util.h"
#include "base/base_account_ip_repository.h"
class AccountIpRepository: public BaseAccountIpRepository {
public:
/**
* This file was auto generated on Apr 5, 2020 and can be modified and extended upon
*
* Base repository methods are automatically
* generated in the "base" version of this repository. The base repository
* is immutable and to be left untouched, while methods in this class
* are used as extension methods for more specific persistence-layer
* accessors or mutators
*
* Base Methods (Subject to be expanded upon in time)
*
* InsertOne
* UpdateOne
* DeleteOne
* FindOne
* GetWhere(std::string where_filter)
* DeleteWhere(std::string where_filter)
* InsertMany
* All
*
* Example custom methods in a repository
*
* AccountIpRepository::GetByZoneAndVersion(int zone_id, int zone_version)
* AccountIpRepository::GetWhereNeverExpires()
* AccountIpRepository::GetWhereXAndY()
* AccountIpRepository::DeleteWhereXAndY()
*
* Most of the above could be covered by base methods, but if you as a developer
* find yourself re-using logic for other parts of the code, its best to just make a
* method that can be re-used easily elsewhere especially if it can use a base repository
* method and encapsulate filters there
*/
// Custom extended repository methods here
};
#endif //EQEMU_ACCOUNT_IP_REPOSITORY_H
+68
View File
@@ -0,0 +1,68 @@
/**
* EQEmulator: Everquest Server Emulator
* Copyright (C) 2001-2020 EQEmulator Development Team (https://github.com/EQEmu/Server)
*
* 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 EQEMU_ACCOUNT_REPOSITORY_H
#define EQEMU_ACCOUNT_REPOSITORY_H
#include "../database.h"
#include "../string_util.h"
#include "base/base_account_repository.h"
class AccountRepository: public BaseAccountRepository {
public:
/**
* This file was auto generated on Apr 5, 2020 and can be modified and extended upon
*
* Base repository methods are automatically
* generated in the "base" version of this repository. The base repository
* is immutable and to be left untouched, while methods in this class
* are used as extension methods for more specific persistence-layer
* accessors or mutators
*
* Base Methods (Subject to be expanded upon in time)
*
* InsertOne
* UpdateOne
* DeleteOne
* FindOne
* GetWhere(std::string where_filter)
* DeleteWhere(std::string where_filter)
* InsertMany
* All
*
* Example custom methods in a repository
*
* AccountRepository::GetByZoneAndVersion(int zone_id, int zone_version)
* AccountRepository::GetWhereNeverExpires()
* AccountRepository::GetWhereXAndY()
* AccountRepository::DeleteWhereXAndY()
*
* Most of the above could be covered by base methods, but if you as a developer
* find yourself re-using logic for other parts of the code, its best to just make a
* method that can be re-used easily elsewhere especially if it can use a base repository
* method and encapsulate filters there
*/
// Custom extended repository methods here
};
#endif //EQEMU_ACCOUNT_REPOSITORY_H

Some files were not shown because too many files have changed in this diff Show More