Git Product home page Git Product logo

idolapsoserv's Introduction

IDOLA PSO Server Emulator

A Phantasy Star Online emulator written in Rust. Currently very incomplete.

Build Status

Features

  • Native Windows, Linux, and MacOSX support.
  • Written in Rust, a high level systems language with statically guaranteed memory and concurrency safety, and a smart optimizing compiler.
  • Memory-efficient architecture for handling connections.
  • Supports Blue Burst.

Planned features

  • Support for multiple kinds of databases (currently sqlite3 file store only)
  • Flexible configuration system for single or multi server set-ups. Only want to run the game locally? Just configure IDOLA to spin up every service needed by the game locally, and run a single instance of the app.
  • Experience point and drop rate adjustment in config for PSOBB.
  • Cross-version interaction between all versions of PSO.

Building

IDOLA requires Rust 1.5 stable or later to build.

  1. Install Rust 1.5 for your platform. Check with rustc --version
  2. Install libsqlite3.
  3. Run cargo build. Optionally, cargo build --release for release optimizations. Warning: compile times will skyrocket.
  4. The binary will be in target/{debug|release}/idola[.exe].

Windows

You must use the GNU ABI version of Rust to build because we link into libsqlite3. The easiest way to set this up is to install MSYS2, and install the mingw-w64-i686 package for libsqlite3 (not the MSYS version) in Pacman. The build script for the Rust binding will use the Windows version of pkg-config to find the libsqlite3 to link.

Running

The idola binary is multi-functional. Primarily, it is the server, but it is multiple servers combined. The configuration file passed with the -c or --config option specifies what services are run in this instance of the server. This aids in debugging; an example configuration can be found at data/default/idola_local.toml in the source tree that spawns a patch, login, ship, 10 blocks, and the shipgate server all bound on 127.0.0.1, with the shipgate's database configured to a Sqlite file named local.db in the current directory.

A complete Blue Burst service minimally requires at least one of each:

  • BB Patch server
  • BB Data server
  • BB Login server (configured to redirect to itself)
  • Ship
  • Block
  • Shipgate

The shipgate serves information about accounts and all the other services (except for the patch server) must login and verify on it. Ships will talk to the shipgate to register themselves to the server.

The following section is not implemented yet.

In addition to running the services, idola can be used to execute commands on a shipgate, such as account management.

Shipgate Security concerns

Currently, only a simple password is used to authenticate connections to the shipgate. That means, if you are running an Internet-accessible service, you should configure your network such that your services connect through your own intranet, so that shipgate traffic does not route through the Internet. If not, user credentials and the shipgate password could be exposed. The easiest way to ensure this for a single server is to bind the shipgate on localhost and configure services to connect on localhost as well.

License

Copyright (C) 2015, 2016 Bygone Worlds Project

Portions derived from Sylverant, Copyright (C) 2012, 2013, 2014, 2015 Lawrence Sebald

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program 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 General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see http://www.gnu.org/licenses/.

idolapsoserv's People

Contributors

hybrideidolon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

idolapsoserv's Issues

Ground items do not get replicated to party joiners by the leader

This depends on correct handling of item unique IDs during transfer from a lobby to a party. This is a lot more complicated than simply being unique IDs between users: the IDs change based on the player's slot in the party, and also whether or not it was generated for a drop on the ground (i.e. stack drops from inventory, enemy and box drops). They also get reassigned when going back to the lobby or logging out.

In the current implementation, item IDs are handled correctly, but for whatever reason, a joining player will not see all the existing items on the ground. Having asserted that the subcommand messages sent during the party burst to a joiner are symmetrical, I do not understand why this is happening. The party leader is responsible for sending info about what items are on the ground, but the joiner is not getting this information. It may be related to item IDs.

A brute-force solution would be to simply send information about all the party inventory items (ground items) on join, but this is not technically correct; the client would see the "freshly dropped" particle effects if, for example, the item were on the ground inside the Hunter's Guild.

Organize services into subcrates

The large majority of server implementation code is currently in the main crate (src) and this results in fairly significant compile times. Each of the services could probably rest in their own subcrates because they do not depend on each other. Linking times would still be long, however.

The mio event loop and message framing state machines could probably be independent of the services as well, so long as the common enums and structs between all the services are made available.

Rewrite message and file format parsers in nom

Almost all of the message and file parsers are implemented as Serial trait implementations (psoserial subcrate). This is hard to maintain and fairly obnoxious to write initially because it requires hand-written read and write implementations. It would be nice if these were all converted to nom-based parsers.

JSON API shipgate access service

A new optional, configurable subservice that provides a JSON API service for interfacing with the shipgate.

This API should allow for account creation, deletion, management, querying ship and block information, etc. It should require the shipgate password (or future authentication mechanism) to interact with, such that another API sits in front could provide further authentication or controlled exposure to data (i.e., a second API shim written by the end user that allows public access to certain shipgate information, but limited access to mutating functions).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.