GetRealmName

From Warcraft Wiki
Jump to navigation Jump to search
GitHub Octocat.png  Townlong-Yak BAD.png  ProfIcons engineering.png  Wowprogramming.png  BTNTemp.png GetRealmName TheWarWithin-Icon-Inline.pngDragonflight-Icon-Inline.pngCata-Logo-Small.pngWrath-Logo-Small.pngWoW Icon update.png + 1.5.0 / 1.13.2
GitHub Octocat.png  Townlong-Yak BAD.png  ProfIcons engineering.png  BTNTemp.png GetNormalizedRealmName TheWarWithin-Icon-Inline.pngDragonflight-Icon-Inline.pngCata-Logo-Small.pngWrath-Logo-Small.pngWoW Icon update.png + 7.1.0 / 1.13.2

Returns the realm name.

realm = GetRealmName()
normalizedRealm = GetNormalizedRealmName()

Returns

realm
string - The name of the realm.
normalizedRealm
string? - The name of the realm without spaces or - hyphens.

Details

Related API GetRealmID
  • The normalized realm name is used for addressing whispers[1] and in-game mail.
  • When logging in, GetNormalizedRealmName() only returns information starting from as early as the PLAYER_LOGIN event.
-- GetTime(), event, GetRealmName(), GetNormalizedRealmName()
11647.589 VARIABLES_LOADED: "Defias Brotherhood", nil
11647.655 PLAYER_LOGIN: "Defias Brotherhood", "DefiasBrotherhood"
11647.655 PLAYER_ENTERING_WORLD: "Defias Brotherhood", "DefiasBrotherhood"

Example

A small list of realm IDs and names.

-- /dump GetRealmID(), GetRealmName(), GetNormalizedRealmName()
503, "Azjol-Nerub", "AzjolNerub"
513, "Twilight's Hammer", "Twilight'sHammer"
635, "Defias Brotherhood", "DefiasBrotherhood"
1049, "憤怒使者", "憤怒使者"
1093, "Ahn'Qiraj", "Ahn'Qiraj"
1413, "Aggra (Português)", "Aggra(Português)"
1925, "Вечная Песня", "ВечнаяПесня"

Patch changes

Mists of Pandaria Patch 5.4.1 (2013-10-29): CVar realmName was removed[2].
WoW Icon update.png Patch 1.5.0 (2005-06-07): Added.

See also

  • UnitName() - Returns a character name and the server (if different from the player's current server)

References

  1. ^ SDPhantom 2020-02-18. Re: Party members with server name?. WoWInterface.
  2. ^ SpaceDuck, Mule 2014-10-30. GetCVar("realmName") gives nil. MMO-Champion.