API:SelectServer
From RoR Wiki
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– Theidfield of an entry from GetServerList.
Returns
Nothing.
Details
- The client looks for a server with this id in its server list. Servers marked
retiredare 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)
