From de997e62656c4a60e069b4fedf5b1b96882c7931 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 8 Oct 2015 23:40:51 +0300 Subject: Add chat command /testinfo for output some debug parameters to log. --- src/actions/actions.cpp | 11 +++++++++++ src/actions/actions.h | 1 + src/actormanager.h | 3 +++ src/dyetool/actions/actions.cpp | 1 + src/enums/input/inputaction.h | 1 + src/input/inputactionmap.h | 5 +++++ 6 files changed, 22 insertions(+) (limited to 'src') diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp index 4655c9833..288c866f0 100644 --- a/src/actions/actions.cpp +++ b/src/actions/actions.cpp @@ -1640,4 +1640,15 @@ impHandler0(clearDrop) return true; } +impHandler0(testInfo) +{ + if (actorManager) + { + logger->log("actors count: %d", static_cast( + actorManager->size())); + return true; + } + return false; +} + } // namespace Actions diff --git a/src/actions/actions.h b/src/actions/actions.h index f2407f936..c26ef3af8 100644 --- a/src/actions/actions.h +++ b/src/actions/actions.h @@ -108,6 +108,7 @@ namespace Actions decHandler(unprotectItem); decHandler(kick); decHandler(clearDrop); + decHandler(testInfo); } // namespace Actions #undef decHandler diff --git a/src/actormanager.h b/src/actormanager.h index 00c8eb052..9646a3cee 100644 --- a/src/actormanager.h +++ b/src/actormanager.h @@ -343,6 +343,9 @@ class ActorManager final: public ConfigListener void updateBadges(); + size_t size() const + { return mActors.size(); } + #ifdef EATHENA_SUPPORT void removeRoom(const int chatId); diff --git a/src/dyetool/actions/actions.cpp b/src/dyetool/actions/actions.cpp index 046cd9c97..14b86ccf4 100644 --- a/src/dyetool/actions/actions.cpp +++ b/src/dyetool/actions/actions.cpp @@ -105,5 +105,6 @@ impHandlerVoid(protectItem) impHandlerVoid(unprotectItem) impHandlerVoid(kick) impHandlerVoid(clearDrop) +impHandlerVoid(testInfo) } // namespace Actions diff --git a/src/enums/input/inputaction.h b/src/enums/input/inputaction.h index 8a991896b..ccbed7386 100644 --- a/src/enums/input/inputaction.h +++ b/src/enums/input/inputaction.h @@ -603,6 +603,7 @@ enumStart(InputAction) CONG_GET, SERVER_CONG_GET, CHANGE_TARGETING_TYPE, + TEST_INFO, TOTAL } enumEnd(InputAction); diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h index 1676b19c7..b3ac8adb5 100644 --- a/src/input/inputactionmap.h +++ b/src/input/inputactionmap.h @@ -4496,6 +4496,11 @@ static const InputActionData inputActionData | InputCondition::EMODS, "", UseArgs_false}, + {"keyTestInfo", + defaultAction(&Actions::testInfo), + InputCondition::INGAME, + "testinfo", + UseArgs_false}, }; #undef defaultAction -- cgit v1.2.3-60-g2f50