Beispiel #1
0
        public ClientRule(IFreeArgs FreeArgs)
        {
            this.paras = new SimpleParaList();
            this.paras.AddFields(new ObjectFields(this));

            ((FreeRuleEventArgs)(FreeArgs)).AddDefault(this);
        }
Beispiel #2
0
 //   , Func<WeaponEntity> grenadeEntiyExtractor
 public GrenadeCacheHelper(Func <GrenadeCacheDataComponent> extractor, Func <WeaponEntity> in_grenadeEntiyExtractor, List <int> grenadeIds, IFreeArgs freeArgs)
 {
     grenadeDataExtractor   = extractor;
     grenadeConfigIds       = grenadeIds;
     grenadeEntityExtractor = in_grenadeEntiyExtractor;
     grenadeValuedIds       = new List <int>();
     heldGrenades           = new Dictionary <int, int>();
     FreeArgs = freeArgs;
 }
Beispiel #3
0
 public WeaponFactory(IPlayerWeaponState playerWeaponState,
                      CharacterStateManager characterState,
                      IWeaponLogicFactory weaponLogicFactory,
                      IFreeArgs freeArgs)
 {
     _playerWeaponState            = playerWeaponState;
     _weaponLogicFactory           = weaponLogicFactory;
     _bulletInfoProviderDispatcher = new BulletFireInfoProviderDispatcher(playerWeaponState);
     _freeArgs = freeArgs;
 }
Beispiel #4
0
        public TacticWeaponLogic(int weaponId, IFreeArgs freeArgs)
        {
            _weaponConfig = SingletonManager.Get <WeaponConfigManagement>().FindConfigById(weaponId);

            if (SharedConfig.IsServer)
            {
                _unitSkill = WeaponSkillFactory.GetSkill(weaponId);
                _freeArgs  = freeArgs as ISkillArgs;
            }
        }
Beispiel #5
0
        //  private CommonWeaponFireUpdate _commonWeaponFireUpdate;

        public WeaponFireUpdateManagaer(//WeaponConfigManagement weaponDataConfigManager,
            //IWeaponResourceConfigManager weaponConfigManager,
            WeaponFireScriptsProvider fireScriptsCreator,
            IFreeArgs freeArgs)
        {
            this.fireScriptsCreator = fireScriptsCreator;
            //_weaponDataConfigManager = weaponDataConfigManager;
            // SingletonManager.Get<WeaponResourceConfigManager>() = weaponConfigManager;
            _freeArgs = freeArgs;
        }
 public WeaponLogicManager( //WeaponConfigManagement weaponDataConfigManager,
                            //IWeaponResourceConfigManager weaponConfigManager,
     IFireLogicProvider fireLogicCreator,
     IFreeArgs freeArgs)
 {
     _fireLogicCreator = fireLogicCreator;
     //_weaponDataConfigManager = weaponDataConfigManager;
     // SingletonManager.Get<WeaponResourceConfigManager>() = weaponConfigManager;
     _defaultWeaponLogic = new DefaultWeaponLogic();
     _freeArgs           = freeArgs;
 }
