Renamed cs file, added ffmpeg binary in repo.
This commit is contained in:
parent
604207c958
commit
b313baa4c1
BIN
2dxAutoClip/artifacts/ffmpeg.exe
Normal file
BIN
2dxAutoClip/artifacts/ffmpeg.exe
Normal file
Binary file not shown.
1
2dxAutoClip/artifacts/prop.txt
Normal file
1
2dxAutoClip/artifacts/prop.txt
Normal file
|
@ -0,0 +1 @@
|
|||
path: E:\autorecording
|
|
@ -24,7 +24,7 @@ class Program
|
|||
if (spiceProcesses.Length > 0)
|
||||
{
|
||||
Console.WriteLine("Found spice64, Attempting connection to TickerHookWS...");
|
||||
await ConnectWebSocket();
|
||||
await TryConnectWebSocket();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -32,6 +32,7 @@ class Program
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
private static string GetFolderPath()
|
||||
{
|
||||
const string filePath = "prop.txt";
|
||||
|
@ -67,7 +68,38 @@ class Program
|
|||
return defaultPath;
|
||||
}
|
||||
|
||||
private static async Task ConnectWebSocket()
|
||||
private static async Task TryConnectWebSocket()
|
||||
{
|
||||
const int maxRetries = 5;
|
||||
int attempt = 0;
|
||||
|
||||
while (attempt < maxRetries)
|
||||
{
|
||||
Console.WriteLine($"Attempt {attempt + 1} of {maxRetries} to connect...");
|
||||
|
||||
bool success = await ConnectWebSocket();
|
||||
|
||||
if (success)
|
||||
{
|
||||
break; // Exit the loop if connection was successful
|
||||
}
|
||||
|
||||
attempt++;
|
||||
|
||||
if (attempt < maxRetries)
|
||||
{
|
||||
Console.WriteLine($"Retrying in 10 seconds... {maxRetries - attempt} attempts remaining.");
|
||||
await Task.Delay(10000); // Wait for 10 seconds before retrying
|
||||
}
|
||||
}
|
||||
|
||||
if (attempt == maxRetries)
|
||||
{
|
||||
Console.WriteLine("Failed to connect after 5 attempts.");
|
||||
}
|
||||
}
|
||||
|
||||
private static async Task<bool> ConnectWebSocket()
|
||||
{
|
||||
var tickerUri = new Uri($"ws://{WebsocketAddress}:{WebsocketPort}");
|
||||
var reconnecting = false;
|
||||
|
@ -77,7 +109,6 @@ private static async Task ConnectWebSocket()
|
|||
var isRecording = false;
|
||||
var currentSongName = string.Empty;
|
||||
|
||||
// Flag to track if we need to check for "MUSIC SELECT!!"
|
||||
var shouldCheckForMusicSelect = false;
|
||||
|
||||
using var clientWebSocket = new ClientWebSocket();
|
||||
|
@ -89,7 +120,7 @@ private static async Task ConnectWebSocket()
|
|||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"Error connecting to TickerHook WebSocket: {ex.Message}");
|
||||
return;
|
||||
return false; // Indicate connection failure
|
||||
}
|
||||
|
||||
var buffer = new byte[1024];
|
||||
|
@ -145,13 +176,8 @@ private static async Task ConnectWebSocket()
|
|||
}
|
||||
}
|
||||
|
||||
if (reconnecting)
|
||||
{
|
||||
await Task.Delay(10000);
|
||||
await ConnectWebSocket();
|
||||
return !reconnecting;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static void StartRecording(string songName)
|
||||
{
|
|
@ -1,32 +1,25 @@
|
|||
{
|
||||
"format": 1,
|
||||
"restore": {
|
||||
"E:\\csharpcazzo\\2dxAutoClip\\2dxAutoClip\\2dxAutoClip.csproj": {}
|
||||
"D:\\2dxAutoClip\\2dxAutoClip\\2dxAutoClip.csproj": {}
|
||||
},
|
||||
"projects": {
|
||||
"E:\\csharpcazzo\\2dxAutoClip\\2dxAutoClip\\2dxAutoClip.csproj": {
|
||||
"D:\\2dxAutoClip\\2dxAutoClip\\2dxAutoClip.csproj": {
|
||||
"version": "1.0.0",
|
||||
"restore": {
|
||||
"projectUniqueName": "E:\\csharpcazzo\\2dxAutoClip\\2dxAutoClip\\2dxAutoClip.csproj",
|
||||
"projectUniqueName": "D:\\2dxAutoClip\\2dxAutoClip\\2dxAutoClip.csproj",
|
||||
"projectName": "2dxAutoClip",
|
||||
"projectPath": "E:\\csharpcazzo\\2dxAutoClip\\2dxAutoClip\\2dxAutoClip.csproj",
|
||||
"projectPath": "D:\\2dxAutoClip\\2dxAutoClip\\2dxAutoClip.csproj",
|
||||
"packagesPath": "C:\\Users\\Mercury\\.nuget\\packages\\",
|
||||
"outputPath": "E:\\csharpcazzo\\2dxAutoClip\\2dxAutoClip\\obj\\",
|
||||
"outputPath": "D:\\2dxAutoClip\\2dxAutoClip\\obj\\",
|
||||
"projectStyle": "PackageReference",
|
||||
"fallbackFolders": [
|
||||
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
|
||||
],
|
||||
"configFilePaths": [
|
||||
"C:\\Users\\Mercury\\AppData\\Roaming\\NuGet\\NuGet.Config",
|
||||
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
|
||||
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
|
||||
"C:\\Users\\Mercury\\AppData\\Roaming\\NuGet\\NuGet.Config"
|
||||
],
|
||||
"originalTargetFrameworks": [
|
||||
"net8.0"
|
||||
],
|
||||
"sources": {
|
||||
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
|
||||
"C:\\Program Files\\dotnet\\library-packs": {},
|
||||
"https://api.nuget.org/v3/index.json": {}
|
||||
},
|
||||
"frameworks": {
|
||||
|
@ -39,6 +32,11 @@
|
|||
"warnAsError": [
|
||||
"NU1605"
|
||||
]
|
||||
},
|
||||
"restoreAuditProperties": {
|
||||
"enableAudit": "true",
|
||||
"auditLevel": "low",
|
||||
"auditMode": "direct"
|
||||
}
|
||||
},
|
||||
"frameworks": {
|
||||
|
@ -78,7 +76,7 @@
|
|||
"privateAssets": "all"
|
||||
}
|
||||
},
|
||||
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.300/PortableRuntimeIdentifierGraph.json"
|
||||
"runtimeIdentifierGraphPath": "C:\\Users\\Mercury\\.dotnet\\sdk\\8.0.303/PortableRuntimeIdentifierGraph.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,12 +5,11 @@
|
|||
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
|
||||
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
|
||||
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
|
||||
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\Mercury\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages</NuGetPackageFolders>
|
||||
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\Mercury\.nuget\packages\</NuGetPackageFolders>
|
||||
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
|
||||
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.9.1</NuGetToolVersion>
|
||||
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.10.1</NuGetToolVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<SourceRoot Include="C:\Users\Mercury\.nuget\packages\" />
|
||||
<SourceRoot Include="C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages\" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,4 @@
|
|||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")]
|
22
2dxAutoClip/obj/Release/net8.0/2dxAutoClip.AssemblyInfo.cs
Normal file
22
2dxAutoClip/obj/Release/net8.0/2dxAutoClip.AssemblyInfo.cs
Normal file
|
@ -0,0 +1,22 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("2dxAutoClip")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+604207c95826ef500eb0db475ad52a6eb1409e4e")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("2dxAutoClip")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("2dxAutoClip")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
// Generated by the MSBuild WriteCodeFragment class.
|
||||
|
|
@ -0,0 +1 @@
|
|||
f60dc6835ae387846e8c0d781c1dc6acd6ee09c156933e3c91a54f6d7a977f7a
|
|
@ -0,0 +1,13 @@
|
|||
is_global = true
|
||||
build_property.TargetFramework = net8.0
|
||||
build_property.TargetPlatformMinVersion =
|
||||
build_property.UsingMicrosoftNETSdkWeb =
|
||||
build_property.ProjectTypeGuids =
|
||||
build_property.InvariantGlobalization =
|
||||
build_property.PlatformNeutralAssembly =
|
||||
build_property.EnforceExtendedAnalyzerRules =
|
||||
build_property._SupportedPlatformList = Linux,macOS,Windows
|
||||
build_property.RootNamespace = _2dxAutoClip
|
||||
build_property.ProjectDir = D:\2dxAutoClip\2dxAutoClip\
|
||||
build_property.EnableComHosting =
|
||||
build_property.EnableGeneratedComInterfaceComImportInterop =
|
|
@ -0,0 +1,8 @@
|
|||
// <auto-generated/>
|
||||
global using global::System;
|
||||
global using global::System.Collections.Generic;
|
||||
global using global::System.IO;
|
||||
global using global::System.Linq;
|
||||
global using global::System.Net.Http;
|
||||
global using global::System.Threading;
|
||||
global using global::System.Threading.Tasks;
|
BIN
2dxAutoClip/obj/Release/net8.0/2dxAutoClip.assets.cache
Normal file
BIN
2dxAutoClip/obj/Release/net8.0/2dxAutoClip.assets.cache
Normal file
Binary file not shown.
Binary file not shown.
|
@ -476,32 +476,24 @@
|
|||
]
|
||||
},
|
||||
"packageFolders": {
|
||||
"C:\\Users\\Mercury\\.nuget\\packages\\": {},
|
||||
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages": {}
|
||||
"C:\\Users\\Mercury\\.nuget\\packages\\": {}
|
||||
},
|
||||
"project": {
|
||||
"version": "1.0.0",
|
||||
"restore": {
|
||||
"projectUniqueName": "E:\\csharpcazzo\\2dxAutoClip\\2dxAutoClip\\2dxAutoClip.csproj",
|
||||
"projectUniqueName": "D:\\2dxAutoClip\\2dxAutoClip\\2dxAutoClip.csproj",
|
||||
"projectName": "2dxAutoClip",
|
||||
"projectPath": "E:\\csharpcazzo\\2dxAutoClip\\2dxAutoClip\\2dxAutoClip.csproj",
|
||||
"projectPath": "D:\\2dxAutoClip\\2dxAutoClip\\2dxAutoClip.csproj",
|
||||
"packagesPath": "C:\\Users\\Mercury\\.nuget\\packages\\",
|
||||
"outputPath": "E:\\csharpcazzo\\2dxAutoClip\\2dxAutoClip\\obj\\",
|
||||
"outputPath": "D:\\2dxAutoClip\\2dxAutoClip\\obj\\",
|
||||
"projectStyle": "PackageReference",
|
||||
"fallbackFolders": [
|
||||
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
|
||||
],
|
||||
"configFilePaths": [
|
||||
"C:\\Users\\Mercury\\AppData\\Roaming\\NuGet\\NuGet.Config",
|
||||
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
|
||||
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
|
||||
"C:\\Users\\Mercury\\AppData\\Roaming\\NuGet\\NuGet.Config"
|
||||
],
|
||||
"originalTargetFrameworks": [
|
||||
"net8.0"
|
||||
],
|
||||
"sources": {
|
||||
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
|
||||
"C:\\Program Files\\dotnet\\library-packs": {},
|
||||
"https://api.nuget.org/v3/index.json": {}
|
||||
},
|
||||
"frameworks": {
|
||||
|
@ -514,6 +506,11 @@
|
|||
"warnAsError": [
|
||||
"NU1605"
|
||||
]
|
||||
},
|
||||
"restoreAuditProperties": {
|
||||
"enableAudit": "true",
|
||||
"auditLevel": "low",
|
||||
"auditMode": "direct"
|
||||
}
|
||||
},
|
||||
"frameworks": {
|
||||
|
@ -553,7 +550,7 @@
|
|||
"privateAssets": "all"
|
||||
}
|
||||
},
|
||||
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.300/PortableRuntimeIdentifierGraph.json"
|
||||
"runtimeIdentifierGraphPath": "C:\\Users\\Mercury\\.dotnet\\sdk\\8.0.303/PortableRuntimeIdentifierGraph.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
"version": 2,
|
||||
"dgSpecHash": "UadaV9K6lUXiqIl2z8bjhbAR5j54RKlO6cUS03Ve0bAmjWv2eBUy7+V9Ozrfloe+w1UWeZZZwMHRYEfHq2vunA==",
|
||||
"dgSpecHash": "6Qjxx2HkXOE=",
|
||||
"success": true,
|
||||
"projectFilePath": "E:\\csharpcazzo\\2dxAutoClip\\2dxAutoClip\\2dxAutoClip.csproj",
|
||||
"projectFilePath": "D:\\2dxAutoClip\\2dxAutoClip\\2dxAutoClip.csproj",
|
||||
"expectedPackageFiles": [
|
||||
"C:\\Users\\Mercury\\.nuget\\packages\\microsoft.netcore.platforms\\3.1.0\\microsoft.netcore.platforms.3.1.0.nupkg.sha512",
|
||||
"C:\\Users\\Mercury\\.nuget\\packages\\microsoft.win32.registry\\4.7.0\\microsoft.win32.registry.4.7.0.nupkg.sha512",
|
||||
|
|
|
@ -1 +1 @@
|
|||
"restore":{"projectUniqueName":"E:\\csharpcazzo\\2dxAutoClip\\2dxAutoClip\\2dxAutoClip.csproj","projectName":"2dxAutoClip","projectPath":"E:\\csharpcazzo\\2dxAutoClip\\2dxAutoClip\\2dxAutoClip.csproj","outputPath":"E:\\csharpcazzo\\2dxAutoClip\\2dxAutoClip\\obj\\","projectStyle":"PackageReference","fallbackFolders":["C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"],"originalTargetFrameworks":["net8.0"],"sources":{"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\":{},"C:\\Program Files\\dotnet\\library-packs":{},"https://api.nuget.org/v3/index.json":{}},"frameworks":{"net8.0":{"targetAlias":"net8.0","projectReferences":{}}},"warningProperties":{"warnAsError":["NU1605"]}}"frameworks":{"net8.0":{"targetAlias":"net8.0","dependencies":{"NAudio":{"target":"Package","version":"[2.2.1, )"},"NAudio.Wasapi":{"target":"Package","version":"[2.2.1, )"},"NAudio.WinMM":{"target":"Package","version":"[2.2.1, )"},"WebSocketSharp":{"target":"Package","version":"[1.0.3-rc11, )"}},"imports":["net461","net462","net47","net471","net472","net48","net481"],"assetTargetFallback":true,"warn":true,"frameworkReferences":{"Microsoft.NETCore.App":{"privateAssets":"all"}},"runtimeIdentifierGraphPath":"C:\\Program Files\\dotnet\\sdk\\8.0.300/PortableRuntimeIdentifierGraph.json"}}
|
||||
"restore":{"projectUniqueName":"D:\\2dxAutoClip\\2dxAutoClip\\2dxAutoClip.csproj","projectName":"2dxAutoClip","projectPath":"D:\\2dxAutoClip\\2dxAutoClip\\2dxAutoClip.csproj","outputPath":"D:\\2dxAutoClip\\2dxAutoClip\\obj\\","projectStyle":"PackageReference","originalTargetFrameworks":["net8.0"],"sources":{"https://api.nuget.org/v3/index.json":{}},"frameworks":{"net8.0":{"targetAlias":"net8.0","projectReferences":{}}},"warningProperties":{"warnAsError":["NU1605"]},"restoreAuditProperties":{"enableAudit":"true","auditLevel":"low","auditMode":"direct"}}"frameworks":{"net8.0":{"targetAlias":"net8.0","dependencies":{"NAudio":{"target":"Package","version":"[2.2.1, )"},"NAudio.Wasapi":{"target":"Package","version":"[2.2.1, )"},"NAudio.WinMM":{"target":"Package","version":"[2.2.1, )"},"WebSocketSharp":{"target":"Package","version":"[1.0.3-rc11, )"}},"imports":["net461","net462","net47","net471","net472","net48","net481"],"assetTargetFallback":true,"warn":true,"frameworkReferences":{"Microsoft.NETCore.App":{"privateAssets":"all"}},"runtimeIdentifierGraphPath":"C:\\Users\\Mercury\\.dotnet\\sdk\\8.0.303/PortableRuntimeIdentifierGraph.json"}}
|
|
@ -1 +1 @@
|
|||
17255280968129270
|
||||
17255540687156279
|
|
@ -1 +1 @@
|
|||
17255280968129270
|
||||
17255540734858045
|
Loading…
Reference in a new issue