Compare commits

...

6 Commits

Author SHA1 Message Date
JustArchi
3db5830f7b Misc 2017-07-05 07:58:20 +02:00
JustArchi
4acc71485e Misc 2017-07-05 07:57:40 +02:00
JustArchi
7822210cc0 Misc + translations update 2017-07-05 07:49:40 +02:00
JustArchi
c46eee4499 Various auto-update improvements 2017-07-05 07:30:08 +02:00
JustArchi
ad09b1dec9 Fix possible early crash 2017-07-05 07:07:03 +02:00
JustArchi
e640f82712 Bump 2017-07-05 06:33:33 +02:00
42 changed files with 98 additions and 144 deletions

View File

@@ -46,32 +46,6 @@ namespace ArchiSteamFarm {
private static FileSystemWatcher FileSystemWatcher;
internal static async Task CheckForUpdate(bool updateOverride = false) {
string targetDirectory = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
// Cleanup from previous update - update directory for old in-use runtime files
string backupDirectory = Path.Combine(targetDirectory, SharedInfo.UpdateDirectory);
if (Directory.Exists(backupDirectory)) {
// It's entirely possible that old process is still running, wait at least a second for eventual cleanup
await Task.Delay(1000).ConfigureAwait(false);
try {
Directory.Delete(backupDirectory, true);
} catch (Exception e) {
ArchiLogger.LogGenericException(e);
return;
}
}
// Cleanup from previous update - old non-runtime in-use files
foreach (string file in Directory.GetFiles(targetDirectory, "*.old", SearchOption.AllDirectories)) {
try {
File.Delete(file);
} catch (Exception e) {
ArchiLogger.LogGenericException(e);
return;
}
}
if (Program.GlobalConfig.UpdateChannel == GlobalConfig.EUpdateChannel.None) {
return;
}
@@ -120,13 +94,39 @@ namespace ArchiSteamFarm {
ArchiLogger.LogGenericInfo(string.Format(Strings.AutoUpdateCheckInfo, autoUpdatePeriod.ToHumanReadable()));
}
ArchiLogger.LogGenericInfo(Strings.UpdateCheckingNewVersion);
string targetDirectory = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
// Cleanup from previous update - update directory for old in-use runtime files
string backupDirectory = Path.Combine(targetDirectory, SharedInfo.UpdateDirectory);
if (Directory.Exists(backupDirectory)) {
// It's entirely possible that old process is still running, wait a short moment for eventual cleanup
await Task.Delay(5000).ConfigureAwait(false);
try {
Directory.Delete(backupDirectory, true);
} catch (Exception e) {
ArchiLogger.LogGenericException(e);
return;
}
}
// Cleanup from previous update - old non-runtime in-use files
foreach (string file in Directory.GetFiles(targetDirectory, "*.old", SearchOption.AllDirectories)) {
try {
File.Delete(file);
} catch (Exception e) {
ArchiLogger.LogGenericException(e);
return;
}
}
string releaseURL = SharedInfo.GithubReleaseURL;
if (Program.GlobalConfig.UpdateChannel == GlobalConfig.EUpdateChannel.Stable) {
releaseURL += "/latest";
}
ArchiLogger.LogGenericInfo(Strings.UpdateCheckingNewVersion);
GitHub.ReleaseResponse releaseResponse;
if (Program.GlobalConfig.UpdateChannel == GlobalConfig.EUpdateChannel.Stable) {
@@ -189,7 +189,7 @@ namespace ArchiSteamFarm {
return;
}
ArchiLogger.LogGenericInfo(Strings.UpdateDownloadingNewVersion);
ArchiLogger.LogGenericInfo(string.Format(Strings.UpdateDownloadingNewVersion, newVersion, binaryAsset.Size / 1024 / 1024));
byte[] result = await Program.WebBrowser.UrlGetToBytesRetry(binaryAsset.DownloadURL).ConfigureAwait(false);
if (result == null) {

View File

@@ -3,8 +3,8 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<AssemblyVersion>3.0.0.1</AssemblyVersion>
<FileVersion>3.0.0.1</FileVersion>
<AssemblyVersion>3.0.0.2</AssemblyVersion>
<FileVersion>3.0.0.2</FileVersion>
<LangVersion>7</LangVersion>
<ErrorReport>none</ErrorReport>
<ApplicationIcon>ASF.ico</ApplicationIcon>

View File

@@ -55,6 +55,11 @@ namespace ArchiSteamFarm.JSON {
internal readonly string Name;
#pragma warning restore 649
#pragma warning disable 649
[JsonProperty(PropertyName = "size", Required = Required.Always)]
internal readonly uint Size;
#pragma warning restore 649
// Deserialized from JSON
private Asset() { }
}

View File

@@ -1306,7 +1306,7 @@ namespace ArchiSteamFarm.Localization {
}
/// <summary>
/// Wyszukuje zlokalizowany ciąg podobny do ciągu Downloading new version... While waiting, consider donating if you appreciate the work being done! :).
/// Wyszukuje zlokalizowany ciąg podobny do ciągu Downloading new version: {0} ({1} MB)... While waiting, consider donating if you appreciate the work being done! :).
/// </summary>
internal static string UpdateDownloadingNewVersion {
get {

View File

@@ -191,9 +191,7 @@
<data name="UpdateCheckingNewVersion" xml:space="preserve">
<value>جاري التحقيق من وجود إصدار جديد...</value>
</data>
<data name="UpdateDownloadingNewVersion" xml:space="preserve">
<value>جاري تحميل الإصدار الجديد... بينما تنتظر، تبرع إذا اعجبك عملنا! :)</value>
</data>
<data name="UpdateFinished" xml:space="preserve">
<value>تم الانتهاء من عملية التحديث!</value>
</data>

View File

@@ -235,9 +235,7 @@
<data name="UpdateCheckingNewVersion" xml:space="preserve">
<value>Проверяване за нова версия...</value>
</data>
<data name="UpdateDownloadingNewVersion" xml:space="preserve">
<value>В момента се сваля новата версия... Докато чакате, помислете за дарение, ако оценявате свършената от нас работа! :)</value>
</data>
<data name="UpdateFinished" xml:space="preserve">
<value>Обновлението приключи!</value>
</data>

View File

@@ -241,9 +241,7 @@ StackTrace:
<data name="UpdateCheckingNewVersion" xml:space="preserve">
<value>Kontrola nové verze...</value>
</data>
<data name="UpdateDownloadingNewVersion" xml:space="preserve">
<value>Probíhá stahování nové verze... Během čekání zvažte podpotu tohoto projektu! :)</value>
</data>
<data name="UpdateFinished" xml:space="preserve">
<value>Úspěšně aktualizováno.</value>
</data>

View File

@@ -240,9 +240,7 @@ StackTrace:
<data name="UpdateCheckingNewVersion" xml:space="preserve">
<value>Undersøger for ny version...</value>
</data>
<data name="UpdateDownloadingNewVersion" xml:space="preserve">
<value>Downloader ny version... Mens du venter, overvej at donere hvis du sætter pris på det arbejde der bliver gjort! :)</value>
</data>
<data name="UpdateFinished" xml:space="preserve">
<value>Opdateringsprocessen er færdig!</value>
</data>

View File

@@ -240,9 +240,7 @@ StackTrace:
<data name="UpdateCheckingNewVersion" xml:space="preserve">
<value>Prüfe auf neue Version...</value>
</data>
<data name="UpdateDownloadingNewVersion" xml:space="preserve">
<value>Lade neue Version herunter... Während du wartest, denk darüber nach zu spenden, wenn du die geleistete Arbeit zu schätzen weißt! :)</value>
</data>
<data name="UpdateFinished" xml:space="preserve">
<value>Aktualisierung abgeschlossen!</value>
</data>

View File

@@ -241,9 +241,7 @@ StackTrace:
<data name="UpdateCheckingNewVersion" xml:space="preserve">
<value>Prüfe auf neue Version...</value>
</data>
<data name="UpdateDownloadingNewVersion" xml:space="preserve">
<value>Lade neue Version herunter... Während du wartest, denk darüber nach zu spenden, wenn du die geleistete Arbeit zu schätzen weißt! :)</value>
</data>
<data name="UpdateFinished" xml:space="preserve">
<value>Aktualisierung abgeschlossen!</value>
</data>

