Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
4d22bdd
Save maps in batches
sorokya Apr 15, 2026
2a2d5d0
Validate web socket message length
sorokya Apr 15, 2026
78422d3
Handle errors when leaving map in player actions
sorokya Apr 15, 2026
c23f333
Remove synchronous Save command from Command enum
sorokya Apr 15, 2026
a19be20
Refactor character length checks to use `chars().count()` and add `tr…
sorokya Apr 15, 2026
8f9a447
feat: add email normalization and account name validation
sorokya Apr 15, 2026
cea78d3
refactor: update dependencies and improve email normalization
sorokya Apr 15, 2026
eef22c8
refactor: enhance character name validation and improve title length …
sorokya Apr 15, 2026
8abad53
Update dependencies
sorokya Apr 15, 2026
4c17cab
Version bump
sorokya Apr 15, 2026
4f8a9ce
refactor: improve account name validation by ensuring it is not empty
sorokya Apr 15, 2026
0b8dc0a
refactor: optimize email normalization by reusing compiled regex
sorokya Apr 15, 2026
e25bac4
refactor: streamline player map leaving logic and improve error handling
sorokya Apr 15, 2026
063d8a5
Make close safer by caching name/guild_tag in player. Fix usage calcu…
sorokya Apr 15, 2026
5977b45
Change to per character tick based usage
sorokya Apr 15, 2026
9acdcaf
Add default value
sorokya Apr 15, 2026
477bb1c
Make recv safer
sorokya Apr 15, 2026
61d4e05
feat: implement database migration system and update README instructions
sorokya Apr 15, 2026
d332bf0
Add unique character name constraint
sorokya Apr 15, 2026
b667fa3
Remove SQL migration files from Dockerfile copy command
sorokya Apr 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 48 additions & 36 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "reoserv"
version = "1.15.0"
version = "1.16.0"
authors = ["Richard Leek <richard@richardleek.com>"]
edition = "2024"
description = "The rust powered endless online server emulator"
Expand Down Expand Up @@ -47,9 +47,10 @@ evalexpr = "13.1"
duration-str = "0.21"
version-compare = "0.2"
mail-send = "0.5"
tokio-tungstenite = "0.28"
tokio-tungstenite = "0.29"
hex = "0.4"
rusqlite = { version = "0.38.0", features = ["bundled"] }
rusqlite = { version = "0.39", features = ["bundled"] }
regex = "1.12.3"

[target.'cfg(windows)'.build-dependencies]
winres = "0.1"
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ RUN addgroup --gid 1000 reoserv && \
WORKDIR /reoserv

COPY --from=builder /app/target/release/reoserv ./
COPY README.md LICENSE.txt install.mysql.sql install.sqlite.sql migrate-schema.sql ./
COPY README.md LICENSE.txt ./
COPY config ./config
COPY data ./data

Expand Down
20 changes: 5 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,13 @@ Reoserv supports both MySQL/MariaDB and SQLite.
- For MySQL/MariaDB, set `host`, `port`, `name`, `username`, and `password`.
- For SQLite, set `name` (the server will use `<name>.db` in the working directory).

3. Install the database schema:
3. Start the server normally. It will create the migration log table and apply any missing migrations from `data/migrations/` automatically:
```sh
./reoserv --install
cargo run
```

> [!WARNING]
> If you are upgrading from an older schema version, run migrations before starting the server:
> ```sh
> ./reoserv --migrate
> ```
> Back up your database first. This is especially important if your schema still uses legacy tables such as `Bank` instead of `character_bank`.
> Back up your database first before upgrading an older installation. Startup now applies pending migrations automatically, including legacy schema transitions.

4. If you choose MySQL/MariaDB and are using the provided Compose setup, start only the database service with:
```sh
Expand All @@ -80,16 +76,10 @@ Build/start the stack:
docker compose up -d --build
```

Install schema in the container:
Start the server in the container to let startup migrations create or upgrade the schema:

```sh
docker compose run --rm reoserv ./reoserv --install
```

For upgrades, run migrations in the container:

```sh
docker compose run --rm reoserv ./reoserv --migrate
docker compose run --rm reoserv ./reoserv
```

## Start the server
Expand Down
5 changes: 5 additions & 0 deletions config/Config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,9 @@ spike_damage = 0.2
# Show drops to deep client players when using #item and #npc command
info_reveals_drops = true

# How often character usage increments in seconds
usage_rate = 60

[bard]

# Graphic IDs of weapons that are valid instruments
Expand Down Expand Up @@ -232,6 +235,8 @@ max_items = 250

[character]

min_name_length = 3

# Should be between 12 and 14
max_name_length = 12

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
-- reoserv: skip-if-table-exists=accounts

CREATE TABLE
IF NOT EXISTS `accounts` (
`id` INTEGER NOT NULL AUTO_INCREMENT,
Expand Down Expand Up @@ -205,4 +207,4 @@ CREATE INDEX IF NOT EXISTS `idx_character_spells_character_id` ON `character_spe

CREATE INDEX IF NOT EXISTS `idx_bans_account_id` ON `bans` (`account_id`);

CREATE INDEX IF NOT EXISTS `idx_bans_ip` ON `bans` (`ip`);
CREATE INDEX IF NOT EXISTS `idx_bans_ip` ON `bans` (`ip`);
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
-- reoserv: skip-if-table-exists=accounts

CREATE TABLE
IF NOT EXISTS `accounts` (
`id` INTEGER PRIMARY KEY,
Expand Down Expand Up @@ -198,4 +200,4 @@ CREATE INDEX IF NOT EXISTS `idx_character_spells_character_id` ON `character_spe

CREATE INDEX IF NOT EXISTS `idx_bans_account_id` ON `bans` (`account_id`);

CREATE INDEX IF NOT EXISTS `idx_bans_ip` ON `bans` (`ip`);
CREATE INDEX IF NOT EXISTS `idx_bans_ip` ON `bans` (`ip`);
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
-- reoserv: skip-if-table-missing=Account

INSERT INTO
`accounts` (
`id`,
Expand Down Expand Up @@ -293,4 +295,4 @@ DROP TABLE IF EXISTS `GuildRank`;

DROP TABLE IF EXISTS `Guild`;

DROP TABLE IF EXISTS `Account`;
DROP TABLE IF EXISTS `Account`;
1 change: 1 addition & 0 deletions data/migrations/0003-unique-character-name.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE UNIQUE INDEX IF NOT EXISTS `characters_name_unique` ON `characters` (`name`);
3 changes: 0 additions & 3 deletions dist-workspace.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ include = [
"data",
"README.md",
"LICENSE.txt",
"install.mysql.sql",
"install.sqlite.sql",
"migrate-schema.sql",
]
# Target platforms to build apps for (Rust target-triple syntax)
targets = [
Expand Down
2 changes: 1 addition & 1 deletion src/character.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ pub struct Character {
pub bank: Vec<Item>,
pub trade_items: Vec<Item>,
pub spells: Vec<Spell>,
pub logged_in_at: Option<DateTime<Utc>>,
pub usage_ticks: i32,
pub quests: Vec<QuestProgress>,
pub captcha_open: bool,
pub warp_suck_ticks: i32,
Expand Down
Loading
Loading