I'm new to the list. I'm a very experienced coder, and system
administrator. But I grew out of actually playing muds a long time ago.
My main interest in CircleMUD is to get ideas from the code on how to
implement a multiplayer game, and how to go about making it fun. The game
I am developing will be MUD-like in that I am trying to capture the same
freedom of action and community, but it certainly will not be text-based.
However, my code does not exclude the possibility of having a text-based
interface, so a MUD could definitely be written from my design.
I joined the list in case there was anything I didn't understand about the
code. All in all however it seems to be very well designed, because I
understood most of the design after reading the code for about 30 minutes.
I have one question thats been bothering me, and then I'll lurk some more
^_^
In the file with main(), comm.c I believe, there is a utility function
that says it was rewritten to stop a warning (passing a structure back on
the stack, or temporary area I believe), but is says that they sacrificed
thread safeness to do it. Its not thread safe because it keeps its return
value in a static structure. Why not just add a parameter to the function
that points to where to put the answer?
do this:
void function(int x, y, z, struct mystruct *my)
{
my->answer = x + y + z;
return;
}
you would call this like this:
main()
{
struct mystruct my;
function(1, 2, 3, &my);
}
instead of this:
struct mystruct *function(int x, y, z)
{
static mystruct my;
my.answer = x + y + z;
return &my;
}
which is called like this:
main()
{
struct mystruct *my;
my = function(1, 2, 3);
}
Its just a nit-pick. I was just wondering if there was a reason that it
was done this way? The way I propose is also the most efficient. So that
doesn't seem to be an issue. It seems to just be laziness, I understand
completely. Make the change that will cause you to change the least code.
Later,
Fenix.
--
The Phoenix - President of The Artistic Intuition Company
Caelius * Zen-X * Mirror Reflex * Runica * X-Domain * Infinite Realms
http://www.io.com/~fenix
+------------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
| http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
+------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/15/00 PST