Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
148 commits
Select commit Hold shift + click to select a range
43b4c7d
Added UnsupportedPlatformException
Dzejkop Jul 4, 2018
bf3e774
Added throwing TorrentClientException if torrent-client has exited
Dzejkop Jul 4, 2018
fe01577
Handling the TorrentClientException
Dzejkop Jul 4, 2018
d7eb0f8
Additional check in reading torrent-client response
Dzejkop Jul 5, 2018
1e819e5
Update CHANGELOG.md
Dzejkop Jul 5, 2018
f33a87b
Added convenience methods and optional parameters
Dzejkop Jul 5, 2018
c0e0913
Implemented all but the "file_verification_failed" events
Dzejkop Jul 5, 2018
0e148f0
Moved the CustomBuilding.cs script
Dzejkop Jul 6, 2018
1bd0d14
Removed deprecated BuildScript.cs
Dzejkop Jul 6, 2018
3367ab1
Added post build warning in PostBuild.cs
Dzejkop Jul 6, 2018
f8ec78b
Removed whitespace
Dzejkop Jul 6, 2018
d74b3f1
Removed the unsupported architecture
Dzejkop Jul 6, 2018
5c86607
Minor refactor
Dzejkop Jul 6, 2018
a133f79
Update CHANGELOG.md
Dzejkop Jul 6, 2018
2eb87ce
Implementation
Dzejkop Jul 6, 2018
af8e768
Update CHANGELOG.md
Dzejkop Jul 6, 2018
edc4a91
Setting window size
Dzejkop Jul 6, 2018
c835bd6
Removed whitespace
Dzejkop Jul 6, 2018
3b63ffb
Two entry points: from build settings or current scene
Dzejkop Jul 6, 2018
93daf8a
Update CHANGELOG.md
Dzejkop Jul 6, 2018
04533dd
Replacing all calls to File.Delete with FileOperations.Delete
Dzejkop Jul 6, 2018
a58426b
Replacing all calls to Directory or File with custom calls
Dzejkop Jul 6, 2018
4f02103
Missing imports and default parameter for DirectoryOperations.Delete
Dzejkop Jul 6, 2018
b6c1c69
Moved DirectoryOperations and FileOperatinos to FileSystem namespace
Dzejkop Jul 6, 2018
b9b0eb6
Added FileSystem.RetryStrategy
Dzejkop Jul 6, 2018
befb21b
Integration
Dzejkop Jul 6, 2018
a4079de
Attaching UnityEngine.SystemInfo.operatingSystem to Sentry tags
Dzejkop Jul 6, 2018
3772dff
Removing whitespace
Dzejkop Jul 6, 2018
1ed33eb
Update CHANGELOG.md
Dzejkop Jul 6, 2018
a08011d
Update CHANGELOG.md
Dzejkop Jul 6, 2018
0681af6
Added the "file_verification_failed" event
Dzejkop Jul 9, 2018
695841d
Update CHANGELOG.md
Dzejkop Jul 9, 2018
8f88ba9
Only StandaloneOSXIntel64 architecture and NET 2.0 compatibility
Dzejkop Jul 9, 2018
0e5b666
English fix
Dzejkop Jul 9, 2018
e74efa5
Merge branch 'feature/v3.x.x/769-custom-build-scripts' into feature/v…
Dzejkop Jul 9, 2018
4a2395c
Replacing statistic event names with enums
Dzejkop Jul 10, 2018
aeeb061
Added a TryDispatchSendEvent and used it where applicable
Dzejkop Jul 10, 2018
3c0469b
Secondary progress bar adjustments
Dzejkop Jul 11, 2018
ffdf9a9
Moving json key values into constants
Dzejkop Jul 12, 2018
fc09553
Initial implementation
Dzejkop Jul 16, 2018
f1078b0
Switching to XZ
Dzejkop Jul 18, 2018
0da3a76
Minor refactoring
Dzejkop Jul 18, 2018
894a9e1
Update CHANGELOG.md
Dzejkop Jul 18, 2018
4499fd9
Merge pull request #63 from patchkit-net/feature/v3.x.x/847-PK_OFFICI…
witcher112 Jul 25, 2018
a13a8ba
Merge branch 'dev/v3.x.x' into feature/v3.x.x/726-attaching-system-in…
witcher112 Jul 25, 2018
706f277
Merge pull request #66 from patchkit-net/feature/v3.x.x/726-attaching…
witcher112 Jul 25, 2018
0bae67f
Merge branch 'dev/v3.x.x' into feature/v3.x.x/1002-lzma2-compression-…
witcher112 Jul 25, 2018
261d9ad
Merge branch 'dev/v3.x.x' into feature/v3.x.x/960-handling-file-syste…
witcher112 Jul 26, 2018
8afdff3
Merge branch 'dev/v3.x.x' into feature/v3.x.x/749-reporting-statistics
witcher112 Jul 26, 2018
5078411
PR requested changes
Dzejkop Jul 26, 2018
364af39
Moved the torrent related classes to the Torrent subdirectory
Dzejkop Jul 26, 2018
a5168be
Added TorrentClientCrashException
Dzejkop Jul 26, 2018
9ce5896
Catching Exception when checking for diff or content strategy fails
Dzejkop Jul 26, 2018
f38ff8a
Merge pull request #61 from patchkit-net/feature/v3.x.x/progress-bar
witcher112 Jul 26, 2018
6c07d47
Merge branch 'dev/v3.x.x' into feature/v3.x.x/876-torrent-client-fail…
witcher112 Jul 26, 2018
f2cac41
Merge pull request #60 from patchkit-net/feature/v3.x.x/876-torrent-c…
witcher112 Jul 26, 2018
1d8b4a2
Anticipating exceptions
Dzejkop Jul 27, 2018
c5e5baf
Brought back logging exception into sentry in the using statements
Dzejkop Jul 27, 2018
b2b8741
Merge branch 'dev/v3.x.x' into feature/v3.x.x/749-reporting-statistics
Dzejkop Jul 27, 2018
d31096e
Brought back BuildScript.cs
Dzejkop Jul 27, 2018
818cbad
PR requested changes
Dzejkop Jul 27, 2018
7900b2e
Merge pull request #68 from patchkit-net/feature/v3.x.x/749-reporting…
witcher112 Aug 1, 2018
e7cf4d7
Merge pull request #73 from patchkit-net/feature/v3.x.x/1002-lzma2-co…
witcher112 Aug 1, 2018
1863165
Fix CHANGELOG.md
witcher112 Aug 1, 2018
20351d1
Merge remote-tracking branch 'origin/dev/v3.10.0' into dev/v3.x.x
Dzejkop Aug 14, 2018
8da8041
Merge pull request #77 from patchkit-net/feature/merge-3.10.0-to-3.x.x
witcher112 Aug 16, 2018
a5565db
Merge branch 'dev/v3.10.x' into dev/v3.x.x
witcher112 Aug 29, 2018
cd6c1a6
Marking torrent related method as deprecated
Dzejkop Aug 30, 2018
9a4e4d6
Removed torrent downloading resolving
Dzejkop Aug 30, 2018
dd3fdb5
Update CHANGELOG.md
Dzejkop Aug 30, 2018
6f41968
Cleaning up RemoteResourceDownloader.cs
Dzejkop Aug 30, 2018
70b56d7
Removing torrent related code
Dzejkop Aug 30, 2018
bd993a9
Implementation and tests
Dzejkop Aug 30, 2018
ee94462
Applying the wrapper
Dzejkop Aug 30, 2018
3a4d87f
Update CHANGELOG.md
Dzejkop Aug 30, 2018
792721e
Minor correction
Dzejkop Aug 30, 2018
461ca68
New Unix launch script now with argument parsing
Dzejkop Sep 3, 2018
b40eda2
Added {network-status} symbol
Dzejkop Sep 3, 2018
b2901a1
Reading network status from command line args
Dzejkop Sep 3, 2018
3dc8b14
Updating PatchKit.Api.dll
Dzejkop Sep 7, 2018
cf26d4b
Using AppVersion to resolve executable and args
Dzejkop Sep 7, 2018
066987f
Update PatchKit.Api.dll
Dzejkop Sep 7, 2018
adebabf
Deleting torrent related code
Dzejkop Sep 7, 2018
5f567f2
Changed test names
Dzejkop Sep 7, 2018
431421f
Changed NotImplemented to NotSupported
Dzejkop Sep 7, 2018
9c79995
Removed tempBuffer
Dzejkop Sep 7, 2018
bb84342
Critical bux fix
Dzejkop Sep 7, 2018
03b3f71
Removing redundant code
Dzejkop Sep 7, 2018
6913376
Crashing the linux launch script if missing required argument
Dzejkop Sep 7, 2018
4a9c250
Typo fix
Dzejkop Sep 7, 2018
4df22a3
Update CHANGELOG.md
Dzejkop Sep 7, 2018
15e4385
Update CHANGELOG.md
Dzejkop Sep 7, 2018
ab16e47
Merge pull request #84 from patchkit-net/feature/v3.x.x/1053-reading-…
witcher112 Sep 14, 2018
c9abd07
Added buffering of download speeds
Dzejkop Sep 17, 2018
9c2d0cd
Update CHANGELOG.md
Dzejkop Sep 17, 2018
dc4cd79
Removing torrent-client binaries
Dzejkop Sep 18, 2018
081c56f
Merge from dev/v3.x.x
Dzejkop Sep 18, 2018
41cee10
Post-merge cleanup
Dzejkop Sep 18, 2018
b74fa69
PR requested changes
Dzejkop Sep 18, 2018
398d690
Changed InvalidBuildTargets to ValidBuildTargets
Dzejkop Sep 18, 2018
3df9daa
Merge pull request #65 from patchkit-net/feature/v3.x.x/960-handling-…
witcher112 Sep 18, 2018
ae75271
Merge pull request #83 from patchkit-net/feature/v3.x.x/1049-ionic-zi…
witcher112 Sep 18, 2018
0c25f68
Merge branch 'dev/v3.x.x' into feature/v3.x.x/716&769-custom-build-sc…
witcher112 Sep 18, 2018
19bc4a6
Merge pull request #69 from patchkit-net/feature/v3.x.x/716&769-custo…
witcher112 Sep 18, 2018
df8815d
Merge from dev/v3.x.x
Dzejkop Sep 18, 2018
ebc36af
Merge pull request #82 from patchkit-net/feature/v3.x.x/1050-deprecat…
witcher112 Sep 18, 2018
3b2fcee
Update CHANGELOG.md
witcher112 Sep 18, 2018
72ae424
Merge branch 'freezed' into dev/v3.x.x
witcher112 Sep 18, 2018
2501791
Update changelog
witcher112 Sep 18, 2018
886c9c1
Merge pull request #88 from patchkit-net/feature/v3.x.x/1058-time-bas…
witcher112 Oct 1, 2018
e10d82d
Removing trash files
Dzejkop Oct 2, 2018
661e011
PR Feeback
Dzejkop Oct 2, 2018
f93e57c
Merge branch 'dev/v3.10.x' into dev/v3.x.x
witcher112 Oct 11, 2018
971da4c
Merge branch 'freezed' into dev/v3.x.x
witcher112 Oct 11, 2018
a378cec
Merge branch 'dev/v3.10.x' into dev/v3.x.x
witcher112 Oct 15, 2018
18b2b4c
Merge branch 'freezed' into dev/v3.x.x
witcher112 Oct 15, 2018
157e18b
Merge branch 'dev/v3.10.x' into dev/v3.x.x
Oct 19, 2018
5c46966
Displaying "Stalled..." when effective bytes per second is 0
Dzejkop Oct 23, 2018
9f66851
Fixing the incorrectly displayed download speed
Dzejkop Oct 24, 2018
788e60f
Added the capabilities field in patcher manifest
Dzejkop Oct 30, 2018
28915c2
Patcher will not clear the progress bar after updating
Dzejkop Oct 30, 2018
c52c8e1
Merge branch 'dev/v3.10.x' into dev/v3.x.x
witcher112 Oct 30, 2018
6a75674
Merge branch 'dev/v3.10.x' into dev/v3.x.x
witcher112 Nov 1, 2018
f9fdc35
Merge branch 'dev/v3.10.x' into dev/v3.x.x
witcher112 Nov 5, 2018
5d5cd31
Merge branch 'dev/v3.x.x' into feature/v3.x.x/1089-displaying-100-per…
Dzejkop Nov 12, 2018
b9719b1
Post merge cleanup
Dzejkop Nov 12, 2018
41d0918
PR update
Dzejkop Nov 12, 2018
378e143
Merge pull request #100 from patchkit-net/feature/v3.x.x/1089-display…
witcher112 Nov 14, 2018
dd66ce6
Periodic updates to DownloadSpeedCalculator
Dzejkop Nov 14, 2018
5ae61f5
Version.cs revert
Dzejkop Nov 14, 2018
984c331
Refactoring
Dzejkop Nov 14, 2018
9474f19
PR Feedback
Dzejkop Nov 14, 2018
1bf7d0f
Merge branch 'dev/v3.x.x' into feature/v3.x.x/1022-and-1021-app-versi…
witcher112 Nov 22, 2018
eafb250
Merge pull request #85 from patchkit-net/feature/v3.x.x/1022-and-1021…
witcher112 Nov 22, 2018
dfe2e24
Hide test manifest functions under internal menu
witcher112 Nov 24, 2018
9c47178
Merge pull request #99 from patchkit-net/feature/v3.x.x/1074-manifest…
witcher112 Nov 24, 2018
4f6e8ba
Add threshold for checking bytes per second
witcher112 Nov 24, 2018
84c32ab
Merge branch 'dev/v3.x.x' into feature/v3.x.x/1069-communicating-down…
witcher112 Nov 24, 2018
3a9d331
Merge pull request #96 from patchkit-net/feature/v3.x.x/1069-communic…
witcher112 Nov 24, 2018
ccc8a30
Add missing meta files
witcher112 Nov 27, 2018
6535afc
Update Rider plugin
witcher112 Nov 27, 2018
c2c33b0
Fix script warning
witcher112 Nov 27, 2018
7b10914
Get rid of asset store libraries
witcher112 Nov 27, 2018
7317724
Hide some of the warnings in Unity console
witcher112 Nov 27, 2018
23a4e83
Remove code warnings
witcher112 Nov 27, 2018
fe439bc
Merge custom building scripts
witcher112 Nov 27, 2018
0250350
Update changelog
witcher112 Nov 27, 2018
36f6f29
Update version
witcher112 Nov 27, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
676 changes: 0 additions & 676 deletions Assets/Editor/AssetStoreBatchMode/AssetStoreBatchMode.cs

