Thread Tools Display Modes
09-08-05, 10:57 AM   #1
Kasheen
A Wyrmkin Dreamwalker
 
Kasheen's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2005
Posts: 58
WoW Client Version

Does anyone know if there is a function that returns the client's version number? Ive checked the Cvars and didnt see it there and couldn't find anything in wowwiki. I guess I'm at a loss then?

Thanks for any help
  Reply With Quote
09-08-05, 11:11 AM   #2
Genghiz Cohen
An Aku'mai Servant
 
Genghiz Cohen's Avatar
Premium Member
Join Date: Aug 2005
Posts: 34
Doesn't it say on the login screen? Before you handshake and all that.
  Reply With Quote
09-08-05, 11:20 AM   #3
Kasheen
A Wyrmkin Dreamwalker
 
Kasheen's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2005
Posts: 58
Yeah it does say it there but my script doesn't know that. Unless I could pull the text out of the font string on the front page in which case I'd need to know all the XML names. . .

The thing is I wan't to be able to do something in my mod like:

if (GetVersion() > 1600) then
-- Do stuff
else
-- Do other stuff
end

I guess there must be some way to do it though, WoW must somehow compare the TOC file's version number with its own.
  Reply With Quote
09-08-05, 11:24 AM   #4
Cairenn
Credendo Vides
 
Cairenn's Avatar
Premium Member
WoWInterface Admin
Join Date: Mar 2004
Posts: 7,134
Ummm

What sort of stuff do you expect your script to be able to do if you aren't running the current version? The only thing you can do if you aren't running the current version is to download and apply the patch, at which point you are then running the current version, so your script knows to just go ahead and run ....
__________________
“Do what you feel in your heart to be right — for you’ll be criticized anyway.” ~ Eleanor Roosevelt
~~~~~~~~~~~~~~~~~~~
Co-Founder & Admin: MMOUI
FaceBook Profile, Page, Group
Avatar Image by RaffaeleMarinetti
  Reply With Quote
09-08-05, 11:37 AM   #5
Kasheen
A Wyrmkin Dreamwalker
 
Kasheen's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2005
Posts: 58
Originally Posted by Cairenn
Ummm

What sort of stuff do you expect your script to be able to do if you aren't running the current version? The only thing you can do if you aren't running the current version is to download and apply the patch, at which point you are then running the current version, so your script knows to just go ahead and run ....
With 1.7 there will be a change in XML for GroupLootFrameTemplate. My script hooks a function to get a different roll frame to show/hide, this roll frame is compatible with 1.6, ie it doesnt have the greed button in the XML. However, if you were to run this on 1.7 you would have 1.6 roll frames, ie no greed button and the wrong parameters being passed to the roll function.

By determining if the user is running a 1.6 mod on version 1.7 you can just not hook the function which means the original frames will be shown/hidden as per usual.

The point in this is basically a fail safe for a user who forgets to update this mod. If you didnt update this mod you wouldn't be able to roll loot which would be pretty disasterous.

Ive found a work around though. I can use getglobal() to find out if the greed button is on the original GroupLootFrame1 XML and if it is there it means they are running 1.7, if not they are running 1.6.

The reason for this madness is so that I can release my mod now and not wait until 1.7 is out and obviously when 1.7 is out a compatible XML will be uploaded for people to use.
  Reply With Quote
09-08-05, 11:46 AM   #6
Cairenn
Credendo Vides
 
Cairenn's Avatar
Premium Member
WoWInterface Admin
Join Date: Mar 2004
Posts: 7,134
Ah ha! Okay. Thank you for the explaination.

Sorry for the inquiry, but there have been folks lately trying to figure out things like this because they are running their own private servers, which of course breaks the TOS and EULA, so I needed to check.
__________________
“Do what you feel in your heart to be right — for you’ll be criticized anyway.” ~ Eleanor Roosevelt
~~~~~~~~~~~~~~~~~~~
Co-Founder & Admin: MMOUI
FaceBook Profile, Page, Group
Avatar Image by RaffaeleMarinetti
  Reply With Quote
09-08-05, 12:12 PM   #7
Kasheen
A Wyrmkin Dreamwalker
 
Kasheen's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2005
Posts: 58
Originally Posted by Cairenn
Ah ha! Okay. Thank you for the explaination.

Sorry for the inquiry, but there have been folks lately trying to figure out things like this because they are running their own private servers, which of course breaks the TOS and EULA, so I needed to check.
No problem. Im a good boy :P.

Once the european test servers come back online I'll be able to test my work around (rest of the mod is tested and working happily by me and someone else) so ill be able to uplaod it and you can take a peek then if it gets approved .
  Reply With Quote
09-08-05, 01:55 PM   #8
Kasheen
A Wyrmkin Dreamwalker
 
Kasheen's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2005
Posts: 58
Yey, its on the site now . Ill post a thread over in the Releases forum to give it a bit of a plug , its called Compact Loot Frames for anyone who wants to know.
  Reply With Quote
09-09-05, 03:01 AM   #9
farang
A Deviate Faerie Dragon
 
farang's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2005
Posts: 19
there is an easy way to solve your problem.

Just take one of the new Commands, and see if it it's existing...

Code:
if (SomeBlizzCommand) then
	DEFAULT_CHAT_FRAME:AddMessage ("Command exists, therefore we can use it!")
else
         DEFAULT_CHAT_FRAME:AddMessage ("Command dosn't exists, damn!")
end
Of course you need to replace "SomeBlizzCommand" with a real new 1.7 command/function
  Reply With Quote
09-09-05, 08:45 AM   #10
Gello
A Molten Giant
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 521
LoadAddOn is a 1.7-specific function I use to test.

if LoadAddOn then
-- we're on 1.7 client
end
  Reply With Quote
09-09-05, 11:10 AM   #11
Kasheen
A Wyrmkin Dreamwalker
 
Kasheen's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2005
Posts: 58
Thanks guys, I ended up just going for:

Code:
getglobal("GroupLootFrame1GreedButton")
and checking for nil. Good suggestion on checking a function as well though .
  Reply With Quote
10-09-05, 11:10 AM   #12
Darjk
A Defias Bandit
Join Date: Oct 2005
Posts: 2
The function that blizzard use is
Code:
local versionType, buildType, version, internalVersion, date = GetBuildInfo();
However that is not available from within the FrameXML, so it doesn't help you but thought you might be interested.
  Reply With Quote
10-09-05, 02:45 PM   #13
Kasheen
A Wyrmkin Dreamwalker
 
Kasheen's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2005
Posts: 58
Thanks , its all settled out now really. It was really just to make sure people who transitioned from 1.6 to 1.7 didnt have their loot windows exploding, that would have meant the drop of your life might have come and you wouldnt have been able to roll ;P.

Now that 1.7 is out its a bit easier because the loot frames arent really changing, hopefully they wont change for a wee while either :P.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » WoW Client Version

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