本文整理汇总了C#中Parser.ReadByte方法的典型用法代码示例。如果您正苦于以下问题:C# Parser.ReadByte方法的具体用法?C# Parser.ReadByte怎么用?C# Parser.ReadByte使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Parser
的用法示例。
在下文中一共展示了Parser.ReadByte方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Characteristics
public void Characteristics(Parser packet)
{
packet.ReadByte("Skin");
packet.ReadByte("Face");
packet.ReadByte("HairColor");
packet.ReadByte("Hair Style");
packet.ReadByte("Facial Hair");
}
示例2: HandleFriendStatus
public void HandleFriendStatus(Parser packet)
{
var result = (ContactResult)packet.ReadByte();
WriteLine("Result: " + result);
var guid = packet.ReadGuid();
WriteLine("GUID: " + guid);
switch (result)
{
case ContactResult.FriendAddedOnline:
case ContactResult.FriendAddedOffline:
case ContactResult.Online:
{
if (result != ContactResult.Online)
{
var note = packet.ReadCString();
WriteLine("Note: " + note);
}
ReadSingleContactBlock(packet, false);
break;
}
}
}
示例3: HandlePlayerChangeDifficulty
public void HandlePlayerChangeDifficulty(Parser packet)
{
var type = (DifficultyChangeType)packet.ReadInt32();
WriteLine("Change Type: " + type);
switch (type)
{
case DifficultyChangeType.PlayerDifficulty1:
{
var difficulty = packet.ReadByte();
WriteLine("Player Difficulty: " + difficulty);
break;
}
case DifficultyChangeType.SpellDuration:
{
var duration = packet.ReadInt32();
WriteLine("Spell Duration: " + duration);
break;
}
case DifficultyChangeType.Time:
{
var time = packet.ReadInt32();
WriteLine("Time: " + time);
break;
}
case DifficultyChangeType.MapDifficulty:
{
var difficulty = (MapDifficulty)packet.ReadInt32();
WriteLine("Map Difficulty: " + difficulty);
break;
}
}
}
示例4: HandleSetTalkerMuted
public void HandleSetTalkerMuted(Parser packet)
{
var guid = packet.ReadGuid();
WriteLine("GUID: " + guid);
var unk = packet.ReadByte();
WriteLine("Unk Byte: " + unk);
}
示例5: HandleGossipMenu
public void HandleGossipMenu(Parser packet)
{
packet.ReadInt64("Guid: ");
packet.ReadCString("Gossip Text: ");
packet.ReadInt32("Unk: ");
packet.ReadInt32("Unk: ");
var QuestAmount = packet.ReadByte();
WriteLine("Quest Amount: " + QuestAmount);
for (int i = 0; i < QuestAmount; i++)
{
packet.ReadInt32("Quest ID: " + i);
packet.ReadInt32("Unknown: " + i);
packet.ReadInt32("Unknown: " + i);
packet.ReadInt32("Unknown: " + i);
packet.ReadByte("Unknown: " + i);
packet.ReadCString("Quest Title: " + i);
}
}
示例6: ReadSingleContactBlock
public void ReadSingleContactBlock(Parser packet, bool onlineCheck)
{
var status = (ContactStatus)packet.ReadByte();
WriteLine("Status: " + status);
if (onlineCheck && status != ContactStatus.Online)
return;
UInt32("AreaID");
UInt32("Level");
var clss = (Class)packet.ReadInt32();
WriteLine("Class: " + clss);
}
示例7: HandleInitializeFactions
public void HandleInitializeFactions(Parser packet)
{
var flags = packet.ReadInt32();
WriteLine("Flags: 0x" + flags.ToString("X8"));
for (var i = 0; i < 128; i++)
{
var sFlags = (FactionFlag)packet.ReadByte();
WriteLine("Faction Flags " + i + ": " + sFlags);
var sStand = packet.ReadInt32();
WriteLine("Faction Standing " + i + ": " + sStand);
}
}
示例8: HandleAvailableVoiceChannel
public void HandleAvailableVoiceChannel(Parser packet)
{
var unk = packet.ReadInt64();
WriteLine("Unk Int64 1: " + unk);
var type = packet.ReadByte();
WriteLine("Channel Type: " + type);
var name = packet.ReadCString();
WriteLine("Channel Name: " + name);
var unk2 = packet.ReadInt64();
WriteLine("Unk Int64 2: " + unk2);
}
示例9: QUESTGIVER_QUEST_DETAILS
public void QUESTGIVER_QUEST_DETAILS(Parser packet)
{
var Guid1 = packet.ReadInt64();
var Guid2 = packet.ReadInt64();
var QID = packet.ReadInt32("QuestID");
WriteLine("Quest ID: " + QID);
packet.ReadCString("Quest Name");
packet.ReadCString("Quest Description");
packet.ReadCString("Quest Progress");
packet.ReadCString("QuestGiverWindowText");
packet.ReadCString("QuestTargetName");
packet.ReadCString("QuestGiverWindowText #2");
packet.ReadCString("QuestTargetName #2");
packet.ReadInt32("QuestTargetModelID");
packet.ReadInt32("QuestTargetModelID #2");
packet.ReadByte("AcceptActivate");
packet.ReadEnum<QuestFlag>("Flags");
packet.ReadInt32("SugesstedPlayers");
packet.ReadByte("QuestStartType");
packet.ReadByte("QuestStartType");
packet.ReadInt32("Required Spell");
packet.ReadInt32("GetRewChoiceItemsCount");
for (int i = 0; i < 6; ++i)
packet.ReadInt32("RewChoiceItemId");
for (int i = 0; i < 6; ++i)
packet.ReadInt32("RewChoiceItemCount");
for (int i = 0; i < 6; ++i)
packet.ReadInt32("RewChoiceItemDisplayId");
packet.ReadInt32("GetRewItemsCount");
for (int i = 0; i < 4; ++i)
packet.ReadInt32("RewItemId");
for (int i = 0; i < 4; ++i)
packet.ReadInt32("RewItemCount");
for (int i = 0; i < 4; ++i)
packet.ReadInt32("RewItemDisplayId");
packet.ReadInt32("Money Rew?");
packet.ReadInt32("Exp Rew?");
for (int i = 0; i < 6; i++)
packet.ReadInt32("Unknown");
for (int i = 0; i < 5; ++i)
packet.ReadInt32("RewRepFaction");
for (int i = 0; i < 5; ++i)
packet.ReadInt32("RewRepValueId");
for (int i = 0; i < 5; ++i)
packet.ReadInt32("RewRepValue");
packet.ReadInt32("Spell Cast");
packet.ReadInt32("Silent Spell Cast");
for (int i = 0; i < 4; i++)
packet.ReadInt32("Unknown");
for (int i = 0; i < 4; i++)
packet.ReadInt32("Unknown");
packet.ReadInt32("Unknown");
packet.ReadInt32("Unknown");
packet.ReadInt32("Something with Emote");
for (int i = 0; i < 4; ++i)
{
packet.ReadInt32("EmoteId");
packet.ReadInt32("EmoteDelay");
}
}
示例10: HandleLootMoneyNotify
public void HandleLootMoneyNotify(Parser packet)
{
packet.ReadInt32("Money Looted: ");
packet.ReadByte("Always 1: ");
}
示例11: HandleNpcGossip
public void HandleNpcGossip(Parser packet)
{
var guid = packet.ReadGuid();
WriteLine("GUID: " + guid);
var entry = packet.ReadUInt32();
WriteLine("Menu id: " + entry);
var textid = packet.ReadUInt32();
WriteLine("Text id: " + textid);
var count = packet.ReadUInt32();
WriteLine("- Amount of Options: " + count);
for (var i = 0; i < count; i++)
{
if (i != 0)
WriteLine("\t--");
var index = packet.ReadUInt32();
WriteLine("\tIndex: " + index);
var icon = packet.ReadByte();
WriteLine("\tIcon: " + icon);
var box = packet.ReadBoolean();
WriteLine("\tBox: " + box);
var boxMoney = packet.ReadUInt32();
if (box) // Only print if there's a box. avaliable.
WriteLine("\tRequired money: " + boxMoney);
var text = packet.ReadCString();
WriteLine("\tText: " + text);
var boxText = packet.ReadCString();
if (box) // Only print if there's a box avaliable.
WriteLine("\tBox text: " + boxText);
}
var questgossips = packet.ReadUInt32();
WriteLine("- Amount of Quest gossips: " + questgossips);
for (var i = 0; i < questgossips; i++)
{
if (i != 0)
WriteLine("\t--");
var questID = packet.ReadUInt32();
WriteLine("\tQuest ID: " + questID);
var questicon = packet.ReadUInt32();
WriteLine("\tIcon: " + questicon);
var questlevel = packet.ReadInt32();
WriteLine("\tLevel: " + questlevel);
var flags = (QuestFlag)(packet.ReadUInt32() | 0xFFFF);
WriteLine("\tFlags: " + flags);
var unk1 = packet.ReadBoolean();
WriteLine("\tUnknown bool: " + unk1);
var title = packet.ReadCString();
WriteLine("\tTitle: " + title);
}
}
示例12: HandleVoiceRosterUpdate
public void HandleVoiceRosterUpdate(Parser packet)
{
var unk64 = packet.ReadInt64();
WriteLine("Unk Int64: " + unk64);
var chanId = packet.ReadInt16();
WriteLine("Channel ID: " + chanId);
var chanName = packet.ReadCString();
WriteLine("Channel Name: " + chanName);
var key = Encoding.UTF8.GetString(packet.ReadBytes(16));
WriteLine("Encryption Key: " + key);
var ip = packet.ReadInt32();
WriteLine("Voice Server IP: " + ip);
var count = packet.ReadByte();
WriteLine("Player Count: " + count);
var leaderGuid = packet.ReadGuid();
WriteLine("Leader GUID: " + leaderGuid);
var leaderFlags = packet.ReadByte();
WriteLine("Leader Flags: 0x" + leaderFlags.ToString("X2"));
var unk = packet.ReadByte();
WriteLine("Unk Byte 1: " + unk);
for (var i = 0; i < count - 1; i++)
{
var guid = packet.ReadGuid();
WriteLine("Player GUID: " + guid);
var idx = packet.ReadByte();
WriteLine("Index: " + idx);
var flags = packet.ReadByte();
WriteLine("Flags: 0x" + flags.ToString("X2"));
var unk2 = packet.ReadByte();
WriteLine("Unk Byte 2: " + unk2);
}
}
示例13: ReadAuraUpdateBlock
public void ReadAuraUpdateBlock(Parser packet)
{
ReadByte("Slot");
var id = packet.ReadInt32();
WriteLine("Spell: " + id);
if (id <= 0)
return;
var flags = (AuraFlag)packet.ReadByte();
WriteLine("Flags: " + flags);
Byte("unk");
Byte("Level");
Byte("Charges");
if (!flags.HasFlag(AuraFlag.NotCaster))
ReadPackedGuid("Caster GUID");
if (!flags.HasFlag(AuraFlag.Duration))
return;
UInt32("Max Duration");
UInt32("Duration");
}
示例14: HandleQuestOfferReward
public void HandleQuestOfferReward(Parser packet)
{
var guid = packet.ReadInt64();
var questId = packet.ReadInt32();
WriteLine("Quest ID: " + questId);
var title = packet.ReadCString();
WriteLine("Title: " + title);
var RewardText = packet.ReadCString();
WriteLine("Reward Text: " + RewardText);
var QGWT = packet.ReadCString();
WriteLine("QuestStart Window Text: " + QGWT);
var QTN = packet.ReadCString();
WriteLine("QuestStart Window Name: " + QTN);
var QTWT = packet.ReadCString();
WriteLine("QuestEnd Window Text: " + QTWT);
var QTN1 = packet.ReadCString();
WriteLine("QuestEnd Window Name: " + QTN1);
var QSMID = packet.ReadInt32();
WriteLine("QuestStart ModelID: " + QSMID);
var QEMID = packet.ReadInt32();
WriteLine("QuestEnd ModelID: " + QEMID);
var EnableNext = packet.ReadByte();
WriteLine("Enable Next: " + EnableNext);
var flags = (QuestFlag)(packet.ReadInt32() | 0xFFFF);
WriteLine("Quest Flag: " + flags);
var SP = packet.ReadInt32();
WriteLine("Suggested Players: " + SP);
var EmoteCount = packet.ReadInt32();
WriteLine("Emote Count: " + EmoteCount);
for (int i = 0; i < EmoteCount; ++i)
{
var EDelay = packet.ReadInt32();
WriteLine("Emote Delay: " + EDelay);
var EID = packet.ReadInt32();
WriteLine("Emote Id: " + EID);
}
var RewCIC = packet.ReadInt32();
WriteLine("Reward Choice Items Amount: " + RewCIC);
for (int i = 0; i < 6; ++i)
{
var RCID = packet.ReadInt32();
WriteLine("Reward Choice ItemId: " + RCID);
}
for (int i = 0; i < 6; ++i)
{
var RCIC = packet.ReadInt32();
WriteLine("Reward Choice Item Count: " + RCIC);
}
for (int i = 0; i < 6; ++i)
{
var RCIDis = packet.ReadInt32();
WriteLine("Reward Choice Item DisplayId: " + RCIDis);
}
var RewItCount = packet.ReadInt32();
WriteLine("Reward Item Count: " + RewItCount);
for (int i = 0; i < 4; ++i)
{
var RewItemId = packet.ReadInt32("RewItemId");
WriteLine("Reward Item Id: " + RewItemId);
}
for (int i = 0; i < 4; ++i)
{
var RewItemCount = packet.ReadInt32("RewItemCount");
WriteLine("Reward Item Count: " + RewItemCount);
}
for (int i = 0; i < 4; ++i)
{
var RewItemDisplayID = packet.ReadInt32("RewItemDisplay");
WriteLine("Reward Item DisplayId: " + RewItemDisplayID);
}
var RewMoney = packet.ReadInt32();
WriteLine("Reward Money: " + RewMoney);
var RewExp = packet.ReadInt32();
WriteLine("Reward Experience: " + RewExp);
var TitleId = packet.ReadInt32();
WriteLine("Reward Title Id: " + TitleId);
packet.ReadInt32("Unknown");
//.........这里部分代码省略.........
示例15: HandleServerChatMessage
public void HandleServerChatMessage(Parser packet)
{
var type = (ChatMessageType)packet.ReadByte();
WriteLine("Type: " + type);
var lang = (Language)packet.ReadInt32();
WriteLine("Language: " + lang);
var guid = packet.ReadGuid();
WriteLine("GUID: " + guid);
var unkInt = packet.ReadInt32();
WriteLine("Unk Int32: " + unkInt);
switch (type)
{
case ChatMessageType.Say:
case ChatMessageType.Yell:
case ChatMessageType.Party:
case ChatMessageType.PartyLeader:
case ChatMessageType.Raid:
case ChatMessageType.RaidLeader:
case ChatMessageType.RaidWarning:
case ChatMessageType.Guild:
case ChatMessageType.Officer:
case ChatMessageType.Emote:
case ChatMessageType.TextEmote:
case ChatMessageType.Whisper:
case ChatMessageType.WhisperInform:
case ChatMessageType.System:
case ChatMessageType.Channel:
case ChatMessageType.Battleground:
case ChatMessageType.BattlegroundNeutral:
case ChatMessageType.BattlegroundAlliance:
case ChatMessageType.BattlegroundHorde:
case ChatMessageType.BattlegroundLeader:
case ChatMessageType.Achievement:
case ChatMessageType.GuildAchievement:
{
if (type == ChatMessageType.Channel)
{
var chanName = packet.ReadCString();
WriteLine("Channel Name: " + chanName);
}
var senderGuid = packet.ReadGuid();
WriteLine("Sender GUID: " + senderGuid);
break;
}
case ChatMessageType.MonsterSay:
case ChatMessageType.MonsterYell:
case ChatMessageType.MonsterParty:
case ChatMessageType.MonsterEmote:
case ChatMessageType.MonsterWhisper:
case ChatMessageType.RaidBossEmote:
case ChatMessageType.RaidBossWhisper:
case ChatMessageType.BattleNet:
{
var nameLen = packet.ReadInt32();
WriteLine("Name Length: " + nameLen);
var name = packet.ReadCString();
WriteLine("Name: " + name);
var target = packet.ReadGuid();
WriteLine("Receiver GUID: " + guid);
if (target.Full != 0)
{
var tNameLen = packet.ReadInt32();
WriteLine("Receiver Name Length: " + tNameLen);
var tName = packet.ReadCString();
WriteLine("Receiver Name: " + tName);
}
break;
}
}
var textLen = packet.ReadInt32();
WriteLine("Text Length: " + textLen);
var text = packet.ReadCString();
WriteLine("Text: " + text);
var chatTag = (ChatTag)packet.ReadByte();
WriteLine("Chat Tag: " + chatTag);
if (type != ChatMessageType.Achievement && type != ChatMessageType.GuildAchievement)
return;
var achId = packet.ReadInt32();
WriteLine("Achievement ID: " + achId);
}