Esempio n. 1
0
        public SystemConfigure GetSystemConfigure()
        {
            SystemConfigure model = null;

            try
            {
                model                = new SystemConfigure();
                model.FBToken        = SqlDAL.Instance.GetSetting("FBToken").Value;
                model.FBUrlApi       = SqlDAL.Instance.GetSetting("FBUrlApi").Value;
                model.MSEndPoint     = SqlDAL.Instance.GetSetting("MSEndPoint").Value;
                model.MSKey          = SqlDAL.Instance.GetSetting("MSKey").Value;
                model.SMTPPassword   = SqlDAL.Instance.GetSetting("SMTPPassword").Value;
                model.SMTPPort       = SqlDAL.Instance.GetSetting("SMTPPort").Value;
                model.SMTPSender     = SqlDAL.Instance.GetSetting("SMTPSender").Value;
                model.SMTPSenderName = SqlDAL.Instance.GetSetting("SMTPSenderName").Value;
                model.MailServer     = SqlDAL.Instance.GetSetting("MailServer").Value;

                //model.MicroAccuracy = int.Parse(SqlDAL.Instance.GetSetting("MicroAccuracy").Value);
                //model.MacroAccuracy = int.Parse(SqlDAL.Instance.GetSetting("MacroAccuracy").Value);
                //model.LogLoss = int.Parse(SqlDAL.Instance.GetSetting("LogLoss").Value);
                //model.LogLossReduction = int.Parse(SqlDAL.Instance.GetSetting("LogLossReduction").Value);

                model.EndPoint = SqlDAL.Instance.GetSetting("EndPoint").Value;
            }
            catch (Exception ex)
            {
                CoreLogger.Instance.Error(this.CreateMessageLog(ex.Message));
            }
            return(model);
        }
Esempio n. 2
0
        public static bool SetConfigure(string strConfigureClass, string strConfigureValue)
        {
            using (var context = new EG_MagicCubeEntities())
            {
                var oSystemConfigure = context.SystemConfigure.AsQueryable().First(x => x.ConfigureName == strConfigureClass);

                if (oSystemConfigure != null)
                {
                    oSystemConfigure.ConfigureValue = strConfigureValue;
                }
                else
                {
                    SystemConfigure new_SystemConfigure = new SystemConfigure()
                    {
                    };
                    new_SystemConfigure.ConfigureName  = strConfigureClass;
                    new_SystemConfigure.ConfigureValue = strConfigureValue;
                    context.SystemConfigure.Add(new_SystemConfigure);
                }
                if (context.SaveChanges() == 0)
                {
                    return(false);
                }
            }
            return(true);
        }
Esempio n. 3
0
 //private static bool startup = false;
 public GameController()
 {
     Debug.Log("GameController.");
     CurrentGameMode = GameMode.NORMAL;
     GameControlProxy.add(this);
     WindowConfigure.initAll();
     if (Rnd == null) Rnd = new RndGenerator((int)System.DateTime.Now.Ticks);
     if (GameActionEvent == null) GameActionEvent = new GameActionEvent();
     if (PlayingLogger == null) PlayingLogger = new PlayLogger();
     if (DungeonInformation == null) DungeonInformation = new DungeonInformation();
     if (ObjectList == null) ObjectList = new ObjectList();
     if (DgParameterTable == null) DgParameterTable = new DungeonParameterTable(5);
     if (SoundController == null) SoundController = SoundController.Instance;
     if (TempGameState == null) TempGameState = new Stack<GameState>();
     if (ActCommandController == null) ActCommandController = new ActionCommandController();
     if (GlobalGameInformation == null) GlobalGameInformation = new GlobalGameInformation();
     if (SystemConfigure == null) SystemConfigure = new SystemConfigure();
     if (SystemConfigureMenu == null) SystemConfigureMenu = new GameSystemConfigureMenu();
     DataSaveSystem.addGameActionEvent();
     //var t = new TagList();
     SaveDataConverter.add(this);
     //PlayerUIController.setVisible(false);
     gameStateChange(GameState.PRELOAD);
     filedModeChange(FieldMode.TOWN);
 }