View File

@@ -235,9 +235,7 @@ StackTrace:
<data name="UpdateCheckingNewVersion" xml:space="preserve">
<value>Έλεγχος για νέα έκδοση...</value>
</data>
<data name="UpdateDownloadingNewVersion" xml:space="preserve">
<value>Λήψη νέας έκδοσης... Όσο περιμένετε, σκεφτείτε να κάνετε μια δωρεά εάν εκτιμάτε τη δουλειά που γίνεται! :)</value>
</data>
<data name="UpdateFinished" xml:space="preserve">
<value>Η διαδικασία ενημέρωσης ολοκληρώθηκε!</value>
</data>

View File

@@ -240,9 +240,7 @@ Trazo de pila:
<data name="UpdateCheckingNewVersion" xml:space="preserve">
<value>Comprobando si existe una nueva versión...</value>
</data>
<data name="UpdateDownloadingNewVersion" xml:space="preserve">
<value>Descargando la nueva versión... ¡Mientras espera, considere donar si aprecia el trabajo que se está realizando! :)</value>
</data>
<data name="UpdateFinished" xml:space="preserve">
<value>¡Proceso de actualización finalizado!</value>
</data>

View File

@@ -201,9 +201,7 @@
<data name="UpdateCheckingNewVersion" xml:space="preserve">
<value>Tarkistetaan päivityksiä...</value>
</data>
<data name="UpdateDownloadingNewVersion" xml:space="preserve">
<value>Ladataan päivityksiä... Odottaessa, harkitse lahjoittamista kiittääksesi työhön käytetystä ajasta! :)</value>
</data>
<data name="UpdateFinished" xml:space="preserve">
<value>Päivitys valmis!</value>
</data>

