Tile - YGameSession - Reserve Session – Ylands

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
[[Image:{{PAGENAME}}.png]]
<!---
*Instructions allowing to transfer players between [[Ylands Game set|'''Game set''']] games.
THIS PAGE WAS GENERATED AUTOMATICALLY; DO NOT EDIT IT, OTHERWISE YOUR CHANGES WILL BE LOST DURING FUTURE UPDATE.
-->
== Reserve Session(Guid, Players, On session reserved, On reservation failed) ==


=== Reserve session ===
[[File:YlandsTile-740.png]]
*If a '''free game instance''' is available, this instruction will try to reserve a '''game session''' for selected players.
**Game instance = game running on official dedicated server.
**Target game instance is chosen automatically.
**If there wont be any instance available, new instance will be spawned automatically.
*In order to reserve session, following input parameters has to be entered
**'''Guid''' - [[Ylands Change Game ID|'''Game ID''']] obtained via [[Ylands Game set|'''Game set manager''']]
**'''Players''' - list of players ([[Ylands Tile category - Array|'''Array''']]) to be transferred.
*If the reservation will be successful, the instruction will return a '''Session object'''.
**Session object - contains target server and list of players to be dispatched.
*If the reservation will fail, the instruction will return a '''Fail reason'''.


=== Dispatch session ===
<pre>static reserveSession(guid: string, players: YCharacter[], onReserved: (sessionObject: YSessionObject) =&gt; void, onReservationFailed: (failReason: YReservationError) =&gt; void): void;</pre>
*This instruction will '''dispatch''' selected players using the '''Session object'''.
=== Parameters ===


=== Fail reason ===
==== guid ====
*Reason why the reservation has failed.
*Can be compared with [[Ylands Tile - Reservation fail type|'''coresponding enumerator''']].


=== Example ===
==== players ====
<gallery>
Image: Ylands-Game-set-session-2.png|Example
</gallery>


== See also ==
==== onReserved ====
*[[Ylands Tile - Matchmaking|'''Start Matchmaking''']]
 
*[[Ylands Matchmaking|'''Matchmaking''']]
==== onReservationFailed ====
*[[Ylands Game set|'''Game set''']]
 
=== Description ===
 
Reserves a multiplayer '''session''' for the selected players.




Line 37: Line 27:


[[Category: Instructions]]
[[Category: Instructions]]
[[Category: Ylands 0.15]]

Revision as of 08:52, 8 July 2021

Reserve Session(Guid, Players, On session reserved, On reservation failed)

YlandsTile-740.png

static reserveSession(guid: string, players: YCharacter[], onReserved: (sessionObject: YSessionObject) => void, onReservationFailed: (failReason: YReservationError) => void): void;

Parameters

guid

players

onReserved

onReservationFailed

Description

Reserves a multiplayer session for the selected players.