-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration
skNetwork has two config files, both called config.yml and both in
plugins/skNetwork/. One is created on the proxy, one on each game server.
server-name: ""
proxy:
host: 127.0.0.1
port: 25580
token: "change-me"
prefix: "?"
force-skript-config: true
atomic-timeout: 5s
display-values: trueThe name this server goes by on the network. Scripts read it with
network server name.
Give every server its own name. Leave it blank and the name becomes server- plus the
port, like server-25567, which works but is hard to read in the console.
Two servers sharing a name causes real trouble. See Limitations.
Where to find the proxy half. host and port must match bind and port in the
proxy's config, and token must match the proxy's token exactly.
Which variables are shared. With ?, {?coins} goes to the network and {coins}
doesn't.
This has to agree with the pattern line in plugins/Skript/config.sk. skNetwork
writes that line for you unless you turn force-skript-config off.
You can't use #, it starts a comment in Skript's config file.
The prefix is stripped before a name travels, so two servers using different prefixes still share the same data.
Whether skNetwork writes its database block into plugins/Skript/config.sk at startup,
above the catch-all default block.
Leave it on unless you want to manage that block by hand. It never touches an existing skNetwork block, so your edits stay.
How long atomically ... and wait waits for the proxy before giving up.
After that the script continues and the atomic change timed out is true. The change
may still have been applied, so treat it as unknown rather than failed. See
Atomic changes.
Takes 500ms, 5s, 2m, and so on.
Whether writes carry a readable copy of the value so /sknetproxy dump can print it.
The proxy stores raw bytes and has no Skript, so without this it only knows how many bytes a variable is:
coins::123 = <8 bytes, no display>
With it on you get the real thing:
coins::123 = 100 (long, seq 1041)
It costs a little work per write. Turn it off on a server that writes constantly and whose values nobody looks up. Values above 64 kB are sent without one either way.
bind: 127.0.0.1
port: 25580
token: "change-me"
log: network.csv
flush-interval: 100ms
compact-when: 2.0
replay-buffer: 10000
scripts:
enabled: false
groups:
hubs:
- lobby
- lobby2
max-file-kb: 512
max-total-mb: 16
players: true
remote-commands: false
use player UUIDs in variable names: true
debug: falseWhich address skNetwork listens on. 127.0.0.1 allows connections from the same machine
only, which is the safe default.
The port can't be 25565, your Minecraft listener already uses that.
If your servers are on different machines you have to change bind, and you should read
Limitations first. There's no encryption on this connection.
The password game servers use. Change it. skNetwork warns you at startup if you leave it
as change-me while listening on more than loopback:
bound to 0.0.0.0 with the default token. Anyone who can reach port 25580
can read and write every network variable you have.
The file every change is written to, inside plugins/skNetwork/. The proxy reads it back
at startup, so your data survives a restart.
Set it to none to keep nothing. Every restart then starts empty and all network
variables are lost. Testing only.
The format is the same shape as Skript's own variables.csv, with a sequence number in
front. The file opens with a notice telling you not to edit it by hand:
# === skNetwork's network variable storage ===
# Please do not modify this file manually!
...
# skNetwork v2 seq=1044
1041, coins::a1b2c3, long, 0000000000000064, 100
1043, gone, , ,
The last line is a delete.
That is not decoration. The proxy holds the file open and rewrites it whole when it
compacts, so an edit made while the proxy is running is overwritten without ever being
read. Stop the proxy first. The seq= number is where sequence numbers resume after a
restart; lower it and the proxy reissues numbers the log has already used.
How often the log is written to disk. A hard crash loses at most this much.
The log only grows as you write, so old lines pile up. The proxy rewrites it as one line per live variable once it holds more than this multiple of the live count.
At 2.0, a log with 5000 live variables is compacted once it passes 10000 lines. It
keeps one backup as network.csv.bak.
Raise it to compact less often, lower it to keep the file smaller.
How many recent changes to keep in memory for servers that reconnect.
A server that was away briefly gets only what it missed, which is fast. One away longer than this gets the whole map, which is slower but always correct.
Covered in full on Script sharing.
Whether the proxy keeps track of who is on which server, carries messages to them, and moves them between servers. Everything on Network players depends on it.
Off means the proxy answers nothing about players. all network servers is empty on
every server, send network message reaches nobody, and connect network player does
nothing. Scripts still load.
Whether one server may run a console command on another with
execute command ... on network server ....
Off by default. Anyone who can write a script on one server would otherwise have console on every server. The proxy refuses and logs each attempt while it is off, and logs each command with the server that sent it while it is on. It warns you at startup when it is on.
The same option Skript has, and it has to mean the same thing on every game server.
Skript decides whether {?coins::%player%} is stored under the player's UUID or their
name. That name reaches the proxy already flattened to text, so the proxy cannot tell
the two apart afterwards. A server set the other way keeps its own separate copy of
every player-keyed variable, and neither side ever sees the other's writes.
Nothing is refused over this. Each server reports its setting when it connects, and a server that disagrees with the proxy is named in the log:
survival has 'use player UUIDs in variable names' set to false in its Skript config,
but this proxy expects true.
Set Skript's option the same way on every game server, or change this to match what they already use. Skript does not rename variables that already exist under the other spelling, so flipping it on a live network strands the old ones.
Prints every change the proxy applies, with the sequence number and which server sent it:
seq 577525 ADD atest::646069::d from lobby2
refused ADD atest::646069::word from lobby2: {atest::646069::word} holds a string
Useful while testing, far too noisy for a live network.
skNetwork sends anonymous usage numbers to bStats: how many servers, how many
variables, which prefix, whether scripts are shared. Opt out for the whole server in
plugins/bStats/config.yml, on the proxy and on each game server separately.
Each half has its own name so a command always reaches the place you meant. See Setup for why.
/sknet state, proxy, copy size, latency
/sknet resync throw the copy away and pull everything again
/sknet reconnect drop the connection and continue where it stopped
skNetwork │ 0.2.0 · protocol 8
│
│ State READY
│ Server lobby
│ Proxy 127.0.0.1:25580 50ms
│ Storage ? routing [?].*
│ Mirror 56,182 variables seq 577,670
│ Applied 56,182 inbound · 1 dropped
│
│ /sknet resync throw the copy away and pull everything
│ /sknet reconnect drop the connection and resume
│
State is coloured. Green is READY, yellow is still connecting, red means the proxy is
gone. A red Storage line reading NOT CONFIGURED means Skript isn't routing anything
to skNetwork on this server.
Extra rows appear only when they matter. Refused counts outbound writes the proxy
wouldn't take, Waiting counts atomic changes still without an answer, and
Last error shows why the last connection ended.
resync and reconnect differ by one thing. reconnect asks the proxy for what was
missed. resync throws the local copy away and pulls everything, which is slower but
repairs a copy you think has gone wrong.
Aliases: /sknetlocal and /sknl.
/sknetproxy state, connected servers, variable count
/sknetproxy push send scripts now
/sknetproxy dump <pattern> look up variables by name, * is a wildcard
skNetwork │ 0.2.0 · protocol 8
│
│ Backends 3 servers
│ Variables 56,183 seq 577,670
│ Scripts 14 file(s) at manifest 104
│
│ /sknetproxy push send scripts now
│ /sknetproxy dump <name> look up a variable, '*' is a wildcard
│
Backends turns yellow when nothing is connected.
dump uses the name without the prefix and sorts the results:
/sknetproxy dump wt::shared::*
│ Matched 2 for wt::shared::*
│
│ wt::shared::note = hello-from-lobby string, seq 577,555
│ wt::shared::writes = 1 long, seq 577,554
│
It shows the first 40 matches and tells you how many more there were. A value written by
a server with display-values off shows as <8 bytes, no display>.
Aliases: /sknetp and /sknp.
Both need sknetwork.admin. On a game server an operator has it already. On the proxy it
has to be granted there, because a proxy doesn't know who is op on a game server. See
Setup.
- Setup for first time installation.
-
Script sharing for the
scriptssection in full. -
Network players for what
playersandremote-commandsturn on.
Guides
Reference