This is stable and fast plugin for nukkit that allows server connect to WaterDog plugin StarGate. It make easyer communication between server. Includes API fur custom packets, transfering players and more
Download here!
- Fast communication between servers
- Custom packets
- Moving players between servers (API)
More features will be added very soon
You can access StarGate-Universe by StarGateUniverse.getInstance()
RegisterPacket(StarGatePacket packet)
Really simple method for registring PacketputPacket(StarGatePacket packet, String clientName)
This allows you to send packet. Packet must be registered firsttransferPlayer(Player player, String server, String client)
This we use to transfer Player between serverskickPlayer(Player player, String reason, String client)
Kick player from any server connected to StarGate networkisOnline(Player player, String client)
Check if player is online. Sends back response 'true!server' or 'false'. Examples here.forwardPacket(String destClient, String localClient, StarGatePacket packet)
Using ForwardPacket you can forward packet to other client/serveraddServer(String address, String port, String name, String client)
Add server to list and allows players to transferremoveServer(String name, String client)
Remove server from server list
Client variable in API is used to specify destination proxy (if more instances are used). It is not important to define it, if one one proxy is used.
Player player = PLUGIN.getServer().getPlayer("alemiz003");
String server = "lobby2";
StarGateUniverse.getInstance().transferPlayer(player, server);
To more examples look here!
Received Packets are handled by CustomPacketEvent
. Official Packets are handled (if needed) automaticly
Accessing Packet from Event:
public StarGatePacket getPacket() {
return packet;
}
Response checking is useful when we want to get some data created by packet back to client.
For more info please consider looking here.
For better understanding please read StarGatePacket and WelcomePacket
If you have servers inside Docker container this is for you. StarGate allows you to create/remove/start/stop any container. Using ServerManagePacket
you can set container exposed ports and env. variables too.
Working example can be found here.
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 getPacketString(String[] strings)
Returns packetString from given array -
static getPacketStringData(String packetString)
Returns array data from given string
Convertor convertor = new Convertor(getID());
convertor.putString(server);
convertor.putInt(tps);
convertor.putInt(players);
this.encoded = convertor.getPacketString();
String[] data = Convertor.getPacketStringData(packetString);
int PacketId = Convertor.getInt(data[0]);