Пример #1
0
    private static string GetNeptuneErrorTitle(string errorCode)
    {
        string empty = string.Empty;

        GameWebAPI.RespDataMA_MessageM.MessageM alert = AlertMaster.GetAlert(errorCode);
        if (alert != null)
        {
            return(empty);
        }
        return(StringMaster.GetString("ShopFailedTitle"));
    }
Пример #2
0
 private void Start()
 {
     if (!DMMain.isJustOnce)
     {
         DMMain.isJustOnce = true;
         AdjustWrapper.Instance.StartAdjust();
         AlertMaster.Initialize();
         StringMaster.Initialize();
         FirebaseMessaging.TokenReceived   += this.OnTokenReceived;
         FirebaseMessaging.MessageReceived += this.OnMessageReceived;
     }
     GUIMain.StartupScreen("UIStartupCaution");
 }
Пример #3
0
        /// <summary>
        /// constructor /
        /// конструктор
        /// </summary>
        public AutoFollowing(string name, StartProgram startProgram)
        {
            TabName      = name;
            StartProgram = startProgram;

            try
            {
                _connector = new ConnectorCandles(TabName, startProgram);
                _connector.OrderChangeEvent               += _connector_OrderChangeEvent;
                _connector.MyTradeEvent                   += _connector_MyTradeEvent;
                _connector.BestBidAskChangeEvent          += _connector_BestBidAskChangeEvent;
                _connector.GlassChangeEvent               += _connector_GlassChangeEvent;
                _connector.TimeChangeEvent                += StrategOneSecurity_TimeServerChangeEvent;
                _connector.NewCandlesChangeEvent          += LogicToEndCandle;
                _connector.LastCandlesChangeEvent         += LogicToUpdateLastCandle;
                _connector.TickChangeEvent                += _connector_TickChangeEvent;
                _connector.LogMessageEvent                += SetNewLogMessage;
                _connector.ConnectorStartedReconnectEvent += _connector_ConnectorStartedReconnectEvent;

                _connector.NewCandlesChangeEvent += _connector_NewCandlesChangeEvent;

                _marketDepthPainter = new MarketDepthPainter(TabName);
                _marketDepthPainter.LogMessageEvent += SetNewLogMessage;

                _journal = new Journal.Journal(TabName, startProgram);

                _journal.PositionStateChangeEvent     += _journal_PositionStateChangeEvent;
                _journal.PositionNetVolumeChangeEvent += _journal_PositionNetVolumeChangeEvent;
                _journal.UserSelectActionEvent        += _journal_UserSelectActionEvent;
                _journal.LogMessageEvent += SetNewLogMessage;


                _chartMaster = new ChartCandleMaster(TabName, StartProgram);
                _chartMaster.LogMessageEvent += SetNewLogMessage;
                _chartMaster.SetNewSecurity(_connector.NamePaper, _connector.TimeFrameBuilder, _connector.PortfolioName, _connector.ServerType);
                _chartMaster.SetPosition(_journal.AllPosition);

                _alerts = new AlertMaster(TabName, _connector, _chartMaster);
                _alerts.LogMessageEvent += SetNewLogMessage;
                _dealCreator             = new PositionCreator();


                _lastTickIndex = 0;
            }
            catch (Exception error)
            {
                SetNewLogMessage(error.ToString(), LogMessageType.Error);
            }
        }
Пример #4
0
 public void ClearCache()
 {
     AlertMaster.ClearCache();
     StringMaster.ClearCache();
     EvolutionMaterialData.ClearCache();
     ChipDataMng.ClearCache();
     TitleDataMng.ClearCache();
     DataMng.Instance().StageGimmick.ZeroClear();
     MasterBase[] array = this.masterList.Values.ToArray <MasterBase>();
     for (int i = 0; i < array.Length; i++)
     {
         array[i].ClearData();
     }
     MonsterPicturebookData.Initialize();
 }
