Re: Ok, next question. (fwd)

From: Jeff (jfink@csugrad.cs.vt.edu)
Date: 09/08/94


"Robert A. Vegas" <rovegas@cs.nmsu.edu> writes:
> Uh, correct me if I'm wrong, but Jeff says that RIGHT NOW, the way the 
> code is at this MOMENT, it saves a player when entering AND when leaving 
> the game. Now, why would it do this? Sure the player has read the message 
> of the day but I think you missed my point. The point is, what is the 
> need for saving a player when you enter and leave a game? Leaving 
> sure...but entering?!?! There is NO code for whether the MOTD has been 
> read or not in there yet...

Here's 3 lines of code from the Circle 3.0 BETA, that fall in interpreter.c
and explain exactly what I was talking about:


      if ((load_result = Crash_load(d->character)))
        d->character->in_room = NOWHERE;
      save_char(d->character, NOWHERE);


This does a few things, most notably, setting the character's object file
to crash rent instead of regular rent, right after loading them.  I think
you'll find that these three lines of code exist in just about anybody's
version of Circle (they're in my version of v2.01).  Now, if we go back
to the original question (how do you modify MOTD to show only once), you'd
go into the Crash_load routines until you found store_to_char(), and make
sure the last on time was loaded from disk rather than updated to the
current clock.  Then you'd add a line before the save_char in interpreter
to set a local variable equal to that clock, and then once you fell down
to the MOTD part, you'd check the local variable to see if you should show
the MOTD.

-Jeff



This archive was generated by hypermail 2b30 : 12/07/00 PST