Okay so i have Subnautica Below Zero Multiplayer Mod and i want to modify it so that it can be played with cracked version of the game too.All i did was to change 2 lines that when it doesn't find the original game files it just starts the game in the directory that i chose.Everything was fine until i tried to build it in Visual Stuido.I got the source code from some app called DnSpy. Once i try to build it just says
Severity Code Description Project File Line Suppression State Error CS1525 Invalid expression term '>' Subnautica.Multiplayer C:\Users\mamma\Desktop\sub22\Subnautica.Multiplayer\Platforms\Steam.cs 126 Active
for like hundreds of times.I haven't used Visual Studio so much so maybe because im dumb and doing something wrong.Here is the full code:
`
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq.Expressions;
using System.Runtime.CompilerServices;
using Gameloop.Vdf;
using Microsoft.CSharp.RuntimeBinder;
using Microsoft.Win32;
using Subnautica.API.Features;
namespace Subnautica.Multiplayer.Platforms
{
// Token: 0x0200000E RID: 14
public class Steam : BasePlatform
{
// Token: 0x17000013 RID: 19
// (get) Token: 0x06000057 RID: 87 RVA: 0x0000563F File Offset: 0x0000383F
// (set) Token: 0x06000058 RID: 88 RVA: 0x00005647 File Offset: 0x00003847
private int GameId { get; set; } = 848450;
// Token: 0x06000059 RID: 89 RVA: 0x00005650 File Offset: 0x00003850
public override bool IsExistsPlatform()
{
string platformPath = this.GetPlatformPath();
Log.Info(string.Format("Steam.IsExistsPlatform: {0}", platformPath));
return platformPath != null;
}
// Token: 0x0600005A RID: 90 RVA: 0x00005680 File Offset: 0x00003880
public override bool IsExistsGame()
{
string gamePath = this.GetGamePath();
Log.Info(string.Format("Steam.IsExistsGame: {0}", gamePath));
return gamePath != null;
}
// Token: 0x0600005B RID: 91 RVA: 0x000056B0 File Offset: 0x000038B0
public override bool IsRunningPlatform()
{
object value = Registry.GetValue("HKEY_CURRENT_USER\\SOFTWARE\\Valve\\Steam\\ActiveProcess", "ActiveUser", "");
bool flag = value == null;
bool result;
if (flag)
{
result = false;
}
else
{
bool flag2 = string.IsNullOrEmpty(value.ToString());
result = (!flag2 && value.ToString() != "0");
}
return result;
}
// Token: 0x0600005C RID: 92 RVA: 0x00005708 File Offset: 0x00003908
public override bool IsRunningGame()
{
return Process.GetProcessesByName("SubnauticaZero").Length != 0;
}
// Token: 0x0600005D RID: 93 RVA: 0x00005728 File Offset: 0x00003928
public override string GetPlatformPath()
{
string mainPath = this.GetMainPath();
bool flag = string.IsNullOrEmpty(mainPath);
string result;
if (flag)
{
Log.Error("Steam -> GetPlatformPath -> NULL");
result = null;
}
else
{
bool flag2 = !File.Exists(Path.Combine(mainPath, "steamclient.dll"));
if (flag2)
{
Log.Error("Steam -> GetPlatformPath -> steamclient -> NOT EXISTS");
result = null;
}
else
{
string text = Path.Combine(mainPath, "steam.exe");
bool flag3 = !File.Exists(text);
if (flag3)
{
Log.Error("Steam -> GetPlatformPath -> steam.exe -> NOT EXISTS");
result = null;
}
else
{
Log.Error("Steam -> GetPlatformPath -> steam.exe -> " + text);
result = text;
}
}
}
return result;
}
// Token: 0x0600005E RID: 94 RVA: 0x000057C4 File Offset: 0x000039C4
public override string GetGamePath()
{
string mainPath = this.GetMainPath();
bool flag = string.IsNullOrEmpty(mainPath);
string result;
if (flag)
{
Log.Error("Steam -> GetGamePath -> NULL");
result = null;
}
else
{
string text = Path.Combine(mainPath, "steamapps", "libraryfolders.vdf");
Log.Info(string.Format("Steam.LibraryPath: {0}", text));
bool flag2 = !File.Exists(text);
if (flag2)
{
result = null;
}
else
{
try
{
object arg = VdfConvert.Deserialize(File.ReadAllText(text));
if (Steam.<>o__9.<>p__25 == null)
{
Steam.<>o__9.<>p__25 = CallSite<Func<CallSite, object, IEnumerable>>.Create(Binder.Convert(CSharpBinderFlags.None, typeof(IEnumerable), typeof(Steam)));
}
Func<CallSite, object, IEnumerable> target = Steam.<>o__9.<>p__25.Target;
CallSite <>p__ = Steam.<>o__9.<>p__25;
if (Steam.<>o__9.<>p__0 == null)
{
Steam.<>o__9.<>p__0 = CallSite<Func<CallSite, object, object>>.Create(Binder.GetMember(CSharpBinderFlags.None, "Value", typeof(Steam), new CSharpArgumentInfo[]
{
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)
}));
}
foreach (object arg2 in target(<>p__, Steam.<>o__9.<>p__0.Target(Steam.<>o__9.<>p__0, arg)))
{
if (Steam.<>o__9.<>p__4 == null)
{
Steam.<>o__9.<>p__4 = CallSite<Func<CallSite, object, object>>.Create(Binder.InvokeMember(CSharpBinderFlags.None, "ToString", null, typeof(Steam), new CSharpArgumentInfo[]
{
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)
}));
}
Func<CallSite, object, object> target2 = Steam.<>o__9.<>p__4.Target;
CallSite <>p__2 = Steam.<>o__9.<>p__4;
if (Steam.<>o__9.<>p__3 == null)
{
Steam.<>o__9.<>p__3 = CallSite<Func<CallSite, object, object>>.Create(Binder.GetMember(CSharpBinderFlags.None, "Value", typeof(Steam), new CSharpArgumentInfo[]
{
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)
}));
}
Func<CallSite, object, object> target3 = Steam.<>o__9.<>p__3.Target;
CallSite <>p__3 = Steam.<>o__9.<>p__3;
if (Steam.<>o__9.<>p__2 == null)
{
Steam.<>o__9.<>p__2 = CallSite<Func<CallSite, object, object>>.Create(Binder.GetMember(CSharpBinderFlags.None, "path", typeof(Steam), new CSharpArgumentInfo[]
{
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)
}));
}
Func<CallSite, object, object> target4 = Steam.<>o__9.<>p__2.Target;
CallSite <>p__4 = Steam.<>o__9.<>p__2;
if (Steam.<>o__9.<>p__1 == null)
{
Steam.<>o__9.<>p__1 = CallSite<Func<CallSite, object, object>>.Create(Binder.GetMember(CSharpBinderFlags.None, "Value", typeof(Steam), new CSharpArgumentInfo[]
{
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)
}));
}
object arg3 = target2(<>p__2, target3(<>p__3, target4(<>p__4, Steam.<>o__9.<>p__1.Target(Steam.<>o__9.<>p__1, arg2))));
if (Steam.<>o__9.<>p__5 == null)
{
Steam.<>o__9.<>p__5 = CallSite<Func<CallSite, Type, object, string, object>>.Create(Binder.InvokeMember(CSharpBinderFlags.None, "Combine", null, typeof(Steam), new CSharpArgumentInfo[]
{
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType | CSharpArgumentInfoFlags.IsStaticType, null),
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null),
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType | CSharpArgumentInfoFlags.Constant, null)
}));
}
object arg4 = Steam.<>o__9.<>p__5.Target(Steam.<>o__9.<>p__5, typeof(Path), arg3, "steamapps");
if (Steam.<>o__9.<>p__8 == null)
{
Steam.<>o__9.<>p__8 = CallSite<Func<CallSite, object, bool>>.Create(Binder.UnaryOperation(CSharpBinderFlags.None, ExpressionType.IsTrue, typeof(Steam), new CSharpArgumentInfo[]
{
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)
}));
}
Func<CallSite, object, bool> target5 = Steam.<>o__9.<>p__8.Target;
CallSite <>p__5 = Steam.<>o__9.<>p__8;
if (Steam.<>o__9.<>p__7 == null)
{
Steam.<>o__9.<>p__7 = CallSite<Func<CallSite, object, object>>.Create(Binder.UnaryOperation(CSharpBinderFlags.None, ExpressionType.Not, typeof(Steam), new CSharpArgumentInfo[]
{
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)
}));
}
Func<CallSite, object, object> target6 = Steam.<>o__9.<>p__7.Target;
CallSite <>p__6 = Steam.<>o__9.<>p__7;
if (Steam.<>o__9.<>p__6 == null)
{
Steam.<>o__9.<>p__6 = CallSite<Func<CallSite, Type, object, object>>.Create(Binder.InvokeMember(CSharpBinderFlags.None, "Exists", null, typeof(Steam), new CSharpArgumentInfo[]
{
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType | CSharpArgumentInfoFlags.IsStaticType, null),
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)
}));
}
bool flag3 = target5(<>p__5, target6(<>p__6, Steam.<>o__9.<>p__6.Target(Steam.<>o__9.<>p__6, typeof(Directory), arg4)));
if (!flag3)
{
if (Steam.<>o__9.<>p__9 == null)
{
Steam.<>o__9.<>p__9 = CallSite<Func<CallSite, Type, object, string, object>>.Create(Binder.InvokeMember(CSharpBinderFlags.None, "Combine", null, typeof(Steam), new CSharpArgumentInfo[]
{
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType | CSharpArgumentInfoFlags.IsStaticType, null),
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null),
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, null)
}));
}
object arg5 = Steam.<>o__9.<>p__9.Target(Steam.<>o__9.<>p__9, typeof(Path), arg4, string.Format("appmanifest_{0}.acf", this.GameId.ToString()));
if (Steam.<>o__9.<>p__12 == null)
{
Steam.<>o__9.<>p__12 = CallSite<Func<CallSite, object, bool>>.Create(Binder.UnaryOperation(CSharpBinderFlags.None, ExpressionType.IsTrue, typeof(Steam), new CSharpArgumentInfo[]
{
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)
}));
}
Func<CallSite, object, bool> target7 = Steam.<>o__9.<>p__12.Target;
CallSite <>p__7 = Steam.<>o__9.<>p__12;
if (Steam.<>o__9.<>p__11 == null)
{
Steam.<>o__9.<>p__11 = CallSite<Func<CallSite, object, object>>.Create(Binder.UnaryOperation(CSharpBinderFlags.None, ExpressionType.Not, typeof(Steam), new CSharpArgumentInfo[]
{
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)
}));
}
Func<CallSite, object, object> target8 = Steam.<>o__9.<>p__11.Target;
CallSite <>p__8 = Steam.<>o__9.<>p__11;
if (Steam.<>o__9.<>p__10 == null)
{
Steam.<>o__9.<>p__10 = CallSite<Func<CallSite, Type, object, object>>.Create(Binder.InvokeMember(CSharpBinderFlags.None, "Exists", null, typeof(Steam), new CSharpArgumentInfo[]
{
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType | CSharpArgumentInfoFlags.IsStaticType, null),
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)
}));
}
bool flag4 = target7(<>p__7, target8(<>p__8, Steam.<>o__9.<>p__10.Target(Steam.<>o__9.<>p__10, typeof(File), arg5)));
if (!flag4)
{
if (Steam.<>o__9.<>p__14 == null)
{
Steam.<>o__9.<>p__14 = CallSite<Func<CallSite, Type, object, object>>.Create(Binder.InvokeMember(CSharpBinderFlags.None, "Deserialize", null, typeof(Steam), new CSharpArgumentInfo[]
{
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType | CSharpArgumentInfoFlags.IsStaticType, null),
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)
}));
}
Func<CallSite, Type, object, object> target9 = Steam.<>o__9.<>p__14.Target;
CallSite <>p__9 = Steam.<>o__9.<>p__14;
Type typeFromHandle = typeof(VdfConvert);
if (Steam.<>o__9.<>p__13 == null)
{
Steam.<>o__9.<>p__13 = CallSite<Func<CallSite, Type, object, object>>.Create(Binder.InvokeMember(CSharpBinderFlags.None, "ReadAllText", null, typeof(Steam), new CSharpArgumentInfo[]
{
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType | CSharpArgumentInfoFlags.IsStaticType, null),
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)
}));
}
object arg6 = target9(<>p__9, typeFromHandle, Steam.<>o__9.<>p__13.Target(Steam.<>o__9.<>p__13, typeof(File), arg5));
if (Steam.<>o__9.<>p__18 == null)
{
Steam.<>o__9.<>p__18 = CallSite<Func<CallSite, object, object>>.Create(Binder.InvokeMember(CSharpBinderFlags.None, "ToString", null, typeof(Steam), new CSharpArgumentInfo[]
{
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)
}));
}
Func<CallSite, object, object> target10 = Steam.<>o__9.<>p__18.Target;
CallSite <>p__10 = Steam.<>o__9.<>p__18;
if (Steam.<>o__9.<>p__17 == null)
{
Steam.<>o__9.<>p__17 = CallSite<Func<CallSite, object, object>>.Create(Binder.GetMember(CSharpBinderFlags.None, "Value", typeof(Steam), new CSharpArgumentInfo[]
{
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)
}));
}
Func<CallSite, object, object> target11 = Steam.<>o__9.<>p__17.Target;
CallSite <>p__11 = Steam.<>o__9.<>p__17;
if (Steam.<>o__9.<>p__16 == null)
{
Steam.<>o__9.<>p__16 = CallSite<Func<CallSite, object, object>>.Create(Binder.GetMember(CSharpBinderFlags.None, "installdir", typeof(Steam), new CSharpArgumentInfo[]
{
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)
}));
}
Func<CallSite, object, object> target12 = Steam.<>o__9.<>p__16.Target;
CallSite <>p__12 = Steam.<>o__9.<>p__16;
if (Steam.<>o__9.<>p__15 == null)
{
Steam.<>o__9.<>p__15 = CallSite<Func<CallSite, object, object>>.Create(Binder.GetMember(CSharpBinderFlags.None, "Value", typeof(Steam), new CSharpArgumentInfo[]
{
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)
}));
}
object obj = target10(<>p__10, target11(<>p__11, target12(<>p__12, Steam.<>o__9.<>p__15.Target(Steam.<>o__9.<>p__15, arg6))));
if (Steam.<>o__9.<>p__20 == null)
{
Steam.<>o__9.<>p__20 = CallSite<Func<CallSite, object, bool>>.Create(Binder.UnaryOperation(CSharpBinderFlags.None, ExpressionType.IsTrue, typeof(Steam), new CSharpArgumentInfo[]
{
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)
}));
}
Func<CallSite, object, bool> target13 = Steam.<>o__9.<>p__20.Target;
CallSite <>p__13 = Steam.<>o__9.<>p__20;
if (Steam.<>o__9.<>p__19 == null)
{
Steam.<>o__9.<>p__19 = CallSite<Func<CallSite, Type, object, object>>.Create(Binder.InvokeMember(CSharpBinderFlags.None, "IsNullOrEmpty", null, typeof(Steam), new CSharpArgumentInfo[]
{
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType | CSharpArgumentInfoFlags.IsStaticType, null),
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)
}));
}
bool flag5 = target13(<>p__13, Steam.<>o__9.<>p__19.Target(Steam.<>o__9.<>p__19, typeof(string), obj));
if (!flag5)
{
if (Steam.<>o__9.<>p__21 == null)
{
Steam.<>o__9.<>p__21 = CallSite<Func<CallSite, Type, object, string, object, string, object>>.Create(Binder.InvokeMember(CSharpBinderFlags.None, "Combine", null, typeof(Steam), new CSharpArgumentInfo[]
{
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType | CSharpArgumentInfoFlags.IsStaticType, null),
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null),
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType | CSharpArgumentInfoFlags.Constant, null),
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null),
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType | CSharpArgumentInfoFlags.Constant, null)
}));
}
object obj2 = Steam.<>o__9.<>p__21.Target(Steam.<>o__9.<>p__21, typeof(Path), arg4, "common", obj, "SubnauticaZero.exe");
if (Steam.<>o__9.<>p__23 == null)
{
Steam.<>o__9.<>p__23 = CallSite<Func<CallSite, object, bool>>.Create(Binder.UnaryOperation(CSharpBinderFlags.None, ExpressionType.IsTrue, typeof(Steam), new CSharpArgumentInfo[]
{
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)
}));
}
Func<CallSite, object, bool> target14 = Steam.<>o__9.<>p__23.Target;
CallSite <>p__14 = Steam.<>o__9.<>p__23;
if (Steam.<>o__9.<>p__22 == null)
{
Steam.<>o__9.<>p__22 = CallSite<Func<CallSite, Type, object, object>>.Create(Binder.InvokeMember(CSharpBinderFlags.None, "Exists", null, typeof(Steam), new CSharpArgumentInfo[]
{
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType | CSharpArgumentInfoFlags.IsStaticType, null),
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)
}));
}
bool flag6 = target14(<>p__14, Steam.<>o__9.<>p__22.Target(Steam.<>o__9.<>p__22, typeof(File), obj2));
if (flag6)
{
if (Steam.<>o__9.<>p__24 == null)
{
Steam.<>o__9.<>p__24 = CallSite<Func<CallSite, object, string>>.Create(Binder.Convert(CSharpBinderFlags.None, typeof(string), typeof(Steam)));
}
return Steam.<>o__9.<>p__24.Target(Steam.<>o__9.<>p__24, obj2);
}
}
}
}
}
}
catch (Exception arg7)
{
Log.Error(string.Format("Steam -> GetGamePath -> Exception: {0}", arg7));
}
result = null;
}
}
return result;
}
// Token: 0x0600005F RID: 95 RVA: 0x000061D4 File Offset: 0x000043D4
public override bool StartGame()
{
string gamePath = this.GetGamePath();
bool flag = string.IsNullOrEmpty(gamePath);
bool result;
if (flag)
{
Process.Start("C:\Games\sub22\Game\SubnauticaZero.exe");
result = true;
}
else
{
result = false;
}
return result;
}
// Token: 0x06000060 RID: 96 RVA: 0x00006208 File Offset: 0x00004408
public override bool UpdateAssembly()
{
string assemblyFilePath = this.GetAssemblyFilePath();
bool flag = string.IsNullOrEmpty(assemblyFilePath);
bool result;
if (flag)
{
result = false;
}
else
{
string launcherGameCorePath = Paths.GetLauncherGameCorePath("Assembly-CSharp.dll");
FileInfo fileInfo = new FileInfo(assemblyFilePath);
FileInfo fileInfo2 = new FileInfo(launcherGameCorePath);
bool exists = fileInfo2.Exists;
if (exists)
{
File.Copy(launcherGameCorePath, assemblyFilePath, true);
result = true;
}
else
{
result = false;
}
}
return result;
}
// Token: 0x06000061 RID: 97 RVA: 0x0000626C File Offset: 0x0000446C
public override string GetAssemblyFilePath()
{
string text = this.GetGamePath();
bool flag = string.IsNullOrEmpty(text);
string result;
if (flag)
{
result = null;
}
else
{
text = text.Replace("SubnauticaZero.exe", "");
result = string.Format("{0}SubnauticaZero_Data{1}Managed{2}Assembly-CSharp.dll", text, Paths.DS, Paths.DS);
}
return result;
}
// Token: 0x06000062 RID: 98 RVA: 0x000062C4 File Offset: 0x000044C4
private string GetMainPath()
{
List<string> list = new List<string>
{
"SOFTWARE\\Valve\\Steam",
"SOFTWARE\\Wow6432Node\\Valve\\Steam"
};
foreach (string name in list)
{
RegistryKey registryKey = Registry.LocalMachine.OpenSubKey(name);
bool flag = registryKey != null;
if (flag)
{
object value = registryKey.GetValue("InstallPath");
bool flag2 = value != null;
if (flag2)
{
return value.ToString().Trim();
}
}
}
return null;
}
}
}
I have tried to install .NET 4.7.2 since github repository said so.It is probably some dumb mistake i made but still can't figure out how to use Visual Studio.