openprunus / arcade-core
Shared core for the OpenPrunus multiplayer games: WebSocket server (RFC 6455) in pure PHP, and small support classes
v1.1.0
2026-11-03 19:10 UTC
Requires
- php: >=8.5
- ext-json: *
- ext-mbstring: *
- psr/clock: ^1.0
- psr/log: ^3.0
Requires (Dev)
- phpstan/phpstan: ^2.3
- phpunit/phpunit: ^12.0
- squizlabs/php_codesniffer: ^4.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
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-blockingstream_selectWebSocket server. It knows nothing about the game: a game plugs in by implementingHub(accept / receive / disconnect / tick / population) andSession(who is idle for how long);Transportis 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.