View File

@@ -241,9 +241,7 @@ StackTrace :
<data name="UpdateCheckingNewVersion" xml:space="preserve">
<value>Recherche d'une nouvelle version...</value>
</data>
<data name="UpdateDownloadingNewVersion" xml:space="preserve">
<value>Téléchargement de la nouvelle version en cours... En attendant, vous pouvez faire un don si vous appréciez le travail effectué ! :)</value>
</data>
<data name="UpdateFinished" xml:space="preserve">
<value>Mise à jour terminée !</value>
</data>

View File

@@ -241,9 +241,7 @@ StackTrace :
<data name="UpdateCheckingNewVersion" xml:space="preserve">
<value>Recherche d'une nouvelle version...</value>
</data>
<data name="UpdateDownloadingNewVersion" xml:space="preserve">
<value>Téléchargement de la nouvelle version en cours... En attendant, vous pouvez faire un don si vous appréciez le travail effectué ! :)</value>
</data>
<data name="UpdateFinished" xml:space="preserve">
<value>Mise à jour terminée !</value>
</data>

View File

@@ -228,9 +228,7 @@ StackTrace:
<data name="UpdateCheckingNewVersion" xml:space="preserve">
<value>מחפש גירסה חדשה...</value>
</data>
<data name="UpdateDownloadingNewVersion" xml:space="preserve">
<value>מוריד גירסה חדשה... בזמן ההמתנה, אנא שקלו לתרום אם אתם מעריכים את העבודה שאנו עושים :)</value>
</data>
<data name="UpdateFinished" xml:space="preserve">
<value>תהליך העדכון הסתיים!</value>
</data>

View File

@@ -239,9 +239,7 @@ StackTrace: {2}</value>
<data name="UpdateCheckingNewVersion" xml:space="preserve">
<value>Új verzió keresése...</value>
</data>
<data name="UpdateDownloadingNewVersion" xml:space="preserve">
<value>Új verzió letöltése folyamatban... Mialatt várakozol, fontold meg, hogy pénzzel támogatod a munkámat, ha tetszik, amit csinálok! :)</value>
</data>
<data name="UpdateFinished" xml:space="preserve">
<value>Frissítés kész!</value>
</data>

View File

