• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ClientVersionBuild类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: ParserAttribute

 // [addedInVersion, removedInVersion[
 public ParserAttribute(int opcode, ClientVersionBuild addedInVersion, ClientVersionBuild removedInVersion)
 {
     if (ClientVersion.AddedInVersion(addedInVersion) && ClientVersion.RemovedInVersion(removedInVersion))
         Opcode = opcode;
     else
         Opcode = 0;
 }
开发者ID:RazorCore,项目名称:WowPacketParser,代码行数:8,代码来源:ParserAttribute.cs


示例2: ParserAttribute

 // [addedInVersion, removedInVersion[
 public ParserAttribute(Opcode opcode, ClientVersionBuild addedInVersion, ClientVersionBuild removedInVersion)
 {
     if (ClientVersion.AddedInVersion(addedInVersion) && ClientVersion.RemovedInVersion(removedInVersion))
         Opcode = Opcodes.GetOpcode(opcode);
     else
         Opcode = 0;
 }
开发者ID:kandera,项目名称:WowPacketParser,代码行数:8,代码来源:ParserAttribute.cs


示例3: GetOpcodeName

        public static string GetOpcodeName(int opcodeId, ClientVersionBuild versionBuild)
        {
            foreach (var pair in GetOpcodeDictionary(versionBuild))
                if (pair.Value == opcodeId)
                    return pair.Key.ToString();

            return opcodeId.ToString();
        }
开发者ID:Supabad,项目名称:WowPacketParser,代码行数:8,代码来源:Opcodes.cs


示例4: GetOpcodeDictionary

 private static Dictionary<Opcode, int> GetOpcodeDictionary(ClientVersionBuild versionBuild)
 {
     switch (versionBuild)
     {
         case ClientVersionBuild.V2_4_3_8606:
         case ClientVersionBuild.V3_0_2_9056:
         case ClientVersionBuild.V3_0_3_9183:
         case ClientVersionBuild.V3_0_8_9464:
         case ClientVersionBuild.V3_0_8a_9506:
         case ClientVersionBuild.V3_0_9_9551:
         case ClientVersionBuild.V3_1_0_9767:
         case ClientVersionBuild.V3_1_1_9806:
         case ClientVersionBuild.V3_1_1a_9835:
         case ClientVersionBuild.V3_1_2_9901:
         case ClientVersionBuild.V3_1_3_9947:
         case ClientVersionBuild.V3_2_0_10192:
         case ClientVersionBuild.V3_2_0a_10314:
         case ClientVersionBuild.V3_2_2_10482:
         case ClientVersionBuild.V3_2_2a_10505:
         case ClientVersionBuild.V3_3_0_10958:
         case ClientVersionBuild.V3_3_0a_11159:
         case ClientVersionBuild.V3_3_3_11685:
         case ClientVersionBuild.V3_3_5a_12340:
         {
             return _V3_3_5_opcodes;
         }
         case ClientVersionBuild.V4_0_3_13329:
         {
             return _V4_0_3_opcodes;
         }
         case ClientVersionBuild.V4_0_6_13596:
         case ClientVersionBuild.V4_0_6a_13623:
         {
             return _V4_0_6_opcodes;
         }
         case ClientVersionBuild.V4_1_0_13914:
         case ClientVersionBuild.V4_1_0a_14007:
         {
             return _V4_1_0_opcodes;
         }
         case ClientVersionBuild.V4_2_0_14333:
         case ClientVersionBuild.V4_2_0a_14480:
         {
             return _V4_2_0_opcodes;
         }
         case ClientVersionBuild.V4_2_2_14545:
         {
             return _V4_2_2_opcodes;
         }
     }
     return _V3_3_5_opcodes; // Default case, should pick a better one
 }
开发者ID:Supabad,项目名称:WowPacketParser,代码行数:52,代码来源:Opcodes.cs


