public void TestValidateClientTs() { Assert.True(GAValidator.ValidateClientTs(GAUtilities.TimeIntervalSince1970())); Assert.False(GAValidator.ValidateClientTs(long.MinValue)); Assert.False(GAValidator.ValidateClientTs(long.MaxValue)); }
public static long GetClientTsAdjusted() { long clientTs = GAUtilities.TimeIntervalSince1970(); long clientTsAdjustedInteger = clientTs + Instance.ClientServerTimeOffset; if (GAValidator.ValidateClientTs(clientTsAdjustedInteger)) { return(clientTsAdjustedInteger); } else { return(clientTs); } }
private static long CalculateServerTimeOffset(long serverTs) { long clientTs = GAUtilities.TimeIntervalSince1970(); return(serverTs - clientTs); }