Пример #5
0
 public static bool CheckDialogMessage(string errorCode)
 {
     if (string.IsNullOrEmpty(errorCode))
     {
         return(false);
     }
     if (errorCode == "LOCAL_ERROR_TIMEOUT" || errorCode == "LOCAL_ERROR_WWW" || errorCode == "LOCAL_ERROR_JSONPARSE" || errorCode == "LOCAL_ERROR_ASSET_DATA" || errorCode == "LOCAL_ERROR_SAVE_DATA_IO" || errorCode == "LOCAL_ERROR_SAVE_DATA_OTHER" || errorCode == "LOCAL_ERROR_SAVE_DATA_SECURITY" || errorCode == "E-AL09" || errorCode == "E-AL10")
     {
         return(true);
     }
     if (!string.IsNullOrEmpty(AlertManager.GetNeptuneErrorString(errorCode)))
     {
         return(true);
     }
     GameWebAPI.RespDataMA_MessageM.MessageM alert = AlertMaster.GetAlert(errorCode);
     return(null != alert);
 }
Пример #6
0
    public static void ReloadMaster()
    {
        DirectoryInfo directoryInfo = new DirectoryInfo(Application.persistentDataPath);

        foreach (FileInfo fileInfo in directoryInfo.GetFiles())
        {
            string name = fileInfo.Name;
            if (name.StartsWith("MA_"))
            {
                File.Delete(Application.persistentDataPath + "/" + name);
            }
        }
        MasterDataMng.Instance().ClearCache();
        MissionBannerCacheBuffer.ClearCacheBuffer();
        MonsterIconCacheBuffer.ClearCacheBuffer();
        PresentBoxItemIconCacheBuffer.ClearCacheBuffer();
        TitleIconCacheBuffer.ClearCacheBuffer();
        StringMaster.Reload();
        AlertMaster.Reload();
    }
Пример #7
0
        public void ResetPasswordByEmail(string Email)
        {
            string companyName       = "";
            string username          = "";
            string temporaryPassword = "";
            string email             = "";
            User   user = (from u in _unitOfWork.User.FindAll().Where(u => u.Email == Email && u.Active == true) select u).FirstOrDefault();

            if (user != null)
            {
                companyName              = user.Company.Name;
                username                 = user.Username;
                email                    = user.Email;
                temporaryPassword        = Utility.GenerateRandomPassword();
                user.Password            = temporaryPassword;
                user.PasswordChangedDate = DateTime.Now;
                user.ModifiedBy          = user.Username;
                user.ModifiedDate        = DateTime.Now;

                _unitOfWork.User.Update(user);
                _unitOfWork.SaveChanges();

                // Create Alert
                UserAlertDTO document = new UserAlertDTO();
                document.Username          = username;
                document.TemporaryPassword = temporaryPassword;
                document.CompanyName       = companyName;
                document.UserEmail         = email;
                AlertMaster alert        = (from a in _unitOfWork.AlertMaster.FindAll().Where(a => a.Code == "RP" && a.Active == true) select a).FirstOrDefault();
                string      emailFrom    = alert.EmailFrom;
                string      emailSubject = StringifyContent(document, alert.EmailSubject);
                string      emailContent = StringifyContent(document, alert.EmailContent);
                string      emailTo      = StringifyContent(document, alert.EmailTo);

                Utility.SendEmail("192.168.1.20", emailFrom, emailTo, "", emailSubject, emailContent);
            }
        }
Пример #8
0
        public void ChangePassword(UserPasswordDTO userPasswordDTO)
        {
            string companyName = "";
            string username    = "";
            string newPassword = "";
            string email       = "";
            User   user        = (from u in _unitOfWork.User.FindAll().Where(u => u.Username == userPasswordDTO.Username && u.Password == userPasswordDTO.OldPassword && u.Active == true) select u).FirstOrDefault();

            if (user != null)
            {
                companyName              = user.Company.Name;
                username                 = user.Username;
                email                    = user.Email;
                newPassword              = userPasswordDTO.NewPassword;
                user.Password            = newPassword;
                user.PasswordChangedDate = DateTime.Now;
                user.ModifiedBy          = user.Username;
                user.ModifiedDate        = DateTime.Now;

                _unitOfWork.User.Update(user);
                _unitOfWork.SaveChanges();

                // Create Alert
                UserAlertDTO document = new UserAlertDTO();
                document.Username    = username;
                document.CompanyName = companyName;
                document.UserEmail   = email;
                AlertMaster alert        = (from a in _unitOfWork.AlertMaster.FindAll().Where(a => a.Code == "CP" && a.Active == true) select a).FirstOrDefault();
                string      emailFrom    = alert.EmailFrom;
                string      emailSubject = StringifyContent(document, alert.EmailSubject);
                string      emailContent = StringifyContent(document, alert.EmailContent);
                string      emailTo      = StringifyContent(document, alert.EmailTo);

                Utility.SendEmail("192.168.1.20", emailFrom, emailTo, "", emailSubject, emailContent);
            }
        }
