diff --git a/src/TgSharp.Core/FileSessionStore.cs b/src/TgSharp.Core/FileSessionStore.cs index 071656df..4e2e847b 100644 --- a/src/TgSharp.Core/FileSessionStore.cs +++ b/src/TgSharp.Core/FileSessionStore.cs @@ -1,9 +1,9 @@ using System; using System.IO; -using TgSharp.TL; using TgSharp.Core.MTProto; using TgSharp.Core.MTProto.Crypto; +using TgSharp.TL; namespace TgSharp.Core { diff --git a/src/TgSharp.Core/Network/MtProtoSender.cs b/src/TgSharp.Core/Network/MtProtoSender.cs index 932bde62..2aa5d729 100644 --- a/src/TgSharp.Core/Network/MtProtoSender.cs +++ b/src/TgSharp.Core/Network/MtProtoSender.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Diagnostics; using System.IO; using System.IO.Compression; using System.Linq; @@ -8,13 +7,13 @@ using System.Threading; using System.Threading.Tasks; -using TgSharp.TL; using TgSharp.Core.Exceptions; using TgSharp.Core.MTProto; using TgSharp.Core.MTProto.Crypto; using TgSharp.Core.Network.Exceptions; using TgSharp.Core.Network.Requests; using TgSharp.Core.Utils; +using TgSharp.TL; namespace TgSharp.Core.Network { @@ -37,10 +36,14 @@ public MtProtoSender(TcpTransport transport, ISessionStore sessionStore, Session private int GenerateSequence(bool confirmed) { - lock (session.Lock) { - try { + lock (session.Lock) + { + try + { return confirmed ? session.Sequence++ * 2 + 1 : session.Sequence * 2; - } finally { + } + finally + { sessionStore.Save(session); } } @@ -71,7 +74,7 @@ private int GenerateSequence(bool confirmed) await Send(memory.ToArray(), request, token).ConfigureAwait(false); } - sessionStore.Save (session); + sessionStore.Save(session); } public async Task Send(byte[] packet, TLMethod request, CancellationToken token = default(CancellationToken)) diff --git a/src/TgSharp.Core/TgSharp.Core.nuspec b/src/TgSharp.Core/TgSharp.Core.nuspec index 61166662..448a6285 100644 --- a/src/TgSharp.Core/TgSharp.Core.nuspec +++ b/src/TgSharp.Core/TgSharp.Core.nuspec @@ -4,13 +4,14 @@ TgSharp 0.1 Telegram client library implemented in C# - Ilya P - aarani, knocte + Ilya P + aarani, knocte https://github.com/nblockchain/TgSharp/ false - Unofficial Telegram (http://telegram.org) client library implemented in C#. - -It's a perfect fit for any developer who would like to send data directly to Telegram users or write own custom Telegram client. + + Unofficial Telegram (http://telegram.org) client library implemented in C#. + It's a perfect fit for any developer who would like to send data directly to Telegram users or write own custom Telegram client. + telegram client, telegram API Copyright 2015-2020 diff --git a/src/TgSharp.Core/TgSharp.CoreCore.csproj b/src/TgSharp.Core/TgSharp.CoreCore.csproj new file mode 100644 index 00000000..ce429b22 --- /dev/null +++ b/src/TgSharp.Core/TgSharp.CoreCore.csproj @@ -0,0 +1,36 @@ + + + + netstandard2.1 + 8.0 + Ilya P, RandallFlagg + aarani, knocte + true + Telegram client library implemented in C# (.NET Standard 2.1) + Unofficial Telegram (http://telegram.org) client library implemented in C#. + It's a perfect fit for any developer who would like to send data directly to Telegram users or write own custom Telegram client. + + 0.1.0.0 + 0.1.0.0 + 0.1.0.0 + https://github.com/nblockchain/TgSharp/ + + Telegram + + + + + + + + + + + + + + + + + + diff --git a/src/TgSharp.TL/TgSharp.TLCore.csproj b/src/TgSharp.TL/TgSharp.TLCore.csproj new file mode 100644 index 00000000..655dddf7 --- /dev/null +++ b/src/TgSharp.TL/TgSharp.TLCore.csproj @@ -0,0 +1,33 @@ + + + + netstandard2.1 + 8.0 + Ilya P, RandallFlagg + aarani, knocte + true + Telegram client library implemented in C# (.NET Standard 2.1) + Unofficial Telegram (http://telegram.org) client library implemented in C#. + It's a perfect fit for any developer who would like to send data directly to Telegram users or write own custom Telegram client. + + 0.1.0.0 + 0.1.0.0 + 0.1.0.0 + https://github.com/nblockchain/TgSharp/ + + Telegram + + + + + + + + + + + + + + +