Ejemplo n.º 1
0
        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");
            }
        }
Ejemplo n.º 2
0
        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");
            }
        }
Ejemplo n.º 3
0
        private void invokeReceivedNotification(ServerNotifications notification)
        {
            var handler = ReceivedNotification;

            if (handler != null)
            {
                handler(notification);
            }
        }
Ejemplo n.º 4
0
        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
        }
Ejemplo n.º 5
0
 private void invokeReceivedNotification(ServerNotifications notification)
 {
     var handler = ReceivedNotification;
     if (handler != null) handler(notification);
 }