Crossfire Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CF: Disconnects and Saves



On Fri, 11 Dec 1998, Markus wrote:
> Just an idea:
> If a client disconnects,
> keep the player for some time at the position where he is and move him
> to a save place afterwards if he survived. so he could not crash the
> client to prevent death (he will still die) and he cannot get treasures
> twice.

This idea was not so stupid...  :-)

I know that it would require some changes to the server code because
several pieces of the current code assume that there is always a client
connected to a player, but consider the following scenario:

If the client disconnects (accidentally or on purpose), then the server
sets the player object in a special state, meaning that it is not
controlled anymore.  At the same time, the player count for that map is
decremented by one.  Everything continues as usual (i.e. the monsters can
attack the player).  Now, one of several things can happen:
1 - The client reconnects quickly and enters the corresponding player
    name and password.  In this case, the client regains control of the
    character.  This will take care of accidental disconnects.
2 - The player's HP reaches 0 because there were too many nasty monsters
    around.  The player dies and is moved back to the city.  This will
    take care of people who attempt to disconnect quickly when they are in
    trouble, hoping to come back to a safe place when they reconnect.
    This could be bad if the user is accidentally disconnected and cannot
    reconnect quickly enough, but that's life... (err... death, actually).
3 - The map is selected to be swapped out (after one minute or so) because
    there are no active players in this map and the missing player did not
    reconnect.  In this case, the server detects that there is one
    disconnected player on the map, and that player is moved to the city
    and saved there.  So if a player is disconnected while in a safe place
    (such as a treasure room) and does not reconnect, then he would be
    saved to an even safer place.

If I got it right, none of these cases would allow any duplication of
objects and this would also solve the problem of people waiting until a
treasure room resets (because a disconnected player would be moved back
to the city before the map resets).  This solution would prevent most
cheats from the client side, and at the same time be nice to people who
are accidentally disconnected.

I chose the delay between disconnection and "save in the city" to be the
map swapout time, because this could be interesting for multi-player
games: if someone is accidentally disconnected, then he would have more
time to reconnect as long as the other players are still playing that map.
But this also has some drawbacks: if one of the other players is nasty,
he could try to steal some equipment from the helpless victim... but he
would have to be quick because he does not know when the guy could
reconnect.  Another problem is that a map could be swapped out before its
time if some other maps are loaded and the server is running out of memory.
In this case, maybe there would not be enough time to reconnect after an
accidental disconnection, although the consequences of this are less
annoying than what happens with the current solution.

-Raphaël
-
[you can put yourself on the announcement list only or unsubscribe altogether
by sending an email stating your wishes to crossfire-request@ifi.uio.no]