Ejemplo n.º 1
0
        public void Disconnect()
        {
            try
            {
                if (Stage == ProtocalStage.Disconnected)
                {
                    return;
                }
                Save();
                Stage = ProtocalStage.Disconnected;
                if (Account != null)
                {
                    DisconnectFromRealm();
                }

                Socket.Close();

                if (!ClientDatabase.disposed && ClientDatabase != null && ClientDatabase.con != null)
                {
                    ClientDatabase?.Dispose();
                    ClientDatabase = null;
                }
            }
            catch (Exception e)
            {
                log.Error(e);
            }
        }
Ejemplo n.º 2
0
 public void Dispose()
 {
     if (Stage != ProtocalStage.Disconnected)
     {
         return;
     }
     handler?.Dispose();
     Account   = null;
     Character = null;
     handler   = null;
     Player?.Dispose();
     Player = null;
     ClientDatabase.Dispose();
     ClientDatabase = null;
 }