diff options
author | Howaner <franzi.moos@googlemail.com> | 2014-08-16 18:02:16 +0200 |
---|---|---|
committer | Howaner <franzi.moos@googlemail.com> | 2014-08-16 18:02:16 +0200 |
commit | 9395cf0bca15371b8dfdb7a444c1e9f7cca0252c (patch) | |
tree | 4d5252d0d5fd44ff05f5429cd11853e7d9b4d75f /src/Bindings/PluginLua.cpp | |
parent | Merge pull request #1316 from ChriPiv/master (diff) | |
download | cuberite-9395cf0bca15371b8dfdb7a444c1e9f7cca0252c.tar cuberite-9395cf0bca15371b8dfdb7a444c1e9f7cca0252c.tar.gz cuberite-9395cf0bca15371b8dfdb7a444c1e9f7cca0252c.tar.bz2 cuberite-9395cf0bca15371b8dfdb7a444c1e9f7cca0252c.tar.lz cuberite-9395cf0bca15371b8dfdb7a444c1e9f7cca0252c.tar.xz cuberite-9395cf0bca15371b8dfdb7a444c1e9f7cca0252c.tar.zst cuberite-9395cf0bca15371b8dfdb7a444c1e9f7cca0252c.zip |
Diffstat (limited to 'src/Bindings/PluginLua.cpp')
-rw-r--r-- | src/Bindings/PluginLua.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/Bindings/PluginLua.cpp b/src/Bindings/PluginLua.cpp index 0f3f25d75..066e050d6 100644 --- a/src/Bindings/PluginLua.cpp +++ b/src/Bindings/PluginLua.cpp @@ -1193,6 +1193,26 @@ bool cPluginLua::OnProjectileHitEntity(cProjectileEntity & a_Projectile, cEntity +bool cPluginLua::OnServerPing(const AString & a_Username, AString & a_Motd, int & a_OnlinePlayersCount, int & a_MaxPlayersCount, AString & a_Favicon) +{ + cCSLock Lock(m_CriticalSection); + bool res = false; + cLuaRefs & Refs = m_HookMap[cPluginManager::HOOK_SERVER_PING]; + for (cLuaRefs::iterator itr = Refs.begin(), end = Refs.end(); itr != end; ++itr) + { + m_LuaState.Call((int)(**itr), a_Username, a_Motd, a_OnlinePlayersCount, a_MaxPlayersCount, a_Favicon, cLuaState::Return, res, a_Motd, a_OnlinePlayersCount, a_MaxPlayersCount, a_Favicon); + if (res) + { + return true; + } + } + return false; +} + + + + + bool cPluginLua::OnSpawnedEntity(cWorld & a_World, cEntity & a_Entity) { cCSLock Lock(m_CriticalSection); |