Serious issue with tickcount() on Linux -
DiDok - 05.09.2012
I recently discovered that something is wrong with tickcounts on my server, so I made a debug command:
Код:
cmd(debug,playerid,params[])
{
gPlayerData[playerid][ACLastTick] = tickcount();
SetTimerEx("CheckTicks",1000,0,"i", playerid);
return 1;
}
forward CheckTicks(playerid);
public CheckTicks(playerid)
{
format(gSString, sizeof(gSString), "%i", tickcount() - gPlayerData[playerid][ACLastTick]);
SendClientMessage(playerid, COLOR_YELLOW, gSString);
}
and used it on homehosted (Win 7) and normal (Linux, at Volt) server.
Results on Win server were kinda normal (~1112 ticks), but on Linux it was showing ~150 ticks (140, 160, 120, etc, very inconsistent and always divisible by 10), raising with playercount (up to ~560 ticks) - definitely not normal value. Changing granularity didn't help at all.
I thought it's hosts' fault but they claim it's something with Linux build of SA:MP server. Could someone tell me what could be the problem here?
Re: Serious issue with tickcount() on Linux -
HB - 05.09.2012
Something not entirely related to your problem, but still worth noting, is that tickcounts have never been the most reliable. The tickcount stops working after a specific amount of days, when the integer size limit has been reached.
Re: Serious issue with tickcount() on Linux -
Lightning[SV] - 05.09.2012
This message is on the sa-mp wiki regarding GetTickCount()
Important Note: GetTickCount will cause problems on servers with uptime of over 24 days (physical server, not SA:MP server) as GetTickCount will eventually warp past the integer size constraints
I used to use GetTickCount in 0.3c on a server with uptime higher than this without any noticible problems. I use a timer now instead.
Re: Serious issue with tickcount() on Linux -
DiDok - 06.09.2012
Quote:
Originally Posted by ******
That's "GetTickCount", not "tickcount", the former is much better so just use that.
|
Holy shit, this one works correctly
Thank you
Can be closed