From 828fd809510317bfa17d9947e29029315f22576b Mon Sep 17 00:00:00 2001 From: Walter Korman Date: Tue, 12 Nov 2002 01:42:28 +0000 Subject: [PATCH] Minor restructuring to allow derived simulator applications to specialize their logon behaviour to suit their needs. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1932 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../micasa/simulator/client/ClientController.java | 15 ++++++++++----- .../micasa/simulator/client/SimulatorApp.java | 11 ++++++++--- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/java/com/threerings/micasa/simulator/client/ClientController.java b/src/java/com/threerings/micasa/simulator/client/ClientController.java index cf732678a..0c340e580 100644 --- a/src/java/com/threerings/micasa/simulator/client/ClientController.java +++ b/src/java/com/threerings/micasa/simulator/client/ClientController.java @@ -1,5 +1,5 @@ // -// $Id: ClientController.java,v 1.8 2002/09/20 00:54:39 mdb Exp $ +// $Id: ClientController.java,v 1.9 2002/11/12 01:42:28 shaper Exp $ package com.threerings.micasa.simulator.client; @@ -7,11 +7,10 @@ import java.awt.event.ActionEvent; import com.samskivert.swing.Controller; import com.samskivert.util.StringUtil; -import com.threerings.presents.dobj.*; -import com.threerings.presents.client.*; +import com.threerings.presents.client.Client; +import com.threerings.presents.client.SessionObserver; -import com.threerings.crowd.client.*; -import com.threerings.crowd.data.*; +import com.threerings.crowd.data.BodyObject; import com.threerings.parlor.game.GameConfig; import com.threerings.parlor.util.ParlorContext; @@ -67,6 +66,12 @@ public class ClientController extends Controller // keep the body object around for stuff _body = (BodyObject)client.getClientObject(); + // have at it + createGame(client); + } + + public void createGame (Client client) + { GameConfig config = null; try { // create the game config object diff --git a/src/java/com/threerings/micasa/simulator/client/SimulatorApp.java b/src/java/com/threerings/micasa/simulator/client/SimulatorApp.java index 890052df6..d12bb556b 100644 --- a/src/java/com/threerings/micasa/simulator/client/SimulatorApp.java +++ b/src/java/com/threerings/micasa/simulator/client/SimulatorApp.java @@ -1,5 +1,5 @@ // -// $Id: SimulatorApp.java,v 1.11 2002/07/15 03:09:29 mdb Exp $ +// $Id: SimulatorApp.java,v 1.12 2002/11/12 01:42:28 shaper Exp $ package com.threerings.micasa.simulator.client; @@ -41,8 +41,7 @@ public class SimulatorApp _client = createSimulatorClient(_frame); // set up the top-level client controller - Controller ctrl = new ClientController( - _client.getParlorContext(), _frame, siminfo); + Controller ctrl = createController(siminfo); _frame.setController(ctrl); // create the server @@ -84,6 +83,12 @@ public class SimulatorApp return new SimpleClient(_frame); } + protected ClientController createController (SimulatorInfo siminfo) + { + return new ClientController( + _client.getParlorContext(), _frame, siminfo); + } + public void run () { // configure and display the main frame