public static IConfigProvider CreateProvider(IConfigSchema schema, TimeSpan?errorThresholdInterval) { ConfigFlags overrideFlags = ConfigProviderBase.OverrideFlags; if ((overrideFlags & ConfigFlags.DisallowADConfig) == ConfigFlags.DisallowADConfig) { return(ConfigProvider.CreateAppProvider(schema)); } if ((overrideFlags & ConfigFlags.DisallowAppConfig) == ConfigFlags.DisallowAppConfig) { return(ConfigProvider.CreateADProvider(schema)); } ConfigProvider configProvider = new ConfigProvider(schema); ConfigDriverBase configDriver = new ADConfigDriver(schema, errorThresholdInterval); ConfigDriverBase configDriver2 = new AppConfigDriver(schema, errorThresholdInterval); if ((overrideFlags & ConfigFlags.LowADConfigPriority) == ConfigFlags.LowADConfigPriority) { configProvider.AddConfigDriver(configDriver2); configProvider.AddConfigDriver(configDriver); } else { configProvider.AddConfigDriver(configDriver); configProvider.AddConfigDriver(configDriver2); } return(configProvider); }
public ConfigString(string name, string cmd, int maxLength, string def, ConfigFlags flags, string desc) : base(name, cmd, flags, desc) { MaxLength = maxLength; Value = def; DefaultValue = def; }
internal static ConfigFlags ParseConfigFlags(List <String> Args) { ConfigFlags Result = ConfigFlags.Config; List <String> ToBeRemoved = new List <String>(); foreach (String Arg in Args) { switch (Arg.ToUpper()) { case "--HELP": Result |= ConfigFlags.Help; break; default: break; } if (Arg.StartsWith("--")) { ToBeRemoved.Add(Arg); } } foreach (String Arg in ToBeRemoved) { Args.Remove(Arg); } return(Result); }
// Token: 0x06000095 RID: 149 RVA: 0x0000331C File Offset: 0x0000151C public static IConfigProvider CreateProvider(string applicationName, AnchorConfig schema) { ConfigDriverBase configDriverBase = null; ConfigDriverBase configDriverBase2 = null; ConfigFlags overrideFlags = ConfigProviderBase.OverrideFlags; if ((overrideFlags & ConfigFlags.DisallowADConfig) != ConfigFlags.DisallowADConfig) { configDriverBase = new ADConfigDriver(schema); } if ((overrideFlags & ConfigFlags.DisallowAppConfig) != ConfigFlags.DisallowAppConfig) { configDriverBase2 = new AnchorConfig.AnchorAppConfigDriver(schema.Name, schema); } AnchorConfig.AnchorConfigProvider anchorConfigProvider = new AnchorConfig.AnchorConfigProvider(schema); if (configDriverBase != null && configDriverBase2 != null && (overrideFlags & ConfigFlags.LowADConfigPriority) == ConfigFlags.LowADConfigPriority) { anchorConfigProvider.AddConfigDriver(configDriverBase2); anchorConfigProvider.AddConfigDriver(configDriverBase); } else { if (configDriverBase != null) { anchorConfigProvider.AddConfigDriver(configDriverBase); } if (configDriverBase2 != null) { anchorConfigProvider.AddConfigDriver(configDriverBase2); } } return(anchorConfigProvider); }
protected ConfigVariable(string name, string cmd, ConfigFlags flags, string desc) { Name = name; ConsoleCommand = cmd; Flags = flags; Description = desc; }
public void Deserialize(Stream stream) { EndianBinaryReader reader = new EndianBinaryReader(EndianBitConverter.Little, stream); if (Encoding.UTF8.GetString(reader.ReadBytes(2)) != "LK") { throw new BoardInfoFormatException("Board info must begin with the 2 byte string 'LK'"); } this.makerId = reader.ReadUInt16(); this.plankId = reader.ReadUInt16(); this.flags = (ConfigFlags)reader.ReadUInt16(); int numGPIOs = reader.ReadByte(); if (numGPIOs != NUM_GPIOS) { throw new BoardInfoFormatException(string.Format("Expected {0} GPIOs, read {1}", NUM_GPIOS, numGPIOs)); } int len = reader.ReadByte(); this.plankName = Encoding.UTF8.GetString(reader.ReadBytes(len)); len = reader.ReadByte(); this.version = Encoding.UTF8.GetString(reader.ReadBytes(len)); gpioNames = new ObservableCollection <PinInfo>(); for (int i = 0; i < NUM_GPIOS; i++) { byte lengthByte = reader.ReadByte(); string pinName = Encoding.UTF8.GetString(reader.ReadBytes(lengthByte & 0x1F)); gpioNames.Add(new PinInfo(i + 1, pinName, (PinTypes)(lengthByte & 0xE0))); } }
public void Show(string sceneId, bool isSceneDeployed, bool isOwnerOrOperator, bool isContributor) { ConfigFlags config = isSceneDeployed? GetDeployedSceneConfig(isOwnerOrOperator, isContributor) : GetProjectSceneConfig(isOwnerOrOperator, isContributor); Show(sceneId, config); }
public ConsoleCommand(string cmd, string format, ConfigFlags flags, string description, ConsoleCallback callback, object data) { Cmd = cmd; Format = format; Flags = flags; Description = description; Callback = callback; Data = data; }
public override ConsoleCommand FindCommand(string cmd, ConfigFlags mask) { if (string.IsNullOrWhiteSpace(cmd)) { return(null); } cmd = cmd.ToLower(); return(Commands.ContainsKey(cmd) && (Commands[cmd].Flags & mask) != 0 ? Commands[cmd] : null); }
private void Build(ConfigFlags flags) { headerContainer.SetActive((flags & headerFlags) != 0); settingsButton.gameObject.SetActive((flags & ConfigFlags.Settings) != 0); duplicateAsProjectButton.gameObject.SetActive((flags & ConfigFlags.DuplicateAsProject) != 0); duplicateButton.gameObject.SetActive((flags & ConfigFlags.Duplicate) != 0); downloadButton.gameObject.SetActive((flags & ConfigFlags.Download) != 0); shareButton.gameObject.SetActive((flags & ConfigFlags.Share) != 0); unpublishButton.gameObject.SetActive((flags & ConfigFlags.Unpublish) != 0); deleteButton.gameObject.SetActive((flags & ConfigFlags.Delete) != 0); quitContributorButton.gameObject.SetActive((flags & ConfigFlags.QuitContributor) != 0); }
public static IConfigProvider CreateAppProvider(IConfigSchema schema, TimeSpan?errorThresholdInterval) { ConfigFlags overrideFlags = ConfigProviderBase.OverrideFlags; if ((overrideFlags & ConfigFlags.DisallowAppConfig) == ConfigFlags.DisallowAppConfig) { return(ConfigProvider.CreateDefaultValueProvider(schema)); } ConfigProvider configProvider = new ConfigProvider(schema); configProvider.AddConfigDriver(new AppConfigDriver(schema, errorThresholdInterval)); return(configProvider); }
public override void RegisterCommand(string cmd, string format, ConsoleCallback callback, ConfigFlags flags, string description, object data = null) { if (Commands.ContainsKey(cmd)) { return; } cmd = cmd.Trim(); format = format.Trim().Replace("??", "?"); Commands.Add(cmd, new ConsoleCommand(cmd, format, flags, description, callback, data)); }
private ConfigFlags GetDeployedSceneConfig(bool isOwnerOrOperator, bool isContributor) { ConfigFlags config = ConfigFlags.DuplicateAsProject | ConfigFlags.Download; if (isOwnerOrOperator) { config |= ConfigFlags.Settings | ConfigFlags.Unpublish; } else if (isContributor) { config |= ConfigFlags.QuitContributor; } return(config); }
private ConfigFlags GetProjectSceneConfig(bool isOwnerOrOperator, bool isContributor) { ConfigFlags config = ConfigFlags.Duplicate | ConfigFlags.Download | ConfigFlags.Share; if (isOwnerOrOperator) { config |= ConfigFlags.Settings | ConfigFlags.Delete; } else if (isContributor) { config |= ConfigFlags.QuitContributor; } return(config); }
private ConfigFlags GetDeployedSceneConfig(bool isOwnerOrOperator, bool isContributor) { ConfigFlags config = 0; if (isOwnerOrOperator) { config |= ConfigFlags.Unpublish; } else if (isContributor) { config |= ConfigFlags.QuitContributor; } return(config); }
public ConsoleCommand( string cmd, string format, string description, ConfigFlags flags, object data) { Cmd = cmd.Trim(); ParametersFormat = format.Trim().Replace("??", "?"); Flags = flags; Description = description; Data = data; if (string.IsNullOrEmpty(Cmd)) { throw new Exception("ConsoleCommand empty cmd"); } }
public override void Init(ConfigFlags saveMask) { SaveMask = saveMask; AppendVariables(new Dictionary <string, ConfigVariable>() { { "ConnTimeout", new ConfigInt("conn_timeout", 100, 5, 1000, ConfigFlags.Save | ConfigFlags.Client | ConfigFlags.Server, "Network timeout") }, { "ConnTimeoutProtection", new ConfigInt("conn_timeout_protection", 1000, 5, 10000, ConfigFlags.Save | ConfigFlags.Client | ConfigFlags.Server, "Network timeout protection") }, { "Password", new ConfigString("password", 32, "", ConfigFlags.Client | ConfigFlags.Server, "Password to the server") }, { "Logfile", new ConfigString("logfile", 128, "", ConfigFlags.Save | ConfigFlags.Client | ConfigFlags.Server, "Filename to log all output to") }, { "ConsoleOutputLevel", new ConfigInt("console_output_level", 0, 0, 2, ConfigFlags.Client | ConfigFlags.Server, "Adjusts the amount of information in the console") }, { "Bindaddr", new ConfigString("bindaddr", 128, "", ConfigFlags.Client | ConfigFlags.Server | ConfigFlags.Master, "Address to bind the client/server to") }, { "EcBindaddr", new ConfigString("ec_bindaddr", 128, "localhost", ConfigFlags.Econ, "Address to bind the external console to. Anything but 'localhost' is dangerous") }, { "EcPort", new ConfigInt("ec_port", 0, 0, 0, ConfigFlags.Econ, "Port to use for the external console") }, { "EcPassword", new ConfigString("ec_password", 32, "", ConfigFlags.Econ, "External console password") }, { "EcBantime", new ConfigInt("ec_bantime", 0, 0, 1440, ConfigFlags.Econ, "The time a client gets banned if econ authentication fails. 0 just closes the connection") }, { "EcAuthTimeout", new ConfigInt("ec_auth_timeout", 30, 1, 120, ConfigFlags.Econ, "Time in seconds before the the econ authentification times out ") }, { "EcOutputLevel", new ConfigInt("ec_output_level", 1, 0, 2, ConfigFlags.Econ, "Adjusts the amount of information in the external console") }, { "ClAllowOldServers", new ConfigInt("cl_allow_old_servers", 1, 0, 1, ConfigFlags.Client | ConfigFlags.Server, "Allow connecting to servers that do not furtherly secure the connection") }, { "Debug", new ConfigInt("debug", 1, 0, 1, ConfigFlags.Client | ConfigFlags.Server, "Debug mode") }, }); }
public abstract void Init(ConfigFlags saveMask);
public static extern ResultCode GpioCfgSetInternals(ConfigFlags configFlags);
public abstract IEnumerable <KeyValuePair <string, ConsoleCommand> > GetCommands( int accessLevel, ConfigFlags flags = ConfigFlags.All);
public abstract void AddCommand(string cmd, string format, string description, ConfigFlags flags, CommandCallback callback, object data = null);
public abstract ConsoleCommand FindCommand(string cmd, ConfigFlags mask);
/// <summary> /// 设置标识位 /// </summary> /// <param name="flag"></param> /// <param name="value"></param> public void SetFlag(ConfigFlags flag, Boolean value) { // 或操作加上标识 // 异或操作让指定标识位取反 // 在异或中,所有与0的异或不变,与1的异或取反 if (value) Flag |= flag; else { // 必须先检查是否包含这个标识位,因为异或的操作仅仅是取反 if ((Flag & flag) == flag) Flag ^= flag; } }
public abstract void RegisterCommand(string cmd, string format, ConsoleCallback callback, ConfigFlags flags, string description, object data = null);
public MachinaCaptureWorker(XivMonTab window, TCPNetworkMonitor.NetworkMonitorType monitorType, ConfigFlags flags) { this._myTab = window; this._monitorType = monitorType; this._configFlags = flags; }
public override void AddCommand(string cmd, string format, string description, ConfigFlags flags, CommandCallback callback, object data = null) { if (Commands.ContainsKey(cmd)) { Debug.Warning("console", $"Command {cmd} already exist"); return; } var command = new ConsoleCommand(cmd, format, description, flags, data); command.Executed += callback; Commands.Add(cmd, command); CommandAdded?.Invoke(command); }
public void Show(string sceneId, ConfigFlags configFlags) { this.sceneId = sceneId; Build(configFlags); gameObject.SetActive(true); }
public void Deserialize(Stream stream) { EndianBinaryReader reader = new EndianBinaryReader(EndianBitConverter.Little, stream); if (Encoding.UTF8.GetString(reader.ReadBytes(2)) != "LK") throw new BoardInfoFormatException("Board info must begin with the 2 byte string 'LK'"); this.makerId = reader.ReadUInt16(); this.plankId = reader.ReadUInt16(); this.flags = (ConfigFlags)reader.ReadUInt16(); int numGPIOs = reader.ReadByte(); if (numGPIOs != NUM_GPIOS) throw new BoardInfoFormatException(string.Format("Expected {0} GPIOs, read {1}", NUM_GPIOS, numGPIOs)); int len = reader.ReadByte(); this.plankName = Encoding.UTF8.GetString(reader.ReadBytes(len)); len = reader.ReadByte(); this.version = Encoding.UTF8.GetString(reader.ReadBytes(len)); gpioNames = new ObservableCollection<PinInfo>(); for (int i = 0; i < NUM_GPIOS; i++) { byte lengthByte = reader.ReadByte(); string pinName = Encoding.UTF8.GetString(reader.ReadBytes(lengthByte & 0x1F)); gpioNames.Add(new PinInfo(i + 1, pinName, (PinTypes)(lengthByte & 0xE0))); } }
public override void Init(ConfigFlags saveMask) { base.Init(saveMask); AppendVariables(new Dictionary <string, ConfigVariable>() { { "SvSpoofProtection", new ConfigInt("sv_spoof_protection", 0, 0, 1, ConfigFlags.Server, "Enable spoof protection") }, { "SvMapWindow", new ConfigInt("sv_map_window", 15, 0, 100, ConfigFlags.Server, "Map downloading send-ahead window") }, { "SvFastDownload", new ConfigInt("sv_fast_download", 1, 0, 1, ConfigFlags.Server, "Enables fast download of maps") }, { "SvNetlimit", new ConfigInt("sv_netlimit", 0, 0, 10000, ConfigFlags.Server, "Netlimit: Maximum amount of traffic a client is allowed to use (in kb/s)") }, { "SvNetlimitAlpha", new ConfigInt("sv_netlimit_alpha", 50, 1, 100, ConfigFlags.Server, "Netlimit: Alpha of Exponention moving average") }, { "SvMapUpdateRate", new ConfigInt("sv_mapupdaterate", 5, 1, 100, ConfigFlags.Server, "(Tw32) real id <-> vanilla id players map update rate") }, { "SvReservedSlots", new ConfigInt("sv_reserved_slots", 0, 0, 16, ConfigFlags.Server, "The number of slots that are reserved for special players") }, { "SvReservedSlotsPass", new ConfigString("sv_reserved_slots_pass", 32, "", ConfigFlags.Server, "The password that is required to use a reserved slot") }, { "SvAllowOldClients", new ConfigInt("sv_allow_old_clients", 1, 0, 1, ConfigFlags.Server, "Allow clients to connect that do not support the anti-spoof protocol (this presents a DoS risk)") }, { "SvOldClientsPerInterval", new ConfigInt("sv_old_clients_per_interval", 5, 0, int.MaxValue, ConfigFlags.Server, "Maximum number of clients that can connect per interval set by `sv_old_clients_interval`") }, { "SvOldClientsInterval", new ConfigInt("sv_old_clients_interval", 20, 0, int.MaxValue, ConfigFlags.Server, "Interval (in seconds) in which `sv_old_clients_per_interval` clients are allowed to connect") }, { "SvOldClientsSkip", new ConfigInt("sv_old_clients_skip", 20, 0, int.MaxValue, ConfigFlags.Server, "How many legacy connection attempts to ignore before sending a legacy handshake despite the rate limit being hit") }, { "SvName", new ConfigString("sv_name", 128, "TeeSharp server", ConfigFlags.Server, "Server name") }, { "SvHostname", new ConfigString("sv_hostname", 128, "", ConfigFlags.Save | ConfigFlags.Server, "Server hostname") }, { "SvPort", new ConfigInt("sv_port", 8303, 0, 65535, ConfigFlags.Server, "Port to use for the server") }, { "SvExternalPort", new ConfigInt("sv_external_port", 0, 0, 0, ConfigFlags.Server, "External port to report to the master servers") }, { "SvMap", new ConfigString("sv_map", 128, "dm1", ConfigFlags.Server, "Map to use on the server") }, { "SvMaxClients", new ConfigInt("sv_max_clients", 64, 1, 64, ConfigFlags.Server, "Maximum number of clients that are allowed on a server") }, { "SvMaxClientsPerIP", new ConfigInt("sv_max_clients_per_ip", 64, 1, 64, ConfigFlags.Server, "Maximum number of clients with the same IP that can connect to the server") }, { "SvMapDownloadSpeed", new ConfigInt("sv_map_download_speed", 2, 1, 16, ConfigFlags.Save | ConfigFlags.Server, "Number of map data packages a client gets on each request") }, { "SvHighBandwidth", new ConfigInt("sv_high_bandwidth", 0, 0, 1, ConfigFlags.Server, "Use high bandwidth mode. Doubles the bandwidth required for the server. LAN use only") }, { "SvRegister", new ConfigInt("sv_register", 1, 0, 1, ConfigFlags.Server, "Register server with master server for public listing") }, { "SvRconPassword", new ConfigString("sv_rcon_password", 32, "", ConfigFlags.Server, "Remote console password (full access)") }, { "SvRconModPassword", new ConfigString("sv_rcon_mod_password", 32, "", ConfigFlags.Server, "Remote console password for moderators (limited access)") }, { "SvRconMaxTries", new ConfigInt("sv_rcon_max_tries", 5, 0, 100, ConfigFlags.Server, "Maximum number of tries for remote console authentication") }, { "SvRconBantime", new ConfigInt("sv_rcon_bantime", 0, 0, 1440, ConfigFlags.Server, "The time a client gets banned if remote console authentication fails. 0 makes it just use kick") }, { "SvAutoDemoRecord", new ConfigInt("sv_auto_demo_record", 0, 0, 1, ConfigFlags.Server, "Automatically record demos") }, { "SvAutoDemoMax", new ConfigInt("sv_auto_demo_max", 10, 0, 1000, ConfigFlags.Server, "Maximum number of automatically recorded demos (0 = no limit)") }, { "SvWarmup", new ConfigInt("sv_warmup", 0, 0, 0, ConfigFlags.Server, "Number of seconds to do warmup before round starts") }, { "SvMotd", new ConfigString("sv_motd", 900, "", ConfigFlags.Server, "Message of the day to display for the clients") }, { "SvTeamdamage", new ConfigInt("sv_teamdamage", 0, 0, 1, ConfigFlags.Server, "Team damage") }, { "SvMaprotation", new ConfigString("sv_maprotation", 768, "", ConfigFlags.Server, "Maps to rotate between") }, { "SvMatchesPerMap", new ConfigInt("sv_matches_per_map", 1, 1, 100, ConfigFlags.Save | ConfigFlags.Server, "Number of matches on each map before rotating") }, { "SvMatchSwap", new ConfigInt("sv_match_swap", 1, 0, 1, ConfigFlags.Server, "Swap teams between matches") }, { "SvPowerups", new ConfigInt("sv_powerups", 1, 0, 1, ConfigFlags.Server, "Allow powerups like ninja") }, { "SvScorelimit", new ConfigInt("sv_scorelimit", 20, 0, 1000, ConfigFlags.Save | ConfigFlags.Server, "Score limit (0 disables)") }, { "SvTimelimit", new ConfigInt("sv_timelimit", 0, 0, 1000, ConfigFlags.Server, "Time limit in minutes (0 disables)") }, { "SvGametype", new ConfigString("sv_gametype", 32, "dm", ConfigFlags.Server, "Game type (dm, tdm, ctf)") }, { "SvTournamentMode", new ConfigInt("sv_tournament_mode", 0, 0, 2, ConfigFlags.Save | ConfigFlags.Server, "Tournament mode. When enabled, players joins the server as spectator (2=additional restricted spectator chat)") }, { "SvPlayerReadyMode", new ConfigInt("sv_player_ready_mode", 0, 0, 1, ConfigFlags.Save | ConfigFlags.Server, "When enabled, players can pause/unpause the game and start the game on warmup via their ready state") }, { "SvSpamprotection", new ConfigInt("sv_spamprotection", 1, 0, 1, ConfigFlags.Server, "Spam protection") }, { "SvRespawnDelayTDM", new ConfigInt("sv_respawn_delay_tdm", 3, 0, 10, ConfigFlags.Server, "Time needed to respawn after death in tdm gametype") }, //{ "SvSpectatorSlots", new ConfigInt("SvSpectatorSlots", "sv_spectator_slots", 0, 0, 64, ConfigFlags.Server, "Number of slots to reserve for spectators") }, { "SvPlayerSlots", new ConfigInt("sv_player_slots", 8, 0, 64 /* TODO */, ConfigFlags.Save | ConfigFlags.Server, "Number of slots to reserve for players") }, { "SvSkillLevel", new ConfigInt("sv_skill_level", 1, 0, 2 /* TODO */, ConfigFlags.Save | ConfigFlags.Server, "Supposed player skill level") }, { "SvTeambalanceTime", new ConfigInt("sv_teambalance_time", 1, 0, 1000, ConfigFlags.Server, "How many minutes to wait before autobalancing teams") }, { "SvInactiveKickTime", new ConfigInt("sv_inactivekick_time", 3, 0, 1000, ConfigFlags.Server, "How many minutes to wait before taking care of inactive players") }, { "SvInactiveKick", new ConfigInt("sv_inactivekick", 1, 0, 2, ConfigFlags.Server, "How to deal with inactive players (0=move to spectator, 1=move to free spectator slot/kick, 2=kick)") }, { "SvSilentSpectatorMode", new ConfigInt("sv_silent_spectator_mode", 1, 0, 1, ConfigFlags.Save | ConfigFlags.Server, "Mute join/leave message of spectator") }, { "SvStrictSpectateMode", new ConfigInt("sv_strict_spectate_mode", 0, 0, 1, ConfigFlags.Server, "Restricts information in spectator mode") }, { "SvVoteSpectate", new ConfigInt("sv_vote_spectate", 1, 0, 1, ConfigFlags.Server, "Allow voting to move players to spectators") }, { "SvVoteSpectateRejoindelay", new ConfigInt("sv_vote_spectate_rejoindelay", 3, 0, 1000, ConfigFlags.Server, "How many minutes to wait before a player can rejoin after being moved to spectators by vote") }, { "SvVoteKick", new ConfigInt("sv_vote_kick", 1, 0, 1, ConfigFlags.Server, "Allow voting to kick players") }, { "SvVoteKickMin", new ConfigInt("sv_vote_kick_min", 0, 0, 64, ConfigFlags.Server, "Minimum number of players required to start a kick vote") }, { "SvVoteKickBantime", new ConfigInt("sv_vote_kick_bantime", 5, 0, 1440, ConfigFlags.Server, "The time to ban a player if kicked by vote. 0 makes it just use kick") }, }); }
public override IEnumerable <KeyValuePair <string, ConsoleCommand> > GetCommands(int accessLevel, ConfigFlags flags = ConfigFlags.All) { return(Commands.Where(pair => pair.Value.AccessLevel <= accessLevel && pair.Value.Flags.HasFlag(flags))); }
/// <summary> /// 获取标识位 /// </summary> /// <param name="flag"></param> /// <returns></returns> public Boolean GetFlag(ConfigFlags flag) { return (Flag & flag) == flag; }