Coder Social home page Coder Social logo

l2py's Introduction

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.)

l2py's People

Contributors

maosplx avatar rostum avatar wotori avatar yurzs 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

l2py's Issues

Разработка

Привет, планируется ли возобновление разработки сервера?

Analyse bot tests

We need to test server somehow using automation.
Implementing a basic bot seems like a good start.
Need to analyse it in details.

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.