Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Development

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

Reply
 
Thread Tools Display Modes
  #1  
Old 09-29-2013, 07:46 PM
Lecht
Fire Beetle
 
Join Date: Sep 2013
Posts: 8
Default .Net plugin support coming soon

I'm working on a .Net interop for quest support. So far it's going really well. I will be using it to develop my server Damoria. After all is hashed out, if anyone else is interested I will release it.

It works by parsing the dbg output file and generates the primary delegates/functions/classes that the quest system revolves around.

Currently Entity, Mob, Client, Npc, EntityList, Inventory, ItemInst, Spells, and Zone are supported.

It loads your assembly into it's own appdomain and can unload it at will, so testing changes is as simple as #unload, copy assembly over, #reload.

All of the events that are passed through EventCommon are passed to the interop's EventManager class for potential interception. You can access the EventManager and subscribe to the events there and then handle it how you'd like to.

This is an example of my SpellHandler class that handles Spell events.

http://pastebin.com/4DeHbfeh

This is the SpellEventArgs class.

http://pastebin.com/dmLv4xav

As you can see here, it contains all the necessary information to handle a spell event properly, including access to the spdatstruct of the spell that was cast as well as the x, y, and z location it might have been targeting using the FreeSpell targeting type.

Here is an example class of one of the test spells I've created, that works using the api of the inerop.

http://pastebin.com/ZB2pH3f7

All of these methods are calling the respective native functions in the processes' memory, the classes are just wrappers that organize things well. I've added extensive support for custom marshal requirements for strings, structs, etc.

For instance this was generated by my interop builder inside of the Mob class:

public StatBonuses GetSpellBonuses()
{
var constStatBonusesPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(StatBon uses)));
var ret = (StatBonuses)Marshal.PtrToStructure((Functions.f_M obGetSpellBonuses((IntPtr)this, constStatBonusesPtr)), typeof(StatBonuses));
Marshal.FreeHGlobal(constStatBonusesPtr);
return ret;
}

the C++ version:

inline StatBonuses GetSpellBonuses() const { return spellbonuses; }

I hope to be able to make this as portable as possible, but I also have a lot of stuff going on in real life. So bare with me!

Last edited by Lecht; 09-29-2013 at 08:13 PM.. Reason: Wanted to provide a little more information
Reply With Quote
  #2  
Old 10-01-2013, 12:44 AM
Stabones
Fire Beetle
 
Join Date: Oct 2013
Location: United States
Posts: 17
Default

Pretty tight.

If you need a hand, I am more than capable pf providing one.

Stabones
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 02:56 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3