reskate.session, which needs session.read), other players’ skaters (session.skaters), tags beside their nametags (session.nametags), their voice volume (voice.control), and messages between the copies of your plugin on every player’s game (reskate.net.send and the message event, which need net.session). See permissions.
Players
A player is a table:
Functions that take a player take either the table or its
id string.
The session is read four times a second, so a player who just joined may take up to a quarter of a second to appear. The player_joined and player_left events (they need session.read) say who came and went; see events.
reskate.session.active()
boolean
true while the player is in a multiplayer session.reskate.session.is_dedicated()
boolean
true when the session is on a dedicated server, false in a player’s lobby or outside a session.reskate.session.players()
Everyone in the session, the local player first.
table
A list of players; empty outside a session.
reskate.session.me()
table or nil
The local player, or
nil outside a session.reskate.session.host()
table or nil
The player who hosts the lobby, or
nil outside a session and on a dedicated server.active, is_dedicated, players, me and host need session.read.active and is_dedicated are true, players lists the players on the server, and me and host are nil: the server is none of them.
Other players’ skaters
reskate.session.skaters()
Where the other players’ skaters are, as the session last heard. The local skater is not in it: use reskate.skater.get.
table
A list of tables:
id(string): the player’s id.position(vector): the skater’s position, in world metres.heading(number): the way it faces, in radians, as the local skater’s heading.age_ms(number): how old that pose is, in milliseconds.
Needs
session.skaters.reskate.session.tag(player, text, colour)
Puts a short tag beside a player’s nametag, or takes yours away. Only this player sees it: it changes nothing on anyone else’s game.
table or string
required
A player, or their id.
string
At most 16 characters of printable ASCII.
nil or "" takes your tag away.number
default:"white"
A number
0xRRGGBBAA.Needs
session.nametags. Raises an error for a player that is not one, text over 16 characters or not printable, and a colour that is not a whole number from 0 to 0xFFFFFFFF. When several plugins tag the same player, one tag shows. Your tags go away when your plugin stops.Voice
reskate.voice.set_volume(player, volume)
Sets how loud a player’s voice chat is for the local player. It changes only what this player hears.
table or string
required
A player, or their id.
number
required
0 mutes them, 1 is as heard, up to 10.
boolean
true when it was set.string
Why not, when
ok is false: “more than 10 changes in a second”, or the session’s own answer when it refused.Needs
voice.control. At most 10 changes a second; past them it returns false and why. Raises an error for a player that is not one, and a volume outside 0 to 10.Messages
Your plugin talks to the copies of itself on the other players’ games, and to its server copy, withreskate.net.send. Messages go only to the same plugin: two copies are the same plugin when their manifest.json gives the same name (case does not matter), whatever their folders are called. A plugin with no name in its manifest.json uses its folder’s name.
The session says who sent a message: a plugin cannot pretend to be another player, or the server.
reskate.net.send(to, message)
Sends a message.
string or table
required
Who gets it:
"all": every other player’s copy (and the server copy).- a player, or a player’s id: that player’s copy only.
"server": the plugin’s server copy only: on the lobby’s host, or on the dedicated server. A server copy cannot send to"server": it is the server.
string or buffer
required
At most 4082 bytes. Text, or binary in a string or a
buffer.boolean
true when it was sent; false outside a session, or when too many messages wait to go out.Needs
net.session. A message is at most 4082 bytes, and a plugin sends at most 16 KB a second (each message counts 14 bytes more for its header). Raises an error past those, for to that is not "all", "server", a player or a player’s id, for "server" from a server copy, and for a message that is not a string or a buffer.The message event
net.session.
fromis the player who sent it. A message from the server copy hasfrom.server == true; itsnameis the host’s, or"Server"on a dedicated server.messageis always a string, even when it was sent as a buffer: usebuffer.fromstringto read it as one.