Simple Lineage 2 C4 server written as a learning exercise. Currently working in WINDOWS & LINUX (thanks to Docker).
- Install docker & docker-compose
docker-compose up
- Server will start listening to address 127.0.0.1 (local) and port 2106.
- Follow instructions to build log dependency from Dockerfile
sudo apt install libssl-dev
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 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
.
core
: Core modules, used by both login server and game serveros
: 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 theos
folder. Make sure to updategame/Makefile
to use the new implementation instead ofos/linux
(replace$(wildcard ../os/linux/*.c)
with new implementation, ie$(wildcard ../os/windows/*.c)
).game
: Game server codegame/db
: Persistence related codegame/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 ingame/db
and updatinggame/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 objectsgame/handler
: Handlers for each client request (ie, entering world)game/handler/client
: Entry point for all game server requestsgame/packet
: Packets sent by game serverlogin
: Login server codelogin/dto
: Data transfer objectslogin/handler
: Handlers for each client requestlogin/packet
: Packets sent by login server
- 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
Please see doc/screenshot.
- l2jserver (http://l2jserver.com/)
- http://fursoffers.narod.ru/Packets.htm
- https://code.google.com/archive/p/l2adenalib/wikis/L2LoginServerProtocol.wiki
MIT