Tile - YGameSession - Reserve Session – Ylands

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
No edit summary
(8 intermediate revisions by 3 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 running, 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
==== onReserved ====
</gallery>
 
==== onReservationFailed ====
 
=== Availability ===
 
[[Ylands:Tile Availability - Server|Server]], [[Ylands:Tile Availability - Not in Edu|Not in Edu]]
 
=== Description ===
 
Reserves a multiplayer '''session''' for the selected players.




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


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

Revision as of 12:15, 12 November 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

Availability

Server, Not in Edu

Description

Reserves a multiplayer session for the selected players.