exilestudios / eolib-php
A PHP library for protocol code generation and other functionalities.
Requires
- php: >=8.0
Requires (Dev)
- phpunit/phpunit: 10
This package is auto-updated.
Last update: 2025-05-04 06:22:25 UTC
README
A core PHP library for writing applications related to Endless Online.
Installation
$ composer require exilestudios/eolib-php-dist
Features
Read and write the following EO data structures:
- Client packets
- Server packets
- Endless Map Files (EMF)
- Endless Item Files (EIF)
- Endless NPC Files (ENF)
- Endless Spell Files (ESF)
- Endless Class Files (ECF)
Utilities:
- Data reader
- Data writer
- Number encoding
- String encoding
- Data encryption
- Packet sequencer
Example Usage
Here's an example of how to use the PacketFamily class from the library:
<?php require_once 'vendor/exilestudios/eolib-php-dist/vendor/autoload.php'; use Eolib\Protocol\Net\PacketFamily; // Access packet family constants echo PacketFamily::CONNECTION; // Output: 1 echo PacketFamily::ACCOUNT; // Output: 2 echo PacketFamily::CHARACTER; // Output: 3 // ... // Use packet family constants in your code $packetFamily = PacketFamily::LOGIN; if ($packetFamily === PacketFamily::LOGIN) { // Handle login packet // ... }
Documentation
The library documentation is available online at: https://exilestudios.github.io/eolib-php You can browse the documentation to learn about the available classes, methods, and their usage.
Development
Requirements
- PHP 7.4 or higher
- Composer
Setup
- Clone the repository:
$ git clone https://github.com/ExileStudios/eolib-php.git $ cd eolib-php
- Install dependencies:
$ composer install $ composer dump-autoload
- Fetch the latest protocol files:
$ composer fetch-protocol
- Generate the protocol code:
$ composer generate-protocol
- Generate the documentation:
$ composer generate-docs
Usage
To fetch the latest protocol files, generate the protocol code, and generate the documentation:
$ composer build
The generated protocol code will be available in the Eolib/Protocol directory. Under the namespace Eolib\Protocol
.
The generated documentation will be available in the docs directory.
License
This library is open-source software licensed under the MIT license.