Added focus module (test, to be replaced)

This commit is contained in:
Logan G 2021-12-16 00:08:40 -07:00
parent eacaa63725
commit 2b0031c683
Signed by: logan
GPG key ID: E328528C921E7A7A
2 changed files with 36 additions and 0 deletions

View file

@ -0,0 +1,9 @@
--@name
--@author
--@client
net.receive("LSFT-Get-Focused", function(data)
net.start("LSFT-Get-Focused-Resp")
net.writeBool(game.hasFocus())
net.send()
end)

View file

@ -0,0 +1,27 @@
--@name
--@author
--@server
do
function getFocused()
net.start("LSFT-Get-Focused")
net.send()
end
net.receive("LSFT-Get-Focused-Resp", function(data, ply)
print(ply:getName(), net.readBool())
end)
core.modules.getfocus = {
version = 1,
desc = "Queries all players to see if their game is focused.",
commands = {
focus = {
func = getFocused,
usage = "focus",
desc = "Prints a list of what the current state of getFocused() is for each player on the server",
},
},
}
end