Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ Dynamically-Called Functions?

Dynamically-Called Functions?

It is now over 60 days since the last post. This thread is closed.     Refresh page


Pages: 1  2 

Posted by Orange   United Kingdom  (25 posts)  Bio
Date Reply #15 on Wed 01 Jan 2003 12:44 PM (UTC)
Message
Certainly. You can start debugging and find out which function call is returning NULL. If that's beyond you at the moment then function pointers probably are too.
Top

Posted by Kris   USA  (198 posts)  Bio
Date Reply #16 on Wed 01 Jan 2003 07:22 PM (UTC)
Message
log_string is a void function; it's supposed to return NULL. As for the dlopen and such, I have no idea what those are, let alone how to debug them.

It is essential that I get this dynamic function call thing to work. Although I have no experience with that, I can figure it out with a little help hehe. I just want it to work! =)
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #17 on Thu 02 Jan 2003 07:50 AM (UTC)
Message
Do you want to be able to call arbitrary functions, or from a known list? Do they need to share all the address space of the main server? Maybe you can spawn off another process and pipe things to it.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Kris   USA  (198 posts)  Bio
Date Reply #18 on Thu 02 Jan 2003 09:52 AM (UTC)
Message
Ok remember that Secondary Command Processor idea I was spinning around? Ya know, a seperate process; stripped-down version of the mud that shares a bit of memory with the primary mud server. I made a post about it back in October I think.

Two things would have to exist for that to really work (I would distribute it as a snippet if it proved viable). First of all would be the shared memory. That's something I'm still researching, but it looks like it can be done under windows. The second would be the ability to call functions in the other process (i.e. call "send_to_char" from the secondary command processor). In order to do that, the process can send a string to the other process via the shared structure, which would then be used to call the function name equal to that string.

So yah, to make it fully flexible and useful, it would have to be dynamic (or 'arbitrary' as you put it). I.e. I would have to be able to call any function that exists on the other mud, without having to maintain an extensive (and cumbersome) list.

Where should I go from here in order to get the dynamic function thingie to work?
Top

Posted by Meerclar   USA  (733 posts)  Bio
Date Reply #19 on Thu 02 Jan 2003 05:40 PM (UTC)
Message
What you describe sounds looks like it would require pretty well writing a fullscale mud from scratch simply to handle the function calls from your original world. The *cough* easy *cough* way would be to convert everything to a database and have the sub process handle calls thru the database but even that is going obscenely difficult to accomplish. I rather suspect any speed you gain in doing this will be neglegable under all but the most extreme of circumstances unless yer trying to run your mud on a 486/33SX with 8MB of RAM. Any computer with a pentium processor or better and a decent amount of RAM(128 minimal) should be able to handle the demands of a mud pretty well seamlessly.

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
Top

Posted by Kris   USA  (198 posts)  Bio
Date Reply #20 on Thu 02 Jan 2003 10:07 PM (UTC)
Message
I'm not doing this for speed. One benefit, for example, is the ability to add/change code in the mud without having to shut it down. I'd just have to have the secondary command processor go offline for a few seconds while it recompiles.

It won't require the creation of a new codebase either. I'll add a function that does all the handling/communication with the SCP, which will be called in game_loop of comm.c. That should be easy enough to work through.

Again, the only thing standing in my way is this dynamic function thing! I need to get past this brick wall before I can do anything else.

How can I get this dynamic function call stuff to work under cygwin????
Top

Posted by Meerclar   USA  (733 posts)  Bio
Date Reply #21 on Thu 02 Jan 2003 10:33 PM (UTC)
Message
You said at one point you have the ability to copyover, why do you need to shutdown to update code? As for making such a project work under Cygwyn, everything I can find seems to indicate it won't work under Cygwin. MSVC should be able to handle it but Cygwin doesnt seem to have the capability to handle the necessary call functions to communicate between the seperate processes.

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #22 on Thu 02 Jan 2003 11:15 PM (UTC)
Message
Again I think you could do this sort-of by piping requests to a separate process, the separate process could be restarted. Sounds a big job, and I don't have Cygwin with me right now to try ideas out.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Kris   USA  (198 posts)  Bio
Date Reply #23 on Fri 03 Jan 2003 03:15 AM (UTC)
Message
Hmm I'll look around some more about the cygwin function thing. It sounds like a basic enough thing, and I'm sure somebody has to have done it before.
Top

Posted by Kris   USA  (198 posts)  Bio
Date Reply #24 on Fri 03 Jan 2003 04:52 AM (UTC)
Message
Man I'm having trouble just finding an appropriate search pattern.... Skimming through google, I managed to figure out how to do it in about 3 other programming languages, but not C....

Asked over IMC, but the only people who spoke up were Samson and Orion, neither of whom had a clue.

So my frusterating search continues.... I know there HAS to be a way to accomplish this somehow....
Top

Posted by Samson   USA  (683 posts)  Bio
Date Reply #25 on Mon 20 Jan 2003 02:35 AM (UTC)

Amended on Mon 20 Jan 2003 02:51 AM (UTC) by Samson

Message
Ever the spin doctor there eh Kris? No, we aren't clueless. It has more to do with the fact that, well, we just don't like you. There. It's been said. Now with that out of the way.... yes, it can be done. You simply weren't willing to do the minimal amount of research needed to uncover your solution. I'm not going to tell you here since you've decided to try and run your smear campaigns again.

To everyone else, apologies for having to vent on him here. I'm sure if you all knew just how much of a pain he's made of himself on IMC over every last little thing, code related or otherwise, you'd understand.
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


80,876 views.

This is page 2, subject is 2 pages long:  [Previous page]  1  2 

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.