arbitrarily assigned turn holder be the one to end the game.
git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@234 c613c5cb-e716-0410-b11b-feb51c14d237
- Flash seems to sketch out when key events go elsewhere
- Whirled now does the handy thing of re-routing 'word' keypresses
to the ChatControl, unless a TextField has focus. We want to automatically
let games get any and all keypresses...
- The damn focus stuff is broken anyway
Untested, Nathan will test.
git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@231 c613c5cb-e716-0410-b11b-feb51c14d237
Brought in 'name' from MsoyGameConfig, because it's useful.
git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@230 c613c5cb-e716-0410-b11b-feb51c14d237
this was the right thing to do. Go ahead and log the innards-laden stack
trace, we'll be glad when there's a bug in our innards.
git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@229 c613c5cb-e716-0410-b11b-feb51c14d237
will see a stack trace originating in the EZGameControl, hopefully
with a useful message.
git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@228 c613c5cb-e716-0410-b11b-feb51c14d237
users can do the right thing with regard to adding extra configuration stuff
(rather than trusting the client to have done it).
git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@227 c613c5cb-e716-0410-b11b-feb51c14d237
Doing this on the client, while theoretically possible, is more complex. We
have a server, we use it to provide commonly needed services, the assignment of
a single client to control the game is a commonly needed service. This also
matches the way other services like turn change and game start and end are
implemented.
A side note: the client-side code was not properly handling disconnected
players, which the server code properly handles.
git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@224 c613c5cb-e716-0410-b11b-feb51c14d237
It acted as a proxy for the distributed ez properties, such that you could
set properties in the object and they'd magically go out over the network.
Like so:
var data :Object = _gameCtrl.data;
data.scores = [ 0, 0 ];
data.startingPlayer = (Math.random() > .5) ? 0 : 1;
Of course, you could read props too and even iterate over them in a for
or for-each loop.
But, with the addition of testAndSet() and setImmediately() it was decided
that this direct access was ripe for confusion. Also, because there was
not a *second-level* proxy for every array property, it didn't send
individual array element updates over the network. I suppose I could write
an array proxy and create one for every array property set, but jeezgod
let's not get too crazy. Let's just keep it EZ and make people use our
nice well-documented methods.
If we want to add a method to EZGameControl for iterating over all
properties, we can. That might be useful...
There is one small concern, which is that now we're handing off our
internal storage Object to usercode, so someone would have to modify
their copy of EZGameControl and then they could... mess up their own game.
Whatever.
git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@221 c613c5cb-e716-0410-b11b-feb51c14d237
- every time we check for the host's existence, if the host doesn't exist
or abandoned the game, the client will try to claim their role automatically
- unified both event types into one "host changed" event
- fixed bug that ignored negative player ids
git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@218 c613c5cb-e716-0410-b11b-feb51c14d237
do it on the backend more efficiently than seating.getPlayerPosition(getMyId());
git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@216 c613c5cb-e716-0410-b11b-feb51c14d237
Fix potential for NPE (passing null to our UserIdentifier) if an
invalid occupantId is specified.
git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@214 c613c5cb-e716-0410-b11b-feb51c14d237
Clarify that it applies to occupants, not just players.
git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@213 c613c5cb-e716-0410-b11b-feb51c14d237
to sending a playerReady notification to the server.
git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@212 c613c5cb-e716-0410-b11b-feb51c14d237
allows games to create a HostCoordinator in their constructor and still not
fail unrecoverably to display outside the client environment.
git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@211 c613c5cb-e716-0410-b11b-feb51c14d237
Of course, the flash documentation says that function.apply() returns
void, but luckily this is not the case. DO NOT TRUST THEIR DOCS, they are
riddled with errors.
git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@210 c613c5cb-e716-0410-b11b-feb51c14d237
Made it protected, added a second function for 'friend' access.
We could use a custom namespace for this, too.
git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@206 c613c5cb-e716-0410-b11b-feb51c14d237
specific meaning, and will be treated differently by wrapper generatin scripts.
git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@199 c613c5cb-e716-0410-b11b-feb51c14d237
essentially calling setImmediate() when they call set(), since set() used
to be immediate.
git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@197 c613c5cb-e716-0410-b11b-feb51c14d237
the event trundles through the queue, especially since the 'test' was
being done immediately.
- Simplified some stuff on the server.
- Fixed up the test, as EZgame arrays will auto-grow.
- Do not set the property immediately on the client! Dangerz! We will add
a new function for that, so that set() behaves like testAndSet() without the
test, and set() behaves like setImmediate() without the immediate.
(And there's no such thing as test and set immediately.)
git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@196 c613c5cb-e716-0410-b11b-feb51c14d237
- Moved property testing, so that it happens before any propertySet events are
dispatched. In the previous version, testing happened while processing the
set event on the server - but since by that time client events have already been
sent, it introduced the possibility of short-lived inconsistencies between client
and server data models.
- Introduced a separate EZ API call for test and set - not only does it perform
the test, but unlike regular set, it does not cache the new value ahead of time.
Instead the new value will have to arrive from the server, at some future point.
- Trimmed PropertySetEvent and other handlers back down - they don't need to
carry any of the test info around, after it's already been performed. Also
cut redundant testing on the clients.
git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@195 c613c5cb-e716-0410-b11b-feb51c14d237
it's atomic in the sense that a single server event will test the variable,
and only set it if the previous value was null (i.e. didn't exist).
This allows for a level of elementary synchronization between the clients.
The new function on EZGameControl is:
_gameCtrl.testAndSet (propertyName, newValue[, index])
I hoped to generalize this to test against arbitrary values, but that's
significantly harder, since properties accept numerous types as values,
and those can have different representations on the client and the server.
So it remains a check against null until we need to generalize it. :)
git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@193 c613c5cb-e716-0410-b11b-feb51c14d237
Undocumented, I'm sure we'll change some things around soon.
Fixed a few bugs, too.
git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@190 c613c5cb-e716-0410-b11b-feb51c14d237
That way, when a function is changed the compiler will tell us about
any matching change we may need to make to WorldGameControlBackend.
Otherwise, the override function that may be present in the world version
may shift to overridding the adapter function.
It's also just cleaner to move these adapter functions to their own class.
git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@187 c613c5cb-e716-0410-b11b-feb51c14d237