Skip to content
dcrodmanPublic

About

Server implementation for the MMO game Phantasy Star Online

Resources

Stars

53 stars

Watchers

5 watching

Forks

Latest commit

 

History

602 Commits

Folders and files

Repository files navigation

Archon

license

Private server implementation for the game Phantasy Star Online Blue Burst, originally developed by SEGA.

Substantial credit is due to the authors of Newserv, Sylverant, and Tethealla, whose implementations make this project possible in the absence of the official servers from which to learn the protocol.

Goals and contributing

There are many other servers out there with varying aims and degrees of functionality. The goal of this one is to be a modern, easy-to-use, and high-performing PSOBB server that can be run across multiple platforms with little setup overhead. Simplicity is a guiding tenant, attempting to be accessible to newcomers and relatively easy to hack on by virtue of clear code and the use of well known standards/practices.

Archon is a long-running personal passion project and the idea of building it is what got me into software engineering in the first place. I work on it when I have time, which typically sporadic given how time-intensive this endeavor can be. Forks, bug fixes, issue reports, explanations of some of the client's bizarre behavior, questions, etc. are all encouraged. As this project stems from a love of both the game and the craft, AI code contributions are not welcome and will be rejected.

Running the server

Archon can be run out of the box with little to no configuration. It includes a starter configuration file, the initialization files for the game, and uses SQLite by default. The only two requirements are Git and Go.

git clone https://github.com/dcrodman/archon.git && cd archon
make run

Configuration

A sensible default configuration is provided for running the server locally, though if you want other players to be able to connect there are a couple of configs you'll want to change. The default configs are located in ./server/config.defaults.yaml but are overridden by anything in ./server/config.yaml. To make changes, simply copy the defaults and then override them in your new config.yaml:

cp server/config.defaults.yaml server/config.yaml

Archon also looks for ARCHON_ prefixed environment variables to override these configs. For example, setting ARCHON_HOSTNAME or ARCHON_DATABASE_ENGINE in your shell will set them without needing a new config file.

By default, the server will look in $(cwd)/server/ for its configuration and any supporting files. If for some reason you'd like to change that, it can be overridden with the -config flag:

# For example, if your config file were in /usr/local/etc/archon/config.yaml:
bin/archon -config /usr/local/etc/archon

Hostname and Broadcast IP

In order for clients outside your network to connect, Archon needs to listen on an external network interface. Once you know your server's IP address, update hostname and external_ip in config.yaml. These values may be the same but if the server will be running on a private subnet (like a home network) then hostname should be set to the IP assigned by the router and the external_ip to the internet-facing address.

Note: If the server will be hosted on a machine in a private network, you'll need to set up port forwarding on the router between the server ports and the machine running Archon. Even then this is only recommended if you have a static IP; you're better off hosting this on a cloud server somewhere for actual gameplay.

Add files to the patch directory

It's recommended that you take the critical files from the copy of the client you intend for people to use and put the majority of them in the patch directory (patch_server.patch_dir in the config file). Archon will load these files and verify that they haven't been tampered with when the client connects, which can help improve stability as well as make cheating harder.

Changing the database

Archon uses SQLite by default, but can easily be switched to use a PostgreSQL database (or others, PRs welcome) if you prefer. Assuming a working Postgres installation, you need only add or uncomment and the following lines in the config file:

database:
    engine: postgres
    host: 127.0.0.1
    port: 5432
    name: archondb
    username: archonadmin
    password: psoadminpassword
    ## Set to verify-full if the Postgres instance supports SSL.
    sslmode: disable

then create the database (substitute the credentials if you wish, they just have to match the config file):

createdb archondb
psql archondb
CREATE USER archonadmin WITH ENCRYPTED PASSWORD 'psoadminpassword';
GRANT ALL ON ALL TABLES IN SCHEMA public TO archonadmin;

Adding Accounts

Archon comes with a small utility for managing accounts, unless you for some reason want to run the SQL yourself (or script it). To add player accounts, just run the tool and follow the prompts:

bin/archon account add

Connecting clients

There are a few possible ways to accomplish this:

  1. Update the connection addresses in the PSOBB client executable
  2. Override the psobb domains in users' hosts file
  3. Configure a DNS server that sends the psobb domains to your server

I may write a DNS server for this one day but for now option #1 is the simplest. You can either grab a hex editor and change the addresses in the client yourself OR use the patcher utility that comes with Archon. Run the following for instructions.

bin/archon patcher -h

A copy of the PSOBB client can be found here (as well as some additional instructions if they're helpful): https://www.pioneer2.net/community/threads/tethealla-server-setup-instructions.1/

Note: If you use a client other than the TethVer12513 executables, you may need to uncomment lines in cmd/archon/patcher.go that correspond to your client. If none exist, you'll have to find the offsets with a hex editor.

About

Server implementation for the MMO game Phantasy Star Online

Resources

Stars

53 stars

Watchers

5 watching

Forks

Releases

Packages

Used by

Contributors

Languages