@@ -239,9 +239,7 @@
<data name="UpdateCheckingNewVersion" xml:space="preserve">
<value>Sedang mengecek versi terbaru...</value>
</data>
<data name="UpdateDownloadingNewVersion" xml:space="preserve">
<value>Mengunduh versi baru... Sambil menunggu, pertimbangkan untuk mengapresiasi seluruh kerja keras dengan mendonasi! :)</value>
</data>
<data name="UpdateFinished" xml:space="preserve">
<value>Proses update selesai!</value>
</data>

View File

@@ -239,9 +239,7 @@
<data name="UpdateCheckingNewVersion" xml:space="preserve">
<value>Verifica della nuova versione...</value>
</data>
<data name="UpdateDownloadingNewVersion" xml:space="preserve">
<value>Scaricando la nuova versione... Durante l'attesa, considera una donazione se apprezzi il lavoro svolto! :)</value>
</data>
<data name="UpdateFinished" xml:space="preserve">
<value>Aggiornamento completato!</value>
</data>

View File

@@ -238,9 +238,7 @@
<data name="UpdateCheckingNewVersion" xml:space="preserve">
<value>新しいバージョンをチェックしています...</value>
</data>
<data name="UpdateDownloadingNewVersion" xml:space="preserve">
<value>新しいバージョンをダウンロードしています... 待っている間、作者への寄付をご検討ください! :)</value>
</data>
<data name="UpdateFinished" xml:space="preserve">
<value>アップデート完了!</value>
</data>

View File

@@ -241,9 +241,7 @@ StackTrace:
<data name="UpdateCheckingNewVersion" xml:space="preserve">
<value>새로운 버전 확인 중...</value>
</data>
<data name="UpdateDownloadingNewVersion" xml:space="preserve">
<value>새로운 버전을 다운로드 중... 기다리는 동안, 완성된 작업이 고맙다면 기부를 고려해 보세요! :)</value>
</data>
<data name="UpdateFinished" xml:space="preserve">
<value>업데이트 작업 완료!</value>
</data>

View File

@@ -238,9 +238,7 @@
<data name="UpdateCheckingNewVersion" xml:space="preserve">
<value>Ieškoma naujos versijos...</value>
</data>
<data name="UpdateDownloadingNewVersion" xml:space="preserve">
<value>Atsiunčiama nauja versija... Kol laukiate, apsvarstykite, gal norite paaukoti jei vertinate daromą darbą! :)</value>
</data>
<data name="UpdateFinished" xml:space="preserve">
<value>Naujinimo procesas baigtas!</value>
</data>

View File

@@ -240,9 +240,7 @@ StackTrace:
<data name="UpdateCheckingNewVersion" xml:space="preserve">
<value>Controleren op nieuwe versie...</value>
</data>
<data name="UpdateDownloadingNewVersion" xml:space="preserve">
<value>Nieuwe versie wordt gedownload... Als je het gedane werk waardeert, overweeg dan tijdens het wachten om te doneren! :)</value>
</data>
<data name="UpdateFinished" xml:space="preserve">
<value>Update is afgerond!</value>
</data>

View File

@@ -240,9 +240,7 @@ StackTrace:
<data name="UpdateCheckingNewVersion" xml:space="preserve">
<value>Controleren op nieuwe versie...</value>
</data>
<data name="UpdateDownloadingNewVersion" xml:space="preserve">
<value>Nieuwe versie wordt gedownload... Als je het gedane werk waardeert, overweeg dan tijdens het wachten om te doneren! :)</value>
</data>
<data name="UpdateFinished" xml:space="preserve">
<value>Update is afgerond!</value>
</data>

View File

@@ -247,7 +247,8 @@ StackTrace:
<value>Wyszukiwanie nowej wersji...</value>
</data>
<data name="UpdateDownloadingNewVersion" xml:space="preserve">
<value>Pobieranie nowej wersji... Podczas czekania rozważ dotację, jeśli doceniasz naszą pracę! :)</value>
<value>Pobieranie nowej wersji: {0} ({1} MB)... Podczas czekania rozważ dotację, jeśli doceniasz naszą pracę! :)</value>
<comment>{0} will be replaced by version string, {1} will be replaced by update size (in megabytes)</comment>
</data>
<data name="UpdateFinished" xml:space="preserve">
<value>Aktualizacja została zakończona!</value>

