namespace Unity.Netcode
{
internal class SessionConfig
{
///
/// The running list of session versions
///
public const uint NoFeatureCompatibility = 0;
public const uint BypassFeatureCompatible = 1;
public const uint ServerDistributionCompatible = 2;
// The most current session version (!!!!set this when you increment!!!!!)
public static uint PackageSessionVersion => ServerDistributionCompatible;
internal uint SessionVersion;
public bool ServiceSideDistribution;
///
/// Service to client
/// Set when the client receives a
///
/// the session's settings
public SessionConfig(ServiceConfig serviceConfig)
{
SessionVersion = serviceConfig.SessionVersion;
ServiceSideDistribution = serviceConfig.ServerRedistribution;
}
///
/// Can be used to directly set the version.
///
///
/// If a client connects that does not support session configuration then
/// this will be invoked. The default values set in the constructor should
/// assume that no features are available.
/// Can also be used for mock/integration testing version handling.
///
/// version to set
public SessionConfig(uint version)
{
SessionVersion = version;
ServiceSideDistribution = false;
}
///
/// Client to Service
/// Default package constructor set when is invoked.
///
public SessionConfig()
{
// The current
SessionVersion = PackageSessionVersion;
ServiceSideDistribution = false;
}
}
}