<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3AGetServerList</id>
	<title>API:GetServerList - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3AGetServerList"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:GetServerList&amp;action=history"/>
	<updated>2026-10-17T16:47:40Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.returnofreckoning.com/index.php?title=API:GetServerList&amp;diff=30462&amp;oldid=prev</id>
		<title>Maintenance script: UI Lua API import (WAR 1.4.8)</title>
		<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:GetServerList&amp;diff=30462&amp;oldid=prev"/>
		<updated>2026-10-16T19:44:57Z</updated>

		<summary type="html">&lt;p&gt;UI Lua API import (WAR 1.4.8)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{LuaApi|group=Pregame}}&lt;br /&gt;
Returns the list of game servers that the login server sent.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
servers = GetServerList()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arguments ==&lt;br /&gt;
None.&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
;servers : &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; – Array of server tables, indexed from 1.&lt;br /&gt;
&lt;br /&gt;
Each server table has these fields:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key !! Type !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;wstring&amp;lt;/code&amp;gt; || Server name.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Server id. Pass it to [[API:SelectServer|SelectServer]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || –&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;population&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || –&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;maximum&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || –&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;language&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Language id. The stock UI looks it up in the &amp;lt;code&amp;gt;ServerLanguage&amp;lt;/code&amp;gt; string table.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;orderPopulationDensity&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Order population level. The stock UI combines it with &amp;lt;code&amp;gt;orderPopulationQueue&amp;lt;/code&amp;gt; to judge realm imbalance.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;destructionPopulationDensity&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Destruction population level.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;orderPopulationQueue&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || –&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;destructionPopulationQueue&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || –&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;online&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;boolean&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the server is up.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;region&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; || Region key, such as &amp;lt;code&amp;gt;&amp;quot;STR_REGION_NORTHAMERICA&amp;quot;&amp;lt;/code&amp;gt;. The stock UI uses it as a key into &amp;lt;code&amp;gt;StringTables.ServerLocation&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;rulesetOpenRvR&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;boolean&amp;lt;/code&amp;gt; || –&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;rulesetRolePlaying&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;boolean&amp;lt;/code&amp;gt; || –&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;rulesetCore&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;boolean&amp;lt;/code&amp;gt; || –&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;localeDistance&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || The stock UI sorts by it and treats 0 as a local server.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;sameLanguage&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;boolean&amp;lt;/code&amp;gt; || –&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;orderBonus&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Order bonus value. The stock UI passes it to [[API:PregameSetServerRealmBonuses|PregameSetServerRealmBonuses]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;destructionBonus&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Destruction bonus value.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;redirect&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;boolean&amp;lt;/code&amp;gt; || –&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;trialServer&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;boolean&amp;lt;/code&amp;gt; || –&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;legacy&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;boolean&amp;lt;/code&amp;gt; || –&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;retired&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;boolean&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; for a retired server. [[API:SelectServer|SelectServer]] refuses these.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;orderChars&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;boolean&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the account has at least one Order character on this server.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;destructionChars&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;boolean&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the account has at least one Destruction character on this server.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;characterCount&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Number of the account&amp;#039;s characters on this server.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* A new table is built from the client&amp;#039;s stored login data on every call.&lt;br /&gt;
* The function returns nothing if the login data is not available.&lt;br /&gt;
* The stock server select window refreshes its list on &amp;lt;code&amp;gt;SystemData.Events.SERVER_LIST_RESPONSE&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
None.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
From &amp;lt;code&amp;gt;interfacecore/source/serverselectwindow.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
local tempList = GetServerList()&lt;br /&gt;
ServerSelectWindow.serverList = {}&lt;br /&gt;
&lt;br /&gt;
for _, data in ipairs(tempList)&lt;br /&gt;
do&lt;br /&gt;
    -- show the server if it is not a legacy server and not a retired server&lt;br /&gt;
    -- or if it is not retired, and is a legacy server, and we are set to showLegacyServers&lt;br /&gt;
    -- or if the server is legacy or retired, but we have a character on it&lt;br /&gt;
    if( ( not data.legacy and not data.retired) or&lt;br /&gt;
        ( not data.retired and data.legacy and ServerSelectWindow.showLegacyServers ) or&lt;br /&gt;
        ( data.characterCount ~= 0 )  )&lt;br /&gt;
    then&lt;br /&gt;
        table.insert(ServerSelectWindow.serverList, data)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:SelectServer|SelectServer]]&lt;br /&gt;
* [[API:PregameSetServerRealmBonuses|PregameSetServerRealmBonuses]]&lt;br /&gt;
* [[API:GetAccountData|GetAccountData]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>