Yes, I hook the PawnLeavingGame method in the PlayerController and then expose the event to blueprints where I call my Save All Player Data And LogOut node. This will handle some disconnections, but other types of disconnections like system power failures will not trigger this event. So I have a SQL job that runs periodically (once a minute or so seems good) to remove any players that have not sent updates to the API within a certain amount of time. As you can see in the blueprint below, I expose the RPGCharacter object for you in blueprints. If your penalty for dying is not too high, I would check to see if the player was in combat and then automatically apply the penalty for dying, so that players will not log out as a means to circumvent dying. With accidental disconnections happening less and less with modern technology, I don’t think this would be that bad. You are free to choose whatever system you want to use though.
