Skip to content

Commit

Permalink
Actually fix login issues
Browse files Browse the repository at this point in the history
  • Loading branch information
WamWooWam committed Nov 8, 2020
1 parent 7cbb19c commit d3ebfcd
Show file tree
Hide file tree
Showing 7 changed files with 112 additions and 104 deletions.
17 changes: 12 additions & 5 deletions Unicord.Universal/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ sealed partial class App : Application

public App()
{
InitializeComponent();
InitializeComponent();
AppDomain.CurrentDomain.FirstChanceException += (o, e) => Logger.LogError(e.Exception);

var provider = VersionHelper.RegisterVersionProvider<UnicordVersionProvider>();
var theme = LocalSettings.Read(REQUESTED_COLOUR_SCHEME, ElementTheme.Default);
Expand All @@ -81,7 +82,7 @@ public App()

if (RoamingSettings.Read(ENABLE_ANALYTICS, true) && APPCENTER_IDENTIFIER != null)
{
AppCenter.Start(APPCENTER_IDENTIFIER, typeof(Push), typeof(Analytics), typeof(Crashes));
AppCenter.Start(APPCENTER_IDENTIFIER, typeof(Push), typeof(Analytics), typeof(Crashes));
}
}

Expand Down Expand Up @@ -215,8 +216,6 @@ protected override void OnLaunched(LaunchActivatedEventArgs e)

private void OnLaunched(bool preLaunch, string arguments, ApplicationExecutionState previousState = ApplicationExecutionState.NotRunning)
{
Process.Start("cmd.exe");

var rawArgs = Strings.SplitCommandLine(arguments);
var args = new Dictionary<string, string>();
foreach (var str in rawArgs)
Expand Down Expand Up @@ -426,6 +425,9 @@ Task SocketErrored(SocketErrorEventArgs e)
e.Client.Ready -= ReadyHandler;
e.Client.SocketErrored -= SocketErrored;
e.Client.ClientErrored -= ClientErrored;

Logger.LogError(e.Exception);

_readySource.SetException(e.Exception);
return Task.CompletedTask;
}
Expand All @@ -435,6 +437,9 @@ Task ClientErrored(ClientErrorEventArgs e)
e.Client.Ready -= ReadyHandler;
e.Client.SocketErrored -= SocketErrored;
e.Client.ClientErrored -= ClientErrored;

Logger.LogError(e.Exception);

_readySource.SetException(e.Exception);
return Task.CompletedTask;
}
Expand All @@ -444,7 +449,9 @@ Task ClientErrored(ClientErrorEventArgs e)
Token = token,
TokenType = TokenType.User,
LogLevel = DSharpPlus.LogLevel.Debug,
GatewayCompressionLevel = GatewayCompressionLevel.None
//#if DEBUG
// GatewayCompressionLevel = GatewayCompressionLevel.None
//#endif
});

Discord.DebugLogger.LogMessageReceived += (o, ee) => Logger.Log(ee.Message, ee.Application);
Expand Down
4 changes: 2 additions & 2 deletions Unicord.Universal/Misc/Logger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using Windows.Storage;

