aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorkilbith <kilbith@users.noreply.github.com>2017-02-03 14:53:43 +0100
committerZeno- <kde.psych@gmail.com>2017-02-03 23:53:43 +1000
commit03b34cb3dd0647b3e378f00cdc7203e580c9dcc8 (patch)
tree20e3a025c31befce23ceea280fa81fe791974aab /src
parent3b9ae409c7d7e9445099b86c85392dba4771e08a (diff)
downloadminetest-03b34cb3dd0647b3e378f00cdc7203e580c9dcc8.tar.gz
minetest-03b34cb3dd0647b3e378f00cdc7203e580c9dcc8.tar.bz2
minetest-03b34cb3dd0647b3e378f00cdc7203e580c9dcc8.zip
Serverlist: Add ping indicators (#5164)
Diffstat (limited to 'src')
-rw-r--r--src/script/lua_api/l_mainmenu.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/script/lua_api/l_mainmenu.cpp b/src/script/lua_api/l_mainmenu.cpp
index 4a2484613..de8890b11 100644
--- a/src/script/lua_api/l_mainmenu.cpp
+++ b/src/script/lua_api/l_mainmenu.cpp
@@ -577,6 +577,13 @@ int ModApiMainMenu::l_get_favorites(lua_State *L)
lua_settable(L, top_lvl2);
}
+ if (servers[i].isMember("ping")) {
+ float ping = servers[i]["ping"].asFloat();
+ lua_pushstring(L, "ping");
+ lua_pushnumber(L, ping);
+ lua_settable(L, top_lvl2);
+ }
+
lua_settable(L, top);
index++;
}