Gets the Peer of the Session that corresponds to the local client/machine.
Get the current session multiplayerInviteCode
The list of all the Peers that are parts of the mutiplayer Session.
Gets the Peer of the Session that acts as the server. Each Session has a single Peer marked as server. When the Peer leaves the Session another one is automatically designated. The server is responsible for the networked Entities that come with the loaded Game (i.e. the Entities which isNetworked property is true and isSpawned false). Internally, the server is also in charge of providing new Peers joining the Session with the current state of the Game.
Gets the time in seconds since the Game started on the server Peer. This time is sent by the server to the other Peers every 10 seconds and is updated at each frame by the local Peer to make it continuous (it basically applies its own delta time onto the received time). There's no complex synchronization system in place, so the server time on the (non-server) local Peer, might be affected by network jitter and jump back or forth a little bit when the message is received. It is therefore non monotonic. If the server Peer leaves the Session and another one takes over, it picks up the server time when the previous one left it. Note that currently, unlike the game.frameTime property, the serverTime resets to 0 when the Game is restarted in edit mode.
Returns all the users, including the local one, participating in this game's multiplayer session.
Note that a user can be present on different peers (if they open multiple tabs or devices
on this multiplayer game session) and a peer has one and only one user associated with it.
To get the list of users that are friends of the local user, use this.localPeer.user.friends
(which is a shortcut for this.game.session.localPeer.user.friends
).
Gets the Peer in the Session with the given id, or null if there's no Peer with such id.
The id of the Peer to look for.
Send a message to all connected Peers which, in response, deliver it to all the User/ScriptComponents of the given networked Entity via the onMessage() method if implemented. If the Entity isn't networked, the method does nothing as the Entity doesn't exist on the remote Peers. The message isn't received locally by the Peer that sends it. Any Peer can send a message to any networked Entity (and not just its owner).
The networked Entity which, on the remote Peers, will get the message in its UserScriptComponents.
A user-defined string identifying the message (for eg: "onPickupTaken")
A JSON-stringifiable (i.e. with just plain old type properties) user-defined object containing the payload of the message.
Indicates whether the local Peer taking part in the Session is either a Player, Interactor or a Spectator.