diff --git a/.env.example b/.env.example deleted file mode 100644 index 94b5f90b..00000000 --- a/.env.example +++ /dev/null @@ -1,2 +0,0 @@ -MYSQL_ROOT_PASSWORD=CHANGEME -MYSQL_REOSERV_PASSWORD=CHANGEME \ No newline at end of file diff --git a/.gitignore b/.gitignore index c7c700a4..04626530 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,7 @@ data/quests/*.eqf .env *.local.toml *.local.ron + +# Endless Online Client +EOzipped028 +EOzipped028.zip diff --git a/README.md b/README.md index cb12b03f..2dbaef37 100644 --- a/README.md +++ b/README.md @@ -2,51 +2,72 @@ # REOSERV -The rust powered [Endless Online](https://game.eoserv.net/) server emulator! +The Rust-powered server emulator for [Endless Online](https://endless-online.com) 🦀 -# Building +## Prerequisites -The only depency is rust and cargo. I recommend using [rustup](https://rustup.rs/) to install both. +Before building the server, ensure you have the following installed: -To build the server simply run +- [Rust](https://www.rust-lang.org/) +- [Cargo](https://doc.rust-lang.org/cargo/appendix/glossary.html#cargo) -`cargo build` +I recommend using [rustup](https://rustup.rs/) to install Rust and Cargo. -or for release build +## Building -`cargo build --release` +To build the server, simply run: -# Database setup +```sh +cargo build +``` -0. You should install docker-compose -1. Create a .env file with the following (replacing s with your own secure password) +For a release build, use: +```sh +cargo build --release ``` -MYSQL_ROOT_PASSWORD= -MYSQL_REOSERV_PASSWORD= -``` -2. Start the container +> [!NOTE] +> Set up and configure a MySQL database before starting the server. See the section below for instructions. +> Edit `config/Config.toml` to match your production database before creating a release build. + +## Database setup and configuration -`docker-compose up` +We use a MySQL database to store game data. -# Configure the server +1. If you don't have a MySQL database set up, you can run this Docker command to create one: + ```sh + docker run --name reoserv-db \ + -e MYSQL_ROOT_PASSWORD="CHANGEME" \ + -e MYSQL_PASSWORD="CHANGEME" \ + -e MYSQL_USER="reoserv" \ + -e MYSQL_DATABASE="reoserv" \ + -e TZ="UTC" \ + -p "3306:3306" \ + -v ./db-init/:/docker-entrypoint-initdb.d/ \ + --restart unless-stopped \ + -d mariadb:latest + ``` + Replace `CHANGEME` with your own secure passwords. -_You can either edit Config.toml directly or edit a copy Config.local.toml_ +2. Edit the database connection settings in `config/Config.toml` or in a copy of it (`config/Config.local.toml`) accordingly before building / running the server. -The only required change right now is the settings for the database connection. +## Start the server -If you're using the provided docker-compose file then all you need to do is set -password to the same password you set to for `MYSQL_REOSERV_PASSWORD` in the .env file. +To run the server, use: + +```sh +cargo run +``` -# Start server +## Setup quests, NPCs and items for your server -You can run the server with +See [our documentation](https://reoserv.net/docs) for instructions on how to setup quests, NPCs, items and more for your server. -`cargo run` +- [Classes, Items, Spells, NPCs](https://reoserv.net/docs/pubs) +- [Maps](https://reoserv.net/docs/maps) +- [Quests](https://reoserv.net/docs/quests) -(if you want more logging then set the `RUST_LOG` environment variable to one -of the following: +## Setup the Endless Online client -- debug: The human readable data structures for every packet will be printed -- trace: The raw byte arrays for every packet will be printed +See `eo-client/README.md` for instructions diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index e1c2e98c..00000000 --- a/docker-compose.yml +++ /dev/null @@ -1,15 +0,0 @@ -services: - - db: - image: mariadb - restart: always - environment: - MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD} - MYSQL_USER: reoserv - MYSQL_DATABASE: reoserv - MYSQL_PASSWORD: ${MYSQL_REOSERV_PASSWORD} - TZ: UTC - ports: - - "3306:3306" - volumes: - - ./db-init/:/docker-entrypoint-initdb.d/ diff --git a/eo-client/README.md b/eo-client/README.md new file mode 100644 index 00000000..6e853b8f --- /dev/null +++ b/eo-client/README.md @@ -0,0 +1,39 @@ +# Setup the Endless Online client + +## Ubuntu + +For Ubuntu users, we provide a script to simplify the client setup. Just follow these steps: + +```sh +cd eo-client +chmod +x setup.sh +./setup.sh +``` + +This script will download the client, configure settings, and apply necessary fixes to get the client running smoothly. + +## Manual setup (Windows and other platforms) + +If you're not on Ubuntu or prefer a manual approach, follow these steps: + +1. Download and unzip the client from [here](https://cache.tehsausage.com/EndlessOnline/EOzipped028.zip). + +2. Copy the custom `eo-client/config/setup.ini` file from this repository into the `EOzipped028/config` directory. _(Do not replace the `setup.ini` in the root of the `EOzipped028` directory.)_ + +3. If using Wine, you may want to apply these optional fixes if the client doesn't run smoothly: + ```sh + cat /usr/lib/wine/wined3d.dll.so | sed 's/EnterCrit/LeaveCrit/' > $HOME/.wine/drive_c/windows/system32/wined3d.dll + wine reg add 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v 'wined3d' /d 'native,builtin' /f + ``` + +## Running the Client + +1. Ensure you have the server up and running in a different terminal window. + +2. Once you've completed the setup, you can run the Endless Online client: + ```sh + cd eo-client/EOzipped028 # or the directory where you unzipped the client + wine endless.exe + ``` + +3. Check the server console for a message confirming that the client has connected. diff --git a/eo-client/config/setup.ini b/eo-client/config/setup.ini new file mode 100644 index 00000000..8b167f93 --- /dev/null +++ b/eo-client/config/setup.ini @@ -0,0 +1,119 @@ +# Endless Online 0.27 [ configuration file ] + +# This is the main Endless Online configuration file. It contains +# the configuration directives that give the game engine its +# instructions. See www.endless-online.com for more instructions. + +# If you do not know what how to use this configuration files you +# are strongly adviced to exit this file without making any changes. + +[CONNECTION] + +# change this values to connect to a server. You can either put +# a 'hostname' or a IP number here. Port number should be given +# on the website owned by the game server you want to connect. + +Host=LOCALHOST +Port=8078 + +[CONFIGURATION] + +# putting fullscreen to 'off' will launch you in a windowed mode, +# attention: performance will suffer in a windowed mode. +# stay on top makes your window always visible in a windowed +# mode. + +Fullscreen=off +Sizeable=off +StayOnTop=off + +# disable pageflipping could increase your framerate (fps). +# running without pageflipping might be unstable. +# only enable blocktranfer if you see weird graphics. + +Pageflipping=on +BlockTransfer=off + +# the next settings are advanced, it are instructions for behaviour +# of the various graphic loaders. Making a loader static will require +# more memory but will increase the overal game performance because +# the harddisk activity will be less. If you have little system memory +# (32mb or less) you can turn these values to 'off' to reduce memory. + +StaticSprites=on +StaticObjects=on +StaticTiles=on + +[SETTINGS] + +# you can disable sound or music, this might speed up a little bit. +# you cannot turn sound or music back 'on' once you are playing. + +Music=off +Sound=on + +# turning off the following features could increase your framerate (fps). +# if the game is running normal you should have both options 'on'. + +ShowBaloons=on +ShowShadows=on + +[CHAT] + +# the server is not filtering the spoken chatlines, but we offer +# you your own filter that you can turn on and off. If you set +# FilterAll to 'on' any chatline with a 'bad' word in it will +# not being displayed on your screen. + +Filter=off +FilterAll=off + +# here you can change a few features of the chat system +# LogChat will make a text file every time you play Endless. +# If needed you can also block all whispers. + +LogChat=on +LogFile=CHATLOG.TXT + +HearWhisper=on +Interaction=on + +[LANGUAGE] + +# the language will change the displayed messages and you +# keyboard behaviour, default this settings are on '0' english. +# note: endless does not support AltGr combinations! +# note: keyboard code 3 will enable 'azerty' keyboards. + +# language code table +# 0: english +# 1: dutch +# 2: swedish +# 3:portuguese + +# keyboard code table +# 0: english +# 1: dutch +# 2: swedish +# 3: azerty + +Language=0 +Keyboard=0 + +[CUSTOM] + +# optional to disable the intro to start the game more quickly. +# if your game doesnt run its adviced to turn this feature 'off'. + +Skipintro=on + +# optional to disable the anti-keylog softpad login system. +# skipping this option could make you vulnerable to keyloggers. + +Skipsoftpad=on + +# remember, every time you launch the game it will be set up with +# these instructions, if you like to change something you need to +# restart the game as well. + +# end of configuration diff --git a/eo-client/setup.sh b/eo-client/setup.sh new file mode 100644 index 00000000..e2d51fea --- /dev/null +++ b/eo-client/setup.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +# Variables +CLIENT_URL="https://cache.tehsausage.com/EndlessOnline/EOzipped028.zip" +SETUP_INI_PATH="./config/setup.ini" +WINE_INSTALL_PREFIX="/usr/lib/wine" # Default Wine installation path +WINEPREFIX="$HOME/.wine" # Default Wine prefix + +# Download and unzip the client +wget $CLIENT_URL -O EOzipped028.zip +unzip EOzipped028.zip -d EOzipped028 + +# Replace setup.ini +cp $SETUP_INI_PATH ./EOzipped028/config/setup.ini + +# Install Wine if not installed +if ! command -v wine &> /dev/null +then + echo "Wine could not be found, installing..." + sudo apt update + sudo apt install -y wine +fi + +# Apply Wine fixes +cat $WINE_INSTALL_PREFIX/wined3d.dll.so | sed 's/EnterCrit/LeaveCrit/' > $WINEPREFIX/drive_c/windows/system32/wined3d.dll +wine reg add 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v 'wined3d' /d 'native,builtin' /f + +echo "Client setup complete. You can now run the client using Wine."