Timestamps
#1

I've recently discovered that at least my server is not capable of handling timestamps which are set far in the future. Today I was trying to set a player variable containing a timestamp 163 days away
= gettime()+(86400*163) , and here's the result:

Код:
[30.03.2014, 12:47:24] [debug] #2  0008934c in public S@@_OnDialogResponse (playerid=7, dialogid=4, response=1, listitem=0, inputtext[]=@0x01124008 "") at C:\Users\Jani\Dropbox\AT_Server_v2\gamemodes\Trucking.pwn:8171
[30.03.2014, 12:47:24] [debug] #3  0000a5b4 in public OnDialogResponse (playerid=7, dialogid=4, response=1, listitem=0, inputtext[]=@0x01124008 "") at C:\Users\Jani\Dropbox\AT_Server_v2\pawno\include\YSI\y_hooks/impl.inc:2251
[30.03.2014, 12:47:24] [debug] Run time error 4: "Array index out of bounds"
[30.03.2014, 12:47:24] [debug]   Accessing element at negative index -1
[30.03.2014, 12:47:24] [debug] Backtrace:
[30.03.2014, 12:47:24] [debug] #0  000104e8 in INI_Close (INI:file=-1) at C:\Users\Jani\Dropbox\AT_Server_v2\pawno\include\YSI\y_ini.inc:746
[30.03.2014, 12:47:24] [debug] #1  00119580 in GivePlayerCash (playerid=16, cash=5688) at C:\Users\Jani\Dropbox\AT_Server_v2\gamemodes\Trucking.pwn:16844
[30.03.2014, 12:47:24] [debug] #2  0007a4ec in public Streamer_OnPlayerEnterCP (playerid=16) at C:\Users\Jani\Dropbox\AT_Server_v2\gamemodes\Trucking.pwn:7066
[30.03.2014, 12:47:24] [debug] #3  0001b810 in public S@@_OnPlayerEnterCheckpoint (playerid=16) at C:\Users\Jani\Dropbox\AT_Server_v2\pawno\include\streamer.inc:383
[30.03.2014, 12:47:24] [debug] #4  00007e20 in public OnPlayerEnterCheckpoint (playerid=16) at C:\Users\Jani\Dropbox\AT_Server_v2\pawno\include\YSI\y_hooks/impl.inc:1146
[30.03.2014, 12:47:26] [debug] Run time error 4: "Array index out of bounds"
[30.03.2014, 12:47:26] [debug]   Accessing element at negative index -1
[30.03.2014, 12:47:26] [debug] Backtrace:
[30.03.2014, 12:47:26] [debug] #0  000104e8 in INI_Close (INI:file=-1) at C:\Users\Jani\Dropbox\AT_Server_v2\pawno\include\YSI\y_ini.inc:746
My whole code just pops! Everything stops working and crashdetect spams my log full of that shit. I've confirmed the same multiple times, first setting the same variable to 3 days from today, then 50. Those work fine. Whenever it's something higher like 150 or so, the above thing happens. I see some of those debug lines are from YSI so could it be the problem and how to possibly solve it?
Reply
#2

You'll need to post your code, otherwise we can't tell if this is a bug or a problem with your code.
Reply
#3

The code that causes this issue is visible in the first post.

pawn Код:
somevar[playerid] = gettime()+(86400*163);
Posthunters are not needed on this thread.
Reply
#4

YSI version 3.09.0684

Is this what you wanted to see? http://pastebin.com/jG5Wkkqh
Reply
#5

Someone else recently also reported some problems with large numbers and Y_INI. I guess ****** will have to look into that.
Reply
#6

Glad to hear I'm not the only one then. Alerted ****** on IRC but he just left right away :P
Reply
#7

I got the current timestamp + (86400 * 163) and stored it to a variable. I printed it (result was 1410272429) and it was fine. Even if there's a chance to exceed the limit, it will just go negative so the problem is not in the unix timestamp.

About the INI_Close: if you notice the file is -1 and that's the value of the negative index from the run time error 19 that was caused. Although GivePlayerCash function (according to the debug info in line 16844) has nothing to do with INI_Close and I don't know why it printed it in the debug.

There's also different debug information again in the first line but it starts from backtrace #2 in line 8171.
Reply
#8

The problem is now actually pinpointed to y_ini. Setting and using the variable doesn't seem to cause any problems but when it's saved or loaded, this starts to happen.
Reply
#9

It seems y_ini cannot handle values over ~1.4 billion even though the limit should be 2.1 billions.

Another thread about it as Vince pointed out: https://sampforum.blast.hk/showthread.php?tid=503480
Reply
#10

Thanks for your replies everyone. As a temporary solution I will save the timestamp as string.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)