Exemple #1
0
        public void ShowMessageOnUserSuicides(SelfDestructionBattleUserEvent e, BattleUserNode user, [JoinByUser] UserNode suicidedUser, BattleUserNode user2Team, [JoinByTeam] Optional <TeamNode> team, [JoinAll] CombatEventLogNode combatEventLog)
        {
            Color  color       = this.GetTeamColor(team, user, combatEventLog);
            string messageText = CombatEventLogUtil.ApplyPlaceholder(combatEventLog.combatLogCommonMessages.SuicideMessage, "{user}", suicidedUser.userRank.Rank, suicidedUser.userUid.Uid, color);

            combatEventLog.uiLog.UILog.AddMessage(messageText);
        }
Exemple #2
0
 public void AddDMSpectatorUIColor(NodeAddedEvent e, [Combine] BattleUserNode battleUser, [JoinByBattle] DMNode battle, [Context, JoinByBattle] SpectatorBattleUserNode spectatorBattleUser)
 {
     if (!spectatorBattleUser.Entity.Id.Equals(battleUser.Entity.Id))
     {
         battleUser.Entity.AddComponent(new ColorInBattleComponent(TeamColor.NONE));
     }
 }
Exemple #3
0
 public void AddDMUIColor(NodeAddedEvent e, [Combine] BattleUserNode battleUser, [JoinByBattle] DMNode battle, [Context, JoinByBattle] TankBattleUserNode tankBattleUser)
 {
     if (!tankBattleUser.Entity.Id.Equals(battleUser.Entity.Id))
     {
         battleUser.Entity.AddComponent(new ColorInBattleComponent(TeamColor.RED));
     }
 }
Exemple #4
0
 public void Update(TimeUpdateEvent e, BattleUserNode selfBattleUser, [JoinByUser] SingleNode <RoundUserComponent> selfRoundUser, [JoinByBattle] ICollection <SingleNode <RoundUserComponent> > allRoundUsers, [JoinAll] StatisticsNode statistics)
 {
     if (!RoundTimeTooShortForMeasuring(statistics))
     {
         PerformanceStatisticsHelperComponent performanceStatisticsHelper = statistics.performanceStatisticsHelper;
         int durationInMs = (int)(e.DeltaTime * 1000f);
         performanceStatisticsHelper.frames.AddFrame(durationInMs);
         performanceStatisticsHelper.tankCount.Add(allRoundUsers.Count, durationInMs);
     }
 }
Exemple #5
0
        public void RedirectEventToTargetOnTargetDeath(KillEvent e, BattleUserNode battleUser, [JoinByUser] UserNode user, BattleUserNode battleUser2Team, [JoinByTeam] Optional <TeamNode> team)
        {
            ShowMessageAfterKilledEvent eventInstance = new ShowMessageAfterKilledEvent {
                KillerUserUid = user.userUid.Uid,
                killerRank    = user.userRank.Rank,
                killerTeam    = this.GetColor(team, battleUser),
                killerItem    = e.KillerMarketItem.Id
            };

            base.ScheduleEvent(eventInstance, e.Target);
        }
        public void InputListner(UpdateEvent e, BattleUserNode user)
        {
            int checkPeriodicTimeSec = user.idleKickConfig.CheckPeriodicTimeSec;

            if (InputManager.IsAnyKey() || this.IsMouseMovement())
            {
                Date now = Date.Now;
                if ((now - user.idleKickCheckLastTime.CheckLastTime) > checkPeriodicTimeSec)
                {
                    base.ScheduleEvent <ResetIdleKickTimeEvent>(user);
                    user.idleKickCheckLastTime.CheckLastTime = now;
                }
            }
        }
        public void UpdateGUI(UpdateEvent e, BattleUserNode battleUser, [JoinByUser] Optional <BattleUserCounterNode> idleCounter, [JoinBy(typeof(BattleGroupComponent))] ActiveRoundNode activeRound, [JoinAll] VisiblePauseServiceMessageNode serviceMessage)
        {
            bool flag  = idleCounter.IsPresent();
            bool flag2 = battleUser.Entity.HasComponent <PauseComponent>();
            int  num   = 0;

            if (flag)
            {
                num = (int)Math.Ceiling((double)IdleKickUtils.CalculateTimeLeft(idleCounter.Get().idleCounter, idleCounter.Get().idleBeginTime, idleCounter.Get().idleKickConfig));
            }
            if ((flag2 && flag) && (idleCounter.Get().idleBeginTime.IdleBeginTime != null))
            {
                serviceMessage.timer.Timer.SecondsLeft = num;
            }
        }
        public void OnBattleStart(NodeAddedEvent e, CombatEventLogNode combatEventLog, BattleUserNode battleUser, [JoinByBattle] SingleNode <DMComponent> dm)
        {
            string battleStartMessage = combatEventLog.combatLogDMMessages.BattleStartMessage;

            combatEventLog.uiLog.UILog.AddMessage(battleStartMessage);
        }
 public void FollowTank(ButtonClickEvent e, UserScoreTableRowButtonNode button, [JoinByUser] BattleUserNode battleUser, [JoinAll] SelfSpectatoUserNode spectator)
 {
     base.ScheduleEvent <CameraFollowEvent>(battleUser.Entity);
 }
