Behold Vilya, Ring of Air and repository for our game and virtual worldly

extensions to the distributed environment provided by Narya.


git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@1 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
Michael Bayne
2006-06-23 17:58:11 +00:00
commit a4df87e52f
317 changed files with 45818 additions and 0 deletions
@@ -0,0 +1,50 @@
//
// $Id: MiCasaClient.java 4191 2006-06-13 22:42:20Z ray $
//
// Narya library - tools for developing networked games
// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved
// http://www.threerings.net/code/narya/
//
// This library is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License as published
// by the Free Software Foundation; either version 2.1 of the License, or
// (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.threerings.micasa.server;
import com.threerings.presents.net.BootstrapData;
import com.threerings.crowd.server.CrowdClient;
import com.threerings.micasa.data.MiCasaBootstrapData;
/**
* Extends the Crowd client and provides bootstrap data specific to the
* MiCasa services.
*/
public class MiCasaClient extends CrowdClient
{
// documentation inherited
protected BootstrapData createBootstrapData ()
{
return new MiCasaBootstrapData();
}
// documentation inherited
protected void populateBootstrapData (BootstrapData data)
{
super.populateBootstrapData(data);
// let the client know their default lobby oid
((MiCasaBootstrapData)data).defLobbyOid =
MiCasaServer.lobreg.getDefaultLobbyOid();
}
}
@@ -0,0 +1,33 @@
//
// $Id: MiCasaConfig.java 4191 2006-06-13 22:42:20Z ray $
//
// Narya library - tools for developing networked games
// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved
// http://www.threerings.net/code/narya/
//
// This library is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License as published
// by the Free Software Foundation; either version 2.1 of the License, or
// (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.threerings.micasa.server;
import com.samskivert.util.Config;
/**
* Provides access to the MiCasa server configuration.
*/
public class MiCasaConfig
{
/** Provides access to configuration data for this package. */
public static Config config = new Config("rsrc/config/micasa/server");
}
@@ -0,0 +1,74 @@
//
// $Id: MiCasaServer.java 4158 2006-05-30 22:12:15Z mdb $
//
// Narya library - tools for developing networked games
// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved
// http://www.threerings.net/code/narya/
//
// This library is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License as published
// by the Free Software Foundation; either version 2.1 of the License, or
// (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.threerings.micasa.server;
import com.threerings.crowd.server.CrowdServer;
import com.threerings.parlor.server.ParlorManager;
import com.threerings.micasa.Log;
import com.threerings.micasa.lobby.LobbyRegistry;
/**
* This class is the main entry point and general organizer of everything
* that goes on in the MiCasa game server process.
*/
public class MiCasaServer extends CrowdServer
{
/** The parlor manager in operation on this server. */
public static ParlorManager parmgr = new ParlorManager();
/** The lobby registry operating on this server. */
public static LobbyRegistry lobreg = new LobbyRegistry();
/**
* Initializes all of the server services and prepares for operation.
*/
public void init ()
throws Exception
{
// do the base server initialization
super.init();
// configure the client manager to use our client class
clmgr.setClientClass(MiCasaClient.class);
// initialize our parlor manager
parmgr.init(invmgr, plreg);
// initialize the lobby registry
lobreg.init(invmgr);
Log.info("MiCasa server initialized.");
}
public static void main (String[] args)
{
MiCasaServer server = new MiCasaServer();
try {
server.init();
server.run();
} catch (Exception e) {
Log.warning("Unable to initialize server.");
Log.logStackTrace(e);
}
}
}