Skeleton for Venison! The tile-laying game of farming, brigandeering and
general conquest. git-svn-id: https://samskivert.googlecode.com/svn/trunk@347 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
Executable
+16
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
BINDIR=`dirname $0`
|
||||
JAVA_ARGS=""
|
||||
|
||||
# grab the -Dinviter if it's specified
|
||||
if [ ! -z "$1" ] ; then
|
||||
case $1 in
|
||||
-Dinvitee=*)
|
||||
JAVA_ARGS=$1
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
$BINDIR/runjava $JAVA_ARGS com.threerings.micasa.client.MiCasaApp $*
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
bindir=`dirname $0`
|
||||
$bindir/runjava com.threerings.micasa.server.MiCasaServer $*
|
||||
Executable
+95
@@ -0,0 +1,95 @@
|
||||
#!/usr/bin/perl -w
|
||||
#
|
||||
# $Id: runjava,v 1.1 2001/10/09 20:27:35 mdb Exp $
|
||||
#
|
||||
# Invokes java with the necessary classpath and parameters.
|
||||
|
||||
use Getopt::Std;
|
||||
|
||||
my $usage = "Usage: $0 [-p pid_file] [-r server_root] args\n";
|
||||
|
||||
# locations of stuff
|
||||
chomp($location = `dirname $0`);
|
||||
|
||||
# get the server root by popping the /bin off of our parent directory
|
||||
@parts = split(/\//, $location);
|
||||
pop(@parts);
|
||||
my $root = join("/", @parts);
|
||||
|
||||
# make sure JAVA_HOME is set
|
||||
my $jhome = $ENV{"JAVA_HOME"};
|
||||
if (!defined $jhome) {
|
||||
warn "$0: Error: No JAVA_HOME specified!\n";
|
||||
warn "\n";
|
||||
warn "You must set your JAVA_HOME environment variable to the\n";
|
||||
warn "the absolute path of your JDK installation. For example:\n";
|
||||
warn "\n";
|
||||
warn " % JAVA_HOME=/usr/local/jdk1.2\n";
|
||||
warn " % export JAVA_HOME\n";
|
||||
die "\n";
|
||||
}
|
||||
|
||||
# make sure it's set to a directory
|
||||
if (! -d $jhome) {
|
||||
die "$0: Can't find a java interpreter in '$jhome'.\n";
|
||||
}
|
||||
|
||||
my $java = "$jhome/bin/java";
|
||||
my $jlib = "$jhome/lib/classes.zip";
|
||||
|
||||
# determine our machine architecture
|
||||
my $ostype = `uname -s`;
|
||||
my $machtype = `uname -m`;
|
||||
chomp($ostype);
|
||||
chomp($machtype);
|
||||
my $arch = "$machtype-$ostype";
|
||||
|
||||
# add our native libraries to the runtime library path
|
||||
my $libs = "$root/lib/$arch";
|
||||
my $libpath = $ENV{"LD_LIBRARY_PATH"};
|
||||
|
||||
if (defined $libpath) {
|
||||
$ENV{"LD_LIBRARY_PATH"} = "$libs:$libpath";
|
||||
} else {
|
||||
$ENV{"LD_LIBRARY_PATH"} = $libs;
|
||||
}
|
||||
|
||||
# put everything in our class path
|
||||
my $classpath = "-classpath $jlib:$root/dist/classes";
|
||||
|
||||
# any zip or jar files in our lib/ directory get added to the class path
|
||||
if (opendir(DIR, "$root/lib")) {
|
||||
foreach $lib (grep { /.(zip|jar)/ && -f "$root/lib/$_" } readdir(DIR)) {
|
||||
$classpath .= ":$root/lib/$lib";
|
||||
}
|
||||
closedir DIR;
|
||||
}
|
||||
|
||||
my $pid_file = undef;
|
||||
my $i = 0;
|
||||
|
||||
# strip out the args (we'd use getopt() but the damned thing provides no
|
||||
# way of escaping arguments so that we can pass args to runjava that get
|
||||
# passed down to the JVM)
|
||||
for ($i = 0; $i < @ARGV; $i++) {
|
||||
my $arg = $ARGV[$i];
|
||||
|
||||
# stop when we see -- (and strip it out because Java don't dig --)
|
||||
if ($arg eq "--") {
|
||||
splice(@ARGV, $i, 1);
|
||||
last;
|
||||
}
|
||||
|
||||
if ($arg eq "-p") {
|
||||
$pid_file = $ARGV[$i+1];
|
||||
splice(@ARGV, $i, 2);
|
||||
$i -= 1; # decrement i so that things stay in sync
|
||||
}
|
||||
}
|
||||
|
||||
# log the pid file if requested to do so
|
||||
print `echo $$ > $pid_file` if (defined $pid_file);
|
||||
|
||||
my $cmd = "$java $classpath " . join(" ", @ARGV);
|
||||
# print "$cmd\n";
|
||||
exec($cmd);
|
||||
@@ -0,0 +1,75 @@
|
||||
<!-- build configuration -->
|
||||
<project name="venison" default="compile" basedir=".">
|
||||
|
||||
<!-- things you may want to change -->
|
||||
<property name="app.name" value="venison"/>
|
||||
<property name="doc.packages" value="org.waywardgeeks.venison.*"/>
|
||||
<property name="doc.overview" value="org/waywardgeeks/venison/overview.html"/>
|
||||
<property name="copyright.holder" value="Michael Bayne"/>
|
||||
<property name="build.compiler" value="jikes"/>
|
||||
<property name="java.libraries" value="/usr/share/java"/>
|
||||
|
||||
<!-- things you probably don't want to change -->
|
||||
<property name="src.dir" value="src/java"/>
|
||||
<property name="deploy.dir" value="dist"/>
|
||||
<property name="dist.jar" value="${app.name}.jar"/>
|
||||
<property name="javadoc.dir" value="${deploy.dir}/docs"/>
|
||||
|
||||
<!-- declare our classpath -->
|
||||
<path id="classpath">
|
||||
<fileset dir="${java.libraries}" includes="**/*.jar"/>
|
||||
<fileset dir="lib" includes="**/*.jar"/>
|
||||
<pathelement location="${deploy.dir}/classes"/>
|
||||
</path>
|
||||
|
||||
<!-- prepares the application directories -->
|
||||
<target name="prepare">
|
||||
<mkdir dir="${deploy.dir}"/>
|
||||
<mkdir dir="${deploy.dir}/classes"/>
|
||||
<mkdir dir="${deploy.dir}/classes/rsrc"/>
|
||||
<mkdir dir="${javadoc.dir}"/>
|
||||
<copy todir="${deploy.dir}/classes">
|
||||
<fileset dir="${src.dir}" includes="**/*.properties"/>
|
||||
</copy>
|
||||
<copy todir="${deploy.dir}/classes/rsrc">
|
||||
<fileset dir="rsrc" includes="**/*"/>
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
<!-- cleans out the installed application -->
|
||||
<target name="clean">
|
||||
<delete dir="${deploy.dir}"/>
|
||||
</target>
|
||||
|
||||
<!-- build the java class files -->
|
||||
<target name="compile" depends="prepare">
|
||||
<javac srcdir="${src.dir}" destdir="${deploy.dir}/classes"
|
||||
debug="on" optimize="off" deprecation="off">
|
||||
<classpath refid="classpath"/>
|
||||
</javac>
|
||||
</target>
|
||||
|
||||
<!-- build the javadoc documentation -->
|
||||
<target name="javadoc" depends="prepare">
|
||||
<javadoc sourcepath="${src.dir}"
|
||||
packagenames="${doc.packages}"
|
||||
windowtitle="${app.name} API"
|
||||
doctitle="${app.name} API"
|
||||
overview="${src.dir}/${doc.overview}"
|
||||
bottom="Copyright © 2001 ${copyright.holder}. All Rights Reserved."
|
||||
destdir="${javadoc.dir}">
|
||||
<classpath refid="classpath"/>
|
||||
<link href="http://java.sun.com/j2se/1.3/docs/api/"/>
|
||||
</javadoc>
|
||||
</target>
|
||||
|
||||
<!-- a target for rebuilding everything -->
|
||||
<target name="all" depends="clean,prepare,compile,javadoc,dist"/>
|
||||
|
||||
<!-- builds our distribution files (war and jar) -->
|
||||
<target name="dist" depends="prepare,compile">
|
||||
<jar file="${deploy.dir}/${dist.jar}"
|
||||
basedir="${deploy.dir}/classes"/>
|
||||
</target>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1 @@
|
||||
i686-Linux
|
||||
@@ -0,0 +1,46 @@
|
||||
Required external libraries
|
||||
---------------------------
|
||||
|
||||
The Venison code requires the following external Java libraries (JAR
|
||||
files) to be placed (or symlinked) here in the lib/ directory or in the
|
||||
shared library directory specified in the build.xml file
|
||||
(${java.libraries}).
|
||||
|
||||
* Apache Commons Util library (from the sanbox)
|
||||
http://jakarta.apache.org/commons/index.html
|
||||
|
||||
* The samskivert package:
|
||||
http://www.waywardgeeks.org/code/samskivert/
|
||||
|
||||
* MM MySQL driver:
|
||||
http://mmmysql.sourceforge.net/
|
||||
|
||||
* Matt Welsh's Non-blocking IO library:
|
||||
http://www.cs.berkeley.edu/~mdw/proj/java-nbio/
|
||||
|
||||
(The native code shared library should be built and placed into
|
||||
lib/i686-Linux where it will be automatically added to LD_LIBRARY_PATH
|
||||
by the runjava script. Alternatively you can put it into your
|
||||
LD_LIBRARY_PATH by hand.)
|
||||
|
||||
* The Java API for XML Processing (JAXP) 1.1 Reference Implementation:
|
||||
http://java.sun.com/xml/download.html
|
||||
|
||||
(Only crimson.jar and jaxp.jar are required. xalan.jar may safely
|
||||
be excluded.)
|
||||
|
||||
* Megginson Technologies' XMLWriter 0.2 library:
|
||||
http://www.megginson.com/Software/xml-writer-0.2.zip
|
||||
|
||||
* The ? game development platform
|
||||
http://www.threerings.net/code/?/
|
||||
|
||||
* The MiCasa game hosting service
|
||||
http://www.threerings.net/code/micasa/
|
||||
|
||||
Once the jar files are in place (regardless of what they are named), the
|
||||
build system will automatically include them in the compile-time
|
||||
classpath.
|
||||
|
||||
--
|
||||
$Id: README,v 1.1 2001/10/09 20:27:35 mdb Exp $
|
||||
@@ -0,0 +1,13 @@
|
||||
#
|
||||
# $Id: dbmap.properties,v 1.1 2001/10/09 20:27:35 mdb Exp $
|
||||
#
|
||||
# This provides information on the JDBC connections that are used by
|
||||
# Venison server services.
|
||||
|
||||
#
|
||||
# The database mapping for the user database.
|
||||
#
|
||||
userdb.driver = org.gjt.mm.mysql.Driver
|
||||
userdb.url = jdbc:mysql://depravity:3306/usermgmt
|
||||
userdb.username = www
|
||||
userdb.password = Il0ve2PL@Y
|
||||
@@ -0,0 +1,4 @@
|
||||
#
|
||||
# $Id: server.properties,v 1.1 2001/10/09 20:27:35 mdb Exp $
|
||||
#
|
||||
# Configuration for the Venison server
|
||||
@@ -0,0 +1,17 @@
|
||||
#
|
||||
# $Id: server.properties,v 1.1 2001/10/09 20:27:35 mdb Exp $
|
||||
#
|
||||
# Configuration for the MiCasa server
|
||||
|
||||
#
|
||||
# The list of lobby identifiers to be loaded into this server.
|
||||
#
|
||||
lobby_ids = venison
|
||||
|
||||
#
|
||||
# The cofiguration for the test lobby.
|
||||
#
|
||||
venison.config = com.threerings.micasa.lobby.LobbyConfig
|
||||
venison.ugi = venison,board,tile,strategy
|
||||
venison.name = Venison Lobby
|
||||
venison.game_config = com.threerings.venison.VenisonConfig
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// $Id: Log.java,v 1.1 2001/10/03 18:32:28 mdb Exp $
|
||||
// $Id: Log.java,v 1.2 2001/10/09 20:27:35 mdb Exp $
|
||||
|
||||
package org.waywardgeeks;
|
||||
package com.threerings.venison;
|
||||
|
||||
/**
|
||||
* A placeholder class that contains a reference to the log object used by
|
||||
@@ -14,7 +14,7 @@ package org.waywardgeeks;
|
||||
* generate log messages. For example:
|
||||
*
|
||||
* <pre>
|
||||
* import org.waywardgeeks.venison.Log;
|
||||
* import com.threerings.venison.Log;
|
||||
* // ...
|
||||
* Log.warning("All hell is breaking loose!");
|
||||
* // ...
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// $Id
|
||||
|
||||
package com.threerings.venison;
|
||||
|
||||
import com.threerings.cocktail.party.client.PlaceView;
|
||||
import com.threerings.parlor.client.GameController;
|
||||
import com.threerings.parlor.util.ParlorContext;
|
||||
|
||||
import com.threerings.venison.Log;
|
||||
|
||||
/**
|
||||
* The main coordinator of user interface activities on the client-side of
|
||||
* the Venison game.
|
||||
*/
|
||||
public class VenisonController extends GameController
|
||||
{
|
||||
protected PlaceView createPlaceView ()
|
||||
{
|
||||
return new VenisonPanel(_ctx);
|
||||
}
|
||||
|
||||
protected void gameDidStart ()
|
||||
{
|
||||
Log.info("Venison game did start.");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
//
|
||||
// $Id
|
||||
|
||||
package com.threerings.venison;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import javax.swing.*;
|
||||
|
||||
import com.threerings.cocktail.party.data.PlaceObject;
|
||||
import com.threerings.cocktail.party.client.PlaceView;
|
||||
|
||||
import com.threerings.parlor.util.ParlorContext;
|
||||
|
||||
/**
|
||||
* The top-level user interface component for the Venison game display.
|
||||
*/
|
||||
public class VenisonPanel
|
||||
extends JPanel implements PlaceView
|
||||
{
|
||||
/**
|
||||
* Constructs a new Venison game display.
|
||||
*/
|
||||
public VenisonPanel (ParlorContext ctx)
|
||||
{
|
||||
add(new JLabel("Venison panel"), BorderLayout.CENTER);
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
public void willEnterPlace (PlaceObject plobj)
|
||||
{
|
||||
Log.info("Panel entered place.");
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
public void didLeavePlace (PlaceObject plobj)
|
||||
{
|
||||
Log.info("Panel left place.");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// $Id: AtlantiConfig.java,v 1.1 2001/10/09 20:27:35 mdb Exp $
|
||||
|
||||
package com.threerings.venison;
|
||||
|
||||
import com.threerings.parlor.data.GameConfig;
|
||||
|
||||
public class VenisonConfig extends GameConfig
|
||||
{
|
||||
public Class getControllerClass ()
|
||||
{
|
||||
return VenisonController.class;
|
||||
}
|
||||
|
||||
public String getManagerClassName ()
|
||||
{
|
||||
return "com.threerings.venison.VenisonManager";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// $Id: AtlantiObject.java,v 1.1 2001/10/09 20:27:35 mdb Exp $
|
||||
|
||||
package com.threerings.venison;
|
||||
|
||||
import com.threerings.parlor.data.GameObject;
|
||||
|
||||
/**
|
||||
* The distributed object used to maintain state for the Venison game.
|
||||
*/
|
||||
public class VenisonObject extends GameObject
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// $Id: AtlantiManager.java,v 1.1 2001/10/09 20:27:35 mdb Exp $
|
||||
|
||||
package com.threerings.venison;
|
||||
|
||||
import com.threerings.parlor.server.GameManager;
|
||||
|
||||
/**
|
||||
* The main coordinator of the Venison game on the server side.
|
||||
*/
|
||||
public class VenisonManager extends GameManager
|
||||
{
|
||||
// documentation inherited
|
||||
protected Class getPlaceObjectClass ()
|
||||
{
|
||||
return VenisonObject.class;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user