示例5: DBFieldNameAttribute

 /// <summary>
 /// [addedInVersion, removedInVersion[
 /// </summary>
 /// <param name="name">database field name</param>
 /// <param name="addedInVersion">initial version</param>
 /// <param name="removedInVersion">final version</param>
 public DBFieldNameAttribute(string name, ClientVersionBuild addedInVersion, ClientVersionBuild removedInVersion)
 {
     if (ClientVersion.AddedInVersion(addedInVersion) && ClientVersion.RemovedInVersion(removedInVersion))
     {
         Name = name;
         Count = 1;
     }
     else
     {
         Name = null;
         Count = 0;
     }
 }
开发者ID:Oboltys,项目名称:WowPacketParser,代码行数:19,代码来源:DBFieldNameAttribute.cs


示例6: GetOpcode

        private static Opcode GetOpcode(int opcodeId, ClientVersionBuild build)
        {
            /* Remove this comment block if you need to find duplicated opcode
             * values in the opcode dictionaries.
             * This is not enabled by default because it is slow as sh*t.
             *
            var dict = GetOpcodeDictionary(build);
            var newDict = new Dictionary<Opcode, int>();
            foreach (var pair in dict)
            {
                if (newDict.ContainsKey(pair.Key) || newDict.ContainsValue(pair.Value))
                    throw new Exception(string.Format("Opcode dictionary got duplicated key ({0}) or value ({1}).",
                                                      pair.Key, pair.Value));
                newDict.Add(pair.Key, pair.Value);
            }*/

            foreach (var pair in GetOpcodeDictionary(build).Where(pair => pair.Value == opcodeId))
                return pair.Key;

            return (Opcode)opcodeId;
        }
开发者ID:hodobaj,项目名称:StrawberryTools,代码行数:21,代码来源:Opcodes.cs


示例7: HotfixVersionAttribute

 public HotfixVersionAttribute(ClientVersionBuild build, bool removedInVersion)
 {
     Build = build;
     RemovedInVersion = removedInVersion;
 }
开发者ID:TrinityCore,项目名称:WowPacketParser,代码行数:5,代码来源:HotfixStructureAttribute.cs


