Mozart.Encore
A cross-platform re-implementation of O2Jam server
Install / Use
/learn @SirusDoma/Mozart.EncoreREADME
CrossTime.Encore
A cross-platform re-implementation of O2Jam game server in C#.
This project is inspired by the Mozart Project 0.028.
Supported client version: v2.33 (X2)
Other Builds
| Build | Supported client version | |--------------------------------------|--------------------------| | Mozart.Encore | v3.10 | | Amadeus.Encore | v3.82 (NX) |
[!CAUTION] The O2Jam X2 client never officially left beta and contains numerous game-breaking bugs. X2 Client and this server build is not recommended as a primary uses for regular gameplay.
Instead, it should be treated as a means of preserving and accessing a client version that has otherwise been lost.
Known limitations:
- The server IP addresses are hard-coded in the client executable. Binary patching is required to connect to a custom server.
- The item shop is non-functional. It requires the user account to be paired with a mgame account, but no such pairing mechanism exists in the network protocol. Even if the client is patched to bypass this checking, the game crashes on the payment page.
- Hall of Fame and Artist Room are not implemented.
- Album mode is not implemented. While a workaround exists to access it, gameplay becomes broken after the first song.
- User list is not working.
- Attributive (Ring modifier) is not working properly.
- Various other client bugs exist, such as inability to enter some servers, the client sending outdated or missing payload packet data, etc.
[!IMPORTANT] Gem Star is not fully supported.
Gem Star is a rating system exclusive to O2Jam X2. Each server defines a Gem Star range and is only accessible to players whose Gem Star count falls within that range, except for the practice server, which is open to all players regardless of their Gem Star count.
Gem Stars can be earned by completing missions, with rewards unique to each server, or by playing against other players in versus mode. However, versus matches can also result in Gem Star loss.
The Gem Stars gain and loss are computed entirely on the server side, and the algorithm behind these calculations was never discovered. For this reason, the server does not implement Gem Star rewards or penalties.
However, Gem Star is defined in the schema and properly included in the network response.
Features
- Zero-Configuration for quick start.
- Full online and local network multiplayer support.
- Complete packet op-code coverage.
- Compatible with multiple SQL database systems.
- Support multi planet and channels deployment.
- Highly customizable with high-level network protocol implementation.
<sub>* In-game web server features are not included.</sub>
Project Structure
| Project | Description | |------------------------------------------------|---------------------------------------------------| | Encore | Custom TCP server framework | | Mozart.Server | Core O2Jam server implementation | | Mozart.Data | Data persistent implementation | | Mozart.Migrations | Database migrations with various drivers | | CrossTime.Web | Lightweight HTTP Web server | | CrossTime | Game server implementation for O2Jam client v2.33 |
Configuration
The server can be configured either with config.ini or command-line arguments.
See Command-line configuration provider to set up command-line config.
Server
Server deployment mode and TCP connection setting.
Use --Server:<Option> to configure these settings via command-line arguments (e.g, --Server:Port=15010)
| Option | Description |
|--------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Mode | Server deployment mode. Supported values: <ul><li>Full<br/>Act as a full-package server: One gateway with one or more channels.</li><br/><li>Gateway<br/>Handle authentication and end-user TCP connections, relaying them to the Channel servers.</li><br/><li>Channel<br/>Manage users persistent and non-persistent in-game states/logic of one particular channel.</li></ul> Default: Full |
| Address | <ul><li>In Full/Gateway mode:<br/>TCP address to listen incoming connection. Using 0.0.0.0 may require admin privilege.</li><br/><li>In Channel mode:<br/>The local endpoint address for the TCP client.</li></ul> Default: 127.0.0.1 |
| Port | <ul><li>In Full/Gateway mode:<br/>TCP port to listen incoming connection.</li><br/><li>In Channel mode:<br/>The local endpoint address for the TCP client.</li></ul> Default: 15010 |
| MaxConnections | The maximum number of clients connecting to the server. Default: 10000 |
| PacketBufferSize | The maximum number of bytes per message frame that can be processed by the server. Default: 4096 bytes |
HTTP
Lightweight HTTP web server settings.
| Option | Description |
|-----------|-------------------------------------------------------------------------------------------------------------------|
| Enabled | Determine whether the web server is enabled. Default: false |
| Address | Web server address to listen incoming requests. Using 0.0.0.0 may require admin privilege. Default: 127.0.0.1 |
| Port | HTTP port to listen incoming requests. Default: 15010 |
Database
Database connection setting.
Use --Db:<Option> to configure these settings via command-line arguments
| Option | Description |
|------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Driver | Specify database provider. <br/>Supported drivers:<ul><li>Memory (NOT Recommended)</li><li>Sqlite (Recommended for local server)</li><li>SqlServer</li><li>MySql</li><li>Postgres</li></ul>Default: Sqlite |
| Name | Database name. Default: O2JAM |
| Url | Database Url, also known as Connection String. Default: Data Source=O2JAM.db |
| MinBatchSize | Minimum number of statements that are needed for a multi-statement command sent to the database. Default: (not configured) |
| MaxBatchSize | Maximum number of statements that are needed for a multi-statement command sent to the database. Default: (not configured) |
| CommandTimeout | The wait time (in seconds) before terminating the attempt to execute a command and generating an error. Default: (not configured) |
