mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-30 12:32:55 +00:00
bleh
This commit is contained in:
parent
0121a527e6
commit
c54fd1039e
@ -1,4 +1,5 @@
|
|||||||
using Steamworks;
|
using HarmonyLib;
|
||||||
|
using Steamworks;
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
@ -63,20 +64,24 @@ public static class Program
|
|||||||
case 0:
|
case 0:
|
||||||
var owned = SteamApps.BIsDlcInstalled((AppId_t)1622100U);
|
var owned = SteamApps.BIsDlcInstalled((AppId_t)1622100U);
|
||||||
Log($"dlc owned: {owned}");
|
Log($"dlc owned: {owned}");
|
||||||
|
|
||||||
exitCode = owned ? 1 : 0;
|
exitCode = owned ? 1 : 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// earn achievement
|
// earn achievement
|
||||||
case 1:
|
case 1:
|
||||||
Log("Earn " + type);
|
var achievementType = (Achievements.Type)arg;
|
||||||
if (!SteamUserStats.SetAchievement(Achievements.s_names[type]))
|
Log("Earn " + achievementType);
|
||||||
|
// for some reason even with unsafe code turned on it throws a FieldAccessException
|
||||||
|
var s_names = (string[])AccessTools.Field(typeof(Achievements), "s_names").GetValue(null);
|
||||||
|
if (!SteamUserStats.SetAchievement(s_names[(int)achievementType]))
|
||||||
{
|
{
|
||||||
LogError("Unable to grant achievement \"" + Achievements.s_names[type] + "\"");
|
LogError("Unable to grant achievement \"" + s_names[(int)achievementType] + "\"");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
exitCode = 0;
|
||||||
}
|
}
|
||||||
SteamUserStats.StoreStats();
|
SteamUserStats.StoreStats();
|
||||||
|
|
||||||
exitCode = 0;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,9 +70,9 @@ public static class Interop
|
|||||||
});
|
});
|
||||||
process!.WaitForExit();
|
process!.WaitForExit();
|
||||||
|
|
||||||
Log($"output:\n{process.StandardOutput.ReadToEnd()}");
|
Log($"StandardOutput:\n{process.StandardOutput.ReadToEnd()}");
|
||||||
LogError($"error:\n{process.StandardError.ReadToEnd()}");
|
LogError($"StandardError:\n{process.StandardError.ReadToEnd()}");
|
||||||
Log($"exit code: {process.ExitCode}");
|
Log($"ExitCode: {process.ExitCode}");
|
||||||
|
|
||||||
return process.ExitCode;
|
return process.ExitCode;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user