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

Finishing Admin Panel Functionality & Code Cleanup

- Added Search functionality to the admin panel
- Added Load and reload to AP
- Fixed GUI bug with RowRightClick in AP
- Added Settings functionality to AP
- Cleaned up the code
parent d159ba9f
Loading
Loading
Loading
Loading
+131 −64
Original line number Diff line number Diff line
@@ -751,6 +751,8 @@ MSync.modules[info.ModuleIdentifier].adminPanel = function(sheet)
    local pnl = vgui.Create( "DPanel", sheet )
    pnl:Dock(FILL)

    MSync.modules[info.ModuleIdentifier].getSettings()

    local delay_text = vgui.Create( "DLabel", pnl )
    delay_text:SetPos( 10, 5 )
    delay_text:SetColor( Color( 0, 0, 0 ) )
@@ -783,23 +785,8 @@ MSync.modules[info.ModuleIdentifier].adminPanel = function(sheet)
    search_button:SetPos( 180, 65 )
    search_button:SetSize( 60, 20 )

    --[[
    local sort_button = vgui.Create( "DButton", pnl )
    sort_button:SetText( "Sort by: [INSERT]" )
    sort_button:SetPos( 240, 65 )
    sort_button:SetSize( 120, 20 )
    sort_button.DoClick = function()
        if search_button:GetValue() and not MSync.modules.MRSync.settings.nosync[allserver_textentry:GetValue()] and not MSync.modules.MRSync.settings.syncall[allserver_textentry:GetValue()] then
            allserver_table:AddLine(allserver_textentry:GetValue())
            MSync.modules.MRSync.settings.syncall[allserver_textentry:GetValue()] = true
            allserver_textentry:SetText("")
            MSync.modules.MRSync.sendSettings()
        end
    end
    ]]

    local reload_button = vgui.Create( "DButton", pnl )
    reload_button:SetText( "Reload" )
    reload_button:SetText( "Load Data" )
    reload_button:SetPos( 380, 65 )
    reload_button:SetSize( 65, 20 )

@@ -839,12 +826,51 @@ MSync.modules[info.ModuleIdentifier].adminPanel = function(sheet)
    }
    ban_table:SortByColumn( sortby.Column, sortby.Descending )

    function displayTable(tbl)
        ban_table:Clear()
        for k,v in pairs(tbl) do
            local length = ""
            local unbanned = "false"

            if v["unBanningAdmin"] then
                unbanned = "true"
            end

            if v["length"] == 0 then
                length = "Permanent"
            else
                length = ULib.secondsToStringTime(v["length"])
            end

            ban_table:AddLine( v["banId"], v["steamid"], v["adminNickname"], length, v["reason"], unbanned)
        end
    end

    save_button.DoClick = function()
        --delay_textentry
        local num = tonumber(delay_textentry:GetValue())
        if num then
            if num < 30 then
                chat.AddText(Color(255, 60, 60),"[MBSync_ERROR] ",Color(255,170,0),"You should not select a value below ",Color(60, 255, 60),"30",Color(255,170,0)," seconds. We recommend to have it at ",Color(60, 255, 60),"300",Color(255,170,0)," seconds")
            else
                MSync.modules[info.ModuleIdentifier].settings["syncDelay"] = num
                MSync.modules[info.ModuleIdentifier].sendSettings()
            end
        else
            chat.AddText(Color(255, 60, 60),"[MBSync_ERROR] ",Color(255,170,0),"That is not a valid value!")
        end
    end

    search_button.DoClick = function()
        -- search_textentry
        if search_textentry:GetValue() then
            tempTable = {}
            tempTable = MSync.modules[info.ModuleIdentifier].searchTable(MSync.modules[info.ModuleIdentifier].banTable, search_textentry:GetValue())
            displayTable(tempTable)
            ban_table:SortByColumn( sortby.Column, sortby.Descending )
        else
            tempTable = MSync.modules[info.ModuleIdentifier].banTable
            displayTable(tempTable)
            ban_table:SortByColumn( sortby.Column, sortby.Descending )
        end
    end

    reload_button.DoClick = function()
