Skip to content

Yurzs/L2py

Repository files navigation

L2py

Code style: black Imports: isort chat on Discord

Lineage2 Interlude+ server emulator written in python3

Stage: Alpha

What currently works

  • Login Server
  • Game Server

Contribute

Feel free to join developing our server:

How to start developing

  • Copy .env.example to .env.
  • Set environment variables as you need in .env

Using docker-compose

  • Make sure you have make, docker, docker-compose installed.
  • Build docker images make docker-build
  • Start containers docker-compose up -d
  • Register game server in database make compose-exec-login register_game_server <GAME_SERVER_HOST> <GAME_SERVER_PORT> <GAME_SERVER_ID>.
    NOTE: <GAME_SERVER_HOST> can't be 0.0.0.0

Without docker-compose

  • Make sure you have make, docker, docker-compose installed.

  • Install poetry using make install

  • Run poetry install

  • Start mongodb in container or using other methods.

  • Activate virtual environment . .venv/bin/activate

  • Register game server in database login/bin/register_game_server <GAME_SERVER_HOST> <GAME_SERVER_PORT> <GAME_SERVER_ID>
    NOTE: <GAME_SERVER_HOST> can't be 0.0.0.0

    NOTE: Apply environment variables with source .env

  • Start login server make python -m login/login

  • Start game server make python -m game/game

Emulator server architecture

Project is split to 2 components:

  • Login Server - L2 login service + basic HTTP API
  • Game Server - L2 game service + basic HTTP API

All those services have own instances of common.application.Application with specific modules (for example game server have TCPServerModule, HTTPServerModule, ScheduleModule).

ApplicationModules

Each ApplicationModule adds functionality to main application process. All modules are running in one asyncio loop.

  • TCPServerModule: L2 protocol requests handler
  • HTTPServerModule: HTTP JSON requests handler
  • ScheduleModule: CRON tasks runner

TCPServerModule Middlewares

Middlewares are used in L2 protocol handler for convenient way for not caring about all those complicated protocol specific encryption.

Data types

Most of the custom data types derive from ctypes (At least numeric ones.)

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages