Exeeding ackslimit
#1

**Fixed**

Yes, my problem on mine server is that when players(s) join they often get timeouted and therefore kicked because on the "exeed "akslimit" m/s 3000".
I increased the acslimit time to 5 sec and 7 secs, but still same problem.
This also happens to me (oftener when i havent restarted my server in about 30 mins) even though i host it myself and have a ping of about 2-17.
I actually don't 100% understand what ackslimit is, so if someone could explain it would be great!

I have deleted everything under OnPlayerUpdate.
I just discovered i have at idle about 22kb/s download from server.

It also EATS my cpu. Pentium 4 @ 1.6ghz 90-100% usage all the time when server on. Othervise it goes down to 0.

And Yes, i am using an gamemode downloaded from here. It's PPC trucking actually, but i added lots of stuff there and modified tons of it and in the beginning it ran great without ackslimit problems. So yes, it have come afterwards, and i have only added 4 timers where only two is running at time.

Also an oftopick thing: How to stream/load objects to players so that vehicles won't fall thru em? Is there any way to (exept using CreateObject with a limit of 1000 objects) do this properly? I use streamer plugin, but increasing stream_distanse and stream_rate from server.cfg dosen't seem to have ANY effect.

Thanks for all replies and if you want to go and see if you get also lagg and then kick from my server, heres the address: eurotrucking.ignorelist.com:7777 (0.3.7).
Reply
#2

Quote:
Originally Posted by Hessu
Посмотреть сообщение
Yes, my problem on mine server is that when players(s) join they often get timeouted and therefore kicked because on the "exeed "akslimit" m/s 3000".
I increased the acslimit time to 5 sec and 7 secs, but still same problem.
This also happens to me (oftener when i havent restarted my server in about 30 mins) even though i host it myself and have a ping of about 2-17.
I actually don't 100% understand what ackslimit is, so if someone could explain it would be great!
https://sampwiki.blast.hk/wiki/MapName

Quote:
Originally Posted by Hessu
Посмотреть сообщение
I have deleted everything under OnPlayerUpdate.
Not sure if it's that.

Quote:
Originally Posted by Hessu
Посмотреть сообщение
And Yes, i am using an gamemode downloaded from here. It's PPC trucking actually, but i added lots of stuff there and modified tons of it and in the beginning it ran great without ackslimit problems. So yes, it have come afterwards, and i have only added 4 timers where only two is running at time.
PPC Trucking is pretty ancient, not sure if it's wise to use it, post your timers here though.

Quote:
Originally Posted by Hessu
Посмотреть сообщение
Also an oftopick thing: How to stream/load objects to players so that vehicles won't fall thru em? Is there any way to (exept using CreateObject with a limit of 1000 objects) do this properly? I use streamer plugin, but increasing stream_distanse and stream_rate from server.cfg dosen't seem to have ANY effect.
spawn the vehicles AFTER the objects are created, not sure if it works in all cases but it's worth a try.
Reply
#3

Here are some timers i just piced up.

pawn Код:
// Start the timer that will show timed messages every 2 minutes
    SetTimer("Timer_TimedMessages", 1000 * 60 * 2, true);
    // Start the timer that will show a random bonus mission for truckers every 5 minutes
    SetTimer("ShowRandomBonusMission", 1000 * 60 * 5, true);
    // Start the timer that checks the toll-gates
    SetTimer("Toll", 1000, true);

    SetTimer("GlobalTimer", 1000, true);

