Skip to content

About

Native outgoing packet queue for Altay

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

ext-netqueue

Native outgoing packet queue for Altay.

Every session buffers its game packets until the next flush, and every moving entity sends the same packet to everyone who can see it. Doing that in PHP costs a few method calls and array writes per (packet, viewer) pair, which adds up fast with lots of players. This extension keeps the buffer as one native string, writes the varint length prefix on the way in, and fans the same packets out to many queues in a single call.

use altay\netqueue\PacketQueue;

$queue = new PacketQueue();
$queue->add($encodedPacket);
PacketQueue::addToAll([$queueA, $queueB], [$encodedPacket]);

$batch = $queue->take(); //same bytes as PacketBatch::encodeRaw(), ready to compress

See the stub for the full API.

Building

phpize
./configure --enable-netqueue
make
make test

Requires PHP 8.3 or newer and a C++20 compiler.

About

Native outgoing packet queue for Altay

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages