SA-MP Forums Archive
Client Issue - Timestamp bug - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP (https://sampforum.blast.hk/forumdisplay.php?fid=3)
+--- Forum: Bug Reports (https://sampforum.blast.hk/forumdisplay.php?fid=20)
+--- Thread: Client Issue - Timestamp bug (/showthread.php?tid=589793)



Client Issue - Timestamp bug - Lordzy - 22.09.2015

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!


Re: Client Issue - Timestamp bug - PT - 25.09.2015

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


Re: Client Issue - Timestamp bug - IstuntmanI - 25.09.2015

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.


Re: Client Issue - Timestamp bug - J0sh... - 25.09.2015

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.


Re: Client Issue - Timestamp bug - Spmn - 28.09.2015

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.