public void Initialize() { // WebCam 操作 Presenter // 各イベントが叩かれたら対応するメソッドを呼び出し WebCamController.TriggerPlayAsObservable().Subscribe(_ => Play()); WebCamController.TriggerStopAsObservable().Subscribe(_ => Stop()); WebCamController.TriggerCaptureAsObservable().Subscribe(_ => Capture()); // WebCam 初期化 Presenter WebCamInitializer.InitializeAsObservable().Subscribe(_ => InitializeCamera()); // WebCamTexture サイズ確定 // XXX: イベントの伝搬が微妙 WebCamEntity .Play .WhenDid() .SelectMany( _ => Observable .EveryUpdate() .Where(__ => WebCamEntity.HasResolutionConfirmed()) .Take(1) ) .Select(_ => new Vector2Int(WebCamEntity.WebCamTextureProperty.Value.width, WebCamEntity.WebCamTextureProperty.Value.height)) .Subscribe(WebCamEntity.ConfirmTextureSize.Did); WebCamEntity .ConfirmTextureSize .WhenDid() .Select(_ => WebCamEntity.WebCamTextureProperty.Value) .Subscribe(WebCamEntity.RenderWebCamTexture.Did); }
protected override void OnStart() { base.OnStart(); _webCamController = _controller as WebCamController; _image.texture = _webCamController.WebCam; if (setNativeSize) { _webCamController.OnWebCanStarted += SetNativeSize; } }
protected override void OnStart() { _webCamController = _bootstrap.GetController(ControllerTypes.WebCam) as WebCamController; _pagesController = _controller as PagesController; var page = GetComponent <Page>(); _id = page.Id; _type = page.Type; _pagesController.NextPage += CheckPage; _pagesController.PreviousPage += CheckPage; _pagesController.OpenPage += CheckPage; _pagesController.OpenPageType += CheckPage; _pagesController.Reset += StopCoroutines; }
protected override void OnStart() { base.OnStart(); _webCamController = _controller as WebCamController; }
void Start() { webcamcontroller = plane.GetComponent <WebCamController>(); }
private void Start() { webCamController = rawImage.GetComponent <WebCamController>(); }
void Start() { text.text = Application.dataPath; webcamcontroller = plane.GetComponent <WebCamController>(); }
public void HandlePacket(Packets packet) { var packetType = packet.PacketType; var errorController = new ErrorController(Client, packet); var windowsController = new WindowsController(Client, packet); var settingsController = new SettingsController(Client, packet); var serverController = new ServerController(Client, packet); if (packetType == PacketType.InvalidOrEmptyPacket) { errorController.InvalidPacket(); return; } if (packetType == PacketType.RequestWindowsInformation) { windowsController.GetWindowsInformation(); return; } if (packetType == PacketType.AesHandshake) { serverController.AesHandshake(); return; } if (!AuthClient.Authenticated && packetType == PacketType.Authenticate) { serverController.Login(); return; } if (AuthClient.Authenticated) { #region //Build a controller workshop! var fileController = new FileController(Client, packet); var processController = new ProcessController(Client, packet); var cpuController = new CpuController(Client, packet); var systemController = new SystemController(Client, packet); var operatingSystemController = new OperatingSystemController(Client, packet); var networkController = new NetworkController(Client, packet); var gpuController = new GpuController(Client, packet); var screenShareController = new ScreenShareController(Client, packet); var pluginController = new PluginController(Client, packet); var webcamController = new WebCamController(Client, packet); #endregion //Running long processes in a new task prevents timeouts from firing switch (packetType) { case PacketType.RequestFile: Task.Run(() => { fileController.RequestFile(); }); break; case PacketType.RequestGpuInformation: gpuController.GetGpuInformation(); break; case PacketType.RemoveFile: fileController.RemoveFile(); break; case PacketType.Plugin: Task.Run(() => { pluginController.StartPlugin(); }); break; case PacketType.ApprovePlugin: pluginController.ApprovePlugin(); break; case PacketType.GetPendingPlugins: pluginController.GetPendingPlugins(); break; case PacketType.GetPlugins: pluginController.ListPlugins(); break; case PacketType.GetBadPlugins: pluginController.ListBadPlugins(); break; case PacketType.CreateFileTree: fileController.CreateFileTree(); break; case PacketType.StartCamera: webcamController.StartCamera(); break; case PacketType.StopCamera: Task.Run(() => { webcamController.StopCamera(); }); break; case PacketType.PauseCamera: webcamController.PauseCamera(); break; case PacketType.GetCameras: webcamController.GetCameras(); break; case PacketType.StartCameraStream: webcamController.StartStream(); break; case PacketType.StopCameraStream: webcamController.StopStream(); break; case PacketType.RequestProcess: processController.RequestProcessInformation(); break; case PacketType.RequestCpuInformation: cpuController.GetCpuInformation(); break; case PacketType.RequestOsInformation: operatingSystemController.GetOperatingSystemInformation(); break; case PacketType.RestartServer: serverController.RestartServer(); break; case PacketType.RequestNetworkInformation: Task.Run(() => { networkController.GetNetworkInformation(); }); break; case PacketType.SearchFiles: Task.Run(() => { fileController.SearchFile(); }); break; case PacketType.UseWebServer: settingsController.ChangeWebServerUse(); break; case PacketType.ChangeWebServerPort: settingsController.ChangeWebServerPort(); break; case PacketType.ChangeWebFilePath: settingsController.ChangeWebFilePath(); break; case PacketType.ChangeTaskServerPort: settingsController.ChangeTaskServerPort(); break; case PacketType.ChangeVncPort: settingsController.ChangeVncPort(); break; case PacketType.ChangeVncPass: settingsController.ChangeVncPassword(); break; case PacketType.ChangeVncProxyPort: settingsController.ChangeVncProxyPort(); break; case PacketType.ChangeNetworkResolve: settingsController.ChangeNetworkResolve(); break; case PacketType.ChangeLoadPlugins: settingsController.ChangeLoadPlugins(); break; case PacketType.ChangeUseTerminal: settingsController.ChangeUseTerminal(); break; case PacketType.GetCurrentSettings: settingsController.GetCurrentSettings(); break; case PacketType.RequestSystemInformation: systemController.GetSystemInformation(); break; case PacketType.GetEventLogs: //WHO REENABLED THIS // Task.Factory.StartNew(() => operatingSystemController.GetEventLogs()); break; case PacketType.StartScreenShare: screenShareController.StartScreenShare(); break; case PacketType.StopScreenShare: screenShareController.StopScreenShare(); break; case PacketType.ApproveFile: fileController.ApproveFile(); break; case PacketType.StartProcess: processController.StartProcess(); break; case PacketType.KillProcess: processController.KillProcess(); break; case PacketType.InvalidOrEmptyPacket: errorController.InvalidPacket(); break; case PacketType.CheckUpdate: serverController.CheckForUpdate(); break; case PacketType.RefreshCameras: webcamController.RefreshCameras(); break; } } else { errorController.NoAuth(); } }
private void Start() { webcamcontroller = plane.GetComponent <WebCamController>(); InvokeRepeating("ListJudge", 1, time); }
public void HandlePacket(Packets packet) { var packetType = packet.packetType; Console.WriteLine(packetType); var errorController = new ErrorController(Client, packet); var windowsController = new WindowsController(Client, packet); if (packetType == PacketType.InvalidOrEmptyPacket) { errorController.InvalidPacket(); return; } if (packetType == PacketType.InvalidApiKey) { errorController.InvalidApiKey(); return; } if (packetType == PacketType.RequestWindowsInformation) { windowsController.GetWindowsInformation(); return; } if (!authClient.Authenticated && packetType == PacketType.Authenticate) { var loginDecoder = new UlteriusLoginDecoder(); var password = packet.args.First().ToString(); var authenticationData = loginDecoder.Login(password, Client); Client.WriteStringAsync(authenticationData, CancellationToken.None); } if (authClient.Authenticated) { #region //Build a controller workshop! var fileController = new FileController(Client, packet); var processController = new ProcessController(Client, packet); var cpuController = new CpuController(Client, packet); var systemController = new SystemController(Client, packet); var operatingSystemController = new OperatingSystemController(Client, packet); var networkController = new NetworkController(Client, packet); var serverController = new ServerController(Client, packet); var settingsController = new SettingsController(Client, packet); var gpuController = new GpuController(Client, packet); var vncController = new VncController(Client, packet); var pluginController = new PluginController(Client, packet); var webcamController = new WebCamController(Client, packet); #endregion switch (packetType) { case PacketType.DownloadFile: fileController.DownloadFile(); break; case PacketType.RequestGpuInformation: gpuController.GetGpuInformation(); break; case PacketType.Plugin: pluginController.StartPlugin(); break; case PacketType.GetPlugins: pluginController.ListPlugins(); break; case PacketType.GetBadPlugins: pluginController.ListBadPlugins(); break; case PacketType.CreateFileTree: fileController.CreateFileTree(); break; case PacketType.StartCamera: webcamController.StartCamera(); break; case PacketType.StopCamera: webcamController.StopCamera(); break; case PacketType.PauseCamera: webcamController.PauseCamera(); break; case PacketType.GetCameras: webcamController.GetCameras(); break; case PacketType.StartCameraStream: webcamController.StartStream(); break; case PacketType.StopCameraStream: webcamController.StopStream(); break; case PacketType.RequestProcess: processController.RequestProcessInformation(); break; case PacketType.StreamProcesses: processController.StreamProcessInformation(); break; case PacketType.StopProcessStream: processController.StopProcessStream(); break; case PacketType.RequestCpuInformation: cpuController.GetCpuInformation(); break; case PacketType.RequestOsInformation: operatingSystemController.GetOperatingSystemInformation(); break; case PacketType.RestartServer: serverController.RestartServer(); break; case PacketType.RequestNetworkInformation: networkController.GetNetworkInformation(); break; case PacketType.UseWebServer: settingsController.ChangeWebServerUse(); break; case PacketType.ChangeWebServerPort: settingsController.ChangeWebServerPort(); break; case PacketType.ChangeWebFilePath: settingsController.ChangeWebFilePath(); break; case PacketType.ChangeTaskServerPort: settingsController.ChangeTaskServerPort(); break; case PacketType.ChangeVncPort: settingsController.ChangeVncPort(); break; case PacketType.ChangeVncPass: settingsController.ChangeVncPassword(); break; case PacketType.ChangeVncProxyPort: settingsController.ChangeVncProxyPort(); break; case PacketType.ChangeNetworkResolve: settingsController.ChangeNetworkResolve(); break; case PacketType.GetCurrentSettings: settingsController.GetCurrentSettings(); break; case PacketType.RequestSystemInformation: systemController.GetSystemInformation(); break; case PacketType.GetEventLogs: Task.Factory.StartNew(() => operatingSystemController.GetEventLogs()); break; case PacketType.StartVncServer: vncController.StartVncServer(); break; case PacketType.StartProcess: processController.StartProcess(); break; case PacketType.KillProcess: processController.KillProcess(); break; case PacketType.EmptyApiKey: errorController.EmptyApiKey(); break; case PacketType.InvalidApiKey: errorController.InvalidApiKey(); break; case PacketType.InvalidOrEmptyPacket: errorController.InvalidPacket(); break; case PacketType.GenerateNewKey: settingsController.GenerateNewAPiKey(); break; case PacketType.CheckUpdate: serverController.CheckForUpdate(); break; case PacketType.GetActiveWindowsSnapshots: windowsController.GetActiveWindowsImages(); break; case PacketType.RefreshCameras: webcamController.RefreshCameras(); break; default: break; } } else { errorController.NoAuth(); } }