protected void WritePacketRateInfo(BitStream stream, PacketNotify note) { note.RateChanged = LocalRateChanged; LocalRateChanged = false; if (stream.WriteFlag(note.RateChanged) && !stream.WriteFlag(TypeFlags.Test((uint)NetConnectionTypeFlags.ConnectionAdaptive))) { stream.WriteRangedU32(LocalRate.MaxRecvBandwidth, 0, MaxFixedBandwidth); stream.WriteRangedU32(LocalRate.MaxSendBandwidth, 0, MaxFixedBandwidth); stream.WriteRangedU32(LocalRate.MinPacketRecvPeriod, 1, MaxFixedSendPeriod); stream.WriteRangedU32(LocalRate.MinPacketSendPeriod, 1, MaxFixedSendPeriod); } }
public bool IsConnectionToClient() { return(TypeFlags.Test((uint)NetConnectionTypeFlags.ConnectionToClient)); }
public bool IsAdaptive() { return(TypeFlags.Test((uint)(NetConnectionTypeFlags.ConnectionAdaptive | NetConnectionTypeFlags.ConnectionRemoteAdaptive))); }
public bool IsConnectionToServer() { return(TypeFlags.Test((uint)NetConnectionTypeFlags.ConnectionToServer)); }