mirror of
https://github.com/EQEmu/Server.git
synced 2026-01-06 05:13:52 +00:00
Compare commits
6 Commits
5d68659cea
...
bbc331485c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bbc331485c | ||
|
|
0815aea6fd | ||
|
|
76f8f1fb95 | ||
|
|
7acff368ea | ||
|
|
012c54c277 | ||
|
|
9b3f9f356d |
4
.github/workflows/build.yaml
vendored
4
.github/workflows/build.yaml
vendored
@ -23,7 +23,7 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y build-essential ninja-build ccache libmariadb-dev libmariadb-dev-compat libboost-all-dev libperl-dev liblua5.1-0-dev libluajit-5.1-dev zlib1g-dev uuid-dev libssl-dev libsodium-dev libmbedtls-dev
|
sudo apt-get install -y build-essential ninja-build ccache
|
||||||
|
|
||||||
- name: Configure
|
- name: Configure
|
||||||
run: |
|
run: |
|
||||||
@ -74,7 +74,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: cmake --build build --config RelWithDebInfo --target ALL_BUILD -- /m
|
run: cmake --build build --parallel --config RelWithDebInfo --target ALL_BUILD -- /m
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
working-directory: build
|
working-directory: build
|
||||||
|
|||||||
@ -16,9 +16,6 @@ set(common_sources
|
|||||||
database/database_dump_service.cpp
|
database/database_dump_service.cpp
|
||||||
database.cpp
|
database.cpp
|
||||||
database_instances.cpp
|
database_instances.cpp
|
||||||
database/database_update_manifest.cpp
|
|
||||||
database/database_update_manifest_custom.cpp
|
|
||||||
database/database_update_manifest_bots.cpp
|
|
||||||
database/database_update.cpp
|
database/database_update.cpp
|
||||||
data_bucket.cpp
|
data_bucket.cpp
|
||||||
dbcore.cpp
|
dbcore.cpp
|
||||||
@ -557,6 +554,9 @@ set(common_headers
|
|||||||
database.h
|
database.h
|
||||||
database_schema.h
|
database_schema.h
|
||||||
database/database_update.h
|
database/database_update.h
|
||||||
|
database/database_update_manifest.h
|
||||||
|
database/database_update_manifest_custom.h
|
||||||
|
database/database_update_manifest_bots.h
|
||||||
data_bucket.cpp
|
data_bucket.cpp
|
||||||
dbcore.h
|
dbcore.h
|
||||||
deity.h
|
deity.h
|
||||||
|
|||||||
@ -5,11 +5,10 @@
|
|||||||
#include "../strings.h"
|
#include "../strings.h"
|
||||||
#include "../rulesys.h"
|
#include "../rulesys.h"
|
||||||
#include "../http/httplib.h"
|
#include "../http/httplib.h"
|
||||||
|
|
||||||
#include "database_update_manifest.cpp"
|
|
||||||
#include "database_update_manifest_custom.cpp"
|
|
||||||
#include "database_update_manifest_bots.cpp"
|
|
||||||
#include "database_dump_service.h"
|
#include "database_dump_service.h"
|
||||||
|
#include "database_update_manifest.h"
|
||||||
|
#include "database_update_manifest_custom.h"
|
||||||
|
#include "database_update_manifest_bots.h"
|
||||||
|
|
||||||
constexpr int BREAK_LENGTH = 70;
|
constexpr int BREAK_LENGTH = 70;
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#include "database_update.h"
|
#pragma once
|
||||||
|
|
||||||
std::vector<ManifestEntry> manifest_entries = {
|
std::vector<ManifestEntry> manifest_entries = {
|
||||||
ManifestEntry{
|
ManifestEntry{
|
||||||
@ -1,4 +1,4 @@
|
|||||||
#include "database_update.h"
|
#pragma once
|
||||||
|
|
||||||
std::vector<ManifestEntry> bot_manifest_entries = {
|
std::vector<ManifestEntry> bot_manifest_entries = {
|
||||||
ManifestEntry{
|
ManifestEntry{
|
||||||
@ -1,4 +1,4 @@
|
|||||||
#include "database_update.h"
|
#pragma once
|
||||||
|
|
||||||
std::vector<ManifestEntry> manifest_entries_custom = {
|
std::vector<ManifestEntry> manifest_entries_custom = {
|
||||||
ManifestEntry{
|
ManifestEntry{
|
||||||
@ -1,8 +1,6 @@
|
|||||||
module should-release
|
module should-release
|
||||||
|
|
||||||
go 1.23.0
|
go 1.24.0
|
||||||
|
|
||||||
toolchain go1.23.5
|
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/google/go-github/v41 v41.0.0
|
github.com/google/go-github/v41 v41.0.0
|
||||||
@ -11,5 +9,5 @@ require (
|
|||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/google/go-querystring v1.1.0 // indirect
|
github.com/google/go-querystring v1.1.0 // indirect
|
||||||
golang.org/x/crypto v0.36.0 // indirect
|
golang.org/x/crypto v0.45.0 // indirect
|
||||||
)
|
)
|
||||||
|
|||||||
@ -10,8 +10,8 @@ github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD
|
|||||||
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
|
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
|
||||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||||
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||||
golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34=
|
golang.org/x/crypto v0.45.0 h1:jMBrvKuj23MTlT0bQEOBcAE0mjg8mK9RXFhRH6nyF3Q=
|
||||||
golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc=
|
golang.org/x/crypto v0.45.0/go.mod h1:XTGrrkGJve7CYK7J8PEww4aY7gM3qMCElcJQ8n8JdX4=
|
||||||
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
|
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
|
||||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||||
|
|||||||
@ -6,6 +6,25 @@ set(world_sources
|
|||||||
client.cpp
|
client.cpp
|
||||||
cliententry.cpp
|
cliententry.cpp
|
||||||
clientlist.cpp
|
clientlist.cpp
|
||||||
|
cli/cli_database_concurrency.cpp
|
||||||
|
cli/cli_bots_enable.cpp
|
||||||
|
cli/cli_bots_disable.cpp
|
||||||
|
cli/cli_mercs_enable.cpp
|
||||||
|
cli/cli_mercs_disable.cpp
|
||||||
|
cli/cli_copy_character.cpp
|
||||||
|
cli/cli_database_updates.cpp
|
||||||
|
cli/cli_database_dump.cpp
|
||||||
|
cli/cli_database_get_schema.cpp
|
||||||
|
cli/cli_database_set_account_status.cpp
|
||||||
|
cli/cli_database_version.cpp
|
||||||
|
cli/cli_test.cpp
|
||||||
|
cli/cli_test_colors.cpp
|
||||||
|
cli/cli_test_expansion.cpp
|
||||||
|
cli/cli_test_repository.cpp
|
||||||
|
cli/cli_test_repository_2.cpp
|
||||||
|
cli/cli_test_string_benchmark.cpp
|
||||||
|
cli/cli_version.cpp
|
||||||
|
cli/cli_etl_get_settings.cpp
|
||||||
console.cpp
|
console.cpp
|
||||||
dynamic_zone.cpp
|
dynamic_zone.cpp
|
||||||
dynamic_zone_manager.cpp
|
dynamic_zone_manager.cpp
|
||||||
@ -68,7 +87,29 @@ set(world_headers
|
|||||||
world_event_scheduler.h
|
world_event_scheduler.h
|
||||||
zonelist.h
|
zonelist.h
|
||||||
zoneserver.h
|
zoneserver.h
|
||||||
)
|
)
|
||||||
|
|
||||||
|
source_group(cli FILES
|
||||||
|
cli/cli_database_concurrency.cpp
|
||||||
|
cli/cli_bots_enable.cpp
|
||||||
|
cli/cli_bots_disable.cpp
|
||||||
|
cli/cli_mercs_enable.cpp
|
||||||
|
cli/cli_mercs_disable.cpp
|
||||||
|
cli/cli_copy_character.cpp
|
||||||
|
cli/cli_database_updates.cpp
|
||||||
|
cli/cli_database_dump.cpp
|
||||||
|
cli/cli_database_get_schema.cpp
|
||||||
|
cli/cli_database_set_account_status.cpp
|
||||||
|
cli/cli_database_version.cpp
|
||||||
|
cli/cli_test.cpp
|
||||||
|
cli/cli_test_colors.cpp
|
||||||
|
cli/cli_test_expansion.cpp
|
||||||
|
cli/cli_test_repository.cpp
|
||||||
|
cli/cli_test_repository_2.cpp
|
||||||
|
cli/cli_test_string_benchmark.cpp
|
||||||
|
cli/cli_version.cpp
|
||||||
|
cli/cli_etl_get_settings.cpp
|
||||||
|
)
|
||||||
|
|
||||||
add_executable(world ${world_sources} ${world_headers})
|
add_executable(world ${world_sources} ${world_headers})
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#include "../world_server_cli.h"
|
||||||
#include "../worlddb.h"
|
#include "../worlddb.h"
|
||||||
#include "../../common/database_schema.h"
|
#include "../../common/database_schema.h"
|
||||||
|
|
||||||
@ -1,3 +1,4 @@
|
|||||||
|
#include "../world_server_cli.h"
|
||||||
#include "../worlddb.h"
|
#include "../worlddb.h"
|
||||||
#include "../../common/rulesys.h"
|
#include "../../common/rulesys.h"
|
||||||
|
|
||||||
@ -1,3 +1,5 @@
|
|||||||
|
#include "../world_server_cli.h"
|
||||||
|
#include "../../common/eqemu_logsys.h"
|
||||||
#include "../../common/eqemu_logsys_log_aliases.h"
|
#include "../../common/eqemu_logsys_log_aliases.h"
|
||||||
#include "../worlddb.h"
|
#include "../worlddb.h"
|
||||||
|
|
||||||
@ -1,4 +1,5 @@
|
|||||||
#include <thread>
|
#include <thread>
|
||||||
|
#include "../world_server_cli.h"
|
||||||
#include "../../common/repositories/zone_repository.h"
|
#include "../../common/repositories/zone_repository.h"
|
||||||
#include "../../common/eqemu_config.h"
|
#include "../../common/eqemu_config.h"
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
@ -1,3 +1,4 @@
|
|||||||
|
#include "../world_server_cli.h"
|
||||||
#include "../../common/database/database_dump_service.h"
|
#include "../../common/database/database_dump_service.h"
|
||||||
|
|
||||||
void WorldserverCLI::DatabaseDump(int argc, char **argv, argh::parser &cmd, std::string &description)
|
void WorldserverCLI::DatabaseDump(int argc, char **argv, argh::parser &cmd, std::string &description)
|
||||||
@ -1,3 +1,4 @@
|
|||||||
|
#include "../world_server_cli.h"
|
||||||
#include "../../common/database_schema.h"
|
#include "../../common/database_schema.h"
|
||||||
#include "../../common/json/json.h"
|
#include "../../common/json/json.h"
|
||||||
|
|
||||||
@ -1,3 +1,4 @@
|
|||||||
|
#include "../world_server_cli.h"
|
||||||
#include "../worlddb.h"
|
#include "../worlddb.h"
|
||||||
|
|
||||||
void WorldserverCLI::DatabaseSetAccountStatus(int argc, char **argv, argh::parser &cmd, std::string &description)
|
void WorldserverCLI::DatabaseSetAccountStatus(int argc, char **argv, argh::parser &cmd, std::string &description)
|
||||||
@ -1,3 +1,5 @@
|
|||||||
|
#include "../world_server_cli.h"
|
||||||
|
#include "../worlddb.h"
|
||||||
#include "../../common/database/database_update.h"
|
#include "../../common/database/database_update.h"
|
||||||
|
|
||||||
void WorldserverCLI::DatabaseUpdates(int argc, char **argv, argh::parser &cmd, std::string &description)
|
void WorldserverCLI::DatabaseUpdates(int argc, char **argv, argh::parser &cmd, std::string &description)
|
||||||
@ -1,3 +1,4 @@
|
|||||||
|
#include "../world_server_cli.h"
|
||||||
#include "../../common/version.h"
|
#include "../../common/version.h"
|
||||||
#include "../../common/json/json.h"
|
#include "../../common/json/json.h"
|
||||||
#include "../../common/rulesys.h"
|
#include "../../common/rulesys.h"
|
||||||
@ -1,3 +1,5 @@
|
|||||||
|
#include "../world_server_cli.h"
|
||||||
|
#include "../worlddb.h"
|
||||||
#include "../../common/events/player_event_logs.h"
|
#include "../../common/events/player_event_logs.h"
|
||||||
#include "../../common/json/json.h"
|
#include "../../common/json/json.h"
|
||||||
|
|
||||||
@ -1,3 +1,4 @@
|
|||||||
|
#include "../world_server_cli.h"
|
||||||
#include "../worlddb.h"
|
#include "../worlddb.h"
|
||||||
#include "../../common/database_schema.h"
|
#include "../../common/database_schema.h"
|
||||||
|
|
||||||
@ -1,3 +1,4 @@
|
|||||||
|
#include "../world_server_cli.h"
|
||||||
#include "../worlddb.h"
|
#include "../worlddb.h"
|
||||||
#include "../../common/database_schema.h"
|
#include "../../common/database_schema.h"
|
||||||
|
|
||||||
@ -1,3 +1,4 @@
|
|||||||
|
#include "../world_server_cli.h"
|
||||||
#include <cereal/archives/json.hpp>
|
#include <cereal/archives/json.hpp>
|
||||||
#include <cereal/types/vector.hpp>
|
#include <cereal/types/vector.hpp>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
@ -1,3 +1,4 @@
|
|||||||
|
#include "../world_server_cli.h"
|
||||||
#include "../../common/zone_store.h"
|
#include "../../common/zone_store.h"
|
||||||
#include "../../common/termcolor/rang.hpp"
|
#include "../../common/termcolor/rang.hpp"
|
||||||
|
|
||||||
@ -1,3 +1,4 @@
|
|||||||
|
#include "../world_server_cli.h"
|
||||||
#include "../../common/rulesys.h"
|
#include "../../common/rulesys.h"
|
||||||
#include "../../common/repositories/content_flags_repository.h"
|
#include "../../common/repositories/content_flags_repository.h"
|
||||||
#include "../../common/content/world_content_service.h"
|
#include "../../common/content/world_content_service.h"
|
||||||
@ -1,3 +1,4 @@
|
|||||||
|
#include "../world_server_cli.h"
|
||||||
#include "../../common/repositories/instance_list_repository.h"
|
#include "../../common/repositories/instance_list_repository.h"
|
||||||
#include "../worlddb.h"
|
#include "../worlddb.h"
|
||||||
|
|
||||||
@ -1,3 +1,5 @@
|
|||||||
|
#include "../world_server_cli.h"
|
||||||
|
#include "../worlddb.h"
|
||||||
#include "../../common/repositories/zone_repository.h"
|
#include "../../common/repositories/zone_repository.h"
|
||||||
|
|
||||||
void WorldserverCLI::TestRepository2(int argc, char **argv, argh::parser &cmd, std::string &description)
|
void WorldserverCLI::TestRepository2(int argc, char **argv, argh::parser &cmd, std::string &description)
|
||||||
@ -1,3 +1,4 @@
|
|||||||
|
#include "../world_server_cli.h"
|
||||||
#include <cereal/archives/json.hpp>
|
#include <cereal/archives/json.hpp>
|
||||||
#include <cereal/types/vector.hpp>
|
#include <cereal/types/vector.hpp>
|
||||||
#include "../../common/events/player_events.h"
|
#include "../../common/events/player_events.h"
|
||||||
@ -1,3 +1,4 @@
|
|||||||
|
#include "../world_server_cli.h"
|
||||||
#include "../../common/json/json.h"
|
#include "../../common/json/json.h"
|
||||||
#include "../../common/version.h"
|
#include "../../common/version.h"
|
||||||
|
|
||||||
@ -39,22 +39,3 @@ void WorldserverCLI::CommandHandler(int argc, char **argv)
|
|||||||
EQEmuCommand::HandleMenu(function_map, cmd, argc, argv);
|
EQEmuCommand::HandleMenu(function_map, cmd, argc, argv);
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "cli/database_concurrency.cpp"
|
|
||||||
#include "cli/bots_enable.cpp"
|
|
||||||
#include "cli/bots_disable.cpp"
|
|
||||||
#include "cli/mercs_enable.cpp"
|
|
||||||
#include "cli/mercs_disable.cpp"
|
|
||||||
#include "cli/copy_character.cpp"
|
|
||||||
#include "cli/database_updates.cpp"
|
|
||||||
#include "cli/database_dump.cpp"
|
|
||||||
#include "cli/database_get_schema.cpp"
|
|
||||||
#include "cli/database_set_account_status.cpp"
|
|
||||||
#include "cli/database_version.cpp"
|
|
||||||
#include "cli/test.cpp"
|
|
||||||
#include "cli/test_colors.cpp"
|
|
||||||
#include "cli/test_expansion.cpp"
|
|
||||||
#include "cli/test_repository.cpp"
|
|
||||||
#include "cli/test_repository_2.cpp"
|
|
||||||
#include "cli/test_string_benchmark.cpp"
|
|
||||||
#include "cli/version.cpp"
|
|
||||||
#include "cli/etl_get_settings.cpp"
|
|
||||||
|
|||||||
@ -21,6 +21,13 @@ set(zone_sources
|
|||||||
client_mods.cpp
|
client_mods.cpp
|
||||||
client_packet.cpp
|
client_packet.cpp
|
||||||
client_process.cpp
|
client_process.cpp
|
||||||
|
cli/cli_benchmark_databuckets.cpp
|
||||||
|
cli/cli_sidecar_serve_http.cpp
|
||||||
|
cli/tests/cli_test_util.cpp
|
||||||
|
cli/tests/cli_databuckets.cpp
|
||||||
|
cli/tests/cli_npc_handins.cpp
|
||||||
|
cli/tests/cli_npc_handins_multiquest.cpp
|
||||||
|
cli/tests/cli_zone_state.cpp
|
||||||
combat_record.cpp
|
combat_record.cpp
|
||||||
corpse.cpp
|
corpse.cpp
|
||||||
doors.cpp
|
doors.cpp
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <random>
|
#include <random>
|
||||||
|
#include "../zone_cli.h"
|
||||||
|
#include "../../common/cli/eqemu_command_handler.h"
|
||||||
#include "../../common/http/httplib.h"
|
#include "../../common/http/httplib.h"
|
||||||
#include "../../common/eqemu_logsys.h"
|
#include "../../common/eqemu_logsys.h"
|
||||||
#include "../sidecar_api/sidecar_api.h"
|
#include "../sidecar_api/sidecar_api.h"
|
||||||
@ -1,3 +1,5 @@
|
|||||||
|
#include "../zone_cli.h"
|
||||||
|
#include "../../common/cli/eqemu_command_handler.h"
|
||||||
#include "../../common/http/httplib.h"
|
#include "../../common/http/httplib.h"
|
||||||
#include "../../common/eqemu_logsys.h"
|
#include "../../common/eqemu_logsys.h"
|
||||||
#include "../sidecar_api/sidecar_api.h"
|
#include "../sidecar_api/sidecar_api.h"
|
||||||
@ -1,3 +1,5 @@
|
|||||||
|
#include "../../zone_cli.h"
|
||||||
|
#include "../../common/cli/eqemu_command_handler.h"
|
||||||
#include "../../common/http/httplib.h"
|
#include "../../common/http/httplib.h"
|
||||||
#include "../../common/eqemu_logsys.h"
|
#include "../../common/eqemu_logsys.h"
|
||||||
#include "../../common/platform.h"
|
#include "../../common/platform.h"
|
||||||
@ -7,6 +9,10 @@
|
|||||||
|
|
||||||
extern Zone* zone;
|
extern Zone* zone;
|
||||||
|
|
||||||
|
void RunTest(const std::string& test_name, const std::string& expected, const std::string& actual);
|
||||||
|
void RunTest(const std::string& test_name, bool expected, bool actual);
|
||||||
|
void RunTest(const std::string& test_name, int expected, int actual);
|
||||||
|
|
||||||
void ZoneCLI::TestDataBuckets(int argc, char** argv, argh::parser& cmd, std::string& description)
|
void ZoneCLI::TestDataBuckets(int argc, char** argv, argh::parser& cmd, std::string& description)
|
||||||
{
|
{
|
||||||
if (cmd[{"-h", "--help"}]) {
|
if (cmd[{"-h", "--help"}]) {
|
||||||
@ -1,3 +1,5 @@
|
|||||||
|
#include "../../zone_cli.h"
|
||||||
|
#include "../../common/cli/eqemu_command_handler.h"
|
||||||
#include "../../common/http/httplib.h"
|
#include "../../common/http/httplib.h"
|
||||||
#include "../../common/eqemu_logsys.h"
|
#include "../../common/eqemu_logsys.h"
|
||||||
#include "../../common/platform.h"
|
#include "../../common/platform.h"
|
||||||
@ -9,6 +11,10 @@
|
|||||||
extern Zone *zone;
|
extern Zone *zone;
|
||||||
using json = nlohmann::json;
|
using json = nlohmann::json;
|
||||||
|
|
||||||
|
void RunTest(const std::string& test_name, const std::string& expected, const std::string& actual);
|
||||||
|
void RunTest(const std::string& test_name, bool expected, bool actual);
|
||||||
|
void RunTest(const std::string& test_name, int expected, int actual);
|
||||||
|
|
||||||
struct HandinEntry {
|
struct HandinEntry {
|
||||||
std::string item_id = "0";
|
std::string item_id = "0";
|
||||||
uint32 count = 0;
|
uint32 count = 0;
|
||||||
@ -1,3 +1,5 @@
|
|||||||
|
#include "../../zone_cli.h"
|
||||||
|
#include "../../common/cli/eqemu_command_handler.h"
|
||||||
#include "../../common/eqemu_logsys.h"
|
#include "../../common/eqemu_logsys.h"
|
||||||
#include "../../common/platform.h"
|
#include "../../common/platform.h"
|
||||||
#include "../../zone.h"
|
#include "../../zone.h"
|
||||||
@ -6,6 +8,10 @@
|
|||||||
|
|
||||||
extern Zone *zone;
|
extern Zone *zone;
|
||||||
|
|
||||||
|
void RunTest(const std::string& test_name, const std::string& expected, const std::string& actual);
|
||||||
|
void RunTest(const std::string& test_name, bool expected, bool actual);
|
||||||
|
void RunTest(const std::string& test_name, int expected, int actual);
|
||||||
|
|
||||||
void ZoneCLI::TestNpcHandinsMultiQuest(int argc, char **argv, argh::parser &cmd, std::string &description)
|
void ZoneCLI::TestNpcHandinsMultiQuest(int argc, char **argv, argh::parser &cmd, std::string &description)
|
||||||
{
|
{
|
||||||
if (cmd[{"-h", "--help"}]) {
|
if (cmd[{"-h", "--help"}]) {
|
||||||
@ -1,6 +1,6 @@
|
|||||||
#include "../../zone.h"
|
#include "../../zone.h"
|
||||||
|
|
||||||
inline void RunTest(const std::string &test_name, const std::string &expected, const std::string &actual)
|
void RunTest(const std::string &test_name, const std::string &expected, const std::string &actual)
|
||||||
{
|
{
|
||||||
if (expected == actual) {
|
if (expected == actual) {
|
||||||
std::cout << "[✅] " << test_name << " PASSED\n";
|
std::cout << "[✅] " << test_name << " PASSED\n";
|
||||||
@ -12,7 +12,7 @@ inline void RunTest(const std::string &test_name, const std::string &expected, c
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void RunTest(const std::string &test_name, bool expected, bool actual)
|
void RunTest(const std::string &test_name, bool expected, bool actual)
|
||||||
{
|
{
|
||||||
if (expected == actual) {
|
if (expected == actual) {
|
||||||
std::cout << "[✅] " << test_name << " PASSED\n";
|
std::cout << "[✅] " << test_name << " PASSED\n";
|
||||||
@ -25,7 +25,7 @@ inline void RunTest(const std::string &test_name, bool expected, bool actual)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void RunTest(const std::string &test_name, int expected, int actual)
|
void RunTest(const std::string &test_name, int expected, int actual)
|
||||||
{
|
{
|
||||||
if (expected == actual) {
|
if (expected == actual) {
|
||||||
std::cout << "[✅] " << test_name << " PASSED\n";
|
std::cout << "[✅] " << test_name << " PASSED\n";
|
||||||
@ -40,7 +40,7 @@ inline void RunTest(const std::string &test_name, int expected, int actual)
|
|||||||
|
|
||||||
extern Zone *zone;
|
extern Zone *zone;
|
||||||
|
|
||||||
inline void SetupZone(std::string zone_short_name, uint32 instance_id = 0) {
|
void SetupZone(std::string zone_short_name, uint32 instance_id = 0) {
|
||||||
EQEmuLogSys::Instance()->SilenceConsoleLogging();
|
EQEmuLogSys::Instance()->SilenceConsoleLogging();
|
||||||
|
|
||||||
EQEmuLogSys::Instance()->log_settings[Logs::ZoneState].log_to_console = std::getenv("DEBUG") ? 3 : 0;
|
EQEmuLogSys::Instance()->log_settings[Logs::ZoneState].log_to_console = std::getenv("DEBUG") ? 3 : 0;
|
||||||
@ -1,11 +1,18 @@
|
|||||||
extern Zone *zone;
|
#include "../../zone_cli.h"
|
||||||
|
#include "../../common/cli/eqemu_command_handler.h"
|
||||||
#include <cereal/archives/json.hpp>
|
#include <cereal/archives/json.hpp>
|
||||||
#include <cereal/types/map.hpp>
|
#include <cereal/types/map.hpp>
|
||||||
#include "../../common/repositories/npc_types_repository.h"
|
#include "../../common/repositories/npc_types_repository.h"
|
||||||
#include "../../corpse.h"
|
#include "../../corpse.h"
|
||||||
#include "../../../common/repositories/respawn_times_repository.h"
|
#include "../../../common/repositories/respawn_times_repository.h"
|
||||||
|
|
||||||
|
extern Zone* zone;
|
||||||
|
|
||||||
|
void RunTest(const std::string& test_name, const std::string& expected, const std::string& actual);
|
||||||
|
void RunTest(const std::string& test_name, bool expected, bool actual);
|
||||||
|
void RunTest(const std::string& test_name, int expected, int actual);
|
||||||
|
void SetupZone(std::string zone_short_name, uint32 instance_id = 0);
|
||||||
|
|
||||||
inline void ClearState()
|
inline void ClearState()
|
||||||
{
|
{
|
||||||
ZoneStateSpawnsRepository::DeleteWhere(database, "zone_id = 32 and instance_id = 0");
|
ZoneStateSpawnsRepository::DeleteWhere(database, "zone_id = 32 and instance_id = 0");
|
||||||
@ -1,18 +0,0 @@
|
|||||||
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
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
void SidecarApi::MapBestZController(const httplib::Request &req, httplib::Response &res)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -16,9 +16,39 @@ void CatchSidecarSignal(int sig_num)
|
|||||||
std::exit(0);
|
std::exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "log_handler.cpp"
|
void SidecarApi::RequestLogHandler(const httplib::Request& req, const httplib::Response& res)
|
||||||
#include "test_controller.cpp"
|
{
|
||||||
#include "map_best_z_controller.cpp"
|
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
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void SidecarApi::TestController(const httplib::Request& req, httplib::Response& res)
|
||||||
|
{
|
||||||
|
nlohmann::json j;
|
||||||
|
|
||||||
|
j["data"]["test"] = "test";
|
||||||
|
|
||||||
|
res.set_content(j.dump(), "application/json");
|
||||||
|
}
|
||||||
|
|
||||||
|
void SidecarApi::MapBestZController(const httplib::Request& req, httplib::Response& res)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
#include "../../common/file.h"
|
#include "../../common/file.h"
|
||||||
|
|
||||||
constexpr static int HTTP_RESPONSE_OK = 200;
|
constexpr static int HTTP_RESPONSE_OK = 200;
|
||||||
|
|||||||
@ -1,10 +0,0 @@
|
|||||||
#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");
|
|
||||||
}
|
|
||||||
@ -39,13 +39,3 @@ void ZoneCLI::CommandHandler(int argc, char **argv)
|
|||||||
EQEmuCommand::HandleMenu(function_map, cmd, argc, argv);
|
EQEmuCommand::HandleMenu(function_map, cmd, argc, argv);
|
||||||
}
|
}
|
||||||
|
|
||||||
// cli
|
|
||||||
#include "cli/benchmark_databuckets.cpp"
|
|
||||||
#include "cli/sidecar_serve_http.cpp"
|
|
||||||
|
|
||||||
// tests
|
|
||||||
#include "cli/tests/_test_util.cpp"
|
|
||||||
#include "cli/tests/databuckets.cpp"
|
|
||||||
#include "cli/tests/npc_handins.cpp"
|
|
||||||
#include "cli/tests/npc_handins_multiquest.cpp"
|
|
||||||
#include "cli/tests/zone_state.cpp"
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user