1
0

Renamed HOOK_COLLECT_PICKUP to HOOK_COLLECTING_PICKUP to match other hooks' naming.

git-svn-id: http://mc-server.googlecode.com/svn/trunk@1180 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com 2013-01-28 16:17:26 +00:00
parent f63b1b2e13
commit 05534bbee1
9 changed files with 19 additions and 19 deletions

View File

@ -1,6 +1,6 @@
/* /*
** Lua binding: AllToLua ** Lua binding: AllToLua
** Generated automatically by tolua++-1.0.92 on 01/27/13 07:29:49. ** Generated automatically by tolua++-1.0.92 on 01/28/13 17:07:07.
*/ */
#ifndef __cplusplus #ifndef __cplusplus
@ -12709,12 +12709,12 @@ static int tolua_AllToLua_cItems_Add01(lua_State* tolua_S)
cItems* self = (cItems*) tolua_tousertype(tolua_S,1,0); cItems* self = (cItems*) tolua_tousertype(tolua_S,1,0);
ENUM_ITEM_ID a_ItemType = ((ENUM_ITEM_ID) (int) tolua_tonumber(tolua_S,2,0)); ENUM_ITEM_ID a_ItemType = ((ENUM_ITEM_ID) (int) tolua_tonumber(tolua_S,2,0));
char a_ItemCount = ((char) tolua_tonumber(tolua_S,3,0)); char a_ItemCount = ((char) tolua_tonumber(tolua_S,3,0));
short a_ItemHealth = ((short) tolua_tonumber(tolua_S,4,0)); short a_ItemDamage = ((short) tolua_tonumber(tolua_S,4,0));
#ifndef TOLUA_RELEASE #ifndef TOLUA_RELEASE
if (!self) tolua_error(tolua_S,"invalid 'self' in function 'Add'", NULL); if (!self) tolua_error(tolua_S,"invalid 'self' in function 'Add'", NULL);
#endif #endif
{ {
self->Add(a_ItemType,a_ItemCount,a_ItemHealth); self->Add(a_ItemType,a_ItemCount,a_ItemDamage);
} }
} }
return 0; return 0;
@ -12743,12 +12743,12 @@ static int tolua_AllToLua_cItems_Set01(lua_State* tolua_S)
int a_Idx = ((int) tolua_tonumber(tolua_S,2,0)); int a_Idx = ((int) tolua_tonumber(tolua_S,2,0));
ENUM_ITEM_ID a_ItemType = ((ENUM_ITEM_ID) (int) tolua_tonumber(tolua_S,3,0)); ENUM_ITEM_ID a_ItemType = ((ENUM_ITEM_ID) (int) tolua_tonumber(tolua_S,3,0));
char a_ItemCount = ((char) tolua_tonumber(tolua_S,4,0)); char a_ItemCount = ((char) tolua_tonumber(tolua_S,4,0));
short a_ItemHealth = ((short) tolua_tonumber(tolua_S,5,0)); short a_ItemDamage = ((short) tolua_tonumber(tolua_S,5,0));
#ifndef TOLUA_RELEASE #ifndef TOLUA_RELEASE
if (!self) tolua_error(tolua_S,"invalid 'self' in function 'Set'", NULL); if (!self) tolua_error(tolua_S,"invalid 'self' in function 'Set'", NULL);
#endif #endif
{ {
self->Set(a_Idx,a_ItemType,a_ItemCount,a_ItemHealth); self->Set(a_Idx,a_ItemType,a_ItemCount,a_ItemDamage);
} }
} }
return 0; return 0;
@ -21256,7 +21256,7 @@ TOLUA_API int tolua_AllToLua_open (lua_State* tolua_S)
tolua_constant(tolua_S,"HOOK_CHAT",cPluginManager::HOOK_CHAT); tolua_constant(tolua_S,"HOOK_CHAT",cPluginManager::HOOK_CHAT);
tolua_constant(tolua_S,"HOOK_CHUNK_GENERATED",cPluginManager::HOOK_CHUNK_GENERATED); tolua_constant(tolua_S,"HOOK_CHUNK_GENERATED",cPluginManager::HOOK_CHUNK_GENERATED);
tolua_constant(tolua_S,"HOOK_CHUNK_GENERATING",cPluginManager::HOOK_CHUNK_GENERATING); tolua_constant(tolua_S,"HOOK_CHUNK_GENERATING",cPluginManager::HOOK_CHUNK_GENERATING);
tolua_constant(tolua_S,"HOOK_COLLECT_PICKUP",cPluginManager::HOOK_COLLECT_PICKUP); tolua_constant(tolua_S,"HOOK_COLLECTING_PICKUP",cPluginManager::HOOK_COLLECTING_PICKUP);
tolua_constant(tolua_S,"HOOK_CRAFTING_NO_RECIPE",cPluginManager::HOOK_CRAFTING_NO_RECIPE); tolua_constant(tolua_S,"HOOK_CRAFTING_NO_RECIPE",cPluginManager::HOOK_CRAFTING_NO_RECIPE);
tolua_constant(tolua_S,"HOOK_DISCONNECT",cPluginManager::HOOK_DISCONNECT); tolua_constant(tolua_S,"HOOK_DISCONNECT",cPluginManager::HOOK_DISCONNECT);
tolua_constant(tolua_S,"HOOK_HANDSHAKE",cPluginManager::HOOK_HANDSHAKE); tolua_constant(tolua_S,"HOOK_HANDSHAKE",cPluginManager::HOOK_HANDSHAKE);

