29 lines
807 B
C#
29 lines
807 B
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using Unity.Mathematics;
|
|
using UnityEngine;
|
|
|
|
namespace BITFALL.Industry
|
|
{
|
|
[Serializable]
|
|
public struct InGameNetServiceSingleton : IWorldNetService
|
|
{
|
|
public void Register(INetDevice device)=>InGameNetService.Register(device as UnityNetDevice);
|
|
|
|
public void Unregister(INetDevice device)=>InGameNetService.UnRegister(device as UnityNetDevice);
|
|
|
|
public INetGateway[] SearchDevices(float3 position, float radius, int minBandwidth)
|
|
{
|
|
var devices = InGameNetService.SearchDevice(position, radius);
|
|
return devices.OfType<INetGateway>().Where(device => device.Connection.Bandwidth >= minBandwidth).ToArray();
|
|
}
|
|
}
|
|
public sealed class InGameNetService: UnityTechServiceBase<UnityNetDevice>
|
|
{
|
|
|
|
}
|
|
|
|
}
|