Skip to content
altayofficialPublic

About

Central network library for Altay family written in PHP

Topics

Resources

Stars

5 stars

Watchers

0 watching

Forks

Latest commit

 

History

91 Commits

Folders and files

Repository files navigation

Network

CI

Central network library for Altay written in PHP

Usage

use altay\network\Network;
use altay\network\raknet\RakNetTransport;
use altay\network\nethernet\NetherNetTransport;
use altay\network\nethernet\ServerData;

$network = new Network($myTransportListener);
$network->registerTransport(new RakNetTransport($logger, "0.0.0.0", 19132));
$network->registerTransport(new NetherNetTransport($logger, $networkId, new ServerData("Altay", "My World")));
$network->start();

while($running){
    $network->tick();
}

$network->shutdown();

To add another network system, implement Transport and register it on the same Network instance.

Requirements

  • PHP 8.1+ with ext-sockets and ext-openssl
  • The NetherNet transport additionally needs ext-gmp. Its DTLS layer is altayofficial/dtls, which is pure PHP - there is no ext-ffi requirement and no native library is loaded at runtime

About

Central network library for Altay family written in PHP

Topics

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages