mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
26 lines
914 B
C#
26 lines
914 B
C#
using System.Collections;
|
|
using System.Diagnostics;
|
|
|
|
namespace ET.Server
|
|
{
|
|
[EntitySystemOf(typeof(WatcherComponent))]
|
|
[FriendOf(typeof(WatcherComponent))]
|
|
public static partial class WatcherComponentSystem
|
|
{
|
|
[EntitySystem]
|
|
public static void Awake(this WatcherComponent self)
|
|
{
|
|
string[] localIP = NetworkHelper.GetAddressIPs();
|
|
var processConfigs = StartProcessConfigCategory.Instance.GetAll();
|
|
foreach (StartProcessConfig startProcessConfig in processConfigs.Values)
|
|
{
|
|
if (!WatcherHelper.IsThisMachine(startProcessConfig.InnerIP, localIP))
|
|
{
|
|
continue;
|
|
}
|
|
System.Diagnostics.Process process = WatcherHelper.StartProcess(startProcessConfig.Id);
|
|
self.Processes.Add(startProcessConfig.Id, process);
|
|
}
|
|
}
|
|
}
|
|
} |