Addons and C++ menu

User Tag List

Results 1 to 8 of 8
  1. #1
    cincture's Avatar Member
    Reputation
    1
    Join Date
    May 2009
    Posts
    20
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Addons and C++

    Could someone please help me? I am trying to understand how the WoW interface and addons communicate with the MaNGOS emulator.

    Blizzard_AuctionUI.xml shows this script on the Auction House BID button:

    Code:
    <OnClick>
    	PlaceAuctionBid("list", GetSelectedAuctionItem("list"), MoneyInputFrame_GetCopper(BrowseBidPrice));
    	self:Disable();			
    </OnClick>
    Blizzard_AuctionUI.lua also calls the function, but does not define it (most likely because addons should not be able to add/remove money)

    Code:
    PlaceAuctionBid(AuctionFrame.type, GetSelectedAuctionItem(AuctionFrame.type), AuctionFrame.buyoutPrice);
    And the MaNGOS file AuctionHouse.cpp has this function defined, which appears to execute the PlaceAuctionBid call:

    Code:
    void WorldSession::HandleAuctionPlaceBid( WorldPacket & recv_data ) { ... }
    My question is, how does clicking the BID button on the auction house call the HandleAuctionPlaceBid function in MaNGOS? Where is the code that makes the call to PlaceAuctionBid execute the HandleAuctionPlaceBid function? And, in general, how do Lua and C++ communicate with each other?

    Thanks!

    Addons and C++
  2. #2
    AngelSandy's Avatar Member
    Reputation
    19
    Join Date
    Jan 2009
    Posts
    330
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's very simple.

    Lua is an "easier" version of C++. In general anyway.
    With Lua, you recall functions already defined in the Core and use them. The huge plus about Lua is that it's a light weight language, and doesn't need to be recompiled, but only reloaded.

    There is a limitation to Lua, as it can't do all the things that C++ can do. Look at it like this:
    C++ is God
    Lua is Jesus

    God can do anything.
    Jesus can only do things to a certain extent.

    I hope this helped a bit Lol :b

  3. #3
    Link_S's Avatar Member
    Reputation
    125
    Join Date
    Dec 2008
    Posts
    293
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by AngelSandy View Post
    It's very simple.

    Lua is an "easier" version of C++. In general anyway.

    No Lua isn't an "easier" version of C++. You can see the difference clearly when you look at code that does the same thing.


    And Mangos didn't have Lua support last time I checked :P

    Sorry cincture but I don't know how to make "addons" for Mangos servers.
    Why do I need a signature?

  4. #4
    cincture's Avatar Member
    Reputation
    1
    Join Date
    May 2009
    Posts
    20
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, now my noobness is going to really show. What exactly does it mean when an emulator doesn't have "lua support"?

  5. #5
    Jotox's Avatar Contributor
    Reputation
    250
    Join Date
    Mar 2008
    Posts
    282
    Thanks G/R
    0/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Okay this is really stupid.

    The LUA in that code that you posted does not cause the mangos code to execute.

    What happens is that when you press the button, the LUA in that code you posted calls a C++ function written in the WoW client, and that C++ function sends a packet to the mangos server.

    The mangos server receives the packet, and sends the packet to its correct code handler, meaning that C++ mangos function that you posted.


    Does that explain it?

  6. #6
    AngelSandy's Avatar Member
    Reputation
    19
    Join Date
    Jan 2009
    Posts
    330
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ^
    What he says xD

  7. #7
    The-Eradicator's Avatar Contributor

    Reputation
    149
    Join Date
    May 2007
    Posts
    829
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Aside from Jotox, you guys clearly didn't read the thread.

    He's asking about clientside Lua, not serverside.


    For OP, Jotox is 100% correct. The only thing he omitted is that somewhere in the core (I don't know where exactly, I use TrinityCore), it routes specific packets, such as the one you're asking about, to their proper functions.


    Note for you: Since it's pretty clear what you're probably leaning towards, yes, you can make addons that get data from the server. You can't add your own functions and have serverside handlers for them, but what you can do is use addon messages. You can manipulate data or send entirely different stuff to players from the addon message handlers.
    The most beautiful thing we can experience is the mysterious. It is the source of all true art and all science. He to whom this emotion is a stranger, who can no longer pause to wonder and stand rapt in awe, is as good as dead: his eyes are closed.
    Albert Einstein

  8. #8
    cincture's Avatar Member
    Reputation
    1
    Join Date
    May 2009
    Posts
    20
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Excellent. Thank you all. It's starting to make much more sense.

    I found where the packets are rerouted in opcodes.cpp. It sounds like the specific code I was asking about is hard coded into the client, so I wouldn't be able to view it. I just wanted to see it, not alter it, so I'll just have to accept that that part of the code is "invisible."

    Thanks for the help! I really appreciate it!

Similar Threads

  1. [Buying] Paying good to someone who can make custom wow addon and bot
    By eric703 in forum World of Warcraft Buy Sell Trade
    Replies: 3
    Last Post: 05-22-2010, 12:57 PM
  2. looking for titanium node addon and roll addon
    By nickaburke in forum World of Warcraft General
    Replies: 1
    Last Post: 09-16-2009, 02:00 PM
  3. GM Addon and Ascent gm Addon
    By THAGENERAL in forum WoW EMU Programs
    Replies: 0
    Last Post: 08-06-2008, 03:21 PM
  4. How do I transfer addon and UI profiles to another account?!
    By Whoopedazz in forum WoW UI, Macros and Talent Specs
    Replies: 7
    Last Post: 03-22-2008, 03:51 AM
  5. Quartz addon and mean purposes
    By Mammin in forum World of Warcraft Exploits
    Replies: 4
    Last Post: 10-03-2007, 03:12 PM
All times are GMT -5. The time now is 03:24 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search