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


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  SMAUG coding
. . -> [Subject]  char_leaving

char_leaving

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Klered   (24 posts)  [Biography] 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 ->

char_leaving( ch, 4 );

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
char_leaving 
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
[Go to top] top

Posted by Greven   Canada  (835 posts)  [Biography] 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
[Go to top] top

Posted by Klered   (24 posts)  [Biography] 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
[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.


11,293 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

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

[Best viewed with any browser - 2K]    [Hosted at HostDash]