Thread Tools Display Modes
07-27-14, 05:57 PM   #41
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by Simca View Post
Also - a bunch of important hardcoded data that many addons will want to use? Sounds like library time! Any volunteers?
Sure, why not, though I don't think the list of addons needing this info will actually be that long. I'll edit this post shortly once I get a repo set up.

Edit:
https://github.com/Phanx/LibRealmInfo

Originally Posted by Vlad View Post
*Edit* You can find, at least the public available realms, over at character transfer. The page HTML contains javascript data on realm names and internal ID's. So far this is the easiest way to extract the list of realms and their IDs:
If anyone can get data for Chinese, Taiwanese, or Korean realms please post it here and I'll add it to the lib.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.

Last edited by Phanx : 08-03-14 at 12:25 AM.
  Reply With Quote
07-28-14, 04:28 PM   #42
TOM_RUS
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: Sep 2008
Posts: 95
TW realms (they share realmlist?)
CN realms

Last edited by TOM_RUS : 07-29-14 at 05:36 AM.
  Reply With Quote
07-29-14, 01:41 AM   #43
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by TOM_RUS View Post
KR/TW realms (they share realmlist?)
CN realms
That first one doesn't seem to include any Korean realms, or at least none of the realm names are in Korean?

Also would you mind using Vlad's script to pick up the realm type (pvp/pve/etc) on those?
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
07-29-14, 05:55 AM   #44
TOM_RUS
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: Sep 2008
Posts: 95
Originally Posted by Phanx View Post
That first one doesn't seem to include any Korean realms, or at least none of the realm names are in Korean?

Also would you mind using Vlad's script to pick up the realm type (pvp/pve/etc) on those?
kr and tw seems to use same logon server:
kr.logon.battle.net = 121.254.200.130
tw.logon.battle.net = 121.254.200.130

and as a result I was getting exactly same realm list. May be they show realm list based on account type, who knows...

Unfortunately I don't have retail accounts in those regions, so I can't open character transfer page.

Also there's seems to be no way to get KR starter edition account, so I can't even grab theirs realm list.

What about realm type, you can get it from blizz web api by searching realm name from my list in data from http://tw.battle.net/api/wow/realm/status
and
http://www.battlenet.com.cn/api/wow/realm/status

That's a lot of manual work.

May be someone can make a suggestion to add realmid to web api?

Actually:
CN realms with type
TW realm with type (25 realms in game, only 24 in realm status)

realms without type not present in realm status data

Last edited by TOM_RUS : 07-29-14 at 06:53 AM.
  Reply With Quote
07-29-14, 07:02 AM   #45
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Any idea what those type-less realms are? Should I bother including them in the lib data?
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
07-29-14, 07:09 AM   #46
TOM_RUS
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: Sep 2008
Posts: 95
Originally Posted by Phanx View Post
Any idea what those type-less realms are? Should I bother including them in the lib data?
Mostly realms for a special use: internal realms, event realms (dreamhack, blizzcon etc), cybersport etc.
  Reply With Quote
07-29-14, 08:44 AM   #47
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Okay, leaving all those out of the lib for now then. I've also added timezones for enUS realms and battlegroups for all realms, and changed the storage format to significantly reduce the memory footprint (from ~300KiB to ~120KiB). All the data for Korean realms is in, but commented out until I get realm IDs for them.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.

Last edited by Phanx : 07-29-14 at 10:07 AM.
  Reply With Quote
08-04-14, 10:07 PM   #48
Ketho
A Pyroguard Emberseer
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,026
Yes, finally beta time =)

-- Off-topic
I had to change the portal CVar in Config.wtf from "cn-test" to "public-test" in order to connect to the beta servers, even though I selected English as the installed/default language and located in Europe. Maybe because my Windows OS is in chinese?

Deleting the Config.wtf still made it rebuild with "cn-test"

Just wondering if other people had similar problems
  Reply With Quote
08-07-14, 07:46 AM   #49
Jarod24
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Jul 2012
Posts: 66
Was skimming over this post a while back and remembered it when i was working on updating my addon for patch 6.0.

Dont know if this has been said before or not but here we go.


