Coder Social home page Coder Social logo

l2auth's Introduction

L2 Auth

Simple Lineage 2 C4 server written as a learning exercise. Currently working in WINDOWS & LINUX (thanks to Docker).

L2Auth Demo

Running the server with Docker

  • Install docker & docker-compose
  • docker-compose up
  • Server will start listening to address 127.0.0.1 (local) and port 2106.

Setting up DEV environment

  • Follow instructions to build log dependency from Dockerfile
  • sudo apt install libssl-dev

What to expect

Right now, the server will listen for up to two connections. For the time being, the server is capable of:

  • Create socket/connection
  • Listen for connections
  • Accept connections
  • Encrypt connection with RSA & Blowfish
  • Send Lineage 2 packets
  • Receive Lineage 2 packets
  • Log in
  • Enter world
  • Restart
  • Very early multiple connection support

Lineage 2 Protocol

Lineage 2 uses TCP in order to send packets.

All integers are little endian.

The first two bytes of the packet contain the packet size and the third one, usually the packet type.

Other than the first packet, all packets are encrypted with blowfish using the following hardcoded key: ;5.]94-31==-%xT!^[$\000.

Folder structure

  • core: Core modules, used by both login server and game server
  • os: OS related code (sockets, threads, etc.)
  • os/<implementation>: For the time being only Linux implementation are being written down but more can be added by easily creating a new folder and implementing all the header files in the os folder. Make sure to update game/Makefile to use the new implementation instead of os/linux (replace $(wildcard ../os/linux/*.c) with new implementation, ie $(wildcard ../os/windows/*.c)).
  • game: Game server code
  • game/db: Persistence related code
  • game/db/<implementation>: Currently I'm working with sqlite since it's the quickest/easiest to implement but, more can be added easily by adding a new folder, implementing all the header files residing in game/db and updating game/Makefile to include the new implementation instead of sqlite (replace $(wildcard db/sqlite3/*.c) with new implementation, ie $(wildcard db/psql/*.c)).
  • game/dto: Data transfer objects
  • game/handler: Handlers for each client request (ie, entering world)
  • game/handler/client: Entry point for all game server requests
  • game/packet: Packets sent by game server
  • login: Login server code
  • login/dto: Data transfer objects
  • login/handler: Handlers for each client request
  • login/packet: Packets sent by login server

To do

  • Correctly handle big/little endian
  • Display terms of service view
  • Display server list
  • Allow to enter game server
  • Create character
  • Enter world
  • Walk
  • Lua integration? since we got hot reload I don't know if it makes sense
  • Handle multiple connections
  • See other players

Screenshots

Please see doc/screenshot.

Credits

Licence

MIT

l2auth's People

Contributors

ruk33 avatar

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.