Sign inSign up

opentibiabr/login-server

By opentibiabr

Updated almost 5 years ago

Image
0

10K+

opentibiabr/login-server repository overview

OpenTibiaBR - Login Server

Version Go GitHub repo size

Discord Channel GitHub pull request GitHub issues

Project

OpenTibiaBR - Login Server is a free open source login server developed in golang to enable cipclient and otclient to connect and login to canary server.

Current version supports only http login, through /login or /login.php routes.

The project is fully covered by tests and supports multi-platform build. Every release is available with multi-platform applications for download.

Builds

PlatformBuild
MacOSMacOS Build
UbuntuUbuntu Build
WindowsWindows Build

Workflow

Getting Started

To run it, simply download the latest release and define your environment variables. You can set environment type as dev if you want to use a .env file (store it in the same folder of the login server).

You can also download our docker image and apply the environment variables to your container.

Enviroment Variables

NAMEHOW TO USE
MYSQL_DBNAMEdatabase default database name
MYSQL_HOSTdatabase host
MYSQL_PORTdatabase port
MYSQL_PASSdatabase password
MYSQL_USERdatabase username
ENV_LOG_LEVELlogrus log level for verbose ref
LOGIN_IPlogin ip address
LOGIN_HTTP_PORTlogin http port
LOGIN_GRPC_PORTlogin grpc port
RATE_LIMITER_BURSTrate limiter same request burst
RATE_LIMITER_RATErate limit request per sec per user
SERVER_IPgame server IP address
SERVER_LOCATIONgame server location
SERVER_NAMEgame server name
SERVER_PORTgame server game port
VOCATIONSgame vocation list csv (a,b,c)

Tests
go test ./tests -v

Build
RUN go build -o TARGET_NAME ./src/

Docker

docker pull opentibiabr/login-server:latest

Automation Image Size Pulls Build

Benchmark

There are a few known login versions available. The most common ones are a python login and login.php, from different websites versions. We've performed a benchmark (code available in benchmark_test.go) where 1k valid requests were performed to the server, locally. As you can see in the results below, we got up to 10x faster without decreasing the server availability (99.5% is still pretty good in any global standard).

image

Also, we performed a benchmark in google cloud, using cloud run and cloud sql database, both with lower possible specifications. As you can see, we kept an average of 700 requests/s and a good availability, even if with the latency between my computed and cloud services being accounted in this graph.

image

Another great aspect is that, comparing with the python login, our docker image is almost 10x smaller (15Mb).

gRPC

From version 2.0.0 on, we start using gRPC protocol. The HTTP runs on top of the gRPC layer, using a reversed proxy. That lead to a small gain in the availability without any performance loss.

In the gRPC server we got a 10x performance boost, compared to the HTTP benchmarks:

image

Issues

We use the issue tracker on GitHub. Everyone who is watching the repository gets notified by e-mail when there is an activity, so be mindful about comments that add no value (e.g. "+1").

We are willing to improve the login server with more features, so feel free to create issues with features requests and ideas, only bug fixes.

If you'd need an issue/feature to be prioritized, you should either do it yourself and submit a pull request, or place a bounty.

Pull requests

Before creating a pull request please keep in mind:

  • Set one single scope in your pull request. Focus help us review and things to ship faster. Too many things on the same Pull Request make it harder to review, harder to test and hard to move on.
  • Add tests. Pull Requests without tests won't be approved.
  • Your code must follow go standard golang format patterns.
  • There are people that doesn't play the game on the official server, so explain your changes to help understand what are you changing and why.
  • Avoid opening a Pull Request to just update minor typo or comments. Try attaching those to other PRs with meaningful content.

Special Thanks

  • our partners
  • our crew (majesty, gpedro, eduardo dantas, foot, lucas)

Sponsors

If you want to sponsor here, join on discord and send a message for one of our administrators.

Partners

Supported by OTServ Brasil

Tag summary

Content type

Image

Digest

Size

7.1 MB

Last updated

almost 5 years ago

docker pull opentibiabr/login-server