public OnFilterScriptInit()//Route 1 length : 4800 secs
{
    isferrygoing = 0;
    SetTimer("MoveCheck", 1000, true);
    SetTimer("FerryToIS", 120000, false);

public MoveCheck(playerid)
{
    if(!IsObjectMoving(ferry))
    {
        if(isferrygoing == 1)
        {
            //SendClientMessage(playerid, 0x00FF0000, "Ferry is docked to Island");
            SetTimer("FerryToLS", 60000, false);
        }
        else if(isferrygoing == 2)
        {
            //SendClientMessage(playerid, 0x00FF0000, "Ferry is docked to Los Santos");
            SetTimer("FerryToIS", 60000, false);
        }
    }
    return 1;
}
Reply
#4

show me FerryToIS please.
Reply
#5

pawn Код:
public FerryToIS(playerid)
{
    //SendClientMessage(playerid, 0x00FF0000, "Ferry is going to Island");
    MoveObject(ferry, 5084.79980, -1985.50000, 0.00000, 11.0,   0.00000, 0.00000, 0.00000);
    isferrygoing = 1;
    return 1;
}
I then started to look what ate my cpu and i started with diasbling all filterscripts. Then i found that it was one that i modified ^^

Well it basically shows the local time for each player ingame where the original clock is, so can you find anything wrong with it? It actually works, but eats loads of cpu. Othervise i just scrap it.
pawn Код:
// Player Time Zone by Klabauter_Mann
// Please do not remove the credits or claim this script as your own
// You must have GeoIP plugin to use this script
// You must have GeoIP include to compile this script

#include <a_samp>
#include geoip

#define servergmt 0 // Set the GMT of your server, example: if your server is in New York City change 0 to -5

#pragma tabsize 0

new Text:txtTimeDisp;

new timestr[32];

new Hour, Minute, Second;

forward UpdateTimeAndWeather(i);

public OnFilterScriptInit()
{
    print("\n-------------------------------------------------");
    print(" Player Time Zone by Klabauter_Mann");
    print("-------------------------------------------------\n");
   
    // Init our text display
    txtTimeDisp = TextDrawCreate(610.0,25.0,"00:00");
    TextDrawUseBox(txtTimeDisp, 0);
    TextDrawFont(txtTimeDisp, 3);
    TextDrawSetShadow(txtTimeDisp,0); // no shadow
    TextDrawSetOutline(txtTimeDisp,2); // thickness 1
    TextDrawBackgroundColor(txtTimeDisp,0x000000FF);
    TextDrawColor(txtTimeDisp,0xFFFFFFFF);
    TextDrawAlignment(txtTimeDisp,3);
    TextDrawLetterSize(txtTimeDisp,0.65,2.0);

    for(new i = 0; i <= MAX_PLAYERS; i++)
    {

    UpdateTimeAndWeather(i);
    SetTimerEx("UpdateTimeAndWeather",1000,true, "i", i);
    }
   
    return true;
}

public OnPlayerSpawn(playerid)
{
    TextDrawShowForPlayer(playerid,txtTimeDisp);

    //gettime(Hour, Minute);
    //SetPlayerTime(playerid,hour,minute);

    return 1;
}

public UpdateTimeAndWeather(i)
{
    // Update time
    gettime(Hour, Minute, Second);
    new gmt = GetPlayerGMT(i);
    new sum = Hour + gmt - servergmt;
    if(sum >= 24 && sum < 48)
    {
        //SetPlayerTime(playerid, sum - 24, Minute);
        format(timestr,32,"%02d:%02d",sum,Minute);
        TextDrawSetString(txtTimeDisp,timestr);
    }
    if(sum >= 48)
    {
        //SetPlayerTime(playerid, sum - 48, Minute);
        format(timestr,32,"%02d:%02d",sum,Minute);
        TextDrawSetString(txtTimeDisp,timestr);
    }
    if(sum < 0)
    {
        //SetPlayerTime(playerid, sum + 24, Minute);
        format(timestr,32,"%02d:%02d",sum,Minute);
        TextDrawSetString(txtTimeDisp,timestr);
    }
    if(sum >= 0 && sum < 24)
    {
        //SetPlayerTime(playerid, sum, Minute);
        format(timestr,32,"%02d:%02d",sum,Minute);
        TextDrawSetString(txtTimeDisp,timestr);
    }
    format(timestr,32,"%02d:%02d",sum,Minute);
    TextDrawSetString(txtTimeDisp,timestr);

    //SetWorldTime(hour);

    new x=0;
    while(x!=MAX_PLAYERS) {
        if(IsPlayerConnected(x) && GetPlayerState(x) != PLAYER_STATE_NONE) {
            //SetPlayerTime(x,hour,minute);
         }
         x++;
    }

    /* Update weather every hour
    if(last_weather_update == 0) {
        UpdateWorldWeather();
    }
    last_weather_update++;
    if(last_weather_update == 60) {
        last_weather_update = 0;
    }*/

}


public OnPlayerDeath(playerid, killerid, reason)
{
    TextDrawHideForPlayer(playerid,txtTimeDisp);
    return 1;
}
Reply
#6

Oh damn that script looks terrible lol..

Depending on your max_players define, most likely there are 500 timers set to all run once every second...

I strongly suggest you to find another timeweather system cause this one is terrible lol.

If you need a specific one, or custom made, swing me a PM.
Reply
#7

I don't get what you're trying to do in your UpdateTimeAndWeather(i) function.

You supply that function with a playerid, yet you have this code under it:
pawn Код:
new x=0;
    while(x!=MAX_PLAYERS) {
        if(IsPlayerConnected(x) && GetPlayerState(x) != PLAYER_STATE_NONE) {
            //SetPlayerTime(x,hour,minute);
         }
         x++;
    }
This again loops through all players.
For every player, you're looping through all of them again.
When 100 players are connected, you're setting the playertime 10.000 times, and that happens every second, using 100 timers.

That's what causes the ackslimit, as you're sending too much data every second to every player.
Every message sent/received needs an acknowledge message to inform both parties (client & server) that every message has been received properly.
Ackslimit is just a counter which counts the amount of acknowledge messages and if you go over the set limit, you get that error in your server's console.

It actually informs you that you're having a very big loop somewhere that sends too much data to your players and it also means you have a terrible script structure as said before by Smileys.


Use one timer, then inside this timer, loop through all players and set their time.
Also update their textdraw and you're done.



PPC Trucking is ancient, I know, but it still does it's job pretty good.
I guess it's still being downloaded after 4-5 years since it's release.
And I've never heard of anyone getting ackslimit messages from it, so it can't be the original code.
Reply
#8

Thanks for the replies.
Yes i didn't put too much time on that script, just modified what i modified and off it went on the server. I gotta be more careful in the future.
Thanks for explaining ackslimit!

I have annother bug with the timers now though.

The timers want to run faster than they should.

The speed O meter and fuel gauge is controlled by 2 timers. One set to 100 that updates speed textdraw and one that updates fuel consumption. At some time when the server have been running, they get messed up. Also other timers for etc speedcameras.
I have never had any problems like this and the wierd thing is, that after a recompile and server restart it works 100% fine again for a while (some hours, maybe 10).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)