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


C# Packet.ReadIPAddress方法代码示例

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


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

示例1: HandleVoiceRosterUpdate

        public static void HandleVoiceRosterUpdate(Packet packet)
        {
            packet.ReadGuid("Group GUID");
            packet.ReadInt16("Channel ID");
            packet.ReadByte("Channel Type"); // 0: channel, 2: party
            packet.ReadCString("Channel Name");
            packet.WriteLine("Encryption Key: " + Utilities.ByteArrayToHexString(packet.ReadBytes(16)));
            packet.WriteLine("IP: " + packet.ReadIPAddress());
            packet.ReadInt16("Voice Server Port");

            var count = packet.ReadByte("Player Count");

            packet.ReadGuid("Leader GUID");

            var leaderFlags1 = packet.ReadByte();
            packet.WriteLine("Leader Flags 1: 0x" + leaderFlags1.ToString("X2"));

            var leaderFlags2 = packet.ReadByte();
            packet.WriteLine("Leader Flags 2: 0x" + leaderFlags2.ToString("X2"));

            for (var i = 0; i < count - 1; i++)
            {
                packet.ReadGuid("Player GUID");
                packet.ReadByte("Index");
                var flags1 = packet.ReadByte();
                packet.WriteLine("Flags 1: 0x" + flags1.ToString("X2"));
                var flags2 = packet.ReadByte();
                packet.WriteLine("Flags 2: 0x" + flags2.ToString("X2"));
            }
        }
开发者ID:Nihilianth,项目名称:WowPacketParser,代码行数:30,代码来源:VoiceChatHandler.cs

示例2: HandleVoiceRosterUpdate

        public static void HandleVoiceRosterUpdate(Packet packet)
        {
            packet.ReadGuid("Group GUID");
            packet.ReadInt16("Channel ID");
            packet.ReadByte("Channel Type"); // 0: channel, 2: party
            packet.ReadCString("Channel Name");
            packet.ReadBytes("Encryption Key", 16);
            packet.ReadIPAddress("IP");
            packet.ReadInt16("Voice Server Port");

            var count = packet.ReadByte("Player Count");

            packet.ReadGuid("Leader GUID");

            var leaderFlags1 = packet.ReadByte();
            packet.AddValue("Leader Flags 1", "0x" + leaderFlags1.ToString("X2"));

            var leaderFlags2 = packet.ReadByte();
            packet.AddValue("Leader Flags 2", "0x" + leaderFlags2.ToString("X2"));

            for (var i = 0; i < count - 1; i++)
            {
                packet.ReadGuid("Player GUID");
                packet.ReadByte("Index");
                var flags1 = packet.ReadByte();
                packet.AddValue("Flags 1", "0x" + flags1.ToString("X2"));
                var flags2 = packet.ReadByte();
                packet.AddValue("Flags 2", "0x" + flags2.ToString("X2"));
            }
        }
开发者ID:Oboltys,项目名称:WowPacketParser,代码行数:30,代码来源:VoiceChatHandler.cs

示例3: HandleRedirectClient

 public static void HandleRedirectClient(Packet packet)
 {
     var ip = packet.ReadIPAddress();
     packet.WriteLine("IP Address: {0}", ip);
     packet.ReadUInt16("Port");
     packet.ReadInt32("Token");
     var hash = packet.ReadBytes(20);
     packet.WriteLine("Address SHA-1 Hash: {0}", Utilities.ByteArrayToHexString(hash));
 }
开发者ID:RazorCore,项目名称:WowPacketParser,代码行数:9,代码来源:SessionHandler.cs

示例4: HandleConnectToFailed

 public static void HandleConnectToFailed(Packet packet)
 {
     packet.WriteLine("IP Address: {0}", packet.ReadIPAddress());
     packet.ReadByte("Reason?");
 }
开发者ID:RazorCore,项目名称:WowPacketParser,代码行数:5,代码来源:SessionHandler.cs

示例5: HandleRedirectClient

 public static void HandleRedirectClient(Packet packet)
 {
     packet.ReadIPAddress("IP Address");
     packet.ReadUInt16("Port");
     packet.ReadInt32("Token");
     packet.ReadBytes("Address SHA-1 Hash", 20);
 }
开发者ID:Oboltys,项目名称:WowPacketParser,代码行数:7,代码来源:SessionHandler.cs

示例6: HandleRedirectClient

        public static void HandleRedirectClient(Packet packet)
        {
            var ip = packet.ReadIPAddress();
            packet.Writer.WriteLine("IP Address: " + ip);

            var port = packet.ReadUInt16();
            packet.Writer.WriteLine("Port: " + port);

            var unk = packet.ReadInt32();
            packet.Writer.WriteLine("Token: " + unk);

            var hash = packet.ReadBytes(20);
            packet.Writer.WriteLine("Address SHA-1 Hash: " + Utilities.ByteArrayToHexString(hash));
        }
开发者ID:CarlosX,项目名称:WowPacketParser,代码行数:14,代码来源:SessionHandler.cs


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