Skip to content

Commit

Permalink
Merge pull request #74 from Aperture-Development/development
Browse files Browse the repository at this point in the history
Critical bugfix
  • Loading branch information
ApertureDevelopment authored Jan 31, 2022
2 parents 49127f3 + 3315904 commit 4dcdf8d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lua/msync/server/sv_modules.lua
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ function MSync.enableModule( module )
if MSync.modules[module] then
MSync.log(MSYNC_DBG_DEBUG, "Module \"" .. module .. "\" enabled?: " .. tostring(MSync.settings.data.enabledModules[module]))
if not MSync.settings.data.enabledModules[module] then
if MSync.DBServer:ping() then
if MSync.DBServer:status() == mysqloo.DATABASE_CONNECTED then
local initTransaction = MSync.DBServer:createTransaction()

MSync.modules[module].init(initTransaction)
Expand Down
4 changes: 2 additions & 2 deletions lua/msync/server/sv_net.lua
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function MSync.net.dbStatus(ply)
MSync.log(MSYNC_DBG_DEBUG, "Exec: net.dbStatus. Param.: " .. tostring(ply))
net.Start("msync.dbStatus")
if MSync.DBServer then
net.WriteBool(MSync.DBServer:ping())
net.WriteBool(MSync.DBServer:status() == mysqloo.DATABASE_CONNECTED and true or false)
else
net.WriteBool(false)
end
Expand Down Expand Up @@ -190,7 +190,7 @@ net.Receive("msync.connectDB", function(len, ply)
if not ply:query("msync.connectDB") then return end

if MSync.DBServer then
if not MSync.DBServer:ping() then
if not (MSync.DBServer:status() == mysqloo.DATABASE_CONNECTED) then
MSync.mysql.initialize()
else
MSync.net.sendMessage(ply, "error", "The database is already connected!")
Expand Down

0 comments on commit 4dcdf8d

Please sign in to comment.