Explore GameReplays...

CNC Zero Hour

GenTool Upload Date issue - help required

Reply to this topic Start new topic
# 1xezon Apr 15 2019, 19:24 PM
Hello. I would like to fix the issue where players upload files with wrong dates. If anyone happens to have this issue or knows someone who has this regularly, can you please get in touch with me?

Typically GenTool sends requests to NTP Servers on start up which should load the correct time for everyone, but for some reason it does not work always and I don't know why. The problem seems to be worse since GenTool 7.5 and I can't track down the change that introduced this behaviour, because I refactored a lot of old code in Upload Mode from 7.4 to 7.5.

The issue becomes obvious when you look here:
http://www.gentool.net/data/zh/

Leikeze collected this list of players who atleast have this issue:
TankCommander
Randommufa1
eldinhitman1
majorcalvin
JOK.GT
TheCurse66
MarlboroRed
softcare1@mail.ru
Barbarous
bilejean
X-MEN

Posts: 17,095

Clan: MENTAL

Game: CNC Zero Hour


+
# 2ku7ari Apr 15 2019, 21:17 PM
Edit: Duplicate. This can be deleted.

This post has been edited by ku7ari: Apr 15 2019, 21:31 PM

Posts: 1,290

Game: CNC Zero Hour


+
# 3ku7ari Apr 15 2019, 21:28 PM
Thankfully I am here to help you.

The most likely issue is that while NTP is great, it can be unreliable. Plus, NTP request can be blocked by Windows Firewall, Routers, or hardware Firewalls.

EDIT 1: Do you know if these users are geographically similiar? ISP's are known to block legitimate ports and access to certain IP address ranges, such as due to government restrictions. This could simply being blocking the client request and giving you these unexpected behaviors.

EDIT 2: The NTP service utilizes UDP port 123. UDP sucks in this scenario because UDP doesn't care about error checking or resending corrupt or missing packets, like TCP does.

I presume you are making the external NTP request because you would run into issues if you used the local timestamp on the Gentool server.

Here are few solutions:

1. Change the NTP service you are using.
2. Use GT server to fetch the timestamp for the client.
3. Validate the initial client timestamp (EZ Way).
  • Did you get the first timestamp?
  • If no, try again with a different NTP service
  • If still no, send a timestamp from GT server

4. Validate the initial client timestamp to the local timestamp on GT.
  • Fetch client timestamp from NTP
  • Compare GT local timestamp to client timestamp
  • If beyond the determined margin of error (ex: off 5 mins or 23 hours being reasonable acceptable, compared to weeks or months being unreasonable), try again.
  • Or if the client timestamp difference is greater or less than 23 hours of the GT Server local timestamp, try again.
  • If unsuccessful, keep trying or review the next options: 1. Force the client timestamp based on the last created directory date, or prevent upload and show error message to end-user.

EDITs: Xezon I marked my two edits, plus fixed a few typos. Hope this helps. Goodluck!


This post has been edited by ku7ari: Apr 16 2019, 04:35 AM

Posts: 1,290

Game: CNC Zero Hour


+
# 4Fargo Apr 15 2019, 21:32 PM
QUOTE(ku7ari @ Apr 15 2019, 22:28 PM) *

Thankfully I am here to help you.

The most likely issue is that while NTP is great, but it can be unreliable. Plus, NTP request can be blocked by Windows Firewall, Routers, or hardware Firewalls.

I presume you are making the external NTP request because you would run into issues if you used the local timestamp on the Gentool server.

Here are few solutions.

1. Change the NTP service you are using.

2. Use GT server to fetch the timestamp for the client

3. Validate the initial client timestamp (EZ Way).

  • Did you get the first timestamp?
  • If no, try again with a different NTP service
  • If still no, send a timestamp from GT server
4. Validate the initial client timestamp to the local timestamp on GT.

  • Fetch client timestamp from NTP
  • Compare GT timestamp to client timestamp
  • If not within a margin of error (off 5 minutes, compared too off 1 day or month), try again or use GT timestamp
  • If not timestamp difference is greater or less than 23 hours on GT Server, try again.
  • If so, validate NTP timestamp to your server or local timestamp.

wow ohmy.gif

Posts: 3,378

Game: CNC Zero Hour


+
# 5ku7ari Apr 15 2019, 21:41 PM
#4 should prevent any date jumps on the Gentool FTP server that you are experiencing. Because of this behavior, and since there is no proper timestamp validation, your Gentool FTP server is willingly creating new directories based on the the value of the string that is passed to you from the GenTool client, regardless if it is valid or not.

Edit: Seems more like a logical error rather than the user (or client) in this example.


This post has been edited by ku7ari: Apr 16 2019, 03:58 AM

Posts: 1,290

Game: CNC Zero Hour


+
# 6ku7ari Apr 15 2019, 21:45 PM
Lastly, my theory only suggest that you not getting the client timestamp (null, or invalid), or the end-users computer hardware, software or ISP is blocking the NTP requests. I am shooting in the dark because I have no idea what your code looks like, or the method behind your GenTool madness.

If you wanted to test my idea, you could simply block UDP port 123 on your computer, verify that is truly not allowing incoming or outgoing connections via that port, and run through a live example. If all looks like fine during this walk-through, try keeping the port blocked, change the date-time on the local computer that you are using to something odd, and give it another shot.

If you want some more assistance, let me now. I'd be glad to help you.

EDIT: Nevermind my original posting, I'll give you something useful instead.

This post has been edited by ku7ari: Apr 16 2019, 04:47 AM

Posts: 1,290

Game: CNC Zero Hour


+
# 7HaWkY^ Apr 16 2019, 05:49 AM
Turn it off and back on and if that doesn’t work hit it with a hammer.


Posts: 18,146

Clan: -MaD|

Game: CNC Zero Hour


+
# 8xezon Apr 16 2019, 09:59 AM
GenTool pulls NTP from 2 different pools

1.pool.ntp.org
2.pool.ntp.org

It then checks if the returned time from both sources is within similar margin (5 minutes). If true, it accepts the time stamp and works with that as base time, otherwise Windows Clock.

You are right, I probably need to pull time from GenTool Server via HTTP request as last resort when NTP fails. If user cannot even pull time from gentool server, then it won't be able to send files anyway.

Posts: 17,095

Clan: MENTAL

Game: CNC Zero Hour


+
# 9^RiNgO Apr 16 2019, 17:04 PM
IPB Image


Such code. Very function.

Posts: 1,337

Game: CNC Zero Hour


+

1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)