@@ -854,7 +880,6 @@ MSync.modules[info.ModuleIdentifier].adminPanel = function(sheet)
            if MSync.modules[info.ModuleIdentifier].temporary["unfinished"] then return end

            tempTable = MSync.modules[info.ModuleIdentifier].banTable
            --PrintTable(tempTable)
            for k,v in pairs(tempTable) do
                local length = ""
                local unbanned = "false"
@@ -869,16 +894,27 @@ MSync.modules[info.ModuleIdentifier].adminPanel = function(sheet)
                    length = ULib.secondsToStringTime(v["length"])
                end

                ban_table:AddLine( v["banId"], v["nickname"], v["adminNickname"], length, v["reason"], unbanned)
                ban_table:AddLine( v["banId"], v["steamid"], v["adminNickname"], length, v["reason"], unbanned)
            end
            timer.Remove("msync.mbsync.waitForBanTable")
        end)
        reload_button:SetText("Reload")
    end

    ban_table.OnRowRightClick = function(panel, lineID, line)
        local ident = line:GetValue(1)
        local cursor_x, cursor_y = panel:CursorPos()
        print(cursor_x)
        local DMenu = vgui.Create("DMenu", panel)

        if cursor_y > 170 then
            cursor_y = 170
        end

        if cursor_x > 290 then
            cursor_x = 290
        end

        DMenu:SetPos(cursor_x, cursor_y)
        DMenu:AddOption("Unban")
        DMenu:AddOption("Edit")
@@ -956,6 +992,14 @@ MSync.modules[info.ModuleIdentifier].adminPanel = function(sheet)
        end
    end

    timer.Create("msync.mbsync.waitForSettings", 1, 0, function()
        if not MSync.modules[info.ModuleIdentifier].settings then return end

        delay_textentry:SetText(MSync.modules[info.ModuleIdentifier].settings["syncDelay"])

        timer.Remove("msync.mbsync.waitForSettings")
    end)

    return pnl
end

@@ -1274,7 +1318,7 @@ MSync.modules[info.ModuleIdentifier].net = function()
            userid = tonumber(userid)
        end

        net.Start("msync."..(info.ModuleIdentifier)..".unban")
        net.Start("msync."..info.ModuleIdentifier..".unban")
            net.WriteInt(userid)
        net.SendToServer()
    end
