Rejoining game after crash/disconnect

RigorRigor Join Date: 2011-02-05 Member: 80545Members
How tough would it be to modify the server code to recognize when a player reconnects to the server? I get a crash to desktop often enough that it would be nice if the server would give me a period of time to reconnect, realize I'm a player that went link dead and place me 1) back on the correct team and 2) keep my stats intact, including plasma count, score, kills, deaths, etc.

There should be two thresholds. First, to protect busy/full servers, there should be a less forgiving timer of 90 seconds after which your player slot becomes eligible to a new player if there are no other slots available on the server. If player slots are not exhausted, the timer should run to a total of 180 seconds during which you can resume your position on the server with your stats intact.

Nothing irritates me more than being dropped from a good game except when I rejoin and cannot even evolve to a Lerk or afford a shotgun.

Though it's a different issue, the server code needs to be changed to prevent someone from switching teams when it would imbalance the teams. For example, if the teams are 5vs5, I can join the opposite team, causing it to become 4vs6. The RR won't allow this, but you can get around it when you're already on a team.

Comments

  • ScardyBobScardyBob ScardyBob Join Date: 2009-11-25 Member: 69528Forum Admins, Forum Moderators, NS2 Playtester, Squad Five Blue, Reinforced - Shadow, WC 2013 - Shadow
    +1

    General disconnect protection would be great. The most frustrating thing is commanding a winning team, crashing, and then being unable to rejoin my original team. Though, fixing the crashes should probably be the priority.
  • HarimauHarimau Join Date: 2007-12-24 Member: 63250Members
    +1 on the idea, regardless of crashing. HoN does this, and it's excellent.
  • Racer1Racer1 Join Date: 2002-11-22 Member: 9615Members
    Agreed. The only potential problem is if someone disconnects on purpose, so their Onos doesn't get killed. There would have to be some kind of delay (perhaps 15 seconds) that it waits after you disconnect before removing your character from its last location. If it is killed during this time, you loose those those upgrades.
  • playerplayer Join Date: 2010-09-12 Member: 73982Members
    A good idea indeed, and actually quite easy to pull off. As Racer1 pointed out, keeping weaponry\classes intact upon reconnect might not work out well (abuse), and putting in a delay before physically removing your model from the world will end up causing quite a lot of confusion (crashes\timeouts are sporadic events after all, and shouldn't effect the battlefield in such a way).

    I'll dot it down as a pending feature for GmOvrmind if Rigor would be so gracious.
  • RigorRigor Join Date: 2011-02-05 Member: 80545Members
    What happens today when you lose connection? Your character goes stiff and you're an easy kill. As an alien you never respawn and as a Marine, you spawn and sit in the IP.

    That reminds me, we really need to bring back IP insta-frag and it should be deadly to members of either team. The spinning "arm" on the IP should also "bat" a skulk/lerk/gorge away, just for humor's sake. Both "features" prevent spawn camping.

    I don't care to come back as an onos if I lost connection, unless of course I reconnect in time that nobody killed me and I didn't time out.

    However, what IS important:

    <ol type='1'><li>I come back with all my stats intact (deaths/kills)</li><li>I come back with all my personal resources intact</li><li>I don't have to wait for my old session to timeout before I can reconnect to the full server</li><li>I get my slot back in the case of a full server</li><li>I get back in with my name intact</li></ol>

    If I get back in and find that my upgrades onos was killed, AT LEAST I may still have the resources to evolve again. Otherwise, it's skulk duty for 10 minutes. That of course depends on if the server was full and if someone got your slot between the time when your session timed out and you attempted to reconnect.
  • ShiloriusShilorius Join Date: 2011-01-14 Member: 77445Members, Reinforced - Shadow
    edited February 2011
    <!--quoteo(post=1832055:date=Feb 14 2011, 05:44 AM:name=Rigor)--><div class='quotetop'>QUOTE (Rigor @ Feb 14 2011, 05:44 AM) <a href="index.php?act=findpost&pid=1832055"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->1. I come back with all my stats intact (deaths/kills)
    2. I come back with all my personal resources intact
    3. I don't have to wait for my old session to timeout before I can reconnect to the full server
    4. I get my slot back in the case of a full server
    5. I get back in with my name intact<!--QuoteEnd--></div><!--QuoteEEnd-->

    +1
    exactly my thaught.


    A few games back I was the last marine at the last hive.. 2 shots with my shotgun would have endet the game.
    Then the game crashed.
    after 10 minutes of rejoin attempts I was back in marine team only to see our base going down...
    I was not able to do anything against it because I had not enough plasma to rearm.
    (the pea shooter rifle was not enough to fight 2 fades)
    That was frustrating!
  • RigorRigor Join Date: 2011-02-05 Member: 80545Members
    <!--quoteo(post=1830255:date=Feb 7 2011, 11:54 AM:name=player)--><div class='quotetop'>QUOTE (player @ Feb 7 2011, 11:54 AM) <a href="index.php?act=findpost&pid=1830255"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->A good idea indeed, and actually quite easy to pull off. As Racer1 pointed out, keeping weaponry\classes intact upon reconnect might not work out well (abuse), and putting in a delay before physically removing your model from the world will end up causing quite a lot of confusion (crashes\timeouts are sporadic events after all, and shouldn't effect the battlefield in such a way).

    I'll dot it down as a pending feature for GmOvrmind if Rigor would be so gracious.<!--QuoteEnd--></div><!--QuoteEEnd-->

    Please do!

    I'd love to see this incorporated in a build or two from now. This is the only thing about the game that really frustrates me.
  • RigorRigor Join Date: 2011-02-05 Member: 80545Members
    player, I notice that when this happens, the server seems to leave your session intact until it times out at the server. What is currently missing is the ability for the server code to realize that a session it's holding for timeout was "owned" by the same user who is now connecting with a new session.

    Today, it either:

    Denies you access because the server is full since your original session is still occupying a slot
    OR
    Connects you to the server and forces a name change and your original session stays until it times out

    I assume you cannot help with that behavior, but what you could do is detect a reconnect from a player that dropped <i>y</i> seconds ago and grant them the resource count they had before they dropped. Is that what you were thinking?

    Or can you actually interact with connection attempts, forcing the server to immediately terminate the original dropped session and then accept the request from the player who is reconnecting? I'm going to assume you cannot interact with this server behavior.
  • playerplayer Join Date: 2010-09-12 Member: 73982Members
    <!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->I assume you cannot help with that behavior, but what you could do is detect a reconnect from a player that dropped y seconds ago and grant them the resource count they had before they dropped. Is that what you were thinking?<!--QuoteEnd--></div><!--QuoteEEnd-->
    That was exactly what I was thinking.

    <!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->Or can you actually interact with connection attempts, forcing the server to immediately terminate the original dropped session and then accept the request from the player who is reconnecting? I'm going to assume you cannot interact with this server behavior.<!--QuoteEnd--></div><!--QuoteEEnd-->
    As it stands, NS2-GmOvrmind(v4) will keep kicking you until your timed-out 'ghost' disappears from the server (it does this for stability reasons). The version I'm currently working on (v5) does it the other way around (kicks the timed-out 'ghost' when you're connected twice). However as you pointed out, a lot of the connecting-functionality is 'hidden' in the engine, and not accessible from the Lua-side of things. This includes detecting an incoming connection of a player BEFORE he has actually entered the game, which means the ghost-kicker I talked about just now, only works when the player was able to fully reconnect to the server again (meaning it won't work if the server was full when you dropped, as it will stay full and you can't reconnect).

    What might be possible is to improve the detection of timed-out clients, for example by imposing stricter ping-requirements (a ping that exceeds 3-5 seconds = an auto-kick). This is something I can implement and leave to the server-operator's discretion.
  • FehaFeha Join Date: 2006-11-16 Member: 58633Members
    edited February 2011
    I want a hook for the initial connect for players, which run before any action is done on the player (such as kicking because of a full server), aswell as a hook that runs after the server made sure someone can join, but before they actually got in (no need to validate and all that). Both hooks requires that the server knows the joiners steamid at that time.

    Apart from requesting hooks for the lua code, I also think that the engine should handle stuff like session problems by itself. If a player with same steamid as a "ghost" on the server joins, the engine should be able of either merging those sessions, or atleast kick the ghost in favor of the new guy (in this case stuff like merging plasma should be done clientside).
    Regardless of how the engine does it, there should also be a lua hook for such cases, so modders can handle rejoins from "crashes (disconnects that didnt terminate the session) separate to normal rejoins, as a disconnect might be exploited in some mods, but a crash is usually unintentionall.
  • playerplayer Join Date: 2010-09-12 Member: 73982Members
    There are quite a number of things I'd like to 'hook' into, among others the ones you mention. You are right that ideally the engine should handle crashes\ghosts on it's own, but I added a temp-fix anyway since it was causing problems for my mod.


    <!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->in this case stuff like merging plasma should be done clientside<!--QuoteEnd--></div><!--QuoteEEnd-->
    Plasma is stored on the server and imposed on the client, so I'm not sure what you ment there.
Sign In or Register to comment.