示例#1
0
        /// <summary>
        /// 销毁战场
        /// 主线程调用
        /// </summary>
        private void EndBattle(Battle battle)
        {
            battle.Stop();
            int count = battle.numChampions;

            //通知CS战场结束
            Protos.BS2CS_BattleEnd battleEnd = ProtoCreator.Q_BS2CS_BattleEnd();
            battleEnd.Bid = battle.id;
            for (int i = 0; i < count; ++i)
            {
                Champion champion = battle.GetChampionAt(i);
                var      info     = new Protos.BS2CS_BattleEndInfo
                {
                    Result       = (Protos.BS2CS_BattleEndInfo.Types.Result)champion.result,
                    Team         = champion.team,
                    Damage       = champion.damage,
                    Hurt         = champion.hurt,
                    Heal         = champion.heal,
                    OccupyTime   = champion.occupyTime,
                    Skill0Used   = champion.skill0Used,
                    Skill0Damage = champion.skill0Damage,
                    Skill1Used   = champion.skill1Used,
                    Skill1Damage = champion.skill1Damage,
                };
                battleEnd.Infos.Add(champion.user.gcNID, info);
            }
            BS.instance.netSessionMgr.Send(SessionType.ServerB2CS, battleEnd, RPCEntry.Pop(this.OnCSBattleEndRet, battle));
        }
示例#2
0
        internal void StopAllBattles()
        {
            int count = this._workingBattles.Count;

            for (int i = 0; i < count; i++)
            {
                Battle battle = this._workingBattles[i];
                battle.Stop();
                POOL.Push(battle);
            }
            this._workingBattles.Clear();
            count = this._finishBattles.Count;
            for (int i = 0; i < count; i++)
            {
                Battle battle = this._workingBattles[i];
                POOL.Push(battle);
            }
            this._finishBattles.Clear();
        }