By continuing to use this site, you agree to the Terms of Service of this website, including usage of cookies.

OK, Don't show this again

StarGate client for PMMP
version 1.0.1
Approved
Direct Download How to install?
Switch version
89 Downloads / 143 Total
5 Reviews
Plugin Description §

StarGate-Atlantis

This is stable and fast plugin for pmmp that allows server connect to WaterDog plugin StarGate. It make easier communication between server. Includes API fur custom packets, transferring players and more Download here!

🎯Features:

  • Fast communication between servers
  • Custom packets
  • Moving players between servers (API)

More features will be added very soon

🔧API

You can access StarGate-Atlantis by StarGateAtlantis::getInstance()

Avalibe Functions

  • transferPlayer(Player player, string server) This we use to transfer Player between servers
  • RegisterPacket(StarGatePacket packet) Really simple method for registring Packet
  • putPacket(StarGatePacket packet) This allows you to send packet. Packet must be registered first
  • kickPlayer(Player player, string reason) Kick player from any server connected to StarGate network
  • isOnline(Player player) Check if player is online. Sends back response 'true!server' or 'false'. Examples here.
  • forwardPacket(string client, StarGatePacket packet) Using ForwardPacket you can forward packet to other client/server
Example:
$player = PLUGIN::getInstance()->getPlayer("alemiz003");
$server = "lobby2";

StarGateAtlantis::getInstance()->transferPlayer($player, $server);

To more examples look here!

📦Packet Handling

Received Packets are handled by CustomPacketEvent. Official Packets are handled (if needed) automaticly Accessing Packet from Event:

public function getPacket() {
  return $this->packet;
}

📞ResponseCheckTask

Response checking is useful when we want to get some data created by packet back to client. PHP allows you to use simple closures to handle result:

$closure = function ($response){
    StarGateAtlantis::getInstance()->getLogger()->info("§a".$response);
};
StarGateAtlantis::getInstance()->isOnline("alemiz0003", $closure);

For more info please consider looking here.

⚙️Creating Own Packets

For better understanding please read StarGatePacket and WelcomePacket

Convertor

Convertor is used for encoding and decoding packets. We can use it for static and nonstatic usage Functions:

  • packetStringData(string packetString) Exports packetString to data array

  • putInt(int integer) Pushes Integer to array

  • putString(string string) Pushes String to array

  • getString(int key) Returns String from array by key value

  • getPacketString() Returns packetString from array data

  • static getInt(string string) Returns Integer from String

  • static getForcePacketString(array strings) Returns packetString from given array

  • static getPacketStringData(string packetString) Returns array data from given string

Example (nonstatic):
$convertor = new Convertor($this->getID());
$convertor->putString($this->server);
$convertor->putInt($this->tps);

$this->encoded = $convertor->getPacketString();
Example (static):
$data = Convertor::getPacketStringData($packetString);
$packetId = (int) $data[0];
What's new §
  • Remove debug
  • Try to reconnect if client lost connection

AlexPads
using v1.0.1
07 Feb 20
Nice!
Alemiz112
15 Feb 20
Thanks!
skillDev5235
using v1.0.1
07 Feb 20
cool
Alemiz112
15 Feb 20
Its my pleasure!
GamakCZ
using v1.0.1
07 Feb 20
Awesome
Alemiz112
15 Feb 20
Thanks!
TheRealKizu
using v1.0.0
02 Feb 20
Good plugin!
Alemiz112
06 Feb 20
Thanks!
provsalt
using v1.0.0
22 Jan 20
Alemiz112
26 Jan 20
Thanks!

Reply to review by :

Supported API versions
3.0.0
->
3.11.4
License §
Categories:
API plugins
Developer Tools
Keywords
Permissions
External Internet sockets
Custom threading

You can leave one review per plugin release, and delete or update your review at any time

Loading...