- Some deflexing of the low-level narya stuff. More to come, as we're
going to want the minimum client to be flex-free. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4507 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -174,7 +174,7 @@ public class Client extends EventDispatcher
|
||||
public function getService (clazz :Class) :InvocationService
|
||||
{
|
||||
if (_bstrap != null) {
|
||||
for each (var isvc :InvocationService in _bstrap.services.source) {
|
||||
for each (var isvc :InvocationService in _bstrap.services.asArray()) {
|
||||
if (isvc is clazz) {
|
||||
return isvc;
|
||||
}
|
||||
|
||||
@@ -26,8 +26,6 @@ import flash.events.TimerEvent;
|
||||
import flash.utils.Timer;
|
||||
import flash.utils.getTimer; // function import
|
||||
|
||||
import mx.collections.IList;
|
||||
|
||||
import com.threerings.util.ClassUtil;
|
||||
import com.threerings.util.HashMap;
|
||||
|
||||
@@ -227,10 +225,10 @@ public class ClientDObjectMgr
|
||||
// if this is a compound event, we need to process its contained
|
||||
// events in order
|
||||
if (event is CompoundEvent) {
|
||||
var events :IList = (event as CompoundEvent).getEvents();
|
||||
var events :Array = (event as CompoundEvent).getEvents();
|
||||
var ecount :int = events.length;
|
||||
for (var ii :int = 0; ii < ecount; ii++) {
|
||||
dispatchEvent(events.getItemAt(ii) as DEvent);
|
||||
dispatchEvent(events[ii] as DEvent);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2,10 +2,7 @@ package com.threerings.presents.client {
|
||||
|
||||
import flash.utils.getTimer; // function import
|
||||
|
||||
import mx.collections.IViewCursor;
|
||||
import mx.collections.ArrayCollection;
|
||||
|
||||
import com.threerings.util.HashMap;
|
||||
import com.threerings.util.Hashtable;
|
||||
|
||||
import com.threerings.presents.data.InvocationMarshaller_ListenerMarshaller;
|
||||
|
||||
@@ -60,7 +57,7 @@ public class InvocationDirector
|
||||
*/
|
||||
public function registerReceiver (decoder :InvocationDecoder) :void
|
||||
{
|
||||
_reclist.addItem(decoder);
|
||||
_reclist.push(decoder);
|
||||
|
||||
// if we're already online, assign a recevier id now
|
||||
if (_clobj != null) {
|
||||
@@ -74,12 +71,11 @@ public class InvocationDirector
|
||||
public function unregisterReceiver (receiverCode :String) :void
|
||||
{
|
||||
// remove the receiver from the list
|
||||
for (var iter :IViewCursor = _reclist.createCursor();
|
||||
iter.moveNext(); ) {
|
||||
for (var ii :int = _reclist.length - 1; ii >= 0; ii--) {
|
||||
var decoder :InvocationDecoder =
|
||||
(iter.current as InvocationDecoder);
|
||||
(_reclist[ii] as InvocationDecoder);
|
||||
if (decoder.getReceiverCode() === receiverCode) {
|
||||
iter.remove();
|
||||
_reclist.splice(ii, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,10 +118,7 @@ public class InvocationDirector
|
||||
{
|
||||
_clobj.startTransaction();
|
||||
try {
|
||||
for (var itr :IViewCursor = _reclist.createCursor();
|
||||
itr.moveNext(); ) {
|
||||
var decoder :InvocationDecoder =
|
||||
(itr.current as InvocationDecoder);
|
||||
for each (var decoder :InvocationDecoder in _reclist) {
|
||||
assignReceiverId(decoder);
|
||||
}
|
||||
} finally {
|
||||
@@ -354,14 +347,14 @@ public class InvocationDirector
|
||||
|
||||
/** Used to keep track of invocation service listeners which will
|
||||
* receive responses from invocation service requests. */
|
||||
protected var _listeners :HashMap = new HashMap();
|
||||
protected var _listeners :Hashtable = new Hashtable();
|
||||
|
||||
/** Used to keep track of invocation notification receivers. */
|
||||
protected var _receivers :HashMap = new HashMap();
|
||||
protected var _receivers :Hashtable = new Hashtable();
|
||||
|
||||
/** All registered receivers are maintained in a list so that we can
|
||||
* assign receiver ids to them when we go online. */
|
||||
internal var _reclist :ArrayCollection = new ArrayCollection();
|
||||
internal var _reclist :Array = [];
|
||||
|
||||
/** The last time we flushed our listeners. */
|
||||
protected var _lastFlushTime :Number;
|
||||
|
||||
Reference in New Issue
Block a user