Client Issue - Timestamp bug
#1

The client doesn't update it's time in case if we've paused the game. I noticed this when I ran a repeating timer to display some message. If we're paused, the timestamp keeps showing the same value for messages until we're back into game. I was quite confused whether my timer got spammed and debugged it using GetTickCount function.



I paused my game when it showed the first debug message and after few minutes, when I resumed, this is what I've got. The last debug message was received when I was active in game. This issue is also there on Chatlog.txt.

Chatlog:
Code:
[21:30:12] Connected. Joining the game...
[21:30:12] Connected to {B9C9BF}SA-MP 0.3 Server
[21:30:30] Testing | Tick : 273871639
[21:33:53] Testing | Tick : 273892594
[21:33:53] Testing | Tick : 273913417
[21:33:53] Testing | Tick : 273934344
[21:33:53] Testing | Tick : 273955272
[21:33:53] Testing | Tick : 273976129
[21:33:53] Testing | Tick : 273997079
[21:33:53] Testing | Tick : 274018018
[21:33:53] Testing | Tick : 274038805
[21:33:53] Testing | Tick : 274059755
[21:33:59] Testing | Tick : 274080729
The script that I used to debug :
pawn Code:
#include <a_samp>

new
    g_Timer;
public OnFilterScriptInit() {

    g_Timer = SetTimer("CTimeStamp", 1000 * 20, true);
    print("Loaded CTimeStamp");
    return 1;
}

public OnFilterScriptExit() {

    KillTimer(g_Timer);
    return 1;
}


forward CTimeStamp();
public CTimeStamp() {

    new
        temp_String[50];
    format(temp_String, sizeof(temp_String), "Testing | Tick : %d", GetTickCount());
    SendClientMessageToAll(-1, temp_String);
   
    return 1;
}
EDIT : Just found that this same issue was reported 5 years ago, yet the problem persists!
Reply
#2

miliseconds count too, thats why the value is diferent i think.
Reply
#3

Yes, this is a problem with the /timestamp. All messages are sent to the player, and he receives them when he returns in the game, I don't think it can be fixed without drastically changing the paused system, as I think that the timestamp is set by client, not by the server.
Reply
#4

Quote:
Originally Posted by IstuntmanI
View Post
Yes, this is a problem with the /timestamp. All messages are sent to the player, and he receives them when he returns in the game, I don't think it can be fixed without drastically changing the paused system, as I think that the timestamp is set by client, not by the server.
You are correct.

OT: SA-MP Cannot get the PC time when it's paused/not the main process, remember you don't receive any more packets until you're unpaused, so it sends the time you before you paused.
Reply
#5

AFAIK clients receive packets when game is paused too but they are added to a 'pool' and applied right after game unpause. So storing a timestamp among message packets would fix this tiny problem.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)