Exemplo n.º 1
0
 public bool SetOption(P2PChannelOption option, int value)
 {
     if (option != P2PChannelOption.MaxPendingBuffers)
     {
         return(false);
     }
     if (!this.m_IsReliable)
     {
         if (P2PLogFilter.logError)
         {
             Debug.LogError("Cannot set MaxPendingBuffers on unreliable channel " + this.m_ChannelId);
         }
         return(false);
     }
     if (value < 0 || value >= 512)
     {
         if (P2PLogFilter.logError)
         {
             Debug.LogError(string.Concat(new object[]
             {
                 "Invalid MaxPendingBuffers for channel ",
                 this.m_ChannelId,
                 ". Must be greater than zero and less than ",
                 512
             }));
         }
         return(false);
     }
     this.m_MaxPendingPacketCount = value;
     return(true);
 }
Exemplo n.º 2
0
 public bool SetChannelOption(int channelId, P2PChannelOption option, int value)
 {
     return(this.m_Channels != null && channelId >= 0 && channelId < this.m_Channels.Length && this.m_Channels[channelId].SetOption(option, value));
 }