PHP code example of dayvsonspacca / aqw-socket-client
1. Go to this page and download the library: Download dayvsonspacca/aqw-socket-client library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
dayvsonspacca / aqw-socket-client example snippets
final class MyScript extends AbstractScript
{
#[Override]
public function start(ClientContext $context): ?CommandInterface
{
return new SomeCommand(); // sent immediately before the loop
}
#[Override]
public function handles(): array
{
return [SomeEvent::class, ErrorEvent::class];
}
#[Override]
public function handle(EventInterface $event, ClientContext $context): ?CommandInterface
{
if ($event instanceof ErrorEvent) {
$this->failed();
return null;
}
$context->set('result', $event->data);
$this->success();
return null;
}
}
$script = new SequenceScript([
new ConnectAndLoginScript($name, $token),
Pipeline::send(new JoinAreaCommand($area))->waitFor(AreaJoinedEvent::class),
]);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.