Determine client from lua

I ask a lua question here because I need my addon to find out which client it is loaded in. Is that possible using the API?

Currently I define X-Client in the various toc files and set to either Mainline, BCC, or Classic and then read the field using GetAddOnMetadata(“addon”, “X-Client”) but I think there must be a better way. But is there a better way?

You can probably do it with GetBuildInfo() and then get the client version from version/tocversion’s first digit(1 for classic, 2 for bc, etc.)

1 Like

Oh, I didn’t know the first digit signified the client version. Is that official or just a qualified guess?

I noticed it from this post https://us.forums.blizzard.com/en/wow/t/please-support-multiple-clients-in-toc-interface/927491/4 that toc version is different for each client.

1 Like

As the last post of this linked thread says, you best use the WOW_PROJECT_ID constant to identify your client: https://wowpedia.fandom.com/wiki/WOW_PROJECT_ID

1 Like

It’s official and corresponds to the game version. Blizzard increments the first digit (also called ‘major version’) with each new expansion.

So 1 is vanilla, 2 is TBC, 3 is Wrath, 4 is Cataclysm, etc, all the way up to 9 for Shadowlands.

The classic versions of the game reuse this versioning scheme. WoW Classic is 1.13.4, TBC classic is 2.5.2 atm. The original classic and TBC have lower version numbers.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.