Fix mod downloading, more descriptive sandbox error message
This commit is contained in:
@@ -220,7 +220,7 @@ quit";
|
|||||||
// ReSharper disable once PossibleNullReferenceException
|
// ReSharper disable once PossibleNullReferenceException
|
||||||
while (!cmd.HasExited)
|
while (!cmd.HasExited)
|
||||||
{
|
{
|
||||||
log.Info(cmd.StandardOutput.ReadLine());
|
log.Info(cmd.StandardOutput.ReadToEnd());
|
||||||
Thread.Sleep(100);
|
Thread.Sleep(100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -221,7 +221,7 @@ namespace Torch.Server.Managers
|
|||||||
|
|
||||||
if (Players.ContainsKey(steamId))
|
if (Players.ContainsKey(steamId))
|
||||||
{
|
{
|
||||||
_log.Warn($"Player {steamId} already has already joined!");
|
_log.Warn($"Player {steamId} has already joined!");
|
||||||
UserRejected(steamId, JoinResult.AlreadyJoined);
|
UserRejected(steamId, JoinResult.AlreadyJoined);
|
||||||
}
|
}
|
||||||
else if (Torch.CurrentSession.KeenSession.OnlineMode == MyOnlineModeEnum.OFFLINE &&
|
else if (Torch.CurrentSession.KeenSession.OnlineMode == MyOnlineModeEnum.OFFLINE &&
|
||||||
|
@@ -8,7 +8,7 @@ namespace Torch
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Provides static accessor for MySteamService because Keen made it internal
|
/// Provides static accessor for MySteamService because Keen made it internal
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class MySteamServiceWrapper
|
public static class MySteamServiceWrapper
|
||||||
{
|
{
|
||||||
private static readonly MethodInfo _getGameService;
|
private static readonly MethodInfo _getGameService;
|
||||||
|
|
||||||
@@ -20,5 +20,10 @@ namespace Torch
|
|||||||
var prop = type.GetProperty("Static", BindingFlags.Static | BindingFlags.Public);
|
var prop = type.GetProperty("Static", BindingFlags.Static | BindingFlags.Public);
|
||||||
_getGameService = prop.GetGetMethod();
|
_getGameService = prop.GetGetMethod();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static IMyGameService Init(bool dedicated, uint appId)
|
||||||
|
{
|
||||||
|
return (IMyGameService)Activator.CreateInstance(Type.GetType("VRage.Steam.MySteamService, VRage.Steam"), dedicated, appId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -137,11 +137,9 @@ namespace Torch
|
|||||||
{
|
{
|
||||||
bool dedicated = Sandbox.Engine.Platform.Game.IsDedicated;
|
bool dedicated = Sandbox.Engine.Platform.Game.IsDedicated;
|
||||||
Environment.SetEnvironmentVariable("SteamAppId", _appSteamId.ToString());
|
Environment.SetEnvironmentVariable("SteamAppId", _appSteamId.ToString());
|
||||||
//KEEN WHY
|
var service = MySteamServiceWrapper.Init(dedicated, _appSteamId);
|
||||||
Activator.CreateInstance(Type.GetType("VRage.Steam.MySteamService, VRage.Steam"), new object[] {dedicated, _appSteamId});
|
|
||||||
var service = MySteamServiceWrapper.Static;
|
|
||||||
MyServiceManager.Instance.AddService<IMyGameService>(service);
|
MyServiceManager.Instance.AddService<IMyGameService>(service);
|
||||||
var serviceInstance = MySteamUgcService.Create(MyPerServerSettings.AppId, service);
|
var serviceInstance = MySteamUgcService.Create(_appSteamId, service);
|
||||||
MyServiceManager.Instance.AddService<IMyUGCService>(serviceInstance);
|
MyServiceManager.Instance.AddService<IMyUGCService>(serviceInstance);
|
||||||
if (dedicated && !MyGameService.HasGameServer)
|
if (dedicated && !MyGameService.HasGameServer)
|
||||||
{
|
{
|
||||||
@@ -239,7 +237,7 @@ namespace Torch
|
|||||||
|
|
||||||
if (MySandboxGame.FatalErrorDuringInit)
|
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
|
try
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user