diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..dfe0770 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Auto detect text files and perform LF normalization +* text=auto diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3a8525b --- /dev/null +++ b/.gitignore @@ -0,0 +1,356 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Nproj +*.nrproj \ No newline at end of file diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..b0e295c --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Kyle + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..0b6ede0 --- /dev/null +++ b/README.md @@ -0,0 +1,22 @@ +# Star Rail Rpc + + +Enables Discord [Rich Presence](https://discord.com/rich-presence) For Honkai: Star Rail. +将星穹铁道动态同步到Discord. +支持国服/国际服 + + +### Info +* This application will auto launch on system start. If you don't want to do this, disable it in taskmgr. +* 这个软件会在你开机的时候自启动, 如果你不需要可以在任务管理器中禁用. + + + +### Feature +* Sync Rich Presence. +* 同步动态到Discord. +* 清除动态当你退出游戏时. + + +### Preview +![Preview.](https://img.kxnrl.com/ugc/482C57A34141676F5AB4161ECF262FFC9817A234!source) \ No newline at end of file diff --git a/StarRailRpc.sln b/StarRailRpc.sln new file mode 100644 index 0000000..292cbf7 --- /dev/null +++ b/StarRailRpc.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.33530.505 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StarRailRpc", "src\StarRailRpc.csproj", "{F51CFE8E-A412-47B4-92BB-84759ED5F6D7}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {F51CFE8E-A412-47B4-92BB-84759ED5F6D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F51CFE8E-A412-47B4-92BB-84759ED5F6D7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F51CFE8E-A412-47B4-92BB-84759ED5F6D7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F51CFE8E-A412-47B4-92BB-84759ED5F6D7}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {07F96A57-340D-443C-8C91-009941439E6D} + EndGlobalSection +EndGlobal diff --git a/src/App.config b/src/App.config new file mode 100644 index 0000000..37483cf --- /dev/null +++ b/src/App.config @@ -0,0 +1,26 @@ + + + + +
+ + + + + + + + + True + + + + + + + + + + + + diff --git a/src/AutoStart.cs b/src/AutoStart.cs new file mode 100644 index 0000000..60a3f81 --- /dev/null +++ b/src/AutoStart.cs @@ -0,0 +1,81 @@ +using Microsoft.Win32; +using System; +using System.Reflection; + +namespace StarRailDiscordRpc; + +internal static class AutoStart +{ + public static void Set() + { + try + { + // Open Base Key. + using var baseKey = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Registry64).OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run", true); + + if (baseKey == null) + { + // wtf? + Console.WriteLine(@"Cannot find HKCU\Software\Microsoft\Windows\CurrentVersion\Run"); + return; + } + + baseKey.SetValue("StarRail-DiscordRpc", Assembly.GetEntryAssembly().Location); + Console.WriteLine("AutoStartup has been set."); + } + catch (Exception e) + { + Console.WriteLine($"Failed to set autostartup: {e.Message}"); + } + } + + public static void Remove() + { + try + { + // Open Base Key. + using var baseKey = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Registry64).OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run", true); + + if (baseKey == null) + { + // wtf? + Console.WriteLine(@"Cannot find HKCU\Software\Microsoft\Windows\CurrentVersion\Run"); + return; + } + + baseKey.DeleteValue("StarRail-DiscordRpc", false); + Console.WriteLine("AutoStartup has been deleted."); + } + catch (Exception e) + { + Console.WriteLine($"Failed to set autostartup: {e.Message}"); + } + } + + public static bool Check() + { + try + { + // Open Base Key. + using var baseKey = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Registry64).OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run", true); + + if (baseKey == null) + { + // wtf? + Console.WriteLine(@"Cannot find HKCU\Software\Microsoft\Windows\CurrentVersion\Run"); + return false; + } + + var ace = baseKey.GetValue("StarRail-DiscordRpc"); + var exe = Assembly.GetEntryAssembly().Location; + return exe.Equals(ace); + } + catch (Exception e) + { + Console.WriteLine($"Failed to set autostartup: {e.Message}"); + } + + return false; + } +} + diff --git a/src/Program.cs b/src/Program.cs new file mode 100644 index 0000000..8b1c7d5 --- /dev/null +++ b/src/Program.cs @@ -0,0 +1,197 @@ +using DiscordRPC; +using System; +using System.Diagnostics; +using System.Linq; +using System.Runtime.InteropServices; +using System.Threading; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace StarRailDiscordRpc; + +internal static class Program +{ + private const string AppId_Zh = "1100788944901247026"; + private const string AppId_En = "1100789242029948999"; + + [STAThread] + static void Main() + { + using var self = new Mutex(true, "StarRail DiscordRPC", out var allow); + if (!allow) + { + MessageBox.Show("StarRail DiscordRPC is already running.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + Environment.Exit(-1); + } + + if (Properties.Settings.Default.IsFirstTime) + { + AutoStart.Set(); + Properties.Settings.Default.IsFirstTime = false; + Properties.Settings.Default.Save(); + } + + Task.Run(async () => + { + using var clientZh = new DiscordRpcClient(AppId_Zh); + using var clientEn = new DiscordRpcClient(AppId_En); + clientZh.Initialize(); + clientEn.Initialize(); + + var playing = false; + + while (true) + { + await Task.Delay(1000); + + Debug.Print($"InLoop"); + + var hndlZh = FindWindow("UnityWndClass", "崩坏:星穹铁道"); + var hndlEn = FindWindow("UnityWndClass", "Honkai: Star Rail"); + if (hndlZh == IntPtr.Zero && + hndlEn == IntPtr.Zero) + { + Debug.Print($"Not found game process."); + playing = false; + if (clientEn.CurrentPresence != null) + { + clientEn.ClearPresence(); + } + if (clientZh.CurrentPresence != null) + { + clientZh.ClearPresence(); + } + continue; + } + + try + { + var procEn = Process.GetProcesses().FirstOrDefault(x => x.MainWindowHandle == hndlEn); + var procZh = Process.GetProcesses().FirstOrDefault(x => x.MainWindowHandle == hndlZh); + + Debug.Print($"Check process with {hndlZh} | {procZh?.ProcessName} || {hndlEn} | {procEn?.ProcessName}"); + + if (procZh != null) + { + if (!playing) + { + playing = true; + + clientZh.SetPresence(new RichPresence + { + Assets = new Assets + { + LargeImageKey = "logo", + LargeImageText = "崩坏:星穹铁道", + }, + Timestamps = Timestamps.Now, + }); + + Debug.Print($"Set RichPresence to {procZh?.ProcessName}"); + } + else + { + Debug.Print($"Keep RichPresence to {procZh?.ProcessName}"); + } + } + else if (procEn != null) + { + if (!playing) + { + playing = true; + + clientEn.SetPresence(new RichPresence + { + Assets = new Assets + { + LargeImageKey = "logo", + LargeImageText = "Honkai: Star Rail", + }, + Timestamps = Timestamps.Now, + }); + + Debug.Print($"Set RichPresence to {procEn?.ProcessName}"); + } + else + { + Debug.Print($"Keep RichPresence to {procEn?.ProcessName}"); + } + } + else + { + playing = false; + if (clientEn.CurrentPresence != null) + { + clientEn.ClearPresence(); + } + if (clientZh.CurrentPresence != null) + { + clientZh.ClearPresence(); + } + Debug.Print($"Clear RichPresence"); + } + } + catch (Exception e) + { + playing = false; + if (clientEn.CurrentPresence != null) + { + clientEn.ClearPresence(); + } + if (clientZh.CurrentPresence != null) + { + clientZh.ClearPresence(); + } + Debug.Print($"{e.Message}{Environment.NewLine}{e.StackTrace}"); + } + + GC.Collect(); + GC.WaitForFullGCComplete(); + } + }); + + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + + var notifyMenu = new ContextMenu(); + var exitButton = new MenuItem("Exit"); + var autoButton = new MenuItem("AutoStart" + " " + (AutoStart.Check() ? "√" : "✘")); + notifyMenu.MenuItems.Add(0, autoButton); + notifyMenu.MenuItems.Add(1, exitButton); + + var notifyIcon = new NotifyIcon() + { + BalloonTipIcon = ToolTipIcon.Info, + ContextMenu = notifyMenu, + Text = "StarRail DiscordRPC", + Icon = Properties.Resources.tray, + Visible = true, + }; + + exitButton.Click += (sender, args) => + { + notifyIcon.Visible = false; + Thread.Sleep(100); + Environment.Exit(0); + }; + autoButton.Click += (sender, args) => + { + if (AutoStart.Check()) + { + AutoStart.Remove(); + } + else + { + AutoStart.Set(); + } + + autoButton.Text = "AutoStart" + " " + (AutoStart.Check() ? "√" : "✘"); + }; + + + Application.Run(); + } + + [DllImport("user32.dll", EntryPoint = "FindWindow")] + private static extern IntPtr FindWindow(string lpClassName, string lpWindowName); +} diff --git a/src/Properties/AssemblyInfo.cs b/src/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..5b4fc56 --- /dev/null +++ b/src/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的一般信息由以下 +// 控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("StarRail Discord Rpc")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("StarRail discord Rpc")] +[assembly: AssemblyCopyright("©2023 Kyle")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 会使此程序集中的类型 +//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 +//请将此类型的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("dc96d5d9-7142-41a0-8ad7-105307ca62db")] + +// 程序集的版本信息由下列四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 +//通过使用 "*",如下所示: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/Properties/Resources.Designer.cs b/src/Properties/Resources.Designer.cs new file mode 100644 index 0000000..522bfb8 --- /dev/null +++ b/src/Properties/Resources.Designer.cs @@ -0,0 +1,83 @@ +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本:4.0.30319.42000 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 +// +//------------------------------------------------------------------------------ + +namespace StarRailDiscordRpc.Properties { + using System; + + + /// + /// 一个强类型的资源类,用于查找本地化的字符串等。 + /// + // 此类是由 StronglyTypedResourceBuilder + // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 + // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen + // (以 /str 作为命令选项),或重新生成 VS 项目。 + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// 返回此类使用的缓存的 ResourceManager 实例。 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("StarRailDiscordRpc.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// 重写当前线程的 CurrentUICulture 属性,对 + /// 使用此强类型资源类的所有资源查找执行重写。 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// 查找类似于 (图标) 的 System.Drawing.Icon 类型的本地化资源。 + /// + internal static System.Drawing.Icon icon { + get { + object obj = ResourceManager.GetObject("icon", resourceCulture); + return ((System.Drawing.Icon)(obj)); + } + } + + /// + /// 查找类似于 (图标) 的 System.Drawing.Icon 类型的本地化资源。 + /// + internal static System.Drawing.Icon tray { + get { + object obj = ResourceManager.GetObject("tray", resourceCulture); + return ((System.Drawing.Icon)(obj)); + } + } + } +} diff --git a/src/Properties/Resources.resx b/src/Properties/Resources.resx new file mode 100644 index 0000000..eb44b8e --- /dev/null +++ b/src/Properties/Resources.resx @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\Resources\icon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\c978cbd1268ec3ec1a8e170cdfb4e214_405257739008908187.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/src/Properties/Settings.Designer.cs b/src/Properties/Settings.Designer.cs new file mode 100644 index 0000000..caf8abc --- /dev/null +++ b/src/Properties/Settings.Designer.cs @@ -0,0 +1,38 @@ +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本:4.0.30319.42000 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 +// +//------------------------------------------------------------------------------ + +namespace StarRailDiscordRpc.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.5.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool IsFirstTime { + get { + return ((bool)(this["IsFirstTime"])); + } + set { + this["IsFirstTime"] = value; + } + } + } +} diff --git a/src/Properties/Settings.settings b/src/Properties/Settings.settings new file mode 100644 index 0000000..5fef8b7 --- /dev/null +++ b/src/Properties/Settings.settings @@ -0,0 +1,9 @@ + + + + + + True + + + \ No newline at end of file diff --git a/src/Resources/c978cbd1268ec3ec1a8e170cdfb4e214_405257739008908187.ico b/src/Resources/c978cbd1268ec3ec1a8e170cdfb4e214_405257739008908187.ico new file mode 100644 index 0000000..d9bbb98 Binary files /dev/null and b/src/Resources/c978cbd1268ec3ec1a8e170cdfb4e214_405257739008908187.ico differ diff --git a/src/Resources/icon.ico b/src/Resources/icon.ico new file mode 100644 index 0000000..fc9626a Binary files /dev/null and b/src/Resources/icon.ico differ diff --git a/src/StarRailRpc.csproj b/src/StarRailRpc.csproj new file mode 100644 index 0000000..4a5e689 --- /dev/null +++ b/src/StarRailRpc.csproj @@ -0,0 +1,130 @@ + + + + + Debug + AnyCPU + {DC96D5D9-7142-41A0-8AD7-105307CA62DB} + WinExe + StarRailDiscordRpc + StarRailDiscordRpc + v4.8 + 512 + true + true + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + 10 + + + x64 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x64 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + Resources\icon.ico + + + StarRailDiscordRpc.Program + + + LocalIntranet + + + false + + + + + ..\packages\DiscordRichPresence.1.1.3.18\lib\net45\DiscordRPC.dll + + + ..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll + + + + + + + + + + + + + + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + True + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + + + + + + + False + Microsoft .NET Framework 4.8 %28x86 和 x64%29 + true + + + False + .NET Framework 3.5 SP1 + false + + + + \ No newline at end of file diff --git a/src/genshin.ico b/src/genshin.ico new file mode 100644 index 0000000..270081a Binary files /dev/null and b/src/genshin.ico differ diff --git a/src/packages.config b/src/packages.config new file mode 100644 index 0000000..4843af4 --- /dev/null +++ b/src/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file