Updated to conform to new place services provided by party. Getting closer

to being able to launch a game.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@406 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2001-10-09 00:48:34 +00:00
parent 95ba5ef9cf
commit 31a0177480
6 changed files with 86 additions and 12 deletions
@@ -1,5 +1,5 @@
//
// $Id: ClientController.java,v 1.2 2001/10/04 23:41:44 mdb Exp $
// $Id: ClientController.java,v 1.3 2001/10/09 00:48:34 mdb Exp $
package com.threerings.micasa.client;
@@ -14,7 +14,6 @@ import com.threerings.cocktail.cher.net.UsernamePasswordCreds;
import com.threerings.cocktail.party.client.*;
import com.threerings.cocktail.party.data.*;
import com.threerings.cocktail.party.util.PlaceViewUtil;
import com.threerings.media.sprite.SpriteManager;
@@ -133,8 +132,9 @@ public class ClientController
// clean up after the old place
if (_place != null) {
_place.removeSubscriber(this);
// dispatch didLeavePlace to our views
PlaceViewUtil.dispatchDidLeavePlace(_frame, _place);
_place.removeSubscriber(this);
}
_place = place;
@@ -142,6 +142,7 @@ public class ClientController
// and enter the new place with bells on
if (_place != null) {
_place.addSubscriber(this);
// dispatch willEnterPlace to our views
PlaceViewUtil.dispatchWillEnterPlace(_frame, _place);
}
}
@@ -1,5 +1,5 @@
//
// $Id: OccupantList.java,v 1.1 2001/10/04 23:41:44 mdb Exp $
// $Id: OccupantList.java,v 1.2 2001/10/09 00:48:34 mdb Exp $
package com.threerings.micasa.client;
@@ -7,9 +7,9 @@ import java.util.Iterator;
import javax.swing.*;
import com.threerings.cocktail.party.client.OccupantObserver;
import com.threerings.cocktail.party.client.PlaceView;
import com.threerings.cocktail.party.data.OccupantInfo;
import com.threerings.cocktail.party.data.PlaceObject;
import com.threerings.cocktail.party.util.PlaceView;
import com.threerings.micasa.util.MiCasaContext;
@@ -0,0 +1,45 @@
//
// $Id: LobbyConfig.java,v 1.1 2001/10/09 00:48:34 mdb Exp $
package com.threerings.micasa.lobby;
import java.io.IOException;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import com.threerings.cocktail.party.data.PlaceConfig;
public class LobbyConfig extends PlaceConfig
{
// documentation inherited
public Class getControllerClass ()
{
return LobbyController.class;
}
// documentation inherited
public String getManagerClassName ()
{
return "com.threerings.micasa.lobby.LobbyManager";
}
// documentation inherited
public void writeTo (DataOutputStream out)
throws IOException
{
super.writeTo(out);
}
// documentation inherited
public void readFrom (DataInputStream in)
throws IOException
{
super.readFrom(in);
}
// documentation inherited
protected void toString (StringBuffer buf)
{
super.toString(buf);
}
}
@@ -0,0 +1,26 @@
//
// $Id: LobbyController.java,v 1.1 2001/10/09 00:48:34 mdb Exp $
package com.threerings.micasa.lobby;
import com.threerings.cocktail.party.data.PlaceConfig;
import com.threerings.cocktail.party.client.PlaceController;
import com.threerings.cocktail.party.client.PlaceView;
import com.threerings.cocktail.party.util.PartyContext;
import com.threerings.micasa.Log;
public class LobbyController extends PlaceController
{
public void init (PartyContext ctx, PlaceConfig config)
{
super.init(ctx, config);
Log.info("Lobby controller created [config=" + config + "].");
}
protected PlaceView createPlaceView ()
{
return null;
}
}
@@ -1,5 +1,5 @@
//
// $Id: LobbyRegistry.java,v 1.2 2001/10/04 23:41:44 mdb Exp $
// $Id: LobbyRegistry.java,v 1.3 2001/10/09 00:48:34 mdb Exp $
package com.threerings.micasa.lobby;
@@ -106,15 +106,17 @@ public class LobbyRegistry implements LobbyCodes
props = PropertiesUtil.getSubProperties(props, lobbyId);
// get the lobby manager class and UGI
String lmgrClass = props.getProperty("mgrclass");
if (StringUtil.blank(lmgrClass)) {
throw new Exception("Missing 'mgrclass' definition in " +
String cfgClass = props.getProperty("config");
if (StringUtil.blank(cfgClass)) {
throw new Exception("Missing 'config' definition in " +
"lobby configuration.");
}
// instantiate the manager class and create the lobby
LobbyConfig config = (LobbyConfig)
Class.forName(cfgClass).newInstance();
LobbyManager lobmgr = (LobbyManager)
MiCasaServer.plreg.createPlace(Class.forName(lmgrClass));
MiCasaServer.plreg.createPlace(config);
// initialize the lobby manager. it will call lobbyReady()
// when it has obtained a reference to its lobby object and is