Tried fixing login bugs
This commit is contained in:
parent
df0980c86e
commit
ecec55ec07
|
@ -128,7 +128,12 @@ namespace DML.Application.Classes
|
||||||
|
|
||||||
Logger.Debug("Creating discord client...");
|
Logger.Debug("Creating discord client...");
|
||||||
|
|
||||||
Client = new DiscordSocketClient();
|
var config = new DiscordSocketConfig()
|
||||||
|
{
|
||||||
|
DefaultRetryMode = RetryMode.AlwaysRetry,
|
||||||
|
};
|
||||||
|
|
||||||
|
Client = new DiscordSocketClient(config);
|
||||||
Client.Log += (arg) =>
|
Client.Log += (arg) =>
|
||||||
{
|
{
|
||||||
var logMessage = $"DiscordClient: {arg.Message}";
|
var logMessage = $"DiscordClient: {arg.Message}";
|
||||||
|
@ -160,7 +165,7 @@ namespace DML.Application.Classes
|
||||||
|
|
||||||
Client.Connected += Client_Connected;
|
Client.Connected += Client_Connected;
|
||||||
|
|
||||||
while (Client.LoginState != LoginState.LoggedIn && !abort)
|
while ((Client.LoginState != LoginState.LoggedIn || Client.ConnectionState!=ConnectionState.Connected) && !abort)
|
||||||
{
|
{
|
||||||
Logger.Debug(Client.ConnectionState.ToString());
|
Logger.Debug(Client.ConnectionState.ToString());
|
||||||
Logger.Debug(Client.LoginState.ToString());
|
Logger.Debug(Client.LoginState.ToString());
|
||||||
|
@ -176,6 +181,7 @@ namespace DML.Application.Classes
|
||||||
{
|
{
|
||||||
Logger.Debug("Trying to login with last known token...");
|
Logger.Debug("Trying to login with last known token...");
|
||||||
await Client.LoginAsync(TokenType.User, Settings.LoginToken);
|
await Client.LoginAsync(TokenType.User, Settings.LoginToken);
|
||||||
|
await Client.StartAsync();
|
||||||
await Task.Delay(1000);
|
await Task.Delay(1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -208,10 +208,6 @@
|
||||||
<Project>{02c1f8ef-32f2-4e77-a36d-79129402af37}</Project>
|
<Project>{02c1f8ef-32f2-4e77-a36d-79129402af37}</Project>
|
||||||
<Name>SweetLib</Name>
|
<Name>SweetLib</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\DML.AppCore\DML.AppCore.csproj">
|
|
||||||
<Project>{4db264a7-2352-4057-b3de-61fcfec01ae5}</Project>
|
|
||||||
<Name>DML.AppCore</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="Resources\Serraniel-Logo4-NO-BG.png" />
|
<None Include="Resources\Serraniel-Logo4-NO-BG.png" />
|
||||||
|
|
|
@ -9,8 +9,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DML.Application", "Discord
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SweetLib", "..\SweetLib\SweetLib\SweetLib.csproj", "{02C1F8EF-32F2-4E77-A36D-79129402AF37}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SweetLib", "..\SweetLib\SweetLib\SweetLib.csproj", "{02C1F8EF-32F2-4E77-A36D-79129402AF37}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DML.AppCore", "DML.AppCore\DML.AppCore.csproj", "{4DB264A7-2352-4057-B3DE-61FCFEC01AE5}"
|
|
||||||
EndProject
|
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
@ -29,10 +27,6 @@ Global
|
||||||
{02C1F8EF-32F2-4E77-A36D-79129402AF37}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{02C1F8EF-32F2-4E77-A36D-79129402AF37}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{02C1F8EF-32F2-4E77-A36D-79129402AF37}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{02C1F8EF-32F2-4E77-A36D-79129402AF37}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{02C1F8EF-32F2-4E77-A36D-79129402AF37}.Release|Any CPU.Build.0 = Release|Any CPU
|
{02C1F8EF-32F2-4E77-A36D-79129402AF37}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{4DB264A7-2352-4057-B3DE-61FCFEC01AE5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{4DB264A7-2352-4057-B3DE-61FCFEC01AE5}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{4DB264A7-2352-4057-B3DE-61FCFEC01AE5}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{4DB264A7-2352-4057-B3DE-61FCFEC01AE5}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|
|
@ -214,10 +214,6 @@
|
||||||
<Project>{c130de6a-3237-42b5-be9f-783d1cd104c6}</Project>
|
<Project>{c130de6a-3237-42b5-be9f-783d1cd104c6}</Project>
|
||||||
<Name>DML.Application</Name>
|
<Name>DML.Application</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\DML.AppCore\DML.AppCore.csproj">
|
|
||||||
<Project>{4db264a7-2352-4057-b3de-61fcfec01ae5}</Project>
|
|
||||||
<Name>DML.AppCore</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
|
|
Loading…
Reference in a new issue