Fix network intercept

This commit is contained in:
Brant Martin
2018-07-18 22:34:44 -04:00
parent b12199c65b
commit ec065ec329
2 changed files with 10 additions and 9 deletions

View File

@@ -106,8 +106,8 @@ namespace Torch.Server.Managers
foreach (var mod in world.Checkpoint.Mods) foreach (var mod in world.Checkpoint.Mods)
sb.AppendLine(mod.PublishedFileId.ToString()); sb.AppendLine(mod.PublishedFileId.ToString());
//TODO DedicatedConfig.Mods = world.Checkpoint.Mods.Select(x => x.PublishedFileId).ToList();
//DedicatedConfig.Mods = world.Checkpoint.Mods.Select(x => x.PublishedFileId).ToList();
Log.Debug("Loaded mod list from world"); Log.Debug("Loaded mod list from world");
@@ -134,8 +134,7 @@ namespace Torch.Server.Managers
return; return;
} }
//TODO DedicatedConfig.Mods = checkpoint.Mods.Select(x => x.PublishedFileId).ToList();
//DedicatedConfig.Mods = checkpoint.Mods.Select(x => x.PublishedFileId).ToList();
Log.Debug("Loaded mod list from world"); Log.Debug("Loaded mod list from world");
@@ -168,9 +167,8 @@ namespace Torch.Server.Managers
checkpoint.Settings = DedicatedConfig.SessionSettings; checkpoint.Settings = DedicatedConfig.SessionSettings;
checkpoint.Mods.Clear(); checkpoint.Mods.Clear();
//TODO: FIXIT foreach (var modId in DedicatedConfig.Mods)
//foreach (var modId in DedicatedConfig.Model.SessionSettings..Mods) checkpoint.Mods.Add(new MyObjectBuilder_Checkpoint.ModItem(modId));
// checkpoint.Mods.Add(new MyObjectBuilder_Checkpoint.ModItem(modId));
MyObjectBuilderSerializer.SerializeXML(sandboxPath, false, checkpoint); MyObjectBuilderSerializer.SerializeXML(sandboxPath, false, checkpoint);

View File

@@ -29,6 +29,8 @@ namespace Torch.Managers
private static Func<MyReplicationLayerBase, MyTypeTable> _typeTableGetter; private static Func<MyReplicationLayerBase, MyTypeTable> _typeTableGetter;
[ReflectedGetter(Name = "m_methodInfoLookup")] [ReflectedGetter(Name = "m_methodInfoLookup")]
private static Func<MyEventTable, Dictionary<MethodInfo, CallSite>> _methodInfoLookupGetter; private static Func<MyEventTable, Dictionary<MethodInfo, CallSite>> _methodInfoLookupGetter;
[ReflectedMethod(Type = typeof(MyReplicationLayer), Name = "GetObjectByNetworkId")]
private static Func<MyReplicationLayer, NetworkId, IMyNetObject> _getObjectByNetworkId;
public NetworkManager(ITorchBase torchInstance) : base(torchInstance) public NetworkManager(ITorchBase torchInstance) : base(torchInstance)
{ {
@@ -150,7 +152,8 @@ namespace Torch.Managers
} }
else // Instance event else // Instance event
{ {
var sendAs = ((MyReplicationLayer)MyMultiplayer.ReplicationLayer).GetObjectByNetworkId(networkId); //var sendAs = ((MyReplicationLayer)MyMultiplayer.ReplicationLayer).GetObjectByNetworkId(networkId);
var sendAs = _getObjectByNetworkId((MyReplicationLayer)MyMultiplayer.ReplicationLayer, networkId);
if (sendAs == null) if (sendAs == null)
{ {
return; return;