Tile - YGameSession - Reserve Session – Ylands

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "{{Ylands editor navbox}}" to "{{Navbox/Ylands}}")
m (Text replacement - "{{DEFAULTSORT:{{#sub:{{PAGENAME}}|14}}}}" to "{{DEFAULTSORT:{{#sub:{{PAGENAME}}|7}}}}")
 
(4 intermediate revisions by 2 users not shown)
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''']]
 
=== Availability ===
 
[[Ylands:Tile Availability - Server|Server]], [[Ylands:Tile Availability - Not in Edu|Not in Edu]]
 
=== Description ===
 
Reserves a multiplayer '''session''' for the selected players.




----
----
{{Navbox/Ylands}}
{{Navbox/Ylands}}
{{DEFAULTSORT:{{#sub:{{PAGENAME}}|14}}}}
{{DEFAULTSORT:{{#sub:{{PAGENAME}}|7}}}}


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

Latest revision as of 14:26, 24 November 2023

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

Availability

Server, Not in Edu

Description

Reserves a multiplayer session for the selected players.