Thread Tools Display Modes
02-03-14, 08:00 AM   #1
hotluck
A Defias Bandit
 
hotluck's Avatar
Join Date: Nov 2010
Posts: 3
Account information code question

Hi

Hopefully someone can point me in the right direction on this.

I am trying to find the code WoW uses to work out the name of an account folder in WTF so it knows where to access/use the correct lua files from when the player is playing (for a person who has multiple accounts on a battle.net account). If I give an example (account names fictional for example) -

In config.wtf in the main WTF folder there is a line that reads -

SET accountList "ACCOUNT1|!ACCOUNT2|"

Now if you then look in the WTF/Account folder, you will see 2 folders -

ACCOUNT1
3468452#1

The second account folder is not the same name as the second account in the accountlist so how does WoW work it out?

Hope this makes sense to someone lol.

Amanda
  Reply With Quote
02-03-14, 08:27 AM   #2
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
Is this a trial account? I'm not 100% sure but I think numbers like 3468452 are used for trial accounts.
  Reply With Quote
02-03-14, 08:45 AM   #3
sezz
A Chromatic Dragonspawn
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 158
@Duugu: Every account that has been created after the WoW/BNet merge only has numbers in it (for example: 3468452#1 = WOW1, 3468452#2 = WOW2), the numbers are AFAIK related to the BNet account. If you login with multiple BNet accounts you should have multiple folders like that with different numbers.

@hotluck: What are you trying to do? File operations aren't possible in addons.
  Reply With Quote
02-03-14, 10:23 AM   #4
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
Originally Posted by sezz View Post
@Duugu: Every account that has been created after the WoW/BNet merge only has numbers in it
Ah. Oh. That explains much. ty
  Reply With Quote
02-03-14, 10:28 AM   #5
10leej
A Molten Giant
 
10leej's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2011
Posts: 583
That's handles through the blizz launcher/battle.net desktop actually. It fetches the profile info and downloads it to the wtf.
__________________
Tweets YouTube Website
  Reply With Quote
02-03-14, 11:38 AM   #6
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by 10leej View Post
That's handles through the blizz launcher/battle.net desktop actually. It fetches the profile info and downloads it to the wtf.
You can still log in directly from the game client; WoW itself (without any launchers) can distinguish between multiple WoW accounts on your Battle.net account.

Originally Posted by hotluck View Post
I am trying to find the code WoW uses to work out the name of an account folder in WTF so it knows where to access/use the correct lua files from when the player is playing (for a person who has multiple accounts on a battle.net account).
1) Addons have no access to, or even awareness of, individual files, so you cannot "access" or "use" any Lua files. You can only access data (such as tables, functions, or strings) that have been loaded into the UI scripting environment by an addon, and you can only load an addon as a whole, not by its individual files.

2) Each WoW account gets its own set of saved variables; only the most basic game client settings (eg. resolution, sound settings, some Blizzard interface options) are shared with other WoW accounts, but those are shared with any account that logs in using that installed copy of the game, not just with other WoW accounts on the same Battle.net account.

Originally Posted by hotluck View Post
The second account folder is not the same name as the second account in the accountlist so how does WoW work it out?
Information doesn't have to be available to addons to be available to WoW. Account names join a long list of other things -- like Real ID names, the exact coordinate locations of mobs, the exact position of tracking dots on the minimap, etc. -- that are not available to addons.

Even if you can make use of the WOW1 and WOW2 names somehow, looking at the accountList CVar would not help if you wanted to log into both accounts at the same time, since nothing (eg. which account was last logged in) is written out to the file on disk until you log out or exit the client, so unless you wanted to (and could consistently remember to) log in, then out, then back in on the first account before logging in on the second account, both clients would load with the same version of Config.wtf.

Rather than asking about the technical details of a particular implementation (which in this case doesn't sound like it's even possible) you'll get more useful replies if you actually describe what you want to do. Instead of asking how to calculate the value of Y at any value of X along a sine curve, just ask how to make an icon bounce up and down.
__________________
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
02-03-14, 02:09 PM   #7
10leej
A Molten Giant
 
10leej's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2011
Posts: 583
Ah though it was handled through the launcher that process doesn't end when you launch the client.
__________________
Tweets YouTube Website
  Reply With Quote
02-03-14, 05:00 PM   #8
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
If you do it from the launcher, it is. But, you can also open the game client (Wow.exe or Wow-64.exe) directly, without any launcher running at any point, and log in from there.

Though, likely nobody does this anymore... I used to do it beacause the WoW Launcher was horrible and messed with WoW folder and file attributes, and didn't actually offer any benefits. However, the new Battle.net launcher not only doesn't break things on my filesystem, but it also saves me from having to type in my password ever again! :P
__________________
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
02-04-14, 12:45 PM   #9
sezz
A Chromatic Dragonspawn
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 158
Originally Posted by Phanx View Post
However, the new Battle.net launcher not only doesn't break things on my filesystem, but it also saves me from having to type in my password ever again! :P
You're lucky - every now and then I get a folder called "(null)" in WTF/Account or WTF/Account/AccountName/Server or an empty and useless SavedVariables folder in WTF/Account...

But that's propably a 64 bit WoW bug in Windows, not a launcher problem. I don't get the (null) folders in OSX and I didn't get them when using the 32 bit WoW client before the Battle.net launcher beta started (I also didn't use the "old" launcher).
  Reply With Quote
02-04-14, 01:23 PM   #10
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by sezz View Post
You're lucky - every now and then I get a folder called "(null)" in WTF/Account or WTF/Account/AccountName/Server or an empty and useless SavedVariables folder in WTF/Account...
Well, it does do that, but that isn't re-showing hidden files, removing read-only and system file attributes (which also removes the custom icons I've set on some folders, among other things), or doing anything else that actively interferes with the desired operation of my filesystem or other programs. Annoying, yes, but not actually breaking.
__________________
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
02-05-14, 10:15 AM   #11
hotluck
A Defias Bandit
 
hotluck's Avatar
Join Date: Nov 2010
Posts: 3
Thanks for the replies guys

I use the addon altoholic which I love, but the only way to have up-to-date info available for both my accounts is to log them both in and use the share option from both sides which takes time.

My idea was to create an addon that worked in conjunction with altoholic that would hold the info of all the user's multiple accounts and be able to merge the info from all the accounts automatically into the current account's wtf altoholic files when they logged in but from the answers you've given, I think that's not possible so I'll just have to grit my teeth and deal with alto as it is.

If anyone has any other ideas about being able to do this within the addon lua limitations I would appreciate it otherwise thanks for the help

Amanda
  Reply With Quote
02-05-14, 10:26 AM   #12
Lombra
A Molten Giant
 
Lombra's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 554
There is an out-of-game way to achieve this BUT it will only work as long as you do not login on both accounts at the same time. If you do, bad things will happen, and horrible things can happen. (as far as your saved variables go, at least) You can use symbolic links to have both accounts use the same account folder. It's not viable in most cases, but just throwing it out there in case you actually don't ever use both accounts at the same time.
__________________
Grab your sword and fight the Horde!
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Account information code question


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