@@ -1282,7 +1326,7 @@ MSync.modules[info.ModuleIdentifier].net = function()
        Description: Net Receiver - Gets called when the server wants to print something to the user chat
        Returns: nothing
    ]]
    net.Receive( "msync."..(info.ModuleIdentifier)..".sendMessage", function( len, ply )
    net.Receive( "msync."..info.ModuleIdentifier..".sendMessage", function( len, ply )
        chat.AddText( Color( 237, 135, 26 ), "[MBSync] ", Color( 255, 255, 255), net.ReadString())
    end )

@@ -1290,7 +1334,7 @@ MSync.modules[info.ModuleIdentifier].net = function()
        Description: Net Receiver - Gets called when the client entered '!mban'
        Returns: nothing
    ]]
    net.Receive( "msync."..(info.ModuleIdentifier)..".openBanGUI", function( len, ply )
    net.Receive( "msync."..info.ModuleIdentifier..".openBanGUI", function( len, ply )
        MSync.modules[info.ModuleIdentifier].banPanel(net.ReadTable())
    end )

@@ -1298,7 +1342,7 @@ MSync.modules[info.ModuleIdentifier].net = function()
        Description: Net Receiver - Gets called when the client entered '!mbsync'
        Returns: nothing
    ]]
    net.Receive( "msync."..(info.ModuleIdentifier)..".openBanTable", function( len, ply )
    net.Receive( "msync."..info.ModuleIdentifier..".openBanTable", function( len, ply )
        MSync.modules[info.ModuleIdentifier].clientPanel()
    end )

@@ -1312,7 +1356,7 @@ MSync.modules[info.ModuleIdentifier].net = function()
        MSync.modules[info.ModuleIdentifier].temporary = {}
        MSync.modules[info.ModuleIdentifier].banTable = {}

        net.Start("msync."..(info.ModuleIdentifier)..".getBanTable")
        net.Start("msync."..info.ModuleIdentifier..".getBanTable")
            net.WriteBool(fulltable)
        net.SendToServer()
    end
@@ -1321,7 +1365,7 @@ MSync.modules[info.ModuleIdentifier].net = function()
        Description: Net Receiver - Gets called when the client entered '!mban'
        Returns: nothing
    ]]
    net.Receive( "msync."..(info.ModuleIdentifier)..".recieveDataCount", function( len, ply )
    net.Receive( "msync."..info.ModuleIdentifier..".recieveDataCount", function( len, ply )
        local num = net.ReadFloat()
        if not MSync.modules[info.ModuleIdentifier].temporary["unfinished"] then
            MSync.modules[info.ModuleIdentifier].temporary["count"] = num
@@ -1335,7 +1379,7 @@ MSync.modules[info.ModuleIdentifier].net = function()
        Description: Net Receiver - Gets called when the client entered '!mban'
        Returns: nothing
    ]]
    net.Receive( "msync."..(info.ModuleIdentifier)..".recieveData", function( len, ply )
    net.Receive( "msync."..info.ModuleIdentifier..".recieveData", function( len, ply )
        MSync.modules[info.ModuleIdentifier].explodeTable(MSync.modules[info.ModuleIdentifier].banTable, net.ReadTable())
        print(MSync.modules[info.ModuleIdentifier].temporary['recieved'])
        MSync.modules[info.ModuleIdentifier].temporary["recieved"] = MSync.modules[info.ModuleIdentifier].temporary["recieved"] + 1
@@ -1354,16 +1398,43 @@ MSync.modules[info.ModuleIdentifier].net = function()
                tempTable[v['banId']]['reason']         = v['reason']
                tempTable[v['banId']]['timestamp']      = v['timestamp']
                tempTable[v['banId']]['servergroup']    = v['servergroup']
                if v['banningAdmin']['nickname'] then
                if v['banningAdmin'] then
                    tempTable[v['banId']]['adminNickname']  = v['banningAdmin']['nickname']
                end
                if v['unBanningAdmin']['nickname'] then
                if v['unBanningAdmin'] then
                    tempTable[v['banId']]['unBanningAdmin']  = v['unBanningAdmin']['nickname']
                end
            end
            MSync.modules[info.ModuleIdentifier].banTable = tempTable
        end
    end )

    --[[
        Description: Net Receiver - Gets called when the server sent settings
        Returns: nothing
    ]]
    net.Receive( "msync."..info.ModuleIdentifier..".sendSettingsPly", function( len, ply )
        MSync.modules[info.ModuleIdentifier].settings = net.ReadTable()
    end )

    --[[
        Description: Function to request the settings from the server
        Returns: nothing
    ]]
    MSync.modules[info.ModuleIdentifier].getSettings = function()
        net.Start("msync."..info.ModuleIdentifier..".getSettings")
        net.SendToServer()
    end

    --[[
        Description: Function to request the settings from the server
        Returns: nothing
    ]]
    MSync.modules[info.ModuleIdentifier].sendSettings = function()
        net.Start("msync."..info.ModuleIdentifier..".sendSettings")
            net.WriteTable(MSync.modules[info.ModuleIdentifier].settings)
        net.SendToServer()
    end
end

--[[
@@ -1380,10 +1451,6 @@ MSync.modules[info.ModuleIdentifier].hooks = function()
    --
end


--MSync.modules[info.ModuleIdentifier].clientPanel()
--MSync.AdminPanel.InitPanel()

--[[
    Return info ( Just for single module loading )
]]
+66 −69
Original line number Diff line number Diff line
@@ -313,14 +313,11 @@ MSync.modules[info.ModuleIdentifier].init = function( transaction )
            ;
        ]] )

        

        getBansQ.onSuccess = function( q, data )

            local banTable = {}

            print("[MBSync] Recieved all ban data")
            --PrintTable(data)
            if fullTable then
                for k,v in pairs(data) do

