From 1bdfb805ab9d1ee7b9d40ea17fd90a0499a35524 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Sat, 13 Dec 2003 02:56:29 +0000 Subject: [PATCH] We can't do this, currentTimeMillis() will return bogus values such that the math appears to work out even though time stopped. We can use RunAnywhere.currentTimeMillis() which will warn if time goes backwards but since when that happens the IntervalManager stops dead in it's tracks, we'll never get ticked to find out about it. Fucking Windows. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2911 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../threerings/presents/client/Client.java | 23 ++++--------------- 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/src/java/com/threerings/presents/client/Client.java b/src/java/com/threerings/presents/client/Client.java index 37897a7bd..1a763b10c 100644 --- a/src/java/com/threerings/presents/client/Client.java +++ b/src/java/com/threerings/presents/client/Client.java @@ -1,15 +1,16 @@ // -// $Id: Client.java,v 1.45 2003/12/13 02:50:12 mdb Exp $ +// $Id: Client.java,v 1.46 2003/12/13 02:56:29 mdb Exp $ package com.threerings.presents.client; import java.util.ArrayList; import java.util.List; -import com.samskivert.util.ObserverList; -import com.samskivert.util.ResultListener; import com.samskivert.util.Interval; import com.samskivert.util.IntervalManager; +import com.samskivert.util.ObserverList; +import com.samskivert.util.ResultListener; +import com.samskivert.util.RunAnywhere; import com.threerings.presents.Log; import com.threerings.presents.data.ClientObject; @@ -396,23 +397,12 @@ public class Client */ protected void tick () { - long now = System.currentTimeMillis(); - - // sanity check to see if we're missing idle ticks for long stretches - if (_lastTicked == 0L) { - _lastTicked = now; - } - long delta = now - _lastTicked; - if (delta > 10000L) { - Log.warning("Long inter-tick interval!? [delta=" + delta + "]."); - } - _lastTicked = now; - // if we're not connected, skip it if (_comm == null) { return; } + long now = RunAnywhere.currentTimeMillis(); if (_dcalc != null) { // if we're syncing the clock, send another ping PingRequest req = new PingRequest(); @@ -704,9 +694,6 @@ public class Client /** Our tick interval id. */ protected int _piid = -1; - /** Check to ensure that we're not missing ticks. */ - protected long _lastTicked; - /** How often we recompute our time offset from the server. */ protected static final long CLOCK_SYNC_INTERVAL = 600 * 1000L;