summaryrefslogtreecommitdiffstats
path: root/src/Bindings/PluginLua.cpp
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-08-16 18:02:16 +0200
committerHowaner <franzi.moos@googlemail.com>2014-08-16 18:02:16 +0200
commit9395cf0bca15371b8dfdb7a444c1e9f7cca0252c (patch)
tree4d5252d0d5fd44ff05f5429cd11853e7d9b4d75f /src/Bindings/PluginLua.cpp
parentMerge pull request #1316 from ChriPiv/master (diff)
downloadcuberite-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 '')
-rw-r--r--src/Bindings/PluginLua.cpp20
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);