Re: Bug in Player State

From: George Greer (greerga@circlemud.org)
Date: 12/20/99


On Tue, 21 Dec 1999, Brandon Phelps wrote:

>First of all i want to say that It's an honor talkin to THE greerga
>himself, hehe OK now for the real email... Why is it that normally then
>if i get disconnected as long as I'm not in olc (or at the main menu
>even) when I reconnect it connects fine and says "You take over your
>body, already in use..."

The duplication bug only manifests itself when your character is in the
login stages of the game.  When you are in CON_PLAYING, it is safe to
reconnect.  The CircleMUD code checks for != CON_PLAYING when deciding
that.  Technically, OasisOLC should have modified Valid_Name() in ban.c to
test for != CON_PLAYING and all of the other OLC states since they don't
have that problem.  In fact, there is already an IS_PLAYING() macro in
utils.h to do so.

diff -up OasisOLCv2.0/ban.c OasisOLCv2.0.1/ban.c
--- OasisOLCv2.0/ban.c  Tue May  4 00:36:36 1999
+++ OasisOLCv2.0.1/ban.c        Tue Dec 21 01:50:41 1999
@@ -263,7 +263,7 @@ int Valid_Name(char *newname)
    */
   for (dt = descriptor_list; dt; dt = dt->next)
     if (dt->character && GET_NAME(dt->character) && !str_cmp(GET_NAME(dt->character), newname))
-      return (STATE(dt) == CON_PLAYING);
+      return (IS_PLAYING(dt));

   /* return valid if list doesn't exist */
   if (!invalid_list || num_invalid < 1)

It appears to compile, so it should work. ;)

--
George Greer            | CircleMUD Community Resources
greerga@circlemud.org   | http://www.circlemud.net/


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



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