diff --git a/TLSharp.Core/Properties/AssemblyInfo.cs b/TLSharp.Core/Properties/AssemblyInfo.cs deleted file mode 100644 index 856dc61d..00000000 --- a/TLSharp.Core/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("TLSharp.Core")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("TLSharp.Core")] -[assembly: AssemblyCopyright("Copyright © 2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("400d2544-1cc6-4d8a-a62c-2292d9947a16")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/TLSharp.Core/Requests/AuthSendCodeRequest.cs b/TLSharp.Core/Requests/AuthSendCodeRequest.cs deleted file mode 100644 index 06852a85..00000000 --- a/TLSharp.Core/Requests/AuthSendCodeRequest.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System; -using System.IO; -using TLSharp.Core.MTProto; -using TeleSharp.TL; -namespace TLSharp.Core.Requests -{ - public class AuthSendCodeRequest : MTProtoRequest - { - - public bool _phoneRegistered; - public string _phoneCodeHash; - public SendCodeArgs args=new SendCodeArgs(); - public AuthSendCodeRequest(string phoneNumber, int smsType, int apiId, string apiHash, string langCode) - { - - args.phone_number = phoneNumber; - args.api_id = apiId; - args.api_hash = apiHash; - args.allow_flashcall = false; - args.current_number = true; - } - - public override void OnSend(BinaryWriter writer) - { - writer.Write(0x86AEF0EC); - writer.Write(0); - Serializers.String.write(writer, args.phone_number); - writer.Write(args.api_id.Value); - Serializers.String.write(writer, args.api_hash); - } - - public override void OnResponse(BinaryReader reader) - { - - var s = Deserializer.Deserialize(typeof(SentCode), reader); - _phoneRegistered = ((SentCode)s).phone_registered; - _phoneCodeHash = ((SentCode)s).phone_code_hash; - } - - public override void OnException(Exception exception) - { - throw new NotImplementedException(); - } - - public override bool Confirmed => true; - public override bool Responded { get; } - } -} diff --git a/TLSharp.Core/Requests/AuthSignInRequest.cs b/TLSharp.Core/Requests/AuthSignInRequest.cs deleted file mode 100644 index 83dc2c20..00000000 --- a/TLSharp.Core/Requests/AuthSignInRequest.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using System.IO; -using TeleSharp.TL; -namespace TLSharp.Core.Requests -{ - public class AuthSignInRequest : MTProtoRequest - { - private SignInArgs args = new SignInArgs(); - public User user; - public int SessionExpires; - - public AuthSignInRequest(string phoneNumber, string phoneCodeHash, string code) - { - args.phone_number = phoneNumber; - args.phone_code_hash = phoneCodeHash; - args.phone_code = code; - } - - public override void OnSend(BinaryWriter writer) - { - Serializer.Serialize(args, typeof(SignInArgs), writer); - } - - public override void OnResponse(BinaryReader reader) - { - var auth = (Authorization)Deserializer.Deserialize(typeof(Authorization), reader); - user = auth.user; - } - - public override void OnException(Exception exception) - { - throw new NotImplementedException(); - } - - public override bool Confirmed => true; - public override bool Responded { get; } - } -} diff --git a/TLSharp.Core/Requests/DownloadFileRequest.cs b/TLSharp.Core/Requests/DownloadFileRequest.cs deleted file mode 100644 index 4574a9b0..00000000 --- a/TLSharp.Core/Requests/DownloadFileRequest.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using System.IO; -using TeleSharp.TL; -namespace TLSharp.Core.Requests -{ - public class DownloadFileRequest : MTProtoRequest - { - private GetFileArgs args = new GetFileArgs(); - public TeleSharp.TL.File file; - - public DownloadFileRequest(InputFileLocation loc,int offset=0,int limit=0) - { - args.location = loc; - args.offset = offset; - args.limit = limit; - } - - public override void OnSend(BinaryWriter writer) - { - Serializer.Serialize(args, typeof(InputFileLocation), writer); - } - - public override void OnResponse(BinaryReader reader) - { - file = (TeleSharp.TL.File)Deserializer.Deserialize(typeof(TeleSharp.TL.File), reader); - } - - public override void OnException(Exception exception) - { - throw new NotImplementedException(); - } - - public override bool Confirmed => true; - public override bool Responded { get; } - } -} diff --git a/TLSharp.Core/Requests/InitConnectionRequest.cs b/TLSharp.Core/Requests/InitConnectionRequest.cs deleted file mode 100644 index b428e8db..00000000 --- a/TLSharp.Core/Requests/InitConnectionRequest.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using TeleSharp.TL; -using TLSharp.Core.MTProto; - -namespace TLSharp.Core.Requests -{ - public class InitConnectionRequest : MTProtoRequest - { - public InvokeWithLayerArgs invokeWithLayer { get; set; } - public InitConnectionArgs initConn { get; set; } - public GetConfigArgs getConfig { get; set; } - public TeleSharp.TL.Config Configs { get; set; } - - public InitConnectionRequest(int apiId) - { - invokeWithLayer = new InvokeWithLayerArgs(); - initConn = new InitConnectionArgs(); - invokeWithLayer.layer = 53; - initConn.api_id = apiId; - initConn.app_version = "1.0-SNAPSHOT"; - initConn.lang_code = "en"; - initConn.system_version = "WinPhone 8.0"; - initConn.device_model = "WinPhone Emulator"; - initConn.query = new GetConfigArgs(); - invokeWithLayer.query = initConn; - } - - public override void OnSend(BinaryWriter writer) - { - Serializer.Serialize(invokeWithLayer, invokeWithLayer.GetType(), writer); - } - - - public override void OnResponse(BinaryReader reader) - { - Configs = (TeleSharp.TL.Config)Deserializer.Deserialize(typeof(TeleSharp.TL.Config), reader); - } - - public override void OnException(Exception exception) - { - throw new NotImplementedException(); - } - - public override bool Responded - { - get { return true; } - } - - public override void OnSendSuccess() - { - - } - public override bool Confirmed => true; - } -} diff --git a/TLSharp.Core/Requests/MTProtoRequest.cs b/TLSharp.Core/Requests/MTProtoRequest.cs deleted file mode 100644 index c095d397..00000000 --- a/TLSharp.Core/Requests/MTProtoRequest.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; -using System.IO; - -namespace TLSharp.Core.Requests -{ - public abstract class MTProtoRequest - { - public MTProtoRequest() - { - Sended = false; - } - - public long MessageId { get; set; } - public int Sequence { get; set; } - - public bool Dirty { get; set; } - - public bool Sended { get; private set; } - public DateTime SendTime { get; private set; } - public bool ConfirmReceived { get; set; } - public abstract void OnSend(BinaryWriter writer); - public abstract void OnResponse(BinaryReader reader); - public abstract void OnException(Exception exception); - public abstract bool Confirmed { get; } - public abstract bool Responded { get; } - - public virtual void OnSendSuccess() - { - SendTime = DateTime.Now; - Sended = true; - } - - public virtual void OnConfirm() - { - ConfirmReceived = true; - } - - public bool NeedResend - { - get - { - return Dirty || (Confirmed && !ConfirmReceived && DateTime.Now - SendTime > TimeSpan.FromSeconds(3)); - } - } - } -} diff --git a/TLSharp.Core/TLSharp.Core.csproj b/TLSharp.Core/TLSharp.Core.csproj index fbef9425..2033ee08 100644 --- a/TLSharp.Core/TLSharp.Core.csproj +++ b/TLSharp.Core/TLSharp.Core.csproj @@ -1,89 +1,31 @@ - - - + + - Debug - AnyCPU - {400D2544-1CC6-4D8A-A62C-2292D9947A16} - Library - Properties - TLSharp.Core - TLSharp.Core - v4.5 - 512 + netstandard2.0;net461 + TLSharp.Core + 1.0.1 + TLSharp.Core + TLSharp.Core + TLSharp.Core + 1.0.1.0 - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 + + - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 + + + - - ..\packages\MarkerMetro.Unity.Ionic.Zlib.2.0.0.14\lib\net35\Ionic.ZLib.dll - True - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - + + - + - - - {d6144517-91d2-4880-86df-e9ff5d7f383a} - TeleSharp.TL - - - - - \ No newline at end of file + + diff --git a/TLSharp.Tests.NUnit/TLSharp.Tests.NUnit.csproj b/TLSharp.Tests.NUnit/TLSharp.Tests.NUnit.csproj index e947f4e9..1cb2d2e5 100644 --- a/TLSharp.Tests.NUnit/TLSharp.Tests.NUnit.csproj +++ b/TLSharp.Tests.NUnit/TLSharp.Tests.NUnit.csproj @@ -1,5 +1,5 @@ - - + + Debug AnyCPU @@ -7,7 +7,8 @@ Library TLSharp.Tests.NUnit TLSharp.Tests.NUnit - v4.5 + v4.6.1 + true @@ -28,10 +29,10 @@ false - - - ..\packages\NUnit.2.6.4\lib\nunit.framework.dll + + ..\packages\NUnit.3.9.0\lib\net45\nunit.framework.dll + @@ -40,15 +41,13 @@ app.config - - - + {DE5C0467-EE99-4734-95F2-EFF7A0B99924} TLSharp.Tests - + \ No newline at end of file diff --git a/TLSharp.Tests.NUnit/Test.cs b/TLSharp.Tests.NUnit/Test.cs index 40e54ac6..bbd427bb 100644 --- a/TLSharp.Tests.NUnit/Test.cs +++ b/TLSharp.Tests.NUnit/Test.cs @@ -6,10 +6,9 @@ namespace TLSharp.Tests { - [TestFixture] public class TLSharpTestsNUnit : TLSharpTests { - [TestFixtureSetUp] + [OneTimeSetUp] public void Init() { base.Init(o => Assert.IsNotNull(o), b => Assert.IsTrue(b)); diff --git a/TLSharp.Tests.NUnit/packages.config b/TLSharp.Tests.NUnit/packages.config index c714ef3a..b93fa214 100644 --- a/TLSharp.Tests.NUnit/packages.config +++ b/TLSharp.Tests.NUnit/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/TLSharp.Tests.VS/TLSharp.Tests.VS.csproj b/TLSharp.Tests.VS/TLSharp.Tests.VS.csproj index a44fff4b..8582dcf0 100644 --- a/TLSharp.Tests.VS/TLSharp.Tests.VS.csproj +++ b/TLSharp.Tests.VS/TLSharp.Tests.VS.csproj @@ -8,7 +8,7 @@ Properties TLSharp.Tests.VS TLSharp.Tests.VS - v4.5 + v4.6.1 512 {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 10.0 @@ -16,6 +16,7 @@ $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages False UnitTest + true diff --git a/TLSharp.Tests/TLSharp.Tests.csproj b/TLSharp.Tests/TLSharp.Tests.csproj index e2277f1c..f9974155 100644 --- a/TLSharp.Tests/TLSharp.Tests.csproj +++ b/TLSharp.Tests/TLSharp.Tests.csproj @@ -9,8 +9,9 @@ Properties TLSharp.Tests TLSharp.Tests - v4.5 + v4.6.1 512 + true diff --git a/TLSharp.Tests/app.config b/TLSharp.Tests/app.config index 490261d2..212c0c3c 100644 --- a/TLSharp.Tests/app.config +++ b/TLSharp.Tests/app.config @@ -1,4 +1,4 @@ - + @@ -12,4 +12,4 @@ - + \ No newline at end of file diff --git a/TLSharp.sln b/TLSharp.sln index 4f55f1bd..228018b9 100644 --- a/TLSharp.sln +++ b/TLSharp.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.24720.0 +# Visual Studio 15 +VisualStudioVersion = 15.0.27130.2024 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TLSharp.Core", "TLSharp.Core\TLSharp.Core.csproj", "{400D2544-1CC6-4D8A-A62C-2292D9947A16}" EndProject diff --git a/TeleSharp.Generator/App.config b/TeleSharp.Generator/App.config index 88fa4027..bae5d6d8 100644 --- a/TeleSharp.Generator/App.config +++ b/TeleSharp.Generator/App.config @@ -1,6 +1,6 @@ - + - + - \ No newline at end of file + diff --git a/TeleSharp.Generator/TeleSharp.Generator.csproj b/TeleSharp.Generator/TeleSharp.Generator.csproj index 94f3e9b3..dcdc6546 100644 --- a/TeleSharp.Generator/TeleSharp.Generator.csproj +++ b/TeleSharp.Generator/TeleSharp.Generator.csproj @@ -9,9 +9,10 @@ Properties TeleSharp.Generator TeleSharp.Generator - v4.5 + v4.6.1 512 true + AnyCPU @@ -33,9 +34,8 @@ 4 - - ..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll - True + + ..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll diff --git a/TeleSharp.Generator/packages.config b/TeleSharp.Generator/packages.config index 9d64bf36..e4ac9c6d 100644 --- a/TeleSharp.Generator/packages.config +++ b/TeleSharp.Generator/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/TeleSharp.TL/Properties/AssemblyInfo.cs b/TeleSharp.TL/Properties/AssemblyInfo.cs deleted file mode 100644 index 3ff3c974..00000000 --- a/TeleSharp.TL/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("TeleSharp.TL")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("TeleSharp.TL")] -[assembly: AssemblyCopyright("Copyright © 2016")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("d6144517-91d2-4880-86df-e9ff5d7f383a")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/TeleSharp.TL/TLContext.cs b/TeleSharp.TL/TLContext.cs index be439361..8d2f9de5 100644 --- a/TeleSharp.TL/TLContext.cs +++ b/TeleSharp.TL/TLContext.cs @@ -16,11 +16,11 @@ static TLContext() { Types = new Dictionary(); Types = (from t in Assembly.GetExecutingAssembly().GetTypes() - where t.IsClass && t.Namespace.StartsWith("TeleSharp.TL") - where t.IsSubclassOf(typeof(TLObject)) - where t.GetCustomAttribute(typeof(TLObjectAttribute)) != null - select t).ToDictionary(x => ((TLObjectAttribute)x.GetCustomAttribute(typeof(TLObjectAttribute))).Constructor, x => x); - Types.Add(481674261, typeof(TLVector<>)); + where t.IsClass && t.Namespace.StartsWith("TeleSharp.TL") + where t.IsSubclassOf(typeof(TLObject)) + where t.GetCustomAttribute(typeof(TLObjectAttribute)) != null + select t).ToDictionary(x => ((TLObjectAttribute)x.GetCustomAttribute(typeof(TLObjectAttribute))).Constructor, x => x); + Types[481674261] = typeof(TLVector<>); } public static Type getType(int Constructor) diff --git a/TeleSharp.TL/TeleSharp.TL.csproj b/TeleSharp.TL/TeleSharp.TL.csproj index 7c6b30c8..b1a1ce9f 100644 --- a/TeleSharp.TL/TeleSharp.TL.csproj +++ b/TeleSharp.TL/TeleSharp.TL.csproj @@ -1,938 +1,28 @@ - - - + + - Debug - AnyCPU - {D6144517-91D2-4880-86DF-E9FF5D7F383A} - Library - Properties - TeleSharp.TL - TeleSharp.TL - v4.5 - 512 + netstandard2.0;net461 + 1.0.1.0 + 1.0.1.0 + 1.0.1 + TeleSharp.TL + TeleSharp.TL + TeleSharp.TL + TeleSharp.TL - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 + + - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 + + + - - ..\packages\BigMath.0.5.0\lib\portable-net45+netcore45+wpa81+wp8+MonoAndroid1+MonoTouch1\BigMath.dll - True - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - \ No newline at end of file + +