本文整理汇总了C#中ClientVersionBuild类的典型用法代码示例。如果您正苦于以下问题:C# ClientVersionBuild类的具体用法?C# ClientVersionBuild怎么用?C# ClientVersionBuild使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ClientVersionBuild类属于命名空间,在下文中一共展示了ClientVersionBuild类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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();
}
示例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
}
示例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;
}
}
示例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;
}
示例7: HotfixVersionAttribute
public HotfixVersionAttribute(ClientVersionBuild build, bool removedInVersion)
{
Build = build;
RemovedInVersion = removedInVersion;
}
示例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:
{
//.........这里部分代码省略.........
示例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;
}
示例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();
}
}
}
示例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;
}
示例12: GetOpcode
public static int GetOpcode(Opcode opcode, ClientVersionBuild versionBuild)
{
int opcodeId;
GetOpcodeDictionary(versionBuild).TryGetValue(opcode, out opcodeId);
return opcodeId;
}
示例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);
}
}
示例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:
//.........这里部分代码省略.........
示例15: InVersion
public static bool InVersion(ClientVersionBuild build1, ClientVersionBuild build2)
{
return AddedInVersion(build1) && RemovedInVersion(build2);
}