Beispiel #7
0
 public WeaponLogicManager(IWeaponDataConfigManager weaponDataConfigManager,
                           IWeaponConfigManager weaponConfigManager,
                           IFireLogicProvider fireLogicCreator,
                           IFreeArgs freeArgs)
 {
     _fireLogicCreator        = fireLogicCreator;
     _weaponDataConfigManager = weaponDataConfigManager;
     _weaponConfigManager     = weaponConfigManager;
     _defaultWeaponLogic      = new DefaultWeaponLogic();
     _freeArgs = freeArgs;
 }
        public virtual IEntity CreateDropSceneWeaponObjectEntity(WeaponScanStruct weaponScan, IEntity entity,
                                                                 int lifeTime, IFreeArgs freeArgs = null)
        {
            PlayerEntity playerEntity      = entity as PlayerEntity;
            var          dropPos           = SceneObjectDropUtil.GetDropObjectPos(playerEntity);
            var          sceneObjectEntity = CreateDropSceneWeaponObjectEntity(weaponScan, dropPos,
                                                                               lifeTime) as SceneObjectEntity;

            if (sceneObjectEntity != null && freeArgs is IEventArgs)
            {
                TriggerArgs ta     = new TriggerArgs();
                var         posVal = sceneObjectEntity.position.Value;
                ta.AddPara(new IntPara("weaponId", weaponScan.ConfigId));
                ta.AddPara(new FloatPara("weaponx", posVal.x));
                ta.AddPara(new FloatPara("weapony", posVal.y));
                ta.AddPara(new FloatPara("weaponz", posVal.z));
                ta.AddUnit("current", (FreeData)playerEntity.freeData.FreeData);
                (freeArgs as IEventArgs).Trigger(FreeTriggerConstant.WEAPON_DROP, ta);
            }

            return(sceneObjectEntity);
        }
        protected void PlayerReportTrigger(GameOverPlayer gameOverPlayer, IPlayerInfo playerInfo, IFreeArgs freeArgs)
        {
            SimpleParable  unit = new SimpleParable();
            SimpleParaList list = new SimpleParaList();

            unit.SetList(list);
            list.AddFields(new ObjectFields(gameOverPlayer));
            list.AddFields(new ObjectFields(_dictGoPlayers));
            list.AddFields(new ObjectFields(_dictPlayers));
            list.AddFields(new ObjectFields(_dictLeavedPlayers));
            IEventArgs args = freeArgs as IEventArgs;

            if (null != args)
            {
                var playerEntity = playerInfo.PlayerEntity as PlayerEntity;
                args.Trigger(FreeTriggerConstant.PLAYER_REPORT, new TempUnit("report", unit),
                             new TempUnit("current", (FreeData)playerEntity.freeData.FreeData));
            }
        }
        /*public bool IsTeamMode()
         * {
         *  return _teamCapacity > 1;
         * }*/

        public virtual void SetStatisticData(GameOverPlayer gameOverPlayer, IPlayerInfo player, IFreeArgs freeArgs)
        {
        }
