Download the PHP package dayvsonspacca/aqw-socket-client without Composer

On this page you can find all versions of the php package dayvsonspacca/aqw-socket-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package aqw-socket-client

AQW Socket Client

Latest Stable Version Total Downloads License

PHP client for connecting and interacting with Adventure Quest Worlds (AQW) servers.

Allows login, sending commands, and processing server events in a modular, script-driven way.

Note: This client is not intended to serve as a bot. Its purpose is solely to explore the exchange of information with the AQW server and to retrieve data such as item names and player information.

Note: This project would not have been possible without the following repositories — thank you! anthony-hyo/swf2png · dwiki08/loving · Froztt13/aqw-python · BrenoHenrike/RBot · 133spider/AQLite


How it works

The library is built around a simple, linear pipeline. Raw bytes come in from the socket, get parsed into typed messages, get interpreted as high-level events, and finally get handled by a Script — which decides what command to send back.

You write a Script that declares which events it cares about and reacts to them by returning a command. The client calls start() once before the loop begins, then receives messages, resolves events, and dispatches them until the script signals it's done.

Each script call returns at most one command, which is enqueued and sent on the next tick. A shared ClientContext flows through every call, letting scripts pass data between steps.

After run() completes, you can read the accumulated state via context():


Pre-built Components

📜 Scripts

Scripts are the core unit of logic. The library ships with both atomic scripts (single-responsibility steps) and composition primitives for building sequences and pipelines.

Composition primitives

Script Description
SequenceScript Runs a list of scripts in order. Advances to the next when the current one succeeds. Fails immediately if any child fails, disconnects, or expires.
Pipeline Fluent DSL for simple linear flows: Pipeline::send($cmd)->waitFor(SomeEvent::class)->orFailOn(OtherEvent::class). Interchangeable with class-based scripts inside SequenceScript.

Login sequence

Script Description
LoginScript Orchestrates the full login flow as a SequenceScript of three atomic steps (see below).
ConnectAndLoginScript Sends LoginCommand on connection. On a successful LoginRespondedEvent, stores socket_id in context.
JoinBattleonScript Sends JoinInitialAreaCommand on start. Succeeds when AreaJoinedEvent for battleon is received, storing area_id in context.
LoadInventoryScript Sends LoadPlayerInventoryCommand on start (reading socket_id and area_id from context). Succeeds when PlayerInventoryLoadedEvent arrives.

Base classes

Class When to use
AbstractScript Base for all atomic scripts. Provides success(), failed(), disconnected(), isDone(), and a default no-op start().
ExpirableScript Extends AbstractScript with a configurable timeout.

⚡ Events

Events are strongly-typed objects produced from raw server messages. They represent things that happened on the server side.

Event Trigger
ConnectionEstablishedEvent Server sent the cross-domain policy — connection is ready.
LoginRespondedEvent Server replied to a login attempt.
AreaJoinedEvent Player successfully joined a map.
PlayerDetectedEvent A player entered or changed state in the current area.
PlayerInventoryLoadedEvent Server finished sending the player's inventory.
PlayerLoggedOutEvent Server confirmed the player's session was terminated.
AlreadyInAreaEvent Player is already in the target area.
AreaLockedEvent Target area is locked and cannot be joined.
AreaMemberOnlyEvent Target area is restricted to members only.
AwayFromKeyboardEvent Player status changed to AFK.
AreaNotAvailableEvent Target area is currently unavailable.

📦 Commands

Commands are actions sent from the client to the server. Each one knows how to serialize itself into the correct protocol format via pack().

Command Description
LoginCommand Authenticates a player using their username and token. First command sent after connection.
LogoutCommand Gracefully terminates the player's session on the server.
JoinInitialAreaCommand Moves the player to the initial area (battleon) right after login.
JoinAreaCommand Transfers the player to a specific map and room instance.
LoadPlayerInventoryCommand Requests the player's full inventory from the server.

Extending

All core pieces are interface-driven, making the library easy to extend.

Writing a custom script

Extend AbstractScript. Declare which events you handle in handles(), react in handle(), and optionally send an initial command from start(). Call success() or failed() when done.

Using Pipeline for simple flows

For common "send a command, wait for a response" patterns:

Pipeline is fully compatible with SequenceScript:

Adding a new event

Implement EventInterface::from(MessageInterface): ?EventInterface. Return null if the message doesn't match.

Adding a new command

Implement CommandInterface::pack(): Packet. Use Packet::packetify() with the %xt%zm%cmd%...% format.

Custom socket

Implement SocketInterface — useful for testing or alternative transports.


All versions of aqw-socket-client with dependencies

PHP Build Version
Package Version
Requires azjezz/psl Version ^5.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package dayvsonspacca/aqw-socket-client contains the following files

Loading the files please wait ...