def disconnect(self, session, reason=""):
        """
        Called from server side to remove session and inform portal
        of this fact.

        Args:
            session (Session): The Session to disconnect.
            reason (str, optional): A motivation for the disconnect.

        """
        session = self.get(session.sessid)
        if not session:
            return

        if hasattr(session, "player") and session.player:
            # only log accounts logging off
            nsess = 1 - len(self.sessions_from_player(session.player))
            string = "Logged out: {player} {address} ({nsessions} sessions(s) remaining)"
            string = string.format(player=session.player, address=session.address, nsessions=nsess)
            session.log(string)

        session.at_disconnect()
        sessid = session.sessid
        del self[sessid]
        # inform portal that session should be closed.
        self.server.amp_protocol.send_AdminServer2Portal(session,
                                                         operation=SDISCONN,
                                                         reason=reason)
dataset/ETHPy150Open evennia/evennia/evennia/server/sessionhandler.py/ServerSessionHandler.disconnect/swapped operands of `-`