From a52de8e8cd67259e328f4a30b12916169406718b Mon Sep 17 00:00:00 2001 From: Mattes D Date: Tue, 17 Jan 2017 14:10:02 +0100 Subject: DeadlockDetect: Provide more information for debugging. --- src/Bindings/PluginManager.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/Bindings') diff --git a/src/Bindings/PluginManager.cpp b/src/Bindings/PluginManager.cpp index 19d2e8b4d..276b08ce7 100644 --- a/src/Bindings/PluginManager.cpp +++ b/src/Bindings/PluginManager.cpp @@ -601,6 +601,27 @@ bool cPluginManager::CallHookEntityChangedWorld(cEntity & a_Entity, cWorld & a_W bool cPluginManager::CallHookExecuteCommand(cPlayer * a_Player, const AStringVector & a_Split, const AString & a_EntireCommand, CommandResult & a_Result) { + // Output the command being executed to log (for troubleshooting deadlocks-in-commands): + auto world = a_Player->GetWorld(); + AString worldName; + Int64 worldAge; + if (world != nullptr) + { + worldName = world->GetName(); + worldAge = world->GetWorldAge(); + } + else + { + worldName = ""; + worldAge = 0; + } + LOG("Player %s is executing command \"%s\" in world \"%s\" at world age %lld.", + a_Player->GetName().c_str(), + a_EntireCommand.c_str(), + worldName.c_str(), + worldAge + ); + FIND_HOOK(HOOK_EXECUTE_COMMAND); VERIFY_HOOK; -- cgit v1.2.3