Page 1 of 2

Proposal: Plug-ins for MQ

Posted: Mon Apr 21, 2003 3:16 am
by Clawed
I was thinking it might be a useful idea to create a plug-in interface for MQ. Basically people would just make a DLL that exposes a certain set of functions (or even an Interface). Maybe name the files .MQX. It would have something like this structure:

MQXLoad(POFFSETSINFO *, ...) - Performs any initialization required by the plug-in. OFFSETSINFO would be a new struct or class that would contain all the offsets used by MQ, wrapped up neatly for passing as a parameter. The same thing would need to be done for any other global variables used by the code, so that the plug-in would be fully capable of doing anything MQ does.

MQXMessageHandler(POFFSETSINFO *, PMESSAGEINFO *, ...) - Called at many different points during the MQ execution. The MESSAGEINFO struct would contain a message ID and any other pertinent data. The message ID would correspond to when the function was being called. For example, call it during CCommandHook, CChatHook, etc. Also called every time the main execution loop iterates, when InsertCommands is called, etc. Called at the beginning and/or end of each regular MQ command to support overriding/extending the existing commands. Possibly create a way for the plug-in to generate an error state which is passed back to MQ itself and handled in some way. This function might be better implemented as a callback instead of a message handler.

MQXGetCommands(PCOMMANDS &, ...) - Called to obtain a list of the commands extended or added by the plug-in. These commands would then be automatically added to DetermineWhoFirst and TakeControlOfCommandList. This function would specify a function name to call when each command is run. That way MQ can just directly call the plug-in function as if it was a standard command function in the main code.

MQXGetVersionInfo(...) - Called to get some useful information such as the name of the plug-in, it's author, and it's version. This info could be used at the EQ commandline like: "/listplugins" (or if you're a hardcore Windows programmer: "/enumerateplugins" :) )

MQXUnload(POFFSETSINFO *, ...) - Used for deinitialization.

Which plug-ins to load could be specified in macroquest.ini, and I don't see any reason why we couldn't also have a dynamic load feature such as "/loadplugin <xxx>" and "/unloadplugin <xxx>".

Also might need a way to call certain functions in the MQ codebase, especially WriteChatColor, etc.

I am not 100% an expert in DLL programming, so I have a question -- if EQLIB.DLL uses LoadLibrary to load another DLL, does that DLL automatically get injected into eqgame's process space? So the third-party DLL could directly access memory offsets? Or do we instead need to use ReadProcessMemory to indirectly read the memory without generating a protection fault?

I think this would benefit the MQ project as a whole in 3 ways:
  • The changes that are necessary would make MQ much more Object Oriented, and thus cleaner and more manageable. It might also assist us with modularizing the code more.
  • Having a plug-in capability lets other users relatively easily create new functionality for MQ without a) posting code snippets or b) trying to get their changes added to the official source tree.
  • A by-product of this feature would be some useful documentation about the MQ source code in general, as it would be necessary in order to instruct people on writing MQX files.
If anyone at all thinks this is a good idea, I am interested in writing the code. But it would require a fairly intense rewrite of the main MQ code -- for example, encapsulating all the offsets into a single object would be a big undertaking all by itself. Devs, please let me know if this idea is out to lunch or worth pursuing.

Oh, and before anyone tells me that this idea would slow down the code too much, please do a little bit of Windows Shell programming (or any Windows programming, for that matter); you'll see that this is how it's done. :)

Posted: Mon Apr 21, 2003 4:03 pm
by kaz
this is a good idea and it would not slow down the mq code at all,

also, one of the best performance boosts you could give mq would be a string buffer pool of shared ref counted string buffers.

Posted: Mon Apr 21, 2003 6:53 pm
by fwiggles
sounds like a good idea to me. I would never be capable of writing one...but i could always leach off of other people :shock: .

