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


C# GSPacketIn.ReadLowEndianShortPascalString方法代码示例

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


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

示例1: HandlePacket

		public void HandlePacket(GameClient client, GSPacketIn packet)
		{
			if (client == null)
				return;

			string ipAddress = client.TcpEndpointAddress;

			byte major;
			byte minor;
			byte build;
			string password;
			string userName;
			
			/// <summary>
			/// Packet Format Change above 1.115
			/// </summary>
			
			if (client.Version < GameClient.eClientVersion.Version1115)
			{
				packet.Skip(2); //Skip the client_type byte
				
				major = (byte)packet.ReadByte();
				minor = (byte)packet.ReadByte();
				build = (byte)packet.ReadByte();
				password = packet.ReadString(20);
				
				
				bool v174;
				//the logger detection we had is no longer working
				//bool loggerUsing = false;
				switch (client.Version)
				{
					case GameClient.eClientVersion.Version168:
					case GameClient.eClientVersion.Version169:
					case GameClient.eClientVersion.Version170:
					case GameClient.eClientVersion.Version171:
					case GameClient.eClientVersion.Version172:
					case GameClient.eClientVersion.Version173:
						v174 = false;
						break;
					default:
						v174 = true;
						break;
				}
	
				if (v174)
				{
					packet.Skip(11);
				}
				else
				{
					packet.Skip(7);
				}
	
				uint c2 = packet.ReadInt();
				uint c3 = packet.ReadInt();
				uint c4 = packet.ReadInt();
	
				if (v174)
				{
					packet.Skip(27);
				}
				else
				{
					packet.Skip(31);
				}
	
				userName = packet.ReadString(20);
			}
			else
			{
				// 1.115c+
				
				// client type
				packet.Skip(1);
				
				//version
				major = (byte)packet.ReadByte();
				minor = (byte)packet.ReadByte();
				build = (byte)packet.ReadByte();
				
				// revision
				packet.Skip(1);
				// build
				packet.Skip(2);
				
				// Read Login
				userName = packet.ReadLowEndianShortPascalString();

				// Read Password
				password = packet.ReadLowEndianShortPascalString();
			}


			
			/*
			if (c2 == 0 && c3 == 0x05000000 && c4 == 0xF4000000)
			{
				loggerUsing = true;
				Log.Warn("logger detected (" + username + ")");
//.........这里部分代码省略.........
开发者ID:dol-leodagan,项目名称:DOLSharp,代码行数:101,代码来源:LoginRequestHandler.cs


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