[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  SMAUG coding
. . -> [Subject]  Corpse making

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: Corpse making
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please).
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Pages: 1 2  3  

Posted by Metsuro   USA  (389 posts)  [Biography] bio
Date Thu 13 Jul 2006 04:14 PM (UTC)  quote  ]
Message
Objs: 48(29)
this is what happened after one of my players logged on an killed one of the mobs about 5 times. first number went up 5 from the blood she created, then 4 for the items she wearing? but if so that only accounts for the 48 and not the 29?

Everything turns around in the end
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Thu 13 Jul 2006 04:06 PM (UTC)  quote  ]
Message
It might be 39 logical objs, but 21 object structure instances. Recall that objects can be grouped together ("stacked").

One thing you can try is just create corpses several times and see if that number goes up incorrectly or varies in some unexpected way. If it does, then you have a problem.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Metsuro   USA  (389 posts)  [Biography] bio
Date Thu 13 Jul 2006 04:02 PM (UTC)  quote  ]
Message
No i didn't, it was already there. The only thing I dont really know if its working correctly or not is this loaded objs business. In memory i have

IdxObjs: 88 Objs: 39(21)

Me being the only one on this confuses me some what. so theres 21 objects in the world but 39 ob those objs are worn or in another object? or is it 21 in the world that arn't worn or in something, and 39 that are worn and in something?

Everything turns around in the end
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Thu 13 Jul 2006 03:58 PM (UTC)  quote  ]
Message
Well, it's still very hard to say if it would work because we can only partially see the code, so . . . when you run the code, does it do what you expect?

If you want to see if you have leaks, you can run a tool like valgrind, if you have it available on your system.

By the way, did you put in that if (!victim) check in fight.c?

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Metsuro   USA  (389 posts)  [Biography] bio
Date Thu 13 Jul 2006 03:45 PM (UTC)  quote  ]
Message
the only change to extract_char is that it is now new_extract_char, with the bool for it. then the one if check if its death or not. everything else calls extract_char which then calls new_extrac with false for death, however in fight.c

   set_char_color( AT_DIEMSG, victim );
   if( victim->pcdata->mdeaths + victim->pcdata->pdeaths < 3 )
      do_help( victim, "new_death" );
   else
      do_help( victim, "_DIEMSG_" );

   new_extract_char( victim, FALSE, TRUE );
   if( !victim )
   {
      bug( "%s: oops! extract_char destroyed pc char", __FUNCTION__ );
      return;
   }


which is the only call that should tell extract that death is true.

Everything turns around in the end
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Thu 13 Jul 2006 03:32 PM (UTC)  quote  ]
Message
It's basically impossible for us to say what is going to happen when we don't know what exactly has been changed and we see bits of code here and there. I mean, sure, for the code you posted, it looks like if the variable death is false, every one of the character's objects will be extracted. Whether or not this actually does what you want it to do in the greater scheme of things is a good question. It depends on when 'death' is set to true or false, and what you have changed in other places of the code.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Metsuro   USA  (389 posts)  [Biography] bio
Date Thu 13 Jul 2006 03:26 PM (UTC)  quote  ]
Message
the changes I made I understand what its doing. Its tacking on an extra arguement, so that you can declare if you died or not. now, in the other copy they use

#define extract_char( ch, fPull ) new_extract_char( ch, fPull, FALSE)

which will return the bool death, false right, every time extract_char is called. however when new_extract_char is called with the last being TRUE then...

   if( !death )
   {
      while( ( obj = ch->last_carrying ) != NULL )
      extract_obj( obj );
   }


only work on logout, and not on death. Which then stops the memory problem right? but doesn't remove the eq on death correct? Sometimes I seem random sometimes I dont, it usually depends on how tired I am... heh... sorry.

Everything turns around in the end
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Thu 13 Jul 2006 12:55 PM (UTC)  quote  ]
Message
I think you need to slow down a bit and learn what these functions are actually doing, how, and why. I have the impression that you're making changes almost randomly, throwing in lines and seeing what happens. That will only cause trouble further down the line. Take the time to learn a bit before charging ahead, and you will get much more out of the exercise.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Metsuro   USA  (389 posts)  [Biography] bio
Date Thu 13 Jul 2006 09:22 AM (UTC)  quote  ]
Message
well I just changed extract_char, to the new_extract_char from dbsc copies, adding a bool death at the end, and then adding an if check before the while.

Everything turns around in the end
[Go to top] top

Posted by Metsuro   USA  (389 posts)  [Biography] bio
Date Thu 13 Jul 2006 08:38 AM (UTC)  quote  ]
Message
having this in causes everything a player is wearing to be removed, And then only places the inventory in the corpse, but removes all eq worn, removing this however doesn't do it. So either i'm missing something far off or what.

Everything turns around in the end
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Thu 13 Jul 2006 05:01 AM (UTC)  quote  ]
Message
It would really mess up item counts, since the object would basically be floating in space, not in any room, inventory, container, etc. Rare items based on item-count would be affected, for example.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Gohan_TheDragonball   USA  (183 posts)  [Biography] bio
Date Thu 13 Jul 2006 04:44 AM (UTC)  quote  ]
Message
no that would only extract the objects when a player dies, however when a player quits fPull is true, so that portion would not be run, and its not really an issue of players getting items duplicated, its more the item remain in memory, take a look at your MEMORY command to see how many actual items are loaded in the game, if you do not extract the objects from memory when a player quits, that amount will grow and grow. though truthfully i know not what that would do in the short term, but if your mud is stable and doesn't crash all too often a problem might arise.
[Go to top] top

Posted by Metsuro   USA  (389 posts)  [Biography] bio
Date Wed 12 Jul 2006 11:41 PM (UTC)  quote  ]
Message
Doesn't your suggestion of adding...

     for ( obj = ch->first_carrying; obj; obj = obj_next )
      {
            obj_next = obj->next_content;
            if ( obj->wear_loc != -1 )
                continue;
            obj_from_char( obj );
            extract_obj( obj );
      }


doesn't it do what the while does already? so what would be the point of adding it once more? and as of right now I havn't seen any problem with duplicated eq, or even lose of eq after dying or quitting? so many I am just missing something, or that your suggestion already does this for me?

Everything turns around in the end
[Go to top] top

Posted by Gohan_TheDragonball   USA  (183 posts)  [Biography] bio
Date Wed 12 Jul 2006 08:35 PM (UTC)  quote  ]
Message
umm no, you do not want to comment that out, move it below the ifcheck, you don't want all those objects remaining when a player quits, they need to be extracted
[Go to top] top

Posted by Metsuro   USA  (389 posts)  [Biography] bio
Date Sun 09 Jul 2006 09:22 PM (UTC)  quote  ]
Message
   xREMOVE_BIT( ch->act, ACT_MOUNTED );

   while( ( obj = ch->last_carrying ) != NULL )
      extract_obj( obj );

   char_from_room( ch );


well I finally noticed that this was right above the if check for !fPull, so I commented out just the while thing and it seems to work properly

Everything turns around in the end
[Go to top] 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.


7,895 views.

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

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]