Categorygithub.com/jadefish/avatar
modulepackage
0.0.0-20240428033201-e52549138864
Repository: https://github.com/jadefish/avatar.git
Documentation: pkg.go.dev

# README

Avatar

Avatar is an emulator for Ultima Online: Renaissance.

Running

$ mkdir logs
$ login 2>>logs/login.log &
$ game 2>>logs/game.log &

Client compatibility

TODO

Building

Requirements:

$ goenv install
$ make

Find login and game in the bin/ directory.

or:

$ OUT_DIR=/some/where/else GOOS=windows GOARCH=amd64 make

Read the Makefile for more options.

Configuration

Provide configuration via a .env file located in the runtime directory or via values present in the runtime environment.

Get started by creating .env:

$ cp .env.example ./bin/.env

Values provided in the runtime environment override values present in the .env file.

Connections

login

By default, login listens on localhost:7775. Change this address by specifying a value for LOGIN_ADDR:

LOGIN_ADDR=10.1.2.3:55940

game

TODO

Storage

Specify a storage provider by setting the value of the STORAGE_PROVIDER environment variable.

  • PostgreSQL: postgres
    • DB_CONNECTION_STRING must also be present.
  • Memory: memory (not recommended)
STORAGE_PROVIDER=postgres
DB_CONNECTION_STRING="user=worker password=foobarbazbat"

Passwords

Specify a password hashing algorithm by setting the value of the PASSWORD_CIPHER environment variable.

  • bcrypt: bcrypt
    • BCRYPT_COST (default: 10) may optionally be present.

You should not change the password hashing algorithm after creating accounts as subsequent password verification would fail.

PASSWORD_CIPHER=bcrypt
BCRYPT_COST=7

# Packages

No description provided by the author
No description provided by the author

# Functions

NewAccountService creates a new service capable of managing Accounts.

# Constants

ClientStateAuthenticated describes a client has been successfully authenticated.
ClientStateDisconnected indicates that the client's connection to the server is no longer valid.
ClientStateNew indicates that a client has just recently connected and has not yet been authenticated.
ClientStateUnknown indicates that the current state of the client is not currently known.

# Variables

Account error conditions.
Account login error conditions.
Account login error conditions.
Account error conditions.
Account error conditions.
Account error conditions.
Account error conditions.
Account error conditions.
Account login error conditions.

# Structs

No description provided by the author
AccountService provides facilities for working with Accounts.
CreateAccountData hold transformed, validated data for creating an Account.
CreateAccountParameters holds untransformed and unvalidated data for creating an Account.
KeyPair contains a pair of version-specific client encryption keys.
UpdateAccountData holds transformed, validated data for updating an Account.
UpdateAccountParameters holds untransformed and unvalidated data for updating an Account.
Version identifies a unique client revision.

# Interfaces

AccountRepository allows for interacting with an Accounts storage provider.
A CryptoService is capable of encrypting and decrypting data.
PasswordService is capable of generating and verifying password hashes.

# Type aliases

ClientState captures the current state of the client.
EntityID represents a unique identifier for a domain entity.
Seed is a value used to initialize the state of a CryptoService.