Commit d159ba9f authored by Maximilian Grüttemeier's avatar Maximilian Grüttemeier
Browse files

Admin Panel Functionality and Bugfix

- Fixed a bug with the transmission count being off
- Fixed a bug where the ban table would not show permanently banned people
- Added first functionality to the Admin Panel
parent 208f5da5
Loading
Loading
Loading
Loading
+525 −506

File changed.

Preview size limit exceeded, changes collapsed.

+4 −3
Original line number Diff line number Diff line
@@ -350,7 +350,7 @@ MSync.modules[info.ModuleIdentifier].init = function( transaction )
                end
            else
                for k,v in pairs(data) do
                    if not v['unban_admin.steamid'] and not ((v.date_unix+v.length_unix) < os.time()) then
                    if not v['unban_admin.steamid'] and ((not((v.date_unix+v.length_unix) < os.time())) or (v.length_unix==0)) then
                        banTable[v["banned.steamid64"]] = {
                            banId = v.p_id,
                            reason = v.reason,
@@ -369,8 +369,9 @@ MSync.modules[info.ModuleIdentifier].init = function( transaction )
            end

            --MSync.modules[info.ModuleIdentifier].sendSettings(ply, banTable)

            MSync.modules[info.ModuleIdentifier].sendCount(ply, math.Round(table.Count(banTable) / 10))
            -- We need to add 0.4 to the calculated number to guarantee that we always round up to the next highest number 
            -- Luckily because we always calculate with whole numbers (there is no half ban) this should be enough to guarantee that we always send enough packages
            MSync.modules[info.ModuleIdentifier].sendCount(ply, math.Round((table.Count(banTable) / 10)+0.4))
            local tempTable = MSync.modules[info.ModuleIdentifier].splitTable(banTable)
            for k,v in pairs(tempTable) do
                MSync.modules[info.ModuleIdentifier].sendPart(ply, v)