當前位置: 首頁>>代碼示例>>C#>>正文


C# PacketHitList.AddHitList方法代碼示例

本文整理匯總了C#中Server.Network.PacketHitList.AddHitList方法的典型用法代碼示例。如果您正苦於以下問題:C# PacketHitList.AddHitList方法的具體用法?C# PacketHitList.AddHitList怎麽用?C# PacketHitList.AddHitList使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Server.Network.PacketHitList的用法示例。


在下文中一共展示了PacketHitList.AddHitList方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: FinalizeAction

        public static void FinalizeAction(BattleSetup setup, PacketHitList parent)
        {
            Scripting.ScriptManager.InvokeSub("AfterActionTaken", setup);

            if (setup.Attacker.CharacterType == Enums.CharacterType.Recruit) {
                if (setup.AttackerMap.MapType == Enums.MapType.Standard) {
                    setup.ExpGained /= 2;
                }
                if (setup.ExpGained > 0) {

                    if (((Recruit)setup.Attacker).Owner.Player.PartyID == null) {
                        if (!(setup.Attacker.Level == Exp.ExpManager.Exp.MaxLevels)) {
                            Scripting.ScriptManager.InvokeSub("PlayerEXP", setup.packetStack, ((Recruit)setup.Attacker).Owner, setup.ExpGained);

                            CheckPlayerLevelUp(setup.PacketStack, ((Recruit)setup.Attacker).Owner);
                        }
                    } else {
                        Party party = PartyManager.FindPlayerParty(((Recruit)setup.Attacker).Owner);
                        if (party != null) {
                            party.HandoutExp(((Recruit)setup.Attacker).Owner, setup.ExpGained, setup.PacketStack);
                        }
                    }
                }
                //setup.PacketStack.AddPacket(((Recruit)setup.Attacker).Owner, PacketBuilder.CreateBattleDivider());
            }

            // Disable caching and build the hitlist to allow for post-processing
            setup.PacketStack.CachingEnabled = false;

            for (int i = 0; i < setup.PacketStack.HitList.Count; i++) {
                if (setup.PacketStack.HitList.ValueByIndex(i).ContainsPacket("battlemsg") && parent == null) {
                    setup.PacketStack.AddPacket(setup.PacketStack.HitList.KeyByIndex(i), PacketBuilder.CreateBattleDivider());
                }

            }

            if (parent != null) {
                parent.AddHitList(setup.PacketStack);
            } else {
                PacketHitList.MethodEnded(ref setup.packetStack);
            }
        }
開發者ID:pzaps,項目名稱:Server,代碼行數:42,代碼來源:BattleProcessor.cs


注:本文中的Server.Network.PacketHitList.AddHitList方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。