View File

@@ -241,9 +241,7 @@ StackTrace:
<data name="UpdateCheckingNewVersion" xml:space="preserve">
<value>Verificando se há atualizações...</value>
</data>
<data name="UpdateDownloadingNewVersion" xml:space="preserve">
<value>Baixando nova versão... Enquanto aguarda, considere fazer uma doação caso aprecie o trabalho que está sendo feito! :)</value>
</data>
<data name="UpdateFinished" xml:space="preserve">
<value>Processo de atualização finalizado!</value>
</data>

View File

@@ -238,9 +238,7 @@ StackTrace:
<data name="UpdateCheckingNewVersion" xml:space="preserve">
<value>A verificar por novas versões...</value>
</data>
<data name="UpdateDownloadingNewVersion" xml:space="preserve">
<value>A obter a nova versão... Enquanto espera, considere doar algo se aprecias o trabalho feito! :)</value>
</data>
<data name="UpdateFinished" xml:space="preserve">
<value>Processo de actualização terminada!</value>
</data>

View File

@@ -247,7 +247,8 @@ StackTrace:
<value>Checking for new version...</value>
</data>
<data name="UpdateDownloadingNewVersion" xml:space="preserve">
<value>Downloading new version... While waiting, consider donating if you appreciate the work being done! :)</value>
<value>Downloading new version: {0} ({1} MB)... While waiting, consider donating if you appreciate the work being done! :)</value>
<comment>{0} will be replaced by version string, {1} will be replaced by update size (in megabytes)</comment>
</data>
<data name="UpdateFinished" xml:space="preserve">
<value>Update process finished!</value>

View File

@@ -241,9 +241,7 @@ StackTrace:
<data name="UpdateCheckingNewVersion" xml:space="preserve">
<value>Se caută versiune nouă...</value>
</data>
<data name="UpdateDownloadingNewVersion" xml:space="preserve">
<value>Se descarcă o versiune nouă... Cât timp aștepți, dacă consideri, poți dona dacă apreciezi toată munca depusă! :)</value>
</data>
<data name="UpdateFinished" xml:space="preserve">
<value>Proces de actualizare finalizat!</value>
</data>

View File

@@ -241,9 +241,7 @@
<data name="UpdateCheckingNewVersion" xml:space="preserve">
<value>Проверка новой версии...</value>
</data>
<data name="UpdateDownloadingNewVersion" xml:space="preserve">
<value>Загрузка новой версии... Во время ожидания подумайте о пожертвовании в пользу разработчиков, если вы цените проделанную работу! :)</value>
</data>
<data name="UpdateFinished" xml:space="preserve">
<value>Процесс обновления завершён!</value>
</data>

View File

@@ -241,9 +241,7 @@ StackTrace:
<data name="UpdateCheckingNewVersion" xml:space="preserve">
<value>Kontrola najnovšej verzie...</value>
</data>
<data name="UpdateDownloadingNewVersion" xml:space="preserve">
<value>Sťahovanie najnovšej verzie... Zváž podporu tohto projektu počas čakania! :)</value>
</data>
<data name="UpdateFinished" xml:space="preserve">
<value>Aktualizácia úspešne dokončená!</value>
</data>

View File

@@ -225,9 +225,7 @@ StackTrace:
<data name="UpdateCheckingNewVersion" xml:space="preserve">
<value>Traženje nove verzije...</value>
</data>
<data name="UpdateDownloadingNewVersion" xml:space="preserve">
<value>Skidanje nove verzije... Dok čekate, razmislite o podržavanju ovoh programa putem donacija ako cenite uložen rad! :)</value>
</data>
<data name="UpdateFinished" xml:space="preserve">
<value>Proces ažuriranja je završen!</value>
</data>

View File

@@ -241,10 +241,7 @@ StackTrace:
<data name="UpdateCheckingNewVersion" xml:space="preserve">
<value>Söker efter senaste versionen...</value>
</data>
<data name="UpdateDownloadingNewVersion" xml:space="preserve">
<value>Laddar ner senaste versionen... Medan du väntar, fundera på att donera om du uppskattar arbetet som görs!
:)</value>
</data>
<data name="UpdateFinished" xml:space="preserve">
<value>Uppdateringsprocessen klar!</value>
</data>

