示例#1
0
        public static async Task <Guid> StartInstanceAsync(ServerType type, int port)
        {
            var id = Guid.NewGuid();

            var instance = new ServerInstance(id)
            {
                ServerType = type,
                ServerPort = port,
                ApiPort    = await ClaimApiPortAsync(),
            };

            instance.Start(DllLocation, Config.DllSource.DotNetPath);

            Instances.Add(instance);

            return(id);
        }
示例#2
0
        public static async Task <Guid> StartInstanceAsync(ServerType type, int port)
        {
            var id = Guid.NewGuid();

            var instance = new ServerInstance(id)
            {
                ServerType = type,
                ServerPort = port,
                ApiPort    = await ClaimApiPortAsync(),
            };

            instance.Start(DllLocation, Config.DllSource.DotNetPath);

            Instances.Add(instance);

            if (type == ServerType.World)
            {
                InstanceHeartBeats.Add(id.ToString(), 0);
                InstanceHealth.Add(id.ToString(), ServerHealth.Healthy);
            }

            return(id);
        }