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

Archive::Development Archive area for Development's posts that were moved here after an inactivity period of 90 days.

Reply
 
Thread Tools Display Modes
  #1  
Old 04-05-2004, 02:53 PM
m0oni9
Hill Giant
 
Join Date: Dec 2003
Posts: 166
Default

I am hesitant to say that perl currently "calls back" to C. This is the process, which I think you have right:
  • -server calls perl function
    -perl function (ie: EVENT_SAY) adds functions/variables to cmd_queue
    -perl function ends
    -server runs through cmd_queue, processing each function
So, there are two big reasons for callbacks: First, to call C functions and get data back immediately; second, to get rid of a lot of overhead.

I actually just submitted a patch that deals with the command queue here: http://www.eqemulator.net/forums/viewtopic.php?t=13906. It effectively makes SendCommands() a re-enterable function.

As far as perl calling C code, I have done this. It's been a little bit since I have looked at it, so I am a bit fuzzy, but involves XS to make the glue between perl and C. I have been able to incorporate just about all of this into the server code itself, so no external library is needed.

However, one of the things I have done is inject the "require MODULE.pm;" statement into a C perl-eval (needed so perl knows how to use package). This in turn tries to load MODULE.pm from disk. I have not been able to find a way to completely hide this in the server code. As things are now, it is all in the server code, except for that external file.

I am again looking through the different perl man pages. I think the answer may be in perlcall, which I may have overlooked before. It seems there is another way to do this. By all means investigate and try things. I am still not comfortable with all this Perl/C/XS stuff. I have only been trying to figure it out because I think it would be a huge boon to perl quests, and nobody is really doing anything with it..

In case you have not seen these, I offer some references that I have used:
I have tried to keep the posts central, but I have done a poor job of it. :cry: I am usually on the eqemu irc server in #ProjectEQ and #npcmovdb lately, nickname bleh if you are interested in that.
Reply With Quote
Reply

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

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 05:47 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 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3