示例8: GetOpcodeDictionary

 public static BiDictionary<Opcode, int> GetOpcodeDictionary(ClientVersionBuild build, Direction direction)
 {
     switch (build)
     {
         case ClientVersionBuild.V1_12_1_5875:
         case ClientVersionBuild.V2_0_1_6180:
         case ClientVersionBuild.V2_0_3_6299:
         case ClientVersionBuild.V2_0_6_6337:
         case ClientVersionBuild.V2_1_0_6692:
         case ClientVersionBuild.V2_1_1_6739:
         case ClientVersionBuild.V2_1_2_6803:
         case ClientVersionBuild.V2_1_3_6898:
         case ClientVersionBuild.V2_2_0_7272:
         case ClientVersionBuild.V2_2_2_7318:
         case ClientVersionBuild.V2_2_3_7359:
         case ClientVersionBuild.V2_3_0_7561:
         case ClientVersionBuild.V2_3_2_7741:
         case ClientVersionBuild.V2_3_3_7799:
         case ClientVersionBuild.V2_4_0_8089:
         case ClientVersionBuild.V2_4_1_8125:
         case ClientVersionBuild.V2_4_2_8209:
         case ClientVersionBuild.V2_4_3_8606:
         case ClientVersionBuild.V3_0_2_9056:
         case ClientVersionBuild.V3_0_3_9183:
         case ClientVersionBuild.V3_0_8_9464:
         case ClientVersionBuild.V3_0_8a_9506:
         case ClientVersionBuild.V3_0_9_9551:
         case ClientVersionBuild.V3_1_0_9767:
         case ClientVersionBuild.V3_1_1_9806:
         case ClientVersionBuild.V3_1_1a_9835:
         case ClientVersionBuild.V3_1_2_9901:
         case ClientVersionBuild.V3_1_3_9947:
         case ClientVersionBuild.V3_2_0_10192:
         case ClientVersionBuild.V3_2_0a_10314:
         case ClientVersionBuild.V3_2_2_10482:
         case ClientVersionBuild.V3_2_2a_10505:
         case ClientVersionBuild.V3_3_0_10958:
         case ClientVersionBuild.V3_3_0a_11159:
         case ClientVersionBuild.V3_3_3_11685:
         case ClientVersionBuild.V3_3_3a_11723:
         case ClientVersionBuild.V3_3_5_12213:
         case ClientVersionBuild.V3_3_5a_12340:
         {
             return Opcodes_3_3_5.Opcodes(direction);
         }
         case ClientVersionBuild.V4_0_1_13164:
         case ClientVersionBuild.V4_0_1a_13205:
         case ClientVersionBuild.V4_0_3_13329:
         {
             return Opcodes_4_0_3.Opcodes(direction);
         }
         case ClientVersionBuild.V4_0_6_13596:
         case ClientVersionBuild.V4_0_6a_13623:
         {
             return Opcodes_4_0_6.Opcodes(direction);
         }
         case ClientVersionBuild.V4_1_0_13914:
         case ClientVersionBuild.V4_1_0a_14007:
         {
             return Opcodes_4_1_0.Opcodes(direction);
         }
         case ClientVersionBuild.V4_2_0_14333:
         case ClientVersionBuild.V4_2_0a_14480:
         {
             return Opcodes_4_2_0.Opcodes(direction);
         }
         case ClientVersionBuild.V4_2_2_14545:
         {
             return Opcodes_4_2_2.Opcodes(direction);
         }
         case ClientVersionBuild.V4_3_0_15005:
         case ClientVersionBuild.V4_3_0a_15050:
         {
             return Opcodes_4_3_0.Opcodes(direction);
         }
         case ClientVersionBuild.V4_3_2_15211:
         {
             return Opcodes_4_3_2.Opcodes(direction);
         }
         case ClientVersionBuild.V4_3_3_15354:
         {
             return Opcodes_4_3_3.Opcodes(direction);
         }
         case ClientVersionBuild.V4_3_4_15595:
         {
             return Opcodes_4_3_4.Opcodes(direction);
         }
         case ClientVersionBuild.V5_0_4_16016:
         {
             return Opcodes_5_0_4.Opcodes(direction);
         }
         case ClientVersionBuild.V5_0_5_16048:
         case ClientVersionBuild.V5_0_5a_16057:
         case ClientVersionBuild.V5_0_5b_16135:
         {
             return Opcodes_5_0_5.Opcodes(direction);
         }
         case ClientVersionBuild.V5_1_0_16309:
         case ClientVersionBuild.V5_1_0a_16357:
         {
//.........这里部分代码省略.........
开发者ID:ChipLeo,项目名称:WowPacketParser,代码行数:101,代码来源:Opcodes.cs


示例9: GetExpansion

 private static ClientType GetExpansion(ClientVersionBuild build)
 {
     if (build >= ClientVersionBuild.V4_0_3_13329)
         return ClientType.Cataclysm;
     else if (build >= ClientVersionBuild.V3_0_3_9183)
         return ClientType.WrathOfTheLichKing;
     else if (build >= ClientVersionBuild.V2_0_3_6299)
         return ClientType.TheBurningCrusade;
     else
         return ClientType.WorldOfWarcraft;
 }
开发者ID:CarlosX,项目名称:WowPacketParser,代码行数:11,代码来源:ClientVersion.cs


示例10: GetOpcodeDictionary

 private static BiDictionary<Opcode, int> GetOpcodeDictionary(ClientVersionBuild build)
 {
     switch (build)
     {
         case ClientVersionBuild.V2_4_3_8606:
         case ClientVersionBuild.V3_0_2_9056:
         case ClientVersionBuild.V3_0_3_9183:
         case ClientVersionBuild.V3_0_8_9464:
         case ClientVersionBuild.V3_0_8a_9506:
         case ClientVersionBuild.V3_0_9_9551:
         case ClientVersionBuild.V3_1_0_9767:
         case ClientVersionBuild.V3_1_1_9806:
         case ClientVersionBuild.V3_1_1a_9835:
         case ClientVersionBuild.V3_1_2_9901:
         case ClientVersionBuild.V3_1_3_9947:
         case ClientVersionBuild.V3_2_0_10192:
         case ClientVersionBuild.V3_2_0a_10314:
         case ClientVersionBuild.V3_2_2_10482:
         case ClientVersionBuild.V3_2_2a_10505:
         case ClientVersionBuild.V3_3_0_10958:
         case ClientVersionBuild.V3_3_0a_11159:
         case ClientVersionBuild.V3_3_3_11685:
         case ClientVersionBuild.V3_3_3a_11723:
         case ClientVersionBuild.V3_3_5a_12340:
         {
             return Opcodes_3_3_5.Opcodes();
         }
         case ClientVersionBuild.V4_0_3_13329:
         {
             return Opcodes_4_0_3.Opcodes();
         }
         case ClientVersionBuild.V4_0_6_13596:
         case ClientVersionBuild.V4_0_6a_13623:
         {
             return Opcodes_4_0_6.Opcodes();
         }
         case ClientVersionBuild.V4_1_0_13914:
         case ClientVersionBuild.V4_1_0a_14007:
         {
             return Opcodes_4_1_0.Opcodes();
         }
         case ClientVersionBuild.V4_2_0_14333:
         case ClientVersionBuild.V4_2_0a_14480:
         {
             return Opcodes_4_2_0.Opcodes();
         }
         case ClientVersionBuild.V4_2_2_14545:
         {
             return Opcodes_4_2_2.Opcodes();
         }
         case ClientVersionBuild.V4_3_0_15005:
         case ClientVersionBuild.V4_3_0_15050:
         {
             return Opcodes_4_3_0.Opcodes();
         }
         case ClientVersionBuild.V4_3_2_15211:
         {
             return Opcodes_4_3_2.Opcodes();
         }
         case ClientVersionBuild.V4_3_3_15354:
         {
             return Opcodes_4_3_3.Opcodes();
         }
         case ClientVersionBuild.V4_3_4_15595:
         {
             return Opcodes_4_3_4.Opcodes();
         }
         default:
         {
             return Opcodes_3_3_5.Opcodes();
         }
     }
 }
开发者ID:kandera,项目名称:WowPacketParser,代码行数:73,代码来源:Opcodes.cs


示例11: GetExpansion

        private static ClientType GetExpansion(ClientVersionBuild build)
        {
            if (build >= ClientVersionBuild.V5_0_4_16016)
                return ClientType.MistsOfPandaria;
            if (build >= ClientVersionBuild.V4_0_3_13329)
                return ClientType.Cataclysm;
            if (build >= ClientVersionBuild.V3_0_3_9183)
                return ClientType.WrathOfTheLichKing;
            if (build >= ClientVersionBuild.V2_0_3_6299)
                return ClientType.TheBurningCrusade;

            return ClientType.WorldOfWarcraft;
        }
开发者ID:Walkum,项目名称:WowPacketParser_Skyfire,代码行数:13,代码来源:ClientVersion.cs


示例12: GetOpcode

 public static int GetOpcode(Opcode opcode, ClientVersionBuild versionBuild)
 {
     int opcodeId;
     GetOpcodeDictionary(versionBuild).TryGetValue(opcode, out opcodeId);
     return opcodeId;
 }
开发者ID:Supabad,项目名称:WowPacketParser,代码行数:6,代码来源:Opcodes.cs


示例13: SetVersion

        public static void SetVersion(ClientVersionBuild version)
        {
            if (Build == version)
                return;

            Build = version;
            _expansion = GetExpansion(version);

            Opcodes.InitializeOpcodeDictionary();
            Handler.ResetHandlers();
            UpdateFields.ResetUFDictionaries();
            try
            {
                var asm = Assembly.Load($"WowPacketParserModule.{VersionDefiningBuild}");
                Trace.WriteLine($"Loading module WowPacketParserModule.{VersionDefiningBuild}.dll");

                Handler.LoadHandlers(asm, VersionDefiningBuild);

                // This is a huge hack to handle the abnormal situation that appeared with builds 6.0 and 6.1 having mostly the same packet structures
                if (!UpdateFields.LoadUFDictionaries(asm, version))
                    UpdateFields.LoadUFDictionaries(asm, VersionDefiningBuild);
            }
            catch (FileNotFoundException)
            {
                // No dll found, try to load the data in the executable itself
                UpdateFields.LoadUFDictionaries(Assembly.GetExecutingAssembly(), Build);
            }
        }
开发者ID:cmsimike,项目名称:WowPacketParser,代码行数:28,代码来源:ClientVersion.cs


示例14: GetOpcodeDictionary

 public static BiDictionary<Opcode, int> GetOpcodeDictionary(ClientVersionBuild build, Direction direction)
 {
     switch (build)
     {
         case ClientVersionBuild.V2_4_3_8606:
         case ClientVersionBuild.V3_0_2_9056:
         case ClientVersionBuild.V3_0_3_9183:
         case ClientVersionBuild.V3_0_8_9464:
         case ClientVersionBuild.V3_0_8a_9506:
         case ClientVersionBuild.V3_0_9_9551:
         case ClientVersionBuild.V3_1_0_9767:
         case ClientVersionBuild.V3_1_1_9806:
         case ClientVersionBuild.V3_1_1a_9835:
         case ClientVersionBuild.V3_1_2_9901:
         case ClientVersionBuild.V3_1_3_9947:
         case ClientVersionBuild.V3_2_0_10192:
         case ClientVersionBuild.V3_2_0a_10314:
         case ClientVersionBuild.V3_2_2_10482:
         case ClientVersionBuild.V3_2_2a_10505:
         case ClientVersionBuild.V3_3_0_10958:
         case ClientVersionBuild.V3_3_0a_11159:
         case ClientVersionBuild.V3_3_3_11685:
         case ClientVersionBuild.V3_3_3a_11723:
         case ClientVersionBuild.V3_3_5a_12340:
         {
             return Opcodes_3_3_5.Opcodes(direction);
         }
         case ClientVersionBuild.V4_0_3_13329:
         {
             return Opcodes_4_0_3.Opcodes(direction);
         }
         case ClientVersionBuild.V4_0_6_13596:
         case ClientVersionBuild.V4_0_6a_13623:
         {
             return Opcodes_4_0_6.Opcodes(direction);
         }
         case ClientVersionBuild.V4_1_0_13914:
         case ClientVersionBuild.V4_1_0a_14007:
         {
             return Opcodes_4_1_0.Opcodes(direction);
         }
         case ClientVersionBuild.V4_2_0_14333:
         case ClientVersionBuild.V4_2_0a_14480:
         {
             return Opcodes_4_2_0.Opcodes(direction);
         }
         case ClientVersionBuild.V4_2_2_14545:
         {
             return Opcodes_4_2_2.Opcodes(direction);
         }
         case ClientVersionBuild.V4_3_0_15005:
         case ClientVersionBuild.V4_3_0a_15050:
         {
             return Opcodes_4_3_0.Opcodes(direction);
         }
         case ClientVersionBuild.V4_3_2_15211:
         {
             return Opcodes_4_3_2.Opcodes(direction);
         }
         case ClientVersionBuild.V4_3_3_15354:
         {
             return Opcodes_4_3_3.Opcodes(direction);
         }
         case ClientVersionBuild.V4_3_4_15595:
         {
             return Opcodes_4_3_4.Opcodes(direction);
         }
         case ClientVersionBuild.V5_0_4_16016:
         {
             return Opcodes_5_0_4.Opcodes(direction);
         }
         case ClientVersionBuild.V5_0_5_16048:
         case ClientVersionBuild.V5_0_5a_16057:
         case ClientVersionBuild.V5_0_5b_16135:
         {
             return Opcodes_5_0_5.Opcodes(direction);
         }
         case ClientVersionBuild.V5_1_0_16309:
         case ClientVersionBuild.V5_1_0a_16357:
         {
             return Opcodes_5_1_0.Opcodes(direction);
         }
         case ClientVersionBuild.V5_2_0_16650:
         case ClientVersionBuild.V5_2_0_16669:
         case ClientVersionBuild.V5_2_0_16683:
         case ClientVersionBuild.V5_2_0_16685:
         case ClientVersionBuild.V5_2_0_16701:
         case ClientVersionBuild.V5_2_0_16709:
         case ClientVersionBuild.V5_2_0_16716:
         case ClientVersionBuild.V5_2_0_16733:
         case ClientVersionBuild.V5_2_0_16769:
         case ClientVersionBuild.V5_2_0_16826:
         {
             return Opcodes_5_2_0.Opcodes(direction);
         }
         case ClientVersionBuild.V5_3_0_16981:
         case ClientVersionBuild.V5_3_0_16983:
         case ClientVersionBuild.V5_3_0_16992:
         case ClientVersionBuild.V5_3_0_17055:
         case ClientVersionBuild.V5_3_0_17116:
//.........这里部分代码省略.........
开发者ID:Gooyeth,项目名称:WowPacketParser,代码行数:101,代码来源:Opcodes.cs


示例15: InVersion

 public static bool InVersion(ClientVersionBuild build1, ClientVersionBuild build2)
 {
     return AddedInVersion(build1) && RemovedInVersion(build2);
 }
开发者ID:DrEhsan,项目名称:WowPacketParser,代码行数:4,代码来源:ClientVersion.cs


示例16: LoadHandlersInto

        private static void LoadHandlersInto(Dictionary<KeyValuePair<ClientVersionBuild, Opcode>, Action<Packet>> handlers, Assembly asm, ClientVersionBuild build)
        {
            var types = asm.GetTypes();
            foreach (var type in types)
            {
                //if (type.Namespace != "WowPacketParser.Parsing.Parsers")
                //    continue;

                if (!type.IsAbstract)
                    continue;

                if (!type.IsPublic)
                    continue;

                var methods = type.GetMethods();

                foreach (var method in methods)
                {
                    if (!method.IsPublic)
                        continue;

                    var attrs = (ParserAttribute[])method.GetCustomAttributes(typeof(ParserAttribute), false);

                    if (attrs.Length <= 0)
                        continue;

                    var parms = method.GetParameters();

                    if (parms.Length <= 0)
                        continue;

                    if (parms[0].ParameterType != typeof(Packet))
                        continue;

                    foreach (var attr in attrs)
                    {
                        var opc = attr.Opcode;
                        if (opc == Opcode.NULL_OPCODE)
                            continue;

                        var key = new KeyValuePair<ClientVersionBuild, Opcode>(build, opc);

                        var del = (Action<Packet>)Delegate.CreateDelegate(typeof(Action<Packet>), method);

                        if (handlers.ContainsKey(key))
                        {
                            Trace.WriteLine(string.Format("Error: (Build: {0}) tried to overwrite delegate for opcode {1} ({2}); new handler: {3}; old handler: {4}",
                                ClientVersion.Build, Opcodes.GetOpcode(attr.Opcode), attr.Opcode, del.Method, handlers[key].Method));
                            continue;
                        }

                        handlers[key] = del;
                    }
                }
            }
        }
开发者ID:DDuarte,项目名称:WowPacketParser,代码行数:56,代码来源:Handler.cs


示例17: RemovedInVersion

 public static bool RemovedInVersion(ClientVersionBuild build)
 {
     return _build < build;
 }
开发者ID:CarlosX,项目名称:WowPacketParser,代码行数:4,代码来源:ClientVersion.cs


示例18: LoadHandlersInto

        private static void LoadHandlersInto(Dictionary<KeyValuePair<ClientVersionBuild, Opcode>, Action<Packet>> handlers, Assembly asm, ClientVersionBuild build)
        {
            var types = asm.GetTypes();
            foreach (Type type in types)
            {
                //if (type.Namespace != "WowPacketParser.Parsing.Parsers")
                //    continue;

                if (!type.IsAbstract)
                    continue;

                if (!type.IsPublic)
                    continue;

                var methods = type.GetMethods();

                foreach (MethodInfo method in methods)
                {
                    if (!method.IsPublic)
                        continue;

                    var attrs = (ParserAttribute[])method.GetCustomAttributes(typeof(ParserAttribute), false);

                    if (attrs.Length <= 0)
                        continue;

                    var parms = method.GetParameters();

                    if (parms.Length <= 0)
                        continue;

                    if (parms[0].ParameterType != typeof(Packet))
                        continue;

                    foreach (ParserAttribute attr in attrs)
                    {
                        Opcode opc = attr.Opcode;
                        if (opc == Opcode.NULL_OPCODE)
                            continue;

                        var key = new KeyValuePair<ClientVersionBuild, Opcode>(build, opc);

                        var del = (Action<Packet>)Delegate.CreateDelegate(typeof(Action<Packet>), method);

                        if (handlers.ContainsKey(key))
                        {
                            // @TODO This is a hack to keep things easy regarding declaration of opcodes.
                            // Ideally, we would split the opcodes into three different enums:
                            // ClientOpcodes, ServerOpcodes, BidirectionalOpcodes
                            // The first two are obvious as to what they would contain.
                            // The last one would be MSG_, UMSG_, TEST_, etc... opcodes
                            // However that's just too much pain to do considering the mess Blizzard does
                            // by naming their opcodes sometimes without following their own rules.
                            Direction direction = attr.Opcode.ToString()[0] == 'S' ? Direction.ServerToClient : Direction.ClientToServer;
                            // ReSharper disable once UseStringInterpolation
                            Trace.WriteLine(string.Format("Error: (Build: {0}) tried to overwrite delegate for opcode {1} ({2}); new handler: {3}; old handler: {4}",
                                ClientVersion.Build, Opcodes.GetOpcode(attr.Opcode, direction), attr.Opcode, del.Method, handlers[key].Method));
                            continue;
                        }

                        handlers[key] = del;
                    }
                }
            }
        }
开发者ID:horn,项目名称:WowPacketParser,代码行数:65,代码来源:Handler.cs


示例19: LoadHandlers

 public static void LoadHandlers(Assembly asm, ClientVersionBuild build)
 {
     LoadHandlersInto(VersionHandlers, asm, build);
 }
开发者ID:DDuarte,项目名称:WowPacketParser,代码行数:4,代码来源:Handler.cs


示例20: SetVersion

        public static void SetVersion(ClientVersionBuild version)
        {
            if (Build == version)
                return;

            Build = version;
            _expansion = GetExpansion(version);

            Opcodes.InitializeOpcodeDictionary();
            Handler.ResetHandlers();
            UpdateFields.ResetUFDictionaries();
            try
            {
                var asm = Assembly.LoadFrom(string.Format(AppDomain.CurrentDomain.BaseDirectory + "/" + "WowPacketParserModule.{0}.dll", ClientVersion.VersionDefiningBuild));
                Trace.WriteLine(string.Format("Loading module WowPacketParserModule.{0}.dll", ClientVersion.VersionDefiningBuild));
                Handler.LoadHandlers(asm, ClientVersion.VersionDefiningBuild);
                UpdateFields.LoadUFDictionaries(asm, ClientVersion.VersionDefiningBuild);
            }
            catch (FileNotFoundException)
            {
                // No dll found, try to load the data in the executable itself
                UpdateFields.LoadUFDictionaries(Assembly.GetExecutingAssembly(), ClientVersion.Build);
            }
        }
开发者ID:Walkum,项目名称:WowPacketParser_Skyfire,代码行数:24,代码来源:ClientVersion.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Cliente类代码示例发布时间:2022-05-24
下一篇:
C# ClientType类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap