示例#1
0
 public void Logout()
 {
     using(Log.Scope())
     {
         Log.Debug("logout");
         if(this.UserId <= 0)
             return;
         if(this.sink >= 0)
         {
             updater.Dispose();
             updater = null;
             Server.UnregisterListener(this.sink, this.security);
             this.sink = -1;
         }
         Server.Logout();
         this.UserId = 0;
     }
 }
示例#2
0
 public long Login(string login, string password)
 {
     using(Log.Scope())
     {
         Log.Debug("Login {0}", login);
         this.UserId = Server.Login(login, password);
         Server.RegisterListener(out this.sink, out this.security);
         updater = new ChangesUpdater(Server.Url, login, password, sink, security);
         return this.UserId;
     }
 }