Skip to main content

no heartbeat


// If there's no heartbeat, ban


local function SendHeartBeat()
    net.Start ("heartbeat_ac")
    net.WriteString ("OK")
    net.SendToServer()
end


local function BanMe(incident)
    net.Start ("ban_me")
    net.WriteEntity (LocalPlayer())
    net.WriteString(incident)
    net.SendToServer()
end

local function AskForUpdate()
    net.Start ("request_ac_info")
    net.SendToServer()
end

local function ScanConCommands()
    if BadCommandTable then
        CmdName  = concommand.GetTable()
        for k, v in pairs (CmdName) do
            for p, m in pairs (BadCommandTable) do
                if (m == k) then
                    BanMe (k)
                end   
            end
        end
    end
end


net.Receive( "get_tables", function( len, pl )
    BadCommandTable = net.ReadTable()
    BadCVarTable = net.ReadTable()
   
end)



timer.Create (tostring(math.random( 10, 20 )), 20, 0, function()
    SendHeartBeat()
    AskForUpdate()
    ScanConCommands()
end)