mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-13 02:38:45 +00:00
Compare commits
59 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c0fe0f11f7 | |||
| a1f1f11940 | |||
| 4c5013e09e | |||
| 838ffbd8c7 | |||
| 42b41d973c | |||
| e7761133a9 | |||
| 93f2bea96e | |||
| ded82ac6d6 | |||
| 6ef182edfd | |||
| e466ca1c6d | |||
| fa5a3155fe | |||
| a20d333f9d | |||
| 853739b538 | |||
| 6094ec9c7b | |||
| 9da1d6b397 | |||
| 8ea7299a57 | |||
| 0811a899d1 | |||
| fad9599642 | |||
| 62711b13d8 | |||
| 2702485206 | |||
| 0aadb891a1 | |||
| d812310c5b | |||
| 1420983700 | |||
| d25cc35f1b | |||
| ed7f395612 | |||
| 8dceb20dd8 | |||
| 6929d180ca | |||
| 011a66a75e | |||
| 07120563a2 | |||
| cc985cbcd5 | |||
| 97caa79472 | |||
| cfa575c756 | |||
| 85063249b4 | |||
| 04d6f8feea | |||
| dfc1bf0381 | |||
| 2237c3a056 | |||
| 4af191c593 | |||
| 0a3972deb9 | |||
| 9d2f258390 | |||
| 0b452f4ec1 | |||
| fef629e1df | |||
| a5a51fbe44 | |||
| 47db92cdb6 | |||
| 690301e80d | |||
| 1887e48b76 | |||
| af2691eb12 | |||
| 2df4289588 | |||
| 49d4d0acc3 | |||
| 5a663910a5 | |||
| b027edd21e | |||
| 0bbfcf7adc | |||
| 7962a0bd38 | |||
| 4d9b51df0a | |||
| 508ecec6ea | |||
| f0c6fa2a26 | |||
| ad6dbb7beb | |||
| 6ddbb41617 | |||
| 8a558f6a29 | |||
| 0585be0360 |
+1
-1
@@ -15,7 +15,7 @@ volumes:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Build Linux X64
|
- name: Build Linux X64
|
||||||
image: akkadius/eqemu-server:v11
|
image: akkadius/eqemu-server:v13
|
||||||
environment:
|
environment:
|
||||||
GITHUB_TOKEN:
|
GITHUB_TOKEN:
|
||||||
from_secret: GH_RELEASE_GITHUB_API_TOKEN
|
from_secret: GH_RELEASE_GITHUB_API_TOKEN
|
||||||
|
|||||||
+189
@@ -1,3 +1,192 @@
|
|||||||
|
## [22.34.0] - 11/11/2023
|
||||||
|
|
||||||
|
### Bots
|
||||||
|
|
||||||
|
* Add ownerraid, byclass and byrace actionables and fix group-based arguments for raids. ([#3680](https://github.com/EQEmu/Server/pull/3680)) @nytmyr 2023-11-19
|
||||||
|
|
||||||
|
### Code
|
||||||
|
|
||||||
|
* Cleanup #giveitem and #summonitem ([#3692](https://github.com/EQEmu/Server/pull/3692)) @Kinglykrab 2023-11-19
|
||||||
|
* Cleanup #show currencies Command ([#3693](https://github.com/EQEmu/Server/pull/3693)) @Kinglykrab 2023-11-19
|
||||||
|
|
||||||
|
### Commands
|
||||||
|
|
||||||
|
* Add #show aa_points Command ([#3695](https://github.com/EQEmu/Server/pull/3695)) @Kinglykrab 2023-11-19
|
||||||
|
|
||||||
|
### Database
|
||||||
|
|
||||||
|
* Pull pet power from content database ([#3689](https://github.com/EQEmu/Server/pull/3689)) @joligario 2023-11-18
|
||||||
|
|
||||||
|
### GM Commands
|
||||||
|
|
||||||
|
* Add `#takeplatinum` ([#3690](https://github.com/EQEmu/Server/pull/3690)) @joligario 2023-11-19
|
||||||
|
* Remove duplicate comment ([#3691](https://github.com/EQEmu/Server/pull/3691)) @joligario 2023-11-19
|
||||||
|
|
||||||
|
### Illusions
|
||||||
|
|
||||||
|
* RandomizeFeastures erased texture. ([#3686](https://github.com/EQEmu/Server/pull/3686)) @noudess 2023-11-12
|
||||||
|
|
||||||
|
### Spawn
|
||||||
|
|
||||||
|
* (imported from takp) Added min_time and max_time to spawnentry. This will prevent a NPC from… ([#3685](https://github.com/EQEmu/Server/pull/3685)) @regneq 2023-11-18
|
||||||
|
|
||||||
|
## [22.33.0] - 11/11/2023
|
||||||
|
|
||||||
|
### Feature
|
||||||
|
|
||||||
|
* Add Comment to Item Data/Quest API ([#3669](https://github.com/EQEmu/Server/pull/3669)) @Kinglykrab 2023-11-07
|
||||||
|
|
||||||
|
### Spawn2
|
||||||
|
|
||||||
|
* Fix edge case with instances not copying disabled spawn state ([#3688](https://github.com/EQEmu/Server/pull/3688)) @Akkadius 2023-11-12
|
||||||
|
|
||||||
|
## [22.32.1] - 11/6/2023
|
||||||
|
|
||||||
|
### Hotfix
|
||||||
|
|
||||||
|
* Adjust spawn2_disabled migration to copy data over
|
||||||
|
|
||||||
|
## [22.32.0] - 11/6/2023
|
||||||
|
|
||||||
|
### Bots
|
||||||
|
|
||||||
|
* Fix invalid races from being created ([#3681](https://github.com/EQEmu/Server/pull/3681)) @nytmyr 2023-11-06
|
||||||
|
|
||||||
|
### Crash
|
||||||
|
|
||||||
|
* Fix crash on CentOS when forming a raid with PCs or BOTs ([#3676](https://github.com/EQEmu/Server/pull/3676)) @neckkola 2023-11-06
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
|
||||||
|
* Add IsTGBCompatibleSpell() to package.add ([#3675](https://github.com/EQEmu/Server/pull/3675)) @Kinglykrab 2023-11-04
|
||||||
|
* Fix Perl__worldwideremovetask package ([#3670](https://github.com/EQEmu/Server/pull/3670)) @Kinglykrab 2023-11-04
|
||||||
|
* Revert " Fix Killed XYZH support in EVENT_DEATH in Perl. " (#3682) ([#3591](https://github.com/EQEmu/Server/pull/3591)) @fryguy503 2023-11-06
|
||||||
|
CRASH
|
||||||
|
|
||||||
|
### GCC
|
||||||
|
|
||||||
|
* Compatibility fix for GCC 13 ([#3677](https://github.com/EQEmu/Server/pull/3677)) @joligario 2023-11-05
|
||||||
|
|
||||||
|
### Parser
|
||||||
|
|
||||||
|
* Cleanup Spire Parsing for crosszonemoveplayerbycharid ([#3674](https://github.com/EQEmu/Server/pull/3674)) @Kinglykrab 2023-11-04
|
||||||
|
* Cleanup Spire Parsing for crosszonemoveplayerbyexpeditionid ([#3671](https://github.com/EQEmu/Server/pull/3671)) @Kinglykrab 2023-11-04
|
||||||
|
* Cleanup Spire Parsing for crosszonemoveplayerbygroupid ([#3673](https://github.com/EQEmu/Server/pull/3673)) @Kinglykrab 2023-11-04
|
||||||
|
* Cleanup Spire Parsing for crosszonemoveplayerbyguildid ([#3672](https://github.com/EQEmu/Server/pull/3672)) @Kinglykrab 2023-11-04
|
||||||
|
|
||||||
|
### Quest API
|
||||||
|
|
||||||
|
* Add GetBaseRaceName() to Perl and Lua ([#3668](https://github.com/EQEmu/Server/pull/3668)) @joligario 2023-11-01
|
||||||
|
* Add details to Lua event dispatch errors ([#3679](https://github.com/EQEmu/Server/pull/3679)) @hgtw 2023-11-06
|
||||||
|
|
||||||
|
### Spawn
|
||||||
|
|
||||||
|
* Split spawn2 enabled into its own state table ([#3664](https://github.com/EQEmu/Server/pull/3664)) @Akkadius 2023-11-06
|
||||||
|
|
||||||
|
### Spells
|
||||||
|
|
||||||
|
* Added IsNightTime() for Dance of the Fireflies ([#3667](https://github.com/EQEmu/Server/pull/3667)) @regneq 2023-11-04
|
||||||
|
|
||||||
|
## [22.31.3] - 10/31/2023
|
||||||
|
|
||||||
|
### Bug
|
||||||
|
|
||||||
|
* Force raids off content database ([#3665](https://github.com/EQEmu/Server/pull/3665)) @joligario 2023-10-31
|
||||||
|
|
||||||
|
### Crash
|
||||||
|
|
||||||
|
* Revert " Fix spell in AESpell related to beacons " ([#3659](https://github.com/EQEmu/Server/pull/3659)) @Akkadius 2023-10-31
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
|
||||||
|
* Fix issue with blocked spells not loading properly @Akkadius 2023-10-31
|
||||||
|
|
||||||
|
### Logs
|
||||||
|
|
||||||
|
* Convert Loot Messages to Error Logs ([#3663](https://github.com/EQEmu/Server/pull/3663)) @Kinglykrab 2023-10-31
|
||||||
|
|
||||||
|
## [22.31.2] - 10/31/2023
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
|
||||||
|
* Hotfix issue with beacon spells crashing @Akkadius 2023-10-31
|
||||||
|
|
||||||
|
## [22.31.1] - 10/31/2023
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
|
||||||
|
* Hotfix issue with blocked spells not loading properly @Akkadius 2023-10-31
|
||||||
|
|
||||||
|
## [22.31.0] - 10/29/2023
|
||||||
|
|
||||||
|
### Crash
|
||||||
|
|
||||||
|
* Fix crash when client pointer does not exist during #hotfix ([#3661](https://github.com/EQEmu/Server/pull/3661)) @Akkadius 2023-10-29
|
||||||
|
* Fix spell in AESpell related to beacons ([#3659](https://github.com/EQEmu/Server/pull/3659)) @Akkadius 2023-10-29
|
||||||
|
|
||||||
|
### Database
|
||||||
|
|
||||||
|
* Add id to variables table ([#3658](https://github.com/EQEmu/Server/pull/3658)) @Akkadius 2023-10-29
|
||||||
|
|
||||||
|
### Linux
|
||||||
|
|
||||||
|
* Add symbols to release builds ([#3660](https://github.com/EQEmu/Server/pull/3660)) @Akkadius 2023-10-29
|
||||||
|
|
||||||
|
### Perl
|
||||||
|
|
||||||
|
* Revert " Reload perl quests on zone bootup " ([#3648](https://github.com/EQEmu/Server/pull/3648)) @Akkadius 2023-10-26
|
||||||
|
|
||||||
|
### Trading
|
||||||
|
|
||||||
|
* Fix part 3 of Issue 932. ([#3654](https://github.com/EQEmu/Server/pull/3654)) @noudess 2023-10-29
|
||||||
|
|
||||||
|
## [22.30.2] - 10/26/2023
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
|
||||||
|
Revert Perl regression in #3648 causing scripts to not reliably initialize on zone bootup. @Akkadius 2023-10-26
|
||||||
|
|
||||||
|
## [22.30.1] - 10/24/2023
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
|
||||||
|
* Fix empty InsertMany in bot starting items. ([#3653](https://github.com/EQEmu/Server/pull/3653)) @Kinglykrab 2023-10-24
|
||||||
|
|
||||||
|
## [22.30.0] - 10/23/2023
|
||||||
|
|
||||||
|
### API
|
||||||
|
|
||||||
|
* Implement Zone Sidecar ([#3635](https://github.com/EQEmu/Server/pull/3635)) @Akkadius 2023-10-24
|
||||||
|
|
||||||
|
### Commands
|
||||||
|
|
||||||
|
* Move #suspend from content database ([#3651](https://github.com/EQEmu/Server/pull/3651)) @joligario 2023-10-24
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
|
||||||
|
* Fix Bot Starting Items SQL ([#3649](https://github.com/EQEmu/Server/pull/3649)) @Kinglykrab 2023-10-23
|
||||||
|
|
||||||
|
### Perl
|
||||||
|
|
||||||
|
* Implement eqemu-perl for Linux ([#3652](https://github.com/EQEmu/Server/pull/3652)) @Akkadius 2023-10-24
|
||||||
|
* Reload perl quests on zone bootup ([#3648](https://github.com/EQEmu/Server/pull/3648)) @hgtw 2023-10-24
|
||||||
|
|
||||||
|
### Pets
|
||||||
|
|
||||||
|
* Disallow effect of alliance line when cast on pets. ([#3650](https://github.com/EQEmu/Server/pull/3650)) @noudess 2023-10-24
|
||||||
|
|
||||||
|
## [22.29.1] - 10/21/2023
|
||||||
|
|
||||||
|
### DB
|
||||||
|
|
||||||
|
* Fix manifest for blocked spells ([#3646](https://github.com/EQEmu/Server/pull/3646)) @joligario 2023-10-21
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
|
||||||
|
* Fix issue with subcommand settings not working ([#3643](https://github.com/EQEmu/Server/pull/3643)) @Kinglykrab 2023-10-21
|
||||||
|
* Hotfix command without hotfix name ([#3644](https://github.com/EQEmu/Server/pull/3644)) @joligario 2023-10-21
|
||||||
|
* Verifying mail keys when none exist ([#3645](https://github.com/EQEmu/Server/pull/3645)) @joligario 2023-10-21
|
||||||
|
|
||||||
## [22.29.0] - 10/20/2023
|
## [22.29.0] - 10/20/2023
|
||||||
|
|
||||||
### Feature
|
### Feature
|
||||||
|
|||||||
+10
-1
@@ -24,7 +24,9 @@ IF (EQEMU_BUILD_STATIC)
|
|||||||
MESSAGE(STATUS "Building with static linking")
|
MESSAGE(STATUS "Building with static linking")
|
||||||
SET(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++")
|
SET(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++")
|
||||||
IF (UNIX)
|
IF (UNIX)
|
||||||
SET(PERL_LIBRARY "/usr/lib/x86_64-linux-gnu/libperl.a")
|
SET(PERL_LIBRARY "/opt/eqemu-perl/lib/5.32.1/x86_64-linux-thread-multi/CORE/libperl.so")
|
||||||
|
SET(PERL_INCLUDE_PATH "/opt/eqemu-perl/lib/5.32.1/x86_64-linux-thread-multi/CORE/")
|
||||||
|
SET(PERL_EXECUTABLE "/opt/eqemu-perl/bin/perl")
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
ENDIF (EQEMU_BUILD_STATIC)
|
ENDIF (EQEMU_BUILD_STATIC)
|
||||||
|
|
||||||
@@ -136,6 +138,13 @@ ELSE()
|
|||||||
MESSAGE(STATUS "* mbedTLS: MISSING *")
|
MESSAGE(STATUS "* mbedTLS: MISSING *")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
MESSAGE(STATUS "PERL_INCLUDE_PATH: ${PERL_INCLUDE_PATH}")
|
||||||
|
MESSAGE(STATUS "PERL_LIBRARY: ${PERL_LIBRARY}")
|
||||||
|
MESSAGE(STATUS "PERL_INCLUDE_DIR: ${PERL_INCLUDE_DIR}")
|
||||||
|
MESSAGE(STATUS "PERL_INCLUDE_DIRS: ${PERL_INCLUDE_DIRS}")
|
||||||
|
MESSAGE(STATUS "PERL_LIBRARIES: ${PERL_LIBRARIES}")
|
||||||
|
MESSAGE(STATUS "PERL_VERSION: ${PERL_VERSION}")
|
||||||
|
|
||||||
MESSAGE(STATUS "**************************************************")
|
MESSAGE(STATUS "**************************************************")
|
||||||
|
|
||||||
#options
|
#options
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ SET(common_sources
|
|||||||
perl_eqdb.cpp
|
perl_eqdb.cpp
|
||||||
perl_eqdb_res.cpp
|
perl_eqdb_res.cpp
|
||||||
process/process.cpp
|
process/process.cpp
|
||||||
|
process.cpp
|
||||||
proc_launcher.cpp
|
proc_launcher.cpp
|
||||||
profanity_manager.cpp
|
profanity_manager.cpp
|
||||||
ptimer.cpp
|
ptimer.cpp
|
||||||
@@ -90,6 +91,7 @@ SET(common_sources
|
|||||||
timer.cpp
|
timer.cpp
|
||||||
unix.cpp
|
unix.cpp
|
||||||
platform.cpp
|
platform.cpp
|
||||||
|
json/json.hpp
|
||||||
json/jsoncpp.cpp
|
json/jsoncpp.cpp
|
||||||
zone_store.cpp
|
zone_store.cpp
|
||||||
net/console_server.cpp
|
net/console_server.cpp
|
||||||
@@ -583,6 +585,7 @@ SET(common_headers
|
|||||||
path_manager.cpp
|
path_manager.cpp
|
||||||
platform.h
|
platform.h
|
||||||
process/process.h
|
process/process.h
|
||||||
|
process.h
|
||||||
proc_launcher.h
|
proc_launcher.h
|
||||||
profanity_manager.h
|
profanity_manager.h
|
||||||
profiler.h
|
profiler.h
|
||||||
|
|||||||
@@ -124,14 +124,6 @@ namespace EQEmuCommand {
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
std::string description;
|
std::string description;
|
||||||
bool ran_command = false;
|
|
||||||
for (auto &it: in_function_map) {
|
|
||||||
if (it.first == argv[1]) {
|
|
||||||
(it.second)(argc, argv, cmd, description);
|
|
||||||
ran_command = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cmd[{"-h", "--help"}]) {
|
if (cmd[{"-h", "--help"}]) {
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
std::cout <<
|
std::cout <<
|
||||||
@@ -142,9 +134,7 @@ namespace EQEmuCommand {
|
|||||||
<< std::endl
|
<< std::endl
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
|
|
||||||
/**
|
// Get max command length for padding length
|
||||||
* Get max command length for padding length
|
|
||||||
*/
|
|
||||||
int max_command_length = 0;
|
int max_command_length = 0;
|
||||||
|
|
||||||
for (auto &it: in_function_map) {
|
for (auto &it: in_function_map) {
|
||||||
@@ -155,18 +145,14 @@ namespace EQEmuCommand {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// Display command menu
|
||||||
* Display command menu
|
|
||||||
*/
|
|
||||||
std::string command_section;
|
std::string command_section;
|
||||||
for (auto &it: in_function_map) {
|
for (auto &it: in_function_map) {
|
||||||
description.clear();
|
description.clear();
|
||||||
|
|
||||||
(it.second)(argc, argv, cmd, description);
|
(it.second)(argc, argv, cmd, description);
|
||||||
|
|
||||||
/**
|
// Print section header
|
||||||
* Print section header
|
|
||||||
*/
|
|
||||||
std::string command_prefix = it.first.substr(0, it.first.find(":"));
|
std::string command_prefix = it.first.substr(0, it.first.find(":"));
|
||||||
|
|
||||||
if (command_prefix.find("test") != std::string::npos) {
|
if (command_prefix.find("test") != std::string::npos) {
|
||||||
@@ -178,9 +164,7 @@ namespace EQEmuCommand {
|
|||||||
std::cout << termcolor::reset << command_prefix << std::endl;
|
std::cout << termcolor::reset << command_prefix << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// Print commands
|
||||||
* Print commands
|
|
||||||
*/
|
|
||||||
std::stringstream command;
|
std::stringstream command;
|
||||||
command << termcolor::colorize << termcolor::yellow << it.first << termcolor::reset;
|
command << termcolor::colorize << termcolor::yellow << it.first << termcolor::reset;
|
||||||
printf(" %-*s %s\n", max_command_length, command.str().c_str(), description.c_str());
|
printf(" %-*s %s\n", max_command_length, command.str().c_str(), description.c_str());
|
||||||
@@ -191,6 +175,15 @@ namespace EQEmuCommand {
|
|||||||
std::exit(0);
|
std::exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ran_command = false;
|
||||||
|
|
||||||
|
for (auto &it: in_function_map) {
|
||||||
|
if (it.first == argv[1]) {
|
||||||
|
(it.second)(argc, argv, cmd, description);
|
||||||
|
ran_command = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (ran_command) {
|
if (ran_command) {
|
||||||
std::exit(0);
|
std::exit(0);
|
||||||
}
|
}
|
||||||
|
|||||||
+24
-16
@@ -2097,37 +2097,45 @@ void Database::ClearInvSnapshots(bool from_now) {
|
|||||||
|
|
||||||
struct TimeOfDay_Struct Database::LoadTime(time_t &realtime)
|
struct TimeOfDay_Struct Database::LoadTime(time_t &realtime)
|
||||||
{
|
{
|
||||||
|
TimeOfDay_Struct t{};
|
||||||
TimeOfDay_Struct eqTime;
|
|
||||||
std::string query = StringFormat("SELECT minute,hour,day,month,year,realtime FROM eqtime limit 1");
|
std::string query = StringFormat("SELECT minute,hour,day,month,year,realtime FROM eqtime limit 1");
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
|
|
||||||
if (!results.Success() || results.RowCount() == 0) {
|
if (!results.Success() || results.RowCount() == 0) {
|
||||||
LogInfo("Loading EQ time of day failed. Using defaults");
|
LogInfo("Loading EQ time of day failed. Using defaults");
|
||||||
eqTime.minute = 0;
|
t.minute = 0;
|
||||||
eqTime.hour = 9;
|
t.hour = 9;
|
||||||
eqTime.day = 1;
|
t.day = 1;
|
||||||
eqTime.month = 1;
|
t.month = 1;
|
||||||
eqTime.year = 3100;
|
t.year = 3100;
|
||||||
realtime = time(nullptr);
|
realtime = time(nullptr);
|
||||||
|
return t;
|
||||||
}
|
}
|
||||||
else{
|
|
||||||
auto row = results.begin();
|
auto row = results.begin();
|
||||||
|
|
||||||
eqTime.minute = Strings::ToUnsignedInt(row[0]);
|
uint8 hour = Strings::ToUnsignedInt(row[1]);
|
||||||
eqTime.hour = Strings::ToUnsignedInt(row[1]);
|
time_t realtime_ = Strings::ToBigInt(row[5]);
|
||||||
eqTime.day = Strings::ToUnsignedInt(row[2]);
|
if (RuleI(World, BootHour) > 0 && RuleI(World, BootHour) <= 24) {
|
||||||
eqTime.month = Strings::ToUnsignedInt(row[3]);
|
hour = RuleI(World, BootHour);
|
||||||
eqTime.year = Strings::ToUnsignedInt(row[4]);
|
realtime_ = time(nullptr);
|
||||||
realtime = Strings::ToBigInt(row[5]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return eqTime;
|
t.minute = Strings::ToUnsignedInt(row[0]);
|
||||||
|
t.hour = hour;
|
||||||
|
t.day = Strings::ToUnsignedInt(row[2]);
|
||||||
|
t.month = Strings::ToUnsignedInt(row[3]);
|
||||||
|
t.year = Strings::ToUnsignedInt(row[4]);
|
||||||
|
realtime = realtime_;
|
||||||
|
|
||||||
|
LogEqTime("Setting hour to [{}]", hour);
|
||||||
|
|
||||||
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Database::SaveTime(int8 minute, int8 hour, int8 day, int8 month, int16 year)
|
bool Database::SaveTime(int8 minute, int8 hour, int8 day, int8 month, int16 year)
|
||||||
{
|
{
|
||||||
std::string query = StringFormat("UPDATE eqtime set minute = %d, hour = %d, day = %d, month = %d, year = %d, realtime = %d limit 1", minute, hour, day, month, year, time(0));
|
std::string query = StringFormat("UPDATE eqtime set minute = %d, hour = %d, day = %d, month = %d, year = %d, realtime = %d limit 1", minute, hour, day, month, year, time(nullptr));
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
|
|
||||||
return results.Success();
|
return results.Success();
|
||||||
|
|||||||
@@ -4973,8 +4973,8 @@ ALTER TABLE `tradeskill_recipe`
|
|||||||
.version = 9239,
|
.version = 9239,
|
||||||
.description = "2023_10_18_blocked_spells_expansions_content_flags.sql",
|
.description = "2023_10_18_blocked_spells_expansions_content_flags.sql",
|
||||||
.check = "SHOW COLUMNS FROM `blocked_spells` LIKE 'min_expansion'",
|
.check = "SHOW COLUMNS FROM `blocked_spells` LIKE 'min_expansion'",
|
||||||
.condition = "",
|
.condition = "empty",
|
||||||
.match = "empty",
|
.match = "",
|
||||||
.sql = R"(
|
.sql = R"(
|
||||||
ALTER TABLE `blocked_spells`
|
ALTER TABLE `blocked_spells`
|
||||||
ADD COLUMN `min_expansion` tinyint(4) NOT NULL DEFAULT -1 AFTER `description`,
|
ADD COLUMN `min_expansion` tinyint(4) NOT NULL DEFAULT -1 AFTER `description`,
|
||||||
@@ -4983,7 +4983,53 @@ ADD COLUMN `content_flags` varchar(100) CHARACTER SET latin1 COLLATE latin1_swed
|
|||||||
ADD COLUMN `content_flags_disabled` varchar(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL AFTER `content_flags`;
|
ADD COLUMN `content_flags_disabled` varchar(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL AFTER `content_flags`;
|
||||||
)"
|
)"
|
||||||
},
|
},
|
||||||
|
ManifestEntry{
|
||||||
|
.version = 9240,
|
||||||
|
.description = "2023_10_29_variables_id.sql",
|
||||||
|
.check = "SHOW COLUMNS FROM `variables` LIKE 'id'",
|
||||||
|
.condition = "empty",
|
||||||
|
.match = "",
|
||||||
|
.sql = R"(
|
||||||
|
ALTER TABLE `variables`
|
||||||
|
ADD COLUMN `id` int(11) NOT NULL AUTO_INCREMENT FIRST,
|
||||||
|
DROP PRIMARY KEY,
|
||||||
|
ADD PRIMARY KEY (`id`) USING BTREE,
|
||||||
|
ADD UNIQUE INDEX(`varname`);
|
||||||
|
)"
|
||||||
|
},
|
||||||
|
ManifestEntry{
|
||||||
|
.version = 9241,
|
||||||
|
.description = "2023_10_29_split_spawn2_enabled.sql",
|
||||||
|
.check = "SHOW TABLES LIKE 'spawn2_disabled'",
|
||||||
|
.condition = "empty",
|
||||||
|
.match = "",
|
||||||
|
.sql = R"(
|
||||||
|
CREATE TABLE `spawn2_backup_2023_10_29` LIKE `spawn2`;
|
||||||
|
INSERT INTO `spawn2_backup_2023_10_29` SELECT * FROM `spawn2`;
|
||||||
|
CREATE TABLE `spawn2_disabled` (
|
||||||
|
`id` bigint(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
`spawn2_id` int(11) DEFAULT NULL,
|
||||||
|
`instance_id` int(11) DEFAULT 0,
|
||||||
|
`disabled` smallint(11) DEFAULT 0,
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE KEY `spawn2_id` (`spawn2_id`,`instance_id`) USING BTREE
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
|
||||||
|
INSERT INTO spawn2_disabled (spawn2_id, disabled) SELECT id, 1 FROM spawn2 WHERE enabled = 0;
|
||||||
|
ALTER TABLE `spawn2` DROP COLUMN `enabled`;
|
||||||
|
)"
|
||||||
|
},
|
||||||
|
ManifestEntry{
|
||||||
|
.version = 9242,
|
||||||
|
.description = "2023_11_7_mintime_maxtime_spawnentry.sql",
|
||||||
|
.check = "SHOW COLUMNS FROM `spawnentry` LIKE 'min_time'",
|
||||||
|
.condition = "empty",
|
||||||
|
.match = "",
|
||||||
|
.sql = R"(
|
||||||
|
ALTER TABLE `spawnentry`
|
||||||
|
ADD COLUMN `min_time` smallint(4) NOT NULL DEFAULT 0 AFTER `condition_value_filter`,
|
||||||
|
ADD COLUMN `max_time` smallint(4) NOT NULL DEFAULT 0 AFTER `min_time`;
|
||||||
|
)"
|
||||||
|
},
|
||||||
// -- template; copy/paste this when you need to create a new entry
|
// -- template; copy/paste this when you need to create a new entry
|
||||||
// ManifestEntry{
|
// ManifestEntry{
|
||||||
// .version = 9228,
|
// .version = 9228,
|
||||||
|
|||||||
@@ -65,8 +65,8 @@ SET FOREIGN_KEY_CHECKS = 1;
|
|||||||
.version = 9040,
|
.version = 9040,
|
||||||
.description = "2023_11_16_bot_starting_items.sql",
|
.description = "2023_11_16_bot_starting_items.sql",
|
||||||
.check = "SHOW TABLES LIKE 'bot_starting_items'",
|
.check = "SHOW TABLES LIKE 'bot_starting_items'",
|
||||||
.condition = "",
|
.condition = "empty",
|
||||||
.match = "empty",
|
.match = "",
|
||||||
.sql = R"(
|
.sql = R"(
|
||||||
CREATE TABLE `bot_starting_items` (
|
CREATE TABLE `bot_starting_items` (
|
||||||
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||||||
#include "../common/repositories/raid_members_repository.h"
|
#include "../common/repositories/raid_members_repository.h"
|
||||||
#include "../common/repositories/respawn_times_repository.h"
|
#include "../common/repositories/respawn_times_repository.h"
|
||||||
#include "../common/repositories/spawn_condition_values_repository.h"
|
#include "../common/repositories/spawn_condition_values_repository.h"
|
||||||
|
#include "repositories/spawn2_disabled_repository.h"
|
||||||
|
|
||||||
|
|
||||||
#include "database.h"
|
#include "database.h"
|
||||||
@@ -49,6 +50,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
bool Database::AddClientToInstance(uint16 instance_id, uint32 character_id)
|
bool Database::AddClientToInstance(uint16 instance_id, uint32 character_id)
|
||||||
{
|
{
|
||||||
auto e = InstanceListPlayerRepository::NewEntity();
|
auto e = InstanceListPlayerRepository::NewEntity();
|
||||||
@@ -553,6 +555,7 @@ void Database::PurgeExpiredInstances()
|
|||||||
CharacterCorpsesRepository::BuryInstances(*this, imploded_instance_ids);
|
CharacterCorpsesRepository::BuryInstances(*this, imploded_instance_ids);
|
||||||
DynamicZoneMembersRepository::DeleteByManyInstances(*this, imploded_instance_ids);
|
DynamicZoneMembersRepository::DeleteByManyInstances(*this, imploded_instance_ids);
|
||||||
DynamicZonesRepository::DeleteWhere(*this, fmt::format("instance_id IN ({})", imploded_instance_ids));
|
DynamicZonesRepository::DeleteWhere(*this, fmt::format("instance_id IN ({})", imploded_instance_ids));
|
||||||
|
Spawn2DisabledRepository::DeleteWhere(*this, fmt::format("instance_id IN ({})", imploded_instance_ids));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Database::SetInstanceDuration(uint16 instance_id, uint32 new_duration)
|
void Database::SetInstanceDuration(uint16 instance_id, uint32 new_duration)
|
||||||
|
|||||||
@@ -345,6 +345,7 @@ namespace DatabaseSchema {
|
|||||||
"respawn_times",
|
"respawn_times",
|
||||||
"saylink",
|
"saylink",
|
||||||
"server_scheduled_events",
|
"server_scheduled_events",
|
||||||
|
"spawn2_disabled",
|
||||||
"player_event_log_settings",
|
"player_event_log_settings",
|
||||||
"player_event_logs",
|
"player_event_logs",
|
||||||
"shared_task_activity_state",
|
"shared_task_activity_state",
|
||||||
|
|||||||
@@ -1052,4 +1052,27 @@ enum ScribeSpellActions
|
|||||||
Unmemorize
|
Unmemorize
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum SpellTimeRestrictions
|
||||||
|
{
|
||||||
|
NoRestriction,
|
||||||
|
Day,
|
||||||
|
Night
|
||||||
|
};
|
||||||
|
|
||||||
|
enum MoneyTypes
|
||||||
|
{
|
||||||
|
Copper,
|
||||||
|
Silver,
|
||||||
|
Gold,
|
||||||
|
Platinum
|
||||||
|
};
|
||||||
|
|
||||||
|
enum MoneySubtypes
|
||||||
|
{
|
||||||
|
Personal,
|
||||||
|
Bank,
|
||||||
|
Cursor,
|
||||||
|
SharedBank // Platinum Only
|
||||||
|
};
|
||||||
|
|
||||||
#endif /*COMMON_EQ_CONSTANTS_H*/
|
#endif /*COMMON_EQ_CONSTANTS_H*/
|
||||||
|
|||||||
@@ -100,6 +100,8 @@ EQEmuLogSys *EQEmuLogSys::LoadLogSettingsDefaults()
|
|||||||
log_settings[Logs::Discord].log_to_console = static_cast<uint8>(Logs::General);
|
log_settings[Logs::Discord].log_to_console = static_cast<uint8>(Logs::General);
|
||||||
log_settings[Logs::QuestErrors].log_to_gmsay = static_cast<uint8>(Logs::General);
|
log_settings[Logs::QuestErrors].log_to_gmsay = static_cast<uint8>(Logs::General);
|
||||||
log_settings[Logs::QuestErrors].log_to_console = static_cast<uint8>(Logs::General);
|
log_settings[Logs::QuestErrors].log_to_console = static_cast<uint8>(Logs::General);
|
||||||
|
log_settings[Logs::EqTime].log_to_console = static_cast<uint8>(Logs::General);
|
||||||
|
log_settings[Logs::EqTime].log_to_gmsay = static_cast<uint8>(Logs::General);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* RFC 5424
|
* RFC 5424
|
||||||
|
|||||||
@@ -139,6 +139,7 @@ namespace Logs {
|
|||||||
PlayerEvents,
|
PlayerEvents,
|
||||||
DataBuckets,
|
DataBuckets,
|
||||||
Zoning,
|
Zoning,
|
||||||
|
EqTime,
|
||||||
MaxCategoryID /* Don't Remove this */
|
MaxCategoryID /* Don't Remove this */
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -237,6 +238,7 @@ namespace Logs {
|
|||||||
"PlayerEvents",
|
"PlayerEvents",
|
||||||
"DataBuckets",
|
"DataBuckets",
|
||||||
"Zoning",
|
"Zoning",
|
||||||
|
"EqTime",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -814,6 +814,16 @@
|
|||||||
OutF(LogSys, Logs::Detail, Logs::Zoning, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
OutF(LogSys, Logs::Detail, Logs::Zoning, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
#define LogEqTime(message, ...) do {\
|
||||||
|
if (LogSys.IsLogEnabled(Logs::General, Logs::EqTime))\
|
||||||
|
OutF(LogSys, Logs::General, Logs::EqTime, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define LogEqTimeDetail(message, ...) do {\
|
||||||
|
if (LogSys.IsLogEnabled(Logs::Detail, Logs::EqTime))\
|
||||||
|
OutF(LogSys, Logs::Detail, Logs::EqTime, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||||
|
} while (0)
|
||||||
|
|
||||||
#define Log(debug_level, log_category, message, ...) do {\
|
#define Log(debug_level, log_category, message, ...) do {\
|
||||||
if (LogSys.IsLogEnabled(debug_level, log_category))\
|
if (LogSys.IsLogEnabled(debug_level, log_category))\
|
||||||
LogSys.Out(debug_level, log_category, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
LogSys.Out(debug_level, log_category, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||||
|
|||||||
+51
-7
@@ -46,16 +46,16 @@ EQTime::EQTime()
|
|||||||
timezone = 0;
|
timezone = 0;
|
||||||
memset(&eqTime, 0, sizeof(eqTime));
|
memset(&eqTime, 0, sizeof(eqTime));
|
||||||
//Defaults for time
|
//Defaults for time
|
||||||
TimeOfDay_Struct start;
|
TimeOfDay_Struct t{};
|
||||||
start.day = 1;
|
t.day = 1;
|
||||||
start.hour = 9;
|
t.hour = 9;
|
||||||
start.minute = 0;
|
t.minute = 0;
|
||||||
start.month = 1;
|
t.month = 1;
|
||||||
start.year = 3100;
|
t.year = 3100;
|
||||||
//Set default time zone
|
//Set default time zone
|
||||||
timezone = 0;
|
timezone = 0;
|
||||||
//Start EQTimer
|
//Start EQTimer
|
||||||
SetCurrentEQTimeOfDay(start, time(0));
|
SetCurrentEQTimeOfDay(t, time(nullptr));
|
||||||
}
|
}
|
||||||
|
|
||||||
//getEQTimeOfDay - Reads timeConvert and writes the result to eqTimeOfDay
|
//getEQTimeOfDay - Reads timeConvert and writes the result to eqTimeOfDay
|
||||||
@@ -200,3 +200,47 @@ void EQTime::ToString(TimeOfDay_Struct *t, std::string &str) {
|
|||||||
buf[127] = '\0';
|
buf[127] = '\0';
|
||||||
str = buf;
|
str = buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool EQTime::IsDayTime() {
|
||||||
|
TimeOfDay_Struct tod{}; //Day time is 5am to 6:59pm (14 hours in-game)
|
||||||
|
GetCurrentEQTimeOfDay(&tod); //TODO: what if it fails and returns zero?
|
||||||
|
|
||||||
|
if (tod.hour >= 5 || tod.hour < 19) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool EQTime::IsNightTime() {
|
||||||
|
TimeOfDay_Struct tod{}; //Night time is 7pm to 4:59am (10 hours in-game)
|
||||||
|
GetCurrentEQTimeOfDay(&tod); //TODO: what if it fails and returns zero?
|
||||||
|
|
||||||
|
if (tod.hour >= 19 || tod.hour < 5) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool EQTime::IsInbetweenTime(uint8 min_time, uint8 max_time) {
|
||||||
|
TimeOfDay_Struct tod{};
|
||||||
|
GetCurrentEQTimeOfDay(&tod);
|
||||||
|
|
||||||
|
if (min_time == 0 || max_time == 0 || min_time > 24 || max_time > 24) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (max_time < min_time) {
|
||||||
|
if ((tod.hour >= min_time && tod.hour > max_time) || (tod.hour < min_time && tod.hour <= max_time)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (tod.hour >= min_time && tod.hour <= max_time) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|||||||
@@ -28,6 +28,9 @@ public:
|
|||||||
uint32 getEQTimeZone() { return timezone; }
|
uint32 getEQTimeZone() { return timezone; }
|
||||||
uint32 getEQTimeZoneHr() { return timezone/60; }
|
uint32 getEQTimeZoneHr() { return timezone/60; }
|
||||||
uint32 getEQTimeZoneMin() { return timezone%60; }
|
uint32 getEQTimeZoneMin() { return timezone%60; }
|
||||||
|
bool IsDayTime();
|
||||||
|
bool IsNightTime();
|
||||||
|
bool IsInbetweenTime(uint8 min_time, uint8 max_time);
|
||||||
|
|
||||||
//Set functions
|
//Set functions
|
||||||
int SetCurrentEQTimeOfDay(TimeOfDay_Struct start_eq, time_t start_real);
|
int SetCurrentEQTimeOfDay(TimeOfDay_Struct start_eq, time_t start_real);
|
||||||
|
|||||||
@@ -356,6 +356,7 @@ namespace EQ
|
|||||||
struct ItemData {
|
struct ItemData {
|
||||||
// Non packet based fields
|
// Non packet based fields
|
||||||
uint8 MinStatus {};
|
uint8 MinStatus {};
|
||||||
|
char Comment[255] {};
|
||||||
|
|
||||||
// Packet based fields
|
// Packet based fields
|
||||||
uint8 ItemClass {}; // Item Type: 0=common, 1=container, 2=book
|
uint8 ItemClass {}; // Item Type: 0=common, 1=container, 2=book
|
||||||
|
|||||||
+24640
File diff suppressed because it is too large
Load Diff
@@ -72,6 +72,8 @@ std::string GetPlatformName()
|
|||||||
return "HC";
|
return "HC";
|
||||||
case EQEmuExePlatform::ExePlatformTests:
|
case EQEmuExePlatform::ExePlatformTests:
|
||||||
return "Tests";
|
return "Tests";
|
||||||
|
case EQEmuExePlatform::ExePlatformZoneSidecar:
|
||||||
|
return "ZoneSidecar";
|
||||||
default:
|
default:
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -37,7 +37,8 @@ enum EQEmuExePlatform
|
|||||||
ExePlatformClientImport,
|
ExePlatformClientImport,
|
||||||
ExePlatformClientExport,
|
ExePlatformClientExport,
|
||||||
ExePlatformHC,
|
ExePlatformHC,
|
||||||
ExePlatformTests
|
ExePlatformTests,
|
||||||
|
ExePlatformZoneSidecar
|
||||||
};
|
};
|
||||||
|
|
||||||
void RegisterExecutablePlatform(EQEmuExePlatform p);
|
void RegisterExecutablePlatform(EQEmuExePlatform p);
|
||||||
|
|||||||
@@ -0,0 +1,44 @@
|
|||||||
|
#include <string>
|
||||||
|
#include <fstream>
|
||||||
|
#include <algorithm>
|
||||||
|
#include "process.h"
|
||||||
|
|
||||||
|
inline std::string random_string(size_t length)
|
||||||
|
{
|
||||||
|
auto randchar = []() -> char {
|
||||||
|
const char charset[] = "0123456789" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz";
|
||||||
|
const size_t max_index = (sizeof(charset) - 1);
|
||||||
|
return charset[static_cast<size_t>(std::rand()) % max_index];
|
||||||
|
};
|
||||||
|
std::string str(length, 0);
|
||||||
|
std::generate_n(str.begin(), length, randchar);
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string Process::execute(const std::string &cmd, bool return_result)
|
||||||
|
{
|
||||||
|
std::string random = "/tmp/" + random_string(25);
|
||||||
|
const char *file_name = random.c_str();
|
||||||
|
|
||||||
|
if (return_result) {
|
||||||
|
#ifdef _WINDOWS
|
||||||
|
std::system((cmd + " > " + file_name + " 2>&1").c_str());
|
||||||
|
#else
|
||||||
|
std::system((cmd + " > " + file_name + " 2>&1").c_str());
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
std::system((cmd).c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string result;
|
||||||
|
|
||||||
|
if (return_result) {
|
||||||
|
std::ifstream file(file_name);
|
||||||
|
result = {std::istreambuf_iterator<char>(file), std::istreambuf_iterator<char>()};
|
||||||
|
std::remove(file_name);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
#ifndef EQEMU_PROCESS_H
|
||||||
|
#define EQEMU_PROCESS_H
|
||||||
|
|
||||||
|
class Process {
|
||||||
|
public:
|
||||||
|
static std::string execute(const std::string &cmd, bool return_result = true);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif //EQEMU_PROCESS_H
|
||||||
@@ -0,0 +1,354 @@
|
|||||||
|
/**
|
||||||
|
* DO NOT MODIFY THIS FILE
|
||||||
|
*
|
||||||
|
* This repository was automatically generated and is NOT to be modified directly.
|
||||||
|
* Any repository modifications are meant to be made to the repository extending the base.
|
||||||
|
* Any modifications to base repositories are to be made by the generator only
|
||||||
|
*
|
||||||
|
* @generator ./utils/scripts/generators/repository-generator.pl
|
||||||
|
* @docs https://eqemu.gitbook.io/server/in-development/developer-area/repositories
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef EQEMU_BASE_SPAWN2_DISABLED_REPOSITORY_H
|
||||||
|
#define EQEMU_BASE_SPAWN2_DISABLED_REPOSITORY_H
|
||||||
|
|
||||||
|
#include "../../database.h"
|
||||||
|
#include "../../strings.h"
|
||||||
|
#include <ctime>
|
||||||
|
|
||||||
|
|
||||||
|
class BaseSpawn2DisabledRepository {
|
||||||
|
public:
|
||||||
|
struct Spawn2Disabled {
|
||||||
|
int64_t id;
|
||||||
|
int32_t spawn2_id;
|
||||||
|
int32_t instance_id;
|
||||||
|
int16_t disabled;
|
||||||
|
};
|
||||||
|
|
||||||
|
static std::string PrimaryKey()
|
||||||
|
{
|
||||||
|
return std::string("id");
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> Columns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"id",
|
||||||
|
"spawn2_id",
|
||||||
|
"instance_id",
|
||||||
|
"disabled",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> SelectColumns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"id",
|
||||||
|
"spawn2_id",
|
||||||
|
"instance_id",
|
||||||
|
"disabled",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string ColumnsRaw()
|
||||||
|
{
|
||||||
|
return std::string(Strings::Implode(", ", Columns()));
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string SelectColumnsRaw()
|
||||||
|
{
|
||||||
|
return std::string(Strings::Implode(", ", SelectColumns()));
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string TableName()
|
||||||
|
{
|
||||||
|
return std::string("spawn2_disabled");
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string BaseSelect()
|
||||||
|
{
|
||||||
|
return fmt::format(
|
||||||
|
"SELECT {} FROM {}",
|
||||||
|
SelectColumnsRaw(),
|
||||||
|
TableName()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string BaseInsert()
|
||||||
|
{
|
||||||
|
return fmt::format(
|
||||||
|
"INSERT INTO {} ({}) ",
|
||||||
|
TableName(),
|
||||||
|
ColumnsRaw()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static Spawn2Disabled NewEntity()
|
||||||
|
{
|
||||||
|
Spawn2Disabled e{};
|
||||||
|
|
||||||
|
e.id = 0;
|
||||||
|
e.spawn2_id = 0;
|
||||||
|
e.instance_id = 0;
|
||||||
|
e.disabled = 0;
|
||||||
|
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
static Spawn2Disabled GetSpawn2Disabled(
|
||||||
|
const std::vector<Spawn2Disabled> &spawn2_disableds,
|
||||||
|
int spawn2_disabled_id
|
||||||
|
)
|
||||||
|
{
|
||||||
|
for (auto &spawn2_disabled : spawn2_disableds) {
|
||||||
|
if (spawn2_disabled.id == spawn2_disabled_id) {
|
||||||
|
return spawn2_disabled;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return NewEntity();
|
||||||
|
}
|
||||||
|
|
||||||
|
static Spawn2Disabled FindOne(
|
||||||
|
Database& db,
|
||||||
|
int spawn2_disabled_id
|
||||||
|
)
|
||||||
|
{
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{} WHERE {} = {} LIMIT 1",
|
||||||
|
BaseSelect(),
|
||||||
|
PrimaryKey(),
|
||||||
|
spawn2_disabled_id
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
auto row = results.begin();
|
||||||
|
if (results.RowCount() == 1) {
|
||||||
|
Spawn2Disabled e{};
|
||||||
|
|
||||||
|
e.id = strtoll(row[0], nullptr, 10);
|
||||||
|
e.spawn2_id = static_cast<int32_t>(atoi(row[1]));
|
||||||
|
e.instance_id = static_cast<int32_t>(atoi(row[2]));
|
||||||
|
e.disabled = static_cast<int16_t>(atoi(row[3]));
|
||||||
|
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NewEntity();
|
||||||
|
}
|
||||||
|
|
||||||
|
static int DeleteOne(
|
||||||
|
Database& db,
|
||||||
|
int spawn2_disabled_id
|
||||||
|
)
|
||||||
|
{
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"DELETE FROM {} WHERE {} = {}",
|
||||||
|
TableName(),
|
||||||
|
PrimaryKey(),
|
||||||
|
spawn2_disabled_id
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() ? results.RowsAffected() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int UpdateOne(
|
||||||
|
Database& db,
|
||||||
|
const Spawn2Disabled &e
|
||||||
|
)
|
||||||
|
{
|
||||||
|
std::vector<std::string> v;
|
||||||
|
|
||||||
|
auto columns = Columns();
|
||||||
|
|
||||||
|
v.push_back(columns[1] + " = " + std::to_string(e.spawn2_id));
|
||||||
|
v.push_back(columns[2] + " = " + std::to_string(e.instance_id));
|
||||||
|
v.push_back(columns[3] + " = " + std::to_string(e.disabled));
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"UPDATE {} SET {} WHERE {} = {}",
|
||||||
|
TableName(),
|
||||||
|
Strings::Implode(", ", v),
|
||||||
|
PrimaryKey(),
|
||||||
|
e.id
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() ? results.RowsAffected() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static Spawn2Disabled InsertOne(
|
||||||
|
Database& db,
|
||||||
|
Spawn2Disabled e
|
||||||
|
)
|
||||||
|
{
|
||||||
|
std::vector<std::string> v;
|
||||||
|
|
||||||
|
v.push_back(std::to_string(e.id));
|
||||||
|
v.push_back(std::to_string(e.spawn2_id));
|
||||||
|
v.push_back(std::to_string(e.instance_id));
|
||||||
|
v.push_back(std::to_string(e.disabled));
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{} VALUES ({})",
|
||||||
|
BaseInsert(),
|
||||||
|
Strings::Implode(",", v)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (results.Success()) {
|
||||||
|
e.id = results.LastInsertedID();
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
e = NewEntity();
|
||||||
|
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int InsertMany(
|
||||||
|
Database& db,
|
||||||
|
const std::vector<Spawn2Disabled> &entries
|
||||||
|
)
|
||||||
|
{
|
||||||
|
std::vector<std::string> insert_chunks;
|
||||||
|
|
||||||
|
for (auto &e: entries) {
|
||||||
|
std::vector<std::string> v;
|
||||||
|
|
||||||
|
v.push_back(std::to_string(e.id));
|
||||||
|
v.push_back(std::to_string(e.spawn2_id));
|
||||||
|
v.push_back(std::to_string(e.instance_id));
|
||||||
|
v.push_back(std::to_string(e.disabled));
|
||||||
|
|
||||||
|
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<std::string> v;
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{} VALUES {}",
|
||||||
|
BaseInsert(),
|
||||||
|
Strings::Implode(",", insert_chunks)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() ? results.RowsAffected() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::vector<Spawn2Disabled> All(Database& db)
|
||||||
|
{
|
||||||
|
std::vector<Spawn2Disabled> all_entries;
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{}",
|
||||||
|
BaseSelect()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
all_entries.reserve(results.RowCount());
|
||||||
|
|
||||||
|
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||||
|
Spawn2Disabled e{};
|
||||||
|
|
||||||
|
e.id = strtoll(row[0], nullptr, 10);
|
||||||
|
e.spawn2_id = static_cast<int32_t>(atoi(row[1]));
|
||||||
|
e.instance_id = static_cast<int32_t>(atoi(row[2]));
|
||||||
|
e.disabled = static_cast<int16_t>(atoi(row[3]));
|
||||||
|
|
||||||
|
all_entries.push_back(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return all_entries;
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::vector<Spawn2Disabled> GetWhere(Database& db, const std::string &where_filter)
|
||||||
|
{
|
||||||
|
std::vector<Spawn2Disabled> all_entries;
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{} WHERE {}",
|
||||||
|
BaseSelect(),
|
||||||
|
where_filter
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
all_entries.reserve(results.RowCount());
|
||||||
|
|
||||||
|
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||||
|
Spawn2Disabled e{};
|
||||||
|
|
||||||
|
e.id = strtoll(row[0], nullptr, 10);
|
||||||
|
e.spawn2_id = static_cast<int32_t>(atoi(row[1]));
|
||||||
|
e.instance_id = static_cast<int32_t>(atoi(row[2]));
|
||||||
|
e.disabled = static_cast<int16_t>(atoi(row[3]));
|
||||||
|
|
||||||
|
all_entries.push_back(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return all_entries;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int DeleteWhere(Database& db, const std::string &where_filter)
|
||||||
|
{
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"DELETE FROM {} WHERE {}",
|
||||||
|
TableName(),
|
||||||
|
where_filter
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() ? results.RowsAffected() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int Truncate(Database& db)
|
||||||
|
{
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"TRUNCATE TABLE {}",
|
||||||
|
TableName()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() ? results.RowsAffected() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int64 GetMaxId(Database& db)
|
||||||
|
{
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"SELECT COALESCE(MAX({}), 0) FROM {}",
|
||||||
|
PrimaryKey(),
|
||||||
|
TableName()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() && results.begin()[0] ? strtoll(results.begin()[0], nullptr, 10) : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int64 Count(Database& db, const std::string &where_filter = "")
|
||||||
|
{
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"SELECT COUNT(*) FROM {} {}",
|
||||||
|
TableName(),
|
||||||
|
(where_filter.empty() ? "" : "WHERE " + where_filter)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() && results.begin()[0] ? strtoll(results.begin()[0], nullptr, 10) : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif //EQEMU_BASE_SPAWN2_DISABLED_REPOSITORY_H
|
||||||
@@ -16,6 +16,7 @@
|
|||||||
#include "../../strings.h"
|
#include "../../strings.h"
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
|
|
||||||
|
|
||||||
class BaseSpawn2Repository {
|
class BaseSpawn2Repository {
|
||||||
public:
|
public:
|
||||||
struct Spawn2 {
|
struct Spawn2 {
|
||||||
@@ -33,7 +34,6 @@ public:
|
|||||||
int8_t path_when_zone_idle;
|
int8_t path_when_zone_idle;
|
||||||
uint32_t _condition;
|
uint32_t _condition;
|
||||||
int32_t cond_value;
|
int32_t cond_value;
|
||||||
uint8_t enabled;
|
|
||||||
uint8_t animation;
|
uint8_t animation;
|
||||||
int8_t min_expansion;
|
int8_t min_expansion;
|
||||||
int8_t max_expansion;
|
int8_t max_expansion;
|
||||||
@@ -63,7 +63,6 @@ public:
|
|||||||
"path_when_zone_idle",
|
"path_when_zone_idle",
|
||||||
"_condition",
|
"_condition",
|
||||||
"cond_value",
|
"cond_value",
|
||||||
"enabled",
|
|
||||||
"animation",
|
"animation",
|
||||||
"min_expansion",
|
"min_expansion",
|
||||||
"max_expansion",
|
"max_expansion",
|
||||||
@@ -89,7 +88,6 @@ public:
|
|||||||
"path_when_zone_idle",
|
"path_when_zone_idle",
|
||||||
"_condition",
|
"_condition",
|
||||||
"cond_value",
|
"cond_value",
|
||||||
"enabled",
|
|
||||||
"animation",
|
"animation",
|
||||||
"min_expansion",
|
"min_expansion",
|
||||||
"max_expansion",
|
"max_expansion",
|
||||||
@@ -149,7 +147,6 @@ public:
|
|||||||
e.path_when_zone_idle = 0;
|
e.path_when_zone_idle = 0;
|
||||||
e._condition = 0;
|
e._condition = 0;
|
||||||
e.cond_value = 1;
|
e.cond_value = 1;
|
||||||
e.enabled = 1;
|
|
||||||
e.animation = 0;
|
e.animation = 0;
|
||||||
e.min_expansion = -1;
|
e.min_expansion = -1;
|
||||||
e.max_expansion = -1;
|
e.max_expansion = -1;
|
||||||
@@ -180,8 +177,9 @@ public:
|
|||||||
{
|
{
|
||||||
auto results = db.QueryDatabase(
|
auto results = db.QueryDatabase(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
"{} WHERE id = {} LIMIT 1",
|
"{} WHERE {} = {} LIMIT 1",
|
||||||
BaseSelect(),
|
BaseSelect(),
|
||||||
|
PrimaryKey(),
|
||||||
spawn2_id
|
spawn2_id
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@@ -204,12 +202,11 @@ public:
|
|||||||
e.path_when_zone_idle = static_cast<int8_t>(atoi(row[11]));
|
e.path_when_zone_idle = static_cast<int8_t>(atoi(row[11]));
|
||||||
e._condition = static_cast<uint32_t>(strtoul(row[12], nullptr, 10));
|
e._condition = static_cast<uint32_t>(strtoul(row[12], nullptr, 10));
|
||||||
e.cond_value = static_cast<int32_t>(atoi(row[13]));
|
e.cond_value = static_cast<int32_t>(atoi(row[13]));
|
||||||
e.enabled = static_cast<uint8_t>(strtoul(row[14], nullptr, 10));
|
e.animation = static_cast<uint8_t>(strtoul(row[14], nullptr, 10));
|
||||||
e.animation = static_cast<uint8_t>(strtoul(row[15], nullptr, 10));
|
e.min_expansion = static_cast<int8_t>(atoi(row[15]));
|
||||||
e.min_expansion = static_cast<int8_t>(atoi(row[16]));
|
e.max_expansion = static_cast<int8_t>(atoi(row[16]));
|
||||||
e.max_expansion = static_cast<int8_t>(atoi(row[17]));
|
e.content_flags = row[17] ? row[17] : "";
|
||||||
e.content_flags = row[18] ? row[18] : "";
|
e.content_flags_disabled = row[18] ? row[18] : "";
|
||||||
e.content_flags_disabled = row[19] ? row[19] : "";
|
|
||||||
|
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
@@ -256,12 +253,11 @@ public:
|
|||||||
v.push_back(columns[11] + " = " + std::to_string(e.path_when_zone_idle));
|
v.push_back(columns[11] + " = " + std::to_string(e.path_when_zone_idle));
|
||||||
v.push_back(columns[12] + " = " + std::to_string(e._condition));
|
v.push_back(columns[12] + " = " + std::to_string(e._condition));
|
||||||
v.push_back(columns[13] + " = " + std::to_string(e.cond_value));
|
v.push_back(columns[13] + " = " + std::to_string(e.cond_value));
|
||||||
v.push_back(columns[14] + " = " + std::to_string(e.enabled));
|
v.push_back(columns[14] + " = " + std::to_string(e.animation));
|
||||||
v.push_back(columns[15] + " = " + std::to_string(e.animation));
|
v.push_back(columns[15] + " = " + std::to_string(e.min_expansion));
|
||||||
v.push_back(columns[16] + " = " + std::to_string(e.min_expansion));
|
v.push_back(columns[16] + " = " + std::to_string(e.max_expansion));
|
||||||
v.push_back(columns[17] + " = " + std::to_string(e.max_expansion));
|
v.push_back(columns[17] + " = '" + Strings::Escape(e.content_flags) + "'");
|
||||||
v.push_back(columns[18] + " = '" + Strings::Escape(e.content_flags) + "'");
|
v.push_back(columns[18] + " = '" + Strings::Escape(e.content_flags_disabled) + "'");
|
||||||
v.push_back(columns[19] + " = '" + Strings::Escape(e.content_flags_disabled) + "'");
|
|
||||||
|
|
||||||
auto results = db.QueryDatabase(
|
auto results = db.QueryDatabase(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
@@ -297,7 +293,6 @@ public:
|
|||||||
v.push_back(std::to_string(e.path_when_zone_idle));
|
v.push_back(std::to_string(e.path_when_zone_idle));
|
||||||
v.push_back(std::to_string(e._condition));
|
v.push_back(std::to_string(e._condition));
|
||||||
v.push_back(std::to_string(e.cond_value));
|
v.push_back(std::to_string(e.cond_value));
|
||||||
v.push_back(std::to_string(e.enabled));
|
|
||||||
v.push_back(std::to_string(e.animation));
|
v.push_back(std::to_string(e.animation));
|
||||||
v.push_back(std::to_string(e.min_expansion));
|
v.push_back(std::to_string(e.min_expansion));
|
||||||
v.push_back(std::to_string(e.max_expansion));
|
v.push_back(std::to_string(e.max_expansion));
|
||||||
@@ -346,7 +341,6 @@ public:
|
|||||||
v.push_back(std::to_string(e.path_when_zone_idle));
|
v.push_back(std::to_string(e.path_when_zone_idle));
|
||||||
v.push_back(std::to_string(e._condition));
|
v.push_back(std::to_string(e._condition));
|
||||||
v.push_back(std::to_string(e.cond_value));
|
v.push_back(std::to_string(e.cond_value));
|
||||||
v.push_back(std::to_string(e.enabled));
|
|
||||||
v.push_back(std::to_string(e.animation));
|
v.push_back(std::to_string(e.animation));
|
||||||
v.push_back(std::to_string(e.min_expansion));
|
v.push_back(std::to_string(e.min_expansion));
|
||||||
v.push_back(std::to_string(e.max_expansion));
|
v.push_back(std::to_string(e.max_expansion));
|
||||||
@@ -399,12 +393,11 @@ public:
|
|||||||
e.path_when_zone_idle = static_cast<int8_t>(atoi(row[11]));
|
e.path_when_zone_idle = static_cast<int8_t>(atoi(row[11]));
|
||||||
e._condition = static_cast<uint32_t>(strtoul(row[12], nullptr, 10));
|
e._condition = static_cast<uint32_t>(strtoul(row[12], nullptr, 10));
|
||||||
e.cond_value = static_cast<int32_t>(atoi(row[13]));
|
e.cond_value = static_cast<int32_t>(atoi(row[13]));
|
||||||
e.enabled = static_cast<uint8_t>(strtoul(row[14], nullptr, 10));
|
e.animation = static_cast<uint8_t>(strtoul(row[14], nullptr, 10));
|
||||||
e.animation = static_cast<uint8_t>(strtoul(row[15], nullptr, 10));
|
e.min_expansion = static_cast<int8_t>(atoi(row[15]));
|
||||||
e.min_expansion = static_cast<int8_t>(atoi(row[16]));
|
e.max_expansion = static_cast<int8_t>(atoi(row[16]));
|
||||||
e.max_expansion = static_cast<int8_t>(atoi(row[17]));
|
e.content_flags = row[17] ? row[17] : "";
|
||||||
e.content_flags = row[18] ? row[18] : "";
|
e.content_flags_disabled = row[18] ? row[18] : "";
|
||||||
e.content_flags_disabled = row[19] ? row[19] : "";
|
|
||||||
|
|
||||||
all_entries.push_back(e);
|
all_entries.push_back(e);
|
||||||
}
|
}
|
||||||
@@ -443,12 +436,11 @@ public:
|
|||||||
e.path_when_zone_idle = static_cast<int8_t>(atoi(row[11]));
|
e.path_when_zone_idle = static_cast<int8_t>(atoi(row[11]));
|
||||||
e._condition = static_cast<uint32_t>(strtoul(row[12], nullptr, 10));
|
e._condition = static_cast<uint32_t>(strtoul(row[12], nullptr, 10));
|
||||||
e.cond_value = static_cast<int32_t>(atoi(row[13]));
|
e.cond_value = static_cast<int32_t>(atoi(row[13]));
|
||||||
e.enabled = static_cast<uint8_t>(strtoul(row[14], nullptr, 10));
|
e.animation = static_cast<uint8_t>(strtoul(row[14], nullptr, 10));
|
||||||
e.animation = static_cast<uint8_t>(strtoul(row[15], nullptr, 10));
|
e.min_expansion = static_cast<int8_t>(atoi(row[15]));
|
||||||
e.min_expansion = static_cast<int8_t>(atoi(row[16]));
|
e.max_expansion = static_cast<int8_t>(atoi(row[16]));
|
||||||
e.max_expansion = static_cast<int8_t>(atoi(row[17]));
|
e.content_flags = row[17] ? row[17] : "";
|
||||||
e.content_flags = row[18] ? row[18] : "";
|
e.content_flags_disabled = row[18] ? row[18] : "";
|
||||||
e.content_flags_disabled = row[19] ? row[19] : "";
|
|
||||||
|
|
||||||
all_entries.push_back(e);
|
all_entries.push_back(e);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
#include "../../strings.h"
|
#include "../../strings.h"
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
|
|
||||||
|
|
||||||
class BaseSpawnentryRepository {
|
class BaseSpawnentryRepository {
|
||||||
public:
|
public:
|
||||||
struct Spawnentry {
|
struct Spawnentry {
|
||||||
@@ -23,6 +24,8 @@ public:
|
|||||||
int32_t npcID;
|
int32_t npcID;
|
||||||
int16_t chance;
|
int16_t chance;
|
||||||
int32_t condition_value_filter;
|
int32_t condition_value_filter;
|
||||||
|
int16_t min_time;
|
||||||
|
int16_t max_time;
|
||||||
int8_t min_expansion;
|
int8_t min_expansion;
|
||||||
int8_t max_expansion;
|
int8_t max_expansion;
|
||||||
std::string content_flags;
|
std::string content_flags;
|
||||||
@@ -41,6 +44,8 @@ public:
|
|||||||
"npcID",
|
"npcID",
|
||||||
"chance",
|
"chance",
|
||||||
"condition_value_filter",
|
"condition_value_filter",
|
||||||
|
"min_time",
|
||||||
|
"max_time",
|
||||||
"min_expansion",
|
"min_expansion",
|
||||||
"max_expansion",
|
"max_expansion",
|
||||||
"content_flags",
|
"content_flags",
|
||||||
@@ -55,6 +60,8 @@ public:
|
|||||||
"npcID",
|
"npcID",
|
||||||
"chance",
|
"chance",
|
||||||
"condition_value_filter",
|
"condition_value_filter",
|
||||||
|
"min_time",
|
||||||
|
"max_time",
|
||||||
"min_expansion",
|
"min_expansion",
|
||||||
"max_expansion",
|
"max_expansion",
|
||||||
"content_flags",
|
"content_flags",
|
||||||
@@ -103,6 +110,8 @@ public:
|
|||||||
e.npcID = 0;
|
e.npcID = 0;
|
||||||
e.chance = 0;
|
e.chance = 0;
|
||||||
e.condition_value_filter = 1;
|
e.condition_value_filter = 1;
|
||||||
|
e.min_time = 0;
|
||||||
|
e.max_time = 0;
|
||||||
e.min_expansion = -1;
|
e.min_expansion = -1;
|
||||||
e.max_expansion = -1;
|
e.max_expansion = -1;
|
||||||
e.content_flags = "";
|
e.content_flags = "";
|
||||||
@@ -132,8 +141,9 @@ public:
|
|||||||
{
|
{
|
||||||
auto results = db.QueryDatabase(
|
auto results = db.QueryDatabase(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
"{} WHERE id = {} LIMIT 1",
|
"{} WHERE {} = {} LIMIT 1",
|
||||||
BaseSelect(),
|
BaseSelect(),
|
||||||
|
PrimaryKey(),
|
||||||
spawnentry_id
|
spawnentry_id
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@@ -146,10 +156,12 @@ public:
|
|||||||
e.npcID = static_cast<int32_t>(atoi(row[1]));
|
e.npcID = static_cast<int32_t>(atoi(row[1]));
|
||||||
e.chance = static_cast<int16_t>(atoi(row[2]));
|
e.chance = static_cast<int16_t>(atoi(row[2]));
|
||||||
e.condition_value_filter = static_cast<int32_t>(atoi(row[3]));
|
e.condition_value_filter = static_cast<int32_t>(atoi(row[3]));
|
||||||
e.min_expansion = static_cast<int8_t>(atoi(row[4]));
|
e.min_time = static_cast<int16_t>(atoi(row[4]));
|
||||||
e.max_expansion = static_cast<int8_t>(atoi(row[5]));
|
e.max_time = static_cast<int16_t>(atoi(row[5]));
|
||||||
e.content_flags = row[6] ? row[6] : "";
|
e.min_expansion = static_cast<int8_t>(atoi(row[6]));
|
||||||
e.content_flags_disabled = row[7] ? row[7] : "";
|
e.max_expansion = static_cast<int8_t>(atoi(row[7]));
|
||||||
|
e.content_flags = row[8] ? row[8] : "";
|
||||||
|
e.content_flags_disabled = row[9] ? row[9] : "";
|
||||||
|
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
@@ -187,10 +199,12 @@ public:
|
|||||||
v.push_back(columns[1] + " = " + std::to_string(e.npcID));
|
v.push_back(columns[1] + " = " + std::to_string(e.npcID));
|
||||||
v.push_back(columns[2] + " = " + std::to_string(e.chance));
|
v.push_back(columns[2] + " = " + std::to_string(e.chance));
|
||||||
v.push_back(columns[3] + " = " + std::to_string(e.condition_value_filter));
|
v.push_back(columns[3] + " = " + std::to_string(e.condition_value_filter));
|
||||||
v.push_back(columns[4] + " = " + std::to_string(e.min_expansion));
|
v.push_back(columns[4] + " = " + std::to_string(e.min_time));
|
||||||
v.push_back(columns[5] + " = " + std::to_string(e.max_expansion));
|
v.push_back(columns[5] + " = " + std::to_string(e.max_time));
|
||||||
v.push_back(columns[6] + " = '" + Strings::Escape(e.content_flags) + "'");
|
v.push_back(columns[6] + " = " + std::to_string(e.min_expansion));
|
||||||
v.push_back(columns[7] + " = '" + Strings::Escape(e.content_flags_disabled) + "'");
|
v.push_back(columns[7] + " = " + std::to_string(e.max_expansion));
|
||||||
|
v.push_back(columns[8] + " = '" + Strings::Escape(e.content_flags) + "'");
|
||||||
|
v.push_back(columns[9] + " = '" + Strings::Escape(e.content_flags_disabled) + "'");
|
||||||
|
|
||||||
auto results = db.QueryDatabase(
|
auto results = db.QueryDatabase(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
@@ -216,6 +230,8 @@ public:
|
|||||||
v.push_back(std::to_string(e.npcID));
|
v.push_back(std::to_string(e.npcID));
|
||||||
v.push_back(std::to_string(e.chance));
|
v.push_back(std::to_string(e.chance));
|
||||||
v.push_back(std::to_string(e.condition_value_filter));
|
v.push_back(std::to_string(e.condition_value_filter));
|
||||||
|
v.push_back(std::to_string(e.min_time));
|
||||||
|
v.push_back(std::to_string(e.max_time));
|
||||||
v.push_back(std::to_string(e.min_expansion));
|
v.push_back(std::to_string(e.min_expansion));
|
||||||
v.push_back(std::to_string(e.max_expansion));
|
v.push_back(std::to_string(e.max_expansion));
|
||||||
v.push_back("'" + Strings::Escape(e.content_flags) + "'");
|
v.push_back("'" + Strings::Escape(e.content_flags) + "'");
|
||||||
@@ -253,6 +269,8 @@ public:
|
|||||||
v.push_back(std::to_string(e.npcID));
|
v.push_back(std::to_string(e.npcID));
|
||||||
v.push_back(std::to_string(e.chance));
|
v.push_back(std::to_string(e.chance));
|
||||||
v.push_back(std::to_string(e.condition_value_filter));
|
v.push_back(std::to_string(e.condition_value_filter));
|
||||||
|
v.push_back(std::to_string(e.min_time));
|
||||||
|
v.push_back(std::to_string(e.max_time));
|
||||||
v.push_back(std::to_string(e.min_expansion));
|
v.push_back(std::to_string(e.min_expansion));
|
||||||
v.push_back(std::to_string(e.max_expansion));
|
v.push_back(std::to_string(e.max_expansion));
|
||||||
v.push_back("'" + Strings::Escape(e.content_flags) + "'");
|
v.push_back("'" + Strings::Escape(e.content_flags) + "'");
|
||||||
@@ -294,10 +312,12 @@ public:
|
|||||||
e.npcID = static_cast<int32_t>(atoi(row[1]));
|
e.npcID = static_cast<int32_t>(atoi(row[1]));
|
||||||
e.chance = static_cast<int16_t>(atoi(row[2]));
|
e.chance = static_cast<int16_t>(atoi(row[2]));
|
||||||
e.condition_value_filter = static_cast<int32_t>(atoi(row[3]));
|
e.condition_value_filter = static_cast<int32_t>(atoi(row[3]));
|
||||||
e.min_expansion = static_cast<int8_t>(atoi(row[4]));
|
e.min_time = static_cast<int16_t>(atoi(row[4]));
|
||||||
e.max_expansion = static_cast<int8_t>(atoi(row[5]));
|
e.max_time = static_cast<int16_t>(atoi(row[5]));
|
||||||
e.content_flags = row[6] ? row[6] : "";
|
e.min_expansion = static_cast<int8_t>(atoi(row[6]));
|
||||||
e.content_flags_disabled = row[7] ? row[7] : "";
|
e.max_expansion = static_cast<int8_t>(atoi(row[7]));
|
||||||
|
e.content_flags = row[8] ? row[8] : "";
|
||||||
|
e.content_flags_disabled = row[9] ? row[9] : "";
|
||||||
|
|
||||||
all_entries.push_back(e);
|
all_entries.push_back(e);
|
||||||
}
|
}
|
||||||
@@ -326,10 +346,12 @@ public:
|
|||||||
e.npcID = static_cast<int32_t>(atoi(row[1]));
|
e.npcID = static_cast<int32_t>(atoi(row[1]));
|
||||||
e.chance = static_cast<int16_t>(atoi(row[2]));
|
e.chance = static_cast<int16_t>(atoi(row[2]));
|
||||||
e.condition_value_filter = static_cast<int32_t>(atoi(row[3]));
|
e.condition_value_filter = static_cast<int32_t>(atoi(row[3]));
|
||||||
e.min_expansion = static_cast<int8_t>(atoi(row[4]));
|
e.min_time = static_cast<int16_t>(atoi(row[4]));
|
||||||
e.max_expansion = static_cast<int8_t>(atoi(row[5]));
|
e.max_time = static_cast<int16_t>(atoi(row[5]));
|
||||||
e.content_flags = row[6] ? row[6] : "";
|
e.min_expansion = static_cast<int8_t>(atoi(row[6]));
|
||||||
e.content_flags_disabled = row[7] ? row[7] : "";
|
e.max_expansion = static_cast<int8_t>(atoi(row[7]));
|
||||||
|
e.content_flags = row[8] ? row[8] : "";
|
||||||
|
e.content_flags_disabled = row[9] ? row[9] : "";
|
||||||
|
|
||||||
all_entries.push_back(e);
|
all_entries.push_back(e);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -120,6 +120,7 @@ public:
|
|||||||
{.parent_command = "set", .sub_command = "title_suffix", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "titlesuffix"},
|
{.parent_command = "set", .sub_command = "title_suffix", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "titlesuffix"},
|
||||||
{.parent_command = "set", .sub_command = "weather", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "weather"},
|
{.parent_command = "set", .sub_command = "weather", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "weather"},
|
||||||
{.parent_command = "set", .sub_command = "zone", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "zclip|zcolor|zheader|zonelock|zsafecoords|zsky|zunderworld"},
|
{.parent_command = "set", .sub_command = "zone", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "zclip|zcolor|zheader|zonelock|zsafecoords|zsky|zunderworld"},
|
||||||
|
{.parent_command = "show", .sub_command = "aa_points", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "showaapoints|showaapts"},
|
||||||
{.parent_command = "show", .sub_command = "aggro", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "aggro"},
|
{.parent_command = "show", .sub_command = "aggro", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "aggro"},
|
||||||
{.parent_command = "show", .sub_command = "buffs", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "showbuffs"},
|
{.parent_command = "show", .sub_command = "buffs", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "showbuffs"},
|
||||||
{.parent_command = "show", .sub_command = "buried_corpse_count", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "getplayerburiedcorpsecount"},
|
{.parent_command = "show", .sub_command = "buried_corpse_count", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "getplayerburiedcorpsecount"},
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
#ifndef EQEMU_SPAWN2_DISABLED_REPOSITORY_H
|
||||||
|
#define EQEMU_SPAWN2_DISABLED_REPOSITORY_H
|
||||||
|
|
||||||
|
#include "../database.h"
|
||||||
|
#include "../strings.h"
|
||||||
|
#include "base/base_spawn2_disabled_repository.h"
|
||||||
|
|
||||||
|
class Spawn2DisabledRepository: public BaseSpawn2DisabledRepository {
|
||||||
|
public:
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file was auto generated 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)
|
||||||
|
*
|
||||||
|
* Note: Not all tables are designed appropriately to fit functionality with all base methods
|
||||||
|
*
|
||||||
|
* InsertOne
|
||||||
|
* UpdateOne
|
||||||
|
* DeleteOne
|
||||||
|
* FindOne
|
||||||
|
* GetWhere(std::string where_filter)
|
||||||
|
* DeleteWhere(std::string where_filter)
|
||||||
|
* InsertMany
|
||||||
|
* All
|
||||||
|
*
|
||||||
|
* Example custom methods in a repository
|
||||||
|
*
|
||||||
|
* Spawn2DisabledRepository::GetByZoneAndVersion(int zone_id, int zone_version)
|
||||||
|
* Spawn2DisabledRepository::GetWhereNeverExpires()
|
||||||
|
* Spawn2DisabledRepository::GetWhereXAndY()
|
||||||
|
* Spawn2DisabledRepository::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_SPAWN2_DISABLED_REPOSITORY_H
|
||||||
@@ -303,6 +303,7 @@ RULE_BOOL(World, EnforceCharacterLimitAtLogin, false, "Enforce the limit for cha
|
|||||||
RULE_BOOL(World, EnableDevTools, true, "Enable or Disable the Developer Tools globally (Most of the time you want this enabled)")
|
RULE_BOOL(World, EnableDevTools, true, "Enable or Disable the Developer Tools globally (Most of the time you want this enabled)")
|
||||||
RULE_BOOL(World, EnableChecksumVerification, false, "Enable or Disable the Checksum Verification for eqgame.exe and spells_us.txt")
|
RULE_BOOL(World, EnableChecksumVerification, false, "Enable or Disable the Checksum Verification for eqgame.exe and spells_us.txt")
|
||||||
RULE_INT(World, MaximumQuestErrors, 30, "Changes the maximum number of quest errors that can be displayed in #questerrors, default is 30")
|
RULE_INT(World, MaximumQuestErrors, 30, "Changes the maximum number of quest errors that can be displayed in #questerrors, default is 30")
|
||||||
|
RULE_INT(World, BootHour, 0, "Sets the in-game hour world will set when it first boots. 0-24 are valid options, where 0 disables this rule")
|
||||||
RULE_CATEGORY_END()
|
RULE_CATEGORY_END()
|
||||||
|
|
||||||
RULE_CATEGORY(Zone)
|
RULE_CATEGORY(Zone)
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
typedef struct eq_cpu_info_s {
|
typedef struct eq_cpu_info_s {
|
||||||
std::string model;
|
std::string model;
|
||||||
|
|||||||
+2
-2
@@ -1142,10 +1142,10 @@ struct ServerInstanceUpdateTime_Struct
|
|||||||
uint32 new_duration;
|
uint32 new_duration;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ServerSpawnStatusChange_Struct
|
struct ServerSpawnStatusChange_Struct {
|
||||||
{
|
|
||||||
uint32 id;
|
uint32 id;
|
||||||
bool new_status;
|
bool new_status;
|
||||||
|
uint32 instance_id;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ServerQGlobalUpdate_Struct
|
struct ServerQGlobalUpdate_Struct
|
||||||
|
|||||||
+9
-3
@@ -51,7 +51,9 @@ namespace ItemField
|
|||||||
#define F(x) x,
|
#define F(x) x,
|
||||||
#include "item_fieldlist.h"
|
#include "item_fieldlist.h"
|
||||||
#undef F
|
#undef F
|
||||||
updated
|
updated,
|
||||||
|
minstatus,
|
||||||
|
comment,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -965,7 +967,7 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_
|
|||||||
#define F(x) "`"#x"`,"
|
#define F(x) "`"#x"`,"
|
||||||
#include "item_fieldlist.h"
|
#include "item_fieldlist.h"
|
||||||
#undef F
|
#undef F
|
||||||
"updated FROM items ORDER BY id";
|
"updated, minstatus, comment FROM items ORDER BY id";
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
return;
|
return;
|
||||||
@@ -977,9 +979,13 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_
|
|||||||
// Unique Identifier
|
// Unique Identifier
|
||||||
item.ID = Strings::ToUnsignedInt(row[ItemField::id]);
|
item.ID = Strings::ToUnsignedInt(row[ItemField::id]);
|
||||||
|
|
||||||
// Name and Lore
|
// Minimum Status
|
||||||
|
item.MinStatus = static_cast<uint8>(Strings::ToUnsignedInt(row[ItemField::minstatus]));
|
||||||
|
|
||||||
|
// Name, Lore, and Comment
|
||||||
strn0cpy(item.Name, row[ItemField::name], sizeof(item.Name));
|
strn0cpy(item.Name, row[ItemField::name], sizeof(item.Name));
|
||||||
strn0cpy(item.Lore, row[ItemField::lore], sizeof(item.Lore));
|
strn0cpy(item.Lore, row[ItemField::lore], sizeof(item.Lore));
|
||||||
|
strn0cpy(item.Comment, row[ItemField::comment], sizeof(item.Comment));
|
||||||
|
|
||||||
// Flags
|
// Flags
|
||||||
item.ArtifactFlag = Strings::ToBool(row[ItemField::artifactflag]);
|
item.ArtifactFlag = Strings::ToBool(row[ItemField::artifactflag]);
|
||||||
|
|||||||
+22
-15
@@ -42,10 +42,32 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
#include <random>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
//Const char based
|
//Const char based
|
||||||
#include "strings_legacy.cpp" // legacy c functions
|
#include "strings_legacy.cpp" // legacy c functions
|
||||||
#include "strings_misc.cpp" // anything non "Strings" scoped
|
#include "strings_misc.cpp" // anything non "Strings" scoped
|
||||||
|
|
||||||
|
std::string Strings::Random(size_t length)
|
||||||
|
{
|
||||||
|
static auto &chrs = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||||
|
|
||||||
|
thread_local static std::mt19937 rg{std::random_device{}()};
|
||||||
|
|
||||||
|
thread_local static std::uniform_int_distribution<std::string::size_type> pick(0, sizeof(chrs) - 2);
|
||||||
|
|
||||||
|
std::string s;
|
||||||
|
|
||||||
|
s.reserve(length);
|
||||||
|
|
||||||
|
while (length--) {
|
||||||
|
s += chrs[pick(rg)];
|
||||||
|
}
|
||||||
|
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<std::string> Strings::Split(const std::string &str, const char delim)
|
std::vector<std::string> Strings::Split(const std::string &str, const char delim)
|
||||||
{
|
{
|
||||||
std::vector<std::string> ret;
|
std::vector<std::string> ret;
|
||||||
@@ -783,21 +805,6 @@ bool Strings::ToBool(const std::string& bool_string)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// returns a random string of specified length
|
|
||||||
std::string Strings::Random(size_t length)
|
|
||||||
{
|
|
||||||
auto randchar = []() -> char {
|
|
||||||
const char charset[] = "0123456789"
|
|
||||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
|
||||||
"abcdefghijklmnopqrstuvwxyz";
|
|
||||||
const size_t max_index = (sizeof(charset) - 1);
|
|
||||||
return charset[static_cast<size_t>(std::rand()) % max_index];
|
|
||||||
};
|
|
||||||
std::string str(length, 0);
|
|
||||||
std::generate_n(str.begin(), length, randchar);
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
|
|
||||||
// a wrapper for stoi which will return a fallback if the string
|
// a wrapper for stoi which will return a fallback if the string
|
||||||
// fails to cast to a number
|
// fails to cast to a number
|
||||||
int Strings::ToInt(const std::string &s, int fallback)
|
int Strings::ToInt(const std::string &s, int fallback)
|
||||||
|
|||||||
@@ -185,7 +185,6 @@ public:
|
|||||||
value = strtod(tmp_str.data(), nullptr);
|
value = strtod(tmp_str.data(), nullptr);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const std::string StringFormat(const char *format, ...);
|
const std::string StringFormat(const char *format, ...);
|
||||||
|
|||||||
+2
-2
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
// Build variables
|
// Build variables
|
||||||
// these get injected during the build pipeline
|
// these get injected during the build pipeline
|
||||||
#define CURRENT_VERSION "22.29.0-dev" // always append -dev to the current version for custom-builds
|
#define CURRENT_VERSION "22.34.0-dev" // always append -dev to the current version for custom-builds
|
||||||
#define LOGIN_VERSION "0.8.0"
|
#define LOGIN_VERSION "0.8.0"
|
||||||
#define COMPILE_DATE __DATE__
|
#define COMPILE_DATE __DATE__
|
||||||
#define COMPILE_TIME __TIME__
|
#define COMPILE_TIME __TIME__
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
* Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt
|
* Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define CURRENT_BINARY_DATABASE_VERSION 9239
|
#define CURRENT_BINARY_DATABASE_VERSION 9242
|
||||||
|
|
||||||
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9040
|
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9040
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "eqemu-server",
|
"name": "eqemu-server",
|
||||||
"version": "22.29.0",
|
"version": "22.34.0",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/EQEmu/Server.git"
|
"url": "https://github.com/EQEmu/Server.git"
|
||||||
|
|||||||
@@ -156,6 +156,11 @@ bool UCSDatabase::VerifyMailKey(const std::string& characterName, int IPAddress,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (results.RowCount() == 0) {
|
||||||
|
LogInfo("No mailkeys found for [{}].", characterName.c_str());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
auto row = results.begin();
|
auto row = results.begin();
|
||||||
|
|
||||||
// The key is the client's IP address (expressed as 8 hex digits) and an 8 hex digit random string generated
|
// The key is the client's IP address (expressed as 8 hex digits) and an 8 hex digit random string generated
|
||||||
|
|||||||
@@ -9,7 +9,17 @@ git submodule init && git submodule update
|
|||||||
|
|
||||||
perl utils/scripts/build/tag-version.pl
|
perl utils/scripts/build/tag-version.pl
|
||||||
|
|
||||||
mkdir -p build && cd build && cmake -DEQEMU_BUILD_TESTS=ON -DEQEMU_BUILD_STATIC=ON -DEQEMU_BUILD_LOGIN=ON -DEQEMU_BUILD_LUA=ON -DEQEMU_BUILD_PERL=ON -DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING="-Os" -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -G 'Unix Makefiles' .. && make -j$((`nproc`-4))
|
mkdir -p build && cd build && \
|
||||||
|
cmake -DEQEMU_BUILD_TESTS=ON \
|
||||||
|
-DEQEMU_BUILD_STATIC=ON \
|
||||||
|
-DEQEMU_BUILD_LOGIN=ON \
|
||||||
|
-DEQEMU_BUILD_LUA=ON \
|
||||||
|
-DEQEMU_BUILD_PERL=ON \
|
||||||
|
-DCMAKE_CXX_FLAGS:STRING="-O1 -g" \
|
||||||
|
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING="-O1 -g" \
|
||||||
|
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
||||||
|
-G 'Unix Makefiles' \
|
||||||
|
.. && make -j$((`nproc`-4))
|
||||||
|
|
||||||
curl https://raw.githubusercontent.com/Akkadius/eqemu-install-v2/master/eqemu_config.json --output eqemu_config.json
|
curl https://raw.githubusercontent.com/Akkadius/eqemu-install-v2/master/eqemu_config.json --output eqemu_config.json
|
||||||
./bin/tests
|
./bin/tests
|
||||||
|
|||||||
+15
-6
@@ -424,12 +424,21 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (EQTimeTimer.Check()) {
|
if (EQTimeTimer.Check()) {
|
||||||
TimeOfDay_Struct tod;
|
TimeOfDay_Struct tod{};
|
||||||
zoneserver_list.worldclock.GetCurrentEQTimeOfDay(time(0), &tod);
|
zoneserver_list.worldclock.GetCurrentEQTimeOfDay(time(nullptr), &tod);
|
||||||
if (!database.SaveTime(tod.minute, tod.hour, tod.day, tod.month, tod.year))
|
if (!database.SaveTime(tod.minute, tod.hour, tod.day, tod.month, tod.year)) {
|
||||||
LogError("Failed to save eqtime");
|
LogEqTime("Failed to save eqtime");
|
||||||
else
|
}
|
||||||
LogDebug("EQTime successfully saved");
|
else {
|
||||||
|
LogEqTime(
|
||||||
|
"EQTime successfully saved - time is now [{}:{}:{}:{}:{}]",
|
||||||
|
tod.year,
|
||||||
|
tod.month,
|
||||||
|
tod.day,
|
||||||
|
tod.hour,
|
||||||
|
tod.minute
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
zoneserver_list.Process();
|
zoneserver_list.Process();
|
||||||
|
|||||||
+5
-1
@@ -133,6 +133,8 @@ SET(zone_sources
|
|||||||
quest_parser_collection.cpp
|
quest_parser_collection.cpp
|
||||||
raids.cpp
|
raids.cpp
|
||||||
raycast_mesh.cpp
|
raycast_mesh.cpp
|
||||||
|
sidecar_api/sidecar_api.cpp
|
||||||
|
sidecar_api/loot_simulator_controller.cpp
|
||||||
shared_task_zone_messaging.cpp
|
shared_task_zone_messaging.cpp
|
||||||
spawn2.cpp
|
spawn2.cpp
|
||||||
spawn2.h
|
spawn2.h
|
||||||
@@ -253,6 +255,7 @@ SET(zone_headers
|
|||||||
quest_parser_collection.h
|
quest_parser_collection.h
|
||||||
raids.h
|
raids.h
|
||||||
raycast_mesh.h
|
raycast_mesh.h
|
||||||
|
sidecar_api/sidecar_api.h
|
||||||
shared_task_zone_messaging.h
|
shared_task_zone_messaging.h
|
||||||
spawn2.cpp
|
spawn2.cpp
|
||||||
spawn2.h
|
spawn2.h
|
||||||
@@ -273,8 +276,9 @@ SET(zone_headers
|
|||||||
zone_config.h
|
zone_config.h
|
||||||
zonedb.h
|
zonedb.h
|
||||||
zonedump.h
|
zonedump.h
|
||||||
|
zone_cli.h
|
||||||
zone_reload.h
|
zone_reload.h
|
||||||
)
|
zone_cli.cpp)
|
||||||
|
|
||||||
ADD_EXECUTABLE(zone ${zone_sources} ${zone_headers})
|
ADD_EXECUTABLE(zone ${zone_sources} ${zone_headers})
|
||||||
|
|
||||||
|
|||||||
+3
-7
@@ -1741,8 +1741,7 @@ bool Client::Death(Mob* killerMob, int64 damage, uint16 spell, EQ::skills::Skill
|
|||||||
static_cast<int>(attack_skill)
|
static_cast<int>(attack_skill)
|
||||||
);
|
);
|
||||||
|
|
||||||
std::vector<std::any> args = { CastToMob() };
|
if (parse->EventPlayer(EVENT_DEATH, this, export_string, 0) != 0) {
|
||||||
if (parse->EventPlayer(EVENT_DEATH, this, export_string, 0, &args) != 0) {
|
|
||||||
if (GetHP() < 0) {
|
if (GetHP() < 0) {
|
||||||
SetHP(0);
|
SetHP(0);
|
||||||
}
|
}
|
||||||
@@ -2389,8 +2388,7 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
|||||||
static_cast<int>(attack_skill)
|
static_cast<int>(attack_skill)
|
||||||
);
|
);
|
||||||
|
|
||||||
std::vector<std::any> args = { CastToMob() };
|
if (parse->EventNPC(EVENT_DEATH, this, oos, export_string, 0) != 0) {
|
||||||
if (parse->EventNPC(EVENT_DEATH, this, oos, export_string, 0, &args) != 0) {
|
|
||||||
if (GetHP() < 0) {
|
if (GetHP() < 0) {
|
||||||
SetHP(0);
|
SetHP(0);
|
||||||
}
|
}
|
||||||
@@ -2407,9 +2405,7 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
|||||||
spell,
|
spell,
|
||||||
static_cast<int>(attack_skill)
|
static_cast<int>(attack_skill)
|
||||||
);
|
);
|
||||||
|
if (parse->EventBot(EVENT_DEATH, CastToBot(), oos, export_string, 0) != 0) {
|
||||||
std::vector<std::any> args = { CastToMob() };
|
|
||||||
if (parse->EventBot(EVENT_DEATH, CastToBot(), oos, export_string, 0, &args) != 0) {
|
|
||||||
if (GetHP() < 0) {
|
if (GetHP() < 0) {
|
||||||
SetHP(0);
|
SetHP(0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8773,7 +8773,9 @@ void Bot::AddBotStartingItems(uint16 race_id, uint8 class_id)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!v.empty()) {
|
||||||
BotInventoriesRepository::InsertMany(content_db, v);
|
BotInventoriesRepository::InsertMany(content_db, v);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
uint8 Bot::spell_casting_chances[SPELL_TYPE_COUNT][PLAYER_CLASS_COUNT][EQ::constants::STANCE_TYPE_COUNT][cntHSND] = { 0 };
|
uint8 Bot::spell_casting_chances[SPELL_TYPE_COUNT][PLAYER_CLASS_COUNT][EQ::constants::STANCE_TYPE_COUNT][cntHSND] = { 0 };
|
||||||
|
|||||||
+595
-157
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,24 @@
|
|||||||
|
#include "../../common/http/httplib.h"
|
||||||
|
#include "../../common/eqemu_logsys.h"
|
||||||
|
#include "../sidecar_api/sidecar_api.h"
|
||||||
|
#include "../../common/platform.h"
|
||||||
|
|
||||||
|
void ZoneCLI::SidecarServeHttp(int argc, char **argv, argh::parser &cmd, std::string &description)
|
||||||
|
{
|
||||||
|
if (cmd[{"-h", "--help"}]) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
RegisterExecutablePlatform(EQEmuExePlatform::ExePlatformZoneSidecar);
|
||||||
|
|
||||||
|
int port = 0;
|
||||||
|
std::string key;
|
||||||
|
if (!cmd("--port").str().empty()) {
|
||||||
|
port = strtoll(cmd("--port").str().c_str(), nullptr, 10);
|
||||||
|
}
|
||||||
|
if (!cmd("--key").str().empty()) {
|
||||||
|
key = cmd("--key").str();
|
||||||
|
}
|
||||||
|
|
||||||
|
SidecarApi::BootWebserver(port, key);
|
||||||
|
}
|
||||||
+23
-21
@@ -2262,10 +2262,10 @@ void Client::QuestReadBook(const char* text, uint8 type) {
|
|||||||
|
|
||||||
uint32 Client::GetCarriedPlatinum() {
|
uint32 Client::GetCarriedPlatinum() {
|
||||||
return (
|
return (
|
||||||
GetMoney(3, 0) +
|
GetMoney(MoneyTypes::Platinum, MoneySubtypes::Personal) +
|
||||||
(GetMoney(2, 0) / 10) +
|
(GetMoney(MoneyTypes::Gold, MoneySubtypes::Personal) / 10) +
|
||||||
(GetMoney(1, 0) / 100) +
|
(GetMoney(MoneyTypes::Silver, MoneySubtypes::Personal) / 100) +
|
||||||
(GetMoney(0, 0) / 1000)
|
(GetMoney(MoneyTypes::Copper, MoneySubtypes::Personal) / 1000)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8119,16 +8119,17 @@ void Client::SendHPUpdateMarquee(){
|
|||||||
|
|
||||||
uint32 Client::GetMoney(uint8 type, uint8 subtype) {
|
uint32 Client::GetMoney(uint8 type, uint8 subtype) {
|
||||||
uint32 value = 0;
|
uint32 value = 0;
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 0: {
|
case MoneyTypes::Copper: {
|
||||||
switch (subtype) {
|
switch (subtype) {
|
||||||
case 0:
|
case MoneySubtypes::Personal:
|
||||||
value = static_cast<uint32>(m_pp.copper);
|
value = static_cast<uint32>(m_pp.copper);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case MoneySubtypes::Bank:
|
||||||
value = static_cast<uint32>(m_pp.copper_bank);
|
value = static_cast<uint32>(m_pp.copper_bank);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case MoneySubtypes::Cursor:
|
||||||
value = static_cast<uint32>(m_pp.copper_cursor);
|
value = static_cast<uint32>(m_pp.copper_cursor);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -8136,15 +8137,15 @@ uint32 Client::GetMoney(uint8 type, uint8 subtype) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 1: {
|
case MoneyTypes::Silver: {
|
||||||
switch (subtype) {
|
switch (subtype) {
|
||||||
case 0:
|
case MoneySubtypes::Personal:
|
||||||
value = static_cast<uint32>(m_pp.silver);
|
value = static_cast<uint32>(m_pp.silver);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case MoneySubtypes::Bank:
|
||||||
value = static_cast<uint32>(m_pp.silver_bank);
|
value = static_cast<uint32>(m_pp.silver_bank);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case MoneySubtypes::Cursor:
|
||||||
value = static_cast<uint32>(m_pp.silver_cursor);
|
value = static_cast<uint32>(m_pp.silver_cursor);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -8152,15 +8153,15 @@ uint32 Client::GetMoney(uint8 type, uint8 subtype) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 2: {
|
case MoneyTypes::Gold: {
|
||||||
switch (subtype) {
|
switch (subtype) {
|
||||||
case 0:
|
case MoneySubtypes::Personal:
|
||||||
value = static_cast<uint32>(m_pp.gold);
|
value = static_cast<uint32>(m_pp.gold);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case MoneySubtypes::Bank:
|
||||||
value = static_cast<uint32>(m_pp.gold_bank);
|
value = static_cast<uint32>(m_pp.gold_bank);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case MoneySubtypes::Cursor:
|
||||||
value = static_cast<uint32>(m_pp.gold_cursor);
|
value = static_cast<uint32>(m_pp.gold_cursor);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -8168,18 +8169,18 @@ uint32 Client::GetMoney(uint8 type, uint8 subtype) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 3: {
|
case MoneyTypes::Platinum: {
|
||||||
switch (subtype) {
|
switch (subtype) {
|
||||||
case 0:
|
case MoneySubtypes::Personal:
|
||||||
value = static_cast<uint32>(m_pp.platinum);
|
value = static_cast<uint32>(m_pp.platinum);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case MoneySubtypes::Bank:
|
||||||
value = static_cast<uint32>(m_pp.platinum_bank);
|
value = static_cast<uint32>(m_pp.platinum_bank);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case MoneySubtypes::Cursor:
|
||||||
value = static_cast<uint32>(m_pp.platinum_cursor);
|
value = static_cast<uint32>(m_pp.platinum_cursor);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case MoneySubtypes::SharedBank:
|
||||||
value = static_cast<uint32>(m_pp.platinum_shared);
|
value = static_cast<uint32>(m_pp.platinum_shared);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -8190,6 +8191,7 @@ uint32 Client::GetMoney(uint8 type, uint8 subtype) {
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+15
-13
@@ -217,6 +217,7 @@ int command_init(void)
|
|||||||
command_add("summonitem", "[itemid] [charges] - Summon an item onto your cursor. Charges are optional.", AccountStatus::GMMgmt, command_summonitem) ||
|
command_add("summonitem", "[itemid] [charges] - Summon an item onto your cursor. Charges are optional.", AccountStatus::GMMgmt, command_summonitem) ||
|
||||||
command_add("suspend", "[name] [days] [reason] - Suspend by character name and for specificed number of days", AccountStatus::GMLeadAdmin, command_suspend) ||
|
command_add("suspend", "[name] [days] [reason] - Suspend by character name and for specificed number of days", AccountStatus::GMLeadAdmin, command_suspend) ||
|
||||||
command_add("suspendmulti", "[Character Name One|Character Name Two|etc] [Days] [Reason] - Suspend multiple characters by name for specified number of days", AccountStatus::GMLeadAdmin, command_suspendmulti) ||
|
command_add("suspendmulti", "[Character Name One|Character Name Two|etc] [Days] [Reason] - Suspend multiple characters by name for specified number of days", AccountStatus::GMLeadAdmin, command_suspendmulti) ||
|
||||||
|
command_add("takeplatinum", "[Platinum] - Takes specified amount of platinum from you or your player target", AccountStatus::GMMgmt, command_takeplatinum) ||
|
||||||
command_add("task", "(subcommand) - Task system commands", AccountStatus::GMLeadAdmin, command_task) ||
|
command_add("task", "(subcommand) - Task system commands", AccountStatus::GMLeadAdmin, command_task) ||
|
||||||
command_add("petname", "[newname] - Temporarily renames your pet. Leave name blank to restore the original name.", AccountStatus::GMAdmin, command_petname) ||
|
command_add("petname", "[newname] - Temporarily renames your pet. Leave name blank to restore the original name.", AccountStatus::GMAdmin, command_petname) ||
|
||||||
command_add("traindisc", "[level] - Trains all the disciplines usable by the target, up to level specified. (may freeze client for a few seconds)", AccountStatus::GMLeadAdmin, command_traindisc) ||
|
command_add("traindisc", "[level] - Trains all the disciplines usable by the target, up to level specified. (may freeze client for a few seconds)", AccountStatus::GMLeadAdmin, command_traindisc) ||
|
||||||
@@ -437,13 +438,13 @@ int command_realdispatch(Client *c, std::string message, bool ignore_status)
|
|||||||
{
|
{
|
||||||
Seperator sep(message.c_str(), ' ', 10, 100, true); // "three word argument" should be considered 1 arg
|
Seperator sep(message.c_str(), ' ', 10, 100, true); // "three word argument" should be considered 1 arg
|
||||||
|
|
||||||
std::string cstr(sep.arg[0] + 1);
|
std::string command(sep.arg[0] + 1);
|
||||||
|
|
||||||
if (commandlist.count(cstr) != 1) {
|
if (commandlist.count(command) != 1) {
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto cur = commandlist[cstr];
|
const CommandRecord* current_command = commandlist[command];
|
||||||
|
|
||||||
bool is_subcommand = false;
|
bool is_subcommand = false;
|
||||||
bool can_use_subcommand = false;
|
bool can_use_subcommand = false;
|
||||||
@@ -451,11 +452,11 @@ int command_realdispatch(Client *c, std::string message, bool ignore_status)
|
|||||||
|
|
||||||
const auto arguments = sep.argnum;
|
const auto arguments = sep.argnum;
|
||||||
|
|
||||||
if (arguments >= 2) {
|
if (arguments) {
|
||||||
const std::string& sub_command = sep.arg[1];
|
const std::string& sub_command = sep.arg[1];
|
||||||
|
|
||||||
for (const auto &e : command_subsettings) {
|
for (const auto &e : command_subsettings) {
|
||||||
if (e.sub_command == sub_command) {
|
if (e.parent_command == command && e.sub_command == sub_command) {
|
||||||
can_use_subcommand = c->Admin() >= static_cast<int16>(e.access_level);
|
can_use_subcommand = c->Admin() >= static_cast<int16>(e.access_level);
|
||||||
is_subcommand = true;
|
is_subcommand = true;
|
||||||
found_subcommand_setting = true;
|
found_subcommand_setting = true;
|
||||||
@@ -465,7 +466,7 @@ int command_realdispatch(Client *c, std::string message, bool ignore_status)
|
|||||||
|
|
||||||
if (!found_subcommand_setting) {
|
if (!found_subcommand_setting) {
|
||||||
for (const auto &e: command_subsettings) {
|
for (const auto &e: command_subsettings) {
|
||||||
if (e.sub_command == sub_command) {
|
if (e.parent_command == command && e.sub_command == sub_command) {
|
||||||
can_use_subcommand = c->Admin() >= static_cast<int16>(e.access_level);
|
can_use_subcommand = c->Admin() >= static_cast<int16>(e.access_level);
|
||||||
is_subcommand = true;
|
is_subcommand = true;
|
||||||
break;
|
break;
|
||||||
@@ -475,7 +476,7 @@ int command_realdispatch(Client *c, std::string message, bool ignore_status)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!ignore_status) {
|
if (!ignore_status) {
|
||||||
if (!is_subcommand && c->Admin() < cur->admin) {
|
if (!is_subcommand && c->Admin() < current_command->admin) {
|
||||||
c->Message(Chat::White, "Your status is not high enough to use this command.");
|
c->Message(Chat::White, "Your status is not high enough to use this command.");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -497,7 +498,7 @@ int command_realdispatch(Client *c, std::string message, bool ignore_status)
|
|||||||
QServ->PlayerLogEvent(Player_Log_Issued_Commands, c->CharacterID(), event_desc);
|
QServ->PlayerLogEvent(Player_Log_Issued_Commands, c->CharacterID(), event_desc);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cur->admin >= COMMANDS_LOGGING_MIN_STATUS) {
|
if (current_command->admin >= COMMANDS_LOGGING_MIN_STATUS) {
|
||||||
LogCommands(
|
LogCommands(
|
||||||
"[{}] ([{}]) used command: [{}] (target=[{}])",
|
"[{}] ([{}]) used command: [{}] (target=[{}])",
|
||||||
c->GetName(),
|
c->GetName(),
|
||||||
@@ -507,8 +508,8 @@ int command_realdispatch(Client *c, std::string message, bool ignore_status)
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!cur->function) {
|
if (!current_command->function) {
|
||||||
LogError("Command [{}] has a null function", cstr);
|
LogError("Command [{}] has a null function", command);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -525,7 +526,7 @@ int command_realdispatch(Client *c, std::string message, bool ignore_status)
|
|||||||
RecordPlayerEventLogWithClient(c, PlayerEvent::GM_COMMAND, e);
|
RecordPlayerEventLogWithClient(c, PlayerEvent::GM_COMMAND, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
cur->function(c, &sep); // Dispatch C++ Command
|
current_command->function(c, &sep); // Dispatch C++ Command
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -665,7 +666,7 @@ void command_hotfix(Client *c, const Seperator *sep)
|
|||||||
hotfix_command = fmt::format("\"{}\" -hotfix={}", shared_memory_path, hotfix_name);
|
hotfix_command = fmt::format("\"{}\" -hotfix={}", shared_memory_path, hotfix_name);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
hotfix_command = fmt::format("\"{}\"", shared_memory_path, hotfix_name);
|
hotfix_command = fmt::format("\"{}\"", shared_memory_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
LogInfo("Running hotfix command [{}]", hotfix_command);
|
LogInfo("Running hotfix command [{}]", hotfix_command);
|
||||||
@@ -691,7 +692,7 @@ void command_hotfix(Client *c, const Seperator *sep)
|
|||||||
}
|
}
|
||||||
worldserver.SendPacket(&pack);
|
worldserver.SendPacket(&pack);
|
||||||
|
|
||||||
if (c) { c->Message(Chat::White, "Hotfix applied"); }
|
worldserver.SendEmoteMessage(0, 0, AccountStatus::ApprenticeGuide, Chat::Yellow, "Hotfix applied");
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -903,6 +904,7 @@ void command_bot(Client *c, const Seperator *sep)
|
|||||||
#include "gm_commands/summonitem.cpp"
|
#include "gm_commands/summonitem.cpp"
|
||||||
#include "gm_commands/suspend.cpp"
|
#include "gm_commands/suspend.cpp"
|
||||||
#include "gm_commands/suspendmulti.cpp"
|
#include "gm_commands/suspendmulti.cpp"
|
||||||
|
#include "gm_commands/takeplatinum.cpp"
|
||||||
#include "gm_commands/task.cpp"
|
#include "gm_commands/task.cpp"
|
||||||
#include "gm_commands/traindisc.cpp"
|
#include "gm_commands/traindisc.cpp"
|
||||||
#include "gm_commands/tune.cpp"
|
#include "gm_commands/tune.cpp"
|
||||||
|
|||||||
@@ -168,6 +168,7 @@ void command_summonburiedplayercorpse(Client *c, const Seperator *sep);
|
|||||||
void command_summonitem(Client *c, const Seperator *sep);
|
void command_summonitem(Client *c, const Seperator *sep);
|
||||||
void command_suspend(Client *c, const Seperator *sep);
|
void command_suspend(Client *c, const Seperator *sep);
|
||||||
void command_suspendmulti(Client *c, const Seperator *sep);
|
void command_suspendmulti(Client *c, const Seperator *sep);
|
||||||
|
void command_takeplatinum(Client* c, const Seperator* sep);
|
||||||
void command_task(Client *c, const Seperator *sep);
|
void command_task(Client *c, const Seperator *sep);
|
||||||
void command_petname(Client *c, const Seperator *sep);
|
void command_petname(Client *c, const Seperator *sep);
|
||||||
void command_traindisc(Client *c, const Seperator *sep);
|
void command_traindisc(Client *c, const Seperator *sep);
|
||||||
|
|||||||
+10
-39
@@ -1440,7 +1440,7 @@ void PerlembParser::ExportZoneVariables(std::string &package_name)
|
|||||||
ExportVar(package_name.c_str(), "zonesn", zone->GetShortName());
|
ExportVar(package_name.c_str(), "zonesn", zone->GetShortName());
|
||||||
ExportVar(package_name.c_str(), "instanceid", zone->GetInstanceID());
|
ExportVar(package_name.c_str(), "instanceid", zone->GetInstanceID());
|
||||||
ExportVar(package_name.c_str(), "instanceversion", zone->GetInstanceVersion());
|
ExportVar(package_name.c_str(), "instanceversion", zone->GetInstanceVersion());
|
||||||
TimeOfDay_Struct eqTime;
|
TimeOfDay_Struct eqTime{};
|
||||||
zone->zone_time.GetCurrentEQTimeOfDay(time(0), &eqTime);
|
zone->zone_time.GetCurrentEQTimeOfDay(time(0), &eqTime);
|
||||||
ExportVar(package_name.c_str(), "zonehour", eqTime.hour - 1);
|
ExportVar(package_name.c_str(), "zonehour", eqTime.hour - 1);
|
||||||
ExportVar(package_name.c_str(), "zonemin", eqTime.minute);
|
ExportVar(package_name.c_str(), "zonemin", eqTime.minute);
|
||||||
@@ -1875,55 +1875,27 @@ void PerlembParser::ExportEventVariables(
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case EVENT_DEATH: {
|
|
||||||
Seperator sep(data);
|
|
||||||
ExportVar(package_name.c_str(), "killer_id", sep.arg[0]);
|
|
||||||
ExportVar(package_name.c_str(), "killer_damage", sep.arg[1]);
|
|
||||||
ExportVar(package_name.c_str(), "killer_spell", sep.arg[2]);
|
|
||||||
ExportVar(package_name.c_str(), "killer_skill", sep.arg[3]);
|
|
||||||
|
|
||||||
if (IsValidSpell(Strings::ToUnsignedInt(sep.arg[2]))) {
|
|
||||||
ExportVar(package_name.c_str(), "spell", "Spell", (void*)&spells[Strings::ToUnsignedInt(sep.arg[2])]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (extra_pointers && extra_pointers->size() == 1) {
|
|
||||||
Mob* killed = std::any_cast<Mob*>(extra_pointers->at(0));
|
|
||||||
if (killed) {
|
|
||||||
ExportVar(package_name.c_str(), "killed_entity_id", killed->GetID());
|
|
||||||
ExportVar(package_name.c_str(), "killed_bot_id", killed->IsBot() ? killed->CastToBot()->GetBotID() : 0);
|
|
||||||
ExportVar(package_name.c_str(), "killed_npc_id", killed->IsNPC() ? killed->GetNPCTypeID() : 0);
|
|
||||||
ExportVar(package_name.c_str(), "killed_x", killed->GetX());
|
|
||||||
ExportVar(package_name.c_str(), "killed_y", killed->GetY());
|
|
||||||
ExportVar(package_name.c_str(), "killed_z", killed->GetZ());
|
|
||||||
ExportVar(package_name.c_str(), "killed_h", killed->GetHeading());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case EVENT_DEATH_ZONE:
|
case EVENT_DEATH_ZONE:
|
||||||
|
case EVENT_DEATH:
|
||||||
case EVENT_DEATH_COMPLETE: {
|
case EVENT_DEATH_COMPLETE: {
|
||||||
Seperator sep(data);
|
Seperator sep(data);
|
||||||
ExportVar(package_name.c_str(), "killer_id", sep.arg[0]);
|
ExportVar(package_name.c_str(), "killer_id", sep.arg[0]);
|
||||||
ExportVar(package_name.c_str(), "killer_damage", sep.arg[1]);
|
ExportVar(package_name.c_str(), "killer_damage", sep.arg[1]);
|
||||||
ExportVar(package_name.c_str(), "killer_spell", sep.arg[2]);
|
ExportVar(package_name.c_str(), "killer_spell", sep.arg[2]);
|
||||||
ExportVar(package_name.c_str(), "killer_skill", sep.arg[3]);
|
ExportVar(package_name.c_str(), "killer_skill", sep.arg[3]);
|
||||||
|
if (extra_pointers && extra_pointers->size() >= 1)
|
||||||
if (IsValidSpell(Strings::ToUnsignedInt(sep.arg[2]))) {
|
{
|
||||||
ExportVar(package_name.c_str(), "spell", "Spell", (void*)&spells[Strings::ToUnsignedInt(sep.arg[2])]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (extra_pointers && extra_pointers->size() >= 1) {
|
|
||||||
Corpse* corpse = std::any_cast<Corpse*>(extra_pointers->at(0));
|
Corpse* corpse = std::any_cast<Corpse*>(extra_pointers->at(0));
|
||||||
if (corpse) {
|
if (corpse)
|
||||||
|
{
|
||||||
ExportVar(package_name.c_str(), "killed_corpse_id", corpse->GetID());
|
ExportVar(package_name.c_str(), "killed_corpse_id", corpse->GetID());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (extra_pointers && extra_pointers->size() >= 2)
|
||||||
if (extra_pointers && extra_pointers->size() >= 2) {
|
{
|
||||||
NPC* killed = std::any_cast<NPC*>(extra_pointers->at(1));
|
NPC* killed = std::any_cast<NPC*>(extra_pointers->at(1));
|
||||||
if (killed) {
|
if (killed)
|
||||||
|
{
|
||||||
ExportVar(package_name.c_str(), "killed_entity_id", killed->GetID());
|
ExportVar(package_name.c_str(), "killed_entity_id", killed->GetID());
|
||||||
ExportVar(package_name.c_str(), "killed_bot_id", killed->IsBot() ? killed->CastToBot()->GetBotID() : 0);
|
ExportVar(package_name.c_str(), "killed_bot_id", killed->IsBot() ? killed->CastToBot()->GetBotID() : 0);
|
||||||
ExportVar(package_name.c_str(), "killed_npc_id", killed->IsNPC() ? killed->GetNPCTypeID() : 0);
|
ExportVar(package_name.c_str(), "killed_npc_id", killed->IsNPC() ? killed->GetNPCTypeID() : 0);
|
||||||
@@ -1933,7 +1905,6 @@ void PerlembParser::ExportEventVariables(
|
|||||||
ExportVar(package_name.c_str(), "killed_h", killed->GetHeading());
|
ExportVar(package_name.c_str(), "killed_h", killed->GetHeading());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+20
-35
@@ -1433,6 +1433,16 @@ void Perl__removeitem(uint32_t item_id, int quantity)
|
|||||||
quest_manager.removeitem(item_id, quantity);
|
quest_manager.removeitem(item_id, quantity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string Perl__getitemcomment(uint32 item_id)
|
||||||
|
{
|
||||||
|
return quest_manager.getitemcomment(item_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string Perl__getitemlore(uint32 item_id)
|
||||||
|
{
|
||||||
|
return quest_manager.getitemlore(item_id);
|
||||||
|
}
|
||||||
|
|
||||||
std::string Perl__getitemname(uint32 item_id)
|
std::string Perl__getitemname(uint32 item_id)
|
||||||
{
|
{
|
||||||
return quest_manager.getitemname(item_id);
|
return quest_manager.getitemname(item_id);
|
||||||
@@ -3506,14 +3516,7 @@ void Perl__crosszonemoveplayerbycharid(uint32 character_id, std::string zone_sho
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Perl__crosszonemoveplayerbycharid(
|
void Perl__crosszonemoveplayerbycharid(uint32 character_id, std::string zone_short_name, float x, float y, float z, float heading)
|
||||||
uint32 character_id,
|
|
||||||
std::string zone_short_name,
|
|
||||||
float x,
|
|
||||||
float y,
|
|
||||||
float z,
|
|
||||||
float heading
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
quest_manager.CrossZoneMove(
|
quest_manager.CrossZoneMove(
|
||||||
CZMove_Struct{
|
CZMove_Struct{
|
||||||
@@ -3551,14 +3554,7 @@ void Perl__crosszonemoveplayerbygroupid(uint32 group_id, std::string zone_short_
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Perl__crosszonemoveplayerbygroupid(
|
void Perl__crosszonemoveplayerbygroupid(uint32 group_id, std::string zone_short_name, float x, float y, float z, float heading)
|
||||||
uint32 group_id,
|
|
||||||
std::string zone_short_name,
|
|
||||||
float x,
|
|
||||||
float y,
|
|
||||||
float z,
|
|
||||||
float heading
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
quest_manager.CrossZoneMove(
|
quest_manager.CrossZoneMove(
|
||||||
CZMove_Struct{
|
CZMove_Struct{
|
||||||
@@ -3634,14 +3630,7 @@ void Perl__crosszonemoveplayerbyguildid(uint32 guild_id, std::string zone_short_
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Perl__crosszonemoveplayerbyguildid(
|
void Perl__crosszonemoveplayerbyguildid(uint32 guild_id, std::string zone_short_name, float x, float y, float z, float heading)
|
||||||
uint32 guild_id,
|
|
||||||
std::string zone_short_name,
|
|
||||||
float x,
|
|
||||||
float y,
|
|
||||||
float z,
|
|
||||||
float heading
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
quest_manager.CrossZoneMove(
|
quest_manager.CrossZoneMove(
|
||||||
CZMove_Struct{
|
CZMove_Struct{
|
||||||
@@ -3679,14 +3668,7 @@ void Perl__crosszonemoveplayerbyexpeditionid(uint32 expedition_id, std::string z
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Perl__crosszonemoveplayerbyexpeditionid(
|
void Perl__crosszonemoveplayerbyexpeditionid(uint32 expedition_id, std::string zone_short_name, float x, float y, float z, float heading)
|
||||||
uint32 expedition_id,
|
|
||||||
std::string zone_short_name,
|
|
||||||
float x,
|
|
||||||
float y,
|
|
||||||
float z,
|
|
||||||
float heading
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
quest_manager.CrossZoneMove(
|
quest_manager.CrossZoneMove(
|
||||||
CZMove_Struct{
|
CZMove_Struct{
|
||||||
@@ -5860,8 +5842,8 @@ void perl_register_quest()
|
|||||||
package.add("GetZoneFogRed", (uint8(*)(uint32))&Perl__GetZoneFogRed);
|
package.add("GetZoneFogRed", (uint8(*)(uint32))&Perl__GetZoneFogRed);
|
||||||
package.add("GetZoneFogRed", (uint8(*)(uint32, uint8))&Perl__GetZoneFogRed);
|
package.add("GetZoneFogRed", (uint8(*)(uint32, uint8))&Perl__GetZoneFogRed);
|
||||||
package.add("GetZoneFogRed", (uint8(*)(uint32, uint8, int))&Perl__GetZoneFogRed);
|
package.add("GetZoneFogRed", (uint8(*)(uint32, uint8, int))&Perl__GetZoneFogRed);
|
||||||
package.add("GetZoneGravity", (float(*)(uint32))&Perl__GetZoneMaximumClip);
|
package.add("GetZoneGravity", (float(*)(uint32))&Perl__GetZoneGravity);
|
||||||
package.add("GetZoneGravity", (float(*)(uint32, int))&Perl__GetZoneMaximumClip);
|
package.add("GetZoneGravity", (float(*)(uint32, int))&Perl__GetZoneGravity);
|
||||||
package.add("GetZoneMaximumClip", (float(*)(uint32))&Perl__GetZoneMaximumClip);
|
package.add("GetZoneMaximumClip", (float(*)(uint32))&Perl__GetZoneMaximumClip);
|
||||||
package.add("GetZoneMaximumClip", (float(*)(uint32, int))&Perl__GetZoneMaximumClip);
|
package.add("GetZoneMaximumClip", (float(*)(uint32, int))&Perl__GetZoneMaximumClip);
|
||||||
package.add("GetZoneMaximumExpansion", (int8(*)(uint32))&Perl__GetZoneMaximumExpansion);
|
package.add("GetZoneMaximumExpansion", (int8(*)(uint32))&Perl__GetZoneMaximumExpansion);
|
||||||
@@ -6033,6 +6015,7 @@ void perl_register_quest()
|
|||||||
package.add("IsTargetRequiredForSpell", &Perl__IsTargetRequiredForSpell);
|
package.add("IsTargetRequiredForSpell", &Perl__IsTargetRequiredForSpell);
|
||||||
package.add("IsTeleportSpell", &Perl__IsTeleportSpell);
|
package.add("IsTeleportSpell", &Perl__IsTeleportSpell);
|
||||||
package.add("IsTranslocateSpell", &Perl__IsTranslocateSpell);
|
package.add("IsTranslocateSpell", &Perl__IsTranslocateSpell);
|
||||||
|
package.add("IsTGBCompatibleSpell", &Perl__IsTGBCompatibleSpell);
|
||||||
package.add("IsVeryFastHealSpell", &Perl__IsVeryFastHealSpell);
|
package.add("IsVeryFastHealSpell", &Perl__IsVeryFastHealSpell);
|
||||||
package.add("IsVirusSpell", &Perl__IsVirusSpell);
|
package.add("IsVirusSpell", &Perl__IsVirusSpell);
|
||||||
package.add("IsValidSpell", &Perl__IsValidSpell);
|
package.add("IsValidSpell", &Perl__IsValidSpell);
|
||||||
@@ -6315,7 +6298,7 @@ void perl_register_quest()
|
|||||||
package.add("worldwideremovespell", (void(*)(uint32, uint8))&Perl__worldwideremovespell);
|
package.add("worldwideremovespell", (void(*)(uint32, uint8))&Perl__worldwideremovespell);
|
||||||
package.add("worldwideremovespell", (void(*)(uint32, uint8, uint8))&Perl__worldwideremovespell);
|
package.add("worldwideremovespell", (void(*)(uint32, uint8, uint8))&Perl__worldwideremovespell);
|
||||||
package.add("worldwideremovetask", (void(*)(uint32))&Perl__worldwideremovetask);
|
package.add("worldwideremovetask", (void(*)(uint32))&Perl__worldwideremovetask);
|
||||||
package.add("worldwideremovetask", (void(*)(uint32, uint8, uint8))&Perl__worldwideremovetask);
|
package.add("worldwideremovetask", (void(*)(uint32, uint8))&Perl__worldwideremovetask);
|
||||||
package.add("worldwideremovetask", (void(*)(uint32, uint8, uint8))&Perl__worldwideremovetask);
|
package.add("worldwideremovetask", (void(*)(uint32, uint8, uint8))&Perl__worldwideremovetask);
|
||||||
package.add("worldwideresetactivity", (void(*)(uint32, int))&Perl__worldwideresetactivity);
|
package.add("worldwideresetactivity", (void(*)(uint32, int))&Perl__worldwideresetactivity);
|
||||||
package.add("worldwideresetactivity", (void(*)(uint32, int, uint8))&Perl__worldwideresetactivity);
|
package.add("worldwideresetactivity", (void(*)(uint32, int, uint8))&Perl__worldwideresetactivity);
|
||||||
@@ -6404,6 +6387,8 @@ void perl_register_quest()
|
|||||||
package.add("get_expedition_lockouts_by_char_id", (perl::reference(*)(uint32, std::string))&Perl__get_expedition_lockouts_by_char_id);
|
package.add("get_expedition_lockouts_by_char_id", (perl::reference(*)(uint32, std::string))&Perl__get_expedition_lockouts_by_char_id);
|
||||||
package.add("getfactionname", &Perl__getfactionname);
|
package.add("getfactionname", &Perl__getfactionname);
|
||||||
package.add("getinventoryslotid", &Perl__getinventoryslotid);
|
package.add("getinventoryslotid", &Perl__getinventoryslotid);
|
||||||
|
package.add("getitemcomment", &Perl__getitemcomment);
|
||||||
|
package.add("getitemlore", &Perl__getitemlore);
|
||||||
package.add("getitemname", &Perl__getitemname);
|
package.add("getitemname", &Perl__getitemname);
|
||||||
package.add("getitemstat", &Perl__getitemstat);
|
package.add("getitemstat", &Perl__getitemstat);
|
||||||
package.add("getlanguagename", &Perl__getlanguagename);
|
package.add("getlanguagename", &Perl__getlanguagename);
|
||||||
|
|||||||
+8
-2
@@ -210,7 +210,7 @@ void Embperl::init_eval_file(void)
|
|||||||
"} else {"
|
"} else {"
|
||||||
// we 'my' $filename,$mtime,$package,$sub to prevent them from changing our state up here.
|
// we 'my' $filename,$mtime,$package,$sub to prevent them from changing our state up here.
|
||||||
" eval(\"package $package; my(\\$filename,\\$mtime,\\$package,\\$sub); \\$isloaded = 1; require './$filename'; \");"
|
" eval(\"package $package; my(\\$filename,\\$mtime,\\$package,\\$sub); \\$isloaded = 1; require './$filename'; \");"
|
||||||
// " print $@ if $@;"
|
" print $@ if $@;"
|
||||||
/* "local *FH;open FH, $filename or die \"open '$filename' $!\";"
|
/* "local *FH;open FH, $filename or die \"open '$filename' $!\";"
|
||||||
"local($/) = undef;my $sub = <FH>;close FH;"
|
"local($/) = undef;my $sub = <FH>;close FH;"
|
||||||
"my $eval = qq{package $package; sub handler { $sub; }};"
|
"my $eval = qq{package $package; sub handler { $sub; }};"
|
||||||
@@ -277,8 +277,14 @@ int Embperl::dosub(const char * subname, const std::vector<std::string> * args,
|
|||||||
std::string sub = subname;
|
std::string sub = subname;
|
||||||
if (sub == "main::eval_file" && !filename.empty() && File::Exists(filename)) {
|
if (sub == "main::eval_file" && !filename.empty() && File::Exists(filename)) {
|
||||||
BenchTimer benchmark;
|
BenchTimer benchmark;
|
||||||
|
|
||||||
|
std::string perl = "perl";
|
||||||
|
if (File::Exists("/opt/eqemu-perl/bin/perl")) {
|
||||||
|
perl = "/opt/eqemu-perl/bin/perl";
|
||||||
|
}
|
||||||
|
|
||||||
std::string syntax_error = Process::execute(
|
std::string syntax_error = Process::execute(
|
||||||
fmt::format("perl -c {} 2>&1", filename)
|
fmt::format("{} -c {} 2>&1", perl, filename)
|
||||||
);
|
);
|
||||||
LogQuests("Perl eval [{}] took [{}]", filename, benchmark.elapsed());
|
LogQuests("Perl eval [{}] took [{}]", filename, benchmark.elapsed());
|
||||||
syntax_error = Strings::Trim(syntax_error);
|
syntax_error = Strings::Trim(syntax_error);
|
||||||
|
|||||||
@@ -2,6 +2,11 @@
|
|||||||
|
|
||||||
void command_giveitem(Client *c, const Seperator *sep)
|
void command_giveitem(Client *c, const Seperator *sep)
|
||||||
{
|
{
|
||||||
|
if (!c->GetTarget() || !!c->GetTarget()->IsClient()) {
|
||||||
|
c->Message(Chat::White, "You must target a player to use this command.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
uint32 item_id = 0;
|
uint32 item_id = 0;
|
||||||
int16 charges = -1;
|
int16 charges = -1;
|
||||||
uint32 augment_one = 0;
|
uint32 augment_one = 0;
|
||||||
@@ -10,21 +15,17 @@ void command_giveitem(Client *c, const Seperator *sep)
|
|||||||
uint32 augment_four = 0;
|
uint32 augment_four = 0;
|
||||||
uint32 augment_five = 0;
|
uint32 augment_five = 0;
|
||||||
uint32 augment_six = 0;
|
uint32 augment_six = 0;
|
||||||
int arguments = sep->argnum;
|
const uint16 arguments = sep->argnum;
|
||||||
std::string cmd_msg = sep->msg;
|
std::string cmd_msg = sep->msg;
|
||||||
size_t link_open = cmd_msg.find('\x12');
|
size_t link_open = cmd_msg.find('\x12');
|
||||||
size_t link_close = cmd_msg.find_last_of('\x12');
|
size_t link_close = cmd_msg.find_last_of('\x12');
|
||||||
if (c->GetTarget()) {
|
|
||||||
if (!c->GetTarget()->IsClient()) {
|
|
||||||
c->Message(Chat::Red, "You can only give items to players with this command.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (link_open != link_close && (cmd_msg.length() - link_open) > EQ::constants::SAY_LINK_BODY_SIZE) {
|
if (link_open != link_close && (cmd_msg.length() - link_open) > EQ::constants::SAY_LINK_BODY_SIZE) {
|
||||||
EQ::SayLinkBody_Struct link_body;
|
EQ::SayLinkBody_Struct link_body;
|
||||||
EQ::saylink::DegenerateLinkBody(
|
EQ::saylink::DegenerateLinkBody(
|
||||||
link_body,
|
link_body,
|
||||||
cmd_msg.substr(link_open + 1, EQ::constants::SAY_LINK_BODY_SIZE));
|
cmd_msg.substr(link_open + 1, EQ::constants::SAY_LINK_BODY_SIZE)
|
||||||
|
);
|
||||||
item_id = link_body.item_id;
|
item_id = link_body.item_id;
|
||||||
augment_one = link_body.augment_1;
|
augment_one = link_body.augment_1;
|
||||||
augment_two = link_body.augment_2;
|
augment_two = link_body.augment_2;
|
||||||
@@ -32,26 +33,35 @@ void command_giveitem(Client *c, const Seperator *sep)
|
|||||||
augment_four = link_body.augment_4;
|
augment_four = link_body.augment_4;
|
||||||
augment_five = link_body.augment_5;
|
augment_five = link_body.augment_5;
|
||||||
augment_six = link_body.augment_6;
|
augment_six = link_body.augment_6;
|
||||||
}
|
} else if (sep->IsNumber(1)) {
|
||||||
else if (sep->IsNumber(1)) {
|
item_id = Strings::ToUnsignedInt(sep->arg[1]);
|
||||||
item_id = Strings::ToInt(sep->arg[1]);
|
} else if (!sep->IsNumber(1)) {
|
||||||
}
|
|
||||||
else if (!sep->IsNumber(1)) {
|
|
||||||
c->Message(
|
c->Message(
|
||||||
Chat::Red,
|
Chat::Red,
|
||||||
"Usage: #giveitem [item id | link] [charges] [augment_one_id] [augment_two_id] [augment_three_id] [augment_four_id] [augment_five_id] [augment_six_id] (Charges are optional.)"
|
"Usage: #giveitem [item id | link] [charges] [augment_one_id] [augment_two_id] [augment_three_id] [augment_four_id] [augment_five_id] [augment_six_id] (Charges and augments are optional.)"
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Client *client_target = c->GetTarget()->CastToClient();
|
Client* t = c->GetTarget()->CastToClient();
|
||||||
|
|
||||||
uint8 item_status = 0;
|
uint8 item_status = 0;
|
||||||
uint8 current_status = c->Admin();
|
const uint8 current_status = c->Admin();
|
||||||
const EQ::ItemData *item = database.GetItem(item_id);
|
|
||||||
if (item) {
|
const auto *item = database.GetItem(item_id);
|
||||||
item_status = item->MinStatus;
|
if (!item) {
|
||||||
|
c->Message(
|
||||||
|
Chat::White,
|
||||||
|
fmt::format(
|
||||||
|
"Item ID {} does not exist.",
|
||||||
|
item_id
|
||||||
|
).c_str()
|
||||||
|
);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
item_status = item->MinStatus;
|
||||||
|
|
||||||
if (item_status > current_status) {
|
if (item_status > current_status) {
|
||||||
c->Message(
|
c->Message(
|
||||||
Chat::White,
|
Chat::White,
|
||||||
@@ -65,34 +75,34 @@ void command_giveitem(Client *c, const Seperator *sep)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (arguments >= 2 && sep->IsNumber(2)) {
|
if (arguments >= 2 && sep->IsNumber(2)) {
|
||||||
charges = Strings::ToInt(sep->arg[2]);
|
charges = static_cast<int16>(Strings::ToInt(sep->arg[2]));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arguments >= 3 && sep->IsNumber(3)) {
|
if (arguments >= 3 && sep->IsNumber(3)) {
|
||||||
augment_one = Strings::ToInt(sep->arg[3]);
|
augment_one = Strings::ToUnsignedInt(sep->arg[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arguments >= 4 && sep->IsNumber(4)) {
|
if (arguments >= 4 && sep->IsNumber(4)) {
|
||||||
augment_two = Strings::ToInt(sep->arg[4]);
|
augment_two = Strings::ToUnsignedInt(sep->arg[4]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arguments >= 5 && sep->IsNumber(5)) {
|
if (arguments >= 5 && sep->IsNumber(5)) {
|
||||||
augment_three = Strings::ToInt(sep->arg[5]);
|
augment_three = Strings::ToUnsignedInt(sep->arg[5]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arguments >= 6 && sep->IsNumber(6)) {
|
if (arguments >= 6 && sep->IsNumber(6)) {
|
||||||
augment_four = Strings::ToInt(sep->arg[6]);
|
augment_four = Strings::ToUnsignedInt(sep->arg[6]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arguments >= 7 && sep->IsNumber(7)) {
|
if (arguments >= 7 && sep->IsNumber(7)) {
|
||||||
augment_five = Strings::ToInt(sep->arg[7]);
|
augment_five = Strings::ToUnsignedInt(sep->arg[7]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arguments == 8 && sep->IsNumber(8)) {
|
if (arguments == 8 && sep->IsNumber(8)) {
|
||||||
augment_six = Strings::ToInt(sep->arg[8]);
|
augment_six = Strings::ToUnsignedInt(sep->arg[8]);
|
||||||
}
|
}
|
||||||
|
|
||||||
client_target->SummonItem(
|
t->SummonItem(
|
||||||
item_id,
|
item_id,
|
||||||
charges,
|
charges,
|
||||||
augment_one,
|
augment_one,
|
||||||
@@ -102,10 +112,30 @@ void command_giveitem(Client *c, const Seperator *sep)
|
|||||||
augment_five,
|
augment_five,
|
||||||
augment_six
|
augment_six
|
||||||
);
|
);
|
||||||
}
|
|
||||||
else {
|
|
||||||
c->Message(Chat::Red, "You must target a client to give the item to.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
const auto *new_item = database.CreateItem(
|
||||||
|
item_id,
|
||||||
|
charges,
|
||||||
|
augment_one,
|
||||||
|
augment_two,
|
||||||
|
augment_three,
|
||||||
|
augment_four,
|
||||||
|
augment_five,
|
||||||
|
augment_six
|
||||||
|
);
|
||||||
|
|
||||||
|
EQ::SayLinkEngine linker;
|
||||||
|
linker.SetLinkType(EQ::saylink::SayLinkItemInst);
|
||||||
|
linker.SetItemInst(new_item);
|
||||||
|
|
||||||
|
const std::string &item_link = linker.GenerateLink();
|
||||||
|
|
||||||
|
c->Message(
|
||||||
|
Chat::White,
|
||||||
|
fmt::format(
|
||||||
|
"You have given {} to {}.",
|
||||||
|
item_link,
|
||||||
|
c->GetTargetDescription(t)
|
||||||
|
).c_str()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ void command_givemoney(Client *c, const Seperator *sep)
|
|||||||
{
|
{
|
||||||
int arguments = sep->argnum;
|
int arguments = sep->argnum;
|
||||||
if (!arguments || !sep->IsNumber(1)) { //as long as the first one is a number, we'll just let atoi convert the rest to 0 or a number
|
if (!arguments || !sep->IsNumber(1)) { //as long as the first one is a number, we'll just let atoi convert the rest to 0 or a number
|
||||||
c->Message(Chat::Red, "Usage: #Usage: #givemoney [Platinum] [Gold] [Silver] [Copper]");
|
c->Message(Chat::Red, "Usage: #givemoney [Platinum] [Gold] [Silver] [Copper]");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -19,7 +19,7 @@ void command_givemoney(Client *c, const Seperator *sep)
|
|||||||
uint32 silver = sep->IsNumber(3) ? Strings::ToUnsignedInt(sep->arg[3]) : 0;
|
uint32 silver = sep->IsNumber(3) ? Strings::ToUnsignedInt(sep->arg[3]) : 0;
|
||||||
uint32 copper = sep->IsNumber(4) ? Strings::ToUnsignedInt(sep->arg[4]) : 0;
|
uint32 copper = sep->IsNumber(4) ? Strings::ToUnsignedInt(sep->arg[4]) : 0;
|
||||||
if (!platinum && !gold && !silver && !copper) {
|
if (!platinum && !gold && !silver && !copper) {
|
||||||
c->Message(Chat::Red, "Usage: #Usage: #givemoney [Platinum] [Gold] [Silver] [Copper]");
|
c->Message(Chat::Red, "Usage: #givemoney [Platinum] [Gold] [Silver] [Copper]");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,14 +14,14 @@ void SetDate(Client *c, const Seperator *sep)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
TimeOfDay_Struct eq_time;
|
TimeOfDay_Struct t{};
|
||||||
zone->zone_time.GetCurrentEQTimeOfDay(time(0), &eq_time);
|
zone->zone_time.GetCurrentEQTimeOfDay(time(0), &t);
|
||||||
|
|
||||||
const uint16 year = Strings::ToUnsignedInt(sep->arg[2]);
|
const uint16 year = Strings::ToUnsignedInt(sep->arg[2]);
|
||||||
const uint8 month = Strings::ToUnsignedInt(sep->arg[3]);
|
const uint8 month = Strings::ToUnsignedInt(sep->arg[3]);
|
||||||
const uint8 day = Strings::ToUnsignedInt(sep->arg[4]);
|
const uint8 day = Strings::ToUnsignedInt(sep->arg[4]);
|
||||||
const uint8 hour = !sep->IsNumber(5) ? eq_time.hour : Strings::ToUnsignedInt(sep->arg[5]) + 1;
|
const uint8 hour = !sep->IsNumber(5) ? t.hour : Strings::ToUnsignedInt(sep->arg[5]) + 1;
|
||||||
const uint8 minute = !sep->IsNumber(6) ? eq_time.minute : Strings::ToUnsignedInt(sep->arg[6]);
|
const uint8 minute = !sep->IsNumber(6) ? t.minute : Strings::ToUnsignedInt(sep->arg[6]);
|
||||||
|
|
||||||
c->Message(
|
c->Message(
|
||||||
Chat::White,
|
Chat::White,
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ void SetTime(Client *c, const Seperator *sep)
|
|||||||
if (arguments < 2 || !sep->IsNumber(2)) {
|
if (arguments < 2 || !sep->IsNumber(2)) {
|
||||||
c->Message(Chat::White, "Usage: #set time [Hour] [Minute]");
|
c->Message(Chat::White, "Usage: #set time [Hour] [Minute]");
|
||||||
|
|
||||||
TimeOfDay_Struct world_time;
|
TimeOfDay_Struct world_time{};
|
||||||
zone->zone_time.GetCurrentEQTimeOfDay(time(0), &world_time);
|
zone->zone_time.GetCurrentEQTimeOfDay(time(0), &world_time);
|
||||||
|
|
||||||
auto time_string = fmt::format(
|
auto time_string = fmt::format(
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#include "../client.h"
|
#include "../client.h"
|
||||||
|
#include "show/aa_points.cpp"
|
||||||
#include "show/aggro.cpp"
|
#include "show/aggro.cpp"
|
||||||
#include "show/buffs.cpp"
|
#include "show/buffs.cpp"
|
||||||
#include "show/buried_corpse_count.cpp"
|
#include "show/buried_corpse_count.cpp"
|
||||||
@@ -55,6 +56,7 @@ void command_show(Client *c, const Seperator *sep)
|
|||||||
};
|
};
|
||||||
|
|
||||||
std::vector<Cmd> commands = {
|
std::vector<Cmd> commands = {
|
||||||
|
Cmd{.cmd = "aa_points", .u = "aa_points", .fn = ShowAAPoints, .a = {"#showaapoints", "#showaapts"}},
|
||||||
Cmd{.cmd = "aggro", .u = "aggro [Distance] [-v] (-v is verbose Faction Information)", .fn = ShowAggro, .a = {"#aggro"}},
|
Cmd{.cmd = "aggro", .u = "aggro [Distance] [-v] (-v is verbose Faction Information)", .fn = ShowAggro, .a = {"#aggro"}},
|
||||||
Cmd{.cmd = "buffs", .u = "buffs", .fn = ShowBuffs, .a = {"#showbuffs"}},
|
Cmd{.cmd = "buffs", .u = "buffs", .fn = ShowBuffs, .a = {"#showbuffs"}},
|
||||||
Cmd{.cmd = "buried_corpse_count", .u = "buried_corpse_count", .fn = ShowBuriedCorpseCount, .a = {"#getplayerburiedcorpsecount"}},
|
Cmd{.cmd = "buried_corpse_count", .u = "buried_corpse_count", .fn = ShowBuriedCorpseCount, .a = {"#getplayerburiedcorpsecount"}},
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
#include "../../client.h"
|
||||||
|
#include "../../dialogue_window.h"
|
||||||
|
|
||||||
|
void ShowAAPoints(Client *c, const Seperator *sep)
|
||||||
|
{
|
||||||
|
Client *t = c;
|
||||||
|
if (c->GetTarget() && c->GetTarget()->IsClient()) {
|
||||||
|
t = c->GetTarget()->CastToClient();
|
||||||
|
}
|
||||||
|
|
||||||
|
const int aa_points = t->GetAAPoints();
|
||||||
|
const int spent_aa_points = t->GetSpentAA();
|
||||||
|
const int total_aa_points = (aa_points + spent_aa_points);
|
||||||
|
|
||||||
|
if (!total_aa_points) {
|
||||||
|
c->Message(
|
||||||
|
Chat::White,
|
||||||
|
fmt::format(
|
||||||
|
"{} {} no AA Points.",
|
||||||
|
c->GetTargetDescription(t, TargetDescriptionType::UCYou),
|
||||||
|
c == t ? "have" : "has"
|
||||||
|
).c_str()
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
c->Message(
|
||||||
|
Chat::White,
|
||||||
|
fmt::format(
|
||||||
|
"AA Points for {} | Current: {} Spent: {} Total: {}",
|
||||||
|
c->GetTargetDescription(t, TargetDescriptionType::UCSelf),
|
||||||
|
Strings::Commify(aa_points),
|
||||||
|
Strings::Commify(spent_aa_points),
|
||||||
|
Strings::Commify(total_aa_points)
|
||||||
|
).c_str()
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -3,34 +3,34 @@
|
|||||||
|
|
||||||
void ShowCurrencies(Client *c, const Seperator *sep)
|
void ShowCurrencies(Client *c, const Seperator *sep)
|
||||||
{
|
{
|
||||||
auto t = c;
|
Client *t = c;
|
||||||
if (c->GetTarget() && c->GetTarget()->IsClient()) {
|
if (c->GetTarget() && c->GetTarget()->IsClient()) {
|
||||||
t = c->GetTarget()->CastToClient();
|
t = c->GetTarget()->CastToClient();
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint32 platinum = (
|
const uint64 platinum = (
|
||||||
t->GetMoney(3, 0) +
|
t->GetMoney(MoneyTypes::Platinum, MoneySubtypes::Personal) +
|
||||||
t->GetMoney(3, 1) +
|
t->GetMoney(MoneyTypes::Platinum, MoneySubtypes::Bank) +
|
||||||
t->GetMoney(3, 2) +
|
t->GetMoney(MoneyTypes::Platinum, MoneySubtypes::Cursor) +
|
||||||
t->GetMoney(3, 3)
|
t->GetMoney(MoneyTypes::Platinum, MoneySubtypes::SharedBank)
|
||||||
);
|
);
|
||||||
|
|
||||||
const uint32 gold = (
|
const uint64 gold = (
|
||||||
t->GetMoney(2, 0) +
|
t->GetMoney(MoneyTypes::Gold, MoneySubtypes::Personal) +
|
||||||
t->GetMoney(2, 1) +
|
t->GetMoney(MoneyTypes::Gold, MoneySubtypes::Bank) +
|
||||||
t->GetMoney(2, 2)
|
t->GetMoney(MoneyTypes::Gold, MoneySubtypes::Cursor)
|
||||||
);
|
);
|
||||||
|
|
||||||
const uint32 silver = (
|
const uint64 silver = (
|
||||||
t->GetMoney(1, 0) +
|
t->GetMoney(MoneyTypes::Silver, MoneySubtypes::Personal) +
|
||||||
t->GetMoney(1, 1) +
|
t->GetMoney(MoneyTypes::Silver, MoneySubtypes::Bank) +
|
||||||
t->GetMoney(1, 2)
|
t->GetMoney(MoneyTypes::Silver, MoneySubtypes::Cursor)
|
||||||
);
|
);
|
||||||
|
|
||||||
const uint32 copper = (
|
const uint64 copper = (
|
||||||
t->GetMoney(0, 0) +
|
t->GetMoney(MoneyTypes::Copper, MoneySubtypes::Personal) +
|
||||||
t->GetMoney(0, 1) +
|
t->GetMoney(MoneyTypes::Copper, MoneySubtypes::Bank) +
|
||||||
t->GetMoney(0, 2)
|
t->GetMoney(MoneyTypes::Copper, MoneySubtypes::Cursor)
|
||||||
);
|
);
|
||||||
|
|
||||||
std::string currency_table;
|
std::string currency_table;
|
||||||
@@ -79,9 +79,9 @@ void ShowCurrencies(Client *c, const Seperator *sep)
|
|||||||
for (const auto& a : zone->AlternateCurrencies) {
|
for (const auto& a : zone->AlternateCurrencies) {
|
||||||
const uint32 currency_value = t->GetAlternateCurrencyValue(a.id);
|
const uint32 currency_value = t->GetAlternateCurrencyValue(a.id);
|
||||||
if (currency_value) {
|
if (currency_value) {
|
||||||
const auto* d = database.GetItem(a.item_id);
|
const auto *item = database.GetItem(a.item_id);
|
||||||
currency_table += DialogueWindow::TableRow(
|
currency_table += DialogueWindow::TableRow(
|
||||||
DialogueWindow::TableCell(d->Name) +
|
DialogueWindow::TableCell(item->Name) +
|
||||||
DialogueWindow::TableCell(Strings::Commify(currency_value))
|
DialogueWindow::TableCell(Strings::Commify(currency_value))
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -10,10 +10,11 @@ void command_summonitem(Client *c, const Seperator *sep)
|
|||||||
uint32 augment_four = 0;
|
uint32 augment_four = 0;
|
||||||
uint32 augment_five = 0;
|
uint32 augment_five = 0;
|
||||||
uint32 augment_six = 0;
|
uint32 augment_six = 0;
|
||||||
int arguments = sep->argnum;
|
const uint16 arguments = sep->argnum;
|
||||||
std::string cmd_msg = sep->msg;
|
std::string cmd_msg = sep->msg;
|
||||||
size_t link_open = cmd_msg.find('\x12');
|
size_t link_open = cmd_msg.find('\x12');
|
||||||
size_t link_close = cmd_msg.find_last_of('\x12');
|
size_t link_close = cmd_msg.find_last_of('\x12');
|
||||||
|
|
||||||
if (link_open != link_close && (cmd_msg.length() - link_open) > EQ::constants::SAY_LINK_BODY_SIZE) {
|
if (link_open != link_close && (cmd_msg.length() - link_open) > EQ::constants::SAY_LINK_BODY_SIZE) {
|
||||||
EQ::SayLinkBody_Struct link_body;
|
EQ::SayLinkBody_Struct link_body;
|
||||||
EQ::saylink::DegenerateLinkBody(link_body, cmd_msg.substr(link_open + 1, EQ::constants::SAY_LINK_BODY_SIZE));
|
EQ::saylink::DegenerateLinkBody(link_body, cmd_msg.substr(link_open + 1, EQ::constants::SAY_LINK_BODY_SIZE));
|
||||||
@@ -24,16 +25,14 @@ void command_summonitem(Client *c, const Seperator *sep)
|
|||||||
augment_four = link_body.augment_4;
|
augment_four = link_body.augment_4;
|
||||||
augment_five = link_body.augment_5;
|
augment_five = link_body.augment_5;
|
||||||
augment_six = link_body.augment_6;
|
augment_six = link_body.augment_6;
|
||||||
}
|
} else if (!sep->IsNumber(1)) {
|
||||||
else if (!sep->IsNumber(1)) {
|
|
||||||
c->Message(
|
c->Message(
|
||||||
Chat::White,
|
Chat::White,
|
||||||
"Usage: #summonitem [item id | link] [charges] [augment_one_id] [augment_two_id] [augment_three_id] [augment_four_id] [augment_five_id] [augment_six_id] (Charges are optional.)"
|
"Usage: #summonitem [item id | link] [charges] [augment_one_id] [augment_two_id] [augment_three_id] [augment_four_id] [augment_five_id] [augment_six_id] (Charges and augments are optional.)"
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
} else {
|
||||||
else {
|
item_id = Strings::ToUnsignedInt(sep->arg[1]);
|
||||||
item_id = Strings::ToInt(sep->arg[1]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!item_id) {
|
if (!item_id) {
|
||||||
@@ -42,12 +41,22 @@ void command_summonitem(Client *c, const Seperator *sep)
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint8 item_status = 0;
|
uint8 item_status = 0;
|
||||||
uint8 current_status = c->Admin();
|
const uint8 current_status = c->Admin();
|
||||||
const EQ::ItemData *item = database.GetItem(item_id);
|
|
||||||
if (item) {
|
const auto *item = database.GetItem(item_id);
|
||||||
item_status = item->MinStatus;
|
if (!item) {
|
||||||
|
c->Message(
|
||||||
|
Chat::White,
|
||||||
|
fmt::format(
|
||||||
|
"Item ID {} does not exist.",
|
||||||
|
item_id
|
||||||
|
).c_str()
|
||||||
|
);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
item_status = item->MinStatus;
|
||||||
|
|
||||||
if (item_status > current_status) {
|
if (item_status > current_status) {
|
||||||
c->Message(
|
c->Message(
|
||||||
Chat::White,
|
Chat::White,
|
||||||
@@ -57,36 +66,70 @@ void command_summonitem(Client *c, const Seperator *sep)
|
|||||||
item_status
|
item_status
|
||||||
).c_str()
|
).c_str()
|
||||||
);
|
);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arguments >= 2 && sep->IsNumber(2)) {
|
if (arguments >= 2 && sep->IsNumber(2)) {
|
||||||
charges = Strings::ToInt(sep->arg[2]);
|
charges = static_cast<int16>(Strings::ToInt(sep->arg[2]));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arguments >= 3 && sep->IsNumber(3)) {
|
if (arguments >= 3 && sep->IsNumber(3)) {
|
||||||
augment_one = Strings::ToInt(sep->arg[3]);
|
augment_one = Strings::ToUnsignedInt(sep->arg[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arguments >= 4 && sep->IsNumber(4)) {
|
if (arguments >= 4 && sep->IsNumber(4)) {
|
||||||
augment_two = Strings::ToInt(sep->arg[4]);
|
augment_two = Strings::ToUnsignedInt(sep->arg[4]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arguments >= 5 && sep->IsNumber(5)) {
|
if (arguments >= 5 && sep->IsNumber(5)) {
|
||||||
augment_three = Strings::ToInt(sep->arg[5]);
|
augment_three = Strings::ToUnsignedInt(sep->arg[5]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arguments >= 6 && sep->IsNumber(6)) {
|
if (arguments >= 6 && sep->IsNumber(6)) {
|
||||||
augment_four = Strings::ToInt(sep->arg[6]);
|
augment_four = Strings::ToUnsignedInt(sep->arg[6]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arguments >= 7 && sep->IsNumber(7)) {
|
if (arguments >= 7 && sep->IsNumber(7)) {
|
||||||
augment_five = Strings::ToInt(sep->arg[7]);
|
augment_five = Strings::ToUnsignedInt(sep->arg[7]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arguments == 8 && sep->IsNumber(8)) {
|
if (arguments == 8 && sep->IsNumber(8)) {
|
||||||
augment_six = Strings::ToInt(sep->arg[8]);
|
augment_six = Strings::ToUnsignedInt(sep->arg[8]);
|
||||||
}
|
}
|
||||||
|
|
||||||
c->SummonItem(item_id, charges, augment_one, augment_two, augment_three, augment_four, augment_five, augment_six);
|
c->SummonItem(
|
||||||
}
|
item_id,
|
||||||
|
charges,
|
||||||
|
augment_one,
|
||||||
|
augment_two,
|
||||||
|
augment_three,
|
||||||
|
augment_four,
|
||||||
|
augment_five,
|
||||||
|
augment_six
|
||||||
|
);
|
||||||
|
|
||||||
|
const auto *new_item = database.CreateItem(
|
||||||
|
item_id,
|
||||||
|
charges,
|
||||||
|
augment_one,
|
||||||
|
augment_two,
|
||||||
|
augment_three,
|
||||||
|
augment_four,
|
||||||
|
augment_five,
|
||||||
|
augment_six
|
||||||
|
);
|
||||||
|
|
||||||
|
EQ::SayLinkEngine linker;
|
||||||
|
linker.SetLinkType(EQ::saylink::SayLinkItemInst);
|
||||||
|
linker.SetItemInst(new_item);
|
||||||
|
|
||||||
|
const std::string &item_link = linker.GenerateLink();
|
||||||
|
|
||||||
|
c->Message(
|
||||||
|
Chat::White,
|
||||||
|
fmt::format(
|
||||||
|
"You have summoned {}.",
|
||||||
|
item_link
|
||||||
|
).c_str()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ void command_suspend(Client *c, const Seperator *sep)
|
|||||||
const std::string reason = sep->arg[3] ? sep->argplus[3] : "";
|
const std::string reason = sep->arg[3] ? sep->argplus[3] : "";
|
||||||
|
|
||||||
auto l = AccountRepository::GetWhere(
|
auto l = AccountRepository::GetWhere(
|
||||||
content_db,
|
database,
|
||||||
fmt::format(
|
fmt::format(
|
||||||
"LOWER(charname) = '{}'",
|
"LOWER(charname) = '{}'",
|
||||||
Strings::Escape(character_name)
|
Strings::Escape(character_name)
|
||||||
@@ -41,7 +41,7 @@ void command_suspend(Client *c, const Seperator *sep)
|
|||||||
l[0].suspendeduntil = std::time(nullptr) + (days * 86400);
|
l[0].suspendeduntil = std::time(nullptr) + (days * 86400);
|
||||||
l[0].suspend_reason = reason;
|
l[0].suspend_reason = reason;
|
||||||
|
|
||||||
if (!AccountRepository::UpdateOne(content_db, l[0])) {
|
if (!AccountRepository::UpdateOne(database, l[0])) {
|
||||||
c->Message(
|
c->Message(
|
||||||
Chat::White,
|
Chat::White,
|
||||||
fmt::format(
|
fmt::format(
|
||||||
|
|||||||
@@ -0,0 +1,57 @@
|
|||||||
|
#include "../client.h"
|
||||||
|
|
||||||
|
void command_takeplatinum(Client *c, const Seperator *sep)
|
||||||
|
{
|
||||||
|
int arguments = sep->argnum;
|
||||||
|
if (!arguments || !sep->IsNumber(1)) { //must be a number
|
||||||
|
c->Message(Chat::Red, "Usage: #takeplatinum [Platinum]");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Client *target = c;
|
||||||
|
if (c->GetTarget() && c->GetTarget()->IsClient()) {
|
||||||
|
target = c->GetTarget()->CastToClient();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32 platinum = Strings::ToUnsignedInt(sep->arg[1]);
|
||||||
|
if (!platinum) {
|
||||||
|
c->Message(Chat::Red, "Usage: #takeplatinum [Platinum]");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool success = target->TakePlatinum(
|
||||||
|
platinum,
|
||||||
|
true
|
||||||
|
);
|
||||||
|
|
||||||
|
if (success) {
|
||||||
|
c->Message(
|
||||||
|
Chat::White,
|
||||||
|
fmt::format(
|
||||||
|
"Subtracted {} from {}.",
|
||||||
|
Strings::Money(
|
||||||
|
platinum,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
),
|
||||||
|
c->GetTargetDescription(target)
|
||||||
|
).c_str()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
c->Message(
|
||||||
|
Chat::Red,
|
||||||
|
fmt::format(
|
||||||
|
"Unable to subtract {} from {}.",
|
||||||
|
Strings::Money(
|
||||||
|
platinum,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
),
|
||||||
|
c->GetTargetDescription(target)
|
||||||
|
).c_str()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
+11
-2
@@ -349,7 +349,6 @@ void lua_stop_all_timers(Lua_Encounter enc) {
|
|||||||
|
|
||||||
void lua_pause_timer(const char *timer) {
|
void lua_pause_timer(const char *timer) {
|
||||||
quest_manager.pausetimer(timer);
|
quest_manager.pausetimer(timer);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void lua_resume_timer(const char *timer) {
|
void lua_resume_timer(const char *timer) {
|
||||||
@@ -879,6 +878,14 @@ int lua_merchant_count_item(uint32 npc_id, uint32 item_id) {
|
|||||||
return quest_manager.MerchantCountItem(npc_id, item_id);
|
return quest_manager.MerchantCountItem(npc_id, item_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string lua_get_item_comment(uint32 item_id) {
|
||||||
|
return quest_manager.getitemcomment(item_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string lua_get_item_lore(uint32 item_id) {
|
||||||
|
return quest_manager.getitemlore(item_id);
|
||||||
|
}
|
||||||
|
|
||||||
std::string lua_get_item_name(uint32 item_id) {
|
std::string lua_get_item_name(uint32 item_id) {
|
||||||
return quest_manager.getitemname(item_id);
|
return quest_manager.getitemname(item_id);
|
||||||
}
|
}
|
||||||
@@ -1266,7 +1273,7 @@ int lua_get_zone_weather() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
luabind::adl::object lua_get_zone_time(lua_State *L) {
|
luabind::adl::object lua_get_zone_time(lua_State *L) {
|
||||||
TimeOfDay_Struct eqTime;
|
TimeOfDay_Struct eqTime{};
|
||||||
zone->zone_time.GetCurrentEQTimeOfDay(time(0), &eqTime);
|
zone->zone_time.GetCurrentEQTimeOfDay(time(0), &eqTime);
|
||||||
|
|
||||||
luabind::adl::object ret = luabind::newtable(L);
|
luabind::adl::object ret = luabind::newtable(L);
|
||||||
@@ -5720,6 +5727,8 @@ luabind::scope lua_register_general() {
|
|||||||
luabind::def("item_link", (std::string(*)(uint32,int16,uint32,uint32,uint32,uint32,uint32))&lua_item_link),
|
luabind::def("item_link", (std::string(*)(uint32,int16,uint32,uint32,uint32,uint32,uint32))&lua_item_link),
|
||||||
luabind::def("item_link", (std::string(*)(uint32,int16,uint32,uint32,uint32,uint32,uint32,uint32))&lua_item_link),
|
luabind::def("item_link", (std::string(*)(uint32,int16,uint32,uint32,uint32,uint32,uint32,uint32))&lua_item_link),
|
||||||
luabind::def("item_link", (std::string(*)(uint32,int16,uint32,uint32,uint32,uint32,uint32,uint32,bool))&lua_item_link),
|
luabind::def("item_link", (std::string(*)(uint32,int16,uint32,uint32,uint32,uint32,uint32,uint32,bool))&lua_item_link),
|
||||||
|
luabind::def("get_item_comment", (std::string(*)(uint32))&lua_get_item_comment),
|
||||||
|
luabind::def("get_item_lore", (std::string(*)(uint32))&lua_get_item_lore),
|
||||||
luabind::def("get_item_name", (std::string(*)(uint32))&lua_get_item_name),
|
luabind::def("get_item_name", (std::string(*)(uint32))&lua_get_item_name),
|
||||||
luabind::def("say_link", (std::string(*)(const char*,bool,const char*))&lua_say_link),
|
luabind::def("say_link", (std::string(*)(const char*,bool,const char*))&lua_say_link),
|
||||||
luabind::def("say_link", (std::string(*)(const char*,bool))&lua_say_link),
|
luabind::def("say_link", (std::string(*)(const char*,bool))&lua_say_link),
|
||||||
|
|||||||
@@ -30,6 +30,11 @@ const char *Lua_Item::GetLore() {
|
|||||||
return self->Lore;
|
return self->Lore;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char *Lua_Item::GetComment() {
|
||||||
|
Lua_Safe_Call_String();
|
||||||
|
return self->Comment;
|
||||||
|
}
|
||||||
|
|
||||||
const char *Lua_Item::GetIDFile() {
|
const char *Lua_Item::GetIDFile() {
|
||||||
Lua_Safe_Call_String();
|
Lua_Safe_Call_String();
|
||||||
return self->IDFile;
|
return self->IDFile;
|
||||||
@@ -957,6 +962,7 @@ luabind::scope lua_register_item() {
|
|||||||
.def("Click_Type", &Lua_Item::GetClick_Type)
|
.def("Click_Type", &Lua_Item::GetClick_Type)
|
||||||
.def("Color", &Lua_Item::GetColor)
|
.def("Color", &Lua_Item::GetColor)
|
||||||
.def("CombatEffects", &Lua_Item::GetCombatEffects)
|
.def("CombatEffects", &Lua_Item::GetCombatEffects)
|
||||||
|
.def("Comment", &Lua_Item::GetComment)
|
||||||
.def("DR", &Lua_Item::GetDR)
|
.def("DR", &Lua_Item::GetDR)
|
||||||
.def("DSMitigation", &Lua_Item::GetDSMitigation)
|
.def("DSMitigation", &Lua_Item::GetDSMitigation)
|
||||||
.def("Damage", &Lua_Item::GetDamage)
|
.def("Damage", &Lua_Item::GetDamage)
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ public:
|
|||||||
int GetItemClass();
|
int GetItemClass();
|
||||||
const char *GetName();
|
const char *GetName();
|
||||||
const char *GetLore();
|
const char *GetLore();
|
||||||
|
const char *GetComment();
|
||||||
const char *GetIDFile();
|
const char *GetIDFile();
|
||||||
uint32 GetID();
|
uint32 GetID();
|
||||||
int GetWeight();
|
int GetWeight();
|
||||||
|
|||||||
@@ -375,6 +375,11 @@ const char *Lua_Mob::GetRaceName() {
|
|||||||
return GetRaceIDName(self->GetRace());
|
return GetRaceIDName(self->GetRace());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char* Lua_Mob::GetBaseRaceName() {
|
||||||
|
Lua_Safe_Call_String();
|
||||||
|
return GetRaceIDName(self->GetBaseRace());
|
||||||
|
}
|
||||||
|
|
||||||
int Lua_Mob::GetGender() {
|
int Lua_Mob::GetGender() {
|
||||||
Lua_Safe_Call_Int();
|
Lua_Safe_Call_Int();
|
||||||
return self->GetGender();
|
return self->GetGender();
|
||||||
@@ -3386,6 +3391,7 @@ luabind::scope lua_register_mob() {
|
|||||||
.def("GetCasterLevel", &Lua_Mob::GetCasterLevel)
|
.def("GetCasterLevel", &Lua_Mob::GetCasterLevel)
|
||||||
.def("GetClass", &Lua_Mob::GetClass)
|
.def("GetClass", &Lua_Mob::GetClass)
|
||||||
.def("GetClassName", &Lua_Mob::GetClassName)
|
.def("GetClassName", &Lua_Mob::GetClassName)
|
||||||
|
.def("GetBaseRaceName", &Lua_Mob::GetBaseRaceName)
|
||||||
.def("GetClassPlural", &Lua_Mob::GetClassPlural)
|
.def("GetClassPlural", &Lua_Mob::GetClassPlural)
|
||||||
.def("GetCleanName", &Lua_Mob::GetCleanName)
|
.def("GetCleanName", &Lua_Mob::GetCleanName)
|
||||||
.def("GetCloseMobList", (Lua_Mob_List(Lua_Mob::*)(void))&Lua_Mob::GetCloseMobList)
|
.def("GetCloseMobList", (Lua_Mob_List(Lua_Mob::*)(void))&Lua_Mob::GetCloseMobList)
|
||||||
|
|||||||
@@ -106,6 +106,7 @@ public:
|
|||||||
int GetRace();
|
int GetRace();
|
||||||
const char *GetClassName();
|
const char *GetClassName();
|
||||||
const char *GetRaceName();
|
const char *GetRaceName();
|
||||||
|
const char* GetBaseRaceName();
|
||||||
int GetGender();
|
int GetGender();
|
||||||
int GetTexture();
|
int GetTexture();
|
||||||
int GetHelmTexture();
|
int GetHelmTexture();
|
||||||
|
|||||||
+7
-18
@@ -438,9 +438,7 @@ int LuaParser::_EventNPC(std::string package_name, QuestEventID evt, NPC* npc, M
|
|||||||
|
|
||||||
lua_pop(L, npop);
|
lua_pop(L, npop);
|
||||||
} catch(std::exception &ex) {
|
} catch(std::exception &ex) {
|
||||||
std::string error = "Lua Exception: ";
|
AddError(fmt::format("Lua Exception | [{}] for NPC [{}] in [{}]: {}", sub_name, npc->GetNPCTypeID(), package_name, ex.what()));
|
||||||
error += std::string(ex.what());
|
|
||||||
AddError(error);
|
|
||||||
|
|
||||||
//Restore our stack to the best of our ability
|
//Restore our stack to the best of our ability
|
||||||
int end = lua_gettop(L);
|
int end = lua_gettop(L);
|
||||||
@@ -532,9 +530,7 @@ int LuaParser::_EventPlayer(std::string package_name, QuestEventID evt, Client *
|
|||||||
|
|
||||||
lua_pop(L, npop);
|
lua_pop(L, npop);
|
||||||
} catch(std::exception &ex) {
|
} catch(std::exception &ex) {
|
||||||
std::string error = "Lua Exception: ";
|
AddError(fmt::format("Lua Exception | [{}] for Player in [{}]: {}", sub_name, package_name, ex.what()));
|
||||||
error += std::string(ex.what());
|
|
||||||
AddError(error);
|
|
||||||
|
|
||||||
//Restore our stack to the best of our ability
|
//Restore our stack to the best of our ability
|
||||||
int end = lua_gettop(L);
|
int end = lua_gettop(L);
|
||||||
@@ -617,9 +613,8 @@ int LuaParser::_EventItem(std::string package_name, QuestEventID evt, Client *cl
|
|||||||
|
|
||||||
lua_pop(L, npop);
|
lua_pop(L, npop);
|
||||||
} catch(std::exception &ex) {
|
} catch(std::exception &ex) {
|
||||||
std::string error = "Lua Exception: ";
|
uint32_t item_id = item->GetItem() ? item->GetItem()->ID : 0;
|
||||||
error += std::string(ex.what());
|
AddError(fmt::format("Lua Exception | [{}] for Item [{}] in [{}]: {}", sub_name, item_id, package_name, ex.what()));
|
||||||
AddError(error);
|
|
||||||
|
|
||||||
//Restore our stack to the best of our ability
|
//Restore our stack to the best of our ability
|
||||||
int end = lua_gettop(L);
|
int end = lua_gettop(L);
|
||||||
@@ -699,9 +694,7 @@ int LuaParser::_EventSpell(std::string package_name, QuestEventID evt, Mob* mob,
|
|||||||
|
|
||||||
lua_pop(L, npop);
|
lua_pop(L, npop);
|
||||||
} catch(std::exception &ex) {
|
} catch(std::exception &ex) {
|
||||||
std::string error = "Lua Exception: ";
|
AddError(fmt::format("Lua Exception | [{}] for Spell [{}] in [{}]: {}", sub_name, spell_id, package_name, ex.what()));
|
||||||
error += std::string(ex.what());
|
|
||||||
AddError(error);
|
|
||||||
|
|
||||||
//Restore our stack to the best of our ability
|
//Restore our stack to the best of our ability
|
||||||
int end = lua_gettop(L);
|
int end = lua_gettop(L);
|
||||||
@@ -766,9 +759,7 @@ int LuaParser::_EventEncounter(std::string package_name, QuestEventID evt, std::
|
|||||||
|
|
||||||
lua_pop(L, 2);
|
lua_pop(L, 2);
|
||||||
} catch(std::exception &ex) {
|
} catch(std::exception &ex) {
|
||||||
std::string error = "Lua Exception: ";
|
AddError(fmt::format("Lua Exception | [{}] for Encounter [{}]: {}", sub_name, encounter_name, ex.what()));
|
||||||
error += std::string(ex.what());
|
|
||||||
AddError(error);
|
|
||||||
|
|
||||||
//Restore our stack to the best of our ability
|
//Restore our stack to the best of our ability
|
||||||
int end = lua_gettop(L);
|
int end = lua_gettop(L);
|
||||||
@@ -1630,9 +1621,7 @@ int LuaParser::_EventBot(
|
|||||||
|
|
||||||
lua_pop(L, npop);
|
lua_pop(L, npop);
|
||||||
} catch(std::exception &ex) {
|
} catch(std::exception &ex) {
|
||||||
std::string error = "Lua Exception: ";
|
AddError(fmt::format("Lua Exception | [{}] for Bot [{}] in [{}]: {}", sub_name, bot->GetBotID(), package_name, ex.what()));
|
||||||
error += std::string(ex.what());
|
|
||||||
AddError(error);
|
|
||||||
|
|
||||||
//Restore our stack to the best of our ability
|
//Restore our stack to the best of our ability
|
||||||
int end = lua_gettop(L);
|
int end = lua_gettop(L);
|
||||||
|
|||||||
+41
-7
@@ -68,6 +68,7 @@
|
|||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WINDOWS
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include "../common/unix.h"
|
#include "../common/unix.h"
|
||||||
|
|
||||||
@@ -85,6 +86,8 @@ extern volatile bool is_zone_loaded;
|
|||||||
#include "../common/events/player_event_logs.h"
|
#include "../common/events/player_event_logs.h"
|
||||||
#include "../common/path_manager.h"
|
#include "../common/path_manager.h"
|
||||||
#include "../common/database/database_update.h"
|
#include "../common/database/database_update.h"
|
||||||
|
#include "zone_event_scheduler.h"
|
||||||
|
#include "zone_cli.h"
|
||||||
|
|
||||||
EntityList entity_list;
|
EntityList entity_list;
|
||||||
WorldServer worldserver;
|
WorldServer worldserver;
|
||||||
@@ -117,12 +120,18 @@ void CatchSignal(int sig_num);
|
|||||||
|
|
||||||
extern void MapOpcodes();
|
extern void MapOpcodes();
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char **argv)
|
||||||
|
{
|
||||||
RegisterExecutablePlatform(ExePlatformZone);
|
RegisterExecutablePlatform(ExePlatformZone);
|
||||||
LogSys.LoadLogSettingsDefaults();
|
LogSys.LoadLogSettingsDefaults();
|
||||||
|
|
||||||
set_exception_handler();
|
set_exception_handler();
|
||||||
|
|
||||||
|
// silence logging if we ran a command
|
||||||
|
if (ZoneCLI::RanConsoleCommand(argc, argv)) {
|
||||||
|
LogSys.SilenceConsoleLogging();
|
||||||
|
}
|
||||||
|
|
||||||
path.LoadPaths();
|
path.LoadPaths();
|
||||||
|
|
||||||
#ifdef USE_MAP_MMFS
|
#ifdef USE_MAP_MMFS
|
||||||
@@ -154,9 +163,11 @@ int main(int argc, char** argv) {
|
|||||||
}
|
}
|
||||||
Config = ZoneConfig::get();
|
Config = ZoneConfig::get();
|
||||||
|
|
||||||
|
// static zone booting
|
||||||
const char *zone_name;
|
const char *zone_name;
|
||||||
uint32 instance_id = 0;
|
uint32 instance_id = 0;
|
||||||
std::string z_name;
|
std::string z_name;
|
||||||
|
if (!ZoneCLI::RanSidecarCommand(argc, argv)) {
|
||||||
if (argc == 4) {
|
if (argc == 4) {
|
||||||
instance_id = Strings::ToInt(argv[3]);
|
instance_id = Strings::ToInt(argv[3]);
|
||||||
worldserver.SetLauncherName(argv[2]);
|
worldserver.SetLauncherName(argv[2]);
|
||||||
@@ -226,6 +237,7 @@ int main(int argc, char** argv) {
|
|||||||
worldserver.SetLaunchedName(".");
|
worldserver.SetLaunchedName(".");
|
||||||
worldserver.SetLauncherName("NONE");
|
worldserver.SetLauncherName("NONE");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
auto mutex = new Mutex;
|
auto mutex = new Mutex;
|
||||||
|
|
||||||
@@ -235,7 +247,8 @@ int main(int argc, char** argv) {
|
|||||||
Config->DatabaseUsername.c_str(),
|
Config->DatabaseUsername.c_str(),
|
||||||
Config->DatabasePassword.c_str(),
|
Config->DatabasePassword.c_str(),
|
||||||
Config->DatabaseDB.c_str(),
|
Config->DatabaseDB.c_str(),
|
||||||
Config->DatabasePort)) {
|
Config->DatabasePort
|
||||||
|
)) {
|
||||||
LogError("Cannot continue without a database connection");
|
LogError("Cannot continue without a database connection");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -280,7 +293,12 @@ int main(int argc, char** argv) {
|
|||||||
EQ::InitializeDynamicLookups();
|
EQ::InitializeDynamicLookups();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Register Log System and Settings */
|
// command handler
|
||||||
|
if (ZoneCLI::RanConsoleCommand(argc, argv) && !ZoneCLI::RanSidecarCommand(argc, argv)) {
|
||||||
|
LogSys.EnableConsoleLogging();
|
||||||
|
ZoneCLI::CommandHandler(argc, argv);
|
||||||
|
}
|
||||||
|
|
||||||
LogSys.SetDatabase(&database)
|
LogSys.SetDatabase(&database)
|
||||||
->SetLogPath(path.GetLogPath())
|
->SetLogPath(path.GetLogPath())
|
||||||
->LoadLogDatabaseSettings()
|
->LoadLogDatabaseSettings()
|
||||||
@@ -455,6 +473,11 @@ int main(int argc, char** argv) {
|
|||||||
worldserver.Connect();
|
worldserver.Connect();
|
||||||
worldserver.SetScheduler(&event_scheduler);
|
worldserver.SetScheduler(&event_scheduler);
|
||||||
|
|
||||||
|
// sidecar command handler
|
||||||
|
if (ZoneCLI::RanConsoleCommand(argc, argv) && ZoneCLI::RanSidecarCommand(argc, argv)) {
|
||||||
|
ZoneCLI::CommandHandler(argc, argv);
|
||||||
|
}
|
||||||
|
|
||||||
Timer InterserverTimer(INTERSERVER_TIMER); // does MySQL pings and auto-reconnect
|
Timer InterserverTimer(INTERSERVER_TIMER); // does MySQL pings and auto-reconnect
|
||||||
#ifdef EQPROFILE
|
#ifdef EQPROFILE
|
||||||
#ifdef PROFILE_DUMP_TIME
|
#ifdef PROFILE_DUMP_TIME
|
||||||
@@ -558,7 +581,15 @@ int main(int argc, char** argv) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (worldwasconnected && is_zone_loaded) {
|
if (worldwasconnected && is_zone_loaded) {
|
||||||
entity_list.ChannelMessageFromWorld(0, 0, ChatChannel_Broadcast, 0, 0, 100, "WARNING: World server connection lost");
|
entity_list.ChannelMessageFromWorld(
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
ChatChannel_Broadcast,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
100,
|
||||||
|
"WARNING: World server connection lost"
|
||||||
|
);
|
||||||
worldwasconnected = false;
|
worldwasconnected = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -614,8 +645,9 @@ int main(int argc, char** argv) {
|
|||||||
|
|
||||||
safe_delete(Config);
|
safe_delete(Config);
|
||||||
|
|
||||||
if (zone != 0)
|
if (zone != 0) {
|
||||||
Zone::Shutdown(true);
|
Zone::Shutdown(true);
|
||||||
|
}
|
||||||
//Fix for Linux world server problem.
|
//Fix for Linux world server problem.
|
||||||
safe_delete(task_manager);
|
safe_delete(task_manager);
|
||||||
safe_delete(npc_scale_manager);
|
safe_delete(npc_scale_manager);
|
||||||
@@ -638,7 +670,8 @@ void Shutdown()
|
|||||||
EQ::EventLoop::Get().Shutdown();
|
EQ::EventLoop::Get().Shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CatchSignal(int sig_num) {
|
void CatchSignal(int sig_num)
|
||||||
|
{
|
||||||
#ifdef _WINDOWS
|
#ifdef _WINDOWS
|
||||||
LogInfo("Recieved signal: [{}]", sig_num);
|
LogInfo("Recieved signal: [{}]", sig_num);
|
||||||
#endif
|
#endif
|
||||||
@@ -646,7 +679,8 @@ void CatchSignal(int sig_num) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Update Window Title with relevant information */
|
/* Update Window Title with relevant information */
|
||||||
void UpdateWindowTitle(char* iNewTitle) {
|
void UpdateWindowTitle(char *iNewTitle)
|
||||||
|
{
|
||||||
#ifdef _WINDOWS
|
#ifdef _WINDOWS
|
||||||
char tmp[500];
|
char tmp[500];
|
||||||
if (iNewTitle) {
|
if (iNewTitle) {
|
||||||
|
|||||||
+8
-1
@@ -3586,10 +3586,17 @@ void Mob::SendIllusionPacket(const AppearanceStruct& a)
|
|||||||
gender = new_gender;
|
gender = new_gender;
|
||||||
hairstyle = new_hair;
|
hairstyle = new_hair;
|
||||||
haircolor = new_hair_color;
|
haircolor = new_hair_color;
|
||||||
helmtexture = new_helmet_texture;
|
|
||||||
race = new_race;
|
race = new_race;
|
||||||
size = new_size;
|
size = new_size;
|
||||||
|
|
||||||
|
// These two should not be modified in base data - it kills db texture
|
||||||
|
// when illusion is only for RandomizeFeatures...
|
||||||
|
if (new_helmet_texture != UINT8_MAX) {
|
||||||
|
helmtexture = new_helmet_texture;
|
||||||
|
}
|
||||||
|
if (new_texture != UINT8_MAX) {
|
||||||
texture = new_texture;
|
texture = new_texture;
|
||||||
|
}
|
||||||
|
|
||||||
auto outapp = new EQApplicationPacket(OP_Illusion, sizeof(Illusion_Struct));
|
auto outapp = new EQApplicationPacket(OP_Illusion, sizeof(Illusion_Struct));
|
||||||
auto is = (Illusion_Struct *) outapp->pBuffer;
|
auto is = (Illusion_Struct *) outapp->pBuffer;
|
||||||
|
|||||||
@@ -462,6 +462,11 @@ int Perl_Mob_GetBaseRace(Mob* self) // @categories Stats and Attributes
|
|||||||
return self->GetBaseRace();
|
return self->GetBaseRace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string Perl_Mob_GetBaseRaceName(Mob* self) // @categories Stats and Attributes
|
||||||
|
{
|
||||||
|
return GetRaceIDName(self->GetBaseRace());
|
||||||
|
}
|
||||||
|
|
||||||
int Perl_Mob_GetBaseGender(Mob* self) // @categories Stats and Attributes
|
int Perl_Mob_GetBaseGender(Mob* self) // @categories Stats and Attributes
|
||||||
{
|
{
|
||||||
return self->GetBaseGender();
|
return self->GetBaseGender();
|
||||||
@@ -3490,6 +3495,7 @@ void perl_register_mob()
|
|||||||
package.add("GetAssistRange", &Perl_Mob_GetAssistRange);
|
package.add("GetAssistRange", &Perl_Mob_GetAssistRange);
|
||||||
package.add("GetBaseGender", &Perl_Mob_GetBaseGender);
|
package.add("GetBaseGender", &Perl_Mob_GetBaseGender);
|
||||||
package.add("GetBaseRace", &Perl_Mob_GetBaseRace);
|
package.add("GetBaseRace", &Perl_Mob_GetBaseRace);
|
||||||
|
package.add("GetBaseRaceName", &Perl_Mob_GetBaseRaceName);
|
||||||
package.add("GetBaseSize", &Perl_Mob_GetBaseSize);
|
package.add("GetBaseSize", &Perl_Mob_GetBaseSize);
|
||||||
package.add("GetBeard", &Perl_Mob_GetBeard);
|
package.add("GetBeard", &Perl_Mob_GetBeard);
|
||||||
package.add("GetBeardColor", &Perl_Mob_GetBeardColor);
|
package.add("GetBeardColor", &Perl_Mob_GetBeardColor);
|
||||||
|
|||||||
@@ -26,6 +26,11 @@ const char* Perl_QuestItemData_GetLore(EQ::ItemData* self)
|
|||||||
return self->Lore;
|
return self->Lore;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char* Perl_QuestItem_GetComment(EQ::ItemData* self)
|
||||||
|
{
|
||||||
|
return self->Comment;
|
||||||
|
}
|
||||||
|
|
||||||
const char* Perl_QuestItemData_GetIDFile(EQ::ItemData* self)
|
const char* Perl_QuestItemData_GetIDFile(EQ::ItemData* self)
|
||||||
{
|
{
|
||||||
return self->IDFile;
|
return self->IDFile;
|
||||||
@@ -949,6 +954,7 @@ void perl_register_questitem_data()
|
|||||||
package.add("GetClickType", &Perl_QuestItemData_GetClickType);
|
package.add("GetClickType", &Perl_QuestItemData_GetClickType);
|
||||||
package.add("GetColor", &Perl_QuestItemData_GetColor);
|
package.add("GetColor", &Perl_QuestItemData_GetColor);
|
||||||
package.add("GetCombatEffects", &Perl_QuestItemData_GetCombatEffects);
|
package.add("GetCombatEffects", &Perl_QuestItemData_GetCombatEffects);
|
||||||
|
package.add("GetComment", &Perl_QuestItem_GetComment);
|
||||||
package.add("GetCorruption", &Perl_QuestItemData_GetCorruption);
|
package.add("GetCorruption", &Perl_QuestItemData_GetCorruption);
|
||||||
package.add("GetDR", &Perl_QuestItemData_GetDR);
|
package.add("GetDR", &Perl_QuestItemData_GetDR);
|
||||||
package.add("GetDSMitigation", &Perl_QuestItemData_GetDSMitigation);
|
package.add("GetDSMitigation", &Perl_QuestItemData_GetDSMitigation);
|
||||||
|
|||||||
+1
-1
@@ -384,7 +384,7 @@ bool ZoneDatabase::GetPoweredPetEntry(const char *pet_type, int16 petpower, PetR
|
|||||||
"FROM pets WHERE type='%s' AND petpower<=%d ORDER BY petpower DESC LIMIT 1",
|
"FROM pets WHERE type='%s' AND petpower<=%d ORDER BY petpower DESC LIMIT 1",
|
||||||
pet_type, petpower);
|
pet_type, petpower);
|
||||||
|
|
||||||
auto results = QueryDatabase(query);
|
auto results = content_db.QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
+31
-7
@@ -359,22 +359,25 @@ Mob *QuestManager::spawn_from_spawn2(uint32 spawn2_id)
|
|||||||
|
|
||||||
void QuestManager::enable_spawn2(uint32 spawn2_id)
|
void QuestManager::enable_spawn2(uint32 spawn2_id)
|
||||||
{
|
{
|
||||||
database.UpdateSpawn2Status(spawn2_id, 1);
|
database.UpdateSpawn2Status(spawn2_id, 1, zone->GetInstanceID());
|
||||||
auto pack = new ServerPacket(ServerOP_SpawnStatusChange, sizeof(ServerSpawnStatusChange_Struct));
|
auto pack = new ServerPacket(ServerOP_SpawnStatusChange, sizeof(ServerSpawnStatusChange_Struct));
|
||||||
ServerSpawnStatusChange_Struct* ssc = (ServerSpawnStatusChange_Struct*) pack->pBuffer;
|
auto *ssc = (ServerSpawnStatusChange_Struct *) pack->pBuffer;
|
||||||
ssc->id = spawn2_id;
|
ssc->id = spawn2_id;
|
||||||
ssc->new_status = 1;
|
ssc->new_status = true;
|
||||||
|
ssc->instance_id = zone->GetInstanceID();
|
||||||
worldserver.SendPacket(pack);
|
worldserver.SendPacket(pack);
|
||||||
safe_delete(pack);
|
safe_delete(pack);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuestManager::disable_spawn2(uint32 spawn2_id)
|
void QuestManager::disable_spawn2(uint32 spawn2_id)
|
||||||
{
|
{
|
||||||
database.UpdateSpawn2Status(spawn2_id, 0);
|
database.UpdateSpawn2Status(spawn2_id, 0, zone->GetInstanceID());
|
||||||
auto pack = new ServerPacket(ServerOP_SpawnStatusChange, sizeof(ServerSpawnStatusChange_Struct));
|
auto pack = new ServerPacket(ServerOP_SpawnStatusChange, sizeof(ServerSpawnStatusChange_Struct));
|
||||||
ServerSpawnStatusChange_Struct* ssc = (ServerSpawnStatusChange_Struct*) pack->pBuffer;
|
auto *ssc = (ServerSpawnStatusChange_Struct *) pack->pBuffer;
|
||||||
ssc->id = spawn2_id;
|
ssc->id = spawn2_id;
|
||||||
ssc->new_status = 0;
|
ssc->new_status = false;
|
||||||
|
ssc->instance_id = zone->GetInstanceID();
|
||||||
|
|
||||||
worldserver.SendPacket(pack);
|
worldserver.SendPacket(pack);
|
||||||
safe_delete(pack);
|
safe_delete(pack);
|
||||||
}
|
}
|
||||||
@@ -3195,8 +3198,29 @@ std::string QuestManager::varlink(
|
|||||||
|
|
||||||
return linker.GenerateLink();
|
return linker.GenerateLink();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string QuestManager::getitemcomment(uint32 item_id) {
|
||||||
|
const auto* item_data = database.GetItem(item_id);
|
||||||
|
if (!item_data) {
|
||||||
|
return "INVALID ITEM ID IN GETITEMCOMMENT";
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string item_comment = item_data->Comment;
|
||||||
|
return item_comment;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string QuestManager::getitemlore(uint32 item_id) {
|
||||||
|
const auto* item_data = database.GetItem(item_id);
|
||||||
|
if (!item_data) {
|
||||||
|
return "INVALID ITEM ID IN GETITEMLORE";
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string item_lore = item_data->Lore;
|
||||||
|
return item_lore;
|
||||||
|
}
|
||||||
|
|
||||||
std::string QuestManager::getitemname(uint32 item_id) {
|
std::string QuestManager::getitemname(uint32 item_id) {
|
||||||
const EQ::ItemData* item_data = database.GetItem(item_id);
|
const auto* item_data = database.GetItem(item_id);
|
||||||
if (!item_data) {
|
if (!item_data) {
|
||||||
return "INVALID ITEM ID IN GETITEMNAME";
|
return "INVALID ITEM ID IN GETITEMNAME";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -250,6 +250,8 @@ public:
|
|||||||
int collectitems_processSlot(int16 slot_id, uint32 item_id, bool remove);
|
int collectitems_processSlot(int16 slot_id, uint32 item_id, bool remove);
|
||||||
int countitem(uint32 item_id);
|
int countitem(uint32 item_id);
|
||||||
void removeitem(uint32 item_id, uint32 quantity = 1);
|
void removeitem(uint32 item_id, uint32 quantity = 1);
|
||||||
|
std::string getitemcomment(uint32 item_id);
|
||||||
|
std::string getitemlore(uint32 item_id);
|
||||||
std::string getitemname(uint32 item_id);
|
std::string getitemname(uint32 item_id);
|
||||||
void enabletitle(int titleset);
|
void enabletitle(int titleset);
|
||||||
bool checktitle(int titlecheck);
|
bool checktitle(int titlecheck);
|
||||||
|
|||||||
+21
-4
@@ -40,7 +40,6 @@ extern WorldServer worldserver;
|
|||||||
Raid::Raid(uint32 raidID)
|
Raid::Raid(uint32 raidID)
|
||||||
: GroupIDConsumer(raidID)
|
: GroupIDConsumer(raidID)
|
||||||
{
|
{
|
||||||
memset(members ,0, (sizeof(RaidMember)*MAX_RAID_MEMBERS));
|
|
||||||
memset(&raid_aa, 0, sizeof(RaidLeadershipAA_Struct));
|
memset(&raid_aa, 0, sizeof(RaidLeadershipAA_Struct));
|
||||||
memset(group_aa, 0, sizeof(GroupLeadershipAA_Struct) * MAX_RAID_GROUPS);
|
memset(group_aa, 0, sizeof(GroupLeadershipAA_Struct) * MAX_RAID_GROUPS);
|
||||||
for (auto& gm : group_mentor) {
|
for (auto& gm : group_mentor) {
|
||||||
@@ -66,7 +65,6 @@ Raid::Raid(uint32 raidID)
|
|||||||
Raid::Raid(Client* nLeader)
|
Raid::Raid(Client* nLeader)
|
||||||
: GroupIDConsumer()
|
: GroupIDConsumer()
|
||||||
{
|
{
|
||||||
memset(members ,0, (sizeof(RaidMember)*MAX_RAID_MEMBERS));
|
|
||||||
memset(&raid_aa, 0, sizeof(RaidLeadershipAA_Struct));
|
memset(&raid_aa, 0, sizeof(RaidLeadershipAA_Struct));
|
||||||
memset(group_aa, 0, sizeof(GroupLeadershipAA_Struct) * MAX_RAID_GROUPS);
|
memset(group_aa, 0, sizeof(GroupLeadershipAA_Struct) * MAX_RAID_GROUPS);
|
||||||
for (auto& gm : group_mentor) {
|
for (auto& gm : group_mentor) {
|
||||||
@@ -1705,10 +1703,10 @@ void Raid::SaveRaidMOTD()
|
|||||||
|
|
||||||
bool Raid::LearnMembers()
|
bool Raid::LearnMembers()
|
||||||
{
|
{
|
||||||
memset(members, 0, (sizeof(RaidMember) * MAX_RAID_MEMBERS));
|
EmptyRaidMembers();
|
||||||
|
|
||||||
auto raid_members = RaidMembersRepository::GetWhere(
|
auto raid_members = RaidMembersRepository::GetWhere(
|
||||||
content_db,
|
database,
|
||||||
fmt::format(
|
fmt::format(
|
||||||
"raidid = {}",
|
"raidid = {}",
|
||||||
GetID()
|
GetID()
|
||||||
@@ -2975,3 +2973,22 @@ void Raid::SendMarkTargets(Client* c)
|
|||||||
}
|
}
|
||||||
UpdateXtargetMarkedNPC();
|
UpdateXtargetMarkedNPC();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Raid::EmptyRaidMembers()
|
||||||
|
{
|
||||||
|
for (int i = 0; i < MAX_RAID_MEMBERS; i++) {
|
||||||
|
members[i].group_number = RAID_GROUPLESS;
|
||||||
|
members[i].is_group_leader = 0;
|
||||||
|
members[i].level = 0;
|
||||||
|
members[i].main_assister = 0;
|
||||||
|
members[i].main_marker = 0;
|
||||||
|
members[i]._class = 0;
|
||||||
|
members[i].is_bot = false;
|
||||||
|
members[i].is_looter = false;
|
||||||
|
members[i].is_raid_leader = false;
|
||||||
|
members[i].is_raid_main_assist_one = false;
|
||||||
|
members[i].member = nullptr;
|
||||||
|
members[i].note.clear();
|
||||||
|
members[i].member_name[0] = '\0';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
+14
-13
@@ -75,19 +75,19 @@ const uint32 RAID_GROUPLESS = 0xFFFFFFFF;
|
|||||||
#define MAX_NO_RAID_MAIN_MARKERS 3
|
#define MAX_NO_RAID_MAIN_MARKERS 3
|
||||||
|
|
||||||
struct RaidMember{
|
struct RaidMember{
|
||||||
char member_name[64];
|
char member_name[64]{ 0 };
|
||||||
Client *member;
|
Client* member{ nullptr };
|
||||||
uint32 group_number;
|
uint32 group_number{ RAID_GROUPLESS };
|
||||||
uint8 _class;
|
uint8 _class{ 0 };
|
||||||
uint8 level;
|
uint8 level{ 0 };
|
||||||
std::string note;
|
std::string note{};
|
||||||
bool is_group_leader;
|
bool is_group_leader{ false };
|
||||||
bool is_raid_leader;
|
bool is_raid_leader{ false };
|
||||||
bool is_looter;
|
bool is_looter{ false };
|
||||||
uint8 main_marker;
|
uint8 main_marker{ 0 };
|
||||||
uint8 main_assister;
|
uint8 main_assister{ 0 };
|
||||||
bool is_bot = false;
|
bool is_bot{ false };
|
||||||
bool is_raid_main_assist_one = false;
|
bool is_raid_main_assist_one{false};
|
||||||
};
|
};
|
||||||
|
|
||||||
struct GroupMentor {
|
struct GroupMentor {
|
||||||
@@ -131,6 +131,7 @@ public:
|
|||||||
void SetNewRaidLeader(uint32 i);
|
void SetNewRaidLeader(uint32 i);
|
||||||
bool IsAssister(const char* who);
|
bool IsAssister(const char* who);
|
||||||
bool IsMarker(const char* who);
|
bool IsMarker(const char* who);
|
||||||
|
void EmptyRaidMembers();
|
||||||
|
|
||||||
uint32 GetFreeGroup();
|
uint32 GetFreeGroup();
|
||||||
uint8 GroupCount(uint32 gid);
|
uint8 GroupCount(uint32 gid);
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
void SidecarApi::RequestLogHandler(const httplib::Request &req, const httplib::Response &res)
|
||||||
|
{
|
||||||
|
if (!req.path.empty()) {
|
||||||
|
std::vector<std::string> params;
|
||||||
|
for (auto &p: req.params) {
|
||||||
|
params.emplace_back(fmt::format("{}={}", p.first, p.second));
|
||||||
|
}
|
||||||
|
|
||||||
|
LogInfo(
|
||||||
|
"[API] Request [{}] [{}{}] via [{}:{}]",
|
||||||
|
res.status,
|
||||||
|
req.path,
|
||||||
|
(!params.empty() ? "?" + Strings::Join(params, "&") : ""),
|
||||||
|
req.remote_addr,
|
||||||
|
req.remote_port
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,173 @@
|
|||||||
|
#include "sidecar_api.h"
|
||||||
|
#include "../../common/json/json.hpp"
|
||||||
|
#include "../zone.h"
|
||||||
|
|
||||||
|
extern Zone* zone;
|
||||||
|
|
||||||
|
void SidecarApi::LootSimulatorController(const httplib::Request &req, httplib::Response &res)
|
||||||
|
{
|
||||||
|
int loottable_id = req.has_param("loottable_id") ? std::stoi(req.get_param_value("loottable_id")) : 4027;
|
||||||
|
int npc_id = req.has_param("npc_id") ? std::stoi(req.get_param_value("npc_id")) : 32040; // lord nagafen
|
||||||
|
auto iterations = 100;
|
||||||
|
auto log_enabled = false;
|
||||||
|
|
||||||
|
LogSys.log_settings[Logs::Loot].log_to_console = 0;
|
||||||
|
|
||||||
|
nlohmann::json j;
|
||||||
|
|
||||||
|
auto npc_type = content_db.LoadNPCTypesData(npc_id);
|
||||||
|
if (npc_type) {
|
||||||
|
auto npc = new NPC(
|
||||||
|
npc_type,
|
||||||
|
nullptr,
|
||||||
|
glm::vec4(0, 0, 0, 0),
|
||||||
|
GravityBehavior::Water
|
||||||
|
);
|
||||||
|
BenchTimer benchmark;
|
||||||
|
|
||||||
|
// depop the previous one
|
||||||
|
for (auto &n: entity_list.GetNPCList()) {
|
||||||
|
if (n.second->GetNPCTypeID() == npc_id) {
|
||||||
|
LogInfo("found npc id [{}]", npc_id);
|
||||||
|
n.second->Depop(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
entity_list.Process();
|
||||||
|
entity_list.MobProcess();
|
||||||
|
npc->SetRecordLootStats(true);
|
||||||
|
|
||||||
|
for (int i = 0; i < iterations; i++) {
|
||||||
|
npc->AddLootTable(loottable_id);
|
||||||
|
|
||||||
|
for (auto &id: zone->GetGlobalLootTables(npc)) {
|
||||||
|
npc->AddLootTable(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
entity_list.AddNPC(npc);
|
||||||
|
|
||||||
|
j["data"]["loottable_id"] = loottable_id;
|
||||||
|
j["data"]["npc_id"] = npc_id;
|
||||||
|
j["data"]["npc_name"] = npc->GetCleanName();
|
||||||
|
j["data"]["rolled_items_count"] = npc->GetRolledItems().size();
|
||||||
|
j["data"]["iterations"] = iterations;
|
||||||
|
|
||||||
|
// npc level loot table
|
||||||
|
auto loot_table = database.GetLootTable(loottable_id);
|
||||||
|
if (!loot_table) {
|
||||||
|
res.status = 400;
|
||||||
|
j["error"] = fmt::format("Loot table not found [{}]", loottable_id);
|
||||||
|
res.set_content(j.dump(), "application/json");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (uint32 i = 0; i < loot_table->NumEntries; i++) {
|
||||||
|
auto le = loot_table->Entries[i];
|
||||||
|
|
||||||
|
nlohmann::json jle;
|
||||||
|
jle["lootdrop_id"] = le.lootdrop_id;
|
||||||
|
jle["droplimit"] = le.droplimit;
|
||||||
|
jle["mindrop"] = le.mindrop;
|
||||||
|
jle["multiplier"] = le.multiplier;
|
||||||
|
jle["probability"] = le.probability;
|
||||||
|
|
||||||
|
auto loot_drop = database.GetLootDrop(le.lootdrop_id);
|
||||||
|
if (!loot_drop) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (uint32 ei = 0; ei < loot_drop->NumEntries; ei++) {
|
||||||
|
auto e = loot_drop->Entries[ei];
|
||||||
|
int rolled_count = npc->GetRolledItemCount(e.item_id);
|
||||||
|
const EQ::ItemData *item = database.GetItem(e.item_id);
|
||||||
|
|
||||||
|
|
||||||
|
auto rolled_percentage = (float) ((float) ((float) rolled_count / (float) iterations) * 100);
|
||||||
|
|
||||||
|
nlohmann::json drop;
|
||||||
|
drop["slot"] = ei;
|
||||||
|
drop["item_id"] = e.item_id;
|
||||||
|
drop["item_name"] = item->Name;
|
||||||
|
drop["chance"] = fmt::format("{:.2f}", e.chance);
|
||||||
|
drop["simulate_rolled_count"] = rolled_count;
|
||||||
|
drop["simulate_rolled_percentage"] = fmt::format("{:.2f}", rolled_percentage);
|
||||||
|
jle["drops"].push_back(drop);
|
||||||
|
}
|
||||||
|
|
||||||
|
j["lootdrops"].push_back(jle);
|
||||||
|
}
|
||||||
|
|
||||||
|
// global loot
|
||||||
|
for (auto &id: zone->GetGlobalLootTables(npc)) {
|
||||||
|
loot_table = database.GetLootTable(id);
|
||||||
|
if (!loot_table) {
|
||||||
|
LogInfo("Global Loot table not found [{}]", id);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (uint32 i = 0; i < loot_table->NumEntries; i++) {
|
||||||
|
auto le = loot_table->Entries[i];
|
||||||
|
|
||||||
|
LogInfo(
|
||||||
|
"# Lootdrop ID [{}] drop_limit [{}] min_drop [{}] mult [{}] probability [{}]",
|
||||||
|
le.lootdrop_id,
|
||||||
|
le.droplimit,
|
||||||
|
le.mindrop,
|
||||||
|
le.multiplier,
|
||||||
|
le.probability
|
||||||
|
);
|
||||||
|
|
||||||
|
nlohmann::json jle;
|
||||||
|
jle["lootdrop_id"] = le.lootdrop_id;
|
||||||
|
jle["droplimit"] = le.droplimit;
|
||||||
|
jle["mindrop"] = le.mindrop;
|
||||||
|
jle["multiplier"] = le.multiplier;
|
||||||
|
jle["probability"] = le.probability;
|
||||||
|
|
||||||
|
auto loot_drop = database.GetLootDrop(le.lootdrop_id);
|
||||||
|
if (!loot_drop) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (uint32 ei = 0; ei < loot_drop->NumEntries; ei++) {
|
||||||
|
auto e = loot_drop->Entries[ei];
|
||||||
|
int rolled_count = npc->GetRolledItemCount(e.item_id);
|
||||||
|
const EQ::ItemData *item = database.GetItem(e.item_id);
|
||||||
|
|
||||||
|
auto rolled_percentage = (float) ((float) ((float) rolled_count / (float) iterations) *
|
||||||
|
100);
|
||||||
|
|
||||||
|
|
||||||
|
LogInfo(
|
||||||
|
"-- [{}] item_id [{}] chance [{}] rolled_count [{}] ({:.2f}%) name [{}]",
|
||||||
|
ei,
|
||||||
|
e.item_id,
|
||||||
|
e.chance,
|
||||||
|
rolled_count,
|
||||||
|
rolled_percentage,
|
||||||
|
item->Name
|
||||||
|
);
|
||||||
|
|
||||||
|
nlohmann::json drop;
|
||||||
|
drop["slot"] = ei;
|
||||||
|
drop["item_id"] = e.item_id;
|
||||||
|
drop["item_name"] = item->Name;
|
||||||
|
drop["chance"] = fmt::format("{:.2f}", e.chance);
|
||||||
|
drop["simulate_rolled_count"] = rolled_count;
|
||||||
|
drop["simulate_rolled_percentage"] = fmt::format("{:.2f}", rolled_percentage);
|
||||||
|
jle["drops"].push_back(drop);
|
||||||
|
|
||||||
|
j["global"]["lootdrops"].push_back(jle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
j["data"]["time"] = benchmark.elapsed();
|
||||||
|
res.status = 200;
|
||||||
|
res.set_content(j.dump(), "application/json");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
res.status = 400;
|
||||||
|
j["error"] = fmt::format("Failed to spawn NPC ID [{}]", npc_id);
|
||||||
|
res.set_content(j.dump(), "application/json");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
void SidecarApi::MapBestZController(const httplib::Request &req, httplib::Response &res)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,119 @@
|
|||||||
|
#include "sidecar_api.h"
|
||||||
|
#include "../../common/http/httplib.h"
|
||||||
|
#include "../../common/eqemu_logsys.h"
|
||||||
|
#include "../zonedb.h"
|
||||||
|
#include "../../shared_memory/loot.h"
|
||||||
|
#include "../../common/process.h"
|
||||||
|
#include "../common.h"
|
||||||
|
#include "../zone.h"
|
||||||
|
#include "../client.h"
|
||||||
|
#include "../../common/json/json.hpp"
|
||||||
|
#include <csignal>
|
||||||
|
|
||||||
|
void CatchSidecarSignal(int sig_num)
|
||||||
|
{
|
||||||
|
LogInfo("[SidecarAPI] Caught signal [{}]", sig_num);
|
||||||
|
LogInfo("Forcefully exiting for now");
|
||||||
|
std::exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
#include "log_handler.cpp"
|
||||||
|
#include "test_controller.cpp"
|
||||||
|
#include "map_best_z_controller.cpp"
|
||||||
|
#include "../../common/file.h"
|
||||||
|
|
||||||
|
constexpr static int HTTP_RESPONSE_OK = 200;
|
||||||
|
constexpr static int HTTP_RESPONSE_BAD_REQUEST = 400;
|
||||||
|
constexpr static int HTTP_RESPONSE_UNAUTHORIZED = 401;
|
||||||
|
|
||||||
|
std::string authorization_key;
|
||||||
|
|
||||||
|
void SidecarApi::BootWebserver(int port, const std::string &key)
|
||||||
|
{
|
||||||
|
LogInfo("Booting zone sidecar API");
|
||||||
|
|
||||||
|
std::signal(SIGINT, CatchSidecarSignal);
|
||||||
|
std::signal(SIGTERM, CatchSidecarSignal);
|
||||||
|
std::signal(SIGKILL, CatchSidecarSignal);
|
||||||
|
|
||||||
|
if (!key.empty()) {
|
||||||
|
authorization_key = key;
|
||||||
|
LogInfo("Booting with authorization key [{}]", authorization_key);
|
||||||
|
}
|
||||||
|
|
||||||
|
int web_api_port = port > 0 ? port : 9099;
|
||||||
|
std::string hotfix_name = "zonesidecar_api_";
|
||||||
|
|
||||||
|
// bake shared memory if it doesn't exist
|
||||||
|
// TODO: Windows
|
||||||
|
if (!File::Exists("shared/zonesidecar_api_loot_drop")) {
|
||||||
|
LogInfo("Creating shared memory for prefix [{}]", hotfix_name);
|
||||||
|
|
||||||
|
std::string output = Process::execute(
|
||||||
|
fmt::format(
|
||||||
|
"./bin/shared_memory -hotfix={} loot items",
|
||||||
|
hotfix_name
|
||||||
|
)
|
||||||
|
);
|
||||||
|
std::cout << output << "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
LogInfo("Loading loot tables");
|
||||||
|
if (!database.LoadLoot(hotfix_name)) {
|
||||||
|
LogError("Loading loot failed!");
|
||||||
|
}
|
||||||
|
|
||||||
|
// bootup a fake zone
|
||||||
|
Zone::Bootup(ZoneID("qrg"), 0, false);
|
||||||
|
zone->StopShutdownTimer();
|
||||||
|
|
||||||
|
httplib::Server api;
|
||||||
|
|
||||||
|
api.set_logger(SidecarApi::RequestLogHandler);
|
||||||
|
api.set_pre_routing_handler(
|
||||||
|
[](const auto &req, auto &res) {
|
||||||
|
for (const auto &header: req.headers) {
|
||||||
|
auto header_key = header.first;
|
||||||
|
auto header_value = header.second;
|
||||||
|
|
||||||
|
LogHTTPDetail("[API] header_key [{}] header_value [{}]", header_key, header_value);
|
||||||
|
|
||||||
|
if (header_key == "Authorization") {
|
||||||
|
std::string auth_key = header_value;
|
||||||
|
Strings::FindReplace(auth_key, "Bearer", "");
|
||||||
|
Strings::Trim(auth_key);
|
||||||
|
|
||||||
|
LogHTTPDetail(
|
||||||
|
"Request Authorization key is [{}] set key is [{}] match [{}]",
|
||||||
|
auth_key,
|
||||||
|
authorization_key,
|
||||||
|
auth_key == authorization_key ? "true" : "false"
|
||||||
|
);
|
||||||
|
|
||||||
|
// authorization key matches, pass the request on to the route handler
|
||||||
|
if (!authorization_key.empty() && auth_key != authorization_key) {
|
||||||
|
LogHTTPDetail("[Sidecar] Returning as unhandled, authorization passed");
|
||||||
|
return httplib::Server::HandlerResponse::Unhandled;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!authorization_key.empty()) {
|
||||||
|
nlohmann::json j;
|
||||||
|
j["error"] = "Authorization key not valid!";
|
||||||
|
res.set_content(j.dump(), "application/json");
|
||||||
|
res.status = HTTP_RESPONSE_UNAUTHORIZED;
|
||||||
|
return httplib::Server::HandlerResponse::Handled;
|
||||||
|
}
|
||||||
|
|
||||||
|
return httplib::Server::HandlerResponse::Unhandled;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
api.Get("/api/v1/test-controller", SidecarApi::TestController);
|
||||||
|
api.Get("/api/v1/loot-simulate", SidecarApi::LootSimulatorController);
|
||||||
|
|
||||||
|
LogInfo("Webserver API now listening on port [{0}]", web_api_port);
|
||||||
|
|
||||||
|
// this is not supposed to bind to the outside world
|
||||||
|
api.listen("localhost", web_api_port);
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
#ifndef EQEMU_SIDECAR_API_H
|
||||||
|
#define EQEMU_SIDECAR_API_H
|
||||||
|
|
||||||
|
#include "../../common/http/httplib.h"
|
||||||
|
|
||||||
|
class SidecarApi {
|
||||||
|
public:
|
||||||
|
static void BootWebserver(int req = 0, const std::string& key = "");
|
||||||
|
static void AuthMiddleware(const httplib::Request &req, const httplib::Response &res);
|
||||||
|
static void RequestLogHandler(const httplib::Request &req, const httplib::Response &res);
|
||||||
|
static void TestController(const httplib::Request &req, httplib::Response &res);
|
||||||
|
static void LootSimulatorController(const httplib::Request &req, httplib::Response &res);
|
||||||
|
static void MapBestZController(const httplib::Request &req, httplib::Response &res);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif //EQEMU_SIDECAR_API_H
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
#include "sidecar_api.h"
|
||||||
|
|
||||||
|
void SidecarApi::TestController(const httplib::Request &req, httplib::Response &res)
|
||||||
|
{
|
||||||
|
nlohmann::json j;
|
||||||
|
|
||||||
|
j["data"]["test"] = "test";
|
||||||
|
|
||||||
|
res.set_content(j.dump(), "application/json");
|
||||||
|
}
|
||||||
+56
-46
@@ -27,6 +27,8 @@
|
|||||||
#include "zone.h"
|
#include "zone.h"
|
||||||
#include "zonedb.h"
|
#include "zonedb.h"
|
||||||
#include "../common/repositories/criteria/content_filter_criteria.h"
|
#include "../common/repositories/criteria/content_filter_criteria.h"
|
||||||
|
#include "../common/repositories/spawn2_repository.h"
|
||||||
|
#include "../common/repositories/spawn2_disabled_repository.h"
|
||||||
|
|
||||||
extern EntityList entity_list;
|
extern EntityList entity_list;
|
||||||
extern Zone* zone;
|
extern Zone* zone;
|
||||||
@@ -468,60 +470,68 @@ bool ZoneDatabase::PopulateZoneSpawnList(uint32 zoneid, LinkedList<Spawn2*> &spa
|
|||||||
LogInfo("Loaded [{}] respawn timer(s)", Strings::Commify(results.RowCount()));
|
LogInfo("Loaded [{}] respawn timer(s)", Strings::Commify(results.RowCount()));
|
||||||
|
|
||||||
const char *zone_name = ZoneName(zoneid);
|
const char *zone_name = ZoneName(zoneid);
|
||||||
std::string query = fmt::format(
|
|
||||||
"SELECT "
|
auto spawns = Spawn2Repository::GetWhere(
|
||||||
"id, "
|
content_db, fmt::format(
|
||||||
"spawngroupID, "
|
"TRUE {} AND zone = '{}' AND (version = {} OR version = -1) ",
|
||||||
"x, "
|
|
||||||
"y, "
|
|
||||||
"z, "
|
|
||||||
"heading, "
|
|
||||||
"respawntime, "
|
|
||||||
"variance, "
|
|
||||||
"pathgrid, "
|
|
||||||
"path_when_zone_idle, "
|
|
||||||
"_condition, "
|
|
||||||
"cond_value, "
|
|
||||||
"enabled, "
|
|
||||||
"animation "
|
|
||||||
"FROM "
|
|
||||||
"spawn2 "
|
|
||||||
"WHERE TRUE {} AND zone = '{}' AND (version = {} OR version = -1) ",
|
|
||||||
ContentFilterCriteria::apply(),
|
ContentFilterCriteria::apply(),
|
||||||
zone_name,
|
zone_name,
|
||||||
version
|
version
|
||||||
|
)
|
||||||
);
|
);
|
||||||
results = QueryDatabase(query);
|
|
||||||
|
|
||||||
if (!results.Success()) {
|
std::vector<uint32> spawn2_ids;
|
||||||
return false;
|
for (auto &s: spawns) {
|
||||||
|
spawn2_ids.push_back(s.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
// we load spawn2_disabled entries for this zone
|
||||||
|
// if there are more specific entries for an instance of this zone, we load those instead
|
||||||
|
// if there are no entries for this zone, we load the default entries
|
||||||
|
std::vector<Spawn2DisabledRepository::Spawn2Disabled> disabled_spawns = {};
|
||||||
|
if (!spawn2_ids.empty()) {
|
||||||
|
disabled_spawns = Spawn2DisabledRepository::GetWhere(
|
||||||
|
database,
|
||||||
|
fmt::format(
|
||||||
|
"spawn2_id IN ({}) and (instance_id = {} OR instance_id = 0) ORDER BY instance_id",
|
||||||
|
Strings::Join(spawn2_ids, ","),
|
||||||
|
zone->GetInstanceID()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (auto &s: spawns) {
|
||||||
uint32 spawn_time_left = 0;
|
uint32 spawn_time_left = 0;
|
||||||
Spawn2* new_spawn = 0;
|
if (spawn_times.count(s.id) != 0) {
|
||||||
bool perl_enabled = Strings::ToInt(row[12]) == 1 ? true : false;
|
spawn_time_left = spawn_times[s.id];
|
||||||
|
}
|
||||||
|
|
||||||
if (spawn_times.count(Strings::ToInt(row[0])) != 0)
|
// load from spawn2_disabled
|
||||||
spawn_time_left = spawn_times[Strings::ToInt(row[0])];
|
bool spawn_enabled = true;
|
||||||
|
|
||||||
new_spawn = new Spawn2(
|
// check if spawn is disabled
|
||||||
Strings::ToInt(row[0]), // uint32 in_spawn2_id
|
for (auto &ds: disabled_spawns) {
|
||||||
Strings::ToInt(row[1]), // uint32 spawngroup_id
|
if (ds.spawn2_id == s.id) {
|
||||||
Strings::ToFloat(row[2]), // float in_x
|
spawn_enabled = !ds.disabled;
|
||||||
Strings::ToFloat(row[3]), // float in_y
|
}
|
||||||
Strings::ToFloat(row[4]), // float in_z
|
}
|
||||||
Strings::ToFloat(row[5]), // float in_heading
|
|
||||||
Strings::ToInt(row[6]), // uint32 respawn
|
auto new_spawn = new Spawn2(
|
||||||
Strings::ToInt(row[7]), // uint32 variance
|
s.id,
|
||||||
spawn_time_left, // uint32 timeleft
|
s.spawngroupID,
|
||||||
Strings::ToInt(row[8]), // uint32 grid
|
s.x,
|
||||||
(bool)Strings::ToInt(row[9]), // bool path_when_zone_idle
|
s.y,
|
||||||
Strings::ToInt(row[10]), // uint16 in_cond_id
|
s.z,
|
||||||
Strings::ToInt(row[11]), // int16 in_min_value
|
s.heading,
|
||||||
perl_enabled, // bool in_enabled
|
s.respawntime,
|
||||||
(EmuAppearance)Strings::ToInt(row[13]) // EmuAppearance anim
|
s.variance,
|
||||||
|
spawn_time_left,
|
||||||
|
s.pathgrid,
|
||||||
|
(bool) s.path_when_zone_idle,
|
||||||
|
s._condition,
|
||||||
|
(int16) s.cond_value,
|
||||||
|
spawn_enabled,
|
||||||
|
(EmuAppearance) s.animation
|
||||||
);
|
);
|
||||||
|
|
||||||
spawn2_list.Insert(new_spawn);
|
spawn2_list.Insert(new_spawn);
|
||||||
@@ -682,7 +692,7 @@ void SpawnConditionManager::Process() {
|
|||||||
//check each spawn event.
|
//check each spawn event.
|
||||||
|
|
||||||
//get our current time
|
//get our current time
|
||||||
TimeOfDay_Struct tod;
|
TimeOfDay_Struct tod{};
|
||||||
zone->zone_time.GetCurrentEQTimeOfDay(&tod);
|
zone->zone_time.GetCurrentEQTimeOfDay(&tod);
|
||||||
|
|
||||||
//see if time is past our nearest event.
|
//see if time is past our nearest event.
|
||||||
@@ -735,7 +745,7 @@ void SpawnConditionManager::ExecEvent(SpawnEvent &event, bool send_update) {
|
|||||||
return; //unable to find the spawn condition to operate on
|
return; //unable to find the spawn condition to operate on
|
||||||
}
|
}
|
||||||
|
|
||||||
TimeOfDay_Struct tod;
|
TimeOfDay_Struct tod{};
|
||||||
zone->zone_time.GetCurrentEQTimeOfDay(&tod);
|
zone->zone_time.GetCurrentEQTimeOfDay(&tod);
|
||||||
if(event.strict && (event.next.hour != tod.hour || event.next.day != tod.day || event.next.month != tod.month || event.next.year != tod.year))
|
if(event.strict && (event.next.hour != tod.hour || event.next.day != tod.day || event.next.month != tod.month || event.next.year != tod.year))
|
||||||
{
|
{
|
||||||
@@ -946,7 +956,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in
|
|||||||
//spawn points which get turned on. Im too lazy to figure out a
|
//spawn points which get turned on. Im too lazy to figure out a
|
||||||
//better solution, and I just dont care thats much.
|
//better solution, and I just dont care thats much.
|
||||||
//get our current time
|
//get our current time
|
||||||
TimeOfDay_Struct tod;
|
TimeOfDay_Struct tod{};
|
||||||
zone->zone_time.GetCurrentEQTimeOfDay(&tod);
|
zone->zone_time.GetCurrentEQTimeOfDay(&tod);
|
||||||
|
|
||||||
for(auto cur = spawn_events.begin(); cur != spawn_events.end(); ++cur) {
|
for(auto cur = spawn_events.begin(); cur != spawn_events.end(); ++cur) {
|
||||||
|
|||||||
+27
-9
@@ -29,12 +29,13 @@
|
|||||||
extern EntityList entity_list;
|
extern EntityList entity_list;
|
||||||
extern Zone *zone;
|
extern Zone *zone;
|
||||||
|
|
||||||
SpawnEntry::SpawnEntry(uint32 in_NPCType, int in_chance, uint16 in_filter, uint8 in_npc_spawn_limit)
|
SpawnEntry::SpawnEntry(uint32 in_NPCType, int in_chance, uint16 in_filter, uint8 in_npc_spawn_limit, uint8 in_min_time, uint8 in_max_time) {
|
||||||
{
|
|
||||||
NPCType = in_NPCType;
|
NPCType = in_NPCType;
|
||||||
chance = in_chance;
|
chance = in_chance;
|
||||||
condition_value_filter = in_filter;
|
condition_value_filter = in_filter;
|
||||||
npc_spawn_limit = in_npc_spawn_limit;
|
npc_spawn_limit = in_npc_spawn_limit;
|
||||||
|
min_time = in_min_time;
|
||||||
|
max_time = in_max_time;
|
||||||
}
|
}
|
||||||
|
|
||||||
SpawnGroup::SpawnGroup(
|
SpawnGroup::SpawnGroup(
|
||||||
@@ -85,8 +86,15 @@ uint32 SpawnGroup::GetNPCType(uint16 in_filter)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (se->condition_value_filter != in_filter)
|
if (se->min_time != 0 && se->max_time != 0 && se->min_time <= 24 && se->max_time <= 24) {
|
||||||
|
if (!zone->zone_time.IsInbetweenTime(se->min_time, se->max_time)) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (se->condition_value_filter != in_filter) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
totalchance += se->chance;
|
totalchance += se->chance;
|
||||||
possible.push_back(se);
|
possible.push_back(se);
|
||||||
@@ -224,7 +232,9 @@ bool ZoneDatabase::LoadSpawnGroups(const char *zone_name, uint16 version, SpawnG
|
|||||||
chance,
|
chance,
|
||||||
condition_value_filter,
|
condition_value_filter,
|
||||||
npc_types.spawn_limit
|
npc_types.spawn_limit
|
||||||
AS sl
|
AS sl,
|
||||||
|
min_time,
|
||||||
|
max_time
|
||||||
FROM
|
FROM
|
||||||
spawnentry,
|
spawnentry,
|
||||||
spawn2,
|
spawn2,
|
||||||
@@ -251,7 +261,9 @@ bool ZoneDatabase::LoadSpawnGroups(const char *zone_name, uint16 version, SpawnG
|
|||||||
Strings::ToInt(row[1]),
|
Strings::ToInt(row[1]),
|
||||||
Strings::ToInt(row[2]),
|
Strings::ToInt(row[2]),
|
||||||
Strings::ToInt(row[3]),
|
Strings::ToInt(row[3]),
|
||||||
(row[4] ? Strings::ToInt(row[4]) : 0)
|
(row[4] ? Strings::ToInt(row[4]) : 0),
|
||||||
|
Strings::ToInt(row[5]),
|
||||||
|
Strings::ToInt(row[6])
|
||||||
);
|
);
|
||||||
|
|
||||||
SpawnGroup *spawn_group = spawn_group_list->GetSpawnGroup(Strings::ToInt(row[0]));
|
SpawnGroup *spawn_group = spawn_group_list->GetSpawnGroup(Strings::ToInt(row[0]));
|
||||||
@@ -340,7 +352,9 @@ bool ZoneDatabase::LoadSpawnGroupsByID(int spawn_group_id, SpawnGroupList *spawn
|
|||||||
spawnentry.npcid,
|
spawnentry.npcid,
|
||||||
spawnentry.chance,
|
spawnentry.chance,
|
||||||
spawnentry.condition_value_filter,
|
spawnentry.condition_value_filter,
|
||||||
spawngroup.spawn_limit
|
spawngroup.spawn_limit,
|
||||||
|
spawnentry.min_time,
|
||||||
|
spawnentry.max_time
|
||||||
FROM
|
FROM
|
||||||
spawnentry,
|
spawnentry,
|
||||||
spawngroup
|
spawngroup
|
||||||
@@ -361,16 +375,20 @@ bool ZoneDatabase::LoadSpawnGroupsByID(int spawn_group_id, SpawnGroupList *spawn
|
|||||||
Strings::ToInt(row[1]),
|
Strings::ToInt(row[1]),
|
||||||
Strings::ToInt(row[2]),
|
Strings::ToInt(row[2]),
|
||||||
Strings::ToInt(row[3]),
|
Strings::ToInt(row[3]),
|
||||||
(row[4] ? Strings::ToInt(row[4]) : 0)
|
(row[4] ? Strings::ToInt(row[4]) : 0),
|
||||||
|
Strings::ToInt(row[5]),
|
||||||
|
Strings::ToInt(row[6])
|
||||||
);
|
);
|
||||||
|
|
||||||
LogSpawnsDetail(
|
LogSpawnsDetail(
|
||||||
"Loading spawn_entry spawn_group_id [{}] npc_id [{}] chance [{}] condition_value_filter [{}] spawn_limit [{}]",
|
"Loading spawn_entry spawn_group_id [{}] npc_id [{}] chance [{}] condition_value_filter [{}] spawn_limit [{}] min_time [{}] max_time [{}] ",
|
||||||
row[0],
|
row[0],
|
||||||
row[1],
|
row[1],
|
||||||
row[2],
|
row[2],
|
||||||
row[3],
|
row[3],
|
||||||
row[4]
|
row[4],
|
||||||
|
row[5],
|
||||||
|
row[6]
|
||||||
);
|
);
|
||||||
|
|
||||||
SpawnGroup *spawn_group = spawn_group_list->GetSpawnGroup(Strings::ToInt(row[0]));
|
SpawnGroup *spawn_group = spawn_group_list->GetSpawnGroup(Strings::ToInt(row[0]));
|
||||||
|
|||||||
+3
-1
@@ -26,10 +26,12 @@
|
|||||||
|
|
||||||
class SpawnEntry {
|
class SpawnEntry {
|
||||||
public:
|
public:
|
||||||
SpawnEntry(uint32 in_NPCType, int in_chance, uint16 in_filter, uint8 in_npc_spawn_limit);
|
SpawnEntry(uint32 in_NPCType, int in_chance, uint16 in_filter, uint8 in_npc_spawn_limit, uint8 in_min_time, uint8 in_max_time);
|
||||||
~SpawnEntry() {}
|
~SpawnEntry() {}
|
||||||
uint32 NPCType;
|
uint32 NPCType;
|
||||||
int chance;
|
int chance;
|
||||||
|
uint8 min_time;
|
||||||
|
uint8 max_time;
|
||||||
uint16 condition_value_filter;
|
uint16 condition_value_filter;
|
||||||
|
|
||||||
//this is a cached value from npc_types, for speed
|
//this is a cached value from npc_types, for speed
|
||||||
|
|||||||
@@ -706,11 +706,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
|
|||||||
|
|
||||||
case SE_AddFaction:
|
case SE_AddFaction:
|
||||||
{
|
{
|
||||||
#ifdef SPELL_EFFECT_SPAM
|
if (caster && !IsPet() && GetPrimaryFaction() > 0) {
|
||||||
snprintf(effect_desc, _EDLEN, "Faction Mod: %+i", effect_value);
|
|
||||||
#endif
|
|
||||||
// EverHood
|
|
||||||
if(caster && GetPrimaryFaction()>0) {
|
|
||||||
caster->AddFactionBonus(GetPrimaryFaction(),effect_value);
|
caster->AddFactionBonus(GetPrimaryFaction(),effect_value);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -711,6 +711,18 @@ bool Mob::DoCastingChecksZoneRestrictions(bool check_on_casting, int32 spell_id)
|
|||||||
Message(Chat::Red, "You cannot cast detrimental spells here.");
|
Message(Chat::Red, "You cannot cast detrimental spells here.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
Zones where you can not cast a spell that is for daytime or nighttime only
|
||||||
|
*/
|
||||||
|
if (spells[spell_id].time_of_day == SpellTimeRestrictions::Day && !zone->zone_time.IsDayTime()) {
|
||||||
|
MessageString(Chat::Red, CAST_DAYTIME);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (spells[spell_id].time_of_day == SpellTimeRestrictions::Night && !zone->zone_time.IsNightTime()) {
|
||||||
|
MessageString(Chat::Red, CAST_NIGHTTIME);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (check_on_casting) {
|
if (check_on_casting) {
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -63,6 +63,8 @@
|
|||||||
#define SAC_TOO_HIGH 204 //This being is too powerful to be a sacrifice.
|
#define SAC_TOO_HIGH 204 //This being is too powerful to be a sacrifice.
|
||||||
#define CANNOT_SAC_SELF 205 //You cannot sacrifice yourself.
|
#define CANNOT_SAC_SELF 205 //You cannot sacrifice yourself.
|
||||||
#define SILENCED_STRING 207 //You *CANNOT* cast spells, you have been silenced!
|
#define SILENCED_STRING 207 //You *CANNOT* cast spells, you have been silenced!
|
||||||
|
#define CAST_DAYTIME 208 //Spell can only be cast during the day.
|
||||||
|
#define CAST_NIGHTTIME 209 //Spell can only be cast during the night.
|
||||||
#define CANNOT_AFFECT_PC 210 //That spell can not affect this target PC.
|
#define CANNOT_AFFECT_PC 210 //That spell can not affect this target PC.
|
||||||
#define SPELL_NEED_TAR 214 //You must first select a target for this spell!
|
#define SPELL_NEED_TAR 214 //You must first select a target for this spell!
|
||||||
#define SUMMON_ONLY_GROUP_CORPSE 215 //You must first target a living group member whose corpse you wish to summon.
|
#define SUMMON_ONLY_GROUP_CORPSE 215 //You must first target a living group member whose corpse you wish to summon.
|
||||||
|
|||||||
+16
-2
@@ -757,8 +757,22 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo: rule or npc field to auto return normal items also
|
// Regardless of quest or non-quest NPC - No in combat trade completion
|
||||||
if (!quest_npc)
|
// is allowed.
|
||||||
|
if (tradingWith->CheckAggro(this))
|
||||||
|
{
|
||||||
|
for (EQ::ItemInstance* inst : items) {
|
||||||
|
if (!inst || !inst->GetItem()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
tradingWith->SayString(TRADE_BACK, GetCleanName());
|
||||||
|
PushItemOnCursor(*inst, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Only enforce trade rules if the NPC doesn't have an EVENT_TRADE
|
||||||
|
// subroutine. That overrides all.
|
||||||
|
else if (!quest_npc)
|
||||||
{
|
{
|
||||||
for (EQ::ItemInstance* inst : items) {
|
for (EQ::ItemInstance* inst : items) {
|
||||||
if (!inst || !inst->GetItem()) {
|
if (!inst || !inst->GetItem()) {
|
||||||
|
|||||||
+10
-11
@@ -965,7 +965,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
|||||||
|
|
||||||
char time_message[255];
|
char time_message[255];
|
||||||
time_t current_time = time(nullptr);
|
time_t current_time = time(nullptr);
|
||||||
TimeOfDay_Struct eq_time;
|
TimeOfDay_Struct eq_time{};
|
||||||
zone->zone_time.GetCurrentEQTimeOfDay(current_time, &eq_time);
|
zone->zone_time.GetCurrentEQTimeOfDay(current_time, &eq_time);
|
||||||
|
|
||||||
sprintf(time_message, "EQTime [%02d:%s%d %s]",
|
sprintf(time_message, "EQTime [%02d:%s%d %s]",
|
||||||
@@ -1729,28 +1729,27 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
|||||||
if (zone)
|
if (zone)
|
||||||
{
|
{
|
||||||
ServerSpawnStatusChange_Struct *ssc = (ServerSpawnStatusChange_Struct*)pack->pBuffer;
|
ServerSpawnStatusChange_Struct *ssc = (ServerSpawnStatusChange_Struct*)pack->pBuffer;
|
||||||
|
if (ssc->instance_id != zone->GetInstanceID()) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
LinkedListIterator<Spawn2 *> iterator(zone->spawn2_list);
|
LinkedListIterator<Spawn2 *> iterator(zone->spawn2_list);
|
||||||
iterator.Reset();
|
iterator.Reset();
|
||||||
Spawn2 *found_spawn = nullptr;
|
Spawn2 *found_spawn = nullptr;
|
||||||
while (iterator.MoreElements())
|
while (iterator.MoreElements()) {
|
||||||
{
|
|
||||||
Spawn2 *cur = iterator.GetData();
|
Spawn2 *cur = iterator.GetData();
|
||||||
if (cur->GetID() == ssc->id)
|
if (cur->GetID() == ssc->id) {
|
||||||
{
|
|
||||||
found_spawn = cur;
|
found_spawn = cur;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
iterator.Advance();
|
iterator.Advance();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (found_spawn)
|
if (found_spawn) {
|
||||||
{
|
if (ssc->new_status == 0) {
|
||||||
if (ssc->new_status == 0)
|
|
||||||
{
|
|
||||||
found_spawn->Disable();
|
found_spawn->Disable();
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
found_spawn->Enable();
|
found_spawn->Enable();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1821,6 +1821,11 @@ void Zone::ResetShutdownTimer() {
|
|||||||
autoshutdown_timer.Start(autoshutdown_timer.GetDuration(), true);
|
autoshutdown_timer.Start(autoshutdown_timer.GetDuration(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Zone::StopShutdownTimer() {
|
||||||
|
LogInfo("Stopping zone shutdown timer");
|
||||||
|
autoshutdown_timer.Disable();
|
||||||
|
}
|
||||||
|
|
||||||
bool Zone::Depop(bool StartSpawnTimer) {
|
bool Zone::Depop(bool StartSpawnTimer) {
|
||||||
std::map<uint32,NPCType *>::iterator itr;
|
std::map<uint32,NPCType *>::iterator itr;
|
||||||
entity_list.Depop(StartSpawnTimer);
|
entity_list.Depop(StartSpawnTimer);
|
||||||
|
|||||||
@@ -302,6 +302,7 @@ public:
|
|||||||
void SpawnConditionChanged(const SpawnCondition &c, int16 old_value);
|
void SpawnConditionChanged(const SpawnCondition &c, int16 old_value);
|
||||||
void StartShutdownTimer(uint32 set_time = (RuleI(Zone, AutoShutdownDelay)));
|
void StartShutdownTimer(uint32 set_time = (RuleI(Zone, AutoShutdownDelay)));
|
||||||
void ResetShutdownTimer();
|
void ResetShutdownTimer();
|
||||||
|
void StopShutdownTimer();
|
||||||
void UpdateQGlobal(uint32 qid, QGlobal newGlobal);
|
void UpdateQGlobal(uint32 qid, QGlobal newGlobal);
|
||||||
void weatherSend(Client *client = nullptr);
|
void weatherSend(Client *client = nullptr);
|
||||||
void ClearSpawnTimers();
|
void ClearSpawnTimers();
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
#include "zone_cli.h"
|
||||||
|
#include "../common/cli/eqemu_command_handler.h"
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
bool ZoneCLI::RanConsoleCommand(int argc, char **argv)
|
||||||
|
{
|
||||||
|
return argc > 1 && (strstr(argv[1], ":") != nullptr || strstr(argv[1], "--") != nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ZoneCLI::RanSidecarCommand(int argc, char **argv)
|
||||||
|
{
|
||||||
|
return argc > 1 && (strstr(argv[1], "sidecar:") != nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ZoneCLI::CommandHandler(int argc, char **argv)
|
||||||
|
{
|
||||||
|
if (argc == 1) { return; }
|
||||||
|
|
||||||
|
argh::parser cmd;
|
||||||
|
cmd.parse(argc, argv, argh::parser::PREFER_PARAM_FOR_UNREG_OPTION);
|
||||||
|
EQEmuCommand::DisplayDebug(cmd);
|
||||||
|
|
||||||
|
// Declare command mapping
|
||||||
|
auto function_map = EQEmuCommand::function_map;
|
||||||
|
|
||||||
|
// Register commands
|
||||||
|
function_map["sidecar:serve-http"] = &ZoneCLI::SidecarServeHttp;
|
||||||
|
|
||||||
|
EQEmuCommand::HandleMenu(function_map, cmd, argc, argv);
|
||||||
|
}
|
||||||
|
|
||||||
|
#include "cli/sidecar_serve_http.cpp"
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
#ifndef EQEMU_ZONE_CLI_H
|
||||||
|
#define EQEMU_ZONE_CLI_H
|
||||||
|
|
||||||
|
#include "../common/cli/argh.h"
|
||||||
|
|
||||||
|
class ZoneCLI {
|
||||||
|
public:
|
||||||
|
static void CommandHandler(int argc, char **argv);
|
||||||
|
static void SidecarServeHttp(int argc, char **argv, argh::parser &cmd, std::string &description);
|
||||||
|
static bool RanConsoleCommand(int argc, char **argv);
|
||||||
|
static bool RanSidecarCommand(int argc, char **argv);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif //EQEMU_ZONE_CLI_H
|
||||||
+22
-5
@@ -21,6 +21,7 @@
|
|||||||
#include "../common/repositories/character_pet_info_repository.h"
|
#include "../common/repositories/character_pet_info_repository.h"
|
||||||
#include "../common/repositories/character_buffs_repository.h"
|
#include "../common/repositories/character_buffs_repository.h"
|
||||||
#include "../common/repositories/criteria/content_filter_criteria.h"
|
#include "../common/repositories/criteria/content_filter_criteria.h"
|
||||||
|
#include "../common/repositories/spawn2_disabled_repository.h"
|
||||||
|
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@@ -171,10 +172,26 @@ uint32 ZoneDatabase::GetSpawnTimeLeft(uint32 id, uint16 instance_id)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ZoneDatabase::UpdateSpawn2Status(uint32 id, uint8 new_status)
|
void ZoneDatabase::UpdateSpawn2Status(uint32 id, uint8 new_status, uint32 instance_id)
|
||||||
{
|
{
|
||||||
std::string query = StringFormat("UPDATE spawn2 SET enabled = %i WHERE id = %lu", new_status, (unsigned long)id);
|
auto spawns = Spawn2DisabledRepository::GetWhere(
|
||||||
QueryDatabase(query);
|
*this,
|
||||||
|
fmt::format("spawn2_id = {} and instance_id = {}", id, instance_id)
|
||||||
|
);
|
||||||
|
if (!spawns.empty()) {
|
||||||
|
auto spawn = spawns[0];
|
||||||
|
// 1 = enabled 0 = disabled
|
||||||
|
spawn.disabled = new_status ? 0 : 1;
|
||||||
|
spawn.instance_id = instance_id;
|
||||||
|
Spawn2DisabledRepository::UpdateOne(*this, spawn);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto spawn = Spawn2DisabledRepository::NewEntity();
|
||||||
|
spawn.spawn2_id = id;
|
||||||
|
spawn.instance_id = instance_id;
|
||||||
|
spawn.disabled = new_status ? 0 : 1;
|
||||||
|
Spawn2DisabledRepository::InsertOne(*this, spawn);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ZoneDatabase::SetSpecialAttkFlag(uint8 id, const char* flag) {
|
bool ZoneDatabase::SetSpecialAttkFlag(uint8 id, const char* flag) {
|
||||||
@@ -2850,7 +2867,7 @@ uint8 ZoneDatabase::RaidGroupCount(uint32 raidid, uint32 groupid) {
|
|||||||
int64 ZoneDatabase::GetBlockedSpellsCount(uint32 zone_id)
|
int64 ZoneDatabase::GetBlockedSpellsCount(uint32 zone_id)
|
||||||
{
|
{
|
||||||
return BlockedSpellsRepository::Count(
|
return BlockedSpellsRepository::Count(
|
||||||
database,
|
*this,
|
||||||
fmt::format(
|
fmt::format(
|
||||||
"zoneid = {} {}",
|
"zoneid = {} {}",
|
||||||
zone_id,
|
zone_id,
|
||||||
@@ -2864,7 +2881,7 @@ bool ZoneDatabase::LoadBlockedSpells(int64 blocked_spells_count, ZoneSpellsBlock
|
|||||||
LogInfo("Loading Blocked Spells from database for {} ({}).", zone_store.GetZoneName(zone_id, true), zone_id);
|
LogInfo("Loading Blocked Spells from database for {} ({}).", zone_store.GetZoneName(zone_id, true), zone_id);
|
||||||
|
|
||||||
const auto& l = BlockedSpellsRepository::GetWhere(
|
const auto& l = BlockedSpellsRepository::GetWhere(
|
||||||
database,
|
*this,
|
||||||
fmt::format(
|
fmt::format(
|
||||||
"zoneid = {} {} ORDER BY id ASC",
|
"zoneid = {} {} ORDER BY id ASC",
|
||||||
zone_id,
|
zone_id,
|
||||||
|
|||||||
+1
-1
@@ -529,7 +529,7 @@ public:
|
|||||||
bool CreateSpawn2(Client *c, uint32 spawngroup, const char* zone, const glm::vec4& position, uint32 respawn, uint32 variance, uint16 condition, int16 cond_value);
|
bool CreateSpawn2(Client *c, uint32 spawngroup, const char* zone, const glm::vec4& position, uint32 respawn, uint32 variance, uint16 condition, int16 cond_value);
|
||||||
void UpdateRespawnTime(uint32 id, uint16 instance_id,uint32 timeleft);
|
void UpdateRespawnTime(uint32 id, uint16 instance_id,uint32 timeleft);
|
||||||
uint32 GetSpawnTimeLeft(uint32 id, uint16 instance_id);
|
uint32 GetSpawnTimeLeft(uint32 id, uint16 instance_id);
|
||||||
void UpdateSpawn2Status(uint32 id, uint8 new_status);
|
void UpdateSpawn2Status(uint32 id, uint8 new_status, uint32 instance_id);
|
||||||
|
|
||||||
/* Grids/Paths */
|
/* Grids/Paths */
|
||||||
uint32 GetFreeGrid(uint16 zoneid);
|
uint32 GetFreeGrid(uint16 zoneid);
|
||||||
|
|||||||
+2
-2
@@ -811,7 +811,7 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z
|
|||||||
Entity* entity = entity_list.GetID(entity_id_being_looted);
|
Entity* entity = entity_list.GetID(entity_id_being_looted);
|
||||||
if (entity == 0)
|
if (entity == 0)
|
||||||
{
|
{
|
||||||
Message(Chat::Red, "Error: OP_EndLootRequest: Corpse not found (ent = 0)");
|
LogError("OP_EndLootRequest: Corpse with id of {} not found for {}.", entity_id_being_looted, GetCleanName());
|
||||||
if (ClientVersion() >= EQ::versions::ClientVersion::SoD)
|
if (ClientVersion() >= EQ::versions::ClientVersion::SoD)
|
||||||
Corpse::SendEndLootErrorPacket(this);
|
Corpse::SendEndLootErrorPacket(this);
|
||||||
else
|
else
|
||||||
@@ -819,7 +819,7 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z
|
|||||||
}
|
}
|
||||||
else if (!entity->IsCorpse())
|
else if (!entity->IsCorpse())
|
||||||
{
|
{
|
||||||
Message(Chat::Red, "Error: OP_EndLootRequest: Corpse not found (!entity->IsCorpse())");
|
LogError("OP_EndLootRequest: Entity with id of {} was not corpse for {}.", entity_id_being_looted, GetCleanName());
|
||||||
Corpse::SendLootReqErrorPacket(this);
|
Corpse::SendLootReqErrorPacket(this);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user