Fix mod downloading, more descriptive sandbox error message

This commit is contained in:
John Gross
2019-10-26 11:38:38 -07:00
parent 52ef0b4d6d
commit cc91fa3653
4 changed files with 12 additions and 9 deletions

View File

@@ -220,7 +220,7 @@ quit";
// ReSharper disable once PossibleNullReferenceException
while (!cmd.HasExited)
{
log.Info(cmd.StandardOutput.ReadLine());
log.Info(cmd.StandardOutput.ReadToEnd());
Thread.Sleep(100);
}
}

View File

@@ -221,7 +221,7 @@ namespace Torch.Server.Managers
if (Players.ContainsKey(steamId))
{
_log.Warn($"Player {steamId} already has already joined!");
_log.Warn($"Player {steamId} has already joined!");
UserRejected(steamId, JoinResult.AlreadyJoined);
}
else if (Torch.CurrentSession.KeenSession.OnlineMode == MyOnlineModeEnum.OFFLINE &&

View File

@@ -8,7 +8,7 @@ namespace Torch
/// <summary>
/// Provides static accessor for MySteamService because Keen made it internal
/// </summary>
public class MySteamServiceWrapper
public static class MySteamServiceWrapper
{
private static readonly MethodInfo _getGameService;
@@ -20,5 +20,10 @@ namespace Torch
var prop = type.GetProperty("Static", BindingFlags.Static | BindingFlags.Public);
_getGameService = prop.GetGetMethod();
}
public static IMyGameService Init(bool dedicated, uint appId)
{
return (IMyGameService)Activator.CreateInstance(Type.GetType("VRage.Steam.MySteamService, VRage.Steam"), dedicated, appId);
}
}
}

View File

@@ -137,11 +137,9 @@ namespace Torch
{
bool dedicated = Sandbox.Engine.Platform.Game.IsDedicated;
Environment.SetEnvironmentVariable("SteamAppId", _appSteamId.ToString());
//KEEN WHY
Activator.CreateInstance(Type.GetType("VRage.Steam.MySteamService, VRage.Steam"), new object[] {dedicated, _appSteamId});
var service = MySteamServiceWrapper.Static;
var service = MySteamServiceWrapper.Init(dedicated, _appSteamId);
MyServiceManager.Instance.AddService<IMyGameService>(service);
var serviceInstance = MySteamUgcService.Create(MyPerServerSettings.AppId, service);
var serviceInstance = MySteamUgcService.Create(_appSteamId, service);
MyServiceManager.Instance.AddService<IMyUGCService>(serviceInstance);
if (dedicated && !MyGameService.HasGameServer)
{
@@ -239,7 +237,7 @@ namespace Torch
if (MySandboxGame.FatalErrorDuringInit)
{
throw new InvalidOperationException("Failed to start sandbox game: fatal error during init");
throw new InvalidOperationException("Failed to start sandbox game: see Keen log for details");
}
try
{