Added serverinfo module (needs rewrite)

This commit is contained in:
Logan G 2022-03-25 23:44:05 -06:00
parent 43c03800dd
commit 524d7a6c92
Signed by: logan
GPG key ID: E328528C921E7A7A

View file

@ -0,0 +1,29 @@
--@name
--@author
--@server
do
local function getServerInfo()
-- Old, use core:log
print(core.colors.logo, "[L-SFT] ", core.colors.text, "-------------------------")
print(core.colors.logo, "[L-SFT] ", core.colors.info, "Name: ", core.colors.text, game.getHostname())
print(core.colors.logo, "[L-SFT] ", core.colors.info, "Players: ", core.colors.text, #find.allPlayers().."/"..game.getMaxPlayers())
print(core.colors.logo, "[L-SFT] ", core.colors.info, "Map: ", core.colors.text, game.getMap())
print(core.colors.logo, "[L-SFT] ", core.colors.info, "Tickrate: ", core.colors.text, math.round(1/game.getTickInterval()).." t/s")
print(core.colors.logo, "[L-SFT] ", core.colors.info, "Is Dedicated: ", core.colors.text, game.isDedicated())
print(core.colors.logo, "[L-SFT] ", core.colors.text, "-------------------------")
end
core.modules.serverinfo = {
version = 1,
desc = "Provides basic server info.",
commands = {
serverinfo = {
usage = "serverinfo",
desc = "Prints basic server information to the chat.",
func = getServerInfo,
},
},
}
end