Files
2026-06-04 11:42:34 +02:00

166 lines
4.3 KiB
C#

using System;
using System.Collections.Generic;
namespace UnityEngine.Networking
{
// Token: 0x020002CE RID: 718
[Serializable]
public class HostTopology
{
// Token: 0x06002F7B RID: 12155 RVA: 0x00045598 File Offset: 0x00043798
public HostTopology(ConnectionConfig defaultConfig, int maxDefaultConnections)
{
if (defaultConfig == null)
{
throw new NullReferenceException("config is not defined");
}
if (maxDefaultConnections <= 0)
{
throw new ArgumentOutOfRangeException("maxDefaultConnections", "Number of connections should be > 0");
}
if (maxDefaultConnections >= 65535)
{
throw new ArgumentOutOfRangeException("maxDefaultConnections", "Number of connections should be < 65535");
}
ConnectionConfig.Validate(defaultConfig);
this.m_DefConfig = new ConnectionConfig(defaultConfig);
this.m_MaxDefConnections = maxDefaultConnections;
}
// Token: 0x06002F7C RID: 12156 RVA: 0x00045644 File Offset: 0x00043844
private HostTopology()
{
}
// Token: 0x17000AD4 RID: 2772
// (get) Token: 0x06002F7D RID: 12157 RVA: 0x00045694 File Offset: 0x00043894
public ConnectionConfig DefaultConfig
{
get
{
return this.m_DefConfig;
}
}
// Token: 0x17000AD5 RID: 2773
// (get) Token: 0x06002F7E RID: 12158 RVA: 0x000456B0 File Offset: 0x000438B0
public int MaxDefaultConnections
{
get
{
return this.m_MaxDefConnections;
}
}
// Token: 0x17000AD6 RID: 2774
// (get) Token: 0x06002F7F RID: 12159 RVA: 0x000456CC File Offset: 0x000438CC
public int SpecialConnectionConfigsCount
{
get
{
return this.m_SpecialConnections.Count;
}
}
// Token: 0x17000AD7 RID: 2775
// (get) Token: 0x06002F80 RID: 12160 RVA: 0x000456EC File Offset: 0x000438EC
public List<ConnectionConfig> SpecialConnectionConfigs
{
get
{
return this.m_SpecialConnections;
}
}
// Token: 0x06002F81 RID: 12161 RVA: 0x00045708 File Offset: 0x00043908
public ConnectionConfig GetSpecialConnectionConfig(int i)
{
if (i > this.m_SpecialConnections.Count || i == 0)
{
throw new ArgumentException("special configuration index is out of valid range");
}
return this.m_SpecialConnections[i - 1];
}
// Token: 0x17000AD8 RID: 2776
// (get) Token: 0x06002F82 RID: 12162 RVA: 0x00045750 File Offset: 0x00043950
// (set) Token: 0x06002F83 RID: 12163 RVA: 0x0004576C File Offset: 0x0004396C
public ushort ReceivedMessagePoolSize
{
get
{
return this.m_ReceivedMessagePoolSize;
}
set
{
this.m_ReceivedMessagePoolSize = value;
}
}
// Token: 0x17000AD9 RID: 2777
// (get) Token: 0x06002F84 RID: 12164 RVA: 0x00045778 File Offset: 0x00043978
// (set) Token: 0x06002F85 RID: 12165 RVA: 0x00045794 File Offset: 0x00043994
public ushort SentMessagePoolSize
{
get
{
return this.m_SentMessagePoolSize;
}
set
{
this.m_SentMessagePoolSize = value;
}
}
// Token: 0x17000ADA RID: 2778
// (get) Token: 0x06002F86 RID: 12166 RVA: 0x000457A0 File Offset: 0x000439A0
// (set) Token: 0x06002F87 RID: 12167 RVA: 0x000457BC File Offset: 0x000439BC
public float MessagePoolSizeGrowthFactor
{
get
{
return this.m_MessagePoolSizeGrowthFactor;
}
set
{
if ((double)value <= 0.5 || (double)value > 1.0)
{
throw new ArgumentException("pool growth factor should be varied between 0.5 and 1.0");
}
this.m_MessagePoolSizeGrowthFactor = value;
}
}
// Token: 0x06002F88 RID: 12168 RVA: 0x000457F4 File Offset: 0x000439F4
public int AddSpecialConnectionConfig(ConnectionConfig config)
{
this.m_SpecialConnections.Add(new ConnectionConfig(config));
return this.m_SpecialConnections.Count;
}
// Token: 0x04000963 RID: 2403
[SerializeField]
private ConnectionConfig m_DefConfig = null;
// Token: 0x04000964 RID: 2404
[SerializeField]
private int m_MaxDefConnections = 0;
// Token: 0x04000965 RID: 2405
[SerializeField]
private List<ConnectionConfig> m_SpecialConnections = new List<ConnectionConfig>();
// Token: 0x04000966 RID: 2406
[SerializeField]
private ushort m_ReceivedMessagePoolSize = 1024;
// Token: 0x04000967 RID: 2407
[SerializeField]
private ushort m_SentMessagePoolSize = 1024;
// Token: 0x04000968 RID: 2408
[SerializeField]
private float m_MessagePoolSizeGrowthFactor = 0.75f;
}
}