From 7a6ec4fb17c957f86452be92f3ef2908f94c9b0d Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sat, 26 Jan 2013 07:50:06 +0000 Subject: Changed HOOK_PLAYER_MOVED to HOOK_PLAYER_MOVING to match the scheme used for names. -ING means the event is being processed and may be refused by a plugin, -ED means it has already happenned and the plugin cannot do anything about it. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1174 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- MCServer/Plugins/HookNotify/HookNotify.lua | 6 +++--- source/Bindings.cpp | 4 ++-- source/Bindings.h | 2 +- source/Player.cpp | 2 +- source/PluginManager.cpp | 4 ++-- source/PluginManager.h | 4 ++-- source/Plugin_NewLua.cpp | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/MCServer/Plugins/HookNotify/HookNotify.lua b/MCServer/Plugins/HookNotify/HookNotify.lua index 204f3cb85..d0221b668 100644 --- a/MCServer/Plugins/HookNotify/HookNotify.lua +++ b/MCServer/Plugins/HookNotify/HookNotify.lua @@ -27,7 +27,7 @@ function Initialize(Plugin) PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_EATING); PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_JOINED); PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_LEFT_CLICK); - PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_MOVED); + PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_MOVING); PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_PLACED_BLOCK); PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_PLACING_BLOCK); PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_RIGHT_CLICK); @@ -191,8 +191,8 @@ end -function OnPlayerMoved(...) - LogHook("OnPlayerMoved", unpack(arg)); +function OnPlayerMoving(...) + LogHook("OnPlayerMoving", unpack(arg)); end diff --git a/source/Bindings.cpp b/source/Bindings.cpp index c10643b69..78f6badc3 100644 --- a/source/Bindings.cpp +++ b/source/Bindings.cpp @@ -1,6 +1,6 @@ /* ** Lua binding: AllToLua -** Generated automatically by tolua++-1.0.92 on 01/25/13 19:08:52. +** Generated automatically by tolua++-1.0.92 on 01/26/13 16:47:03. */ #ifndef __cplusplus @@ -21402,7 +21402,7 @@ TOLUA_API int tolua_AllToLua_open (lua_State* tolua_S) tolua_constant(tolua_S,"HOOK_PLAYER_EATING",cPluginManager::HOOK_PLAYER_EATING); tolua_constant(tolua_S,"HOOK_PLAYER_JOINED",cPluginManager::HOOK_PLAYER_JOINED); tolua_constant(tolua_S,"HOOK_PLAYER_LEFT_CLICK",cPluginManager::HOOK_PLAYER_LEFT_CLICK); - tolua_constant(tolua_S,"HOOK_PLAYER_MOVED",cPluginManager::HOOK_PLAYER_MOVED); + tolua_constant(tolua_S,"HOOK_PLAYER_MOVING",cPluginManager::HOOK_PLAYER_MOVING); tolua_constant(tolua_S,"HOOK_PLAYER_PLACED_BLOCK",cPluginManager::HOOK_PLAYER_PLACED_BLOCK); tolua_constant(tolua_S,"HOOK_PLAYER_PLACING_BLOCK",cPluginManager::HOOK_PLAYER_PLACING_BLOCK); tolua_constant(tolua_S,"HOOK_PLAYER_RIGHT_CLICK",cPluginManager::HOOK_PLAYER_RIGHT_CLICK); diff --git a/source/Bindings.h b/source/Bindings.h index a7e440967..f320c4fed 100644 --- a/source/Bindings.h +++ b/source/Bindings.h @@ -1,6 +1,6 @@ /* ** Lua binding: AllToLua -** Generated automatically by tolua++-1.0.92 on 01/25/13 19:08:52. +** Generated automatically by tolua++-1.0.92 on 01/26/13 16:47:03. */ /* Exported function */ diff --git a/source/Player.cpp b/source/Player.cpp index f1a535f78..f00b0768c 100644 --- a/source/Player.cpp +++ b/source/Player.cpp @@ -174,7 +174,7 @@ void cPlayer::Tick(float a_Dt, MTRand & a_TickRandom) } else if (m_bDirtyPosition) { - cRoot::Get()->GetPluginManager()->CallHookPlayerMoved(*this); + cRoot::Get()->GetPluginManager()->CallHookPlayerMoving(*this); float DiffX = (float)(GetPosX() - m_LastPosX ); float DiffY = (float)(GetPosY() - m_LastPosY ); diff --git a/source/PluginManager.cpp b/source/PluginManager.cpp index 6211ffa36..cda7a0dba 100644 --- a/source/PluginManager.cpp +++ b/source/PluginManager.cpp @@ -601,9 +601,9 @@ bool cPluginManager::CallHookPlayerLeftClick(cPlayer & a_Player, int a_BlockX, i -bool cPluginManager::CallHookPlayerMoved(cPlayer & a_Player) +bool cPluginManager::CallHookPlayerMoving(cPlayer & a_Player) { - HookMap::iterator Plugins = m_Hooks.find(HOOK_PLAYER_MOVED); + HookMap::iterator Plugins = m_Hooks.find(HOOK_PLAYER_MOVING); if (Plugins == m_Hooks.end()) { return false; diff --git a/source/PluginManager.h b/source/PluginManager.h index 332996e67..4de79f539 100644 --- a/source/PluginManager.h +++ b/source/PluginManager.h @@ -60,7 +60,7 @@ public: // tolua_export HOOK_PLAYER_EATING, HOOK_PLAYER_JOINED, HOOK_PLAYER_LEFT_CLICK, - HOOK_PLAYER_MOVED, + HOOK_PLAYER_MOVING, HOOK_PLAYER_PLACED_BLOCK, HOOK_PLAYER_PLACING_BLOCK, HOOK_PLAYER_RIGHT_CLICK, @@ -111,7 +111,7 @@ public: // tolua_export bool CallHookPlayerBrokenBlock (cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta); bool CallHookPlayerEating (cPlayer & a_Player); bool CallHookPlayerJoined (cPlayer & a_Player); - bool CallHookPlayerMoved (cPlayer & a_Player); + bool CallHookPlayerMoving (cPlayer & a_Player); bool CallHookPlayerLeftClick (cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, char a_Status); bool CallHookPlayerPlacedBlock (cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta); bool CallHookPlayerPlacingBlock (cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta); diff --git a/source/Plugin_NewLua.cpp b/source/Plugin_NewLua.cpp index 2214e701c..ef7c148be 100644 --- a/source/Plugin_NewLua.cpp +++ b/source/Plugin_NewLua.cpp @@ -562,7 +562,7 @@ bool cPlugin_NewLua::OnPlayerLeftClick(cPlayer & a_Player, int a_BlockX, int a_B bool cPlugin_NewLua::OnPlayerMoved(cPlayer & a_Player) { cCSLock Lock(m_CriticalSection); - const char * FnName = GetHookFnName(cPluginManager::HOOK_PLAYER_MOVED); + const char * FnName = GetHookFnName(cPluginManager::HOOK_PLAYER_MOVING); ASSERT(FnName != NULL); if (!PushFunction(FnName)) { @@ -1168,7 +1168,7 @@ const char * cPlugin_NewLua::GetHookFnName(cPluginManager::PluginHook a_Hook) case cPluginManager::HOOK_PLAYER_EATING: return "OnPlayerEating"; case cPluginManager::HOOK_PLAYER_JOINED: return "OnPlayerJoined"; case cPluginManager::HOOK_PLAYER_LEFT_CLICK: return "OnPlayerLeftClick"; - case cPluginManager::HOOK_PLAYER_MOVED: return "OnPlayerMoved"; + case cPluginManager::HOOK_PLAYER_MOVING: return "OnPlayerMoving"; case cPluginManager::HOOK_PLAYER_PLACED_BLOCK: return "OnPlayerPlacedBlock"; case cPluginManager::HOOK_PLAYER_PLACING_BLOCK: return "OnPlayerPlacingBlock"; case cPluginManager::HOOK_PLAYER_RIGHT_CLICK: return "OnPlayerRightClick"; -- cgit v1.2.3