本文整理汇总了C#中Parser.ReadCString方法的典型用法代码示例。如果您正苦于以下问题:C# Parser.ReadCString方法的具体用法?C# Parser.ReadCString怎么用?C# Parser.ReadCString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Parser
的用法示例。
在下文中一共展示了Parser.ReadCString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleClientChatMessage
public void HandleClientChatMessage(Parser packet)
{
var type = (ChatMessageType)packet.ReadInt32();
WriteLine("Type: " + type);
var lang = (Language)packet.ReadInt32();
WriteLine("Language: " + lang);
switch (type)
{
case ChatMessageType.Whisper:
{
var to = packet.ReadCString();
WriteLine("Recipient: " + to);
goto default;
}
case ChatMessageType.Channel:
{
var chan = packet.ReadCString();
WriteLine("Channel: " + chan);
goto default;
}
default:
{
var msg = packet.ReadCString();
WriteLine("Message: " + msg);
break;
}
}
}
示例2: HandleGameObjectQueryResponse
public void HandleGameObjectQueryResponse(Parser packet)
{
var entry = packet.ReadEntry();
WriteLine("Entry: " + entry.Key);
if (entry.Value)
return;
var type = (GameObjectType)packet.ReadInt32();
WriteLine("Type: " + type);
var dispId = packet.ReadInt32();
WriteLine("Display ID: " + dispId);
var name = new string[4];
for (var i = 0; i < 4; i++)
{
name[i] = packet.ReadCString();
WriteLine("Name " + i + ": " + name[i]);
}
var iconName = packet.ReadCString();
WriteLine("Icon Name: " + iconName);
var castCaption = packet.ReadCString();
WriteLine("Cast Caption: " + castCaption);
var unkStr = packet.ReadCString();
WriteLine("Unk String: " + unkStr);
var data = new int[24];
for (var i = 0; i < 24; i++)
{
data[i] = packet.ReadInt32();
WriteLine("Data " + i + ": " + data[i]);
}
var size = packet.ReadSingle();
WriteLine("Size: " + size);
var qItem = new int[6];
for (var i = 0; i < 6; i++)
{
qItem[i] = packet.ReadInt32();
WriteLine("Quest Item " + i + ": " + qItem[i]);
}
//SQLStore.WriteData(SQLStore.GameObjects.GetCommand(entry.Key, type, dispId, name[0], iconName,
// castCaption, unkStr, data, size, qItem));
}
示例3: HandleContactList
public void HandleContactList(Parser packet)
{
var flags = (ContactListFlag)packet.ReadInt32();
WriteLine("List Flags: " + flags);
var count = packet.ReadInt32();
WriteLine("Count: " + count);
for (var i = 0; i < count; i++)
{
var guid = packet.ReadGuid();
WriteLine("GUID: " + guid);
var cflags = (ContactEntryFlag)packet.ReadInt32();
WriteLine("Flags: " + cflags);
var note = packet.ReadCString();
WriteLine("Note: " + note);
if (!cflags.HasFlag(ContactEntryFlag.Friend))
continue;
ReadSingleContactBlock(packet, true);
}
}
示例4: 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;
}
}
}
示例5: HandleSetActiveVoiceChannel
public void HandleSetActiveVoiceChannel(Parser packet)
{
var chanId = packet.ReadInt32();
WriteLine("Channel ID: " + chanId);
var name = packet.ReadCString();
WriteLine("Channel Name: " + name);
}
示例6: HandleGroupInvite
public void HandleGroupInvite(Parser packet)
{
var name = packet.ReadCString();
WriteLine("Name: " + name);
var unkint = packet.ReadInt32();
WriteLine("Unk Int32: " + unkint);
}
示例7: 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);
}
}
示例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: HandleGossipPoi
public void HandleGossipPoi(Parser packet)
{
var flags = packet.ReadInt32();
WriteLine("Flags: 0x" + flags.ToString("X8"));
Float("X");
Float("Y");
var icon = (GossipPoiIcon)packet.ReadInt32();
WriteLine("Icon: " + icon);
var data = packet.ReadInt32();
WriteLine("Data: " + data);
var iconName = packet.ReadCString();
WriteLine("Icon Name: " + iconName);
}
示例10: HandleItemQueryResponse
public void HandleItemQueryResponse(Parser packet)
{
var entry = packet.ReadEntry();
WriteLine("Entry: " + entry.Key);
if (entry.Value)
return;
var iClass = (ItemClass)packet.ReadInt32();
WriteLine("Class: " + iClass);
var subClass = packet.ReadInt32();
WriteLine("Sub Class: " + subClass);
var unk0 = packet.ReadInt32();
WriteLine("Unk Int32: " + unk0);
var name = new string[4];
for (var i = 0; i < 4; i++)
{
name[i] = packet.ReadCString();
WriteLine("Name " + i + ": " + name[i]);
}
var dispId = packet.ReadInt32();
WriteLine("Display ID: " + dispId);
var quality = (ItemQuality)packet.ReadInt32();
WriteLine("Quality: " + quality);
var flags = (ItemFlag)packet.ReadInt32();
WriteLine("Flags: " + flags);
var flags2 = (ItemFlagExtra)packet.ReadInt32();
WriteLine("Extra Flags: " + flags2);
var buyPrice = packet.ReadInt32();
WriteLine("Buy Price: " + buyPrice);
var sellPrice = packet.ReadInt32();
WriteLine("Sell Price: " + sellPrice);
var invType = (InventoryType)packet.ReadInt32();
WriteLine("Inventory Type: " + invType);
var allowClass = (ClassMask)packet.ReadInt32();
WriteLine("Allowed Classes: " + allowClass);
var allowRace = (RaceMask)packet.ReadInt32();
WriteLine("Allowed Races: " + allowRace);
var itemLvl = packet.ReadInt32();
WriteLine("Item Level: " + itemLvl);
var reqLvl = packet.ReadInt32();
WriteLine("Required Level: " + reqLvl);
var reqSkill = packet.ReadInt32();
WriteLine("Required Skill ID: " + reqSkill);
var reqSkLvl = packet.ReadInt32();
WriteLine("Required Skill Level: " + reqSkLvl);
var reqSpell = packet.ReadInt32();
WriteLine("Required Spell: " + reqSpell);
var reqHonor = packet.ReadInt32();
WriteLine("Required Honor Rank: " + reqHonor);
var reqCity = packet.ReadInt32();
WriteLine("Required City Rank: " + reqCity);
var reqRepFaction = packet.ReadInt32();
WriteLine("Required Rep Faction: " + reqRepFaction);
var reqRepValue = packet.ReadInt32();
WriteLine("Required Rep Value: " + reqRepValue);
var maxCount = packet.ReadInt32();
WriteLine("Max Count: " + maxCount);
var stacks = packet.ReadInt32();
WriteLine("Max Stack Size: " + stacks);
var contSlots = packet.ReadInt32();
WriteLine("Container Slots: " + contSlots);
var statsCount = packet.ReadInt32();
WriteLine("Stats Count: " + statsCount);
var type = new ItemModType[statsCount];
var value = new int[statsCount];
for (var i = 0; i < statsCount; i++)
{
type[i] = (ItemModType)packet.ReadInt32();
WriteLine("Stat Type " + i + ": " + type[i]);
value[i] = packet.ReadInt32();
WriteLine("Stat Value " + i + ": " + value[i]);
}
//.........这里部分代码省略.........
示例11: HandleAddVoiceIgnore
public void HandleAddVoiceIgnore(Parser packet)
{
var name = packet.ReadCString();
WriteLine("Name: " + name);
}
示例12: 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");
//.........这里部分代码省略.........
示例13: 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");
}
}
示例14: HandleQuestQueryResponse
//.........这里部分代码省略.........
WriteLine("Reward Choice Item ID " + i + ": " + rewChoiceItemId[i]);
rewChoiceItemCnt[i] = packet.ReadInt32();
WriteLine("Reward Choice Item Count " + i + ": " + rewChoiceItemCnt[i]);
}
var rewFactionId = new int[5];
for (var i = 0; i < 5; i++)
{
rewFactionId[i] = packet.ReadInt32();
WriteLine("Reward Faction ID " + i + ": " + rewFactionId[i]);
}
var rewRepIdx = new int[5];
for (var i = 0; i < 5; i++)
{
rewRepIdx[i] = packet.ReadInt32();
WriteLine("Reward Reputation ID " + i + ": " + rewRepIdx[i]);
}
var rewRepOverride = new int[5];
for (var i = 0; i < 5; i++)
{
rewRepOverride[i] = packet.ReadInt32();
WriteLine("Reward Rep Override " + i + ": " + rewRepOverride[i]);
}
var pointMap = packet.ReadInt32();
WriteLine("Point Map ID: " + pointMap);
var pointX = packet.ReadSingle();
WriteLine("Point X: " + pointX);
var pointY = packet.ReadSingle();
WriteLine("Point Y: " + pointY);
var pointOpt = packet.ReadInt32();
WriteLine("Point Opt: " + pointOpt);
var title = packet.ReadCString();
WriteLine("Title: " + title);
var objectives = packet.ReadCString();
WriteLine("Objectives: " + objectives);
var details = packet.ReadCString();
WriteLine("Details: " + details);
var endText = packet.ReadCString();
WriteLine("End Text: " + endText);
var returnText = packet.ReadCString();
WriteLine("Return Text: " + returnText);
var reqId = new KeyValuePair<int, bool>[4];
var reqCnt = new int[4];
var srcId = new int[4];
var srcCnt = new int[4];
for (var i = 0; i < 4; i++)
{
reqId[i] = packet.ReadEntry();
WriteLine("Required " + (reqId[i].Value ? "GO" : "NPC") +
" ID " + i + ": " + reqId[i].Key);
reqCnt[i] = packet.ReadInt32();
WriteLine("Required Count: " + i + ": " + reqCnt[i]);
srcId[i] = packet.ReadInt32();
WriteLine("Source ID: " + i + ": " + srcId[i]);
srcCnt[i] = packet.ReadInt32();
WriteLine("Source Count: " + i + ": " + srcCnt[i]);
}
var reqItemId = new int[6];
var reqItemCnt = new int[6];
for (var i = 0; i < 6; i++)
{
reqItemId[i] = packet.ReadInt32();
WriteLine("Required Item ID " + i + ": " + reqItemId[i]);
reqItemCnt[i] = packet.ReadInt32();
WriteLine("Required Item Count: " + i + ": " + reqItemCnt[i]);
}
var objectiveText = new string[4];
for (var i = 0; i < 4; i++)
{
objectiveText[i] = packet.ReadCString();
WriteLine("Objective Text " + i + ": " + objectiveText[i]);
}
//SQLStore.WriteData(SQLStore.Quests.GetCommand(id, method, level, minLevel, sort, type,
// players, factId, factRep, nextQuest, xpId, rewReqMoney, rewMoneyMaxLvl,
// rewSpell, rewSpellCast, rewHonor, rewHonorBonus, srcItemId, flags, titleId,
// reqPlayerKills, bonusTalents, bonusArenaPoints, bonusUnk, rewItemId, rewItemCnt,
// rewChoiceItemId, rewChoiceItemCnt, rewFactionId, rewRepIdx, rewRepOverride,
// pointMap, pointX, pointY, pointOpt, title, objectives, details, endText,
// returnText, reqId, reqCnt, srcId, srcCnt, reqItemId, reqItemCnt, objectiveText));
}
示例15: HandleNpcTextUpdate
public void HandleNpcTextUpdate(Parser packet)
{
var entry = packet.ReadInt32();
WriteLine("Entry: " + entry);
var prob = new float[8];
var text1 = new string[8];
var text2 = new string[8];
var lang = new Language[8];
var emDelay = new int[8][];
var emEmote = new int[8][];
for (var i = 0; i < 8; i++)
{
prob[i] = packet.ReadSingle();
WriteLine("Probability " + i + ": " + prob[i]);
text1[i] = packet.ReadCString();
WriteLine("Text 1 " + i + ": " + text1[i]);
text2[i] = packet.ReadCString();
WriteLine("Text 2 " + i + ": " + text2[i]);
lang[i] = (Language)packet.ReadInt32();
WriteLine("Language " + i + ": " + lang[i]);
emDelay[i] = new int[3];
emEmote[i] = new int[3];
for (var j = 0; j < 3; j++)
{
emDelay[i][j] = packet.ReadInt32();
WriteLine("Emote Delay " + j + ": " + emDelay[i][j]);
emEmote[i][j] = packet.ReadInt32();
WriteLine("Emote ID " + j + ": " + emEmote[i][j]);
}
}
//SQLStore.WriteData(SQLStore.NpcTexts.GetCommand(entry, prob, text1, text2, lang, emDelay, emEmote));
}