void changedGameState(ServerNotifications notification) { switch (notification) { case ServerNotifications.Hit: Vibrate(300); PlaySound("Flop.wav"); break; case ServerNotifications.Win: Vibrate(1000); break; case ServerNotifications.FieldUpdated: break; case ServerNotifications.Miss: break; case ServerNotifications.Goal: break; case ServerNotifications.Start: Vibrate(1000); PlaySound("OutHere1.wav"); break; default: throw new ArgumentOutOfRangeException("notification"); } }
void changedGameState(ServerNotifications notification) { switch (notification) { case ServerNotifications.Hit: Vibrate(300); PlaySound("Flop.wav"); break; case ServerNotifications.Win: Vibrate(1000); break; case ServerNotifications.FieldUpdated: break; case ServerNotifications.Miss: break; case ServerNotifications.Goal: break; case ServerNotifications.Start: Vibrate(1000); PlaySound("OutHere1.wav"); break; default: throw new ArgumentOutOfRangeException("notification"); } }
private void invokeReceivedNotification(ServerNotifications notification) { var handler = ReceivedNotification; if (handler != null) { handler(notification); } }
public ProcessServer(ITaskManager taskManager, IEnvironment environment, IRpcProcessConfiguration configuration) { Environment = environment; completionTask = completionHandle.ToTask(); ownsTaskManager = taskManager == null; if (ownsTaskManager) { taskManager = new TaskManager(); try { taskManager.Initialize(); } catch { ourContext = new MainThreadSynchronizationContext(cts.Token); taskManager.Initialize(ourContext); } } else { externalCts = CancellationTokenSource.CreateLinkedTokenSource(taskManager.Token); externalCts.Token.Register(Dispose); } TaskManager = taskManager; if (configuration == null) { configuration = new ApplicationConfigurationWrapper(TaskManager, ApplicationConfiguration.instance); // read the executable path up front so it gets serialized if it needs to, while we're on the main thread var _ = configuration.ExecutablePath; } if (string.IsNullOrEmpty(configuration.AccessToken)) { configuration.AccessToken = GenerateAccessToken(); } Configuration = configuration; localProcessManager = new ProcessManager(Environment); processManager = new RemoteProcessManager(this, localProcessManager.DefaultProcessEnvironment, cts.Token); notifications = new ServerNotifications(this); #if UNITY_EDITOR UnityEditor.EditorApplication.quitting += ShutdownSync; #endif }
private void invokeReceivedNotification(ServerNotifications notification) { var handler = ReceivedNotification; if (handler != null) handler(notification); }