GUID's are changing for the next expansion.
The new format for players are: Player:[server ID]:[player UID] (Example: "Player:976:0002FD64")

local strGUID = UnitGUID("player");

New GUID format: http://wowpedia.org/Patch_6.0.1/API_changes#Changes
Old documentation on GUID: http://wowpedia.org/GUID

Maybe you could use the server ID part of the guid to identify what server you are on (presuming that the ID are uniqe in the world and are persistant).
Combining that along with a hardcoded list of ID's in a library you could maybe get something working?
__________________
Author of IfThen, Links in Chat
  Reply With Quote
08-07-14, 07:51 AM   #50
Lombra
A Molten Giant
 
Lombra's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 554
Yes, that was brought up.

I noticed that according to diffs a new GetCurrentRegion function is available, but I don't know whether it not being mentioned here at all means that it's all good - case closed, or that it's something completely different.
__________________
Grab your sword and fight the Horde!
  Reply With Quote
08-07-14, 09:13 AM   #51
Jarod24
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Jul 2012
Posts: 66
Hmm. yes "GetCurrentRegion()" is a function in the latest build but i dont know if it's working or not.


I did a "/dump GetCurrentRegion()" on two of the the current Beta servers ("Level 100 PvE" and "Beta Leveling Realm 01") and the only returned result was "1".


Got no clue if this is just a placeholder value or what "1" actually refers too. (Beta?, Datacenter? Continent?, Region of a map)
__________________
Author of IfThen, Links in Chat
  Reply With Quote
08-07-14, 10:02 AM   #52
TOM_RUS
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: Sep 2008
Posts: 95
Originally Posted by Jarod24 View Post
Hmm. yes "GetCurrentRegion()" is a function in the latest build but i dont know if it's working or not.


I did a "/dump GetCurrentRegion()" on two of the the current Beta servers ("Level 100 PvE" and "Beta Leveling Realm 01") and the only returned result was "1".


Got no clue if this is just a placeholder value or what "1" actually refers too. (Beta?, Datacenter? Continent?, Region of a map)
Return value of this API is based on value of "portal" cvar. They are checking if value of this cvar matches something from this array http://paste2.org/x9c1Wkw2 and return an index at first match. If nothing matches, they return 1. Theres's also special case for "cn-test".

Last edited by TOM_RUS : 08-07-14 at 10:15 AM.
  Reply With Quote
08-07-14, 09:00 PM   #53
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by TOM_RUS View Post
Return value of this API is based on value of "portal" cvar.
That sounds rather useless, then, considering that the "portal" CVar has already been established to be unreliable if you're using the Battle.net launcher... maybe they're going to fix that?
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
08-15-14, 03:00 PM   #54
Simca
An Aku'mai Servant
 
Simca's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2012
Posts: 33
Originally Posted by Phanx View Post
That sounds rather useless, then, considering that the "portal" CVar has already been established to be unreliable if you're using the Battle.net launcher... maybe they're going to fix that?
I don't think its reliability has anything to do with the App; somebody earlier in the thread showed that starting the game via the exe and then logging into an EU account after a US account made it still show 'US'.

Fortunately, realmlist CVar apparently has the same limitations, so there is no harm in Ace3 using the portal CVar at least since it will mimic the old behavior perfectly (even if that old behavior was flawed).
__________________
Assistant admin for MMO-Champion
WoW database file expert - ask me anything
  Reply With Quote
08-16-14, 01:30 AM   #55
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by Simca View Post
I don't think its reliability has anything to do with the App; somebody earlier in the thread showed that starting the game via the exe and then logging into an EU account after a US account made it still show 'US'.
If you have an EU account, and log in via Wow.exe while it's configured to connect to US login servers, it still connects to US servers, and automatically creates a US trial account on your Battle.net account and logs you into that. You can have both EU and US WoW accounts on the same Battle.net account.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
10-15-14, 02:55 PM   #56
Bringer
A Fallenroot Satyr
 
Bringer's Avatar
Join Date: Jul 2012
Posts: 26
Trying LibRealmInfo-5

and ran into a couple of problems

