mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-22 20:33:01 +00:00
Compare commits
3 Commits
fix
...
xackery/test
| Author | SHA1 | Date | |
|---|---|---|---|
| f37e0c3214 | |||
| 01b498f9c2 | |||
| e0f9d9a8db |
Vendored
+116
@@ -0,0 +1,116 @@
|
||||
{
|
||||
//"testMate.cpp.test.executables": "{build,Build,BUILD,out,Out,OUT}/**/*{test,Test,TEST}*"
|
||||
"testMate.cpp.test.executables": "{build,Build,BUILD,out,Out,OUT}/**/*zone{test,Test,TEST}*",
|
||||
"cmake.configureSettings": {
|
||||
//"EQEMU_BUILD_SERVER": "ON",
|
||||
"EQEMU_BUILD_LUA": "ON"
|
||||
},
|
||||
"files.associations": {
|
||||
"chrono": "cpp",
|
||||
"functional": "cpp",
|
||||
"algorithm": "cpp",
|
||||
"any": "cpp",
|
||||
"array": "cpp",
|
||||
"atomic": "cpp",
|
||||
"bit": "cpp",
|
||||
"bitset": "cpp",
|
||||
"cctype": "cpp",
|
||||
"cfenv": "cpp",
|
||||
"charconv": "cpp",
|
||||
"cinttypes": "cpp",
|
||||
"clocale": "cpp",
|
||||
"cmath": "cpp",
|
||||
"codecvt": "cpp",
|
||||
"compare": "cpp",
|
||||
"complex": "cpp",
|
||||
"concepts": "cpp",
|
||||
"condition_variable": "cpp",
|
||||
"coroutine": "cpp",
|
||||
"csetjmp": "cpp",
|
||||
"csignal": "cpp",
|
||||
"cstdarg": "cpp",
|
||||
"cstddef": "cpp",
|
||||
"cstdint": "cpp",
|
||||
"cstdio": "cpp",
|
||||
"cstdlib": "cpp",
|
||||
"cstring": "cpp",
|
||||
"ctime": "cpp",
|
||||
"cwchar": "cpp",
|
||||
"cwctype": "cpp",
|
||||
"deque": "cpp",
|
||||
"exception": "cpp",
|
||||
"execution": "cpp",
|
||||
"resumable": "cpp",
|
||||
"filesystem": "cpp",
|
||||
"format": "cpp",
|
||||
"forward_list": "cpp",
|
||||
"fstream": "cpp",
|
||||
"future": "cpp",
|
||||
"initializer_list": "cpp",
|
||||
"iomanip": "cpp",
|
||||
"ios": "cpp",
|
||||
"iosfwd": "cpp",
|
||||
"iostream": "cpp",
|
||||
"istream": "cpp",
|
||||
"iterator": "cpp",
|
||||
"limits": "cpp",
|
||||
"list": "cpp",
|
||||
"locale": "cpp",
|
||||
"map": "cpp",
|
||||
"memory": "cpp",
|
||||
"memory_resource": "cpp",
|
||||
"mutex": "cpp",
|
||||
"new": "cpp",
|
||||
"numeric": "cpp",
|
||||
"optional": "cpp",
|
||||
"ostream": "cpp",
|
||||
"queue": "cpp",
|
||||
"random": "cpp",
|
||||
"ratio": "cpp",
|
||||
"regex": "cpp",
|
||||
"scoped_allocator": "cpp",
|
||||
"set": "cpp",
|
||||
"shared_mutex": "cpp",
|
||||
"source_location": "cpp",
|
||||
"sstream": "cpp",
|
||||
"stack": "cpp",
|
||||
"stdexcept": "cpp",
|
||||
"stop_token": "cpp",
|
||||
"streambuf": "cpp",
|
||||
"string": "cpp",
|
||||
"strstream": "cpp",
|
||||
"system_error": "cpp",
|
||||
"thread": "cpp",
|
||||
"tuple": "cpp",
|
||||
"type_traits": "cpp",
|
||||
"typeindex": "cpp",
|
||||
"typeinfo": "cpp",
|
||||
"unordered_map": "cpp",
|
||||
"unordered_set": "cpp",
|
||||
"utility": "cpp",
|
||||
"valarray": "cpp",
|
||||
"variant": "cpp",
|
||||
"vector": "cpp",
|
||||
"xfacet": "cpp",
|
||||
"xhash": "cpp",
|
||||
"xiosbase": "cpp",
|
||||
"xlocale": "cpp",
|
||||
"xlocbuf": "cpp",
|
||||
"xlocinfo": "cpp",
|
||||
"xlocmes": "cpp",
|
||||
"xlocmon": "cpp",
|
||||
"xlocnum": "cpp",
|
||||
"xloctime": "cpp",
|
||||
"xmemory": "cpp",
|
||||
"xstddef": "cpp",
|
||||
"xstring": "cpp",
|
||||
"xtr1common": "cpp",
|
||||
"xtree": "cpp",
|
||||
"xutility": "cpp",
|
||||
"*.tcc": "cpp",
|
||||
"string_view": "cpp",
|
||||
"rope": "cpp",
|
||||
"slist": "cpp",
|
||||
"*.ipp": "cpp"
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -127,7 +127,7 @@ OPTION(EQEMU_COMMANDS_LOGGING "Enable GM Command logs" ON)
|
||||
OPTION(EQEMU_BUILD_SERVER "Build the game server." ON)
|
||||
OPTION(EQEMU_BUILD_LOGIN "Build the login server." ON)
|
||||
OPTION(EQEMU_BUILD_HC "Build the headless client." OFF)
|
||||
OPTION(EQEMU_BUILD_TESTS "Build utility tests." OFF)
|
||||
OPTION(EQEMU_BUILD_TESTS "Build zone tests." ON)
|
||||
OPTION(EQEMU_BUILD_CLIENT_FILES "Build Client Import/Export Data Programs." ON)
|
||||
OPTION(EQEMU_PREFER_LUA "Build with normal Lua even if LuaJIT is found." OFF)
|
||||
|
||||
@@ -442,6 +442,7 @@ ENDIF(EQEMU_BUILD_HC)
|
||||
|
||||
IF(EQEMU_BUILD_TESTS)
|
||||
ADD_SUBDIRECTORY(tests)
|
||||
ADD_SUBDIRECTORY(test)
|
||||
ENDIF(EQEMU_BUILD_TESTS)
|
||||
|
||||
IF(EQEMU_BUILD_CLIENT_FILES)
|
||||
|
||||
@@ -469,7 +469,7 @@ void EQEmuLogSys::Out(
|
||||
std::string prefix;
|
||||
|
||||
if (RuleB(Logging, PrintFileFunctionAndLine)) {
|
||||
prefix = fmt::format("[{0}::{1}:{2}] ", base_file_name(file), func, line);
|
||||
prefix = fmt::format("[{0}:{1}] ", base_file_name(file), line);
|
||||
}
|
||||
|
||||
va_list args;
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RunSettings>
|
||||
<Catch2Adapter>
|
||||
<FilenameFilter>^zonetest</FilenameFilter>
|
||||
</Catch2Adapter>
|
||||
</RunSettings>
|
||||
@@ -0,0 +1,597 @@
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 3.2)
|
||||
|
||||
SET(zonetest_sources
|
||||
../zone/aa.cpp
|
||||
../zone/aa_ability.cpp
|
||||
../zone/aggro.cpp
|
||||
../zone/aggromanager.cpp
|
||||
../zone/api_service.cpp
|
||||
../zone/attack.cpp
|
||||
../zone/aura.cpp
|
||||
../zone/beacon.cpp
|
||||
../zone/bonuses.cpp
|
||||
../zone/bot.cpp
|
||||
../zone/bot_command.cpp
|
||||
../zone/bot_database.cpp
|
||||
../zone/botspellsai.cpp
|
||||
../zone/cheat_manager.cpp
|
||||
../zone/client.cpp
|
||||
../zone/client_mods.cpp
|
||||
../zone/client_packet.cpp
|
||||
../zone/client_process.cpp
|
||||
../zone/command.cpp
|
||||
../zone/corpse.cpp
|
||||
../zone/data_bucket.cpp
|
||||
../zone/doors.cpp
|
||||
../zone/dialogue_window.cpp
|
||||
../zone/dynamic_zone.cpp
|
||||
../zone/effects.cpp
|
||||
../zone/embparser.cpp
|
||||
../zone/embparser_api.cpp
|
||||
../zone/embperl.cpp
|
||||
../zone/embxs.cpp
|
||||
../zone/encounter.cpp
|
||||
../zone/entity.cpp
|
||||
../zone/exp.cpp
|
||||
../zone/expedition.cpp
|
||||
../zone/expedition_database.cpp
|
||||
../zone/expedition_request.cpp
|
||||
../zone/fastmath.cpp
|
||||
../zone/fearpath.cpp
|
||||
../zone/forage.cpp
|
||||
../zone/groups.cpp
|
||||
../zone/guild.cpp
|
||||
../zone/guild_mgr.cpp
|
||||
../zone/hate_list.cpp
|
||||
../zone/heal_rotation.cpp
|
||||
../zone/horse.cpp
|
||||
../zone/inventory.cpp
|
||||
../zone/loottables.cpp
|
||||
../zone/lua_bot.cpp
|
||||
../zone/lua_bit.cpp
|
||||
../zone/lua_corpse.cpp
|
||||
../zone/lua_client.cpp
|
||||
../zone/lua_door.cpp
|
||||
../zone/lua_encounter.cpp
|
||||
../zone/lua_entity.cpp
|
||||
../zone/lua_entity_list.cpp
|
||||
../zone/lua_expedition.cpp
|
||||
../zone/lua_general.cpp
|
||||
../zone/lua_group.cpp
|
||||
../zone/lua_hate_list.cpp
|
||||
../zone/lua_inventory.cpp
|
||||
../zone/lua_item.cpp
|
||||
../zone/lua_iteminst.cpp
|
||||
../zone/lua_mob.cpp
|
||||
../zone/lua_mod.cpp
|
||||
../zone/lua_npc.cpp
|
||||
../zone/lua_object.cpp
|
||||
../zone/lua_packet.cpp
|
||||
../zone/lua_parser.cpp
|
||||
../zone/lua_parser_events.cpp
|
||||
../zone/lua_raid.cpp
|
||||
../zone/lua_spawn.cpp
|
||||
../zone/lua_spell.cpp
|
||||
../zone/lua_stat_bonuses.cpp
|
||||
../zone/embperl.cpp
|
||||
../zone/embxs.cpp
|
||||
../zone/entity.cpp
|
||||
../zone/exp.cpp
|
||||
../zone/fearpath.cpp
|
||||
../zone/forage.cpp
|
||||
../zone/global_loot_manager.cpp
|
||||
../zone/groups.cpp
|
||||
../zone/guild.cpp
|
||||
../zone/guild_mgr.cpp
|
||||
../zone/hate_list.cpp
|
||||
../zone/horse.cpp
|
||||
../zone/inventory.cpp
|
||||
../zone/loottables.cpp
|
||||
main.cpp
|
||||
../zone/map.cpp
|
||||
../zone/merc.cpp
|
||||
../zone/mob.cpp
|
||||
../zone/mob_ai.cpp
|
||||
../zone/mob_appearance.cpp
|
||||
../zone/mob_movement_manager.cpp
|
||||
../zone/mob_info.cpp
|
||||
../zone/mod_functions.cpp
|
||||
../zone/npc.cpp
|
||||
../zone/npc_ai.cpp
|
||||
../zone/npc_scale_manager.cpp
|
||||
../zone/object.cpp
|
||||
../zone/oriented_bounding_box.cpp
|
||||
../zone/pathfinder_interface.cpp
|
||||
../zone/pathfinder_nav_mesh.cpp
|
||||
../zone/pathfinder_null.cpp
|
||||
../zone/pathing.cpp
|
||||
../zone/perl_bot.cpp
|
||||
../zone/perl_client.cpp
|
||||
../zone/perl_doors.cpp
|
||||
../zone/perl_entity.cpp
|
||||
../zone/perl_expedition.cpp
|
||||
../zone/perl_groups.cpp
|
||||
../zone/perl_hateentry.cpp
|
||||
../zone/perl_inventory.cpp
|
||||
../zone/perl_mob.cpp
|
||||
../zone/perl_npc.cpp
|
||||
../zone/perl_object.cpp
|
||||
../zone/perl_perlpacket.cpp
|
||||
../zone/perl_player_corpse.cpp
|
||||
../zone/perl_questitem.cpp
|
||||
../zone/perl_raids.cpp
|
||||
../zone/perl_spell.cpp
|
||||
../zone/perlpacket.cpp
|
||||
../zone/petitions.cpp
|
||||
../zone/pets.cpp
|
||||
../zone/position.cpp
|
||||
../zone/qglobals.cpp
|
||||
../zone/queryserv.cpp
|
||||
../zone/questmgr.cpp
|
||||
../zone/quest_parser_collection.cpp
|
||||
../zone/raids.cpp
|
||||
../zone/raycast_mesh.cpp
|
||||
../zone/shared_task_zone_messaging.cpp
|
||||
../zone/spawn2.cpp
|
||||
../zone/spawn2.h
|
||||
../zone/spawngroup.cpp
|
||||
../zone/special_attacks.cpp
|
||||
../zone/spell_effects.cpp
|
||||
../zone/spells.cpp
|
||||
../zone/task_client_state.cpp
|
||||
../zone/task_goal_list_manager.cpp
|
||||
../zone/task_manager.cpp
|
||||
../zone/task_proximity_manager.cpp
|
||||
../zone/tasks.cpp
|
||||
../zone/titles.cpp
|
||||
../zone/tradeskills.cpp
|
||||
../zone/trading.cpp
|
||||
../zone/trap.cpp
|
||||
../zone/tribute.cpp
|
||||
../zone/tune.cpp
|
||||
../zone/water_map.cpp
|
||||
../zone/water_map_v1.cpp
|
||||
../zone/water_map_v2.cpp
|
||||
../zone/waypoints.cpp
|
||||
../zone/worldserver.cpp
|
||||
../zone/xtargetautohaters.cpp
|
||||
../zone/zone.cpp
|
||||
../zone/zone_config.cpp
|
||||
../zone/zonedb.cpp
|
||||
../zone/zone_event_scheduler.cpp
|
||||
../zone/zone_reload.cpp
|
||||
../zone/zone_store.cpp
|
||||
../zone/zoning.cpp
|
||||
)
|
||||
|
||||
SET(zonetest_headers
|
||||
catch.hpp
|
||||
../zone/aa.h
|
||||
../zone/aa_ability.h
|
||||
../zone/aggromanager.h
|
||||
../zone/api_service.h
|
||||
../zone/aura.h
|
||||
../zone/basic_functions.h
|
||||
../zone/beacon.h
|
||||
../zone/bot.h
|
||||
../zone/bot_command.h
|
||||
../zone/bot_database.h
|
||||
../zone/bot_structs.h
|
||||
../zone/cheat_manager.h
|
||||
../zone/client.h
|
||||
../zone/client_packet.h
|
||||
../zone/command.h
|
||||
../zone/common.h
|
||||
../zone/corpse.h
|
||||
../zone/data_bucket.h
|
||||
../zone/doors.h
|
||||
../zone/dialogue_window.h
|
||||
../zone/dynamic_zone.h
|
||||
../zone/embparser.h
|
||||
../zone/embperl.h
|
||||
../zone/embxs.h
|
||||
../zone/encounter.h
|
||||
../zone/entity.h
|
||||
../zone/errmsg.h
|
||||
../zone/event_codes.h
|
||||
../zone/expedition.h
|
||||
../zone/expedition_database.h
|
||||
../zone/expedition_request.h
|
||||
../zone/fastmath.h
|
||||
../zone/forage.h
|
||||
../zone/global_loot_manager.h
|
||||
../zone/groups.h
|
||||
../zone/guild_mgr.h
|
||||
../zone/hate_list.h
|
||||
../zone/heal_rotation.h
|
||||
../zone/horse.h
|
||||
../zone/lua_bot.h
|
||||
../zone/lua_bit.h
|
||||
../zone/lua_client.h
|
||||
../zone/lua_corpse.h
|
||||
../zone/lua_door.h
|
||||
../zone/lua_encounter.h
|
||||
../zone/lua_entity.h
|
||||
../zone/lua_entity_list.h
|
||||
../zone/lua_expedition.h
|
||||
../zone/lua_general.h
|
||||
../zone/lua_group.h
|
||||
../zone/lua_hate_list.h
|
||||
../zone/lua_inventory.h
|
||||
../zone/lua_item.h
|
||||
../zone/lua_iteminst.h
|
||||
../zone/lua_mob.h
|
||||
../zone/lua_mod.h
|
||||
../zone/lua_npc.h
|
||||
../zone/lua_object.h
|
||||
../zone/lua_packet.h
|
||||
../zone/lua_parser.h
|
||||
../zone/lua_parser_events.h
|
||||
../zone/lua_ptr.h
|
||||
../zone/lua_raid.h
|
||||
../zone/lua_spawn.h
|
||||
../zone/lua_spell.h
|
||||
../zone/lua_stat_bonuses.h
|
||||
../zone/map.h
|
||||
../zone/masterentity.h
|
||||
../zone/maxskill.h
|
||||
../zone/message.h
|
||||
../zone/merc.h
|
||||
../zone/mob.h
|
||||
../zone/mob_movement_manager.h
|
||||
../zone/npc.h
|
||||
../zone/npc_ai.h
|
||||
../zone/npc_scale_manager.h
|
||||
../zone/object.h
|
||||
../zone/oriented_bounding_box.h
|
||||
../zone/pathfinder_interface.h
|
||||
../zone/pathfinder_nav_mesh.h
|
||||
../zone/pathfinder_null.h
|
||||
../zone/perlpacket.h
|
||||
../zone/petitions.h
|
||||
../zone/pets.h
|
||||
../zone/position.h
|
||||
../zone/qglobals.h
|
||||
../zone/quest_interface.h
|
||||
../zone/queryserv.h
|
||||
../zone/quest_interface.h
|
||||
../zone/questmgr.h
|
||||
../zone/quest_parser_collection.h
|
||||
../zone/raids.h
|
||||
../zone/raycast_mesh.h
|
||||
../zone/skills.h
|
||||
../zone/shared_task_zone_messaging.h
|
||||
../zone/spawn2.cpp
|
||||
../zone/spawn2.h
|
||||
../zone/spawngroup.h
|
||||
../zone/string_ids.h
|
||||
../zone/task_client_state.h
|
||||
../zone/task_goal_list_manager.h
|
||||
../zone/task_manager.h
|
||||
../zone/task_proximity_manager.h
|
||||
../zone/tasks.h
|
||||
../zone/titles.h
|
||||
../zone/trap.h
|
||||
../zone/water_map.h
|
||||
../zone/water_map_v1.h
|
||||
../zone/water_map_v2.h
|
||||
../zone/worldserver.h
|
||||
../zone/xtargetautohaters.h
|
||||
../zone/zone.h
|
||||
../zone/zone_event_scheduler.h
|
||||
../zone/zone_config.h
|
||||
../zone/zonedb.h
|
||||
../zone/zonedump.h
|
||||
../zone/zone_reload.h
|
||||
../zone/zone_store.h
|
||||
)
|
||||
|
||||
SET(zonetest_gm_commands
|
||||
../zone/gm_commands/acceptrules.cpp
|
||||
../zone/gm_commands/advnpcspawn.cpp
|
||||
../zone/gm_commands/aggro.cpp
|
||||
../zone/gm_commands/aggrozone.cpp
|
||||
../zone/gm_commands/ai.cpp
|
||||
../zone/gm_commands/appearance.cpp
|
||||
../zone/gm_commands/appearanceeffects.cpp
|
||||
../zone/gm_commands/attack.cpp
|
||||
../zone/gm_commands/augmentitem.cpp
|
||||
../zone/gm_commands/ban.cpp
|
||||
../zone/gm_commands/beard.cpp
|
||||
../zone/gm_commands/beardcolor.cpp
|
||||
../zone/gm_commands/bestz.cpp
|
||||
../zone/gm_commands/bind.cpp
|
||||
../zone/gm_commands/camerashake.cpp
|
||||
../zone/gm_commands/castspell.cpp
|
||||
../zone/gm_commands/chat.cpp
|
||||
../zone/gm_commands/checklos.cpp
|
||||
../zone/gm_commands/copycharacter.cpp
|
||||
../zone/gm_commands/corpse.cpp
|
||||
../zone/gm_commands/corpsefix.cpp
|
||||
../zone/gm_commands/countitem.cpp
|
||||
../zone/gm_commands/cvs.cpp
|
||||
../zone/gm_commands/damage.cpp
|
||||
../zone/gm_commands/databuckets.cpp
|
||||
../zone/gm_commands/date.cpp
|
||||
../zone/gm_commands/dbspawn2.cpp
|
||||
../zone/gm_commands/delacct.cpp
|
||||
../zone/gm_commands/deletegraveyard.cpp
|
||||
../zone/gm_commands/delpetition.cpp
|
||||
../zone/gm_commands/depop.cpp
|
||||
../zone/gm_commands/depopzone.cpp
|
||||
../zone/gm_commands/details.cpp
|
||||
../zone/gm_commands/devtools.cpp
|
||||
../zone/gm_commands/disablerecipe.cpp
|
||||
../zone/gm_commands/disarmtrap.cpp
|
||||
../zone/gm_commands/distance.cpp
|
||||
../zone/gm_commands/doanim.cpp
|
||||
../zone/gm_commands/door.cpp
|
||||
../zone/gm_commands/door_manipulation.cpp
|
||||
../zone/gm_commands/door_manipulation.h
|
||||
../zone/gm_commands/dye.cpp
|
||||
../zone/gm_commands/dz.cpp
|
||||
../zone/gm_commands/dzkickplayers.cpp
|
||||
../zone/gm_commands/editmassrespawn.cpp
|
||||
../zone/gm_commands/emote.cpp
|
||||
../zone/gm_commands/emotesearch.cpp
|
||||
../zone/gm_commands/emoteview.cpp
|
||||
../zone/gm_commands/enablerecipe.cpp
|
||||
../zone/gm_commands/endurance.cpp
|
||||
../zone/gm_commands/equipitem.cpp
|
||||
../zone/gm_commands/face.cpp
|
||||
../zone/gm_commands/faction.cpp
|
||||
../zone/gm_commands/findclass.cpp
|
||||
../zone/gm_commands/findfaction.cpp
|
||||
../zone/gm_commands/findnpctype.cpp
|
||||
../zone/gm_commands/findrace.cpp
|
||||
../zone/gm_commands/findskill.cpp
|
||||
../zone/gm_commands/findspell.cpp
|
||||
../zone/gm_commands/findtask.cpp
|
||||
../zone/gm_commands/findzone.cpp
|
||||
../zone/gm_commands/fixmob.cpp
|
||||
../zone/gm_commands/flag.cpp
|
||||
../zone/gm_commands/flagedit.cpp
|
||||
../zone/gm_commands/flags.cpp
|
||||
../zone/gm_commands/flymode.cpp
|
||||
../zone/gm_commands/fov.cpp
|
||||
../zone/gm_commands/freeze.cpp
|
||||
../zone/gm_commands/gassign.cpp
|
||||
../zone/gm_commands/gearup.cpp
|
||||
../zone/gm_commands/gender.cpp
|
||||
../zone/gm_commands/getplayerburiedcorpsecount.cpp
|
||||
../zone/gm_commands/getvariable.cpp
|
||||
../zone/gm_commands/ginfo.cpp
|
||||
../zone/gm_commands/giveitem.cpp
|
||||
../zone/gm_commands/givemoney.cpp
|
||||
../zone/gm_commands/globalview.cpp
|
||||
../zone/gm_commands/gm.cpp
|
||||
../zone/gm_commands/gmspeed.cpp
|
||||
../zone/gm_commands/gmzone.cpp
|
||||
../zone/gm_commands/goto.cpp
|
||||
../zone/gm_commands/grid.cpp
|
||||
../zone/gm_commands/guild.cpp
|
||||
../zone/gm_commands/guildapprove.cpp
|
||||
../zone/gm_commands/guildcreate.cpp
|
||||
../zone/gm_commands/guildlist.cpp
|
||||
../zone/gm_commands/hair.cpp
|
||||
../zone/gm_commands/haircolor.cpp
|
||||
../zone/gm_commands/haste.cpp
|
||||
../zone/gm_commands/hatelist.cpp
|
||||
../zone/gm_commands/heal.cpp
|
||||
../zone/gm_commands/helm.cpp
|
||||
../zone/gm_commands/heritage.cpp
|
||||
../zone/gm_commands/heromodel.cpp
|
||||
../zone/gm_commands/hideme.cpp
|
||||
../zone/gm_commands/hp.cpp
|
||||
../zone/gm_commands/incstat.cpp
|
||||
../zone/gm_commands/instance.cpp
|
||||
../zone/gm_commands/interrogateinv.cpp
|
||||
../zone/gm_commands/interrupt.cpp
|
||||
../zone/gm_commands/invsnapshot.cpp
|
||||
../zone/gm_commands/invul.cpp
|
||||
../zone/gm_commands/ipban.cpp
|
||||
../zone/gm_commands/iplookup.cpp
|
||||
../zone/gm_commands/iteminfo.cpp
|
||||
../zone/gm_commands/itemsearch.cpp
|
||||
../zone/gm_commands/kick.cpp
|
||||
../zone/gm_commands/kill.cpp
|
||||
../zone/gm_commands/killallnpcs.cpp
|
||||
../zone/gm_commands/lastname.cpp
|
||||
../zone/gm_commands/list.cpp
|
||||
../zone/gm_commands/listpetition.cpp
|
||||
../zone/gm_commands/loc.cpp
|
||||
../zone/gm_commands/lock.cpp
|
||||
../zone/gm_commands/logcommand.cpp
|
||||
../zone/gm_commands/logs.cpp
|
||||
../zone/gm_commands/makepet.cpp
|
||||
../zone/gm_commands/mana.cpp
|
||||
../zone/gm_commands/max_all_skills.cpp
|
||||
../zone/gm_commands/memspell.cpp
|
||||
../zone/gm_commands/merchantcloseshop.cpp
|
||||
../zone/gm_commands/merchantopenshop.cpp
|
||||
../zone/gm_commands/modifynpcstat.cpp
|
||||
../zone/gm_commands/motd.cpp
|
||||
../zone/gm_commands/movechar.cpp
|
||||
../zone/gm_commands/movement.cpp
|
||||
../zone/gm_commands/myskills.cpp
|
||||
../zone/gm_commands/mysql.cpp
|
||||
../zone/gm_commands/mystats.cpp
|
||||
../zone/gm_commands/name.cpp
|
||||
../zone/gm_commands/netstats.cpp
|
||||
../zone/gm_commands/network.cpp
|
||||
../zone/gm_commands/npccast.cpp
|
||||
../zone/gm_commands/npcedit.cpp
|
||||
../zone/gm_commands/npceditmass.cpp
|
||||
../zone/gm_commands/npcemote.cpp
|
||||
../zone/gm_commands/npcloot.cpp
|
||||
../zone/gm_commands/npcsay.cpp
|
||||
../zone/gm_commands/npcshout.cpp
|
||||
../zone/gm_commands/npcspawn.cpp
|
||||
../zone/gm_commands/npcspecialattk.cpp
|
||||
../zone/gm_commands/npcstats.cpp
|
||||
../zone/gm_commands/npctype_cache.cpp
|
||||
../zone/gm_commands/npctypespawn.cpp
|
||||
../zone/gm_commands/nudge.cpp
|
||||
../zone/gm_commands/nukebuffs.cpp
|
||||
../zone/gm_commands/nukeitem.cpp
|
||||
../zone/gm_commands/object.cpp
|
||||
../zone/gm_commands/oocmute.cpp
|
||||
../zone/gm_commands/opcode.cpp
|
||||
../zone/gm_commands/path.cpp
|
||||
../zone/gm_commands/peekinv.cpp
|
||||
../zone/gm_commands/peqzone.cpp
|
||||
../zone/gm_commands/permaclass.cpp
|
||||
../zone/gm_commands/permagender.cpp
|
||||
../zone/gm_commands/permarace.cpp
|
||||
../zone/gm_commands/petitems.cpp
|
||||
../zone/gm_commands/petitioninfo.cpp
|
||||
../zone/gm_commands/petname.cpp
|
||||
../zone/gm_commands/pf.cpp
|
||||
../zone/gm_commands/picklock.cpp
|
||||
../zone/gm_commands/profanity.cpp
|
||||
../zone/gm_commands/proximity.cpp
|
||||
../zone/gm_commands/push.cpp
|
||||
../zone/gm_commands/pvp.cpp
|
||||
../zone/gm_commands/qglobal.cpp
|
||||
../zone/gm_commands/questerrors.cpp
|
||||
../zone/gm_commands/race.cpp
|
||||
../zone/gm_commands/raidloot.cpp
|
||||
../zone/gm_commands/randomfeatures.cpp
|
||||
../zone/gm_commands/refreshgroup.cpp
|
||||
../zone/gm_commands/reloadaa.cpp
|
||||
../zone/gm_commands/reloadallrules.cpp
|
||||
../zone/gm_commands/reloadcontentflags.cpp
|
||||
../zone/gm_commands/reloademote.cpp
|
||||
../zone/gm_commands/reloadlevelmods.cpp
|
||||
../zone/gm_commands/reloadmerchants.cpp
|
||||
../zone/gm_commands/reloadperlexportsettings.cpp
|
||||
../zone/gm_commands/reloadqst.cpp
|
||||
../zone/gm_commands/reloadstatic.cpp
|
||||
../zone/gm_commands/reloadtitles.cpp
|
||||
../zone/gm_commands/reloadtraps.cpp
|
||||
../zone/gm_commands/reloadworld.cpp
|
||||
../zone/gm_commands/reloadworldrules.cpp
|
||||
../zone/gm_commands/reloadzps.cpp
|
||||
../zone/gm_commands/removeitem.cpp
|
||||
../zone/gm_commands/repop.cpp
|
||||
../zone/gm_commands/resetaa.cpp
|
||||
../zone/gm_commands/resetaa_timer.cpp
|
||||
../zone/gm_commands/resetdisc_timer.cpp
|
||||
../zone/gm_commands/revoke.cpp
|
||||
../zone/gm_commands/roambox.cpp
|
||||
../zone/gm_commands/rules.cpp
|
||||
../zone/gm_commands/save.cpp
|
||||
../zone/gm_commands/scale.cpp
|
||||
../zone/gm_commands/scribespell.cpp
|
||||
../zone/gm_commands/scribespells.cpp
|
||||
../zone/gm_commands/sendzonespawns.cpp
|
||||
../zone/gm_commands/sensetrap.cpp
|
||||
../zone/gm_commands/serverinfo.cpp
|
||||
../zone/gm_commands/serverrules.cpp
|
||||
../zone/gm_commands/set_adventure_points.cpp
|
||||
../zone/gm_commands/setaapts.cpp
|
||||
../zone/gm_commands/setaaxp.cpp
|
||||
../zone/gm_commands/setaltcurrency.cpp
|
||||
../zone/gm_commands/setanim.cpp
|
||||
../zone/gm_commands/setcrystals.cpp
|
||||
../zone/gm_commands/setendurance.cpp
|
||||
../zone/gm_commands/setfaction.cpp
|
||||
../zone/gm_commands/setgraveyard.cpp
|
||||
../zone/gm_commands/sethp.cpp
|
||||
../zone/gm_commands/setlanguage.cpp
|
||||
../zone/gm_commands/setlsinfo.cpp
|
||||
../zone/gm_commands/setmana.cpp
|
||||
../zone/gm_commands/setpass.cpp
|
||||
../zone/gm_commands/setpvppoints.cpp
|
||||
../zone/gm_commands/setskill.cpp
|
||||
../zone/gm_commands/setskillall.cpp
|
||||
../zone/gm_commands/setstartzone.cpp
|
||||
../zone/gm_commands/setstat.cpp
|
||||
../zone/gm_commands/setxp.cpp
|
||||
../zone/gm_commands/showbonusstats.cpp
|
||||
../zone/gm_commands/showbuffs.cpp
|
||||
../zone/gm_commands/shownpcgloballoot.cpp
|
||||
../zone/gm_commands/shownumhits.cpp
|
||||
../zone/gm_commands/showskills.cpp
|
||||
../zone/gm_commands/showspellslist.cpp
|
||||
../zone/gm_commands/showstats.cpp
|
||||
../zone/gm_commands/showzonegloballoot.cpp
|
||||
../zone/gm_commands/showzonepoints.cpp
|
||||
../zone/gm_commands/shutdown.cpp
|
||||
../zone/gm_commands/size.cpp
|
||||
../zone/gm_commands/spawn.cpp
|
||||
../zone/gm_commands/spawnfix.cpp
|
||||
../zone/gm_commands/spawnstatus.cpp
|
||||
../zone/gm_commands/spellinfo.cpp
|
||||
../zone/gm_commands/stun.cpp
|
||||
../zone/gm_commands/summon.cpp
|
||||
../zone/gm_commands/summonburiedplayercorpse.cpp
|
||||
../zone/gm_commands/summonitem.cpp
|
||||
../zone/gm_commands/suspend.cpp
|
||||
../zone/gm_commands/task.cpp
|
||||
../zone/gm_commands/tattoo.cpp
|
||||
../zone/gm_commands/tempname.cpp
|
||||
../zone/gm_commands/texture.cpp
|
||||
../zone/gm_commands/time.cpp
|
||||
../zone/gm_commands/timers.cpp
|
||||
../zone/gm_commands/timezone.cpp
|
||||
../zone/gm_commands/title.cpp
|
||||
../zone/gm_commands/titlesuffix.cpp
|
||||
../zone/gm_commands/traindisc.cpp
|
||||
../zone/gm_commands/trapinfo.cpp
|
||||
../zone/gm_commands/tune.cpp
|
||||
../zone/gm_commands/ucs.cpp
|
||||
../zone/gm_commands/undye.cpp
|
||||
../zone/gm_commands/undyeme.cpp
|
||||
../zone/gm_commands/unfreeze.cpp
|
||||
../zone/gm_commands/unlock.cpp
|
||||
../zone/gm_commands/unmemspell.cpp
|
||||
../zone/gm_commands/unmemspells.cpp
|
||||
../zone/gm_commands/unscribespell.cpp
|
||||
../zone/gm_commands/unscribespells.cpp
|
||||
../zone/gm_commands/updatechecksum.cpp
|
||||
../zone/gm_commands/untraindisc.cpp
|
||||
../zone/gm_commands/untraindiscs.cpp
|
||||
../zone/gm_commands/uptime.cpp
|
||||
../zone/gm_commands/version.cpp
|
||||
../zone/gm_commands/viewcurrencies.cpp
|
||||
../zone/gm_commands/viewnpctype.cpp
|
||||
../zone/gm_commands/viewpetition.cpp
|
||||
../zone/gm_commands/viewzoneloot.cpp
|
||||
../zone/gm_commands/wc.cpp
|
||||
../zone/gm_commands/weather.cpp
|
||||
../zone/gm_commands/who.cpp
|
||||
../zone/gm_commands/worldshutdown.cpp
|
||||
../zone/gm_commands/worldwide.cpp
|
||||
../zone/gm_commands/wp.cpp
|
||||
../zone/gm_commands/wpadd.cpp
|
||||
../zone/gm_commands/wpinfo.cpp
|
||||
../zone/gm_commands/xtargets.cpp
|
||||
../zone/gm_commands/zclip.cpp
|
||||
../zone/gm_commands/zcolor.cpp
|
||||
../zone/gm_commands/zheader.cpp
|
||||
../zone/gm_commands/zonebootup.cpp
|
||||
../zone/gm_commands/zonelock.cpp
|
||||
../zone/gm_commands/zoneshutdown.cpp
|
||||
../zone/gm_commands/zonestatus.cpp
|
||||
../zone/gm_commands/zopp.cpp
|
||||
../zone/gm_commands/zsafecoords.cpp
|
||||
../zone/gm_commands/zsave.cpp
|
||||
../zone/gm_commands/zsky.cpp
|
||||
../zone/gm_commands/zstats.cpp
|
||||
../zone/gm_commands/zunderworld.cpp
|
||||
)
|
||||
|
||||
SOURCE_GROUP(zonetest_gm_commands FILES
|
||||
${zonetest_gm_commands}
|
||||
)
|
||||
|
||||
ADD_EXECUTABLE(zonetest ${zonetest_sources} ${zonetest_headers} ${zonetest_gm_commands})
|
||||
|
||||
INSTALL(TARGETS zonetest RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
|
||||
|
||||
ADD_DEFINITIONS(-DZONE)
|
||||
|
||||
TARGET_LINK_LIBRARIES(zonetest ${ZONE_LIBS})
|
||||
|
||||
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
|
||||
+17970
File diff suppressed because it is too large
Load Diff
+380
@@ -0,0 +1,380 @@
|
||||
#define CATCH_CONFIG_MAIN
|
||||
#include "catch.hpp"
|
||||
|
||||
#include "../common/eqemu_logsys.h"
|
||||
#include "../common/global_define.h"
|
||||
#include "../common/shareddb.h"
|
||||
#include "../common/eqemu_config.h"
|
||||
#include "../common/platform.h"
|
||||
#include "../common/crash.h"
|
||||
#include "../common/rulesys.h"
|
||||
#include "../common/string_util.h"
|
||||
#include "../common/content/world_content_service.h"
|
||||
#include "../common/global_define.h"
|
||||
#include "../common/timer.h"
|
||||
#include "../common/eq_packet_structs.h"
|
||||
#include "../common/mutex.h"
|
||||
#include "../common/opcodemgr.h"
|
||||
#include "../common/guilds.h"
|
||||
#include "../common/eq_stream_ident.h"
|
||||
#include "../common/patches/patches.h"
|
||||
#include "../common/rulesys.h"
|
||||
#include "../common/profanity_manager.h"
|
||||
#include "../common/string_util.h"
|
||||
#include "../common/crash.h"
|
||||
#include "../common/memory_mapped_file.h"
|
||||
#include "../common/spdat.h"
|
||||
#include "../common/eqemu_logsys.h"
|
||||
|
||||
#include "../zone/api_service.h"
|
||||
#include "../zone/zone_config.h"
|
||||
#include "../zone/masterentity.h"
|
||||
#include "../zone/worldserver.h"
|
||||
#include "../zone/zone.h"
|
||||
#include "../zone/queryserv.h"
|
||||
#include "../zone/command.h"
|
||||
#ifdef BOTS
|
||||
#include "../zone/bot_command.h"
|
||||
#endif
|
||||
#include "../zone/zonedb.h"
|
||||
#include "../zone/zone_store.h"
|
||||
#include "../zone/titles.h"
|
||||
#include "../zone/guild_mgr.h"
|
||||
#include "../zone/task_manager.h"
|
||||
#include "../zone/quest_parser_collection.h"
|
||||
#include "../zone/embparser.h"
|
||||
#include "../zone/lua_parser.h"
|
||||
#include "../zone/questmgr.h"
|
||||
#include "../zone/npc_scale_manager.h"
|
||||
|
||||
#include "../common/net/eqstream.h"
|
||||
#include "../common/content/world_content_service.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <signal.h>
|
||||
#include <time.h>
|
||||
#include <chrono>
|
||||
|
||||
#ifdef _CRTDBG_MAP_ALLOC
|
||||
#undef new
|
||||
#define new new(_NORMAL_BLOCK, __FILE__, __LINE__)
|
||||
#endif
|
||||
|
||||
#ifdef _WINDOWS
|
||||
#include <conio.h>
|
||||
#include <process.h>
|
||||
#else
|
||||
#include <pthread.h>
|
||||
#include "../common/unix.h"
|
||||
#include "zone_store.h"
|
||||
#include "zone_event_scheduler.h"
|
||||
|
||||
#endif
|
||||
|
||||
volatile bool RunLoops = true;
|
||||
#ifdef __FreeBSD__
|
||||
#include <pthread_np.h>
|
||||
#endif
|
||||
|
||||
extern volatile bool is_zone_loaded;
|
||||
|
||||
EntityList entity_list;
|
||||
WorldServer worldserver;
|
||||
ZoneStore zone_store;
|
||||
uint32 numclients = 0;
|
||||
char errorname[32];
|
||||
extern Zone* zone;
|
||||
npcDecayTimes_Struct npcCorpseDecayTimes[100];
|
||||
TitleManager title_manager;
|
||||
QueryServ *QServ = 0;
|
||||
TaskManager *task_manager = 0;
|
||||
NpcScaleManager *npc_scale_manager;
|
||||
QuestParserCollection *parse = 0;
|
||||
EQEmuLogSys LogSys;
|
||||
ZoneEventScheduler event_scheduler;
|
||||
WorldContentService content_service;
|
||||
const SPDat_Spell_Struct* spells;
|
||||
int32 SPDAT_RECORDS = -1;
|
||||
const ZoneConfig *Config;
|
||||
double frame_time = 0.0;
|
||||
|
||||
using namespace std;
|
||||
|
||||
TEST_CASE("client simple attack npc", "[client][npc]") {
|
||||
streambuf* originalBuf = cout.rdbuf();
|
||||
ostringstream buf;
|
||||
|
||||
RegisterExecutablePlatform(ExePlatformZone);
|
||||
LogSys.LoadLogSettingsDefaults();
|
||||
|
||||
QServ = new QueryServ;
|
||||
parse = new QuestParserCollection();
|
||||
|
||||
LogSys.log_settings[Logs::Combat].is_category_enabled = 1;
|
||||
LogSys.log_settings[Logs::Combat].log_to_console = 3;
|
||||
LogSys.log_settings[Logs::Attack].is_category_enabled = 1;
|
||||
LogSys.log_settings[Logs::Attack].log_to_console = 3;
|
||||
RuleManager::Instance()->SetRule("Logging:PrintFileFunctionAndLine", "1");
|
||||
//EQEmuConfig::LoadConfig();
|
||||
/*try {
|
||||
REQUIRE_NOTHROW(EQEmuConfig::LoadConfig());
|
||||
}
|
||||
catch (Json::Exception e) {
|
||||
LogError("Unable to load configuration file: {}", e.what());
|
||||
FAIL();
|
||||
}
|
||||
catch (std::exception e) {
|
||||
LogError("Unable to load configuration file generic fail: {}", e.what());
|
||||
FAIL();
|
||||
}*/
|
||||
//LogInfo("CURRENT_VERSION: {}", CURRENT_VERSION);
|
||||
zone = new Zone(-1, 0, "test");
|
||||
|
||||
NPCType* npc_type = new NPCType();
|
||||
NPC* npc_source = new NPC(npc_type, nullptr, glm::vec4(0, 0, 0, 0), GravityBehavior::Water);
|
||||
npc_source->SetName("npc_source");
|
||||
npc_source->ModifyNPCStat("max_hp", "1000");
|
||||
npc_source->ModifyNPCStat("accuracy", "100");
|
||||
npc_source->SetHP(1000);
|
||||
|
||||
Client* client_target = new Client(nullptr);
|
||||
client_target->SetName("client_target");
|
||||
SECTION("Attack client_target") {
|
||||
LogInfo("Testing Attack");
|
||||
//cout.rdbuf(buf.rdbuf());
|
||||
|
||||
REQUIRE(npc_source->Attack(client_target));
|
||||
//cout.rdbuf(originalBuf);
|
||||
//REQUIRE(buf.str().find("Final damage against") != std::string::npos);
|
||||
//buf.str("");
|
||||
}
|
||||
|
||||
DamageHitInfo my_hit = DamageHitInfo();
|
||||
SECTION("DoAttack no damage client_target") {
|
||||
LogInfo("Testing DoAttack no damage");
|
||||
my_hit.tohit = 100;
|
||||
my_hit.damage_done = 0;
|
||||
npc_source->DoAttack(client_target, my_hit);
|
||||
REQUIRE(client_target->GetHP() == 1000);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
SECTION("ImmuneToMelee client_target") {
|
||||
LogInfo("Testing ImmuneToMelee");
|
||||
my_hit.tohit = 100;
|
||||
my_hit.damage_done = 5;
|
||||
npc_source->SetSpecialAbility(IMMUNE_MELEE, 1);
|
||||
npc_source->Attack(client_target);
|
||||
npc_source->SetSpecialAbility(IMMUNE_MELEE, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
SECTION("DoAttack client_target 5 base damage") {
|
||||
LogInfo("Testing DoAttack 5 base damage");
|
||||
my_hit.base_damage = 5;
|
||||
my_hit.damage_done = 5;
|
||||
my_hit.min_damage = 1;
|
||||
my_hit.tohit = 100;
|
||||
npc_source->DoAttack(client_target, my_hit);
|
||||
return;
|
||||
}
|
||||
|
||||
SECTION("CommonOutgoingHitSuccess client_target 5 base damage") {
|
||||
LogInfo("Testing CommonOutgoingHitSuccess 5 base damage");
|
||||
|
||||
my_hit.base_damage = 5;
|
||||
my_hit.min_damage = 1;
|
||||
my_hit.damage_done = 5;
|
||||
my_hit.tohit = 100;
|
||||
npc_source->CommonOutgoingHitSuccess(client_target, my_hit);
|
||||
return;
|
||||
}
|
||||
|
||||
SECTION("Damage client_target 5 base damage") {
|
||||
LogInfo("Testing Damage(self) 5 base damage");
|
||||
my_hit.damage_done = 5;
|
||||
npc_source->Damage(client_target, my_hit.damage_done, SPELL_UNKNOWN, my_hit.skill, true);
|
||||
}
|
||||
|
||||
|
||||
LogInfo("{} dealt {} damage to {}", npc_source->GetName(), 1000 - client_target->GetHP(), client_target->GetName());
|
||||
cout.rdbuf(originalBuf);
|
||||
}
|
||||
|
||||
TEST_CASE("npc simple attack", "[npc]") {
|
||||
|
||||
streambuf* originalBuf = cout.rdbuf();
|
||||
ostringstream buf;
|
||||
|
||||
RegisterExecutablePlatform(ExePlatformZone);
|
||||
LogSys.LoadLogSettingsDefaults();
|
||||
|
||||
QServ = new QueryServ;
|
||||
parse = new QuestParserCollection();
|
||||
|
||||
LogSys.log_settings[Logs::Combat].is_category_enabled = 1;
|
||||
LogSys.log_settings[Logs::Combat].log_to_console = 3;
|
||||
LogSys.log_settings[Logs::Attack].is_category_enabled = 1;
|
||||
LogSys.log_settings[Logs::Attack].log_to_console = 3;
|
||||
RuleManager::Instance()->SetRule("Logging:PrintFileFunctionAndLine", "1");
|
||||
//EQEmuConfig::LoadConfig();
|
||||
/*try {
|
||||
REQUIRE_NOTHROW(EQEmuConfig::LoadConfig());
|
||||
}
|
||||
catch (Json::Exception e) {
|
||||
LogError("Unable to load configuration file: {}", e.what());
|
||||
FAIL();
|
||||
}
|
||||
catch (std::exception e) {
|
||||
LogError("Unable to load configuration file generic fail: {}", e.what());
|
||||
FAIL();
|
||||
}*/
|
||||
//LogInfo("CURRENT_VERSION: {}", CURRENT_VERSION);
|
||||
zone = new Zone(-1, 0, "test");
|
||||
|
||||
NPCType* npc_type = new NPCType();
|
||||
NPC* npc_source = new NPC(npc_type, nullptr, glm::vec4(0, 0, 0, 0), GravityBehavior::Water);
|
||||
npc_source->SetName("npc_source");
|
||||
npc_source->ModifyNPCStat("max_hp", "1000");
|
||||
npc_source->ModifyNPCStat("accuracy", "100");
|
||||
npc_source->SetHP(1000);
|
||||
|
||||
NPC* npc_target= new NPC(npc_type, nullptr, glm::vec4(0, 0, 0, 0), GravityBehavior::Water);
|
||||
npc_target->SetName("npc_target");
|
||||
npc_target->ModifyNPCStat("max_hp", "1000");
|
||||
npc_target->ModifyNPCStat("accuracy", "100");
|
||||
npc_target->SetHP(1000);
|
||||
|
||||
SECTION("Attack npc_target") {
|
||||
LogInfo("Testing Attack");
|
||||
//cout.rdbuf(buf.rdbuf());
|
||||
|
||||
REQUIRE(npc_source->Attack(npc_target));
|
||||
//cout.rdbuf(originalBuf);
|
||||
//REQUIRE(buf.str().find("Final damage against") != std::string::npos);
|
||||
//buf.str("");
|
||||
}
|
||||
|
||||
DamageHitInfo my_hit = DamageHitInfo();
|
||||
SECTION("DoAttack no damage npc_target") {
|
||||
LogInfo("Testing DoAttack no damage");
|
||||
my_hit.tohit = 100;
|
||||
my_hit.damage_done = 0;
|
||||
npc_source->DoAttack(npc_target, my_hit);
|
||||
REQUIRE(npc_target->GetHP() == 1000);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
SECTION("ImmuneToMelee npc_target") {
|
||||
LogInfo("Testing ImmuneToMelee");
|
||||
my_hit.tohit = 100;
|
||||
my_hit.damage_done = 5;
|
||||
npc_source->SetSpecialAbility(IMMUNE_MELEE, 1);
|
||||
npc_source->Attack(npc_target);
|
||||
npc_source->SetSpecialAbility(IMMUNE_MELEE, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
SECTION("DoAttack npc_target 5 base damage") {
|
||||
LogInfo("Testing DoAttack 5 base damage");
|
||||
my_hit.base_damage = 5;
|
||||
my_hit.damage_done = 5;
|
||||
my_hit.min_damage = 1;
|
||||
my_hit.tohit = 100;
|
||||
npc_source->DoAttack(npc_target, my_hit);
|
||||
return;
|
||||
}
|
||||
|
||||
SECTION("CommonOutgoingHitSuccess npc_target 5 base damage") {
|
||||
LogInfo("Testing CommonOutgoingHitSuccess 5 base damage");
|
||||
|
||||
my_hit.base_damage = 5;
|
||||
my_hit.min_damage = 1;
|
||||
my_hit.damage_done = 5;
|
||||
my_hit.tohit = 100;
|
||||
npc_source->CommonOutgoingHitSuccess(npc_target, my_hit);
|
||||
return;
|
||||
}
|
||||
|
||||
SECTION("Damage npc_target 5 base damage") {
|
||||
LogInfo("Testing Damage(self) 5 base damage");
|
||||
my_hit.damage_done = 5;
|
||||
npc_source->Damage(npc_target, my_hit.damage_done, SPELL_UNKNOWN, my_hit.skill, true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
LogInfo("{} dealt {} damage to {}", npc_source->GetName(), 1000-npc_target->GetHP(), npc_target->GetName());
|
||||
cout.rdbuf(originalBuf);
|
||||
}
|
||||
|
||||
TEST_CASE("npc death by attack", "[npc]") {
|
||||
RegisterExecutablePlatform(ExePlatformZone);
|
||||
LogSys.LoadLogSettingsDefaults();
|
||||
|
||||
QServ = new QueryServ;
|
||||
parse = new QuestParserCollection();
|
||||
//EQEmuConfig::LoadConfig();
|
||||
/*try {
|
||||
REQUIRE_NOTHROW(EQEmuConfig::LoadConfig());
|
||||
}
|
||||
catch (Json::Exception e) {
|
||||
LogError("Unable to load configuration file: {}", e.what());
|
||||
FAIL();
|
||||
}
|
||||
catch (std::exception e) {
|
||||
LogError("Unable to load configuration file generic fail: {}", e.what());
|
||||
FAIL();
|
||||
}*/
|
||||
zone = new Zone(-1, 0, "test");
|
||||
|
||||
NPCType* npc_type = new NPCType();
|
||||
NPC* npc = new NPC(npc_type, nullptr, glm::vec4(0, 0, 0, 0), GravityBehavior::Water);
|
||||
npc->ModifyNPCStat("max_hp", "1");
|
||||
npc->SetHP(1);
|
||||
npc->Attack(npc);
|
||||
}
|
||||
|
||||
void Shutdown()
|
||||
{
|
||||
Zone::Shutdown(true);
|
||||
LogInfo("Shutting down...");
|
||||
LogSys.CloseFileLogs();
|
||||
EQ::EventLoop::Get().Shutdown();
|
||||
}
|
||||
|
||||
void CatchSignal(int sig_num) {
|
||||
#ifdef _WINDOWS
|
||||
LogInfo("Recieved signal: [{}]", sig_num);
|
||||
#endif
|
||||
Shutdown();
|
||||
}
|
||||
|
||||
/* Update Window Title with relevant information */
|
||||
void UpdateWindowTitle(char* iNewTitle) {
|
||||
#ifdef _WINDOWS
|
||||
char tmp[500];
|
||||
if (iNewTitle) {
|
||||
snprintf(tmp, sizeof(tmp), "%i: %s", ZoneConfig::get()->ZonePort, iNewTitle);
|
||||
}
|
||||
else {
|
||||
if (zone) {
|
||||
#if defined(GOTFRAGS) || defined(_EQDEBUG)
|
||||
snprintf(tmp, sizeof(tmp), "%i: %s, %i clients, %i", ZoneConfig::get()->ZonePort, zone->GetShortName(), numclients, getpid());
|
||||
#else
|
||||
snprintf(tmp, sizeof(tmp), "%s :: clients: %i inst_id: %i inst_ver: %i :: port: %i", zone->GetShortName(), numclients, zone->GetInstanceID(), zone->GetInstanceVersion(), ZoneConfig::get()->ZonePort);
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
#if defined(GOTFRAGS) || defined(_EQDEBUG)
|
||||
snprintf(tmp, sizeof(tmp), "%i: sleeping, %i", ZoneConfig::get()->ZonePort, getpid());
|
||||
#else
|
||||
snprintf(tmp, sizeof(tmp), "%i: sleeping", ZoneConfig::get()->ZonePort);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
SetConsoleTitle(tmp);
|
||||
#endif
|
||||
}
|
||||
+4
-2
@@ -188,8 +188,10 @@ Client::Client(EQStreamInterface* ieqs)
|
||||
berserk = false;
|
||||
dead = false;
|
||||
eqs = ieqs;
|
||||
ip = eqs->GetRemoteIP();
|
||||
port = ntohs(eqs->GetRemotePort());
|
||||
if (eqs) {
|
||||
ip = eqs->GetRemoteIP();
|
||||
port = ntohs(eqs->GetRemotePort());
|
||||
}
|
||||
client_state = CLIENT_CONNECTING;
|
||||
Trader=false;
|
||||
Buyer = false;
|
||||
|
||||
@@ -4295,6 +4295,12 @@ void Mob::TriggerDefensiveProcs(Mob *on, uint16 hand, bool FromSkillProc, int da
|
||||
if (!on) {
|
||||
return;
|
||||
}
|
||||
if (on->GetHP() == 0) {
|
||||
return;
|
||||
}
|
||||
if (on->HasDied()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!FromSkillProc) {
|
||||
on->TryDefensiveProc(this, hand);
|
||||
|
||||
@@ -234,6 +234,9 @@ bool NpcScaleManager::LoadScaleData()
|
||||
*/
|
||||
NpcScaleManager::global_npc_scale NpcScaleManager::GetGlobalScaleDataForTypeLevel(int8 npc_type, int npc_level)
|
||||
{
|
||||
if (npc_type < 1) {
|
||||
return {};
|
||||
}
|
||||
auto iter = npc_global_base_scaling_data.find(std::make_pair(npc_type, npc_level));
|
||||
if (iter != npc_global_base_scaling_data.end()) {
|
||||
return iter->second;
|
||||
|
||||
@@ -471,6 +471,9 @@ int QuestParserCollection::EventEncounter(QuestEventID evt, std::string encounte
|
||||
}
|
||||
|
||||
QuestInterface *QuestParserCollection::GetQIByNPCQuest(uint32 npcid, std::string &filename) {
|
||||
if (!Config) {
|
||||
return nullptr;
|
||||
}
|
||||
//first look for /quests/zone/npcid.ext (precedence)
|
||||
filename = Config->QuestDir;
|
||||
filename += zone->GetShortName();
|
||||
@@ -699,6 +702,9 @@ QuestInterface *QuestParserCollection::GetQIByPlayerQuest(std::string &filename)
|
||||
}
|
||||
|
||||
QuestInterface *QuestParserCollection::GetQIByGlobalNPCQuest(std::string &filename) {
|
||||
if (!Config) {
|
||||
return nullptr;
|
||||
}
|
||||
// simply look for /quests/global/global_npc.ext
|
||||
filename = Config->QuestDir;
|
||||
filename += QUEST_GLOBAL_DIRECTORY;
|
||||
@@ -1003,6 +1009,7 @@ void QuestParserCollection::GetErrors(std::list<std::string> &err) {
|
||||
int QuestParserCollection::DispatchEventNPC(QuestEventID evt, NPC* npc, Mob *init, std::string data, uint32 extra_data,
|
||||
std::vector<EQ::Any> *extra_pointers) {
|
||||
int ret = 0;
|
||||
if (_load_precedence.size() == 0) return ret;
|
||||
auto iter = _load_precedence.begin();
|
||||
while(iter != _load_precedence.end()) {
|
||||
int i = (*iter)->DispatchEventNPC(evt, npc, init, data, extra_data, extra_pointers);
|
||||
|
||||
@@ -22,6 +22,9 @@ TaskProximityManager::~TaskProximityManager()
|
||||
|
||||
bool TaskProximityManager::LoadProximities(int zone_id)
|
||||
{
|
||||
if (zone_id == -1) {
|
||||
return false;
|
||||
}
|
||||
TaskProximity proximity{};
|
||||
m_task_proximities.clear();
|
||||
|
||||
|
||||
+3
-1
@@ -965,7 +965,9 @@ Zone::Zone(uint32 in_zoneid, uint32 in_instanceid, const char* in_short_name)
|
||||
merchantvar = 0;
|
||||
tradevar = 0;
|
||||
lootvar = 0;
|
||||
|
||||
if (zoneid == -1) {
|
||||
return;
|
||||
}
|
||||
if(RuleB(TaskSystem, EnableTaskSystem)) {
|
||||
task_manager->LoadProximities(zoneid);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user