Exemple #10
0
 public void ShowAssistMessage(VisualScoreAssistEvent e, BattleUserNode battleUser, [JoinAll] KillAssistElementNode killAssistNode)
 {
     killAssistNode.killAssist.AddAssistMessage(e.Score, e.Percent, e.TargetUid);
 }
Exemple #11
0
 public void LogUserTryGoToBattle(NodeAddedEvent e, BattleUserNode user, [JoinByBattle] BattleNode battle, [JoinByMap] MapNode map)
 {
     this.WriteToLog("User start going to battle " + map.descriptionItem.Name);
 }
        public void RoundDisbalanced(NodeAddedEvent e, SingleNode <RoundDisbalancedComponent> roundDisbalanced, SingleNode <DisbalanceStartedWinNotificationComponent> winDisbalance, SingleNode <DisbalanceStartedLooseNotificationComponent> looseDisbalance, SingleNode <DisbalanceInfoComponent> disbalanceInfo, BattleUserNode user, [JoinByTeam] SingleNode <TeamColorComponent> team, [JoinByBattle] BattleNode battle)
        {
            TeamColor loser = roundDisbalanced.component.Loser;
            float     time  = roundDisbalanced.component.FinishTime.UnityTime - Date.Now.UnityTime;

            disbalanceInfo.component.Timer.Set(time, true);
            if (loser == team.component.TeamColor)
            {
                disbalanceInfo.component.ShowDisbalanceInfo(false, battle.battleMode.BattleMode);
                this.ActivateEffect(looseDisbalance);
            }
            else
            {
                disbalanceInfo.component.ShowDisbalanceInfo(true, battle.battleMode.BattleMode);
                this.ActivateEffect(winDisbalance);
            }
        }
Exemple #13
0
        public void NotifyAboutUserExit(NodeRemoveEvent e, BattleUserNode battleUser, [JoinByUser, Context] UserNode user, [JoinByUser] BattleUserNode battleUser2Team, [JoinByTeam] Optional <TeamNode> team, [JoinAll] CombatEventLogNode combatEventLog)
        {
            string messageText = CombatEventLogUtil.ApplyPlaceholder(combatEventLog.combatLogCommonMessages.UserLeaveBattleMessage, "{user}", user.userRank.Rank, user.userUid.Uid, this.GetTeamColor(team, battleUser, combatEventLog));

            combatEventLog.uiLog.UILog.AddMessage(messageText);
        }
Exemple #14
0
 public void ShowFlagDeliverMessage(VisualScoreFlagReturnEvent e, BattleUserNode battleUser, [JoinAll] KillAssistElementNode killAssistNode)
 {
     killAssistNode.killAssist.AddFlagReturnMessage(e.Score);
 }