@@ -558,12 +555,12 @@ MSync.modules[info.ModuleIdentifier].net = function()
            text [string] - the text you want to send to the client
        Returns: nothing
    ]]
    util.AddNetworkString("msync."..(info.ModuleIdentifier)..".sendMessage")
    util.AddNetworkString("msync."..info.ModuleIdentifier..".sendMessage")
    MSync.modules[info.ModuleIdentifier].msg = function(ply, content, type)
        if not type then type = 0 end
        -- Basic message
        if type == 0 then
            net.Start("msync."..(info.ModuleIdentifier)..".sendMessage")
            net.Start("msync."..info.ModuleIdentifier..".sendMessage")
                net.WriteFloat(type)
                net.WriteString(content)
            net.Send(ply)
@@ -577,9 +574,9 @@ MSync.modules[info.ModuleIdentifier].net = function()
            banTable [table] - the ban table
        Returns: nothing
    ]]
    util.AddNetworkString("msync."..(info.ModuleIdentifier)..".sendBanTable")
    util.AddNetworkString("msync."..info.ModuleIdentifier..".sendBanTable")
    MSync.modules[info.ModuleIdentifier].sendSettings = function(ply, banTable)
        net.Start("msync."..(info.ModuleIdentifier)..".sendBanTable")
        net.Start("msync."..info.ModuleIdentifier..".sendBanTable")
            net.WriteTable(banTable)
        net.Send(ply)
    end
@@ -590,9 +587,9 @@ MSync.modules[info.ModuleIdentifier].net = function()
            player [player] - the player that wants to open the admin GUI
        Returns: nothing
    ]]
    util.AddNetworkString("msync."..(info.ModuleIdentifier)..".openBanTable")
    util.AddNetworkString("msync."..info.ModuleIdentifier..".openBanTable")
    MSync.modules[info.ModuleIdentifier].openBanTable = function(ply)
        net.Start("msync."..(info.ModuleIdentifier)..".openBanTable")
        net.Start("msync."..info.ModuleIdentifier..".openBanTable")
        net.Send(ply)
    end

