Jump to content

Packet loss last second + Packet total kicker


Quited

Recommended Posts

  
-- PacketLoss Last second Kicker 
function packetLossCheck() 
    local loss = getNetworkStats()["packetlossLastSecond"] 
    if (loss > 33) then 
        kickPlayer ( source , High PacketLoss 33) 
    end 
end 
setTimer(packetLossCheck, 1000, 0) 

True or not ؟

And

  
-- PacketLoss Total Kicker 
function packetLossCheck() 
    local loss = getNetworkStats()["packetlossTotal"] 
    if (loss > 33) then 
        kickPlayer ( source , High PacketLoss 33) 
    end 
end 
setTimer(packetLossCheck, 1000 , 0) 

Edited by Guest
Link to comment
  • Moderators

Jep, + 3

  
--not very efficient... 
setTimer(function ()--packetLossCheck 
    for player,i in pairs(getElementsByType("player")) do 
        if getNetworkStats(player)["packetlossTotal"] > 33 then 
            kickPlayer ( player , "High PacketLoss. ") 
        end 
    end 
end, 1000 , 0) 

Link to comment
Jep, + 3
  
--not very efficient... 
setTimer(function ()--packetLossCheck 
    for player,i in pairs(getElementsByType("player")) do 
        if getNetworkStats(player)["packetlossTotal"] > 33 then 
            kickPlayer ( player , "High PacketLoss. ") 
        end 
    end 
end, 1000 , 0) 

ffs... timers?

Use getTickCount()...

Link to comment
Jep, + 3
  
--not very efficient... 
setTimer(function ()--packetLossCheck 
    for player,i in pairs(getElementsByType("player")) do 
        if getNetworkStats(player)["packetlossTotal"] > 33 then 
            kickPlayer ( player , "High PacketLoss. ") 
        end 
    end 
end, 1000 , 0) 

ffs... timers?

Use getTickCount()...

It's server sided, how are you expecting him to use getTickCount() to check if one second passed without having something that runs constantly? and there is no problem with timers when there is only one timer.

Also, 'i' and 'player' should which places in the loop.

Link to comment
  • Moderators
ffs... timers?

Use getTickCount()...

It is just 1 timer at server side.

I use(normally) tickcount but tickcount does not loop,,,.,.,.,.

Loop on client render can also sometimes be laggy, now you use also GPU power to loop.(+1 event), of course it is the best solution at client side.

@arezu

ah yes, my bad.

I wasn't really ..... and..

Link to comment
Jep, + 3
  
--not very efficient... 
setTimer(function ()--packetLossCheck 
    for player,i in pairs(getElementsByType("player")) do 
        if getNetworkStats(player)["packetlossTotal"] > 33 then 
            kickPlayer ( player , "High PacketLoss. ") 
        end 
    end 
end, 1000 , 0) 

ffs... timers?

Use getTickCount()...

It's server sided, how are you expecting him to use getTickCount() to check if one second passed without having something that runs constantly? and there is no problem with timers when there is only one timer.

Also, 'i' and 'player' should which places in the loop.

getTickCount() is still way better.

Oh and by the way, both functions are client-sided too.

Except for kickPlayer.

ffs... timers?

Use getTickCount()...

It is just 1 timer at server side.

I use(normally) tickcount but tickcount does not loop,,,.,.,.,.

Loop on client render can also sometimes be laggy, now you use also GPU power to loop.(+1 event), of course it is the best solution at client side.

@arezu

ah yes, my bad.

I wasn't really ..... and..

onClientRender laggy?

I'd upgrade your PC if I were you, because San Andreas is built in 2004 lol.

Also, what would you rather have... A lagging server or a lagging PC.

Link to comment
  • Moderators

Well maybe you should mind the differences.

-- why make a loop at clientside? You can't check other players their packetlossTotal at client side. 
for player, i in pairs --etc. 
  
  
-- server 
getNetworkStats(player)  -- or player is nill for the server network. 
  
-- client 
getNetworkStats() 
  

onClientRender laggy?

I'd upgrade your PC if I were you, because San Andreas is built in 2004 lol.

Also, what would you rather have... A lagging server or a lagging PC.

- HD 7970

- CPU Type QuadCore Intel Core i7, 3700 MHz (37 x 100) (hyperthreading)

- Module Name Corsair CML32GX3M4A1600C10 8 GB X 4

I am not laggy at all. Gta san is for that system a pathetic game. I am only play it, because I can modify it. :!:

But some people are playing at very weak pc's(especially laptops) . A little bit script performance would be welcome.

I already told you that I use getTickCount()!

I even use table(tickcount) timers to manage respawn from the players.

Link to comment
  • 7 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...