Download the PHP package nadybot/aolib without Composer
On this page you can find all versions of the php package nadybot/aolib. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download nadybot/aolib
More information about nadybot/aolib
Files in nadybot/aolib
Package aolib
Short Description An amphp3-based client library for the Anarchy Online chat server
License AGPL-3.0-or-later
Informations about the package aolib
Generic AMP3-based client and libraries for Anarchy Online Chat-bots in PHP
This is a very basic library that provides AMP3-based async classes to deal with connections to the chat-server of Anarchy Online. It consists of
- a tokenizer to extract single packets out of an endless stream (files, sockets, …)
- a connection-handler that utilizes the tokenizer to parse these string-packets into binary packets
- a parser that parses these binary packets into AO-packets
- an MMDB database class to access builtin-strings
- a basic client that combines all this, and keeps track of known uid <=> name mappings, as well as make the ever important lookup of these available as if these calls were sync
You have to be familiar with the AMP way of dealing with things, otherwise, this is useless to you.
Basic usage
This just scratches the surface of what the library can do. I don't expect anyone else to use this code, so please step forward if I'm mistaken.
Check the code for usage of the client. Whether you extend it, or wrap it, is up to you, but extending is the more elegant solution.
Lookups
Looking up names or UIDs is done like this
All the logic happens behind the scenes. You either receive an int/string, or null.
Sending packets
This is the most basic interface:
Multi character usage
Running tests
Make sure you installed the developer packages as well and run vendor/bin/phpunit -c phpunit.xml
Developing
The code has been written under VSCode using the following extensions:
- PHP Intelephense (bmewburn.vscode-intelephense-client)
- phpcs (shevaua.phpcs)
- phpstan (sanderronde.phpstan-vscode)
- PHPUnit Watcher (herisit.phpunit-watcher)
- Simple PHP CS Fixer 3 (phlak.simple-php-cs-fixer-3)
The shipped .vscode/settings.json
-file should automatically configure them to work with this project.
All versions of aolib with dependencies
amphp/byte-stream Version ^2.1.0
thecodingmachine/safe Version ^2.0
psr/log Version ^1|^2|^3
amphp/file Version ^3.0
nadylib/leaky-bucket Version ^0.1.0
amphp/pipeline Version ^1.1