Exemple #15
0
        public void CTFStartMessage(NodeAddedEvent e, BattleUserNode selfTank, [JoinByBattle] CTFBattleNode ctfBattle, [Context, JoinAll] CombatLogNode combatEventLog)
        {
            string battleStartMessage = combatEventLog.combatLogCTFMessages.BattleStartMessage;

            combatEventLog.uiLog.UILog.AddMessage(battleStartMessage);
        }
Exemple #16
0
 public void ShowHealMessage(VisualScoreHealEvent e, BattleUserNode battleUser, [JoinAll] KillAssistElementNode killAssistNode)
 {
     killAssistNode.killAssist.AddHealMessage(e.Score);
 }
 public void SetUserReady(NodeAddedEvent e, BattleUserNode user, LoadCompletedNode loadCompleted, MapNode map, [Context, JoinByMap] MapEffectNode mapEffect)
 {
     user.Entity.AddComponent <UserReadyToBattleComponent>();
     GC.Collect();
 }
Exemple #18
0
        public void ShowKilledMessage(ShowMessageAfterKilledEvent e, TankNode victimTank, [JoinByUser] UserNode victimUser, [JoinByUser] BattleUserNode user, TankNode victimTank2Team, [JoinByTeam] Optional <TeamNode> team, [JoinAll] CombatEventLogNode combatEventLog)
        {
            string messageText = CombatEventLogUtil.ApplyPlaceholder(CombatEventLogUtil.ApplyPlaceholder(combatEventLog.combatLogCommonMessages.KillMessage, "{victim}", victimUser.userRank.Rank, victimUser.userUid.Uid, this.GetTeamColor(team, user, combatEventLog)), "{killer}", e.killerRank, e.KillerUserUid, CombatEventLogUtil.GetTeamColor(e.killerTeam, combatEventLog.combatEventLog)).Replace("{killItem}", e.killerItem.ToString());

            combatEventLog.uiLog.UILog.AddMessage(messageText);
        }
Exemple #19
0
 public void ShowKilledMessage(VisualScoreKillEvent e, BattleUserNode battleUser, [JoinAll] KillAssistElementNode killAssistNode)
 {
     killAssistNode.killAssist.AddKillMessage(e.Score, e.TargetUid, e.TargetRank);
 }
Exemple #20
0
        public void PlayUpdateRankEffect(UpdateUserRankEffectEvent evt, ReadyTankNode tank, UserRankNode user, [JoinByUser] BattleUserNode battleUser)
        {
            GameObject effectPrefab = tank.updateUserRankEffect.EffectPrefab;
            GetInstanceFromPoolEvent eventInstance = new GetInstanceFromPoolEvent {
                Prefab          = effectPrefab,
                AutoRecycleTime = effectPrefab.GetComponent <UpdateRankEffectSettings>().DestroyTimeDelay
            };

            base.ScheduleEvent(eventInstance, tank);
            Transform  instance   = eventInstance.Instance;
            GameObject gameObject = instance.gameObject;
            Transform  transform  = new GameObject("RankEffectRoot").transform;

            transform.parent        = tank.tankVisualRoot.transform;
            transform.localPosition = Vector3.zero;
            transform.localRotation = Quaternion.identity;
            transform.localScale    = Vector3.one;
            transform.gameObject.AddComponent <UpdateUserRankTransformBehaviour>().Init();
            instance.parent        = transform;
            instance.localPosition = Vector3.zero;
            instance.localRotation = Quaternion.identity;
            instance.localScale    = Vector3.one;
            foreach (UpdateRankEffectParticleMovement movement in gameObject.GetComponentsInChildren <UpdateRankEffectParticleMovement>(true))
            {
                movement.parent = transform;
            }
            transform.GetComponentInChildren <UpdateRankEffectSettings>(true).icon.SetRank(user.userRank.Rank);
            gameObject.SetActive(true);
            base.NewEvent <UpdateRankEffectFinishedEvent>().Attach(battleUser).ScheduleDelayed(tank.updateUserRankEffect.FinishEventTime);
            if (!tank.Entity.HasComponent <UpdateUserRankEffectInstantiatedComponent>())
            {
                tank.Entity.AddComponent <UpdateUserRankEffectInstantiatedComponent>();
            }
            tank.Entity.RemoveComponent <UpdateUserRankEffectReadyComponent>();
        }
