Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:SelectServer

From RoR Wiki
Revision as of 19:48, 16 October 2026 by Maintenance script (talk | contribs) (UI Lua API import (WAR 1.4.8))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

UI Lua API · Pregame functions
Version: WAR 1.4.8

Picks a game server from the server list and moves the pregame on to logging in to it.

SelectServer(serverId)

Arguments

serverId
number – The id field of an entry from GetServerList.

Returns

Nothing.

Details

  • The client looks for a server with this id in its server list. Servers marked retired are skipped. If no match is found, nothing happens.
  • On a match the client remembers the server as the chosen one.
  • If the client is in the pregame state, it then switches to its next pregame step to connect to that server.
  • The login server data must be available; otherwise nothing happens.
  • The stock UI sets the realm choice with PregameSetPreSelectedServerRealm before calling this.

Errors

None besides the generic Invalid Parameters message when the argument is not a number.

Example

From interfacecore/source/serverselectwindow.lua:

local serverData = ServerSelectWindow.serverList[ServerSelectWindow.selectedServer]
-- set the pre-selected server to both realms
PregameSetPreSelectedServerRealm(ServerSelectWindow.BOTH_REALM_OPTIONS)
SelectServer(serverData.id)

See also