View File

@@ -241,9 +241,7 @@ Yığın izleme:
<data name="UpdateCheckingNewVersion" xml:space="preserve">
<value>Yeni sürüm kontrol ediliyor...</value>
</data>
<data name="UpdateDownloadingNewVersion" xml:space="preserve">
<value>Yeni sürüm indiriliyor... Beklerken, yaptığımız çalışmayı takdir ediyorsanız bağış yapmayı düşünün! :)</value>
</data>
<data name="UpdateFinished" xml:space="preserve">
<value>Güncelleme işlemi tamamlandı!</value>
</data>

View File

@@ -241,9 +241,7 @@
<data name="UpdateCheckingNewVersion" xml:space="preserve">
<value>Перевірка наявності нової версії...</value>
</data>
<data name="UpdateDownloadingNewVersion" xml:space="preserve">
<value>Завантаження нової версії... Під час очікування подумайте про пожертвування на користь розробників, якщо ви цінуєте виконану роботу! :)</value>
</data>
<data name="UpdateFinished" xml:space="preserve">
<value>Процесс оновлення закінчено!</value>
</data>

View File

@@ -236,9 +236,7 @@ StackTrace:
<data name="UpdateCheckingNewVersion" xml:space="preserve">
<value>Kiểm tra phiên bản mới...</value>
</data>
<data name="UpdateDownloadingNewVersion" xml:space="preserve">
<value>Tải xuống phiên bản mới... Trong khi chờ đợi, hãy xem xét quyên góp nếu bạn đánh giá cao công việc được thực hiện! :)</value>
</data>
<data name="UpdateFinished" xml:space="preserve">
<value>Quá trình cập nhật hoàn tất!</value>
</data>

View File

@@ -238,9 +238,7 @@
<data name="UpdateCheckingNewVersion" xml:space="preserve">
<value>正在检查新版本...</value>
</data>
<data name="UpdateDownloadingNewVersion" xml:space="preserve">
<value>更新中……如果你喜欢这个项目,可以考虑趁现在进行捐赠:)</value>
</data>
<data name="UpdateFinished" xml:space="preserve">
<value>更新完毕</value>
</data>

View File

@@ -238,9 +238,7 @@
<data name="UpdateCheckingNewVersion" xml:space="preserve">
<value>正在檢查新版本...</value>
</data>
<data name="UpdateDownloadingNewVersion" xml:space="preserve">
<value>正在下載新版本... 等待期間如果喜歡這個軟體請考慮捐助ASF! :)</value>
</data>
<data name="UpdateFinished" xml:space="preserve">
<value>更新完成 </value>
</data>

View File

