This should be added to the code at the server! If any player in a pve map that makes no activities for a few second (for example 2000ms), the server should shield the player until the server detects any activities. The server already has disconnection detection at 2 mins I beleive.

This is not related to AFK since the server does not disconnect AFK players. Although, in a pve map, an AFK player should be disconnected if he/she is not in a party.