-
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: true
debug: falseThe 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.
Prints every change the server sends and receives. Useful while setting up, far too noisy to leave on.
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
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:
# skNetwork v2 seq=1044
1041, coins::a1b2c3, long, 0000000000000064, 100
1043, gone, , ,
The last line is a delete.
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.
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.
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.0.1 · protocol 6
│
│ 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.
Two extra rows appear only when they matter. Refused counts outbound writes the proxy
wouldn't take, and Waiting counts atomic changes still without an answer.
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.0.1 · protocol 6
│
│ 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.
Guides
Reference