Quantcast
Download
(17 Kb)
Download
Updated: 07-29-18 04:57 AM
Compatibility:
Battle for Azeroth (8.0.1)
Updated:07-29-18 04:57 AM
Created:07-27-14 08:55 PM
Downloads:1,600
Favorites:2
MD5:
8.0.1

LibRealmInfo

Version: 13
by: Phanx [More]

Library to provide information about realms.

If you only need to know the names of realms connected to the player's current realm, you should just use GetAutoCompleteRealms instead of this library.

If you only need to know which region the player is currently on, you can use GetCurrentRegion, but you should be aware that this function is not always reliable.

Use GitHub for issues and patches.

Usage

Available API methods:

  • :GetCurrentRegion()
    Get the two-letter abbrevation for the region the player is currently connected to; one of "US", "EU", "KR", "CN" or "TW". Returns nil on PTR and Beta realms.
  • :GetRealmInfo(name[, region])
    Get information about a realm by name; if no region is provided, the player's current region will be assumed.
  • :GetRealmInfoByID(id)
    Get information about a realm by ID.
  • :GetRealmInfoByGUID(guid)
    Get information about the realm the given player GUID belongs to.
  • :GetRealmInfoByUnit(unit)
    Get information about the realm the given player unit belongs to.
All of the above methods return the following values:
  1. id - the numeric unique ID of the realm
  2. name - the name of the realm
  3. api_name - the name of the realm without spaces, as seen in chat etc.
  4. rules - one of "PVP", "PVE", "RP" or "RPPVP"
  5. locale - the official language of the realm
  6. battlegroup - the name of the realm's battlegroup
  7. region - one of "US", "EU", "KR", "CN" or "TW"
  8. timezone - for realms in the US region, a string describing the realm's time zone, eg. "PST" or "AEST"
  9. connections - for connected realms, a table listing the IDs of connected realms
  10. latin_name - for Russian-language realms, the English name of the realm
  11. latin_api_name - for Russian-language realms, the English name of the realm without spaces
Note that the realm IDs contained in the GUIDs of player characters on connected realms indicate the realm hosting the connected realm group, which may not be the realm that character actually belongs to. Use GetPlayerInfoByGUID to get the real realm name, or use the :GetRealmInfoByGUID or :GetRealmInfoByUnit methods provided by LibRealmInfo.

To Do

Data for Korean realms?
If you have an active Korean account, please log into the Battle.net website, go to the Paid Character Transfer page, select a character, save the HTML source of the page (right-click, view source, save) and attach it to a ticket.

Connection data for Chinese and Taiwanese realms
If you can read Chinese, please locate the blog or forum post where Blizzard lists the connected realms for one or both of these regions and link to it in a ticket.

Lib: Realm Info
13 (2018-07-29)
Full Changelog Previous releases
  • Bump minor version
  • Update TOC
  • Workaround for missing data for Chinese realms
  • Remove discontinued servers (fixes #13)
  • Include nameless "host" servers in connected realm list
  • Update readme
  • Remove unused code
  • Use helper function to generate API names
  • Convert snake case variable names to camel case
  • Remove realm entries for nameless realms
    These are used to host connected realm groups. They are not included
    in the realm info from the Battle.net API, but are included (as the
    connected group ID) from the connected realm info API. To support
    region detection, we now add these to the realm info table dynamically
    when unpacking the connected realm info.
  • Return a copy of the connections list
    Otherwise the client addon can modify the library's internal data,
    since tables in Lua are passed by reference.
  • Update connected realm data from Battle.net API
  • Update realm data from Blizzard Developer API
  • Remove LOD flag
Archived Files (11)
File Name
Version
Size
Author
Date
12
21kB
Phanx
02-08-18 04:06 AM
11
20kB
Phanx
06-09-17 10:17 PM
9
22kB
Phanx
11-03-14 01:11 AM
7
20kB
Phanx
10-06-14 12:45 PM
6
20kB
Phanx
09-25-14 03:49 AM
4
17kB
Phanx
08-04-14 06:23 AM
4
17kB
Phanx
08-03-14 01:14 PM
3
15kB
Phanx
07-29-14 10:05 AM
2
10kB
Phanx
07-29-14 01:21 AM
1
16kB
Phanx
07-27-14 08:56 PM
0B
Phanx
07-27-14 08:55 PM


Post A Reply Comment Options
Unread 07-27-14, 09:35 PM  
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view AddOns

Forum posts: 5617
File comments: 2321
Uploads: 48
Please use GitHub for bug reports, feature requests, and patches.
__________________
Author/maintainer of Grid, PhanxChat, oUF_Phanx, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
Last edited by Phanx : 08-02-14 at 11:32 PM.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: