fix: send public config on modif

This commit is contained in:
Linventif 2024-03-13 20:30:23 +01:00
parent ce4d1be667
commit 3bb44ccbc0
No known key found for this signature in database
GPG Key ID: FAC0CA60F9AEEC24
2 changed files with 9 additions and 1 deletions

View File

@ -35,7 +35,7 @@ local netReceive = {
gmInte.showTestConnection(data)
end,
[5] = function(data)
gmInte.config = data
gmInte.config = table.Merge(gmInte.config, data)
end,
[6] = function(data)
gmInte.chatAddText(data)

View File

@ -14,6 +14,14 @@ function gmInte.saveSetting(setting, value)
gmInte.config[setting] = value
file.Write("gm_integration/config.json", util.TableToJSON(gmInte.config, true))
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
function gmInte.tryConfig()