Exemplo n.º 1
0
        private void Awake()
        {
            _logger = PatcherLogManager.DefaultLogger;

            EnforceCorrectScreenSize();

#if UNITY_STANDALONE_WIN && !UNITY_EDITOR
            _windowRect.position = new Vector2(Screen.currentResolution.width / 2.0f - Screen.width / 2.0f,
                                               Screen.currentResolution.height / 2.0f - Screen.height / 2.0f);
            _windowRect.size = new Vector2(Screen.width, Screen.height);

            Application.runInBackground = true;

            uint threadId = GetCurrentThreadId();
            EnumThreadWindows(threadId, (hWnd, lParam) =>
            {
                var classText = new StringBuilder(UnityWindowClassName.Length + 1);
                GetClassName(hWnd, classText, classText.Capacity);
                if (classText.ToString() == UnityWindowClassName)
                {
                    _windowsHandle = hWnd;
                    return(false);
                }
                return(true);
            }, IntPtr.Zero);
#endif
        }
        public RemoteResourceDownloader([NotNull] string destinationFilePath, [NotNull] string destinationMetaPath,
                                        RemoteResource resource,
                                        bool useTorrents,
                                        CreateNewHttpDownloader createNewHttpDownloader,
                                        CreateNewChunkedHttpDownloader createNewChunkedHttpDownloader,
                                        CreateNewTorrentDownloader createNewTorrentDownloader)
        {
            if (destinationFilePath == null)
            {
                throw new ArgumentNullException("destinationFilePath");
            }
            if (destinationMetaPath == null)
            {
                throw new ArgumentNullException("destinationMetaPath");
            }

            _logger = PatcherLogManager.DefaultLogger;
            _destinationFilePath            = destinationFilePath;
            _destinationMetaPath            = destinationMetaPath;
            _resource                       = resource;
            _useTorrents                    = useTorrents;
            _createNewHttpDownloader        = createNewHttpDownloader;
            _createNewChunkedHttpDownloader = createNewChunkedHttpDownloader;
            _createNewTorrentDownloader     = createNewTorrentDownloader;
        }
    private void Start()
    {
        _logger = PatcherLogManager.DefaultLogger;

        var patcher = Patcher.Instance;

        Assert.IsNotNull(patcher);
        Assert.IsNotNull(MainAnimator);
        Assert.IsNotNull(NewImage);
        Assert.IsNotNull(OldImage);

        patcher.Data
        .SkipWhile(data => string.IsNullOrEmpty(data.AppSecret))
        .First()
        .ObserveOnMainThread()
        .Subscribe(Initialize);
        //TODO: Dispose subscription
    }
Exemplo n.º 4
0
        public InstallDiffCommand([NotNull] string packagePath, string packageMetaPath, string packagePassword,
                                  int versionId,
                                  [NotNull] ILocalDirectory localData, [NotNull] ILocalMetaData localMetaData,
                                  [NotNull] IRemoteMetaData remoteMetaData)
        {
            if (packagePath == null)
            {
                throw new ArgumentNullException("packagePath");
            }

            if (versionId <= 0)
            {
                throw new ArgumentOutOfRangeException("versionId");
            }

            if (localData == null)
            {
                throw new ArgumentNullException("localData");
            }

            if (localMetaData == null)
            {
                throw new ArgumentNullException("localMetaData");
            }

            if (remoteMetaData == null)
            {
                throw new ArgumentNullException("remoteMetaData");
            }

            _logger          = PatcherLogManager.DefaultLogger;
            _packagePath     = packagePath;
            _packageMetaPath = packageMetaPath;
            _packagePassword = packagePassword;
            _versionId       = versionId;
            _localData       = localData;
            _localMetaData   = localMetaData;
            _remoteMetaData  = remoteMetaData;
        }
Exemplo n.º 5
0
 public UnityHttpClient()
 {
     _logger = PatcherLogManager.DefaultLogger;
 }