mirror of
https://github.com/whoswhip/RhythiaReplayExporter.git
synced 2026-12-04 07:08:42 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4f4701ac1e
|
+19
-5
@@ -1,12 +1,18 @@
|
|||||||
using Microsoft.Data.Sqlite;
|
using System.Globalization;
|
||||||
using System.Globalization;
|
using System.Runtime.InteropServices;
|
||||||
|
using Microsoft.Data.Sqlite;
|
||||||
|
|
||||||
namespace RhythiaReplayExporter;
|
namespace RhythiaReplayExporter;
|
||||||
|
|
||||||
class Program
|
class Program
|
||||||
{
|
{
|
||||||
static void Main(string[] args)
|
static void Main(string[] args)
|
||||||
{
|
{
|
||||||
string appData = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
|
string appData;
|
||||||
|
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
|
||||||
|
appData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
|
||||||
|
else
|
||||||
|
appData = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
|
||||||
if (string.IsNullOrWhiteSpace(appData))
|
if (string.IsNullOrWhiteSpace(appData))
|
||||||
{
|
{
|
||||||
Console.WriteLine("Failed to find app data folder.");
|
Console.WriteLine("Failed to find app data folder.");
|
||||||
@@ -17,10 +23,14 @@ class Program
|
|||||||
string rhythia = Path.Combine(appData, "CapoRhythia");
|
string rhythia = Path.Combine(appData, "CapoRhythia");
|
||||||
if (!Directory.Exists(rhythia))
|
if (!Directory.Exists(rhythia))
|
||||||
{
|
{
|
||||||
Console.WriteLine("CapoRhythia directory doesn't exist in app data.");
|
rhythia = Path.Combine(appData, "Rhythia");
|
||||||
|
if (!Directory.Exists(rhythia))
|
||||||
|
{
|
||||||
|
Console.WriteLine("Neither CapoRhythia or Rhythia exists in app data.");
|
||||||
Environment.Exit(1);
|
Environment.Exit(1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
string database = Path.Combine(rhythia, "rhythia.db");
|
string database = Path.Combine(rhythia, "rhythia.db");
|
||||||
if (!File.Exists(database))
|
if (!File.Exists(database))
|
||||||
@@ -47,7 +57,11 @@ class Program
|
|||||||
int count = 0;
|
int count = 0;
|
||||||
while (reader.Read())
|
while (reader.Read())
|
||||||
{
|
{
|
||||||
DateTime createdAt = DateTime.ParseExact(reader.GetString(0), "yyyy-MM-dd HH:mm:ss.FFFFFFF", CultureInfo.InvariantCulture);
|
DateTime createdAt = DateTime.ParseExact(
|
||||||
|
reader.GetString(0),
|
||||||
|
"yyyy-MM-dd HH:mm:ss.FFFFFFF",
|
||||||
|
CultureInfo.InvariantCulture
|
||||||
|
);
|
||||||
string legacyMapId = reader.GetString(1);
|
string legacyMapId = reader.GetString(1);
|
||||||
byte[] replay = reader.GetFieldValue<byte[]>(2);
|
byte[] replay = reader.GetFieldValue<byte[]>(2);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user