This file was deleted.

376 changes: 0 additions & 376 deletions Assets/Editor/AssetStoreBatchMode/ReflectionHelpers.cs

This file was deleted.

9 changes: 0 additions & 9 deletions Assets/Editor/AssetStoreBatchMode/lib.meta

This file was deleted.

This file was deleted.

This file was deleted.

20 changes: 0 additions & 20 deletions Assets/Editor/AssetStoreBatchMode/lib/NDesk.Options/COPYING

This file was deleted.

This file was deleted.

Binary file not shown.
17 changes: 1 addition & 16 deletions Assets/Editor/InternalMenuItems.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,10 @@ namespace PatchKit.Unity.Editor

public class InternalMenuItems
{
[MenuItem("Tools/PatchKit Patcher Internal/Upload Asset Store Package", false, 1)]
public static void UploadAssetStorePackage()
{
if (string.IsNullOrEmpty(InternalSettings.Email) || string.IsNullOrEmpty(InternalSettings.Password))
{
Debug.LogError("Please set email and password in internal settings");
return;
}

AssetStoreBatchMode.UploadAssetStorePackage(
InternalSettings.Email, InternalSettings.Password,
"PatchKit Patcher",
new [] {"PatchKit Patcher", "Plugins/PatchKit", "Plugins/UniRx", "StreamingAssets"});
}

[MenuItem("Tools/PatchKit Patcher Internal/Settings", false, 100)]
public static void Settings()
{
InternalSettings.Show();
InternalSettings.ShowSettings();
}
}

