Ejemplo n.º 1
0
 private void connection_LoginRecoveryRequested(LoginResponse response)
 {
     if (response != null)
     {
         CafeAuth cafeAuth = null;
         if (this.NxIDToEntityDic.TryGetValue(response.NexonID, out cafeAuth))
         {
             if (response.Result == AuthorizeResult.Allowed)
             {
                 cafeAuth.FrontendConn.RequestOperation(new NotifyCafeAuthResult());
             }
             if (response.Result == AuthorizeResult.Forbidden || response.Result == AuthorizeResult.Terminate)
             {
                 SendPacket op;
                 if (response.Option == Option.AccountShutdowned || (response.ExtendInfos != null && response.ExtendInfos.IsShutDownEnabled))
                 {
                     op = SendPacket.Create <SystemMessage>(new SystemMessage(SystemMessageCategory.Notice, "GameUI_Heroes_Policy_Shutdown"));
                 }
                 else if (response.ExtendInfos != null && response.ExtendInfos.IsShutDownEnabled)
                 {
                     op = SendPacket.Create <SystemMessage>(new SystemMessage(SystemMessageCategory.Notice, "GameUI_Heroes_Policy_IPBlocked"));
                 }
                 else
                 {
                     op = SendPacket.Create <SystemMessage>(new SystemMessage(SystemMessageCategory.Notice, "GameUI_Heroes_Cafe_Expired"));
                 }
                 cafeAuth.FrontendConn.RequestOperation(op);
                 Scheduler.Schedule(base.Thread, Job.Create <CafeAuth>(new Action <CafeAuth>(this.Kick_User), cafeAuth), 5000);
             }
             cafeAuth.SessionNo = response.SessionNo;
             this.WaitQueue.Remove(cafeAuth);
             cafeAuth.SetValid();
         }
     }
 }
Ejemplo n.º 2
0
        private void TryLogin(CafeAuth entity)
        {
            AsyncResultSync sync = new AsyncResultSync(base.Thread);

            sync.OnFinished += delegate(ISynchronizable __)
            {
                if (sync != null && this.WaitQueue.Contains(entity))
                {
                    LoginResponse loginResponse = this.connection.EndLogin(sync.AsyncResult);
                    if (loginResponse != null)
                    {
                        if (loginResponse.Result == AuthorizeResult.Allowed)
                        {
                            entity.FrontendConn.RequestOperation(new NotifyCafeAuthResult());
                        }
                        if (loginResponse.Result == AuthorizeResult.Forbidden || loginResponse.Result == AuthorizeResult.Terminate)
                        {
                            SendPacket op = SendPacket.Create <SystemMessage>(new SystemMessage(SystemMessageCategory.Notice, "GameUI_Heroes_Cafe_Expired"));
                            entity.FrontendConn.RequestOperation(op);
                            Scheduler.Schedule(this.Thread, Job.Create <CafeAuth>(new Action <CafeAuth>(this.Kick_User), entity), 5000);
                        }
                        entity.SessionNo = loginResponse.SessionNo;
                        this.WaitQueue.Remove(entity);
                        entity.SetValid();
                    }
                }
            };
            this.connection.BeginLogin(entity.NexonID, entity.CharacterID, entity.LocalAddress, entity.RemoteAddress, entity.CanTry, entity.IsTrial, entity.MID, (entity.GameRoomClient == 0) ? null : new int[]
            {
                entity.GameRoomClient
            }, new AsyncCallback(sync.AsyncCallback), entity);
        }