Beispiel #11
0
 public override void SetStatisticData(GameOverPlayer gameOverPlayer, IPlayerInfo playerInfo, IFreeArgs freeArgs)
 {
     gameOverPlayer.Id = playerInfo.PlayerId;
     if (null == playerInfo.StatisticsData)
     {
         Logger.Error("player's statisticsData is null ");
         return;
     }
     gameOverPlayer.Score = playerInfo.StatisticsData.KillCount;
     foreach (EStatisticsID eId in Enum.GetValues(typeof(EStatisticsID)))
     {
         gameOverPlayer.Statistics.Add((int)eId, 0);
     }
     gameOverPlayer.Statistics[(int)EStatisticsID.KillCount]           = playerInfo.StatisticsData.KillCount;
     gameOverPlayer.Statistics[(int)EStatisticsID.HitDownCount]        = playerInfo.StatisticsData.HitDownCount;
     gameOverPlayer.Statistics[(int)EStatisticsID.PlayerDamage]        = Convert.ToInt32(playerInfo.StatisticsData.PlayerDamage);
     gameOverPlayer.Statistics[(int)EStatisticsID.TotalDamage]         = Convert.ToInt32(playerInfo.StatisticsData.TotalDamage);
     gameOverPlayer.Statistics[(int)EStatisticsID.ShootingCount]       = playerInfo.StatisticsData.ShootingCount;
     gameOverPlayer.Statistics[(int)EStatisticsID.ShootingSuccCount]   = playerInfo.StatisticsData.ShootingSuccCount;
     gameOverPlayer.Statistics[(int)EStatisticsID.ShootingPlayerCount] = playerInfo.StatisticsData.ShootingPlayerCount;
     gameOverPlayer.Statistics[(int)EStatisticsID.CritCount]           = playerInfo.StatisticsData.CritCount;
     gameOverPlayer.Statistics[(int)EStatisticsID.TotalMoveDistance]   = Convert.ToInt32(playerInfo.StatisticsData.TotalMoveDistance);
     gameOverPlayer.Statistics[(int)EStatisticsID.VehicleMoveDistance] = Convert.ToInt32(playerInfo.StatisticsData.VehicleMoveDistance);
     gameOverPlayer.Statistics[(int)EStatisticsID.AssistCount]         = playerInfo.StatisticsData.AssistCount;
     gameOverPlayer.Statistics[(int)EStatisticsID.CureVolume]          = Convert.ToInt32(playerInfo.StatisticsData.CureVolume);
     gameOverPlayer.Statistics[(int)EStatisticsID.AccSpeedTime]        = playerInfo.StatisticsData.AccSpeedTime;
     gameOverPlayer.Statistics[(int)EStatisticsID.SaveCount]           = playerInfo.StatisticsData.SaveCount;
     gameOverPlayer.Statistics[(int)EStatisticsID.TotalBeDamage]       = Convert.ToInt32(playerInfo.StatisticsData.TotalBeDamage);
     gameOverPlayer.Statistics[(int)EStatisticsID.DefenseDamage]       = Convert.ToInt32(playerInfo.StatisticsData.DefenseDamage);
     gameOverPlayer.Statistics[(int)EStatisticsID.DeadCount]           = playerInfo.StatisticsData.DeadCount;
     gameOverPlayer.Statistics[(int)EStatisticsID.KillDistance]        = Convert.ToInt32(playerInfo.StatisticsData.MaxKillDistance);
     gameOverPlayer.Statistics[(int)EStatisticsID.DestroyVehicle]      = playerInfo.StatisticsData.DestroyVehicle;
     gameOverPlayer.Statistics[(int)EStatisticsID.UseThrowingCount]    = playerInfo.StatisticsData.UseThrowingCount;
     gameOverPlayer.Statistics[(int)EStatisticsID.IsFullArmed]         = playerInfo.StatisticsData.IsFullArmed ? 1 : 0;
     gameOverPlayer.Statistics[(int)EStatisticsID.EvenKillCount]       = playerInfo.StatisticsData.MaxEvenKillCount;
     gameOverPlayer.Statistics[(int)EStatisticsID.SwimTime]            = playerInfo.StatisticsData.SwimTime;
     gameOverPlayer.Statistics[(int)EStatisticsID.Drown]               = playerInfo.StatisticsData.Drown ? 1 : 0;
     gameOverPlayer.Statistics[(int)EStatisticsID.PoisionDead]         = playerInfo.StatisticsData.PoisionDead ? 1 : 0;
     gameOverPlayer.Statistics[(int)EStatisticsID.DropDead]            = playerInfo.StatisticsData.DropDead ? 1 : 0;
     gameOverPlayer.Statistics[(int)EStatisticsID.KillByVehicle]       = playerInfo.StatisticsData.KillByVehicle ? 1 : 0;
     gameOverPlayer.Statistics[(int)EStatisticsID.KillByPlayer]        = playerInfo.StatisticsData.KillByPlayer ? 1 : 0;
     gameOverPlayer.Statistics[(int)EStatisticsID.KillByAirBomb]       = playerInfo.StatisticsData.KillByAirBomb ? 1 : 0;
     gameOverPlayer.Statistics[(int)EStatisticsID.KillByRifle]         = playerInfo.StatisticsData.KillWithRifle;
     gameOverPlayer.Statistics[(int)EStatisticsID.KillByMachineGun]    = playerInfo.StatisticsData.KillWithMachineGun;
     gameOverPlayer.Statistics[(int)EStatisticsID.KillBySubMachineGun] = playerInfo.StatisticsData.KillWithSubmachineGun;
     gameOverPlayer.Statistics[(int)EStatisticsID.KillByThrowWeapon]   = playerInfo.StatisticsData.KillWithThrowWeapon;
     gameOverPlayer.Statistics[(int)EStatisticsID.KillByMelee]         = playerInfo.StatisticsData.KillWithMelee;
     gameOverPlayer.Statistics[(int)EStatisticsID.KillByPistol]        = playerInfo.StatisticsData.KillWithPistol;
     gameOverPlayer.Statistics[(int)EStatisticsID.KillBySniper]        = playerInfo.StatisticsData.KillWithSniper;
     gameOverPlayer.Statistics[(int)EStatisticsID.KillByShotGun]       = playerInfo.StatisticsData.KillWithShotGun;
     gameOverPlayer.Statistics[(int)EStatisticsID.GameTime]            = playerInfo.StatisticsData.GameTime;
     gameOverPlayer.Statistics[(int)EStatisticsID.GameCount]           = playerInfo.StatisticsData.IsRunaway ? 0 : 1;
     gameOverPlayer.Statistics[(int)EStatisticsID.CritKillCount]       = playerInfo.StatisticsData.CritKillCount;
     gameOverPlayer.Statistics[(int)EStatisticsID.GetFirstBlood]       = playerInfo.StatisticsData.GetFirstBlood ? 1 : 0;
     gameOverPlayer.Statistics[(int)EStatisticsID.TeamCount]           = _dictTeams.Count;
     gameOverPlayer.Statistics[(int)EStatisticsID.DeadTime]            = playerInfo.StatisticsData.DeadTime;
     gameOverPlayer.Statistics[(int)EStatisticsID.AliveTime]           = (playerInfo.StatisticsData.GameTime - playerInfo.StatisticsData.DeadTime) / 1000;
     AddHonorData(gameOverPlayer, playerInfo);
     PlayerReportTrigger(gameOverPlayer, playerInfo, freeArgs);
 }
 public override void SetStatisticData(GameOverPlayer gameOverPlayer, IPlayerInfo playerInfo, IFreeArgs freeArgs)
 {
     gameOverPlayer.Id = playerInfo.PlayerId;
     if (null == playerInfo.StatisticsData)
     {
         Logger.Error("player's statisticsData is null ");
         return;
     }
     gameOverPlayer.Score = playerInfo.StatisticsData.KillCount;
     foreach (EStatisticsID eId in Enum.GetValues(typeof(EStatisticsID)))
     {
         gameOverPlayer.Statistics.Add((int)eId, 0);
     }
     gameOverPlayer.Statistics[(int)EStatisticsID.KillCount]           = playerInfo.StatisticsData.KillCount;
     gameOverPlayer.Statistics[(int)EStatisticsID.HitDownCount]        = playerInfo.StatisticsData.HitDownCount;
     gameOverPlayer.Statistics[(int)EStatisticsID.PlayerDamage]        = (int)playerInfo.StatisticsData.PlayerDamage;
     gameOverPlayer.Statistics[(int)EStatisticsID.TotalDamage]         = (int)playerInfo.StatisticsData.TotalDamage;
     gameOverPlayer.Statistics[(int)EStatisticsID.ShootingCount]       = playerInfo.StatisticsData.ShootingCount;
     gameOverPlayer.Statistics[(int)EStatisticsID.ShootingSuccCount]   = playerInfo.StatisticsData.ShootingSuccCount;
     gameOverPlayer.Statistics[(int)EStatisticsID.ShootingPlayerCount] = playerInfo.StatisticsData.ShootingPlayerCount;
     gameOverPlayer.Statistics[(int)EStatisticsID.CritCount]           = playerInfo.StatisticsData.CritCount;
     gameOverPlayer.Statistics[(int)EStatisticsID.TotalMoveDistance]   = (int)playerInfo.StatisticsData.TotalMoveDistance;
     gameOverPlayer.Statistics[(int)EStatisticsID.AssistCount]         = playerInfo.StatisticsData.AssistCount;
     gameOverPlayer.Statistics[(int)EStatisticsID.SaveCount]           = playerInfo.StatisticsData.SaveCount;
     gameOverPlayer.Statistics[(int)EStatisticsID.TotalBeDamage]       = (int)playerInfo.StatisticsData.TotalBeDamage;
     gameOverPlayer.Statistics[(int)EStatisticsID.DefenseDamage]       = (int)playerInfo.StatisticsData.DefenseDamage;
     gameOverPlayer.Statistics[(int)EStatisticsID.DeadCount]           = playerInfo.StatisticsData.DeadCount;
     gameOverPlayer.Statistics[(int)EStatisticsID.KillDistance]        = (int)playerInfo.StatisticsData.MaxKillDistance;
     gameOverPlayer.Statistics[(int)EStatisticsID.UseThrowingCount]    = playerInfo.StatisticsData.UseThrowingCount;
     gameOverPlayer.Statistics[(int)EStatisticsID.EvenKillCount]       = playerInfo.StatisticsData.MaxEvenKillCount;
     gameOverPlayer.Statistics[(int)EStatisticsID.KillByRifle]         = playerInfo.StatisticsData.KillWithRifle;
     gameOverPlayer.Statistics[(int)EStatisticsID.KillByMachineGun]    = playerInfo.StatisticsData.KillWithMachineGun;
     gameOverPlayer.Statistics[(int)EStatisticsID.KillBySubMachineGun] = playerInfo.StatisticsData.KillWithSubmachineGun;
     gameOverPlayer.Statistics[(int)EStatisticsID.KillByThrowWeapon]   = playerInfo.StatisticsData.KillWithThrowWeapon;
     gameOverPlayer.Statistics[(int)EStatisticsID.KillByMelee]         = playerInfo.StatisticsData.KillWithMelee;
     gameOverPlayer.Statistics[(int)EStatisticsID.KillByPistol]        = playerInfo.StatisticsData.KillWithPistol;
     gameOverPlayer.Statistics[(int)EStatisticsID.KillBySniper]        = playerInfo.StatisticsData.KillWithSniper;
     gameOverPlayer.Statistics[(int)EStatisticsID.KillByShotGun]       = playerInfo.StatisticsData.KillWithShotGun;
     gameOverPlayer.Statistics[(int)EStatisticsID.GameTime]            = playerInfo.StatisticsData.GameTime;
     gameOverPlayer.Statistics[(int)EStatisticsID.GameCount]           = playerInfo.StatisticsData.IsRunaway ? 0 : 1;
     gameOverPlayer.Statistics[(int)EStatisticsID.CritKillCount]       = playerInfo.StatisticsData.CritKillCount;
     gameOverPlayer.Statistics[(int)EStatisticsID.C4SetCount]          = playerInfo.StatisticsData.C4PlantCount;
     gameOverPlayer.Statistics[(int)EStatisticsID.C4DefuseCount]       = playerInfo.StatisticsData.C4DefuseCount;
     gameOverPlayer.Statistics[(int)EStatisticsID.GetFirstBlood]       = playerInfo.StatisticsData.GetFirstBlood ? 1 : 0;
     if (((PlayerEntity)playerInfo.PlayerEntity).gamePlay.LifeState != (int)EPlayerLifeState.Alive)
     {
         playerInfo.StatisticsData.DeadTime += (int)System.DateTime.Now.Ticks / 10000 - playerInfo.StatisticsData.LastDeadTime;
     }
     gameOverPlayer.Statistics[(int)EStatisticsID.DeadTime] = playerInfo.StatisticsData.DeadTime;
     AddHonorData(gameOverPlayer, playerInfo);
     PlayerReportTrigger(gameOverPlayer, playerInfo, freeArgs);
 }
