Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 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: 2 additions & 0 deletions config/Config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,8 @@ max_items = 250

[character]

min_name_length = 3

# Should be between 12 and 14
max_name_length = 12

Expand Down
1 change: 0 additions & 1 deletion src/map/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,6 @@ pub enum Command {
player_id: i32,
npc_index: i32,
},
Save,
SaveAsync {
respond_to: oneshot::Sender<()>,
},
Expand Down
2 changes: 0 additions & 2 deletions src/map/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -574,8 +574,6 @@ impl Map {
npc_index,
} => self.reset_character(player_id, npc_index),

Command::Save => self.save().await,

Command::SaveAsync { respond_to } => {
self.save().await;
let _ = respond_to.send(());
Expand Down
10 changes: 5 additions & 5 deletions src/map/map/board/create_board_post.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::{
SETTINGS,
db::{DbHandle, insert_params},
utils::get_board_tile_spec,
utils::{get_board_tile_spec, truncate_to_chars},
};
use chrono::{Duration, Utc};

Expand Down Expand Up @@ -34,14 +34,14 @@ impl Map {
return self.open_board(player_id, board_id);
}

let subject = if subject.len() > SETTINGS.board.max_subject_length as usize {
String::from(&subject[..SETTINGS.board.max_subject_length as usize])
let subject = if subject.chars().count() > SETTINGS.board.max_subject_length as usize {
truncate_to_chars(&subject, SETTINGS.board.max_subject_length as usize)
} else {
subject
};

let body = if body.len() > SETTINGS.board.max_post_length as usize {
String::from(&body[..SETTINGS.board.max_post_length as usize])
let body = if body.chars().count() > SETTINGS.board.max_post_length as usize {
truncate_to_chars(&body, SETTINGS.board.max_post_length as usize)
} else {
body
};
Expand Down
15 changes: 9 additions & 6 deletions src/map/map/character/set_character_property.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use eolib::protocol::{
},
};

use crate::{CLASS_DB, SETTINGS};
use crate::{CLASS_DB, SETTINGS, utils::validate_character_name};

use super::super::Map;

Expand All @@ -20,24 +20,27 @@ impl Map {

match property.as_str() {
"title" => {
if (1..={ SETTINGS.character.max_title_length }).contains(&value.len()) {
let title_length = value.chars().count();
if title_length > 0 && title_length <= SETTINGS.character.max_title_length {
character.title = Some(value);
} else {
character.title = None;
}
false
}
"fiance" => {
if (1..={ SETTINGS.character.max_name_length }).contains(&value.len()) {
character.fiance = Some(value);
let name = value.to_lowercase();
if validate_character_name(&name) {
character.fiance = Some(name);
} else {
character.fiance = None;
}
false
}
"partner" => {
if (1..={ SETTINGS.character.max_name_length }).contains(&value.len()) {
character.partner = Some(value);
let name = value.to_lowercase();
if validate_character_name(&name) {
character.partner = Some(name);
} else {
character.partner = None;
}
Expand Down
Loading
Loading