Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Florian Lang
2017-08-15 11:24:59 +02:00
9 changed files with 30 additions and 23 deletions

View File

@@ -16,8 +16,7 @@ branches:
mono: none
# ASF requires .NET Core 2.0+
# TODO: We should target stable 2.0.0 once it's released
dotnet: 2.0.0-preview2-006497
dotnet: 2.0.0
env:
global:
@@ -32,14 +31,14 @@ script:
RUNTIMES="generic win-x64 linux-x64 linux-arm osx-x64"
dotnet build -c Release
dotnet test -c Release --no-build --no-restore ArchiSteamFarm.Tests
dotnet build -c Release --no-restore
dotnet test ArchiSteamFarm.Tests -c Release --no-build --no-restore
for RUNTIME in $RUNTIMES; do
if [ "$RUNTIME" = "generic" ]; then
dotnet publish -c Release -o "out/${RUNTIME}"
dotnet publish ArchiSteamFarm -c Release -o "out/${RUNTIME}" --no-restore
else
dotnet publish -c Release -r "$RUNTIME" -o "out/${RUNTIME}"
dotnet publish ArchiSteamFarm -c Release -o "out/${RUNTIME}" -r "$RUNTIME" --no-restore
fi
echo "$RUNTIME" > "ArchiSteamFarm/out/${RUNTIME}/ArchiSteamFarm.version"

View File

@@ -3,8 +3,8 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<AssemblyVersion>3.0.1.4</AssemblyVersion>
<FileVersion>3.0.1.4</FileVersion>
<AssemblyVersion>3.0.1.5</AssemblyVersion>
<FileVersion>3.0.1.5</FileVersion>
<LangVersion>latest</LangVersion>
<ErrorReport>none</ErrorReport>
<ApplicationIcon>ASF.ico</ApplicationIcon>
@@ -18,6 +18,8 @@
<RepositoryUrl>https://github.com/JustArchi/ArchiSteamFarm.git</RepositoryUrl>
<PackageIconUrl>https://github.com/JustArchi/ArchiSteamFarm/raw/master/resources/ASF.ico</PackageIconUrl>
<RepositoryType>Git</RepositoryType>
<ServerGarbageCollection>true</ServerGarbageCollection>
<ConcurrentGarbageCollection>true</ConcurrentGarbageCollection>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">

View File

@@ -49,6 +49,9 @@ namespace ArchiSteamFarm {
[JsonProperty(Required = Required.DisallowNull)]
internal readonly bool AutoUpdates = true;
[JsonProperty(Required = Required.DisallowNull)]
internal readonly byte BackgroundGCPeriod;
[SuppressMessage("ReSharper", "CollectionNeverUpdated.Global")]
[JsonProperty(Required = Required.DisallowNull)]
internal readonly HashSet<uint> Blacklist = new HashSet<uint>();
@@ -102,7 +105,7 @@ namespace ArchiSteamFarm {
internal readonly bool Statistics = true;
[JsonProperty(Required = Required.DisallowNull)]
internal readonly ProtocolTypes SteamProtocols = ProtocolTypes.All;
internal readonly ProtocolTypes SteamProtocols = ProtocolTypes.Tcp;
[JsonProperty(Required = Required.DisallowNull)]
internal readonly EUpdateChannel UpdateChannel = EUpdateChannel.Stable;

View File

@@ -28,18 +28,21 @@ using System.Threading;
namespace ArchiSteamFarm {
internal static class Hacks {
private const byte GarbageCollectorDelay = 1;
private static Timer GarbageCollectionTimer;
private static Timer GarbageCompactionTimer;
internal static void Init() {
internal static void EnableBackgroundGC(byte period) {
if (period == 0) {
ASF.ArchiLogger.LogNullError(nameof(period));
return;
}
if (GarbageCollectionTimer == null) {
GarbageCollectionTimer = new Timer(
e => GC.Collect(),
null,
TimeSpan.FromSeconds(GarbageCollectorDelay), // Delay
TimeSpan.FromSeconds(GarbageCollectorDelay) // Period
TimeSpan.FromSeconds(period), // Delay
TimeSpan.FromSeconds(period) // Period
);
}
@@ -47,8 +50,8 @@ namespace ArchiSteamFarm {
GarbageCompactionTimer = new Timer(
e => GCSettings.LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode.CompactOnce,
null,
TimeSpan.FromMinutes(GarbageCollectorDelay), // Delay
TimeSpan.FromMinutes(GarbageCollectorDelay) // Period
TimeSpan.FromMinutes(period), // Delay
TimeSpan.FromMinutes(period) // Period
);
}
}

View File

@@ -31,7 +31,6 @@ using System.IO;
using System.Linq;
using System.Reflection;
using System.Resources;
using System.Runtime;
using System.Threading.Tasks;
using ArchiSteamFarm.Localization;
using NLog;
@@ -238,8 +237,8 @@ namespace ArchiSteamFarm {
return;
}
if (GCSettings.IsServerGC) {
Hacks.Init();
if (GlobalConfig.BackgroundGCPeriod > 0) {
Hacks.EnableBackgroundGC(GlobalConfig.BackgroundGCPeriod);
}
if (!string.IsNullOrEmpty(GlobalConfig.CurrentCulture)) {

View File

@@ -1,6 +1,7 @@
{
"AutoRestart": true,
"AutoUpdates": true,
"BackgroundGCPeriod": 0,
"Blacklist": [],
"ConnectionTimeout": 60,
"CurrentCulture": null,
@@ -18,6 +19,6 @@
"OptimizationMode": 0,
"Statistics": true,
"SteamOwnerID": 0,
"SteamProtocols": 7,
"SteamProtocols": 1,
"UpdateChannel": 1
}

View File

@@ -28,9 +28,9 @@ after_test:
foreach ($RUNTIME in $RUNTIMES) {
if ($RUNTIME -eq 'generic') {
dotnet publish -c "$env:CONFIGURATION" -o "out\$RUNTIME"
dotnet publish ArchiSteamFarm -c "$env:CONFIGURATION" -o "out\$RUNTIME" --no-restore
} else {
dotnet publish -c "$env:CONFIGURATION" -r "$RUNTIME" -o "out\$RUNTIME"
dotnet publish ArchiSteamFarm -c "$env:CONFIGURATION" -o "out\$RUNTIME" -r "$RUNTIME" --no-restore
}
Set-Content -Path "ArchiSteamFarm\out\$RUNTIME\ArchiSteamFarm.version" -Value "$RUNTIME"

2
cc.sh
View File

@@ -44,7 +44,7 @@ if [[ "$CLEAN" -eq 1 ]]; then
fi
dotnet restore
dotnet build -c "$BUILD" -o "$OUT" "${MSBUILD_ARGS[@]}"
dotnet build -c "$BUILD" -o "$OUT" --no-restore "${MSBUILD_ARGS[@]}"
echo
echo "Compilation finished successfully! :)"

Binary file not shown.