@@ -600,9 +597,9 @@ MSync.modules[info.ModuleIdentifier].net = function()
        Description: Net Receiver - Gets called when the client banned a player with the ban gui
        Returns: nothing
    ]]
    util.AddNetworkString("msync."..(info.ModuleIdentifier)..".banid")
    net.Receive("msync."..(info.ModuleIdentifier)..".banid", function(len, ply)
        if not ply:query("msync."..(info.ModuleIdentifier)..".banPlayer") then return end
    util.AddNetworkString("msync."..info.ModuleIdentifier..".banid")
    net.Receive("msync."..info.ModuleIdentifier..".banid", function(len, ply)
        if not ply:query("msync."..info.ModuleIdentifier..".banPlayer") then return end

        local ban = net.ReadTable()

@@ -635,9 +632,9 @@ MSync.modules[info.ModuleIdentifier].net = function()
        Description: Net Receiver - Gets called when the client edits a ban
        Returns: nothing
    ]]
    util.AddNetworkString("msync."..(info.ModuleIdentifier)..".editBan")
    net.Receive("msync."..(info.ModuleIdentifier)..".editBan", function(len, ply)
        if not ply:query("msync."..(info.ModuleIdentifier)..".banPlayer") then return end
    util.AddNetworkString("msync."..info.ModuleIdentifier..".editBan")
    net.Receive("msync."..info.ModuleIdentifier..".editBan", function(len, ply)
        if not ply:query("msync."..info.ModuleIdentifier..".banPlayer") then return end

        local editedBan = net.ReadTable()

@@ -670,9 +667,9 @@ MSync.modules[info.ModuleIdentifier].net = function()
        Description: Net Receiver - Gets called when the client tries to unban someone
        Returns: nothing
    ]]
    util.AddNetworkString("msync."..(info.ModuleIdentifier)..".unban")
    net.Receive("msync."..(info.ModuleIdentifier)..".unban", function(len, ply)
        if not ply:query("msync."..(info.ModuleIdentifier)..".unBanID") then return end
    util.AddNetworkString("msync."..info.ModuleIdentifier..".unban")
    net.Receive("msync."..info.ModuleIdentifier..".unban", function(len, ply)
        if not ply:query("msync."..info.ModuleIdentifier..".unBanID") then return end

        local banid = net.ReadInt()

@@ -792,7 +789,7 @@ MSync.modules[info.ModuleIdentifier].net = function()
            if not ply:query("msync.openAdminGUI") then return end
            MSync.modules[info.ModuleIdentifier].getBans(ply, fullTable)
        else
            if not ply:query("msync."..(info.ModuleIdentifier)..".openBanTable") then return end
            if not ply:query("msync."..info.ModuleIdentifier..".openBanTable") then return end
            MSync.modules[info.ModuleIdentifier].getBans(ply, false)
        end
    end )
@@ -818,7 +815,7 @@ MSync.modules[info.ModuleIdentifier].ulx = function()
            reason [string] - the ban reason - OPTIONAL - Default: "banned by staff"
    ]]
    MSync.modules[info.ModuleIdentifier].Chat.banPlayer = function(calling_ply, target_ply, length, allserver, reason)
        if not calling_ply:query("msync."..(info.ModuleIdentifier)..".banPlayer") then return end;
        if not calling_ply:query("msync."..info.ModuleIdentifier..".banPlayer") then return end;
        if not IsValid(calling_ply) then return end;

        if calling_ply == target_ply then
@@ -849,7 +846,7 @@ MSync.modules[info.ModuleIdentifier].ulx = function()
            MSync.modules[info.ModuleIdentifier].banUser(target_ply, calling_ply, length, reason, allserver)
        end
    end
    local BanPlayer = ulx.command( "MSync", "msync."..(info.ModuleIdentifier)..".banPlayer", MSync.modules[info.ModuleIdentifier].Chat.banPlayer, "!mban" )
    local BanPlayer = ulx.command( "MSync", "msync."..info.ModuleIdentifier..".banPlayer", MSync.modules[info.ModuleIdentifier].Chat.banPlayer, "!mban" )
    BanPlayer:addParam{ type=ULib.cmds.PlayerArg, hint="player", ULib.cmds.optional}
    BanPlayer:addParam{ type=ULib.cmds.NumArg, hint="minutes, 0 for perma", ULib.cmds.optional, ULib.cmds.allowTimeString, min=0 }
    BanPlayer:addParam{ type=ULib.cmds.StringArg, hint="true/false, if the player should be banned on all servers", ULib.cmds.optional }
