This module allows servers under the control of a proxy server to exchange information via sockets.
For the module to work, you need to install Skcrew on a proxy server (
Velocity or
Bungeecord ). In the configuration file on the proxy server, specify the port for opening the server socket, on the game server specify the address of the proxy server and the port of the open server socket.
Returns the server by the name under which it is written in the proxy server configuration. If this server is not listed in the proxy server configuration, <none> will be returned
server%string%
Get the name of the server
server[]nameof%server%
%server%'sserver[]name
Get a list of servers
The expression below returns a list of all servers described in the proxy server configuration.
[all]servers
Get only those servers that are enabled. In order for the server to be defined as enabled, it must be connected to a socket server.
[all]onlineservers
Get players from the server
Returns a list of players in the form of online players.
players(from|of|on)%servers%
%servers%'splayers
Get a player on a proxy server
Accepts the player’s nickname or UUID, returns the online player, or <none> if the player is not online
network[]player%string%
The server player is automatically converted to OfflinePlayer if used in any expressions if necessary.
Get the player’s server
serverof%networkplayer%
%networkplayer%'sserver
CONDITIONS
Check that the server is online
%servers%is(online|connected)
%servers%is(n't|not)(online|connected)
Check that the player is online
Allows you to change the player’s server if it is located on a server that is connected to a proxy server
Allows you to specify the reason. The reason may be plain text, or an AdventureAPI component (
Velocity ) or ChatComponentAPI (
Bungeecord ) in JSON format.
The event has built-in data, using the event-server you can get the player’s server, and using the event-player you can get the player in the form of an OfflinePlayer
The player disconnected from the game server
It is called after the player disconnects from the game server that is connected to the proxy.
The event has built-in data, using the event-server you can get the server of the player from which he left, and using the event-player you can get the player in the form of an OfflinePlayer
SIGNALS
Signals allow you to transfer the information you need between servers.
Create a signal
The signal has the form key : values, which allows you to transfer any data that can be serialized.
set{_signal}tosignalnamed"broadcast"withdata"Hello world!","My name is Bjork."
Get the signal key.
(key|signalname)of%signal%
%signal%'s(signalname|key)
Get signal data
Returns a list of objects
dataof%signal%
%signal%'sdata
Send a signal
Allows you to send a signal to any connected server
sendsignal%signals%to%servers%
set{_signal}tosignalnamed"broadcast"withdata"Hello world!","My name is Bjork."sendsignal{_signal}toallservers
Signal receiving event
It also allows you to track signals by key.
signal[(withkey|keyed)%string%]
The event has built-in data, using the event-signal you can receive the incoming signal.
onload:set{_signal}tosignalnamed"broadcast"withdata"Hello world!","My name is Bjork."sendsignal{_signal}toallserversonsignalwithkey"broadcast":senddataofevent-signaltoallplayers,console
WEB API
API allows you to get information from servers, as well as send signals from outside. Make sure that the web server is enabled in the Skcrew settings of your proxy server.
Here you can also configure the web server port and authorization data to access the API. Authorization is performed by passing the username and password to base64 in the request header:
Allows you to kick a player from a proxy server, by his nickname or UUID. When using a POST request, you can specify the reason for the kick. The reason can be specified either in plain text or by the AdventureAPI component (
Velocity ) or ChatComponentAPI (
Bungeecord ) in JSON format.
curl localhost:1338/players/Lotzy/kick -X POST -H "Authorization: Basic YWRtaW46YWRtaW4=" -H "Content-Type: application/json" -d '"GO OUT FROM SERVER"'
{"data":"Player Lotzy kicked"}
GET/players/{UUID/NICKNAME}/connect/{SERVER}
Allows you to move a player to another server, by his nickname or UUID.