Installation Guide

From HSpace

Jump to: navigation, search

BUILDING HSPACE

First, you will need to unpack and compile your game engine, be it PennMUSH or whatever. It is important for you to compile your game without HSpace to be certain that you can even get that far. Build your game, start it up, and get it running well. If you install HSpace without first testing your game without it, you won't be able to distinguish normal game problems from problems that could be caused by the space system!

Ok, you know your game works, right? Shut down your game, and let's build HSpace.

PennMUSH Build Instructions

1) Move your hspace directory into your pennmush/src directory, so that your hspace directory should be at pennmush/src/hspace.

2) Go to the hspace directory, and type make.

If all goes well, it should compile. You should see several lines like "Generating dependencies for ..." and "Compiling ..." If you see any errors, you have compilation problems that were not forseen when this package was created. If that happens, go to the sectioned titled "WHERE TO GET HELP" in this guide.

When your package is done building, you will see a file called in the hspace directory named "libhspace.a." This is the fully compiled HSpace code that will need to be "plugged in" to your game engine. Go to the section titled "INSTALLING HSPACE FOR <X>," where <X> is your game type.

INSTALLATION HSPACE FOR PENNMUSH

You will need to modify one two files for PennMUSH to add HSpace: src/local.c and Makefile.SH.

Make the following change to Makefile.SH (in the pennmush directory):

Locate the line starting with: CLIBS=. In Penn 1.8.2, it appears to be something like CLIBS=$libs $cryptlib $libssl $libmysqlclient

Change it To: CLIBS=-lpthread -Lhspace -lhspace -Lhspace/hsnetwork -lhsnetwork -lstdc++ $libs $cryptlib $libssl $libmysqlclient

Note that this assumes you have your hspace package directory in the pennmush/src directory! If this is not the case, then you should have -L<path to libhspace.a> (e.g. -L../spacestuff/hspace).

Penn ships with a local.dst file in the pennmush/src directory. Move or copy that file to local.c (under unix systems do mv local.dst local.c). Once copied, make the following changes to src/local.c, but do not include the <--- and the text after it!:

local_startup(void)  // <--- Find this
{
	hsInit(); // <--- Add this
}

local_dump_database(void) // <--- Find this
{
	hsDumpDatabases(); // <--- Add this
}

local_shutdown(void) // <--- Find this
{
	hsShutdown(); // <--- Add this
}

local_timer(void) // <--- Find this
{
	hsCycle(); // <--- Add this
}

local_data_free(dbref object __attribute__ ((__unused__))) // <--- Find this
{
    hsDestroyObject(object);
}


When you have made these changes, change to your top-level PennMUSH directory, and type 'sh ./Configure -S', which will regenerate your main Makefile, then type 'make install', which should compile PennMUSH again and link the HSpace code with your game.

There is a known issue with PennMUSH versions 1.8.1p0 and above at this step of the HSpace install process.

When compiling , you may see an error which complains about

pennmush/src/hspace/hsinterface.cpp:1237: undefined reference to `free_object'


Basically, in pennush/src/destroy.c, change:

On line 83 change: 
static void free_object(dbref thing);

to:

extern void free_object(dbref thing);


on line 589 change:

static void
free_object(dbref thing)

to:

void
free_object(dbref thing)

HSpace seems to compile fine after this change.

In the PennMUSH game directory, make a directory named "space," and copy the hspace/hspace.cnf file to this directory. Edit the hspace.cnf, and change things as you please.

Copy all files in the hspace/help_files directory to your pennmush/game/txt/hlp directory. From pennmush/game/txt type 'make' to rebuild the help files.

Restart your game, and you should have HSpace commands available. Type 'help hspace' for the HSpace help files.

Views
Personal tools