@@ -810,10 +810,6 @@ MSync.modules[info.ModuleIdentifier].init = function( transaction )
810810 ]]
811811 MSync .modules [info .ModuleIdentifier ].loadSettings ()
812812
813- if not MSync .modules [info .ModuleIdentifier ].banTable then
814- MSync .log (MSYNC_DBG_WARNING , " [MBSync] Ban table not found yet, requesting now" )
815- MSync .modules [info .ModuleIdentifier ].getActiveBans ()
816- end
817813end
818814
819815--[[
@@ -1395,13 +1391,6 @@ end
13951391 Define hooks your module is listening on e.g. PlayerDisconnect
13961392]]
13971393MSync .modules [info .ModuleIdentifier ].hooks = function ()
1398- --[[
1399- This hook starts the timers for the asynchronous ban data loading and the check if one of the online players has been banned
1400- ]]
1401- timer .Create (" msync." .. info .ModuleIdentifier .. " .getActiveBans" , MSync .modules [info .ModuleIdentifier ].settings .syncDelay , 0 , function ()
1402- MSync .modules [info .ModuleIdentifier ].getActiveBans ()
1403- end )
1404- MSync .modules [info .ModuleIdentifier ].getActiveBans ()
14051394
14061395 hook .Add (" CheckPassword" , " msync." .. info .ModuleIdentifier .. " .banCheck" , function ( steamid64 )
14071396 MSync .log (MSYNC_DBG_DEBUG , " [MBSync] Checking ban status for \" " .. steamid64 .. " \" " )
@@ -1525,6 +1514,22 @@ MSync.modules[info.ModuleIdentifier].hooks = function()
15251514 end
15261515 MSync .modules [info .ModuleIdentifier ].unBanUser (steamid , admin_id )
15271516 end )
1517+
1518+ hook .Add (" MSyncModuleLoaded" , " msync.mbsync.loadData" , function ( msync_module )
1519+ if (not msync_module or msync_module == info .ModuleIdentifier ) and not MSync .modules [info .ModuleIdentifier ].banTable then
1520+ if not MSync .modules [info .ModuleIdentifier ].banTable then
1521+ MSync .log (MSYNC_DBG_WARNING , " [MBSync] Ban table not found yet, requesting now" )
1522+ MSync .modules [info .ModuleIdentifier ].getActiveBans ()
1523+ end
1524+
1525+ --[[
1526+ Start timer to asynchroniously resync data
1527+ ]]
1528+ timer .Create (" msync." .. info .ModuleIdentifier .. " .getActiveBans" , MSync .modules [info .ModuleIdentifier ].settings .syncDelay , 0 , function ()
1529+ MSync .modules [info .ModuleIdentifier ].getActiveBans ()
1530+ end )
1531+ end
1532+ end )
15281533end
15291534
15301535--[[
0 commit comments