Skip to content

Commit

Permalink
Merge pull request #24 from Aperture-Development/development
Browse files Browse the repository at this point in the history
Bugfix for #22
  • Loading branch information
ApertureDevelopment authored May 9, 2020
2 parents c683cf4 + bacc115 commit ac621f0
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
9 changes: 6 additions & 3 deletions lua/msync/client_gui/cl_admin_gui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,12 @@ function MSync.AdminPanel.InitModuleSettings( sheet )

for k, v in pairs(files) do
local info = include("msync/client_gui/modules/"..v)
MSync.modules[info.ModuleIdentifier]["init"]()
MSync.modules[info.ModuleIdentifier]["net"]()
pnl:AddSheet( info.Name, MSync.modules[info.ModuleIdentifier].adminPanel(pnl))

if MSync.moduleState[info["ModuleIdentifier"]] then
MSync.modules[info.ModuleIdentifier]["init"]()
MSync.modules[info.ModuleIdentifier]["net"]()
pnl:AddSheet( info.Name, MSync.modules[info.ModuleIdentifier].adminPanel(pnl))
end
end

return pnl
Expand Down
13 changes: 7 additions & 6 deletions lua/msync/client_gui/cl_modules.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ end
function MSync.initModules()

for k,v in pairs(MSync.modules) do
if not MSync.moduleState[v["info"]["ModuleIdentifier"]] then return end;
v["init"]()
v["net"]()
v["ulx"]()
v["hooks"]()
print("["..v["info"]["Name"].."] Module loaded")
if MSync.moduleState[v["info"]["ModuleIdentifier"]] then
v["init"]()
v["net"]()
v["ulx"]()
v["hooks"]()
print("["..v["info"]["Name"].."] Module loaded")
end
end

end
Expand Down
2 changes: 1 addition & 1 deletion lua/msync/server/sv_init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ end
Returns: safe settings table
]]
function MSync.func.getSafeSettings()
local settings = MSync.settings.data
local settings = table.Copy(MSync.settings.data)
settings.mysql.password = nil

return settings
Expand Down
3 changes: 1 addition & 2 deletions lua/msync/server/sv_net.lua
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ end )
util.AddNetworkString("msync.getSettings")
net.Receive("msync.getSettings", function(len, ply)
if not ply:query("msync.getSettings") then return end

MSync.net.sendTable(ply, "settings", MSync.func.getSafeSettings())
end )

Expand All @@ -126,9 +125,9 @@ util.AddNetworkString("msync.toggleModule")
net.Receive("msync.toggleModule", function(len, ply)
if not ply:query("msync.toggleModule") then return end


local ident = net.ReadString()
local state = net.ReadString()

if state == "Enable" then
MSync.settings.data.enabledModules[ident] = true
elseif state == "Disable" then
Expand Down

0 comments on commit ac621f0

Please sign in to comment.