@@ -869,7 +866,7 @@ MSync.modules[info.ModuleIdentifier].ulx = function()
            reason [string] - the ban reason - OPTIONAL - Default: "banned by staff"
    ]]
    MSync.modules[info.ModuleIdentifier].Chat.banSteamID = function(calling_ply, target_steamid, length, allserver, reason)
        if not calling_ply:query("msync."..(info.ModuleIdentifier)..".banSteamID") then return end;
        if not calling_ply:query("msync."..info.ModuleIdentifier..".banSteamID") then return end;

        --[[
            Check for empty or invalid steamid
@@ -901,7 +898,7 @@ MSync.modules[info.ModuleIdentifier].ulx = function()
        MSync.modules[info.ModuleIdentifier].banUserID(target_steamid, calling_ply, length, reason, allserver)

    end
    local BanPlayer = ulx.command( "MSync", "msync."..(info.ModuleIdentifier)..".banSteamID", MSync.modules[info.ModuleIdentifier].Chat.banSteamID, "!mbanid" )
    local BanPlayer = ulx.command( "MSync", "msync."..info.ModuleIdentifier..".banSteamID", MSync.modules[info.ModuleIdentifier].Chat.banSteamID, "!mbanid" )
    BanPlayer:addParam{ type=ULib.cmds.StringArg, hint="steamid"}
    BanPlayer:addParam{ type=ULib.cmds.NumArg, hint="minutes, 0 for perma", ULib.cmds.optional, ULib.cmds.allowTimeString, min=0 }
    BanPlayer:addParam{ type=ULib.cmds.StringArg, hint="true/false, if the player should be banned on all servers", ULib.cmds.optional }
@@ -918,7 +915,7 @@ MSync.modules[info.ModuleIdentifier].ulx = function()
            target_steamid [string] - the target steamid
    ]]
    MSync.modules[info.ModuleIdentifier].Chat.unBanID = function(calling_ply, target_steamid)
        if not calling_ply:query("msync."..(info.ModuleIdentifier)..".unBanID") then return end;
        if not calling_ply:query("msync."..info.ModuleIdentifier..".unBanID") then return end;

        --[[
            Check for empty or invalid steamid
@@ -930,7 +927,7 @@ MSync.modules[info.ModuleIdentifier].ulx = function()
        ]]
        MSync.modules[info.ModuleIdentifier].unBanUser(target_steamid, calling_ply)
    end
    local BanPlayer = ulx.command( "MSync", "msync."..(info.ModuleIdentifier)..".unBanID", MSync.modules[info.ModuleIdentifier].Chat.unBanID, "!munban" )
    local BanPlayer = ulx.command( "MSync", "msync."..info.ModuleIdentifier..".unBanID", MSync.modules[info.ModuleIdentifier].Chat.unBanID, "!munban" )
    BanPlayer:addParam{ type=ULib.cmds.StringArg, hint="steamid"}
    BanPlayer:defaultAccess( ULib.ACCESS_SUPERADMIN )
    BanPlayer:help( "Opens MSync Settings." )
@@ -944,7 +941,7 @@ MSync.modules[info.ModuleIdentifier].ulx = function()
            target_steamid [string] - the target steamid
    ]]
    MSync.modules[info.ModuleIdentifier].Chat.checkBan = function(calling_ply, target_steamid)
        if not calling_ply:query("msync."..(info.ModuleIdentifier)..".checkBan") then return end;
        if not calling_ply:query("msync."..info.ModuleIdentifier..".checkBan") then return end;

        if not target_steamid or not ULib.isValidSteamID(target_steamid) then return end

@@ -978,7 +975,7 @@ MSync.modules[info.ModuleIdentifier].ulx = function()


    end
    local BanPlayer = ulx.command( "MSync", "msync."..(info.ModuleIdentifier)..".checkBan", MSync.modules[info.ModuleIdentifier].Chat.checkBan, "!mcheck" )
    local BanPlayer = ulx.command( "MSync", "msync."..info.ModuleIdentifier..".checkBan", MSync.modules[info.ModuleIdentifier].Chat.checkBan, "!mcheck" )
    BanPlayer:addParam{ type=ULib.cmds.StringArg, hint="steamid"}
    BanPlayer:defaultAccess( ULib.ACCESS_SUPERADMIN )
    BanPlayer:help( "Opens MSync Settings." )