Exemple #21
0
 public void LoadMapResources(NodeAddedEvent e, BattleUserNode user, [JoinByBattle, Context] BattleNode battle, [JoinByMap, Context] MapNode map, [JoinAll] ICollection <SingleNode <MapComponent> > maps)
 {
Exemple #22
0
 public void SendStatisticDataOnRoundStop(NodeRemoveEvent e, SingleNode <RoundUserComponent> roundUser, [JoinByUser] BattleUserNode battleUser, [JoinByUser] SelfUserNode selfUser, [JoinByUser] SingleNode <RoundUserComponent> node, [JoinByBattle] SingleNode <BattleComponent> battle, [JoinByMap] SingleNode <MapComponent> map, [JoinAll] StatisticsNode statistics)
 {
     if (!RoundTimeTooShortForMeasuring(statistics))
     {
         PerformanceStatisticsHelperComponent performanceStatisticsHelper = statistics.performanceStatisticsHelper;
         FramesCollection         frames = performanceStatisticsHelper.frames;
         PerformanceStatisticData data   = new PerformanceStatisticData {
             UserName             = selfUser.userUid.Uid,
             GraphicDeviceName    = SystemInfo.graphicsDeviceName,
             GraphicsDeviceType   = SystemInfo.graphicsDeviceType.ToString(),
             GraphicsMemorySize   = SystemInfo.graphicsMemorySize,
             DefaultQuality       = GraphicsSettings.INSTANCE.DefaultQuality.Name,
             Quality              = QualitySettings.names[QualitySettings.GetQualityLevel()],
             Resolution           = GraphicsSettings.INSTANCE.CurrentResolution.ToString(),
             MapName              = GetMapName(map),
             BattleRoundTimeInMin = (int)((Time.realtimeSinceStartup - performanceStatisticsHelper.startRoundTimeInSec) / 60f),
             TankCountModa        = performanceStatisticsHelper.tankCount.Moda,
             Moda    = frames.Moda,
             Average = frames.Average,
             StandardDeviationInMs = frames.StandartDevation,
             HugeFrameCount        = frames.HugeFrameCount,
             MinAverageForInterval = frames.MinAverageForInterval,
             MaxAverageForInterval = frames.MaxAverageForInterval,
             GraphicDeviceKey      = $"DeviceVendorID: {SystemInfo.graphicsDeviceVendorID}; DeviceID: {SystemInfo.graphicsDeviceID}",
             AveragePing           = battleUser.battlePing.getAveragePing(),
             PingModa = battleUser.battlePing.getMediana(),
             GraphicsDeviceVersion = SystemInfo.graphicsDeviceVersion,
             CustomSettings        = GraphicsSettings.INSTANCE.customSettings,
             Windowed            = !Screen.fullScreen,
             SaturationLevel     = GraphicsSettings.INSTANCE.CurrentSaturationLevel,
             VegetationLevel     = GraphicsSettings.INSTANCE.CurrentVegetationLevel,
             GrassLevel          = GraphicsSettings.INSTANCE.CurrentGrassLevel,
             AntialiasingQuality = GraphicsSettings.INSTANCE.CurrentAntialiasingQuality,
             AnisotropicQuality  = GraphicsSettings.INSTANCE.CurrentAnisotropicQuality,
             TextureQuality      = GraphicsSettings.INSTANCE.CurrentTextureQuality,
             ShadowQuality       = GraphicsSettings.INSTANCE.CurrentShadowQuality,
             AmbientOcclusion    = GraphicsSettings.INSTANCE.currentAmbientOcclusion,
             Bloom = GraphicsSettings.INSTANCE.currentBloom,
             RenderResolutionQuality = GraphicsSettings.INSTANCE.CurrentRenderResolutionQuality,
             SystemMemorySize        = SystemInfo.systemMemorySize,
             TotalReservedMemory     = (long)Profiler.GetTotalReservedMemory(),
             TotalAllocatedMemory    = (long)Profiler.GetTotalAllocatedMemory(),
             MonoHeapSize            = (long)Profiler.GetMonoHeapSize(),
             HandlerNames            = new string[0],
             HandlerCallCounts       = new int[0]
         };
         base.Log.InfoFormat("{0}\n{1}", "PerformanceStatisticData", EcsToStringUtil.ToStringWithProperties(data, ", "));
         base.ScheduleEvent(new SendPerfomanceStatisticDataEvent(data), selfUser);
     }
 }
 public void ShowReceivedMessage(BattleChatValidMessageReceivedEvent e, BattleChatNode chatNode, [JoinAll] SelfBattleUserNode selfBattleUser, [Combine, JoinByBattle] BattleUserNode battleUserNode, [JoinByUser] UserNode userNode)
 {
     if (e.UserId == userNode.Entity.Id)
     {
         base.NewEvent(new BattleChatUserMessageReceivedEvent(e.Message)).Attach(chatNode).Attach(userNode).Schedule();
     }
 }
Exemple #24
0
        public void NotifyAboutTakenGold(GoldTakenNotificationEvent e, BattleUserNode battleUser, [JoinByUser] UserNode user, [JoinByUser] RoundUserNode roundUser, [JoinByTeam] Optional <TeamNode> team, [JoinAll] CombatEventLogNode combatEventLog)
        {
            string messageText = CombatEventLogUtil.ApplyPlaceholder(combatEventLog.combatLogCommonMessages.GoldTakenMessage, "{user}", user.userRank.Rank, user.userUid.Uid, this.GetTeamColor(team, battleUser, combatEventLog));

            combatEventLog.uiLog.UILog.AddMessage(messageText);
        }
Exemple #25
0
 private TeamColor GetColor(Optional <TeamNode> team, BattleUserNode battleUser) =>
 !team.IsPresent() ? (!battleUser.Entity.HasComponent <ColorInBattleComponent>() ? TeamColor.NONE : battleUser.Entity.GetComponent <ColorInBattleComponent>().TeamColor) : team.Get().colorInBattle.TeamColor;
Exemple #26
0
 public void ShowStreakMessage(VisualScoreStreakEvent e, BattleUserNode battleUser, [JoinAll] KillAssistElementNode killAssistNode)
 {
     killAssistNode.killAssist.AddKillStreakMessage(e.Score);
 }
 public void MarkSelfBattleUser(NodeAddedEvent e, BattleUserNode battleUser, [Context, JoinByUser] SelfUserNode user)
 {
     battleUser.Entity.AddComponent <SelfBattleUserComponent>();
 }
Exemple #28
0
 private Color GetTeamColor(Optional <TeamNode> team, BattleUserNode battleUser, CombatEventLogNode combatEventLog) =>
 CombatEventLogUtil.GetTeamColor(this.GetColor(team, battleUser), combatEventLog.combatEventLog);
Exemple #29
0
 public void Sync(IdleBeginTimeSyncEvent e, BattleUserNode battleUser)
 {
     battleUser.idleBeginTime.IdleBeginTime = new Date?(e.IdleBeginTime);
 }
Exemple #30
0
        public void KillStreakBattleLog(KillStreakEvent e, SingleNode <TankIncarnationKillStatisticsComponent> node, [JoinByUser] UserNode userNode, [JoinByUser] BattleUserNode battleUser, [JoinByUser] RoundUserNode roundUser, [JoinByTeam] Optional <TeamNode> team, [JoinAll] CombatEventLogNode combatEventLog)
        {
            int kills = node.component.Kills;

            if ((kills >= 5) && ((kills % 5) == 0))
            {
                string messageText = CombatEventLogUtil.ApplyPlaceholder(combatEventLog.combatLogCommonMessages.KillStreakMessage.Replace("{killNum}", kills.ToString()), "{user}", userNode.userRank.Rank, userNode.userUid.Uid, this.GetTeamColor(team, battleUser, combatEventLog));
                combatEventLog.uiLog.UILog.AddMessage(messageText);
            }
        }