internal void Connect(string arguments, Channel channel) { Logger.Debug($"Current arguments: {arguments}."); Arguments = !string.IsNullOrEmpty(arguments) ? arguments.Split(new char[] { ' ' }) : new string[0]; Logger.Debug($"Current config: {channel.GetType().Name}."); Channel = channel; // waiting for storm to send connect message Logger.Debug("Waiting for connect message."); ConnectMessage message = (ConnectMessage)Channel.Receive <ConnectMessage>(); int pid = Process.GetCurrentProcess().Id; // storm requires to create empty file named with PID if (!string.IsNullOrEmpty(message.PidDir) && Directory.Exists(message.PidDir)) { Logger.Debug($"Creating pid file. PidDir: {message.PidDir}; PID: {pid}"); string path = Path.Combine(message.PidDir, pid.ToString()); File.WriteAllText(path, ""); } Logger.Debug($"Current context: {JsonConvert.SerializeObject(message.Context)}."); Context = message.Context; Logger.Debug($"Current config: {JsonConvert.SerializeObject(message.Configuration)}."); Configuration = message.Configuration; // send PID back to storm Channel.Send(new PidMessage(pid)); OnInitialized?.Invoke(this, EventArgs.Empty); }
public async Task Initialize() { clientNodeSpecification = new Ubii.Clients.Client { Name = clientName, IsDedicatedProcessingNode = isDedicatedProcessingNode }; List <Ubii.Processing.ProcessingModule> pmDatabaseList = processingModuleDatabase.GetAllSpecifications(); //Debug.Log("Node init PM list: " + pmDatabaseList.Count); foreach (Ubii.Processing.ProcessingModule pm in pmDatabaseList) { clientNodeSpecification.ProcessingModules.Add(pm); } bool success = await InitNetworkConnection(); if (success) { OnConnected?.Invoke(); processingModuleManager = new ProcessingModuleManager(this.GetID(), null, this.processingModuleDatabase, this.topicDataProxy); await SubscribeSessionInfo(); OnInitialized?.Invoke(); Debug.Log("Node client specs: " + clientNodeSpecification); } else { Debug.LogError("UbiiNode.Initialize() - failed to establish network connection to master node"); } }
public static void Init() { LinkAssemblies(); IsInitialized = true; OnInitialized?.Invoke(null, EventArgs.Empty); }
public bool Initialize(Engine engine) { this.engine = engine; if (!TryOpenMpq(out mpq)) { OnFailedInitialize?.Invoke(); waitForInitialized.SetResult(false); waitForInitialized = new(); return(false); } coroutineManager = new(); NotificationsCenter = new NotificationsCenter(this); TimeManager = new TimeManager(this); ScreenSpaceSelector = new ScreenSpaceSelector(this); DbcManager = new DbcManager(this, databaseClientFileOpener); CurrentMap = DbcManager.MapStore.FirstOrDefault(m => m.Id == 1) ?? Map.Empty; TextureManager = new WoWTextureManager(this); MeshManager = new WoWMeshManager(this); MdxManager = new MdxManager(this); WmoManager = new WmoManager(this); ChunkManager = new ChunkManager(this); CameraManager = new CameraManager(this); LightingManager = new LightingManager(this); AreaTriggerManager = new AreaTriggerManager(this); RaycastSystem = new RaycastSystem(engine); ModuleManager = new ModuleManager(this, gameView); // must be last OnInitialized?.Invoke(); IsInitialized = true; waitForInitialized.SetResult(true); return(true); }
private void SetSettings() { FirebaseApp.SetEditorDatabaseUrl("https://textquest-test.firebaseio.com/"); DbRoot = FirebaseDatabase.DefaultInstance.RootReference; DbRoot.ValueChanged += OnRootChanges; OnInitialized.Invoke(); }
/// <summary> /// The initializer for MainViewModel. /// </summary> /// <param name="uiDispatcher">The UI dispatcher.</param> public void Initialize(CoreDispatcher uiDispatcher) { RunOnUiThread(() => { OnInitialized?.Invoke(); }); }
private void _asr_OnInitialized(object sender, EventArgs e) { if (OnInitialized != null) { try { OnInitialized.Invoke(sender, e); } catch { } // 防止内部异常影响到这里 } }
// 建立连接事件 private void _client_OnConnected(object sender, EventArgs e) { if (OnInitialized != null) { OnInitialized.Invoke(sender, e); } }
public void Init() { TryRefreshData(); if (OnInitialized != null) { OnInitialized.Invoke(); } }
static void Init() { IsInitialized = true; Application = Windows.UI.Xaml.Application.Current; FormsGestures.UWP.Settings.Init(Windows.UI.Xaml.Application.Current); OnInitialized?.Invoke(null, EventArgs.Empty); LinkAssemblies(); }
/// <summary> /// 初始化 /// </summary> public void Initialize() { // 此方法在 AsrProxy 中使用,这里不需要做任何动作 if (OnInitialized != null) { OnInitialized.Invoke(this, new EventArgs()); } }
public void Init() { GenerateCommonItems(false); SetSelectionButtons(); isInitialized = true; OnInitialized?.Invoke(); }
/// <summary> /// Initializes the Plugin System. /// </summary> /// <param name="internalConfigPath">The Path that is used by internal config files by the Plugin System</param> /// <param name="pluginDirectory">The Path used as "Install Directory" for Plugins/Packages</param> public static void Initialize( string internalConfigPath, string pluginDirectory, Func <string, string, bool> updateDialog, Action <string, int, int> setStatus, string staticDataConfig = null, bool checkUpdates = true) { if (IsInitialized) { throw new Exception("Can not Initialize the Plugin System Twice"); } SendLog("Initializing Plugin System"); //TODO: Process Things like updates before the plugin system loads the libraries. PluginPaths.InternalSystemConfigPath = Path.GetFullPath(internalConfigPath); PluginPaths.PluginDirectory = Path.GetFullPath(pluginDirectory); PluginPaths.EnsureInternalDirectoriesExist(); PluginPaths.CreateInternalFilesIfMissing(); ErrorHandler.Initialize(); LoadOrder.Initialize(); if (staticDataConfig != null && File.Exists(staticDataConfig)) { StaticData.SetState(File.ReadAllText(staticDataConfig)); } IsInitialized = true; SendLog("Updating.."); PluginHost = new PluginSystemHost(); HelperClass.ReloadDefaultPlugins(); OnInitialized?.Invoke(); if (File.Exists(PluginPaths.InternalStartupInstructionPath)) { SendLog("Running Start Actions.."); ActionRunner.RunActions(); } if (checkUpdates) { ListHelper.LoadList(PluginPaths.PluginListFile).Select(x => new BasePluginPointer(x)).ToList() .ForEach(x => UpdateManager.CheckAndUpdate(x, updateDialog, setStatus)); } SendLog("Registering System Host.."); LoadPlugins(PluginHost); SendLog("Registered System Host.."); SendLogDivider(); //Everything Finished SendLog("Initialization Complete."); SendLogDivider(); }
public static void Init(Context context, Bundle bundle) { LinkAssemblies(); Context = context; IsInitialized = true; OnInitialized?.Invoke(null, EventArgs.Empty); }
private static void OnAdvertiserIdRequestDone(string id, bool isTrackingEnabled, string errorMsg) { AdvertiserId = id; IsTrackingEnabled = isTrackingEnabled; Log("Advertiser ID requested"); IsInitialized = true; Log($"Initialized | Post schedule file name: {Settings.postScheduleFileName} | App ID: {Settings.appId} | API Key: {Settings.apiKey}"); OnInitialized.Invoke(); }
void Init(int tick) { Toolbox.Log("Init servertick: " + tick); // currentTick = tick; initialized = true; elapsedTime = 0; // elapsedTime = serverCurrentTickElapsedTime + (NetworkManager.singleton.client.GetRTT() / 2f / 1000f); OnInitialized?.Invoke(currentTick); }
public void Initialize(CardStack draw, CardStack discard, PlayerHand inspect, PlayerHand[] playerHands) { Draw = draw; Discard = discard; Inspect = inspect; PlayerHands = playerHands; IsInitialized = true; OnInitialized?.Invoke(this, new OnInitializedArgs(PlayerHands)); }
private void Initialize() { _cleanFingers = (BonePose[])wrapee.Fingers.Clone(); _cleanHand = new BonePose() { boneID = BoneId.Hand_Start, rotation = wrapee.Hand.rotation, position = wrapee.Hand.position }; OnInitialized?.Invoke(); }
public void Initialize() { if (IsInitialized) { return; } IsInitialized = true; //UIマネージャーに登録 UIManager.Instance.Register(this); OnInitialized?.Invoke(); }
private IEnumerator InitializeAsync(ConnectionManager connectionManager) { this.ConnectionManager = connectionManager ?? throw new ArgumentNullException(nameof(connectionManager)); Spawner = new GameSpawner(this); connectionManager.OnPlayerConnect += OnPlayerConnect; connectionManager.OnActivePlayersUpdated += OnActivePlayersUpdated; connectionManager.OnPlayerDisconnect += OnPlayerDisconnect; yield return(connectionManager.Initialize()); Initialized = true; OnInitialized?.Invoke(this, EventArgs.Empty); }
private int OnPresent(IntPtr swapChainPointer, int syncInterval, int flags) { if (Initialized) { return(_presentHook.OriginalFunction(swapChainPointer, syncInterval, flags)); } var device = new SwapChain(swapChainPointer).GetDevice <Device>(); OnInitialized?.Invoke(device, device.ImmediateContext); Initialized = true; return(_presentHook.OriginalFunction(swapChainPointer, syncInterval, flags)); }
protected virtual void RaiseOnInitialized() { try { if (!Initialized && !Unloaded) { Initialized = true; OnInitialized.RaiseEvent(this, null); } } catch (Exception ex) { Global.Logger.AddItem(new LogItem(ex)); } }
/// <summary> /// Init xul and start message loop /// </summary> private static void InitXul() { _invoker = new Control(); _invoker.CreateControl(); Xpcom.AfterInitalization += () => { _initialized = true; _initializedSignal?.Release(); OnInitialized?.Invoke(); }; Xpcom.EnableProfileMonitoring = false; Xpcom.Initialize(_xulPath); Application.Run(); }
protected virtual void OnInitialize() { try { if (!Initialized && !Unloaded) { Initialized = true; OnInitialized.RaiseEvent(this, null); var map = Utility.Map.GetMap().Type; if (BlacklistedMaps.Any(m => m.Equals(map))) { OnUnload(null, new UnloadEventArgs(true)); } } } catch (Exception ex) { Global.Logger.AddItem(new LogItem(ex)); } }
public void InitializeBoard(BoardModel StartBoard) { for (int i = 0; i < StartBoard.Bottom.Length; i++) { if (StartBoard.Bottom[i] != default) { Bottom[i].Add(StartBoard.Bottom[i]); } } for (int i = 0; i < StartBoard.Top.Length; i++) { if (StartBoard.Top[i] != default) { Top[i].Add(StartBoard.Bottom[i]); } } DeckCard = StartBoard.DeckCard; OnInitialized?.Invoke(StartBoard); }
private void Initialize() { var temp = Resources.LoadAll <IngredientSo>(INGREDIENT_PATH + specificFolderName); //Offsets the elements to form a grid pattern. int height = 0; for (int i = 0; i < temp.Length; i++) { IngredientSlice slice = Instantiate(ingredientPrefab, parentTransform).GetComponent <IngredientSlice>(); slice.Initialize(temp[i]); int tempWidth = (i % width); slice.transform.localPosition = new Vector3(tempWidth * horizontalPadding, 0, height * verticalPadding); if (tempWidth == width - 1) { height++; } } //Invocation for ingredient response to update. OnInitialized?.Invoke(); }
public void Initialize(ItemModel itemInformation) { _itemInformation = itemInformation; if (itemName != null) { itemName.text = _itemInformation.Name; } if (itemDescription != null) { itemDescription.text = _itemInformation.Description; } LoadImage(_itemInformation.ImageUrl); if (_itemInformation.IsSubscription()) { AttachRenewSubscriptionHandler(); } OnInitialized?.Invoke(itemInformation); }
/// <summary> /// Initializes the network classes, but doesn't establish connection. /// </summary> /// <param name="peerType">Client, Server or Both.</param> /// <param name="port"></param> public void InitNetwork(PeerType peerType, int?port = 1777) { InitializeMessageLoopActions(); this.LocalPeerType = peerType; switch (this.LocalPeerType) { case PeerType.Client: var npConfig = new NetPeerConfiguration(AppName); client = new NetClient(npConfig); break; case PeerType.Server: serverConfiguration = new NetPeerConfiguration(AppName); if (port != null) { serverConfiguration.Port = (int)port; } server = new NetServer(serverConfiguration); break; case PeerType.Both: serverConfiguration = new NetPeerConfiguration(AppName); var cConfig = new NetPeerConfiguration(AppName); cConfig.Port = (int)port + 1; client = new NetClient(cConfig); if (port != null) { serverConfiguration.Port = (int)port; } server = new NetServer(serverConfiguration); server.Start(); break; default: throw new ArgumentOutOfRangeException(nameof(this.LocalPeerType), this.LocalPeerType, null); } OnInitialized?.Invoke(this.LocalPeerType); }
public void Init() { InitLists(); int hexagonCoordinatesCount = transform.childCount; _allHexagonCoordinates = new GameObject[hexagonCoordinatesCount]; for (int i = 0; i < hexagonCoordinatesCount; i++) { _allHexagonCoordinates[i] = transform.GetChild(i).gameObject; GameObject attachedHexagon = _allHexagonCoordinates[i].GetComponent <HexagonCoordinate>().attachedHexagon; if (attachedHexagon != null) { attachedHexagon.GetComponent <Hexagon>().Init(); } } isInitialized = true; OnInitialized?.Invoke(); }
private void Instance_Initialized(bool succeeded) { if (succeeded) { // Configure application version string format var version = Windows.ApplicationModel.Package.Current.Id.Version; AppVersion = $"{version.Major}.{version.Minor}.{version.Build}.{version.Revision}"; Debug.WriteLine($"Application version: {AppVersion}"); InstallFactories(); Task.Run(async() => { await Devices.Instance.GetMediaAsync(); }); RunOnUiThread(() => OnInitialized?.Invoke()); } else { RunOnUiThread(async() => await new MessageDialog("Failed to initialize WebRTC library!").ShowAsync()); } }