Skip to content
This repository has been archived by the owner on Jan 20, 2021. It is now read-only.
Phanx edited this page Jan 1, 2019 · 5 revisions

GetRealmInfo

id, name, nameForAPI, rules, locale, _, region, 
timezone, connectedIDs, englishName, englishNameForAPI
   = LibStub("LibRealmInfo"):GetRealmInfo(name, region)

Arguments

  1. name - string: The name of the realm to query
  2. realm - (optional) string: The region to query. If not specified, the player's region will be used.

Returns

  1. id - number: the realm ID
  2. name - string: the realm name
  3. nameForAPI - string: the realm name as displayed when joined with player names, e.g. in chat (without spaces, dashes, etc.)
  4. rules - string: one of "Normal" or "Roleplaying"
  5. locale - string: the official realm language, corresponds with GetLocale() values
  6. nil
  7. region - string: one of "US", "EU", "KR", "CN" or "TW"
  8. timezone - string/nil: for US realms, one of "PST", "MST", "CST", "EST", "BRT", or "AEST"
  9. connectedIDs - table/nil: for connected realms, a table containing a list of realm IDs (including the queried realm ID)
  10. englishName - string/nil: for non-Latin realm names, the English version of the realm name (eg. "Azuregos" vs "Азурегос")
  11. englishNameForAPI - string/nil: for non-Latin realm names, the English version of the realm's name as it appears when appended to player names in-game

Notes on return values

  • The locale for European English servers is enUS, not enGB, and European Portuguese is ptBR, not ptPT. These values correspond with the value returned by the GetLocale API function, and with the fact that WoW doesn't have separate translations for these regional variations.

  • The 6th return value is always nil. Previously it was the name of the realm's battlegroup. However, the Battle.net Developer API (where the data in LibRealmInfo now comes from) does not provide this information, and battlegroups are no longer relevant anyway, so this information has been removed from LibRealmInfo. A nil value is returned in this position for backwards compatibility.

  • Connected realm groups often include an unnamed server that is only used to host the connected realm group. The IDs of these servers can be seen in player GUIDs. LibRealmInfo does support these servers, but only to provide region information; no other information would be relevant, as these servers are not actually realms and have no other intrinsic properties.

  • English equivalent names are provided for Russian, Korean, and Taiwanese realms; and also for a few French realms whose names include non-ASCII punctuation symbols.

Note about Chinese realm data

Realm info is obtained from the Blizzard Developer API for accuracy, but getting info about Chinese realms would require a separate Chinese Battle.net account, which I do not have. The info for Chinese realms in LibRealmInfo is therefore the old manually compiled data, which may be inaccurate or outdated, and info about connected realms is missing entirely. If you have a Chinese Battle.net account and are willing to help, please open a ticket or email me.

US Timezones

  • PST = UTC-8 = US Pacific Standard Time
  • MST = UTC-7 = US Mountain Standard Time
  • CST = UTC-6 = US Central Standard Time, also used on Latin American servers
  • EST = UTC-5 = US Eastern Standard Time
  • BRT = UTC-3 = Brazil Time
  • AEST = UTC+10 = Australian Eastern Standard Time, used on Oceanic servers

LibRealmInfo does not provide timezone information for other regions, as all realms within a given non-US region use the same timezone. For the curious, European servers are on Central European Time (UTC+1) including Russian servers; Chinese and Taiwanese servers are on China Standard Time (UTC+8); and Korean servers are on Korea Standard Time (UTC+9).

GetRealmInfoByID

id, name, nameForAPI, rules, locale, _, region,
timezone, connectedIDs, englishName, englishNameForAPI
   = LibStub("LibRealmInfo"):GetRealmInfoByID(id)

Arguments

  1. id - number: The ID for the realm to query (strings will be converted to numbers)

Returns

Same as GetRealmInfo.

GetRealmInfoByGUID

id, name, nameForAPI, rules, locale, _, region,
timezone, connectedIDs, englishName, englishNameForAPI
   = LibStub("LibRealmInfo"):GetRealmInfoByGUID(guid)

Arguments

  1. guid - string: The GUID of the unit whose realm to query.

Returns

Same as GetRealmInfo.

GetRealmInfoByUnit

id, name, nameForAPI, rules, locale, _, region,
timezone, connectedIDs, englishName, englishNameForAPI
   = LibStub("LibRealmInfo"):GetRealmInfoByUnit(unit)

Arguments

  1. unit - string: The unit token (eg. "target") of the unit whose realm to query.

Returns

Same as GetRealmInfo.