@@ -135,6 +135,9 @@ namespace ArchiSteamFarm {
ASF.ArchiLogger.LogGenericException(e);
}
// Give new process some time to take over the window (if needed)
await Task.Delay(2000).ConfigureAwait(false);
ShutdownResetEvent.Set();
Environment.Exit(0);
}
@@ -306,7 +309,7 @@ namespace ArchiSteamFarm {
OS.Init(GlobalConfig.Headless);
WebBrowser.Init();
WebBrowser = new WebBrowser(ASF.ArchiLogger);
WebBrowser = new WebBrowser(ASF.ArchiLogger, true);
}
private static async Task<bool> InitShutdownSequence() {

View File

@@ -37,6 +37,7 @@ namespace ArchiSteamFarm {
internal sealed class WebBrowser {
internal const byte MaxRetries = 5; // Defines maximum number of retries, UrlRequest() does not handle retry by itself (it's app responsibility)
private const byte ExtendedTimeoutMultiplier = 10; // Multiplier for WebBrowsers dealing with huge data
private const byte MaxConnections = ServicePointManager.DefaultNonPersistentConnectionLimit; // Defines maximum number of connections per ServicePoint. Be careful, as it also defines maximum number of sockets in CLOSE_WAIT state
private const byte MaxIdleTime = 15; // In seconds, how long socket is allowed to stay in CLOSE_WAIT state after there are no connections to it
@@ -45,7 +46,7 @@ namespace ArchiSteamFarm {
private readonly ArchiLogger ArchiLogger;
private readonly HttpClient HttpClient;
internal WebBrowser(ArchiLogger archiLogger) {
internal WebBrowser(ArchiLogger archiLogger, bool extendedTimeout = false) {
ArchiLogger = archiLogger ?? throw new ArgumentNullException(nameof(archiLogger));
HttpClientHandler httpClientHandler = new HttpClientHandler {
@@ -54,7 +55,7 @@ namespace ArchiSteamFarm {
};
HttpClient = new HttpClient(httpClientHandler) {
Timeout = TimeSpan.FromSeconds(Program.GlobalConfig.ConnectionTimeout)
Timeout = TimeSpan.FromSeconds(extendedTimeout ? ExtendedTimeoutMultiplier * Program.GlobalConfig.ConnectionTimeout : Program.GlobalConfig.ConnectionTimeout)
};
// Most web services expect that UserAgent is set, so we declare it globally
@@ -380,12 +381,13 @@ namespace ArchiSteamFarm {
}
private async Task<HttpResponseMessage> UrlGetToResponse(string request, string referer = null) {
if (!string.IsNullOrEmpty(request)) {
return await UrlRequest(new Uri(request), HttpMethod.Get, null, referer).ConfigureAwait(false);
if (string.IsNullOrEmpty(request)) {
ArchiLogger.LogNullError(nameof(request));
return null;
}
ArchiLogger.LogNullError(nameof(request));
return null;
HttpResponseMessage result = await UrlRequest(new Uri(request), HttpMethod.Get, null, referer).ConfigureAwait(false);
return result;
}
private async Task<XmlDocument> UrlGetToXML(string request, string referer = null) {

View File

@@ -15,9 +15,9 @@ This tool is being used by ASF developers for synchronization of strings/transla
## Before you begin
- Make sure that your ```crowdin_identity.yaml``` file exists - this is the file with login credentials that is not being committed to GitHub. If it doesn't exist yet (e.g. because you've just cloned the repo), create it from ```crowdin_identity_example.yaml``` and fill ```api_key``` that can be found **[here](http://l10n.asf.justarchi.net/project/archisteamfarm/settings#api)**.
- Make sure that your `crowdin_identity.yaml` file exists - this is the file with login credentials that is not being committed to GitHub. If it doesn't exist yet (e.g. because you've just cloned the repo), create it from `crowdin_identity_example.yaml` and fill `api_key` that can be found **[here](http://l10n.asf.justarchi.net/project/archisteamfarm/settings#api)**.
- Ensure that ```crowdin``` command is recognized by your OS.
- Ensure that `crowdin` command is recognized by your OS.
---
@@ -25,14 +25,16 @@ This tool is being used by ASF developers for synchronization of strings/transla
- Install **[Java JDK](http://www.oracle.com/technetwork/java/javase/downloads/index.html)**.
- **[Set JAVA_HOME properly](https://confluence.atlassian.com/doc/setting-the-java_home-variable-in-windows-8895.html)**.
- Launch ```setup_crowdin.bat``` as administrator.
- Open new ```cmd``` prompt and verify that ```crowdin help``` indeed works.
- Launch `setup_crowdin.bat` as administrator.
- Open new `cmd` prompt and verify that `crowdin help` indeed works.
---
## Usage
- ```archi_download.bat``` for downloading translations from Crowdin (typically last commit before release).
- `archi_upload.bat` for pushing strings to Crowdin (when any `*Strings.resx` file gets modified).
- ```archi_upload.bat``` for pushing strings to Crowdin (when any ```*Strings.resx``` file gets modified).
- `archi_download.bat` for downloading translations from Crowdin (typically last commit before release).
- `archi_sync.bat` for upload + download (tree sync).

View File

@@ -0,0 +1,5 @@
@echo off
cd ..\\..
call crowdin -b master --identity tools\\crowdin-cli\\crowdin_identity.yaml upload sources
call crowdin -b master --identity tools\\crowdin-cli\\crowdin_identity.yaml download
pause