当前位置: 首页>>代码示例>>C#>>正文


C# NetIncomingMessageType类代码示例

本文整理汇总了C#中NetIncomingMessageType的典型用法代码示例。如果您正苦于以下问题:C# NetIncomingMessageType类的具体用法?C# NetIncomingMessageType怎么用?C# NetIncomingMessageType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


NetIncomingMessageType类属于命名空间,在下文中一共展示了NetIncomingMessageType类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Reset

		internal void Reset()
		{
			m_incomingMessageType = NetIncomingMessageType.Error;
			m_readPosition = 0;
			m_receivedMessageType = NetMessageType.LibraryError;
			m_senderConnection = null;
			m_bitLength = 0;
			m_isFragment = false;
		}
开发者ID:xxy1991,项目名称:cozy,代码行数:9,代码来源:NetIncomingMessage.cs

示例2: CreateIncomingMessage

 internal NetIncomingMessage CreateIncomingMessage(NetIncomingMessageType tp, int minimumByteSize)
 {
     NetIncomingMessage retval;
     if (m_incomingMessagesPool == null || !m_incomingMessagesPool.TryDequeue(out retval))
         retval = new NetIncomingMessage(tp);
     else
         retval.m_incomingMessageType = tp;
     retval.m_data = GetStorage(minimumByteSize);
     return retval;
 }
开发者ID:tomoprime,项目名称:CrabBattle,代码行数:10,代码来源:NetPeer.MessagePools.cs

示例3: NetPeerConfiguration

		/// <summary>
		/// NetPeerConfiguration constructor
		/// </summary>
		public NetPeerConfiguration(string appIdentifier)
		{
			if (string.IsNullOrEmpty(appIdentifier))
				throw new NetException("App identifier must be at least one character long");
			m_appIdentifier = appIdentifier.ToString(System.Globalization.CultureInfo.InvariantCulture);

			//
			// default values
			//
			m_disabledTypes = NetIncomingMessageType.ConnectionApproval | NetIncomingMessageType.UnconnectedData | NetIncomingMessageType.VerboseDebugMessage | NetIncomingMessageType.ConnectionLatencyUpdated;
			m_networkThreadName = "Lidgren network thread";
			m_localAddress = IPAddress.Any;
			m_broadcastAddress = IPAddress.Broadcast;
			var ip = NetUtility.GetBroadcastAddress();
			if (ip != null)
			{
				m_broadcastAddress = ip;
			}
			m_port = 0;
			m_receiveBufferSize = 131071;
			m_sendBufferSize = 131071;
			m_acceptIncomingConnections = false;
			m_maximumConnections = 32;
			m_defaultOutgoingMessageCapacity = 16;
			m_pingInterval = 4.0f;
			m_connectionTimeout = 25.0f;
			m_useMessageRecycling = true;
			m_resendHandshakeInterval = 3.0f;
			m_maximumHandshakeAttempts = 5;
			m_autoFlushSendQueue = true;

			// Maximum transmission unit
			// Ethernet can take 1500 bytes of payload, so lets stay below that.
			// The aim is for a max full packet to be 1440 bytes (30 x 48 bytes, lower than 1468)
			// -20 bytes IP header
			//  -8 bytes UDP header
			//  -4 bytes to be on the safe side and align to 8-byte boundary
			// Total 1408 bytes
			// Note that lidgren headers (5 bytes) are not included here; since it's part of the "mtu payload"
			m_maximumTransmissionUnit = 1408;
			m_autoExpandMTU = false;
			m_expandMTUFrequency = 2.0f;
			m_expandMTUFailAttempts = 5;

			m_loss = 0.0f;
			m_minimumOneWayLatency = 0.0f;
			m_randomOneWayLatency = 0.0f;
			m_duplicates = 0.0f;

			m_isLocked = false;
		}
开发者ID:RedSkotina,项目名称:ss13remake,代码行数:54,代码来源:NetPeerConfiguration.cs

示例4: NetIncomingMessage

 internal NetIncomingMessage(NetIncomingMessageType tp)
 {
     m_incomingMessageType = tp;
 }
开发者ID:AyyTee,项目名称:Aventyr,代码行数:4,代码来源:NetIncomingMessage.cs

示例5: NetPeerConfiguration

        /// <summary>
        /// NetPeerConfiguration constructor
        /// </summary>
        public NetPeerConfiguration(string appIdentifier)
        {
            if (string.IsNullOrEmpty(appIdentifier))
                throw new NetException("App identifier must be at least one character long");
            m_appIdentifier = appIdentifier.ToString(System.Globalization.CultureInfo.InvariantCulture);

            //
            // default values
            //
            m_disabledTypes = NetIncomingMessageType.ConnectionApproval | NetIncomingMessageType.UnconnectedData | NetIncomingMessageType.VerboseDebugMessage | NetIncomingMessageType.ConnectionLatencyUpdated | NetIncomingMessageType.NatIntroductionSuccess;
            m_networkThreadName = "Lidgren network thread";
            m_localAddress = IPAddress.Any;
            m_broadcastAddress = IPAddress.Broadcast;
            var ip = NetUtility.GetBroadcastAddress();
            if (ip != null)
            {
                m_broadcastAddress = ip;
            }
            m_port = 0;
            m_receiveBufferSize = 131071;
            m_sendBufferSize = 131071;
            m_acceptIncomingConnections = false;
            m_maximumConnections = 32;
            m_defaultOutgoingMessageCapacity = 16;
            m_pingInterval = 4.0f;
            m_connectionTimeout = 25.0f;
            m_useMessageRecycling = true;
            m_resendHandshakeInterval = 3.0f;
            m_maximumHandshakeAttempts = 5;
            m_autoFlushSendQueue = true;

            m_maximumTransmissionUnit = kDefaultMTU;
            m_autoExpandMTU = false;
            m_expandMTUFrequency = 2.0f;
            m_expandMTUFailAttempts = 5;

            m_loss = 0.0f;
            m_minimumOneWayLatency = 0.0f;
            m_randomOneWayLatency = 0.0f;
            m_duplicates = 0.0f;

            m_isLocked = false;
        }