View File

@ -1,6 +1,6 @@
/* /*
** Lua binding: AllToLua ** Lua binding: AllToLua
** Generated automatically by tolua++-1.0.92 on 01/27/13 07:29:49. ** Generated automatically by tolua++-1.0.92 on 01/28/13 17:07:08.
*/ */
/* Exported function */ /* Exported function */

View File

@ -240,7 +240,7 @@ bool cPickup::CollectedBy(cPlayer * a_Dest)
return false; // Not old enough return false; // Not old enough
} }
if (cRoot::Get()->GetPluginManager()->CallHookCollectPickup(a_Dest, *this)) if (cRoot::Get()->GetPluginManager()->CallHookCollectingPickup(a_Dest, *this))
{ {
return false; return false;
} }

View File

@ -92,7 +92,7 @@ bool cPlugin::OnChunkGenerating(cWorld * a_World, int a_ChunkX, int a_ChunkZ, cC
bool cPlugin::OnCollectPickup(cPlayer * a_Player, cPickup * a_Pickup) bool cPlugin::OnCollectingPickup(cPlayer * a_Player, cPickup * a_Pickup)
{ {
UNUSED(a_Player); UNUSED(a_Player);
UNUSED(a_Pickup); UNUSED(a_Pickup);

View File

@ -52,7 +52,7 @@ public:
virtual bool OnChat (cPlayer * a_Player, const AString & a_Message); virtual bool OnChat (cPlayer * a_Player, const AString & a_Message);
virtual bool OnChunkGenerated (cWorld * a_World, int a_ChunkX, int a_ChunkZ); virtual bool OnChunkGenerated (cWorld * a_World, int a_ChunkX, int a_ChunkZ);
virtual bool OnChunkGenerating (cWorld * a_World, int a_ChunkX, int a_ChunkZ, cChunkDesc * a_pLuaChunk); virtual bool OnChunkGenerating (cWorld * a_World, int a_ChunkX, int a_ChunkZ, cChunkDesc * a_pLuaChunk);
virtual bool OnCollectPickup (cPlayer * a_Player, cPickup * a_Pickup); virtual bool OnCollectingPickup (cPlayer * a_Player, cPickup * a_Pickup);
virtual bool OnCraftingNoRecipe (const cPlayer * a_Player, const cCraftingGrid * a_Grid, cCraftingRecipe * a_Recipe); virtual bool OnCraftingNoRecipe (const cPlayer * a_Player, const cCraftingGrid * a_Grid, cCraftingRecipe * a_Recipe);
virtual bool OnDisconnect (cPlayer * a_Player, const AString & a_Reason); virtual bool OnDisconnect (cPlayer * a_Player, const AString & a_Reason);
virtual bool OnHandshake (cClientHandle * a_Client, const AString & a_Username); virtual bool OnHandshake (cClientHandle * a_Client, const AString & a_Username);

View File

@ -323,16 +323,16 @@ bool cPluginManager::CallHookChunkGenerating(cWorld * a_World, int a_ChunkX, int
bool cPluginManager::CallHookCollectPickup(cPlayer * a_Player, cPickup & a_Pickup) bool cPluginManager::CallHookCollectingPickup(cPlayer * a_Player, cPickup & a_Pickup)
{ {
HookMap::iterator Plugins = m_Hooks.find(HOOK_COLLECT_PICKUP); HookMap::iterator Plugins = m_Hooks.find(HOOK_COLLECTING_PICKUP);
if (Plugins == m_Hooks.end()) if (Plugins == m_Hooks.end())
{ {
return false; return false;
} }
for (PluginList::iterator itr = Plugins->second.begin(); itr != Plugins->second.end(); ++itr) for (PluginList::iterator itr = Plugins->second.begin(); itr != Plugins->second.end(); ++itr)
{ {
if ((*itr)->OnCollectPickup(a_Player, &a_Pickup)) if ((*itr)->OnCollectingPickup(a_Player, &a_Pickup))
{ {
return true; return true;
} }

View File

@ -50,7 +50,7 @@ public: // tolua_export
HOOK_CHAT, HOOK_CHAT,
HOOK_CHUNK_GENERATED, HOOK_CHUNK_GENERATED,
HOOK_CHUNK_GENERATING, HOOK_CHUNK_GENERATING,
HOOK_COLLECT_PICKUP, HOOK_COLLECTING_PICKUP,
HOOK_CRAFTING_NO_RECIPE, HOOK_CRAFTING_NO_RECIPE,
HOOK_DISCONNECT, HOOK_DISCONNECT,
HOOK_HANDSHAKE, HOOK_HANDSHAKE,
@ -102,7 +102,7 @@ public: // tolua_export
bool CallHookChat (cPlayer * a_Player, const AString & a_Message); bool CallHookChat (cPlayer * a_Player, const AString & a_Message);
bool CallHookChunkGenerated (cWorld * a_World, int a_ChunkX, int a_ChunkZ); bool CallHookChunkGenerated (cWorld * a_World, int a_ChunkX, int a_ChunkZ);
bool CallHookChunkGenerating (cWorld * a_World, int a_ChunkX, int a_ChunkZ, cChunkDesc * a_Chunk); bool CallHookChunkGenerating (cWorld * a_World, int a_ChunkX, int a_ChunkZ, cChunkDesc * a_Chunk);
bool CallHookCollectPickup (cPlayer * a_Player, cPickup & a_Pickup); bool CallHookCollectingPickup (cPlayer * a_Player, cPickup & a_Pickup);
bool CallHookCraftingNoRecipe (const cPlayer * a_Player, const cCraftingGrid * a_Grid, cCraftingRecipe * a_Recipe); bool CallHookCraftingNoRecipe (const cPlayer * a_Player, const cCraftingGrid * a_Grid, cCraftingRecipe * a_Recipe);
bool CallHookDisconnect (cPlayer * a_Player, const AString & a_Reason); bool CallHookDisconnect (cPlayer * a_Player, const AString & a_Reason);
bool CallHookHandshake (cClientHandle * a_ClientHandle, const AString & a_Username); bool CallHookHandshake (cClientHandle * a_ClientHandle, const AString & a_Username);

View File

@ -280,10 +280,10 @@ bool cPlugin_NewLua::OnChunkGenerating(cWorld * a_World, int a_ChunkX, int a_Chu
bool cPlugin_NewLua::OnCollectPickup(cPlayer * a_Player, cPickup * a_Pickup) bool cPlugin_NewLua::OnCollectingPickup(cPlayer * a_Player, cPickup * a_Pickup)
{ {
cCSLock Lock(m_CriticalSection); cCSLock Lock(m_CriticalSection);
const char * FnName = GetHookFnName(cPluginManager::HOOK_COLLECT_PICKUP); const char * FnName = GetHookFnName(cPluginManager::HOOK_COLLECTING_PICKUP);
ASSERT(FnName != NULL); ASSERT(FnName != NULL);
if (!PushFunction(FnName)) if (!PushFunction(FnName))
{ {
@ -1190,7 +1190,7 @@ const char * cPlugin_NewLua::GetHookFnName(cPluginManager::PluginHook a_Hook)
case cPluginManager::HOOK_CHAT: return "OnChat"; case cPluginManager::HOOK_CHAT: return "OnChat";
case cPluginManager::HOOK_CHUNK_GENERATED: return "OnChunkGenerated"; case cPluginManager::HOOK_CHUNK_GENERATED: return "OnChunkGenerated";
case cPluginManager::HOOK_CHUNK_GENERATING: return "OnChunkGenerating"; case cPluginManager::HOOK_CHUNK_GENERATING: return "OnChunkGenerating";
case cPluginManager::HOOK_COLLECT_PICKUP: return "OnCollectPickup"; case cPluginManager::HOOK_COLLECTING_PICKUP: return "OnCollectingPickup";
case cPluginManager::HOOK_CRAFTING_NO_RECIPE: return "OnCraftingNoRecipe"; case cPluginManager::HOOK_CRAFTING_NO_RECIPE: return "OnCraftingNoRecipe";
case cPluginManager::HOOK_DISCONNECT: return "OnDisconnect"; case cPluginManager::HOOK_DISCONNECT: return "OnDisconnect";
case cPluginManager::HOOK_HANDSHAKE: return "OnHandshake"; case cPluginManager::HOOK_HANDSHAKE: return "OnHandshake";

View File

@ -34,7 +34,7 @@ public:
virtual bool OnChat (cPlayer * a_Player, const AString & a_Message) override; virtual bool OnChat (cPlayer * a_Player, const AString & a_Message) override;
virtual bool OnChunkGenerated (cWorld * a_World, int a_ChunkX, int a_ChunkZ) override; virtual bool OnChunkGenerated (cWorld * a_World, int a_ChunkX, int a_ChunkZ) override;
virtual bool OnChunkGenerating (cWorld * a_World, int a_ChunkX, int a_ChunkZ, cChunkDesc * a_pLuaChunk ) override; virtual bool OnChunkGenerating (cWorld * a_World, int a_ChunkX, int a_ChunkZ, cChunkDesc * a_pLuaChunk ) override;
virtual bool OnCollectPickup (cPlayer * a_Player, cPickup * a_Pickup) override; virtual bool OnCollectingPickup (cPlayer * a_Player, cPickup * a_Pickup) override;
virtual bool OnCraftingNoRecipe (const cPlayer * a_Player, const cCraftingGrid * a_Grid, cCraftingRecipe * a_Recipe) override; virtual bool OnCraftingNoRecipe (const cPlayer * a_Player, const cCraftingGrid * a_Grid, cCraftingRecipe * a_Recipe) override;
virtual bool OnDisconnect (cPlayer * a_Player, const AString & a_Reason) override; virtual bool OnDisconnect (cPlayer * a_Player, const AString & a_Reason) override;
virtual bool OnHandshake (cClientHandle * a_Client, const AString & a_Username) override; virtual bool OnHandshake (cClientHandle * a_Client, const AString & a_Username) override;