前言
没有科学上网,就不要折腾了
1注册Epic
2注册github
3关联账号
在UE官网登入账号并且关联github账号
4下载源码
5 执行Setup.bat
5.1 执行出错提示Failed to download
Failed to download 'http://cdn.unrealengine.com/dependencies/UnrealEngine-24819931/19acf26186763763ae43ec3e4bd12b5a50105e41': SocketException: 远程主机强迫关闭了一个现有的连接。
Wrapped by IOException: Unable to read data from the transport connection: 远程主机强迫关闭了一个现有的连接。.
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource<System.Int32>.GetResult(Int16 token)
at System.Net.Http.HttpConnection.InitialFillAsync(Boolean async)
at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)Wrapped by HttpRequestException: An error occurred while sending the request.
at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
at GitDependencies.Program.DownloadAndExtractFiles(String Url, Uri Proxy, String CacheFileName, Int64 CompressedSize, String ExpectedHash, IncomingFile[] Files, Double HttpTimeoutMultiplier, NotifyReadDelegate NotifyRead)Wrapped by AggregateException: One or more errors occurred. (An error occurred while sending the request.)
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at GitDependencies.Program.DownloadWorker(ConcurrentQueue`1 DownloadQueue, AsyncDownloadState State, Double HttpTimeoutMultiplier, Int32 MaxRetries, CancellationToken CancellationToken)
查看该指令相关的命令配置
UnrealEngine\Engine\Binaries\DotNET\GitDependencies\win-x64>GitDependencies.exe --help
Usage:
GitDependencies [options]
Options:
--all Sync all folders
--include=<X> Include binaries in folders called <X>
--exclude=<X> Exclude binaries in folders called <X>
--prompt Prompt before overwriting modified files
--force Always overwrite modified files
--root=<PATH> Set the repository directory to be sync
--threads=<N> Use N threads when downloading new files
--dry-run Print a list of outdated files and exit
--http-timeout-multiplier=<N> Override download timeout multiplier
--max-retries Override maximum number of retries per file
--proxy=<user:password@url> Sets the HTTP proxy address and credentials
--cache=<PATH> Specifies a custom path for the download cache
--cache-size-multiplier=<N> Cache size as multiplier of current download
--cache-days=<N> Number of days to keep entries in the cache
--no-cache Disable caching of downloaded files
Detected settings:
Excluded folders: none
Proxy server: none
Download cache: F:\dongshenghua\ue5.1\UnrealEngine\.git\ue-gitdeps
Default arguments can be set through the UE_GITDEPS_ARGS environment variable.
解决方案
增加如下的参数
--http-timeout-multiplier=120 延长超时时间
--cache=d:\cache 设置缓存,避免每次下载
--threads=10 多线程下载
--exclude=Linux --exclude=IOS --exclude=HTML5 --exclude=Android
5.2 执行最后出错
Checking dependencies (excluding Linux, IOS, HTML5, Android)...
Updating dependencies: 99% (40959/40960), 5982.3/6031.9 MiB | 0.00 MiB/s...
解决方案
重新启动命令行窗口