Esempio n. 4
0
 public JsonResult SaveConfigure(SystemConfigure model)
 {
     if (ModelState.IsValid)
     {
         if (systemConfigureBusiness.SaveConfigure(model))
         {
             return(Json(new { success = true, msg = MessageHelper.SaveSuccess }));
         }
     }
     CoreLogger.Instance.Error(this.CreateMessageLog(ModelState.GetMessage()));
     return(Json(new { success = false, msg = MessageHelper.SaveNotSuccess }));
 }
 public void init(SystemConfigure configure)
 {
     BGMSlider.value = configure.BGMVolume;
     SESlider.value = configure.SEVolume;
     switch (configure.MiniMapTransParent)
     {
         case MiniMapEntity.Transparent.CLEAR:
             getMiniMapToggle(MiniMapToggleType.OFF).isOn = true;
             break;
         case MiniMapEntity.Transparent.ZERO:
             getMiniMapToggle(MiniMapToggleType.ON).isOn = true;
             break;
         default:
             getMiniMapToggle(MiniMapToggleType.HERF).isOn = true;
             break;
     }
 }
Esempio n. 6
0
        public bool SaveConfigure(SystemConfigure model)
        {
            var rsBool = true;

            try
            {
                if (SqlDAL.Instance.SaveSettingModel(new SettingModel()
                {
                    Key = "FBToken", Value = model.FBToken
                }) < 0)
                {
                    rsBool = false;
                }
                if (SqlDAL.Instance.SaveSettingModel(new SettingModel()
                {
                    Key = "FBUrlApi", Value = model.FBUrlApi
                }) < 0)
                {
                    rsBool = false;
                }
                if (SqlDAL.Instance.SaveSettingModel(new SettingModel()
                {
                    Key = "MSEndPoint", Value = model.MSEndPoint
                }) < 0)
                {
                    rsBool = false;
                }
                if (SqlDAL.Instance.SaveSettingModel(new SettingModel()
                {
                    Key = "MSKey", Value = model.MSKey
                }) < 0)
                {
                    rsBool = false;
                }
                if (SqlDAL.Instance.SaveSettingModel(new SettingModel()
                {
                    Key = "SMTPPassword", Value = model.SMTPPassword
                }) < 0)
                {
                    rsBool = false;
                }
                if (SqlDAL.Instance.SaveSettingModel(new SettingModel()
                {
                    Key = "SMTPPort", Value = model.SMTPPort
                }) < 0)
                {
                    rsBool = false;
                }
                if (SqlDAL.Instance.SaveSettingModel(new SettingModel()
                {
                    Key = "SMTPSender", Value = model.SMTPSender
                }) < 0)
                {
                    rsBool = false;
                }
                if (SqlDAL.Instance.SaveSettingModel(new SettingModel()
                {
                    Key = "SMTPSenderName", Value = model.SMTPSenderName
                }) < 0)
                {
                    rsBool = false;
                }
                if (SqlDAL.Instance.SaveSettingModel(new SettingModel()
                {
                    Key = "MailServer", Value = model.MailServer
                }) < 0)
                {
                    rsBool = false;
                }

                if (SqlDAL.Instance.SaveSettingModel(new SettingModel()
                {
                    Key = "EndPoint", Value = model.EndPoint
                }) < 0)
                {
                    rsBool = false;
                }
            }
            catch (Exception ex)
            {
                CoreLogger.Instance.Error(this.CreateMessageLog(ex.Message));
            }
            return(rsBool);
        }
 public void open(SystemConfigure configure, bool changegamestate = true, bool invisiblecurrentmenu = true, bool playsound = true)
 {
     base.open(changegamestate, invisiblecurrentmenu, playsound);
     this.Controller.init(configure);
 }