namespace Unicord.Universal
{
Expand All @@ -13,9 +15,7 @@ internal static class Logger
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void Log(object message, [CallerMemberName] string source = "General")
{
#if !STORE
Debug.WriteLine(message, source);
#endif
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
Expand Down
5 changes: 3 additions & 2 deletions Unicord.Universal/Package.Debug.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@
<Identity Name="24101WamWooWamRD.Unicord.Canary" Publisher="CN=WamWooWam" Version="1.2.7.0" />
<mp:PhoneIdentity PhoneProductId="5783aabf-3049-421f-ae1d-e88bd89018f1" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
<Properties>
<DisplayName>Unicord Canary</DisplayName>
<DisplayName>ms-resource:AppDisplayName</DisplayName>
<PublisherDisplayName>Wan Kerr Co. Ltd.</PublisherDisplayName>
<Logo>Assets\Store\StoreLogo.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.15063.0" MaxVersionTested="10.0.17763.0" />
</Dependencies>
<Resources>
<Resource Language="x-generate" />
<Resource Language="EN-GB" />
<Resource Language="FR" />
</Resources>
<Applications>
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="Unicord.Universal.App">
Expand Down
186 changes: 94 additions & 92 deletions Unicord.Universal/Package.appxmanifest
Original file line number Diff line number Diff line change
@@ -1,90 +1,92 @@
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3" xmlns:uap4="http://schemas.microsoft.com/appx/manifest/uap/windows10/4" xmlns:uap5="http://schemas.microsoft.com/appx/manifest/uap/windows10/5" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" IgnorableNamespaces="uap mp">
<Identity Name="24101WamWooWamRD.Unicord" Publisher="CN=0F22111D-EDF0-42F0-B58D-26C4C5C5054B" Version="1.6.21.0" />
<mp:PhoneIdentity PhoneProductId="5783aabf-3049-421f-ae1d-e88bd89018f2" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
<Properties>
<DisplayName>ms-resource:AppDisplayName</DisplayName>
<PublisherDisplayName>Wan Kerr Co. Ltd.</PublisherDisplayName>
<Logo>Assets\Store\StoreLogo.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.15063.0" MaxVersionTested="10.0.17763.0" />
</Dependencies>
<Resources>
<Resource Language="EN-GB" />
<Resource Language="FR" />
</Resources>
<Applications>
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="Unicord.Universal.App">
<uap:VisualElements DisplayName="ms-resource:AppDisplayName" Square150x150Logo="Assets\Store\Square150x150Logo.png" Square44x44Logo="Assets\Store\Square44x44Logo.png" Description="ms-resource:AppDisplayDescription" BackgroundColor="transparent">
<uap:LockScreen Notification="badge" BadgeLogo="Assets\Store\BadgeLogo.png" />
<uap:DefaultTile Wide310x150Logo="Assets\Store\Wide310x150Logo.png" Square310x310Logo="Assets\Store\LargeTile.png" Square71x71Logo="Assets\Store\SmallTile.png" ShortName="Unicord">
<uap:ShowNameOnTiles>
<uap:ShowOn Tile="square150x150Logo" />
<uap:ShowOn Tile="wide310x150Logo" />
<uap:ShowOn Tile="square310x310Logo" />
</uap:ShowNameOnTiles>
</uap:DefaultTile>
<uap:SplashScreen Image="Assets\Store\SplashScreen.png" BackgroundColor="#7289DA" />
<uap:InitialRotationPreference>
<uap:Rotation Preference="portrait" />
</uap:InitialRotationPreference>
</uap:VisualElements>
<Extensions>
<!--<uap5:Extension Category="windows.startupTask" StartPage="EntryPage">
<Identity Name="24101WamWooWamRD.Unicord" Publisher="CN=0F22111D-EDF0-42F0-B58D-26C4C5C5054B" Version="1.6.24.0" />
<mp:PhoneIdentity PhoneProductId="5783aabf-3049-421f-ae1d-e88bd89018f2" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
<Properties>
<DisplayName>ms-resource:AppDisplayName</DisplayName>
<PublisherDisplayName>Wan Kerr Co. Ltd.</PublisherDisplayName>
<Logo>Assets\Store\StoreLogo.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.15063.0" MaxVersionTested="10.0.17763.0" />
</Dependencies>
<Resources>
<Resource Language="EN-GB" />
<Resource Language="FR" />
</Resources>
<Applications>
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="Unicord.Universal.App">
<uap:VisualElements DisplayName="ms-resource:AppDisplayName" Square150x150Logo="Assets\Store\Square150x150Logo.png" Square44x44Logo="Assets\Store\Square44x44Logo.png" Description="ms-resource:AppDisplayDescription" BackgroundColor="transparent">
<uap:LockScreen Notification="badge" BadgeLogo="Assets\Store\BadgeLogo.png" />
<uap:DefaultTile Wide310x150Logo="Assets\Store\Wide310x150Logo.png" Square310x310Logo="Assets\Store\LargeTile.png" Square71x71Logo="Assets\Store\SmallTile.png" ShortName="Unicord">
<uap:ShowNameOnTiles>
<uap:ShowOn Tile="square150x150Logo" />
<uap:ShowOn Tile="wide310x150Logo" />
<uap:ShowOn Tile="square310x310Logo" />
</uap:ShowNameOnTiles>
</uap:DefaultTile>
<uap:SplashScreen Image="Assets\Store\SplashScreen.png" BackgroundColor="#7289DA" />
<uap:InitialRotationPreference>
<uap:Rotation Preference="portrait" />
</uap:InitialRotationPreference>
</uap:VisualElements>
<Extensions>
<!--<uap5:Extension Category="windows.startupTask" StartPage="EntryPage">
<uap5:StartupTask TaskId="UnicordStartup" DisplayName="Unicord" />
</uap5:Extension>-->
<uap:Extension Category="windows.voipCall">
</uap:Extension>
<uap4:Extension Category="windows.contactPanel">
<uap4:ContactPanel />
</uap4:Extension>
<uap:Extension Category="windows.shareTarget">
<uap:ShareTarget Description="Share to Discord">
<uap:SupportedFileTypes>
<uap:SupportsAnyFileType />
</uap:SupportedFileTypes>
<uap:DataFormat>StorageItem</uap:DataFormat>
<uap:DataFormat>Bitmap</uap:DataFormat>
<uap:DataFormat>Text</uap:DataFormat>
<uap:DataFormat>WebLink</uap:DataFormat>
</uap:ShareTarget>
</uap:Extension>
<uap:Extension Category="windows.protocol">
<uap:Protocol Name="ms-contact-profile">
<uap:Logo>Assets\Store\Square44x44Logo.png</uap:Logo>
<uap:DisplayName>Unicord</uap:DisplayName>
</uap:Protocol>
</uap:Extension>
<uap:Extension Category="windows.protocol">
<uap:Protocol Name="ms-ipmessaging">
<uap:Logo>Assets\Store\Square44x44Logo.png</uap:Logo>
<uap:DisplayName>Unicord</uap:DisplayName>
</uap:Protocol>
</uap:Extension>
<uap:Extension Category="windows.appService" EntryPoint="Unicord.Universal.Voice.Background.ServiceBackgroundTask">
<uap:AppService Name="com.wankerr.Unicord.Voice" ServerName="Unicord.Universal.Voice.Background.ServiceBackgroundTask" />
</uap:Extension>
<Extension Category="windows.backgroundTasks" EntryPoint="Unicord.Universal.Voice.Background.VoiceBackgroundTask">
<BackgroundTasks ServerName="Unicord.Universal.Voice.Background.ServiceBackgroundTask">
<Task Type="systemEvent" />
</BackgroundTasks>
</Extension>
<uap:Extension Category="windows.fileTypeAssociation">
<uap:FileTypeAssociation Name="uni-theme">
<uap:DisplayName>Unicord Theme</uap:DisplayName>
<uap:SupportedFileTypes>
<uap:FileType ContentType="application/x-unicord-theme">.uni-theme</uap:FileType>
</uap:SupportedFileTypes>
</uap:FileTypeAssociation>
</uap:Extension>
</Extensions>
</Application>
</Applications>
<!--<Extensions>
--><!-- Enlighten COM on where to find Metadata Based Marshaling (MBM) data for the Game Bar private types
<uap:Extension Category="windows.voipCall">
</uap:Extension>
<uap4:Extension Category="windows.contactPanel">
<uap4:ContactPanel />
</uap4:Extension>
<uap:Extension Category="windows.shareTarget">
<uap:ShareTarget Description="Share to Discord">
<uap:SupportedFileTypes>
<uap:SupportsAnyFileType />
</uap:SupportedFileTypes>
<uap:DataFormat>StorageItem</uap:DataFormat>
<uap:DataFormat>Bitmap</uap:DataFormat>
<uap:DataFormat>Text</uap:DataFormat>
<uap:DataFormat>WebLink</uap:DataFormat>
</uap:ShareTarget>
</uap:Extension>
<uap:Extension Category="windows.protocol">
<uap:Protocol Name="ms-contact-profile">
<uap:Logo>Assets\Store\Square44x44Logo.png</uap:Logo>
<uap:DisplayName>Unicord</uap:DisplayName>
</uap:Protocol>
</uap:Extension>
<uap:Extension Category="windows.protocol">
<uap:Protocol Name="ms-ipmessaging">
<uap:Logo>Assets\Store\Square44x44Logo.png</uap:Logo>
<uap:DisplayName>Unicord</uap:DisplayName>
</uap:Protocol>
</uap:Extension>
<uap:Extension Category="windows.appService" EntryPoint="Unicord.Universal.Voice.Background.ServiceBackgroundTask">
<uap:AppService Name="com.wankerr.Unicord.Voice" ServerName="Unicord.Universal.Voice.Background.ServiceBackgroundTask" />
</uap:Extension>
<Extension Category="windows.backgroundTasks" EntryPoint="Unicord.Universal.Voice.Background.VoiceBackgroundTask">
<BackgroundTasks ServerName="Unicord.Universal.Voice.Background.ServiceBackgroundTask">
<Task Type="systemEvent" />
</BackgroundTasks>
</Extension>
<uap:Extension Category="windows.fileTypeAssociation">
<uap:FileTypeAssociation Name="uni-theme">
<uap:DisplayName>Unicord Theme</uap:DisplayName>
<uap:SupportedFileTypes>
<uap:FileType ContentType="application/x-unicord-theme">.uni-theme</uap:FileType>
</uap:SupportedFileTypes>
</uap:FileTypeAssociation>
</uap:Extension>
</Extensions>
</Application>
</Applications>
<!--<Extensions>
-->
<!-- Enlighten COM on where to find Metadata Based Marshaling (MBM) data for the Game Bar private types
<Path> is a required element (by VS) and has to point to a binary in the package, but it's not used when the class id is
00000355-0000-0000-C000-000000000046 (MBM). Due to that we just put the Microsoft.Gaming.XboxGameBar.winmd here. --><!--
00000355-0000-0000-C000-000000000046 (MBM). Due to that we just put the Microsoft.Gaming.XboxGameBar.winmd here. -->
<!--
<Extension Category="windows.activatableClass.proxyStub">
<ProxyStub ClassId="00000355-0000-0000-C000-000000000046">
<Path>Microsoft.Gaming.XboxGameBar.winmd</Path>
Expand All @@ -101,14 +103,14 @@
</ProxyStub>
</Extension>
</Extensions>-->
<Capabilities>
<Capability Name="internetClient" />
<uap:Capability Name="videosLibrary" />
<uap:Capability Name="picturesLibrary" />
<uap:Capability Name="contacts" />
<uap:Capability Name="voipCall" />
<uap:Capability Name="phoneCall" />
<DeviceCapability Name="microphone" />
<DeviceCapability Name="webcam" />
</Capabilities>
<Capabilities>
<Capability Name="internetClient" />
<uap:Capability Name="videosLibrary" />
<uap:Capability Name="picturesLibrary" />
<uap:Capability Name="contacts" />
<uap:Capability Name="voipCall" />
<uap:Capability Name="phoneCall" />
<DeviceCapability Name="microphone" />
<DeviceCapability Name="webcam" />
</Capabilities>
</Package>
1 change: 0 additions & 1 deletion Unicord.Universal/Pages/DiscordPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
using Unicord.Universal.Voice;
using Windows.ApplicationModel.Resources;
using Windows.Foundation.Metadata;
using Windows.System.RemoteSystems;
using Windows.UI.Core;
using Windows.UI.Notifications;
using Windows.UI.Xaml;
Expand Down
2 changes: 1 addition & 1 deletion Unicord.Universal/Unicord.Universal.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP;CODE_ANALYSIS;CODE_ANALYSIS</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<DebugType>full</DebugType>
<PlatformTarget>ARM</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>none</ErrorReport>
Expand Down
1 change: 0 additions & 1 deletion Unicord.Universal/rd.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="utf-8" ?>
<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">

</Directives>

0 comments on commit d3ebfcd

Please sign in to comment.