/// <summary> /// Initializes default attributes and sets up command dispatching /// </summary> public EventsController() : base() { this.Shared = new SharedReferences(); this.LoggedEvents = new List<IGenericEvent>(); this.CommandDispatchers.AddRange(new List<ICommandDispatch>() { new CommandDispatch() { CommandType = CommandType.EventsFetchAfterEventId, ParameterTypes = new List<CommandParameterType>() { new CommandParameterType() { Name = "eventId", Type = typeof(ulong) } }, Handler = this.EventsFetchAfterEventId }, new CommandDispatch() { CommandType = CommandType.EventsLog, ParameterTypes = new List<CommandParameterType>() { new CommandParameterType() { Name = "event", Type = typeof(IGenericEvent) } }, Handler = this.EventsLog } }); }
/// <summary> /// Creates new controller with the default attributes set /// </summary> public TextCommandController() { this.Shared = new SharedReferences(); this.TextCommands = new List<TextCommandModel>(); this.CommandDispatchers.AddRange(new List<ICommandDispatch>() { new CommandDispatch() { CommandType = CommandType.TextCommandsExecute, ParameterTypes = new List<CommandParameterType>() { new CommandParameterType() { Name = "text", Type = typeof(String) } }, Handler = this.TextCommandsExecute }, new CommandDispatch() { CommandType = CommandType.TextCommandsPreview, ParameterTypes = new List<CommandParameterType>() { new CommandParameterType() { Name = "text", Type = typeof(String) } }, Handler = this.TextCommandsPreview }, new CommandDispatch() { CommandType = CommandType.TextCommandsRegister, ParameterTypes = new List<CommandParameterType>() { new CommandParameterType() { Name = "textCommand", Type = typeof(TextCommandModel) } }, Handler = this.TextCommandsRegister }, new CommandDispatch() { CommandType = CommandType.TextCommandsUnregister, ParameterTypes = new List<CommandParameterType>() { new CommandParameterType() { Name = "textCommand", Type = typeof(TextCommandModel) } }, Handler = this.TextCommandsUnregister } }); }
internal override bool Reconstruct(BlamLib.Blam.CacheFile c) { PredictedResources.DeleteAll(); EditorScenarioData.Delete(); LevelData.DeleteAll(); SharedReferences.DeleteAll(); SimulationDefinitionTable.DeleteAll(); DeleteCompiledScripts(); if (ScenarioResources.Count >= 1) { var scenario_resources = ScenarioResources[0]; scenario_resources.references.DeleteAll(); scenario_resources.ai_resources.DeleteAll(); } return(true); }
/// <summary> /// Default Initialization /// </summary> public CorePluginController() : base() { this.Shared = new SharedReferences(); this.LoadedPlugins = new List<PluginModel>(); this.CorePluginControllerCallbackProxy = new CorePluginControllerCallbackProxy() { BubbleObjects = { this } }; this.CommandDispatchers.AddRange(new List<ICommandDispatch>() { new CommandDispatch() { CommandType = CommandType.PluginsEnable, Handler = this.EnablePlugin }, new CommandDispatch() { CommandType = CommandType.PluginsDisable, Handler = this.DisablePlugin } }); }
/// <summary> /// Initializes default attributes /// </summary> public DatabaseController() : base() { this.Shared = new SharedReferences(); this.OpenDrivers = new Dictionary<String, IDriver>(); this.GroupedVariableListener = new GroupedVariableListener() { Variables = this.Shared.Variables, GroupsVariableName = CommonVariableNames.DatabaseConfigGroups.ToString(), ListeningVariablesNames = new List<String>() { CommonVariableNames.DatabaseDriverName.ToString(), CommonVariableNames.DatabaseHostname.ToString(), CommonVariableNames.DatabasePort.ToString(), CommonVariableNames.DatabaseUid.ToString(), CommonVariableNames.DatabasePassword.ToString(), CommonVariableNames.DatabaseMemory.ToString() } }; this.CommandDispatchers.AddRange(new List<ICommandDispatch>() { new CommandDispatch() { CommandType = CommandType.DatabaseQuery, ParameterTypes = new List<CommandParameterType>() { new CommandParameterType() { Name = "query", Type = typeof(IDatabaseObject) } }, Handler = this.Query }, new CommandDispatch() { CommandType = CommandType.DatabaseQuery, ParameterTypes = new List<CommandParameterType>() { new CommandParameterType() { Name = "query", Type = typeof(IDatabaseObject), IsList = true } }, Handler = this.Query }, new CommandDispatch() { CommandType = CommandType.DatabaseQuery, ParameterTypes = new List<CommandParameterType>() { new CommandParameterType() { Name = "driver", Type = typeof(String) }, new CommandParameterType() { Name = "query", Type = typeof(IDatabaseObject) } }, Handler = this.QueryDriver }, new CommandDispatch() { CommandType = CommandType.DatabaseQuery, ParameterTypes = new List<CommandParameterType>() { new CommandParameterType() { Name = "driver", Type = typeof(String) }, new CommandParameterType() { Name = "query", Type = typeof(IDatabaseObject), IsList = true } }, Handler = this.QueryDriver } }); }
/// <summary> /// Initializes a security controller with the default values and dispatch. /// </summary> public SecurityController() : base() { this.Shared = new SharedReferences(); this.Groups = new List<GroupModel>() { new GroupModel() { Name = "Guest", IsGuest = true } }; this.CommandDispatchers.AddRange(new List<ICommandDispatch>() { new CommandDispatch() { CommandType = CommandType.SecurityAddGroup, ParameterTypes = new List<CommandParameterType>() { new CommandParameterType() { Name = "groupName", Type = typeof(String) } }, Handler = this.SecurityAddGroup }, new CommandDispatch() { CommandType = CommandType.SecurityRemoveGroup, ParameterTypes = new List<CommandParameterType>() { new CommandParameterType() { Name = "groupName", Type = typeof(String) } }, Handler = this.SecurityRemoveGroup }, new CommandDispatch() { CommandType = CommandType.SecurityRemoveAccount, ParameterTypes = new List<CommandParameterType>() { new CommandParameterType() { Name = "username", Type = typeof(String) } }, Handler = this.SecurityRemoveAccount }, new CommandDispatch() { CommandType = CommandType.SecurityRemovePlayer, ParameterTypes = new List<CommandParameterType>() { new CommandParameterType() { Name = "gameType", Type = typeof(String) }, new CommandParameterType() { Name = "uid", Type = typeof(String) } }, Handler = this.SecurityRemovePlayer }, new CommandDispatch() { CommandType = CommandType.SecurityQueryPermission, ParameterTypes = new List<CommandParameterType>() { new CommandParameterType() { Name = "commandName", Type = typeof(String) }, new CommandParameterType() { Name = "targetGameType", Type = typeof(String) }, new CommandParameterType() { Name = "targetUid", Type = typeof(String) } }, Handler = this.DispatchPermissionsCheckByAccountPlayerDetails }, new CommandDispatch() { CommandType = CommandType.SecurityQueryPermission, ParameterTypes = new List<CommandParameterType>() { new CommandParameterType() { Name = "commandName", Type = typeof(String) }, new CommandParameterType() { Name = "targetAccountName", Type = typeof(String) } }, Handler = this.DispatchPermissionsCheckByAccountDetails }, new CommandDispatch() { CommandType = CommandType.SecurityQueryPermission, ParameterTypes = new List<CommandParameterType>() { new CommandParameterType() { Name = "commandName", Type = typeof(String) } }, Handler = this.DispatchPermissionsCheckByCommand }, new CommandDispatch() { CommandType = CommandType.SecurityGroupSetPermission, ParameterTypes = new List<CommandParameterType>() { new CommandParameterType() { Name = "groupName", Type = typeof(String) }, new CommandParameterType() { Name = "permissionName", Type = typeof(String) }, new CommandParameterType() { Name = "authority", Type = typeof(int) } }, Handler = this.SecurityGroupSetPermission }, new CommandDispatch() { CommandType = CommandType.SecurityGroupAppendPermissionTrait, ParameterTypes = new List<CommandParameterType>() { new CommandParameterType() { Name = "groupName", Type = typeof(String) }, new CommandParameterType() { Name = "permissionName", Type = typeof(String) }, new CommandParameterType() { Name = "trait", Type = typeof(String) } }, Handler = this.SecurityGroupAppendPermissionTrait }, new CommandDispatch() { CommandType = CommandType.SecurityGroupRemovePermissionTrait, ParameterTypes = new List<CommandParameterType>() { new CommandParameterType() { Name = "groupName", Type = typeof(String) }, new CommandParameterType() { Name = "permissionName", Type = typeof(String) }, new CommandParameterType() { Name = "trait", Type = typeof(String) } }, Handler = this.SecurityGroupRemovePermissionTrait }, new CommandDispatch() { CommandType = CommandType.SecurityGroupSetPermissionDescription, ParameterTypes = new List<CommandParameterType>() { new CommandParameterType() { Name = "groupName", Type = typeof(String) }, new CommandParameterType() { Name = "permissionName", Type = typeof(String) }, new CommandParameterType() { Name = "description", Type = typeof(String) } }, Handler = this.SecurityGroupSetPermissionDescription }, new CommandDispatch() { CommandType = CommandType.SecurityGroupCopyPermissions, ParameterTypes = new List<CommandParameterType>() { new CommandParameterType() { Name = "sourceGroupName", Type = typeof(String) }, new CommandParameterType() { Name = "destinationGroupName", Type = typeof(String) } }, Handler = this.SecurityGroupCopyPermissions }, new CommandDispatch() { CommandType = CommandType.SecurityGroupAddAccount, ParameterTypes = new List<CommandParameterType>() { new CommandParameterType() { Name = "groupName", Type = typeof(String) }, new CommandParameterType() { Name = "username", Type = typeof(String) } }, Handler = this.SecurityGroupAddAccount }, new CommandDispatch() { CommandType = CommandType.SecurityAccountAddPlayer, ParameterTypes = new List<CommandParameterType>() { new CommandParameterType() { Name = "username", Type = typeof(String) }, new CommandParameterType() { Name = "gameType", Type = typeof(String) }, new CommandParameterType() { Name = "uid", Type = typeof(String) } }, Handler = this.SecurityAccountAddPlayer }, new CommandDispatch() { CommandType = CommandType.SecurityAccountSetPassword, ParameterTypes = new List<CommandParameterType>() { new CommandParameterType() { Name = "username", Type = typeof(String) }, new CommandParameterType() { Name = "password", Type = typeof(String) } }, Handler = this.SecurityAccountSetPassword }, new CommandDispatch() { CommandType = CommandType.SecurityAccountSetPasswordHash, ParameterTypes = new List<CommandParameterType>() { new CommandParameterType() { Name = "username", Type = typeof(String) }, new CommandParameterType() { Name = "passwordHash", Type = typeof(String) } }, Handler = this.SecurityAccountSetPasswordHash }, new CommandDispatch() { CommandType = CommandType.SecurityAccountAppendAccessToken, ParameterTypes = new List<CommandParameterType>() { new CommandParameterType() { Name = "username", Type = typeof(String) }, new CommandParameterType() { Name = "id", Type = typeof(Guid) }, new CommandParameterType() { Name = "tokenHash", Type = typeof(String) }, new CommandParameterType() { Name = "lastTouched", Type = typeof(DateTime) } }, Handler = this.SecurityAccountAppendAccessToken }, new CommandDispatch() { CommandType = CommandType.SecurityAccountAuthenticate, ParameterTypes = new List<CommandParameterType>() { new CommandParameterType() { Name = "username", Type = typeof(String) }, new CommandParameterType() { Name = "passwordPlainText", Type = typeof(String) }, new CommandParameterType() { Name = "identifier", Type = typeof(String) } }, Handler = this.SecurityAccountAuthenticate }, new CommandDispatch() { CommandType = CommandType.SecurityAccountAuthenticateToken, ParameterTypes = new List<CommandParameterType>() { new CommandParameterType() { Name = "id", Type = typeof(Guid) }, new CommandParameterType() { Name = "token", Type = typeof(String) }, new CommandParameterType() { Name = "identifier", Type = typeof(String) } }, Handler = this.SecurityAccountAuthenticateToken }, new CommandDispatch() { CommandType = CommandType.SecurityAccountSetPreferredLanguageCode, ParameterTypes = new List<CommandParameterType>() { new CommandParameterType() { Name = "username", Type = typeof(String) }, new CommandParameterType() { Name = "languageCode", Type = typeof(String) } }, Handler = this.SecurityAccountSetPreferredLanguageCode }, new CommandDispatch() { CommandType = CommandType.SecuritySetPredefinedStreamPermissions, ParameterTypes = new List<CommandParameterType>() { new CommandParameterType() { Name = "groupName", Type = typeof(String) } }, Handler = this.SecuritySetPredefinedStreamPermissions }, new CommandDispatch() { CommandType = CommandType.SecuritySetPredefinedAdministratorsPermissions, ParameterTypes = new List<CommandParameterType>() { new CommandParameterType() { Name = "groupName", Type = typeof(String) } }, Handler = this.SecuritySetPredefinedAdministratorsPermissions } }); }
/// <summary> /// Initializes the certificate with the default values. /// </summary> public CertificateController() { this.Shared = new SharedReferences(); }
/// <summary> /// Initalizes the command server controller with default values /// </summary> public CommandServerController() : base() { this.Shared = new SharedReferences(); this.Certificate = new CertificateController(); }
/// <summary> /// Initializes events console with default values. /// </summary> public EventsConsoleController() : base() { this.Shared = new SharedReferences(); }
/// <summary> /// Initializes with default attributes /// </summary> public PushEventsController() : base() { this.Shared = new SharedReferences(); this.EndPoints = new Dictionary<String, IPushEventsEndPoint>(); this.Tasks = new List<Timer>(); this.CommandDispatchers.AddRange(new List<ICommandDispatch>() { new CommandDispatch() { CommandType = CommandType.EventsEstablishJsonStream, ParameterTypes = new List<CommandParameterType>() { new CommandParameterType() { Name = "name", Type = typeof(String) }, new CommandParameterType() { Name = "uri", Type = typeof(String) }, new CommandParameterType() { Name = "key", Type = typeof(String) }, new CommandParameterType() { Name = "interval", Type = typeof(int) }, new CommandParameterType() { IsList = true, Name = "inclusive", Type = typeof(String) } }, Handler = this.EventsEstablishJsonStream }, new CommandDispatch() { CommandType = CommandType.EventsEstablishJsonStream, ParameterTypes = new List<CommandParameterType>() { new CommandParameterType() { Name = "name", Type = typeof(String) }, new CommandParameterType() { Name = "uri", Type = typeof(String) }, new CommandParameterType() { Name = "key", Type = typeof(String) }, new CommandParameterType() { Name = "interval", Type = typeof(int) }, new CommandParameterType() { Name = "inclusive", Type = typeof(String) } }, Handler = this.EventsEstablishJsonStream } }); this.GroupedVariableListener = new GroupedVariableListener() { GroupsVariableName = CommonVariableNames.EventsPushConfigGroups.ToString(), ListeningVariablesNames = new List<String>() { CommonVariableNames.EventsPushUri.ToString(), CommonVariableNames.EventPushIntervalSeconds.ToString(), CommonVariableNames.EventPushContentType.ToString(), CommonVariableNames.EventPushStreamKey.ToString(), CommonVariableNames.EventPushInclusiveNames.ToString() } }; }
/// <summary> /// Initiates the package controller with the default values. /// </summary> public PackagesController() { this.Shared = new SharedReferences(); this.Cache = new RepositoryCache(); this.LocalRepository = PackageRepositoryFactory.Default.CreateRepository(Defines.PackagesDirectory.FullName); this.GroupedVariableListener = new GroupedVariableListener() { Variables = this.Shared.Variables, GroupsVariableName = CommonVariableNames.PackagesConfigGroups.ToString(), ListeningVariablesNames = new List<String>() { CommonVariableNames.PackagesRepositoryUri.ToString() } }; this.CommandDispatchers.AddRange(new List<ICommandDispatch>() { new CommandDispatch() { CommandType = CommandType.PackagesMergePackage, ParameterTypes = new List<CommandParameterType>() { new CommandParameterType() { Name = "packageId", Type = typeof(String) } }, Handler = this.PackagesMergePackage }, new CommandDispatch() { CommandType = CommandType.PackagesUninstallPackage, ParameterTypes = new List<CommandParameterType>() { new CommandParameterType() { Name = "packageId", Type = typeof(String) } }, Handler = this.PackagesUninstallPackage }, new CommandDispatch() { CommandType = CommandType.PackagesFetchPackages, Handler = this.PackagesFetchPackages }, new CommandDispatch() { CommandType = CommandType.PackagesAppendRepository, ParameterTypes = new List<CommandParameterType>() { new CommandParameterType() { Name = "uri", Type = typeof(String) } }, Handler = this.PackagesAppendRepository }, new CommandDispatch() { CommandType = CommandType.PackagesRemoveRepository, ParameterTypes = new List<CommandParameterType>() { new CommandParameterType() { Name = "uri", Type = typeof(String) } }, Handler = this.PackagesRemoveRepository } }); }
/// <summary> /// Initializes the connection controller with default values, setting up command dispatches /// </summary> public ConnectionController() : base() { this.Shared = new SharedReferences(); this.ConnectionModel = new ConnectionModel(); this.ProtocolState = new ProtocolState(); this.CommandDispatchers.AddRange(new List<ICommandDispatch>() { new CommandDispatch() { CommandType = CommandType.ConnectionQuery, Handler = this.ConnectionQuery }, new CommandDispatch() { CommandType = CommandType.NetworkProtocolQueryPlayers, Handler = this.NetworkProtocolQueryPlayers }, new CommandDispatch() { CommandType = CommandType.NetworkProtocolQuerySettings, Handler = this.NetworkProtocolQuerySettings }, new CommandDispatch() { CommandType = CommandType.NetworkProtocolQueryBans, Handler = this.NetworkProtocolQueryBans }, new CommandDispatch() { CommandType = CommandType.NetworkProtocolQueryMaps, Handler = this.NetworkProtocolQueryMaps }, new CommandDispatch() { CommandType = CommandType.NetworkProtocolQueryMapPool, Handler = this.NetworkProtocolQueryMapPool } }); // Add all network actions, dispatching them to NetworkProtocolAction this.CommandDispatchers.AddRange(Enum.GetValues(typeof(NetworkActionType)).Cast<NetworkActionType>().Select(actionType => new CommandDispatch() { Name = actionType.ToString(), ParameterTypes = new List<CommandParameterType>() { new CommandParameterType() { Name = "action", Type = typeof(INetworkAction) } }, Handler = this.NetworkProtocolAction })); this.CommandDispatchers.AddRange(Enum.GetValues(typeof(NetworkActionType)).Cast<NetworkActionType>().Select(actionType => new CommandDispatch() { Name = actionType.ToString(), ParameterTypes = new List<CommandParameterType>() { new CommandParameterType() { Name = "action", Type = typeof(INetworkAction), IsList = true } }, Handler = this.NetworkProtocolActions })); }
/// <summary> /// Initializes the language controller with the default values. /// </summary> public LanguageController() : base() { this.Shared = new SharedReferences(); this.Default = null; this.LoadedLanguageFiles = new List<LanguageConfig>(); this.CommandDispatchers.AddRange(new List<ICommandDispatch>() { new CommandDispatch() { CommandType = CommandType.LanguageLocalize, ParameterTypes = new List<CommandParameterType>() { new CommandParameterType() { Name = "languageCode", Type = typeof(String) }, new CommandParameterType() { Name = "namespace", Type = typeof(String) }, new CommandParameterType() { Name = "name", Type = typeof(String) }, new CommandParameterType() { Name = "args", Type = typeof(String), IsList = true, IsConvertable = true } }, Handler = this.Localize }, new CommandDispatch() { CommandType = CommandType.LanguageLocalize, ParameterTypes = new List<CommandParameterType>() { new CommandParameterType() { Name = "languageCode", Type = typeof(String) }, new CommandParameterType() { Name = "namespace", Type = typeof(String) }, new CommandParameterType() { Name = "name", Type = typeof(String) }, new CommandParameterType() { Name = "arg", Type = typeof(String) } }, Handler = this.SingleParameterLocalize }, new CommandDispatch() { CommandType = CommandType.LanguageLocalize, ParameterTypes = new List<CommandParameterType>() { new CommandParameterType() { Name = "languageCode", Type = typeof(String) }, new CommandParameterType() { Name = "namespace", Type = typeof(String) }, new CommandParameterType() { Name = "name", Type = typeof(String) } }, Handler = this.ParameterlessLocalize } }); }