Fix mod downloading, more descriptive sandbox error message
This commit is contained in:
@@ -216,11 +216,11 @@ quit";
|
||||
StandardOutputEncoding = Encoding.ASCII
|
||||
};
|
||||
var cmd = Process.Start(steamCmdProc);
|
||||
|
||||
|
||||
// ReSharper disable once PossibleNullReferenceException
|
||||
while (!cmd.HasExited)
|
||||
{
|
||||
log.Info(cmd.StandardOutput.ReadLine());
|
||||
log.Info(cmd.StandardOutput.ReadToEnd());
|
||||
Thread.Sleep(100);
|
||||
}
|
||||
}
|
||||
|
@@ -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 &&
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
@@ -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
|
||||
{
|
||||
|
Reference in New Issue
Block a user