Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ SMAUG
➜ SMAUG coding
➜ char_leaving
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Klered
(24 posts) Bio
|
Date
| Thu 15 Sep 2005 03:52 PM (UTC) Amended on Thu 15 Sep 2005 04:58 PM (UTC) by Klered
|
Message
| Hi.
When a player dumps out of the game, ie, do_quit, we have ->
but what I would like to do is dump the player back into a con_state somewhere in the nanny, specifically a new con_state to pick another player.
This bit below instead of using dumps them back into the nanny - but upon re-entering the game through our game menu results in a 'End of the World' message and Short-cutting not allowed =)
for(d = first_descriptor; d; d = d->next)
DESCRIPTOR_DATA *d;
/*24 = game menu*/
ch->desc->connected = 24;
d->connected = 24;
Can someone give me an overview of what I am looking at here as far as time to a)get a player back to constate 24, and be able to rejoin the game as is ... and...b)work out an account system?
Thanks,
Kl | Top |
|
Posted by
| Greven
Canada (835 posts) Bio
|
Date
| Reply #1 on Thu 15 Sep 2005 06:06 PM (UTC) |
Message
| Why are you looping through all of the descriptors and making everyone back to that con state? You would probably want to look at extract_char in handler.c, around this line:
if (ch->desc)
{
if (ch->desc->character != ch)
bug("Extract_char: char's descriptor points to another char", 0);
else
{
ch->desc->character = NULL;
close_socket(ch->desc, FALSE);
ch->desc = NULL;
}
}
The character will be completely dealt with(sort of, still hase to be freed, but thats handled else where), etc, but you still have their descriptor. You could just set the descriptor back to 24 and that SHOULD work, though completely untested.
As for an account system, I beleive that there are a couple snippets somewhere out there, but I highly recommend writing your own. I did this, and it is much better (IMHO) for what I need than the snippets. |
Nobody ever expects the spanish inquisition!
darkwarriors.net:4848
http://darkwarriors.net | Top |
|
Posted by
| Klered
(24 posts) Bio
|
Date
| Reply #2 on Thu 15 Sep 2005 06:17 PM (UTC) |
Message
| Thanks Greven I will take a look.
PS - You have mail.
KL | 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.
12,600 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top