idk why it's not working

This commit is contained in:
LTP
2021-02-12 00:45:51 +07:00
parent e5cb3e5ae0
commit b372230eae
2 changed files with 16 additions and 5 deletions

View File

@@ -7,10 +7,10 @@ namespace Torch.Utils
{
public static MyObjectBuilder_Checkpoint.ModItem Create(ulong modId)
{
var serviceName = "Steam";
if (MyGameService.IsOnline)
serviceName = MyGameService.GetDefaultUGC().ServiceName;
return new MyObjectBuilder_Checkpoint.ModItem(modId, serviceName);
return new MyObjectBuilder_Checkpoint.ModItem(modId, GetDefaultServiceName());
}
//because KEEEN!
public static string GetDefaultServiceName() => "Steam";
}
}

View File

@@ -148,6 +148,7 @@ namespace Torch
//not implemented by keen.. removed in cross-play update
//MyVRage.Platform.InitScripting(MyVRageScripting.Create());
_ = MyVRage.Platform.Scripting;
MyFileSystem.ExePath = Path.GetDirectoryName(typeof(SpaceEngineersGame).Assembly.Location);
@@ -292,14 +293,24 @@ namespace Torch
MyObjectBuilder_Checkpoint checkpoint = MyLocalCache.LoadCheckpoint(sessionPath, out ulong checkpointSize);
if (MySession.IsCompatibleVersion(checkpoint))
{
if (MyWorkshop.DownloadWorldModsBlocking(checkpoint.Mods, null).Success)
var downloadResult = MyWorkshop.DownloadWorldModsBlocking(checkpoint.Mods.Select(b =>
{
b.PublishedServiceName = ModItemUtils.GetDefaultServiceName();
return b;
}).ToList(), null);
if (downloadResult.Success)
{
MyLog.Default.WriteLineAndConsole("Mods Downloaded");
// MySpaceAnalytics.Instance.SetEntry(MyGameEntryEnum.Load);
MySession.Load(sessionPath, checkpoint, checkpointSize);
_hostServerForSession(MySession.Static, MyMultiplayer.Static);
}
else
{
MyLog.Default.WriteLineAndConsole("Unable to download mods");
MyLog.Default.WriteLineAndConsole("Missing Mods:");
downloadResult.MismatchMods?.ForEach(b => MyLog.Default.WriteLineAndConsole($"\t{b.Title} ({b.Id})"));
}
}
else
MyLog.Default.WriteLineAndConsole(MyTexts.Get(MyCommonTexts.DialogTextIncompatibleWorldVersion)