From 796c6d2587d57e5159776e1fc5c3dd0fac71cc6a Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Thu, 7 Sep 2006 03:10:47 +0000 Subject: [PATCH] Match change to java class. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4357 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/as/com/threerings/presents/net/AuthRequest.as | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/as/com/threerings/presents/net/AuthRequest.as b/src/as/com/threerings/presents/net/AuthRequest.as index 773c9a864..85a845995 100644 --- a/src/as/com/threerings/presents/net/AuthRequest.as +++ b/src/as/com/threerings/presents/net/AuthRequest.as @@ -9,6 +9,17 @@ public class AuthRequest extends UpstreamMessage { _creds = creds; _version = version; + + // magic up a timezone in the format "GMT+XX:XX" + // Of course, the sign returned from getTimezoneOffset() is wrong + var minsOffset :int = -1 * new Date().getTimezoneOffset(); + var hoursFromUTC :int = Math.abs(minsOffset) / 60; + var minsFromUTC :int = Math.abs(minsOffset) % 60; + + minsFromUTC %= 60; + _zone = "GMT" + ((minsOffset < 0) ? "-" : "+") + + ((hoursFromUTC < 10) ? "0" : "") + hoursFromUTC + ":" + + ((minsFromUTC < 10) ? "0" : "") + minsFromUTC; } // documentation inherited @@ -18,6 +29,7 @@ public class AuthRequest extends UpstreamMessage out.writeObject(_creds); out.writeField(_version); + out.writeField(_zone); } // documentation inherited @@ -27,9 +39,11 @@ public class AuthRequest extends UpstreamMessage _creds = (ins.readObject() as Credentials); _version = (ins.readField(String) as String); + _zone = (ins.readField(String) as String); } protected var _creds :Credentials; protected var _version :String; + protected var _zone :String; } }