Esempio n. 1
0
        private void TickUsers()
        {
            for (LinkedListNode <UserInfo> linkNode = m_UserMgr.Users.FirstValue; null != linkNode; linkNode = linkNode.Next)
            {
                UserInfo info = linkNode.Value;
                if (info.LevelChanged || info.GetShootStateInfo().WeaponChanged || info.GetSkillStateInfo().BuffChanged || info.GetEquipmentStateInfo().EquipmentChanged)
                {
                    LogSystem.Debug("UserAttrCalculate LevelChanged:{0} WeaponChanged:{1} BuffChanged:{2} EquipmentChanged:{3}", info.LevelChanged, info.GetShootStateInfo().WeaponChanged, info.GetSkillStateInfo().BuffChanged, info.GetEquipmentStateInfo().EquipmentChanged);
                    UserAttrCalculator.Calc(info);
                    info.LevelChanged = false;
                    info.GetShootStateInfo().WeaponChanged        = false;
                    info.GetSkillStateInfo().BuffChanged          = false;
                    info.GetEquipmentStateInfo().EquipmentChanged = false;
                }
            }
            UserInfo player = WorldSystem.Instance.GetPlayerSelf();

            if (null != player && player.Hp <= 0)
            {
                if (player.DeadTime <= 0)
                {
                    GfxSystem.PublishGfxEvent("ge_show_relive", "ui", null);
                    player.DeadTime = TimeUtility.GetServerMilliseconds();
                }
            }
        }
Esempio n. 2
0
        private void TickUsers()
        {
            for (LinkedListNode <UserInfo> linkNode = UserManager.Users.FirstValue; null != linkNode; linkNode = linkNode.Next)
            {
                UserInfo info = linkNode.Value;
                if (info.GetEquipmentStateInfo().EquipmentChanged)
                {
                    RefreshItemSkills(info);
                }
                if (info.LevelChanged || info.GetSkillStateInfo().BuffChanged || info.GetEquipmentStateInfo().EquipmentChanged || info.GetLegacyStateInfo().LegacyChanged)
                {
                    UserAttrCalculator.Calc(info);
                    info.LevelChanged = false;
                    info.GetSkillStateInfo().BuffChanged          = false;
                    info.GetEquipmentStateInfo().EquipmentChanged = false;
                    info.GetLegacyStateInfo().LegacyChanged       = false;
                }
                if (info.Hp <= 0)
                {
                    if (info.DeadTime <= 0)
                    {
                        //计算击杀收益
                        CalcKillIncome(info);
                        info.GetCombatStatisticInfo().AddDeadCount(1);  //死亡计数+1
                                                                        //解除控制
                        ReleaseControl(info);
                        //发送玩家死亡消息
                        Msg_RC_Dead build = new Msg_RC_Dead();
                        build.role_id = info.GetId();
                        NotifyAllUser(build);
                        PlayerLevelupExpConfig cfg = PlayerConfigProvider.Instance.GetPlayerLevelupExpConfigById(info.GetLevel());
                        info.SetStateFlag(Operate_Type.OT_AddBit, CharacterState_Type.CST_BODY);

                        m_StorySystem.SendMessage("userkilled", info.GetId(), GetLivingUserCount());

                        TryFireAllUserKilled();
                        NoticeAttempRoomClosing();

                        info.DeadTime = TimeUtility.GetServerMilliseconds();
                        if (null != cfg && m_IsPvpScene)
                        {
                            info.ReviveTime = TimeUtility.GetServerMilliseconds() + cfg.m_RebornTime * 1000;
                        }
                        else
                        {
                            info.ReviveTime = TimeUtility.GetServerMilliseconds() + info.ReleaseTime + 2000;
                        }
                        NpcInfo npc = NpcManager.GetNpcInfo(info.PartnerId);
                        if (null != npc && npc.NpcType == (int)NpcTypeEnum.Partner)
                        {
                            npc.NeedDelete = true;
                        }
                    }
                    else
                    {
                        /*
                         * long delta = TimeUtility.GetServerMilliseconds() - info.DeadTime;
                         * if (delta > info.ReleaseTime) {
                         * info.DeadTime = info.ReviveTime;
                         * Msg_RC_Disappear build = new Msg_RC_Disappear();
                         * build.role_id = info.GetId();
                         * NotifyAllUser(build);
                         * }
                         */
                    }
                }
            }
        }