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


C# PacketReader.ReadUnicodeStringLESafe方法代码示例

本文整理汇总了C#中Server.Network.PacketReader.ReadUnicodeStringLESafe方法的典型用法代码示例。如果您正苦于以下问题:C# PacketReader.ReadUnicodeStringLESafe方法的具体用法?C# PacketReader.ReadUnicodeStringLESafe怎么用?C# PacketReader.ReadUnicodeStringLESafe使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Server.Network.PacketReader的用法示例。


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

示例1: OnReceive

        public static void OnReceive(NetState state, PacketReader pvSrc)
        {
            pvSrc.ReadByte(); // 1: <4.0.1a, 2>=4.0.1a

            HardwareInfo info = new HardwareInfo();

            info.m_InstanceID = pvSrc.ReadInt32();
            info.m_OSMajor = pvSrc.ReadInt32();
            info.m_OSMinor = pvSrc.ReadInt32();
            info.m_OSRevision = pvSrc.ReadInt32();
            info.m_CpuManufacturer = pvSrc.ReadByte();
            info.m_CpuFamily = pvSrc.ReadInt32();
            info.m_CpuModel = pvSrc.ReadInt32();
            info.m_CpuClockSpeed = pvSrc.ReadInt32();
            info.m_CpuQuantity = pvSrc.ReadByte();
            info.m_PhysicalMemory = pvSrc.ReadInt32();
            info.m_ScreenWidth = pvSrc.ReadInt32();
            info.m_ScreenHeight = pvSrc.ReadInt32();
            info.m_ScreenDepth = pvSrc.ReadInt32();
            info.m_DXMajor = pvSrc.ReadInt16();
            info.m_DXMinor = pvSrc.ReadInt16();
            info.m_VCDescription = pvSrc.ReadUnicodeStringLESafe(64);
            info.m_VCVendorID = pvSrc.ReadInt32();
            info.m_VCDeviceID = pvSrc.ReadInt32();
            info.m_VCMemory = pvSrc.ReadInt32();
            info.m_Distribution = pvSrc.ReadByte();
            info.m_ClientsRunning = pvSrc.ReadByte();
            info.m_ClientsInstalled = pvSrc.ReadByte();
            info.m_PartialInstalled = pvSrc.ReadByte();
            info.m_Language = pvSrc.ReadUnicodeStringLESafe(4);
            info.m_Unknown = pvSrc.ReadStringSafe(64);

            info.m_TimeReceived = DateTime.Now;

            Account acct = state.Account as Account;

            if (acct != null)
                acct.HardwareInfo = info;
        }
开发者ID:FreeReign,项目名称:forkuo,代码行数:39,代码来源:HardwareInfo.cs

示例2: UnicodePromptResponse

		public static void UnicodePromptResponse( NetState state, PacketReader pvSrc )
		{
			int serial = pvSrc.ReadInt32();
			int prompt = pvSrc.ReadInt32();
			int type = pvSrc.ReadInt32();
			/*string lang = */pvSrc.ReadString( 4 );
			string text = pvSrc.ReadUnicodeStringLESafe();

			if ( text.Length > 128 )
				return;

			Mobile from = state.Mobile;
			Prompt p = from.Prompt;

			if ( p != null && p.Serial == serial && p.Serial == prompt )
			{
				from.Prompt = null;

				try {
					if ( type == 0 )
						p.OnCancel( from );
					else
						p.OnResponse( from, text );
				} catch (Exception e) {
					log.Fatal(String.Format("Exception disarmed in UnicodePrompt response {0}, type {1}",
											state.Mobile, type), e);
				}
			}
		}
开发者ID:kamronbatman,项目名称:DefianceUO-Pre1.10,代码行数:29,代码来源:PacketHandlers.cs

示例3: UnicodePromptResponse

		public static void UnicodePromptResponse( NetState state, PacketReader pvSrc )
		{
			int serial = pvSrc.ReadInt32();
			int prompt = pvSrc.ReadInt32();
			int type = pvSrc.ReadInt32();
			string lang = pvSrc.ReadString( 4 );
			string text = pvSrc.ReadUnicodeStringLESafe();

			if ( text.Length > 128 )
				return;

			Mobile from = state.Mobile;
			Prompt p = from.Prompt;

			if ( p != null && p.Serial == serial && p.Serial == prompt )
			{
				from.Prompt = null;

				if ( type == 0 )
					p.OnCancel( from );
				else
					p.OnResponse( from, text );
			}
		}
开发者ID:Grimoric,项目名称:RunUO.2.3.r1083,代码行数:24,代码来源:PacketHandlers.cs

示例4: UnicodePromptResponse

        public static void UnicodePromptResponse(NetState state, PacketReader pvSrc)
        {
            Mobile from = state.Mobile;
            Prompt p = from.Prompt;

            int senderSerial = pvSrc.ReadInt32();
            int promptId = pvSrc.ReadInt32();
            int type = pvSrc.ReadInt32();
            /*string lang = */
            pvSrc.ReadString(4);
            string text = pvSrc.ReadUnicodeStringLESafe();

            if (text.Length > 128)
                return;

            int promptSerial = (p != null && p.Sender != null) ? p.Sender.Serial.Value : from.Serial.Value;

            if (p != null && promptSerial == senderSerial && p.TypeId == promptId)
            {
                from.Prompt = null;

                try
                {
                    if (type == 0)
                        p.OnCancel(from);
                    else
                        p.OnResponse(from, text);
                }
                catch (Exception e)
                {
                    Console.WriteLine("Exception disarmed in UnicodePrompt response {0}, type {1}: {2}", state.Mobile, type, e);
                }
            }
        }
开发者ID:zerodowned,项目名称:JustUO-merged-with-EC-Support,代码行数:34,代码来源:PacketHandlers.cs


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