Tile - YGameSession - Reserve Session – Ylands

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
No edit summary
(11 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]]
*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 player ([[Ylands Tile category - Array|Array]]) to be transfered.
*This instruction will try to reserve a game session, if free game instance is available.
**Game instance = game running on official dedicated server.
**Target instances are chosen automatically.
**If there wont be any instances running, new instances will be spawned automatically.
*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''']].
==== players ====
 
==== onReserved ====
 
==== 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.


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


----
----
{{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.