Expand Down
2 changes: 1 addition & 1 deletion Assets/Editor/InternalSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static string Password
set { EditorPrefs.SetString(PasswordKey, value); }
}

public static void Show()
public static void ShowSettings()
{
EditorWindow window = GetWindow<InternalSettings>();
window.Show();
Expand Down
154 changes: 154 additions & 0 deletions Assets/Editor/Tests/GZipStreamWrapperTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
using System;
using System.IO;
using System.Text;
using Ionic.Zlib;
using NUnit.Framework;
using PatchKit.Unity.Utilities;

public class GZipStreamWrapperTest
{
private class MockStream : Stream
{
public override bool CanRead
{
get
{
return true;
}
}

public override bool CanSeek
{
get
{
return false;
}
}

public override bool CanWrite
{
get
{
return false;
}
}
public override long Length
{
get
{
return _internalStream.Length;
}
}

public override long Position
{
get
{
return _internalStream.Position;
}

set
{
_internalStream.Position = value;
}
}

private readonly int _packetSize;

private readonly MemoryStream _internalStream;

public MockStream(byte[] data, int packetSize)
{
_packetSize = packetSize;
_internalStream = new MemoryStream(data);
}

public override void Flush()
{
throw new System.NotImplementedException();
}

public override int Read(byte[] buffer, int offset, int count)
{
return _internalStream.Read(buffer, offset, System.Math.Min(count, _packetSize));
}

public override long Seek(long offset, SeekOrigin origin)
{
return _internalStream.Seek(offset, origin);
}

public override void SetLength(long value)
{
_internalStream.SetLength(value);
}

public override void Write(byte[] buffer, int offset, int count)
{
throw new System.NotImplementedException();
}
}

private const string RawData = "1234567890987654321qwerweqrfa";

private byte[] compressedData;

[SetUp]
public void SetUp()
{
using (var targetStream = new MemoryStream())
{
using (var sourceStream = new MemoryStream(Encoding.ASCII.GetBytes(RawData)))
{
using (var gzipStream = new GZipStream(targetStream, CompressionMode.Compress))
{
Streams.Copy(sourceStream, gzipStream);
}
}

compressedData = targetStream.ToArray();
}
}

[Test]
public void Raw_GZip_Stream_Fails_On_Mocked_Stream()
{
TestDelegate act = () => {
using (var targetStream = new MemoryStream())
{
using (var mockStream = new MockStream(compressedData, 5))
{
using (var gzipStream = new GZipStream(mockStream, CompressionMode.Decompress))
{
Streams.Copy(gzipStream, targetStream);
}
}
}
};

Assert.Throws(typeof(ZlibException), act);
}

[Test]
public void Wrapped_Read_Succeeds_On_Mocked_Stream()
{
string decompressed;
using (var targetStream = new MemoryStream())
{
using (var mockStream = new MockStream(compressedData, 5))
{
using (var wrapperStream = new GZipReadWrapperStream(mockStream))
{
using (var gzipStream = new GZipStream(wrapperStream, CompressionMode.Decompress))
{
Streams.Copy(gzipStream, targetStream);
}
}
}

decompressed = Encoding.ASCII.GetString(targetStream.ToArray());
}

Assert.That(decompressed == RawData);
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

61 changes: 6 additions & 55 deletions Assets/Editor/Tests/RemoteResourceDownloaderTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ private RemoteResource CreateTestRemoteResource()
ChunksData = CreateTestChunksData(),
Size = 1,
HashCode = "hashcode",
TorrentUrls = new[] {"torrent-url"},
ResourceUrls = new[]
{
// TODO: Test when MetaUrl is set
Expand All @@ -50,7 +49,7 @@ private RemoteResource CreateTestRemoteResource()
new ResourceUrl
{
Url = "url-2",
MetaUrl = null,
MetaUrl = null,
Country = "PL",
PartSize = 0,
}
Expand Down Expand Up @@ -89,66 +88,21 @@ public void TearDown()
}

[Test]
public void UseTorrentDownloaderFirst()
{
RemoteResource resource = CreateTestRemoteResource();

var httpDownloader = Substitute.For<IHttpDownloader>();
var chunkedHttpDownloader = Substitute.For<IChunkedHttpDownloader>();
var torrentDownloader = Substitute.For<ITorrentDownloader>();

var downloader = new RemoteResourceDownloader(_filePath, _metaFilePath, resource, true,
(path, urls) => httpDownloader,
(path, urls, data, size) => chunkedHttpDownloader,
(path, filePath, bytes) => torrentDownloader);

downloader.Download(CancellationToken.Empty);

chunkedHttpDownloader.DidNotReceiveWithAnyArgs().Download(CancellationToken.Empty);
torrentDownloader.ReceivedWithAnyArgs().Download(CancellationToken.Empty);
}

[Test]
public void UseChunkedHttpDownloaderIfTorrentFails()
{
RemoteResource resource = CreateTestRemoteResource();

var httpDownloader = Substitute.For<IHttpDownloader>();
var chunkedHttpDownloader = Substitute.For<IChunkedHttpDownloader>();
var torrentDownloader = Substitute.For<ITorrentDownloader>();
torrentDownloader.When(t => t.Download(CancellationToken.Empty)).Do(
info => { throw new DownloadFailureException("Test."); });

var downloader = new RemoteResourceDownloader(_filePath, _metaFilePath, resource, true,
(path, urls) => httpDownloader,
(path, urls, data, size) => chunkedHttpDownloader,
(path, filePath, bytes) => torrentDownloader);

downloader.Download(CancellationToken.Empty);

chunkedHttpDownloader.ReceivedWithAnyArgs().Download(CancellationToken.Empty);
torrentDownloader.ReceivedWithAnyArgs().Download(CancellationToken.Empty);
}

[Test]
public void UseChunkedHttpDownloaderIfTorrentIsNotUsed()
public void UseChunkedHttpDownloader()
{
RemoteResource resource = CreateTestRemoteResource();

var httpDownloader = Substitute.For<IHttpDownloader>();
var chunkedHttpDownloader = Substitute.For<IChunkedHttpDownloader>();
var torrentDownloader = Substitute.For<ITorrentDownloader>();

var downloader = new RemoteResourceDownloader(_filePath, _metaFilePath, resource, false,
var downloader = new RemoteResourceDownloader(_filePath, _metaFilePath, resource,
(path, urls) => httpDownloader,
(path, urls, data, size) => chunkedHttpDownloader,
(path, filePath, bytes) => torrentDownloader);
(path, urls, data, size) => chunkedHttpDownloader);

downloader.Download(CancellationToken.Empty);

httpDownloader.DidNotReceiveWithAnyArgs().Download(CancellationToken.Empty);
chunkedHttpDownloader.ReceivedWithAnyArgs().Download(CancellationToken.Empty);
torrentDownloader.DidNotReceiveWithAnyArgs().Download(CancellationToken.Empty);
}

[Test]
Expand All @@ -159,17 +113,14 @@ public void UseHttpDownloaderIfChunksAreNotAvailable()

var httpDownloader = Substitute.For<IHttpDownloader>();
var chunkedHttpDownloader = Substitute.For<IChunkedHttpDownloader>();
var torrentDownloader = Substitute.For<ITorrentDownloader>();

var downloader = new RemoteResourceDownloader(_filePath, _metaFilePath, resource, false,
var downloader = new RemoteResourceDownloader(_filePath, _metaFilePath, resource,
(path, urls) => httpDownloader,
(path, urls, data, size) => chunkedHttpDownloader,
(path, filePath, bytes) => torrentDownloader);
(path, urls, data, size) => chunkedHttpDownloader);

downloader.Download(CancellationToken.Empty);

httpDownloader.ReceivedWithAnyArgs().Download(CancellationToken.Empty);
chunkedHttpDownloader.DidNotReceiveWithAnyArgs().Download(CancellationToken.Empty);
torrentDownloader.DidNotReceiveWithAnyArgs().Download(CancellationToken.Empty);
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace PatchKit.Unity
{
public class CustomBuildScripts
public class CustomBuilding
{
[MenuItem("Tools/Build/Windows x86")]
public static void BuildWindows86 ()
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading