Some changes required for the new compiler.
- Import bleeding may be fixed, as I had to import a bunch of things I should have had to earlier. - NOW they make duplicate variable definitions bad (but without block scoping... yay). - Another hoopjump. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4233 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -27,6 +27,7 @@ import com.threerings.util.ArrayUtil;
|
|||||||
import com.threerings.util.HashMap;
|
import com.threerings.util.HashMap;
|
||||||
import com.threerings.util.Map;
|
import com.threerings.util.Map;
|
||||||
import com.threerings.util.ResultListener;
|
import com.threerings.util.ResultListener;
|
||||||
|
import com.threerings.util.StringUtil;
|
||||||
|
|
||||||
import com.threerings.presents.client.BasicDirector;
|
import com.threerings.presents.client.BasicDirector;
|
||||||
import com.threerings.presents.client.Client;
|
import com.threerings.presents.client.Client;
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package com.threerings.crowd.chat.client {
|
package com.threerings.crowd.chat.client {
|
||||||
|
|
||||||
import com.threerings.util.Name;
|
import com.threerings.util.Name;
|
||||||
|
import com.threerings.util.ResultAdapter;
|
||||||
|
import com.threerings.util.ResultListener;
|
||||||
import com.threerings.util.StringUtil;
|
import com.threerings.util.StringUtil;
|
||||||
|
|
||||||
import com.threerings.crowd.data.BodyObject;
|
import com.threerings.crowd.data.BodyObject;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.threerings.io {
|
package com.threerings.io {
|
||||||
|
|
||||||
import flash.errors.IOError;
|
import flash.errors.IOError;
|
||||||
|
import flash.errors.MemoryError;
|
||||||
|
|
||||||
import flash.utils.ByteArray;
|
import flash.utils.ByteArray;
|
||||||
import flash.utils.IDataInput;
|
import flash.utils.IDataInput;
|
||||||
|
|||||||
@@ -26,15 +26,15 @@ public class Streamer
|
|||||||
|
|
||||||
initStreamers();
|
initStreamers();
|
||||||
|
|
||||||
for each (var streamer :Streamer in _streamers) {
|
var streamer :Streamer;
|
||||||
|
for each (streamer in _streamers) {
|
||||||
if (streamer.isStreamerFor(obj)) {
|
if (streamer.isStreamerFor(obj)) {
|
||||||
return streamer;
|
return streamer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (obj is TypedArray) {
|
if (obj is TypedArray) {
|
||||||
var streamer :Streamer = new ArrayStreamer(
|
streamer = new ArrayStreamer((obj as TypedArray).getJavaType());
|
||||||
(obj as TypedArray).getJavaType());
|
|
||||||
_streamers.push(streamer);
|
_streamers.push(streamer);
|
||||||
return streamer;
|
return streamer;
|
||||||
}
|
}
|
||||||
@@ -68,7 +68,8 @@ public class Streamer
|
|||||||
initStreamers();
|
initStreamers();
|
||||||
|
|
||||||
// see if we have a streamer for it
|
// see if we have a streamer for it
|
||||||
for each (var streamer :Streamer in _streamers) {
|
var streamer :Streamer;
|
||||||
|
for each (streamer in _streamers) {
|
||||||
if (streamer.getJavaClassName() === jname) {
|
if (streamer.getJavaClassName() === jname) {
|
||||||
return streamer;
|
return streamer;
|
||||||
}
|
}
|
||||||
@@ -76,7 +77,7 @@ public class Streamer
|
|||||||
|
|
||||||
// see if it's an array that we unstream using an ArrayStreamer
|
// see if it's an array that we unstream using an ArrayStreamer
|
||||||
if (jname.charAt(0) === "[") {
|
if (jname.charAt(0) === "[") {
|
||||||
var streamer :Streamer = new ArrayStreamer(jname);
|
streamer = new ArrayStreamer(jname);
|
||||||
_streamers.push(streamer);
|
_streamers.push(streamer);
|
||||||
return streamer;
|
return streamer;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,9 +2,11 @@ package com.threerings.io.streamers {
|
|||||||
|
|
||||||
import com.threerings.util.ClassUtil;
|
import com.threerings.util.ClassUtil;
|
||||||
|
|
||||||
|
import com.threerings.io.ArrayMask;
|
||||||
import com.threerings.io.ObjectInputStream;
|
import com.threerings.io.ObjectInputStream;
|
||||||
import com.threerings.io.ObjectOutputStream;
|
import com.threerings.io.ObjectOutputStream;
|
||||||
import com.threerings.io.Streamer;
|
import com.threerings.io.Streamer;
|
||||||
|
import com.threerings.io.Translations;
|
||||||
import com.threerings.io.TypedArray;
|
import com.threerings.io.TypedArray;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -75,22 +77,23 @@ public class ArrayStreamer extends Streamer
|
|||||||
:void
|
:void
|
||||||
{
|
{
|
||||||
var arr :Array = (obj as Array);
|
var arr :Array = (obj as Array);
|
||||||
|
var ii :int;
|
||||||
out.writeInt(arr.length);
|
out.writeInt(arr.length);
|
||||||
if (_elementType == int) {
|
if (_elementType == int) {
|
||||||
for (var ii :int = 0; ii < arr.length; ii++) {
|
for (ii = 0; ii < arr.length; ii++) {
|
||||||
out.writeInt(arr[ii] as int);
|
out.writeInt(arr[ii] as int);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (_isFinal) {
|
} else if (_isFinal) {
|
||||||
var mask :ArrayMask = new ArrayMask(arr.length);
|
var mask :ArrayMask = new ArrayMask(arr.length);
|
||||||
for (var ii :int = 0; ii < arr.length; ii++) {
|
for (ii = 0; ii < arr.length; ii++) {
|
||||||
if (arr[ii] != null) {
|
if (arr[ii] != null) {
|
||||||
mask.setBit(ii);
|
mask.setBit(ii);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mask.writeTo(out);
|
mask.writeTo(out);
|
||||||
// now write the populated elements
|
// now write the populated elements
|
||||||
for (var ii :int = 0; ii < arr.length; ii++) {
|
for (ii = 0; ii < arr.length; ii++) {
|
||||||
var element :Object = arr[ii];
|
var element :Object = arr[ii];
|
||||||
if (element != null) {
|
if (element != null) {
|
||||||
out.writeBareObjectImpl(element, _delegate);
|
out.writeBareObjectImpl(element, _delegate);
|
||||||
@@ -98,7 +101,7 @@ public class ArrayStreamer extends Streamer
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
for (var ii :int = 0; ii < arr.length; ii++) {
|
for (ii = 0; ii < arr.length; ii++) {
|
||||||
out.writeObject(arr[ii]);
|
out.writeObject(arr[ii]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -108,15 +111,16 @@ public class ArrayStreamer extends Streamer
|
|||||||
:void
|
:void
|
||||||
{
|
{
|
||||||
var arr :Array = (obj as Array);
|
var arr :Array = (obj as Array);
|
||||||
|
var ii :int;
|
||||||
if (_elementType == int) {
|
if (_elementType == int) {
|
||||||
for (var ii :int = 0; ii < arr.length; ii++) {
|
for (ii = 0; ii < arr.length; ii++) {
|
||||||
arr[ii] = ins.readInt();
|
arr[ii] = ins.readInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (_isFinal) {
|
} else if (_isFinal) {
|
||||||
var mask :ArrayMask = new ArrayMask();
|
var mask :ArrayMask = new ArrayMask();
|
||||||
mask.readFrom(ins);
|
mask.readFrom(ins);
|
||||||
for (var ii :int = 0; ii < length; ii++) {
|
for (ii = 0; ii < length; ii++) {
|
||||||
if (mask.isSet(ii)) {
|
if (mask.isSet(ii)) {
|
||||||
var target :Object;
|
var target :Object;
|
||||||
if (_delegate == null) {
|
if (_delegate == null) {
|
||||||
@@ -130,7 +134,7 @@ public class ArrayStreamer extends Streamer
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
for (var ii :int = 0; ii < arr.length; ii++) {
|
for (ii = 0; ii < arr.length; ii++) {
|
||||||
arr[ii] = ins.readObject();
|
arr[ii] = ins.readObject();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,9 +30,11 @@ import mx.collections.IList;
|
|||||||
import com.threerings.util.ClassUtil;
|
import com.threerings.util.ClassUtil;
|
||||||
import com.threerings.util.HashMap;
|
import com.threerings.util.HashMap;
|
||||||
|
|
||||||
|
import com.threerings.presents.dobj.CompoundEvent;
|
||||||
import com.threerings.presents.dobj.DEvent;
|
import com.threerings.presents.dobj.DEvent;
|
||||||
import com.threerings.presents.dobj.DObject;
|
import com.threerings.presents.dobj.DObject;
|
||||||
import com.threerings.presents.dobj.DObjectManager;
|
import com.threerings.presents.dobj.DObjectManager;
|
||||||
|
import com.threerings.presents.dobj.ObjectAccessError;
|
||||||
import com.threerings.presents.dobj.ObjectDestroyedEvent;
|
import com.threerings.presents.dobj.ObjectDestroyedEvent;
|
||||||
import com.threerings.presents.dobj.Subscriber;
|
import com.threerings.presents.dobj.Subscriber;
|
||||||
|
|
||||||
@@ -214,8 +216,8 @@ public class ClientDObjectMgr
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else if (obj is FailureResponse) {
|
} else if (obj is FailureResponse) {
|
||||||
var oid :int = (obj as FailureResponse).getOid();
|
var foid :int = (obj as FailureResponse).getOid();
|
||||||
notifyFailure(oid);
|
notifyFailure(foid);
|
||||||
|
|
||||||
} else if (obj is PongResponse) {
|
} else if (obj is PongResponse) {
|
||||||
_client.gotPong(obj as PongResponse);
|
_client.gotPong(obj as PongResponse);
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ import com.threerings.presents.dobj.DSet;
|
|||||||
import com.threerings.presents.dobj.EventListener;
|
import com.threerings.presents.dobj.EventListener;
|
||||||
import com.threerings.presents.dobj.InvocationNotificationEvent;
|
import com.threerings.presents.dobj.InvocationNotificationEvent;
|
||||||
import com.threerings.presents.dobj.InvocationRequestEvent;
|
import com.threerings.presents.dobj.InvocationRequestEvent;
|
||||||
|
import com.threerings.presents.dobj.InvocationResponseEvent;
|
||||||
|
import com.threerings.presents.dobj.MessageEvent;
|
||||||
import com.threerings.presents.dobj.ObjectAccessError;
|
import com.threerings.presents.dobj.ObjectAccessError;
|
||||||
import com.threerings.presents.dobj.Subscriber;
|
import com.threerings.presents.dobj.Subscriber;
|
||||||
import com.threerings.presents.dobj.SubscriberAdapter;
|
import com.threerings.presents.dobj.SubscriberAdapter;
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import mx.utils.ObjectUtil;
|
|||||||
|
|
||||||
import com.threerings.presents.dobj.DObject;
|
import com.threerings.presents.dobj.DObject;
|
||||||
import com.threerings.presents.dobj.DSet;
|
import com.threerings.presents.dobj.DSet;
|
||||||
|
import com.threerings.presents.dobj.DSet_Entry;
|
||||||
|
|
||||||
import com.threerings.io.ObjectInputStream;
|
import com.threerings.io.ObjectInputStream;
|
||||||
import com.threerings.io.ObjectOutputStream;
|
import com.threerings.io.ObjectOutputStream;
|
||||||
|
|||||||
@@ -43,22 +43,19 @@ public class CompoundEvent extends DEvent
|
|||||||
public function CompoundEvent (
|
public function CompoundEvent (
|
||||||
target :DObject = null, omgr :DObjectManager = null)
|
target :DObject = null, omgr :DObjectManager = null)
|
||||||
{
|
{
|
||||||
if (target == null) {
|
super((target == null) ? 0 : target.getOid());
|
||||||
super();
|
|
||||||
return;
|
if (target != null) {
|
||||||
|
// sanity check
|
||||||
|
if (omgr == null) {
|
||||||
|
throw new ArgumentError(
|
||||||
|
"Must receive non-null object manager reference");
|
||||||
|
}
|
||||||
|
|
||||||
|
_omgr = omgr;
|
||||||
|
_target = target;
|
||||||
|
_events = new StreamableArrayList();
|
||||||
}
|
}
|
||||||
|
|
||||||
super(target.getOid());
|
|
||||||
|
|
||||||
// sanity check
|
|
||||||
if (omgr == null) {
|
|
||||||
throw new ArgumentError(
|
|
||||||
"Must receive non-null object manager reference");
|
|
||||||
}
|
|
||||||
|
|
||||||
_omgr = omgr;
|
|
||||||
_target = target;
|
|
||||||
_events = new StreamableArrayList();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -76,7 +76,8 @@ public class ClassUtil
|
|||||||
|
|
||||||
// See which classes we extend.
|
// See which classes we extend.
|
||||||
var exts :XMLList = typeInfo.child("extendsClass").attribute("type");
|
var exts :XMLList = typeInfo.child("extendsClass").attribute("type");
|
||||||
for each (var type :String in exts) {
|
var type :String;
|
||||||
|
for each (type in exts) {
|
||||||
if (asClass == getClassByName(type)) {
|
if (asClass == getClassByName(type)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -85,7 +86,7 @@ public class ClassUtil
|
|||||||
// See which interfaces we implement.
|
// See which interfaces we implement.
|
||||||
var imps :XMLList = typeInfo.child("implementsInterface")
|
var imps :XMLList = typeInfo.child("implementsInterface")
|
||||||
.attribute("type");
|
.attribute("type");
|
||||||
for each (var type :String in imps) {
|
for each (type in imps) {
|
||||||
if (asClass == getClassByName(type)) {
|
if (asClass == getClassByName(type)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,12 +96,13 @@ public class Hashtable
|
|||||||
// documentation inherited from interface Map
|
// documentation inherited from interface Map
|
||||||
public function put (key :Object, value :Object) :*
|
public function put (key :Object, value :Object) :*
|
||||||
{
|
{
|
||||||
|
var oldValue :*;
|
||||||
if (isSimple(key)) {
|
if (isSimple(key)) {
|
||||||
if (_simpleData == null) {
|
if (_simpleData == null) {
|
||||||
_simpleData = new Dictionary();
|
_simpleData = new Dictionary();
|
||||||
}
|
}
|
||||||
|
|
||||||
var oldValue :* = _simpleData[key];
|
oldValue = _simpleData[key];
|
||||||
_simpleData[key] = value;
|
_simpleData[key] = value;
|
||||||
if (oldValue === undefined) {
|
if (oldValue === undefined) {
|
||||||
_simpleSize++;
|
_simpleSize++;
|
||||||
@@ -121,7 +122,7 @@ public class Hashtable
|
|||||||
var firstEntry :Entry = (_entries[index] as Entry);
|
var firstEntry :Entry = (_entries[index] as Entry);
|
||||||
for (var e :Entry = firstEntry; e != null; e = e.next) {
|
for (var e :Entry = firstEntry; e != null; e = e.next) {
|
||||||
if (e.hash == hash && e.key.equals(hkey)) {
|
if (e.hash == hash && e.key.equals(hkey)) {
|
||||||
var oldValue :* = e.value;
|
oldValue = e.value;
|
||||||
e.value = value;
|
e.value = value;
|
||||||
return oldValue; // size did not change
|
return oldValue; // size did not change
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user