Search by

openprunus / arcade-core

OpenPrunus

Shared core for the OpenPrunus multiplayer games: WebSocket server (RFC 6455) in pure PHP, and small support classes

Package info

github.com/OpenPrunus/arcade-core

pkg:composer/openprunus/arcade-core

Statistics

Installs: 154

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.1.0 2026-11-03 19:10 UTC

This package is auto-updated.

Last update: 2026-11-03 19:18:31 UTC


README

Shared PHP 8.5 core of the OpenPrunus multiplayer games (Chicken Challenge, Gloop Volley).

  • Arcade\WebSocket — RFC 6455 handshake and frame codec in pure PHP.
  • Arcade\Server — non-blocking stream_select WebSocket server. It knows nothing about the game: a game plugs in by implementing Hub (accept / receive / disconnect / tick / population) and Session (who is idle for how long); Transport is the send channel handed to the game. The tick interval and the client cap are parameters.
  • Arcade\Support — Env, Nickname, AtomicFile, SystemClock, StdoutLogger (PSR-3 / PSR-20).
$server = SocketServer::listen(8081, $hub, new Handshake($allowedOrigins), interval: 1 / 60, maxClients: 300);
$server->run();

Development

composer install
composer check   # phpcs (PSR-12), phpstan level 8, phpunit

MIT licensed.