本文整理汇总了C#中Parser.ReadEntry方法的典型用法代码示例。如果您正苦于以下问题:C# Parser.ReadEntry方法的具体用法?C# Parser.ReadEntry怎么用?C# Parser.ReadEntry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Parser
的用法示例。
在下文中一共展示了Parser.ReadEntry方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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));
}
示例2: 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));
}
示例3: HandleCreatureQueryResponse
public void HandleCreatureQueryResponse(Parser packet)
{
var entry = packet.ReadEntry();
WriteLine("Entry: " + entry.Key);
if (entry.Value)
return;
var name = new string[8];
for (var i = 0; i < 8; i++)
{
name[i] = packet.ReadCString();
WriteLine("Name " + i + ": " + name[i]);
}
var subName = packet.ReadCString();
WriteLine("Sub Name: " + subName);
var iconName = packet.ReadCString();
WriteLine("Icon Name: " + iconName);
var typeFlags = (CreatureTypeFlag)packet.ReadInt32();
WriteLine("Type Flags: " + typeFlags);
//Allways 0?
packet.ReadInt32("Unknown");
var type = (CreatureType)packet.ReadInt32();
WriteLine("Type: " + type);
var family = (CreatureFamily)packet.ReadInt32();
WriteLine("Family: " + family);
var rank = (CreatureRank)packet.ReadInt32();
WriteLine("Rank: " + rank);
var killCredit = new int[2];
for (var i = 0; i < 2; i++)
{
killCredit[i] = packet.ReadInt32();
WriteLine("Kill Credit " + i + ": " + killCredit[i]);
}
var dispId = new int[4];
for (var i = 0; i < 4; i++)
{
dispId[i] = packet.ReadInt32();
WriteLine("Display ID " + i + ": " + dispId[i]);
}
var mod1 = packet.ReadSingle();
WriteLine("Modifier 1: " + mod1);
var mod2 = packet.ReadSingle();
WriteLine("Modifier 2: " + mod2);
var racialLeader = packet.ReadBoolean();
WriteLine("Racial Leader: " + racialLeader);
var qItem = new int[6];
for (var i = 0; i < 6; i++)
{
qItem[i] = packet.ReadInt32();
WriteLine("Quest Item " + i + ": " + qItem[i]);
}
var moveId = packet.ReadInt32();
WriteLine("Movement ID: " + moveId);
packet.ReadInt32("Unknown"); // 0 ?
//SQLStore.WriteData(SQLStore.Creatures.GetCommand(entry.Key, name[0], subName, iconName, typeFlags,
// type, family, rank, killCredit, dispId, mod1, mod2, racialLeader, qItem, moveId));
}
示例4: 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]);
}
//.........这里部分代码省略.........