当前位置: 首页>>代码示例>>C#>>正文


C# Parser.ReadSingle方法代码示例

本文整理汇总了C#中Parser.ReadSingle方法的典型用法代码示例。如果您正苦于以下问题:C# Parser.ReadSingle方法的具体用法?C# Parser.ReadSingle怎么用?C# Parser.ReadSingle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Parser的用法示例。


在下文中一共展示了Parser.ReadSingle方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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));
        }
开发者ID:Gintama,项目名称:VoragineTools,代码行数:50,代码来源:GameObjectHandler.cs

示例2: HandleQuestQueryResponse

        public void HandleQuestQueryResponse(Parser packet)
        {
            var id = packet.ReadInt32();
            WriteLine("Entry: " + id);

            var method = (QuestMethod)packet.ReadInt32();
            WriteLine("Method: " + method);

            var level = packet.ReadInt32();
            WriteLine("Level: " + level);

            var minLevel = packet.ReadInt32();
            WriteLine("Min Level: " + minLevel);

            var sort = (QuestSort)packet.ReadInt32();
            WriteLine("Sort: " + sort);

            var type = (QuestType)packet.ReadInt32();
            WriteLine("Type: " + type);

            var players = packet.ReadInt32();
            WriteLine("Suggested Players: " + players);

            var factId = new int[2];
            var factRep = new int[2];
            for (var i = 0; i < 2; i++)
            {
                factId[i] = packet.ReadInt32();
                WriteLine("Required Faction ID " + i + ": " + factId[i]);

                factRep[i] = packet.ReadInt32();
                WriteLine("Required Faction Rep " + i + ": " + factRep[i]);
            }

            var nextQuest = packet.ReadInt32();
            WriteLine("Next Chain Quest: " + nextQuest);

            var xpId = packet.ReadInt32();
            WriteLine("Quest XP ID: " + xpId);

            var rewReqMoney = packet.ReadInt32();
            WriteLine("Reward/Required Money: " + rewReqMoney);

            var rewMoneyMaxLvl = packet.ReadInt32();
            WriteLine("Reward Money Max Level: " + rewMoneyMaxLvl);

            var rewSpell = packet.ReadInt32();
            WriteLine("Reward Spell: " + rewSpell);

            var rewSpellCast = packet.ReadInt32();
            WriteLine("Reward Spell Cast: " + rewSpellCast);

            var rewHonor = packet.ReadInt32();
            WriteLine("Reward Honor: " + rewHonor);

            var rewHonorBonus = packet.ReadSingle();
            WriteLine("Reward Honor Multiplier: " + rewHonorBonus);

            var srcItemId = packet.ReadInt32();
            WriteLine("Source Item ID: " + srcItemId);

            var flags = (QuestFlag)(packet.ReadInt32() | 0xFFFF);
            WriteLine("Flags: " + flags);

            var unk1 = packet.ReadInt32();
            WriteLine("Unknown: " + unk1);

            var titleId = packet.ReadInt32();
            WriteLine("Title ID: " + titleId);

            var reqPlayerKills = packet.ReadInt32();
            WriteLine("Required Player Kills: " + reqPlayerKills);

            var bonusTalents = packet.ReadInt32();
            WriteLine("Bonus Talents: " + bonusTalents);

            var bonusArenaPoints = packet.ReadInt32();
            WriteLine("Bonus Arena Points: " + bonusArenaPoints);

            var bonusUnk = packet.ReadInt32();
            WriteLine("SkillLine: " + bonusUnk);

            var unk2 = packet.ReadInt32();
            WriteLine("SkillPoints: " + unk2);

            var unk3 = packet.ReadInt32();
            WriteLine("Reward Faction Mask: " + unk3);

            var QuestGiverPortrait = packet.ReadInt32();
            WriteLine("QuestGiverPortrait: " + QuestGiverPortrait);

            var QuestTurnPortrait = packet.ReadInt32();
            WriteLine("QuestTurnPortrait: " + QuestTurnPortrait);

            var rewItemId = new int[4];
            var rewItemCnt = new int[4];
            for (var i = 0; i < 4; i++)
            {
                rewItemId[i] = packet.ReadInt32();
                WriteLine("Reward Item ID " + i + ": " + rewItemId[i]);
//.........这里部分代码省略.........
开发者ID:Dekadencee,项目名称:PacketViewer,代码行数:101,代码来源:QuestHandler.cs

示例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));
        }
开发者ID:Kr4v3n5,项目名称:PacketViewer,代码行数:74,代码来源:QueryHandler.cs

示例4: 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));
        }
开发者ID:Kr4v3n5,项目名称:PacketViewer,代码行数:39,代码来源:QueryHandler.cs

示例5: HandleItemQueryResponse


//.........这里部分代码省略.........
            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]);
            }

            var ssdId = packet.ReadInt32();
            WriteLine("SSD ID: " + ssdId);

            var ssdVal = packet.ReadInt32();
            WriteLine("SSD Value: " + ssdVal);

            var dmgMin = new float[2];
            var dmgMax = new float[2];
            var dmgType = new DamageType[2];
            for (var i = 0; i < 2; i++)
            {
                dmgMin[i] = packet.ReadSingle();
                WriteLine("Damage Min " + i + ": " + dmgMin[i]);

                dmgMax[i] = packet.ReadSingle();
                WriteLine("Damage Max " + i + ": " + dmgMax[i]);

                dmgType[i] = (DamageType)packet.ReadInt32();
                WriteLine("Damage Type " + i + ": " + dmgType[i]);
            }

            var resistance = new int[7];
            for (var i = 0; i < 7; i++)
            {
                resistance[i] = packet.ReadInt32();
                WriteLine((DamageType)i + " Resistance: " + resistance[i]);
            }

            var delay = packet.ReadInt32();
            WriteLine("Delay: " + delay);

            var ammoType = (AmmoType)packet.ReadInt32();
            WriteLine("Ammo Type: " + ammoType);

            var rangedMod = packet.ReadSingle();
            WriteLine("Ranged Mod: " + rangedMod);

            var spellId = new int[5];
            var spellTrigger = new ItemSpellTriggerType[5];
            var spellCharges = new int[5];
            var spellCooldown = new int[5];
            var spellCategory = new int[5];
            var spellCatCooldown = new int[5];
            for (var i = 0; i < 5; i++)
开发者ID:Gintama,项目名称:VoragineTools,代码行数:67,代码来源:ItemHandler.cs


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