mirror of
https://github.com/gmod-integration/lua.git
synced 2025-03-15 22:07:34 +00:00
fix: send public config on modif
This commit is contained in:
parent
ce4d1be667
commit
3bb44ccbc0
|
@ -35,7 +35,7 @@ local netReceive = {
|
||||||
gmInte.showTestConnection(data)
|
gmInte.showTestConnection(data)
|
||||||
end,
|
end,
|
||||||
[5] = function(data)
|
[5] = function(data)
|
||||||
gmInte.config = data
|
gmInte.config = table.Merge(gmInte.config, data)
|
||||||
end,
|
end,
|
||||||
[6] = function(data)
|
[6] = function(data)
|
||||||
gmInte.chatAddText(data)
|
gmInte.chatAddText(data)
|
||||||
|
|
|
@ -14,6 +14,14 @@ function gmInte.saveSetting(setting, value)
|
||||||
gmInte.config[setting] = value
|
gmInte.config[setting] = value
|
||||||
file.Write("gm_integration/config.json", util.TableToJSON(gmInte.config, true))
|
file.Write("gm_integration/config.json", util.TableToJSON(gmInte.config, true))
|
||||||
gmInte.log("Setting Saved")
|
gmInte.log("Setting Saved")
|
||||||
|
|
||||||
|
// send to all players if it's a public setting
|
||||||
|
for _, ply in pairs(player.GetAll()) do
|
||||||
|
if (ply:IsValid() && ply:IsPlayer(ply)) then
|
||||||
|
gmInte.log("Sending new Public Config to " .. ply:Nick())
|
||||||
|
gmInte.publicGetConfig(ply)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function gmInte.tryConfig()
|
function gmInte.tryConfig()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user