Пример #1
0
        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);
            }
        }
Пример #2
0
 public bool IsConnectionToClient()
 {
     return(TypeFlags.Test((uint)NetConnectionTypeFlags.ConnectionToClient));
 }
Пример #3
0
 public bool IsAdaptive()
 {
     return(TypeFlags.Test((uint)(NetConnectionTypeFlags.ConnectionAdaptive | NetConnectionTypeFlags.ConnectionRemoteAdaptive)));
 }
Пример #4
0
 public bool IsConnectionToServer()
 {
     return(TypeFlags.Test((uint)NetConnectionTypeFlags.ConnectionToServer));
 }