Exemple #1
0
        private void processMessage(Option option, ExtendInformation extendInfo, int kickRemainMin, string nxID, bool kick)
        {
            this.NotifyMessage(option, extendInfo, kickRemainMin, nxID);
            CafeAuth cafeAuth;

            if (this.NxIDToEntityDic.TryGetValue(nxID, out cafeAuth))
            {
                cafeAuth.ReportCafeAuthMessage(option.ToString());
                if (kick)
                {
                    Scheduler.Schedule(base.Thread, Job.Create <CafeAuth>(new Action <CafeAuth>(this.Kick_User), cafeAuth), 5000);
                }
            }
        }
Exemple #2
0
        private void NotifyMessage(Option option, ExtendInformation extendInfo, int arument, string nxID)
        {
            CafeAuth      cafeAuth;
            SendPacket    sendPacket;
            bool          flag;
            SystemMessage systemMessage = null;
            Option        option1       = option;

            switch (option1)
            {
            case Option.NoOption:
            {
                if (extendInfo == null)
                {
                    break;
                }
                switch (extendInfo.ShutDownErrorCode)
                {
                case PolicyInfoErrorCode.Success:
                {
                    if (systemMessage != null)
                    {
                        if (this.NxIDToEntityDic.TryGetValue(nxID, out cafeAuth) && systemMessage != null)
                        {
                            sendPacket = SendPacket.Create <SystemMessage>(systemMessage);
                            cafeAuth.FrontendConn.RequestOperation(sendPacket);
                        }
                        if (this.ScheduleShutdownMessageNexonID.Contains(nxID))
                        {
                            flag = this.ScheduleShutdownMessageNexonID.Remove(nxID);
                        }
                        return;
                    }
                    DateTime shutDownTime = extendInfo.ShutDownTime;
                    if (extendInfo.ShutDownTime == DateTime.MinValue)
                    {
                        if (this.NxIDToEntityDic.TryGetValue(nxID, out cafeAuth) && systemMessage != null)
                        {
                            sendPacket = SendPacket.Create <SystemMessage>(systemMessage);
                            cafeAuth.FrontendConn.RequestOperation(sendPacket);
                        }
                        if (this.ScheduleShutdownMessageNexonID.Contains(nxID))
                        {
                            flag = this.ScheduleShutdownMessageNexonID.Remove(nxID);
                        }
                        return;
                    }
                    object[] month = new object[] { extendInfo.ShutDownTime.Month, extendInfo.ShutDownTime.Day, extendInfo.ShutDownTime.Hour };
                    systemMessage = new SystemMessage(SystemMessageCategory.Notice, "GameUI_Heroes_Policy_Shutdown_Notify_EndTime", month);
                    break;
                }

                case PolicyInfoErrorCode.CannotFindAgeInfo:
                {
                    systemMessage = new SystemMessage(SystemMessageCategory.Notice, "GameUI_Heroes_Policy_CannotFindAgeInfo");
                    goto case PolicyInfoErrorCode.Success;
                }

                case PolicyInfoErrorCode.CannotAutholizing:
                {
                    systemMessage = new SystemMessage(SystemMessageCategory.Notice, "GameUI_Heroes_Policy_CannotAutholizing");
                    goto case PolicyInfoErrorCode.Success;
                }

                case PolicyInfoErrorCode.BlockFromShutdownSystem:
                {
                    systemMessage = new SystemMessage(SystemMessageCategory.Notice, "GameUI_Heroes_Policy_Shutdown");
                    goto case PolicyInfoErrorCode.Success;
                }

                case PolicyInfoErrorCode.BlockFromSelectiveShutdownSystem:
                {
                    systemMessage = new SystemMessage(SystemMessageCategory.Notice, "GameUI_Heroes_Policy_SelectiveShutdown");
                    goto case PolicyInfoErrorCode.Success;
                }

                default:
                {
                    systemMessage = new SystemMessage(SystemMessageCategory.Notice, "GameUI_Heroes_Policy_CannotPlayGame");
                    goto case PolicyInfoErrorCode.Success;
                }
                }
                break;
            }

            case Option.AddressNotAllowed:
            {
                systemMessage = new SystemMessage(SystemMessageCategory.Notice, "GameUI_Heroes_Policy_IPBlocked");
                break;
            }

            case Option.AddressMaxConnected:
            {
                systemMessage = new SystemMessage(SystemMessageCategory.Dialog, "GameUI_Login_Fail_Cafe_MaxConnected");
                break;
            }

            case Option.AddressExpired:
            {
                systemMessage = new SystemMessage(SystemMessageCategory.Notice, "GameUI_Heroes_Cafe_Expired");
                break;
            }

            default:
            {
                switch (option1)
                {
                case Option.WelcomePrepaid:
                {
                    if (arument <= 60)
                    {
                        systemMessage = new SystemMessage(SystemMessageCategory.Notice, "GameUI_Heroes_Cafe_TimeLeft_LessThanOneHour");
                    }
                    else
                    {
                        object[] objArray = new object[] { arument / 60 };
                        systemMessage = new SystemMessage(SystemMessageCategory.Notice, "GameUI_Heroes_Cafe_TimeLeft", objArray);
                    }
                    break;
                }

                case Option.PrepaidExpired:
                    break;

                case Option.PrepaidExhausted:
                {
                    systemMessage = new SystemMessage(SystemMessageCategory.Notice, "GameUI_Heroes_Cafe_Expired");
                    break;
                }

                default:
                {
                    systemMessage = (option1 == Option.AccountShutdowned ? new SystemMessage(SystemMessageCategory.Notice, "GameUI_Heroes_Policy_Shutdown") : new SystemMessage(SystemMessageCategory.Dialog, "GameUI_Heroes_Policy_CannotPlayGame"));
                    break;
                }
                }
                break;
            }
            }
            if (this.NxIDToEntityDic.TryGetValue(nxID, out cafeAuth) && systemMessage != null)
            {
                sendPacket = SendPacket.Create <SystemMessage>(systemMessage);
                cafeAuth.FrontendConn.RequestOperation(sendPacket);
            }
            if (this.ScheduleShutdownMessageNexonID.Contains(nxID))
            {
                flag = this.ScheduleShutdownMessageNexonID.Remove(nxID);
            }
        }