Added serverinfo module (needs rewrite)
This commit is contained in:
parent
43c03800dd
commit
524d7a6c92
1 changed files with 29 additions and 0 deletions
29
modules/server/sv_serverinfo.txt
Normal file
29
modules/server/sv_serverinfo.txt
Normal 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
|
Loading…
Reference in a new issue