@@ -992,11 +989,11 @@ MSync.modules[info.ModuleIdentifier].ulx = function()
            none
    ]]
    MSync.modules[info.ModuleIdentifier].Chat.openBanTable = function(calling_ply)
        if not calling_ply:query("msync."..(info.ModuleIdentifier)..".openBanTable") then return end;
        if not calling_ply:query("msync."..info.ModuleIdentifier..".openBanTable") then return end;
        -- Open Ban Table
        MSync.modules[info.ModuleIdentifier].openBanTable(calling_ply)
    end
    local BanPlayer = ulx.command( "MSync", "msync."..(info.ModuleIdentifier)..".openBanTable", MSync.modules[info.ModuleIdentifier].Chat.openBanTable, "!mbsync" )
    local BanPlayer = ulx.command( "MSync", "msync."..info.ModuleIdentifier..".openBanTable", MSync.modules[info.ModuleIdentifier].Chat.openBanTable, "!mbsync" )
    BanPlayer:defaultAccess( ULib.ACCESS_SUPERADMIN )
    BanPlayer:help( "Opens MSync Settings." )

@@ -1012,7 +1009,7 @@ MSync.modules[info.ModuleIdentifier].ulx = function()
            reason [string] - the ban reason - OPTIONAL - Default: "banned by staff"
    ]]
    MSync.modules[info.ModuleIdentifier].Chat.editBan = function(calling_ply, ban_id, length, allserver, reason)
        if not calling_ply:query("msync."..(info.ModuleIdentifier)..".editBan") then return end;
        if not calling_ply:query("msync."..info.ModuleIdentifier..".editBan") then return end;
        if not IsValid(calling_ply) then return end;

        --[[
@@ -1037,7 +1034,7 @@ MSync.modules[info.ModuleIdentifier].ulx = function()
        ]]
        MSync.modules[info.ModuleIdentifier].editBan(tostring(ban_id), tostring(reason), tostring(length), calling_ply, allserver)
    end
    local EditBan = ulx.command( "MSync", "msync."..(info.ModuleIdentifier)..".editBan", MSync.modules[info.ModuleIdentifier].Chat.editBan, "!medit" )
    local EditBan = ulx.command( "MSync", "msync."..info.ModuleIdentifier..".editBan", MSync.modules[info.ModuleIdentifier].Chat.editBan, "!medit" )
    EditBan:addParam{ type=ULib.cmds.NumArg, hint="BanID"}
    EditBan:addParam{ type=ULib.cmds.NumArg, hint="minutes, 0 for perma", ULib.cmds.optional, ULib.cmds.allowTimeString, min=0 }
    EditBan:addParam{ type=ULib.cmds.StringArg, hint="true/false, all servers?", ULib.cmds.optional }
@@ -1056,12 +1053,12 @@ MSync.modules[info.ModuleIdentifier].hooks = function()

        This hook starts the timers for the asynchronous ban data loading and the check if one of the online players has been banned
    ]]
    timer.Create("msync."..(info.ModuleIdentifier)..".getActiveBans", MSync.modules[info.ModuleIdentifier].settings.syncDelay, 0, function() 
    timer.Create("msync."..info.ModuleIdentifier..".getActiveBans", MSync.modules[info.ModuleIdentifier].settings.syncDelay, 0, function()
        MSync.modules[info.ModuleIdentifier].getActiveBans()
    end)
    MSync.modules[info.ModuleIdentifier].getActiveBans()

    hook.Add("CheckPassword", "msync."..(info.ModuleIdentifier)..".banCheck", function( steamid64 )
    hook.Add("CheckPassword", "msync."..info.ModuleIdentifier..".banCheck", function( steamid64 )
        if MSync.modules[info.ModuleIdentifier].banTable[steamid64] then
            local ban = MSync.modules[info.ModuleIdentifier].banTable[steamid64]
            local unbanDate
@@ -1100,7 +1097,7 @@ MSync.modules[info.ModuleIdentifier].hooks = function()
        end
    end)

    hook.Add("PlayerDisconnected", "msync."..(info.ModuleIdentifier)..".saveDisconnects", function( ply )
    hook.Add("PlayerDisconnected", "msync."..info.ModuleIdentifier..".saveDisconnects", function( ply )
        if ply:IsBot() then return end
        local tableLength = #MSync.modules[info.ModuleIdentifier].recentDisconnects
        local data = {