Don't report ready if not actually a player.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3258 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -28,6 +28,7 @@ import com.threerings.presents.dobj.AttributeChangedEvent;
|
||||
|
||||
import com.threerings.crowd.client.PlaceController;
|
||||
import com.threerings.crowd.client.PlaceControllerDelegate;
|
||||
import com.threerings.crowd.data.BodyObject;
|
||||
import com.threerings.crowd.data.PlaceConfig;
|
||||
import com.threerings.crowd.data.PlaceObject;
|
||||
import com.threerings.crowd.util.CrowdContext;
|
||||
@@ -35,6 +36,8 @@ import com.threerings.crowd.util.CrowdContext;
|
||||
import com.threerings.parlor.Log;
|
||||
import com.threerings.parlor.util.ParlorContext;
|
||||
|
||||
import com.threerings.util.Name;
|
||||
|
||||
/**
|
||||
* The game controller manages the flow and control of a game on the
|
||||
* client side. This class serves as the root of a hierarchy of controller
|
||||
@@ -93,13 +96,18 @@ public abstract class GameController extends PlaceController
|
||||
// runnable here that will let the game manager know that we're
|
||||
// ready on the next pass through the distributed event loop
|
||||
Log.info("Entering game " + _gobj.which() + ".");
|
||||
_ctx.getClient().getInvoker().invokeLater(new Runnable() {
|
||||
public void run () {
|
||||
// finally let the game manager know that we're ready to roll
|
||||
Log.info("Reporting ready " + _gobj.which() + ".");
|
||||
_gobj.gameService.playerReady(_ctx.getClient());
|
||||
}
|
||||
});
|
||||
Name username =
|
||||
((BodyObject)_ctx.getClient().getClientObject()).username;
|
||||
if (_gobj.getPlayerIndex(username) != -1) {
|
||||
_ctx.getClient().getInvoker().invokeLater(new Runnable() {
|
||||
public void run () {
|
||||
// finally let the game manager know that we're ready
|
||||
// to roll
|
||||
Log.info("Reporting ready " + _gobj.which() + ".");
|
||||
_gobj.gameService.playerReady(_ctx.getClient());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user