开发者ID:JamieH,项目名称:lidgren-network-gen3,代码行数:46,代码来源:NetPeerConfiguration.cs

示例6: SetMessageTypeEnabled

 /// <summary>
 /// Enables or disables receiving of the specified type of message
 /// </summary>
 public void SetMessageTypeEnabled(NetIncomingMessageType type, bool enabled)
 {
     if (enabled)
         m_disabledTypes &= (~type);
     else
         m_disabledTypes |= type;
 }
开发者ID:JamieH,项目名称:lidgren-network-gen3,代码行数:10,代码来源:NetPeerConfiguration.cs

示例7: IsMessageTypeEnabled

 /// <summary>
 /// Gets if receiving of the specified type of message is enabled
 /// </summary>
 public bool IsMessageTypeEnabled(NetIncomingMessageType type)
 {
     return !((m_disabledTypes & type) == type);
 }
开发者ID:JamieH,项目名称:lidgren-network-gen3,代码行数:7,代码来源:NetPeerConfiguration.cs

示例8: EnableMessageType

 /// <summary>
 /// Enables receiving of the specified type of message
 /// </summary>
 public void EnableMessageType(NetIncomingMessageType type)
 {
     m_disabledTypes &= (~type);
 }
开发者ID:JamieH,项目名称:lidgren-network-gen3,代码行数:7,代码来源:NetPeerConfiguration.cs

示例9: DisableMessageType

 /// <summary>
 /// Disables receiving of the specified type of message
 /// </summary>
 public void DisableMessageType(NetIncomingMessageType type)
 {
     m_disabledTypes |= type;
 }
开发者ID:JamieH,项目名称:lidgren-network-gen3,代码行数:7,代码来源:NetPeerConfiguration.cs

示例10: CreateIncomingMessage

		internal NetIncomingMessage CreateIncomingMessage(NetIncomingMessageType tp, byte[] copyFrom, int offset, int copyLength)
		{
			NetIncomingMessage retval;
			if (m_incomingMessagesPool.TryDequeue(out retval))
				retval.Reset();
			else
				retval = new NetIncomingMessage();

			NetException.Assert(retval.m_status == NetIncomingMessageReleaseStatus.NotReleased);

			retval.m_data = GetStorage(copyLength);
			Buffer.BlockCopy(copyFrom, offset, retval.m_data, 0, copyLength);

			retval.m_bitLength = copyLength * 8;
			retval.m_incomingType = tp;
			retval.m_senderConnection = null;
			retval.m_senderEndpoint = null;

			return retval;
		}
开发者ID:AugustoAngeletti,项目名称:blockspaces,代码行数:20,代码来源:NetPeer.Recycling.cs

示例11: CreateIncomingMessage

		/// <summary>
		/// Creates an incoming message with the required capacity for releasing to the application
		/// </summary>
		internal NetIncomingMessage CreateIncomingMessage(NetIncomingMessageType tp, string text)
		{
			NetIncomingMessage retval;
			if (string.IsNullOrEmpty(text))
			{
				retval = CreateIncomingMessage(tp, 1);
				retval.Write(string.Empty);
				return retval;
			}

			int numBytes = System.Text.Encoding.UTF8.GetByteCount(text);
			retval = CreateIncomingMessage(tp, numBytes + (numBytes > 127 ? 2 : 1));
			retval.Write(text);

			return retval;
		}
开发者ID:xxy1991,项目名称:cozy,代码行数:19,代码来源:NetPeer.MessagePools.cs

示例12: UnhandledMessageEventArgs

 public UnhandledMessageEventArgs(NetIncomingMessageType myMessageType, int myLengthBytes)
 {
     messageType = myMessageType;
     lengthBytes = myLengthBytes;
 }
开发者ID:refactoryourmind,项目名称:yapper,代码行数:5,代码来源:C_LidgrenContainer.cs

示例13: CanCreateContext

		public bool CanCreateContext(NetIncomingMessageType messageType)
		{
			return messageType == NetIncomingMessageType.StatusChanged || messageType == NetIncomingMessageType.Data;
		}
开发者ID:HelloKitty,项目名称:GladNet2-Lidgren,代码行数:4,代码来源:LidgrenClientMessageContextFactory.cs


注:本文中的NetIncomingMessageType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。