Tile - YGameSession - Get Reserved Game Id – Ylands

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
[[Image:{{PAGENAME}}.png]]
[[Image:{{PAGENAME}}.png]]
*Instructions allowing to transfer players between [[Ylands Game set|'''Game set''']] games.
*Instruction allowing to transfer a player to a game within same [[Ylands Game set|'''Game set''']].
**Player will be added to [[Ylands Matchmaking|'''Matchmaker''']] queue. If there will '''enough players''' queuing for the same game, they will be then '''transferred''' to '''newly spawned server''' of that game.
**The [[Ylands Matchmaking|'''Matchmaker''']] will '''always''' spawn '''new server instance''' if enough players are available. The [[Ylands Matchmaking|'''Matchmaker''']] '''will not transfer''' player to already '''running instances'''.
 
===Start Matchmaking===
*Player will be added to [[Ylands Matchmaking|'''Matchmaker''']] queue for listed games.
**'''Guids''' - list ([[Ylands Tile category - Array|'''Array''']]) of [[Ylands Change Game ID|'''Game ID''']] obtained via [[Ylands Game set|'''Game set manager''']] which the player will be matched to.
**'''Player''' - player to be added to [[Ylands Matchmaking|'''Matchmaker''']] queue.
**'''Priority''' - [[Ylands Matchmaking|'''Matchmaker''']] request priority.
***Player requests with higher priority are prioritized over the other.
***If there are players matchmaking for same game(s), but with lower priority, they will be added to the players with higher priority.


===Reserve session===
*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'''.
*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.
**Session object - contains target server and player to be dispatched.
*If the reservation will fail, the instruction will return a '''Fail reason'''.
*If the reservation will fail, the instruction will return a '''Fail reason'''.
===Cancel matchmaking===
*This instruction will '''cancel''' current [[Ylands Matchmaking|'''Matchmaker''']] request.


===Dispatch session===
===Dispatch session===
*This instruction will '''dispatch''' selected players using the '''Session object'''.
*This instruction will '''dispatch''' selected player using the '''Session object'''.


===Fail reason===
===Fail reason===
*Reason why the reservation has failed.
*Reason why the reservation has failed.
*Can be compared with [[Ylands Tile - Reservation fail type|'''coresponding enumerator''']].
*Can be compared with [[Ylands Tile - Matchmaking fail type|'''corresponding enumerator''']].
 
===Get reserved Game Id===
*Returns the [[Ylands Change Game ID|'''Game ID''']] of game where the player can be dispatched to.
*Guid is determined from the '''Session object'''.
 


===Example===
===Example===

Revision as of 16:43, 7 September 2020

File:Tile - YGameSession - Get Reserved Game Id.png

  • Instruction allowing to transfer a player to a game within same Game set.
    • Player will be added to Matchmaker queue. If there will enough players queuing for the same game, they will be then transferred to newly spawned server of that game.
    • The Matchmaker will always spawn new server instance if enough players are available. The Matchmaker will not transfer player to already running instances.

Start Matchmaking

  • Player will be added to Matchmaker queue for listed games.
    • Guids - list (Array) of Game ID obtained via Game set manager which the player will be matched to.
    • Player - player to be added to Matchmaker queue.
    • Priority - Matchmaker request priority.
      • Player requests with higher priority are prioritized over the other.
      • If there are players matchmaking for same game(s), but with lower priority, they will be added to the players with higher priority.
  • If the reservation will be successful, the instruction will return a Session object.
    • Session object - contains target server and player to be dispatched.
  • If the reservation will fail, the instruction will return a Fail reason.

Cancel matchmaking

  • This instruction will cancel current Matchmaker request.

Dispatch session

  • This instruction will dispatch selected player using the Session object.

Fail reason

Get reserved Game Id

  • Returns the Game ID of game where the player can be dispatched to.
  • Guid is determined from the Session object.


Example



Template:Ylands scripting navbox