Exemplo n.º 1
0
        private void ApplyClientConfig(Guid clientGiud)
        {
            string clientId = clientGiud.ToString();

            ISLogger.Write($"Loading config for {clientId}");
            //Reading client config
            string left  = ConfigManager.ReadConfig(clientId + "BoundLeft");
            string right = ConfigManager.ReadConfig(clientId + "BoundRight");
            string above = ConfigManager.ReadConfig(clientId + "BoundAbove");
            string below = ConfigManager.ReadConfig(clientId + "BoundBelow");
            string hk    = ConfigManager.ReadConfig(clientId + "Hotkey");

            if (hk != null)
            {
                Hotkey key = Hotkey.FromSettingsString(hk);
                if (key != null)
                {
                    inputMan?.SetUpdateClientHotkey(key, clientGiud);
                    ISLogger.Write($"IsServer->Loaded saved hotkey for client");
                }
                else
                {
                    ISLogger.Write($"IsServer->Error reading client hotkey from config");
                }
            }
            else
            {
                ISLogger.Write($"IsServer->Error reading client hotkey from config (hotkey was null)");
            }
        }
Exemplo n.º 2
0
        private void LoadHotkeySettings()
        {
            string exitHk = ConfigManager.ReadConfig("HotkeyExit");

            if (exitHk != null)
            {
                Hotkey hk = Hotkey.FromSettingsString(exitHk);
                if (hk != null)
                {
                    inputMan.SetFunctionHotkey(hk, HotkeyFunction.Exit);
                }
                else
                {
                    inputMan.SetFunctionHotkey(ServerDefaultExitHotkey, HotkeyFunction.Exit);
                }
            }
            else
            {
                inputMan.SetFunctionHotkey(ServerDefaultExitHotkey, HotkeyFunction.Exit);
            }

            string localHk = ConfigManager.ReadConfig("HotkeyLocal");

            if (localHk != null)
            {
                Hotkey hk = Hotkey.FromSettingsString(localHk);
                if (hk != null)
                {
                    inputMan.SetFunctionHotkey(hk, HotkeyFunction.SwitchToLocalInput);
                }
                else
                {
                    inputMan.SetFunctionHotkey(ServerDefaultSwitchLocalHotkey, HotkeyFunction.SwitchToLocalInput);
                }
            }
            else
            {
                inputMan.SetFunctionHotkey(ServerDefaultSwitchLocalHotkey, HotkeyFunction.SwitchToLocalInput);
            }

            string sasHk = ConfigManager.ReadConfig("HotkeySas");

            if (exitHk == null)
            {
                Hotkey hk = Hotkey.FromSettingsString(sasHk);
                if (hk != null)
                {
                    inputMan.SetFunctionHotkey(hk, HotkeyFunction.SAS);
                }
                else
                {
                    inputMan.SetFunctionHotkey(ServerDefaultSASHotkey, HotkeyFunction.SAS);
                }
            }
            else
            {
                inputMan.SetFunctionHotkey(ServerDefaultSASHotkey, HotkeyFunction.SAS);
            }
        }