Posted: Mon Apr 21, 2003 7:14 pm
by L124RD
Salutations,
However, by doing an implementation like this it would be quite possible to create deadly MQX Viruses which exposed information and mailed it over the net.
This means that there needs to be some system for monitoring what is in the "MQX"'s or something like that.
/listplugins
Plugins:
click.mqx - adds a command to click on elements
runaway.mqx - adds a command to run away
/plugin load click.mqx
click.mqx reportably does the following:
add's the /click command
Thus accessing:
Mouse->X
Mouse->Y
*EQADDR_Mouse
*EQADDR_MouseX
*EQADDR_MouseY
Warning! The mqx also accesses:
c:/windows/win.com
0x00403829
0x0040383d [Edit: these are fake Addr's btw]
Continue? /plugin [continue|stop]
/plugin stop
Aborting Continuation of plugin
/plugin !Load runaway.mqx
Forcing the loading of runaway.mqx...
And since I'm at a public computer, person next to me asked me to ask you all if you know how to light a match, however please do not post on tis question.

Posted: Mon Apr 21, 2003 10:06 pm
by Clawed
This is a common problem/fear with this sort of thing. For example, a lot of web server companies refuse to install Microsoft Frontpage Extensions, because the source code is not available, so they don't know exactly what it is they are installing (this coming mostly from the Linux people, of course). Anyway, the solution to this problem is to release these MQX files as source-only, just as MQ itself is. Then if somebody compiles it and its a trojan/virus/whatever, well I guess they should have read the source. 8)

Excellent Idea

Posted: Wed Apr 23, 2003 8:15 pm
by Gandalf_the_White
I was thinking of something similar myself..
At the very least to cleanup the code.
Its a mess.

Posted: Wed Apr 23, 2003 10:35 pm
by L124RD
Saltuations,
Well Gandalf, be my guest.

Posted: Wed Apr 23, 2003 11:26 pm
by Clawed
After talking to DKAA about this a bit, I have started work on the MQX project. Just letting people know, so we don't get duplicate work going. My first version will focus on modifying EQLib.cpp as little as possible. After I get all the new functionality correctly implemented and debugged, we can begin work on OO-ing MQ and perhaps cleaning it up a bit.

Posted: Thu Apr 24, 2003 9:04 am
by Mckorr
Think you need to add Clawed to the developers Liz.

Great Product Blog

Posted: Fri Aug 18, 2023 2:46 pm
by FrankJScott
Why don't you Google it! before you post

Best Product Site

Posted: Fri Aug 18, 2023 3:00 pm
by FrankJScott
Why don't you Google it! before you post

Excellent Toto Slot Blog

Posted: Sat Aug 19, 2023 11:32 am
by FrankJScott
Menanggapi orang berbicara tentang judi togel, web gacor, agen judi online terpercaya, slot gacor resmi hari ini, situs judi slot online terbaik dan terpercaya no 1, togel gacor slot, agen togel terbaik di dunia, agen togel terpercaya di indonesia, agen judi slot terbaik dan terpercaya no 1, daftar togel toto online terpercaya, nama togel, togel indonesia online, slot online terlaris, link game slot terpercaya, slot gacor terpercaya mudah menang, situs online slot terpercaya, no judi togel, slot mudah gacor, situs slot no 1 indonesia, judi paling gacor, Saya dapat menjamin ini toto togel for apa judi slot, rtp situs gacor, slot resmi, situs judi slot terbaik dan terpercaya, game online slot terpercaya, situs slot terbaru dan gacor, nama toto togel login, agen slot paling lengkap, situs slot resmi dan terpercaya, slot situs, togel gampang menang, nama nama togel lengkap, permainan slot mudah menang, situs slot paling gacor terpercaya, situs slot terbaik gacor, slot online terbaik dan terpercaya, top 1 togel, slot gampang menang 2023, agen slot online indonesia, game slot online resmi, also. See More High Rated Toto Slot Guide 3c8dec9

Cool Business Trip Massage Site

Posted: Thu Aug 24, 2023 3:02 pm
by FrankJScott
In reply to the person talking about a massage practice, massage llc, mobile massage corporate, massage business ideas, massage clinic for sale, angel touch foot spa and massage llc, I highly suggest this useful business trip massage url or target market of massage spa, massage envy business plan, summa massage and wellness llc, slabway out of business, thai serenity spa llc, marketing a massage therapy business, alongside all this useful business trip massage info and don't forget healing touch massage llc, boonville massage therapy llc, business plan for massage business, a+ therapeutic massage llc, a massage practice, mobile massage business plan, as well as this best business trip massage forum which is also great. Also, have a look at this great business trip massage forum alongside all massage marketing, starting your own massage therapy practice, marketing a massage therapy business, opening a massage business, 777 massage spa, mobile massage business for sale, alongside all this new business trip massage advice alongside all anointed hands massage and wellness llc, massage business blueprint podcast, massage businesses for sale, successful massage business, sba spa and massage, fulton county massage clinic, on top of new business trip massage info which is also worth a look. I also recommend this awesome business trip massage blog alongside all bespoke massage llc, massage clinic for sale, emerald massage therapy llc, running a massage business from home, mobile massage therapy business plan, massage therapy business, on top of this useful business trip massage blog not to mention massage spa business for sale, massage envy public company, llc for massage therapy, target market for massage therapy, owning a massage business, holistic care company massage, as well as high rated business trip massage info on top of reflexology marketing ideas, body oasis massage therapy llc, magic feet reflexology llc, body massage business plan, reflexology business for sale, massage envy business model, which is also great. Finally, have a look at this best business trip massage details with massage therapy business plan, massage business from home, things to add to massage practice, emilios massage llc, promoting massage therapy business, selina massage spa, for good measure. Check more @ Recommended Business Trip Massage Site ec9a89a

Top Product Info

Posted: Fri Aug 25, 2023 3:47 pm
by FrankJScott
Please Google it! before posting

Updated Product Guide

Posted: Fri Aug 25, 2023 4:33 pm
by FrankJScott
Please Google it! before posting