Пример #1
0
 private void SessionLeave(USession sees)
 {
     Sessions.Remove(sees);
     OnSessionLeave?.Invoke(sees);
     if (Sessions.Count < 1)
     {
         OnUserLeave?.Invoke(this);
     }
 }
Пример #2
0
 public void AddSession(USession sess)
 {
     if (Sessions.FirstOrDefault((x) => x.Callback == sess.Callback) == null)
     {
         sess.OnLeave += SessionLeave;
         Sessions.Add(sess);
         sess.Callback.RLogin(new RUser(BaseUser, true));
         Console.WriteLine("SLogin: " + BaseUser.Login);
     }
 }