Giter VIP home page Giter VIP logo

azerust's Introduction

azerust

Azerust is an experimental WoW server emulator for patch 3.3.5 written in Rust. Currently, it only implements the auth server. It is currently being built to be compatible (read: piggy back on top of) the TrinityCore database. Note, however, that we use mariadb in the docker-compose file. Our goals are:

  • fast
  • readable
  • safe
  • concise

Note: For the time being this relies on nightly for the arbitrary_enum_discriminant feature, which simplifies serialization / deserialization.

Getting Started

This project uses cargo-make for scripting / tasks. It also uses the latest nightly compiler however this is only to speed up compilation.

Configuration

You will need to provide some configs. Run the init command on the world and auth server to generate configs for them.

Docker

The simplest method to kickstart is to just use docker compose. To set up the database, you can use a docker compose file we have available. We need to populate a schema, for which we piggy back off the incredible Trinitycore project.

> cargo make fetch-db
> docker compose --profile server up

The downloaded SQL scripts will be used to set up the databases. You will also need to create a config-auth-compose.yml and a confit-world-compose.yml file which are used by docker-compose.

Building

We statically check our queries against the database to ensure type safety across the board. This means we depend on access to certain information from our database. Obviously spinning up a db every time you build is cumbersome, so there are two options:

.env

DATABASE_URL=mysql://localhost/auth
# or
SQLX_OFFLINE=true

Setting DATABASE_URL dynamically updates queries as we go, while the SQLX_OFFLINE option uses the data in sqlx-data.json. This should always be up to date. If the queries change at any time, we will need to regenerate this file from the live database. To do this, use the make command:

cargo make prepare

The next part is easy. Provide the --release flag if you want to make it go fast.

cargo make auth
# or
cargo run --bin azerust-auth --release

Logging

You can use the RUST_LOG env var to configure log levels. For example, we can enable debug mode for the azerust packages:

RUST_LOG=azerust_auth,azerust_world=debug

Account Creation

To create a command, you can use the exec command to run commands against the database.

cargo make auth exec account create <username> <password> <email>

azerust's People

Contributors

arlyon 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  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

azerust's Issues

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.