Пример #9
0
    protected override void Start()
    {
        this.userID.text        = string.Empty;
        this.userCode.text      = string.Empty;
        this.appVersion.text    = string.Empty;
        this.buildNumLabel.text = string.Empty;
        this.NpVersion.text     = string.Empty;
        this.userID.gameObject.SetActive(false);
        this.userCode.gameObject.SetActive(false);
        this.appVersion.gameObject.SetActive(false);
        this.buildNumLabel.gameObject.SetActive(false);
        this.NpVersion.gameObject.SetActive(false);
        this.cacheClearButtonLabel.text = StringMaster.GetString("TitleCacheButton");
        this.takeoverButtonLabel.text   = StringMaster.GetString("TakeOverTitle");
        this.optionButtonLabel.text     = StringMaster.GetString("TitleOptionButton");
        this.inquiryButtonLabel.text    = StringMaster.GetString("InquiryTitle");
        this.infomationMessage          = AlertMaster.GetAlert("E-AL80");
        UILabel componentInChildren = this.infomationBtn.GetComponentInChildren <UILabel>();

        if (componentInChildren != null)
        {
            componentInChildren.text = this.infomationMessage.messageTitle;
        }
        UILabel componentInChildren2 = this.contactBtn.GetComponentInChildren <UILabel>();

        if (componentInChildren2 != null)
        {
            componentInChildren2.text = StringMaster.GetString("InquiryTitle");
        }
        base.Start();
        base.gameObject.SetActive(true);
        if (!global::Debug.isDebugBuild || this.buildNumLabel != null)
        {
        }
        base.StartCoroutine(this.StartEvent());
    }
