This repository has been archived on 2025-07-21. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
EnvyUpdate/EnvyUpdate/Debug.cs
2021-05-02 16:16:03 +02:00

50 lines
1.4 KiB
C#

using System;
using System.IO;
using System.Linq;
namespace EnvyUpdate
{
class Debug
{
readonly static string debugFilePath = GlobalVars.exepath + "debug.txt";
public static int LoadFakeIDs(string idType)
{
/*
* Usage:
* Create debug.txt file.
* Fill in variables:
* Line 1: psid
* Line 2: pfid
* Line 3: osid
* Line 4: dtcid
* Line 5: Local driver version
*
* Supply /debug flag to exe.
*/
string line = null;
switch (idType)
{
case "psid":
line = File.ReadLines(debugFilePath).Take(1).First();
break;
case "pfid":
line = File.ReadLines(debugFilePath).Skip(1).Take(1).First();
break;
case "osid":
line = File.ReadLines(debugFilePath).Skip(2).Take(1).First();
break;
case "dtcid":
line = File.ReadLines(debugFilePath).Skip(3).Take(1).First();
break;
default:
break;
}
return int.Parse(line);
}
public static string LocalDriv()
{
return File.ReadLines(debugFilePath).Skip(4).Take(1).First();
}
}
}