Page 1 of 1

Permadeath and segfault

Posted: Fri Nov 01, 2013 7:57 pm
by SilverNexus
When a character is killed on a permadeath server, his/her name still is listed in the character selection dialog after the player is returned to the character selection screen. Selecting the dead character causes the selection dialog to go away and prompt the user for his/her password in the messages area of the client (like the old way would have to confirm a new character's password). When the user enters a password, the server segfaults after giving this error:

Code: Select all

13/11/01 14:15:13 [Error]   BUG: process_events(): Object without map or inventory is on active list: TestDummy (23386)
I am using a stock trunk server, version 1.70.0-r19089 with permadeath enabled (someone I know was planning on doing a YouTube "hardcore" series).

As far as I can tell, the server is acting appropriately, as the character no longer exists. The problem appears to be that the client still displays the dead character as an option in the first place.

Posted: Mon Nov 04, 2013 11:52 pm
by Leaf
I moved this to the SF project page as a bug report.

https://sourceforge.net/p/crossfire/bugs/762/

Posted: Thu Nov 07, 2013 11:09 pm
by SilverNexus
Is there a way for the server to request the account name from the client?

I know there are several instances where the server is given the account name, but I'm not sure whether or not the server can fetch that information at-will.

If there isn't, I might have to make a character array/pointer to the account the character is from in the player structure, just so that the accounts file can be updated when a character dies in permadeath.

Maybe the delete_character() function has some useful information for this. If only I could find it...

Posted: Fri Nov 08, 2013 11:07 pm
by SilverNexus
I found the account name in the player structure. (pl->socket.account_name)

As such, I just need to make a way for the dead character to be revived with the appropriate effect on the account file.

I was thinking that either an extra defined variable in the pl_corpse archetype containing the account name or an additional file (in the var/crossfire folder) that lists the names of dead players and the accounts they are tied to.
If there is an unused char* variable in the making of pl_corpse, that seems like an easier way to implement this than making a whole new file it would have to sift through every death and resurrection.

Any thoughts on these ideas?

Posted: Sat Nov 09, 2013 12:25 am
by SilverNexus
In the end, I chose an attribute in the pl_corpse.
Specifically, I am currently using slaying, but can change it to something else should there be some weird effects from using that variable.

Posted: Sun Nov 10, 2013 7:56 am
by SilverNexus
Patch committed to r19105.