Server Time Precision
Options
Hi,
Server Time is currently an int (32 bit). This means it will overflow ~50 days after the machine was bootet. Such an overflow could have very strange effects on the game. Wouldn't it be better to use a 64 bit number here? We are already having problems because the number becomes negative after 24 days or so...
David
Server Time is currently an int (32 bit). This means it will overflow ~50 days after the machine was bootet. Such an overflow could have very strange effects on the game. Wouldn't it be better to use a 64 bit number here? We are already having problems because the number becomes negative after 24 days or so...
David
0
Comments
-
A 64bit number would be quite some overhead as it's sent a lot. The benefits are too small for that.
In best case, you use the int to calculate time-deltas, instead of using it absolute. Then an overflow won't hurt you at all. The diff between int.max and int.min is 1, despite overflows:
[code2=csharp]int old = int.MaxValue;
int current = int.MinValue;
int diff = (int)(current - old);[/code2]0