Beispiel #13
0
        public override void SetStatisticData(GameOverPlayer gameOverPlayer, IPlayerInfo playerInfo, IFreeArgs freeArgs)
        {
            gameOverPlayer.Id = playerInfo.PlayerId;
            if (null == playerInfo.StatisticsData)
            {
                Logger.Error("player's statisticsData is null ");
                return;
            }
            gameOverPlayer.Score = playerInfo.StatisticsData.KillCount;
            foreach (EStatisticsID eId in Enum.GetValues(typeof(EStatisticsID)))
            {
                gameOverPlayer.Statistics.Add((int)eId, 0);
            }
            int normalKills = playerInfo.StatisticsData.KillCount - playerInfo.StatisticsData.CritKillCount;

            gameOverPlayer.Statistics[(int)EStatisticsID.KillCount]           = playerInfo.StatisticsData.KillCount;
            gameOverPlayer.Statistics[(int)EStatisticsID.HitDownCount]        = playerInfo.StatisticsData.HitDownCount;
            gameOverPlayer.Statistics[(int)EStatisticsID.PlayerDamage]        = Convert.ToInt32(playerInfo.StatisticsData.PlayerDamage);
            gameOverPlayer.Statistics[(int)EStatisticsID.TotalDamage]         = Convert.ToInt32(playerInfo.StatisticsData.TotalDamage);
            gameOverPlayer.Statistics[(int)EStatisticsID.ShootingCount]       = playerInfo.StatisticsData.ShootingCount;
            gameOverPlayer.Statistics[(int)EStatisticsID.ShootingSuccCount]   = playerInfo.StatisticsData.ShootingSuccCount;
            gameOverPlayer.Statistics[(int)EStatisticsID.ShootingPlayerCount] = playerInfo.StatisticsData.ShootingPlayerCount;
            gameOverPlayer.Statistics[(int)EStatisticsID.CritCount]           = playerInfo.StatisticsData.CritCount;
            gameOverPlayer.Statistics[(int)EStatisticsID.TotalMoveDistance]   = Convert.ToInt32(playerInfo.StatisticsData.TotalMoveDistance);
            gameOverPlayer.Statistics[(int)EStatisticsID.AssistCount]         = playerInfo.StatisticsData.AssistCount;
            gameOverPlayer.Statistics[(int)EStatisticsID.SaveCount]           = playerInfo.StatisticsData.SaveCount;
            gameOverPlayer.Statistics[(int)EStatisticsID.TotalBeDamage]       = Convert.ToInt32(playerInfo.StatisticsData.TotalBeDamage);
            gameOverPlayer.Statistics[(int)EStatisticsID.DefenseDamage]       = Convert.ToInt32(playerInfo.StatisticsData.DefenseDamage);
            gameOverPlayer.Statistics[(int)EStatisticsID.DeadCount]           = playerInfo.StatisticsData.DeadCount;
            gameOverPlayer.Statistics[(int)EStatisticsID.KillDistance]        = Convert.ToInt32(playerInfo.StatisticsData.MaxKillDistance);
            gameOverPlayer.Statistics[(int)EStatisticsID.UseThrowingCount]    = playerInfo.StatisticsData.UseThrowingCount;
            gameOverPlayer.Statistics[(int)EStatisticsID.EvenKillCount]       = playerInfo.StatisticsData.MaxEvenKillCount;
            gameOverPlayer.Statistics[(int)EStatisticsID.KillByRifle]         = playerInfo.StatisticsData.KillWithRifle;
            gameOverPlayer.Statistics[(int)EStatisticsID.KillByMachineGun]    = playerInfo.StatisticsData.KillWithMachineGun;
            gameOverPlayer.Statistics[(int)EStatisticsID.KillBySubMachineGun] = playerInfo.StatisticsData.KillWithSubmachineGun;
            gameOverPlayer.Statistics[(int)EStatisticsID.KillByThrowWeapon]   = playerInfo.StatisticsData.KillWithThrowWeapon;
            gameOverPlayer.Statistics[(int)EStatisticsID.KillByMelee]         = playerInfo.StatisticsData.KillWithMelee;
            gameOverPlayer.Statistics[(int)EStatisticsID.KillByPistol]        = playerInfo.StatisticsData.KillWithPistol;
            gameOverPlayer.Statistics[(int)EStatisticsID.KillBySniper]        = playerInfo.StatisticsData.KillWithSniper;
            gameOverPlayer.Statistics[(int)EStatisticsID.KillByShotGun]       = playerInfo.StatisticsData.KillWithShotGun;
            gameOverPlayer.Statistics[(int)EStatisticsID.GameTime]            = playerInfo.StatisticsData.GameTime;
            gameOverPlayer.Statistics[(int)EStatisticsID.GameCount]           = playerInfo.StatisticsData.IsRunaway ? 0 : 1;
            gameOverPlayer.Statistics[(int)EStatisticsID.CritKillCount]       = playerInfo.StatisticsData.CritKillCount;
            gameOverPlayer.Statistics[(int)EStatisticsID.C4SetCount]          = playerInfo.StatisticsData.C4PlantCount;
            gameOverPlayer.Statistics[(int)EStatisticsID.C4DefuseCount]       = playerInfo.StatisticsData.C4DefuseCount;
            gameOverPlayer.Statistics[(int)EStatisticsID.GetFirstBlood]       = playerInfo.StatisticsData.GetFirstBlood ? 1 : 0;
            gameOverPlayer.Statistics[(int)EStatisticsID.DeadTime]            = playerInfo.StatisticsData.DeadTime;
            gameOverPlayer.Statistics[(int)EStatisticsID.NormalKills]         = Math.Max(0, normalKills);
            AddHonorData(gameOverPlayer, playerInfo);
            PlayerReportTrigger(gameOverPlayer, playerInfo, freeArgs);
        }