First I'm clueless.. lol I tried various ways to get results from library but keep getting nil as result..
copied LibRealmInfo as sub directory of my addon
updated my copy of Libstub from your LibRealmInfo
added LibRealmInfo into my toc
libs\LibStub\LibStub.lua
libs\CallbackHandler-1.0\CallbackHandler-1.0.lua
libs\LibWho-2.0\LibWho-2.0.lua
libs\LibRealmInfo\LibRealmInfo.lua

example logging in on US Cenarius

after event ADDON_LOADED for addon
local regionKey = GetCVar("portal") == "public-test" and "PTR" or GetCVar("portal")
print ("Regionkey ="..regionKey)
local uinID = UnitGUID("Player"); print(uinID) -- character not in world yet.. invalid

response was for me:
US
nil

after all initialization events fired and system stable character in world

local uinID = UnitGUID("Player"); print(uinID)
local realmID, name, apiName, rules, locale, battlegroup, region, timezone, connected, latinName = LibStub("LibRealmInfo"):GetRealmInfoByUnit("Player")
print (realmID) ... print(latinName) all returned nil

response for me was:
Player-1168-066A8EE3
nil


Second I found when doing x = UnidGUID("Player");print(x) that some realms have been renumbered.

US Cenarius which was 2 is now reporting as 1168
US Terokkar which was 1563 is now 1070
US Elune and Maelstrom have retained their numbers

edit: follow up .. 1168 is in the character transfer list as realm Blackmoore
1070 is the response code for both terokkar and Alexstrasza !!!

Last edited by Bringer : 10-15-14 at 05:36 PM.
  Reply With Quote
10-15-14, 05:14 PM   #57
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by Bringer View Post
Trying LibRealmInfo-5
Well, there's your first problem, as we're up to v7 now.

Originally Posted by Bringer View Post
First I'm clueless.. lol I tried various ways to get results from library but keep getting nil as result..
It doesn't matter where you put it, as long as the paths in your TOC file are correct. Also, you have to completely exit and restart WoW before it will detect any new files. Since the paths you posted look fine I can only assume the latter is the problem. If it's not, ZIP up your whole addon, libs and all, and attach it to your post.

Originally Posted by Bringer View Post
Second I found when doing x = UnidGUID("Player");print(x) that some realms have been renumbered.
Can you please do the following:

1. Log into your account on the Battle.net website.
2. Click on your WoW account in the "Your Game Accounts" list on the right.
3. Click on "Character Transfer" at the bottom of the page.
4. Click on a character.
5. Right-click on the page and select "View Source".
6. Save the HTML file somewhere.
7. Attach the HTML file to a post here. You'll probably have to rename it with a .txt extension, as I don't think the forum is configured to accept .html attachments.

Thanks!

Edit: I just checked the EU realms and there are no ID mismatches, so just need US data.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.

Last edited by Phanx : 10-15-14 at 05:21 PM.
  Reply With Quote
10-15-14, 07:05 PM   #58
Bringer
A Fallenroot Satyr
 
Bringer's Avatar
Join Date: Jul 2012
Posts: 26
Note that in game ServerID's do not match Character Transfer ServerID's at all times.

in game Cenarius has id that matches non-existant Chracter Transfer realm Blackmoore.

also see edit on my previous about 2 in game realms having same ServerID
Attached Files
File Type: log pct-select.html.log (105.0 KB, 1633 views)
  Reply With Quote
10-15-14, 10:18 PM   #59
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by Bringer View Post
Note that in game ServerID's do not match Character Transfer ServerID's at all times.
Well, that's rather awkward.

Is anyone actually even using this lib? Now that they've added GetCurrentRegion() and we already have GetAutoCompleteRealms() do any addons actually have a use for a realm info database?
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
10-16-14, 12:32 PM   #60
Bringer
A Fallenroot Satyr
 
Bringer's Avatar
Join Date: Jul 2012
Posts: 26
Sad to say the GetCurrentRegion() is also a bogus solution.

From my US installed setup
Logging in to battlenet via an EU created account
Logging in to Pozzo dell'Eternità
and running
/script print(GetCurrentRegion())
returns 1 aka US
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Detect Current Region

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off