All the latest and ... well, the latest anyway.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3950 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -38,7 +38,7 @@ public class BasicDirector
|
||||
* context that it can use to register itself with the necessary
|
||||
* entities.
|
||||
*/
|
||||
protected function BasicDirector (ctx :PresentsContext)
|
||||
public function BasicDirector (ctx :PresentsContext)
|
||||
{
|
||||
// save context
|
||||
_ctx = ctx;
|
||||
|
||||
@@ -7,22 +7,18 @@ public class InvocationAdapter
|
||||
* Construct an InvocationAdapter that will call the specified
|
||||
* function on error.
|
||||
*/
|
||||
public function InvocationAdapter (failedFunc :Function, args :Array = null)
|
||||
public function InvocationAdapter (failedFunc :Function)
|
||||
{
|
||||
_failedFunc = failedFunc;
|
||||
_args = args;
|
||||
}
|
||||
|
||||
// documentation inherited from interface InvocationListener
|
||||
public function requestFailed (cause :String) :void
|
||||
{
|
||||
_failedFunc(cause, _args);
|
||||
_failedFunc(cause);
|
||||
}
|
||||
|
||||
/** The Function to call when we've recevied our failure response. */
|
||||
protected var _failedFunc :Function;
|
||||
|
||||
/** Any other extra information to pass along to the function. */
|
||||
protected var _args :Array;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,6 +35,15 @@ public class InvocationDirector
|
||||
_omgr = omgr;
|
||||
_client = client;
|
||||
|
||||
var subby :Object = new Object();
|
||||
subby.objectAvailable = function (obj :DObject) :void {
|
||||
gotClientObject(obj as ClientObject);
|
||||
}
|
||||
subby.requestFailed = function (
|
||||
oid :int, cause :ObjectAccessError) :void {
|
||||
gotClientObjectFailed(oid, cause);
|
||||
}
|
||||
|
||||
_omgr.subscribeToObject(cloid, new ClientSubscriber(this));
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,11 @@ import com.threerings.presents.dobj.DSet;
|
||||
import com.threerings.presents.dobj.QSet;
|
||||
import com.threerings.presents.net.UsernamePasswordCreds;
|
||||
|
||||
import com.threerings.presents.dobj.DObjectManager;
|
||||
|
||||
import com.threerings.presents.net.BootstrapData;
|
||||
|
||||
|
||||
public class TestClient extends Client
|
||||
{
|
||||
public function TestClient ()
|
||||
@@ -61,7 +66,18 @@ public class TestClient extends Client
|
||||
list.addItem(bob);
|
||||
Log.debug("jim's indeX: " + list.getItemIndex(jim));
|
||||
Log.debug("bob2's indeX: " + list.getItemIndex(bob2));
|
||||
Log.debug("function: " + describeType(testFunc).toXMLString());
|
||||
Log.debug("func length: " + testFunc.length);
|
||||
Log.debug("funcToString: " + testFunc);
|
||||
Log.debug("interfaces: " + describeType(Bint));
|
||||
|
||||
var funcy :Function = function (i :int) :void {
|
||||
Log.debug("i is " + i);
|
||||
Log.debug("first list item is " + list[0]);
|
||||
}
|
||||
|
||||
_savedFunc = funcy;
|
||||
_listy = list;
|
||||
|
||||
|
||||
/*
|
||||
@@ -109,6 +125,13 @@ public class TestClient extends Client
|
||||
//var ta3 :TypedArray = new TypedArray(Pork);
|
||||
}
|
||||
|
||||
public override function gotBootstrap (
|
||||
data :BootstrapData, omgr :DObjectManager) :void
|
||||
{
|
||||
_listy.addItemAt("new item 0", 0);
|
||||
super.gotBootstrap(data, omgr);
|
||||
_savedFunc(3);
|
||||
}
|
||||
|
||||
// If a class isn't used anywhere, it won't get added to the .swf.
|
||||
// Here, I hack.
|
||||
@@ -117,19 +140,30 @@ public class TestClient extends Client
|
||||
var i :int = TimeBaseMarshaller.GET_TIME_OID;
|
||||
}
|
||||
|
||||
public function testFunc (one :int, two :int = 0) :void
|
||||
public function testFunc (one :int, two :int = 0, three :int = -1) :void
|
||||
{
|
||||
Log.debug("this: " + ", args: " + arguments.length +
|
||||
": " + arguments);
|
||||
}
|
||||
|
||||
prototype var _foo :String;
|
||||
|
||||
protected var _savedFunc :Function;
|
||||
protected var _listy :ArrayCollection;
|
||||
}
|
||||
}
|
||||
|
||||
import com.threerings.presents.Log;
|
||||
import com.threerings.presents.client.TestClient;
|
||||
|
||||
interface Aint {
|
||||
function foo () :void;
|
||||
}
|
||||
|
||||
interface Bint extends Aint {
|
||||
function bar () :void;
|
||||
}
|
||||
|
||||
class Person
|
||||
{
|
||||
public function Person (name :String)
|
||||
|
||||
Reference in New Issue
Block a user