42 IEntity entity = instigatorContextData.GetVictimEntity();
48 bool isUnlimitedEditor =
false;
53 isUnlimitedEditor = !editorManager.IsLimited();
56 if (!isUnlimitedEditor && m_iKillFeedType ==
EKillFeedType.DISABLED)
59 IEntity killerEntity = instigatorContextData.GetKillerEntity();
61 int victimPlayerId = SCR_PossessingManagerComponent.GetPlayerIdFromControlledEntity(entity);
64 if (victimPlayerId <= 0)
71 if (!localPlayerFaction && !isUnlimitedEditor)
74 bool forceFullKillfeed;
77 if (localPlayerFaction && !isUnlimitedEditor && m_iReceiveKillFeedType != EKillFeedReceiveType.ALL)
85 if (victimPlayerId > 0)
92 if (FactionAffiliation)
93 victimFaction = FactionAffiliation.GetAffiliatedFaction();
98 bool victimIsFriendly = (scrLocalPlayerFaction && scrLocalPlayerFaction.
DoCheckIfFactionFriendly(scrLocalPlayerFaction)) || (!scrLocalPlayerFaction && localPlayerFaction.IsFactionFriendly(victimFaction));
101 if (!isUnlimitedEditor && victimIsFriendly && m_eFriendlyFireKillFeedType != SCR_EFriendlyFireKillFeedType.DEFAULT_SETTINGS && instigatorContextData.HasAnyVictimKillerRelation(
SCR_ECharacterDeathStatusRelations.KILLED_BY_FRIENDLY_PLAYER))
104 if (m_eFriendlyFireKillFeedType == SCR_EFriendlyFireKillFeedType.SHOW_FRIENDLY_KILLS_TO_TEAM)
105 forceFullKillfeed =
true;
107 else if (m_eFriendlyFireKillFeedType == SCR_EFriendlyFireKillFeedType.SHOW_FRIENDLY_KILLS_TO_PLAYERS_INVOLVED)
108 forceFullKillfeed = (localPlayerID == instigatorContextData.GetKillerPlayerID() || localPlayerID == victimPlayerId);
111 if (!forceFullKillfeed)
113 switch (m_iReceiveKillFeedType)
116 case EKillFeedReceiveType.GROUP_ONLY :
119 if (localPlayerID != victimPlayerId)
122 if (!victimIsFriendly)
130 SCR_AIGroup localPlayerGroup = groupManager.GetPlayerGroup(localPlayerID);
133 if (!localPlayerGroup || !localPlayerGroup.
IsPlayerInGroup(victimPlayerId))
141 case EKillFeedReceiveType.SAME_FACTION_ONLY :
144 if (localPlayerID != victimPlayerId)
147 if (!localPlayerFaction || localPlayerFaction != victimFaction)
151 if (!victimIsFriendly)
159 case EKillFeedReceiveType.ALLIES_ONLY :
162 if (localPlayerID != victimPlayerId)
165 if (!victimIsFriendly)
173 case EKillFeedReceiveType.ENEMIES_ONLY :
176 if (localPlayerID == victimPlayerId)
180 if (victimIsFriendly)
192 int killerPlayerID = instigatorContextData.GetKillerPlayerID();
200 if (killerPlayerID <= 0)
203 SCR_NotificationsComponent.SendLocal(
ENotification.PLAYER_DIED, victimPlayerId);
207 SCR_NotificationsComponent.SendLocal(
ENotification.PLAYER_KILLED_BY_EDITOR_PLAYER, victimPlayerId, killerPlayerID);
212 if (killerPlayerID <= 0)
215 SCR_NotificationsComponent.SendLocal(
ENotification.PLAYER_DIED, victimPlayerId);
219 SCR_NotificationsComponent.SendLocalUnlimitedEditor(
ENotification.POSSESSED_AI_KILLED_BY_EDITOR_PLAYER, victimPlayerId, killerPlayerID);
226 if (!isUnlimitedEditor && m_iKillFeedType ==
EKillFeedType.UNKNOWN_KILLER && !forceFullKillfeed)
230 SCR_NotificationsComponent.SendLocal(
ENotification.PLAYER_DIED, victimPlayerId);
233 SCR_NotificationsComponent.SendLocalUnlimitedEditor(
ENotification.POSSESSED_AI_DIED, victimPlayerId);
244 SCR_NotificationsComponent.SendLocal(
ENotification.PLAYER_DIED, victimPlayerId);
247 SCR_NotificationsComponent.SendLocalUnlimitedEditor(
ENotification.POSSESSED_AI_DIED, victimPlayerId);
255 SCR_NotificationsComponent.SendLocal(
ENotification.PLAYER_KILLED_PLAYER, killerPlayerID, victimPlayerId);
257 SCR_NotificationsComponent.SendLocalUnlimitedEditor(
ENotification.PLAYER_KILLED_POSSESSED_AI, killerPlayerID, victimPlayerId);
266 SCR_EditableCharacterComponent editableCharacterComponent = SCR_EditableCharacterComponent.Cast(killerEntity.
FindComponent(SCR_EditableCharacterComponent));
267 if (editableCharacterComponent)
268 killerRplId =
Replication.FindItemId(editableCharacterComponent);
271 if (!killerRplId.IsValid())
275 SCR_NotificationsComponent.SendLocal(
ENotification.PLAYER_DIED, victimPlayerId);
278 SCR_NotificationsComponent.SendLocalUnlimitedEditor(
ENotification.POSSESSED_AI_DIED, victimPlayerId);
289 SCR_NotificationsComponent.SendLocalLimitedEditor(
ENotification.AI_KILLED_PLAYER, killerRplId, victimPlayerId);
290 SCR_NotificationsComponent.SendLocalUnlimitedEditor(
ENotification.POSSESSED_AI_KILLED_PLAYER, killerPlayerID, victimPlayerId);
294 SCR_NotificationsComponent.SendLocalUnlimitedEditor(
ENotification.POSSESSED_AI_KILLED_POSSESSED_AI, killerPlayerID, victimPlayerId);
303 SCR_NotificationsComponent.SendLocal(
ENotification.AI_KILLED_PLAYER, killerRplId, victimPlayerId);
305 SCR_NotificationsComponent.SendLocalUnlimitedEditor(
ENotification.AI_KILLED_POSSESSED_AI, killerRplId, victimPlayerId);
312 SCR_NotificationsComponent.SendLocal(
ENotification.PLAYER_DIED, victimPlayerId);
314 SCR_NotificationsComponent.SendLocalUnlimitedEditor(
ENotification.POSSESSED_AI_DIED, victimPlayerId);
355 bool hasUnlimitedEditor = editorManager && !editorManager.IsLimited();
358 if (hasUnlimitedEditor)
359 SCR_NotificationsComponent.SendToEveryone(
ENotification.EDITOR_GM_LEFT, playerId);
361 bool isKickedOrBanned =
false;
364 if (m_PlayerKickReasonsConfig)
366 string groupId, reasonId;
371 GetGame().GetFullKickReason(cause, groupInt, reasonInt, groupId, reasonId);
375 isKickedOrBanned = preset != null && !preset.m_sMessage.IsEmpty();
380 Print(
"'SCR_NotificationSenderComponent' has no 'm_PlayerKickReasonsConfig'! Make sure it is added else it will never know if a player was kicked!",
LogLevel.ERROR);
384 if (isKickedOrBanned || timeout != 0)
386 SCR_DataCollectorComponent dataCollector =
GetGame().GetDataCollector();
396 if (banTimeOut > 0 && banTimeOut > timeout)
397 timeout = banTimeOut;
405 else if (timeout < 0)
412 else if (m_bShowPlayerLeftNotification && !hasUnlimitedEditor)
414 SCR_NotificationsComponent.SendToEveryone(
ENotification.PLAYER_LEFT, playerId);