Serious issue with tickcount() on Linux
#1

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?
Reply
#2

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.
Reply
#3

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.
Reply
#4

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
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)