public static void Main()
        {
            _sem    = new SystemSemaphoreHelper("app_semaphor:c79ef123-5330-42b0-b437-d7701ea089cf");
            Setting = new SettingModel(Path.GetFullPath("setting.opt"));
            Setting.Load();

            _countSem = Setting.CopyCount - (uint)AppHelper.GetAllProcessesButThis().Length; // !
            _msgTitle = "id=" + AppHelper.ProcessId;

            if (Setting.CopyCount == 0)
            {
                RunApp();
            }
            else
            {
                _sem.Create(Setting.CopyCount);
                if (_sem.Take())
                {
                    RunApp();
                }
                else
                {
                    TakeSemaphorFailed();
                }
            }
        }
Beispiel #2
0
        private void Settings()
        {
            SettingModel model = new SettingModel();

            model.Load();

            SettingService.SetSetting(model);
        }
Beispiel #3
0
 public RealmCore()
 {
     Log     = new MessageLog();
     Db      = new DataAccessObject();
     Setting = SettingModel.Load <RealmSetting>();
     Db.Setup(Setting);
     GManager = new GameManager(this);
     PManager = new PlayerManager(this);
 }
Beispiel #4
0
 public GameCore()
 {
     Log     = new MessageLog();
     Db      = new DataAccessObject();
     Setting = SettingModel.Load <GameSetting>();
     Db.Setup(Setting);
     RClient = new RealmClient(this);
     RClient.NewException += RClient_NewException;
     RClient.Connected    += RClient_Connected;
     RClient.Disconnected += RClient_Disconnected;
     RClient.DataReceived += RClient_DataReceived;
     RClient.DataSended   += RClient_DataSended;
 }
Beispiel #5
0
        public void actionSetting(GameObject setting)
        {
            SettingModel model = new SettingModel();

            model.Load();

            setting.transform.Find("quality").GetChild(0).GetComponent <Dropdown>().value  = (int)model.quality;
            setting.transform.Find("mouseSpeed").GetChild(0).GetComponent <Slider>().value = model.mouse;
            setting.transform.Find("soundValue").GetChild(0).GetComponent <Slider>().value = model.sound;
            setting.transform.Find("musicValue").GetChild(0).GetComponent <Slider>().value = model.music;
            setting.transform.Find("mute").GetChild(0).GetComponent <Toggle>().isOn        = model.mute == 1 ? true : false;
            setting.transform.Find("fullScreen").GetChild(0).GetComponent <Toggle>().isOn  = model.fullscreen == 1 ? true : false;

            setting.SetActive(!setting.active);
        }
 public void Update()
 {
     _model.Load();
     InitViewModelByModel();
 }