Пример #10
0
 public static bool ShowAlertDialog(Action <int> action, string errorCode)
 {
     AlertManager.lastErrorCode = errorCode;
     if (errorCode == "LOCAL_ERROR_TIMEOUT")
     {
         string @string = StringMaster.GetString("AlertNetworkErrorTitle");
         string string2 = StringMaster.GetString("AlertNetworkErrorTimeOut");
         return(AlertManager.ShowAlertDialog(action, @string, string2, AlertManager.ButtonActionType.Retry, true));
     }
     if (errorCode == "LOCAL_ERROR_WWW")
     {
         string string3 = StringMaster.GetString("AlertDataErrorTitle");
         string string4 = StringMaster.GetString("AlertDataErrorInfo");
         return(AlertManager.ShowAlertDialog(action, string3, string4, AlertManager.ButtonActionType.Retry, true));
     }
     if (errorCode == "LOCAL_ERROR_JSONPARSE")
     {
         string string5 = StringMaster.GetString("SaveFailedTitle");
         string string6 = StringMaster.GetString("AlertJsonErrorInfo");
         return(AlertManager.ShowAlertDialog(action, string5, string6, AlertManager.ButtonActionType.Title, true));
     }
     if (errorCode == "LOCAL_ERROR_ASSET_DATA")
     {
         string string7 = StringMaster.GetString("AlertNetworkErrorTitle");
         string string8 = StringMaster.GetString("AlertNetworkErrorRetry");
         return(AlertManager.ShowAlertDialog(action, string7, string8, AlertManager.ButtonActionType.Retry, true));
     }
     if (errorCode == "LOCAL_ERROR_SAVE_DATA_IO")
     {
         string string9  = StringMaster.GetString("SaveFailedTitle");
         string string10 = StringMaster.GetString("SaveFailed-02");
         return(AlertManager.ShowAlertDialog(action, string9, string10, AlertManager.ButtonActionType.Close, true));
     }
     if (errorCode == "LOCAL_ERROR_SAVE_DATA_OTHER")
     {
         string string11 = StringMaster.GetString("SaveFailedTitle");
         string string12 = StringMaster.GetString("SaveFailed-01");
         return(AlertManager.ShowAlertDialog(action, string11, string12, AlertManager.ButtonActionType.Close, true));
     }
     if (errorCode == "LOCAL_ERROR_SAVE_DATA_SECURITY")
     {
         string string13 = StringMaster.GetString("SaveFailedTitle");
         string string14 = StringMaster.GetString("SaveFailed-03");
         return(AlertManager.ShowAlertDialog(action, string13, string14, AlertManager.ButtonActionType.Close, true));
     }
     if (errorCode == "E-AL09")
     {
         string string15 = StringMaster.GetString("TakeOver-12");
         string string16 = StringMaster.GetString("TakeOver-13");
         return(AlertManager.ShowAlertDialog(action, string15, string16, AlertManager.ButtonActionType.Close, true));
     }
     if (errorCode == "E-AL10")
     {
         string string17 = StringMaster.GetString("TakeOver-12");
         string string18 = StringMaster.GetString("TakeOver-13");
         return(AlertManager.ShowAlertDialog(action, string17, string18, AlertManager.ButtonActionType.Close, true));
     }
     if (!string.IsNullOrEmpty(AlertManager.GetNeptuneErrorString(errorCode)))
     {
         return(AlertManager.ShowAlertDialog(action, AlertManager.GetNeptuneErrorTitle(errorCode), AlertManager.GetNeptuneErrorString(errorCode), AlertManager.ButtonActionType.Close, true));
     }
     GameWebAPI.RespDataMA_MessageM.MessageM alert = AlertMaster.GetAlert(errorCode);
     if (alert == null)
     {
         alert = AlertMaster.GetAlert("E-GP01");
     }
     if (alert == null)
     {
         return(AlertManager.ErrorCallback(action, errorCode));
     }
     AlertManager.ButtonActionType actionType = (AlertManager.ButtonActionType) int.Parse(alert.actionType);
     AlertManager.DialogType       dialogType = (AlertManager.DialogType) int.Parse(alert.actionValue);
     if (dialogType == AlertManager.DialogType.Alert)
     {
         return(AlertManager.ShowAlertDialog(action, alert.messageTitle, alert.messageText, actionType, true));
     }
     if (dialogType != AlertManager.DialogType.Modal)
     {
         return(AlertManager.ShowAlertDialog(action, alert.messageTitle, alert.messageText, actionType, true));
     }
     return(AlertManager.ShowModalMessage(action, alert.messageTitle, alert.messageText, actionType, true));
 }
Пример #11
0
    private static string GetNeptuneErrorString(string errorCode)
    {
        string result = string.Empty;

        GameWebAPI.RespDataMA_MessageM.MessageM alert = AlertMaster.GetAlert(errorCode);
        if (alert != null)
        {
            return(result);
        }
        string text = errorCode.Replace("C-NP", string.Empty);

        switch (text)
        {
        case "100":
            result = StringMaster.GetString("AlertJsonErrorInfo");
            break;

        case "101":
            result = StringMaster.GetString("ShopFailed-01");
            break;

        case "102":
            result = StringMaster.GetString("ShopFailed-06");
            break;

        case "103":
            result = StringMaster.GetString("ShopFailed-07");
            break;

        case "104":
            result = StringMaster.GetString("ShopFailed-05");
            break;

        case "105":
            result = StringMaster.GetString("ShopFailed-08");
            break;

        case "106":
            result = StringMaster.GetString("ShopFailed-10");
            break;

        case "107":
            result = StringMaster.GetString("ShopFailed-02");
            break;

        case "120":
            result = StringMaster.GetString("ShopFailed-11");
            break;

        case "199":
            result = StringMaster.GetString("ShopFailed-04");
            break;

        case "200":
            result = StringMaster.GetString("ShopFailed-03");
            break;

        case "201":
            result = StringMaster.GetString("ShopFailed-13");
            break;

        case "203":
            result = StringMaster.GetString("ShopFailed-12");
            break;
        }
        return(result);
    }