5 private ref array<ref SCR_BaseEditorEffect> m_EffectsSendPingFromPlayer;
8 private ref array<ref SCR_BaseEditorEffect> m_EffectsSendPingFromEditor;
11 private ref array<ref SCR_BaseEditorEffect> m_EffectsSendPingUnlimitedOnlyFromPlayer;
14 private ref array<ref SCR_BaseEditorEffect> m_EffectsSendPingUnlimitedOnlyFromEditor;
17 private ref array<ref SCR_BaseEditorEffect> m_EffectsReceivePingFromPlayer;
20 private ref array<ref SCR_BaseEditorEffect> m_EffectsReceivePingFromEditor;
23 private ref array<ref SCR_BaseEditorEffect> m_EffectsReceivePingUnlimitedOnlyFromPlayer;
26 private ref array<ref SCR_BaseEditorEffect> m_EffectsReceivePingUnlimitedOnlyFromEditor;
28 void ActivateEffects(
SCR_PingEditorComponent component,
bool isReceiver,
int reporterID,
bool reporterInEditor,
bool unlimitedOnly,
vector position, set<SCR_EditableEntityComponent> targets)
72 [
Attribute(defvalue:
"10",
desc:
"How long (in seconds) a ping entity exists before being deleted. Fading is done speratly from this value in SCR_PingEffectsEditorUIComponent.")]
75 [
Attribute(defvalue:
"0.75",
desc:
"How long (in seconds) is the ping on cooldown to prevent spamming.",
params:
"0, inf, 0.05")]
119 if (manager.IsLimited())
121 SCR_NotificationsComponent.SendLocal(
ENotification.EDITOR_GM_ONLY_PING_LIMITED_RIGHTS);
125 else if (!manager.IsOpened())
135 SCR_NotificationsComponent.SendLocal(
ENotification.EDITOR_PING_NO_GM_TO_PING);
139 int reporterID = manager.GetPlayerID();
140 bool reporterInEditor = manager.IsOpened() && !manager.IsLimited();
142 if (target) target.GetPos(
position);
143 CallEvents(manager,
false, reporterID, reporterInEditor, unlimitedOnly,
position, target);
184 if (!manager)
return;
186 int reporterID = manager.GetPlayerID();
187 bool reporterInEditor = manager.IsOpened() && !manager.IsLimited();
194 m_Core.Event_OnEditorManagerPing.Invoke(reporterID, reporterInEditor, reporterEntity, unlimitedOnly,
position, targetID);
200 if (!manager || manager.GetPlayerID() == reporterID)
203 if (unlimitedOnly && manager.IsLimited())
207 if (!reporterInEditor)
210 if (!manager.IsOpened() || manager.IsLimited())
214 SCR_AccessKeysEditorComponent accessKeysManager = SCR_AccessKeysEditorComponent.Cast(manager.FindComponent(SCR_AccessKeysEditorComponent));
215 if (accessKeysManager && reporterEntity && !reporterEntity.
HasAccessInHierarchy(accessKeysManager.GetAccessKey()))
226 if (!manager)
return;
228 if (unlimitedOnly && manager.IsLimited())
232 CallEvents(manager,
false, reporterID, reporterInEditor, unlimitedOnly,
position, target);
293 set<SCR_EditableEntityComponent> targets =
new set<SCR_EditableEntityComponent>;
294 if (target) targets.Insert(target);
306 if (prefabData) prefabData.ActivateEffects(
this, isReceiver, reporterID, reporterInEditor, unlimitedOnly,
position, targets);
312 Expire(reporterID, prevPingEntity);
321 int targetPlayerID = 0;
328 targetPlayerID = SCR_PossessingManagerComponent.GetPlayerIdFromMainEntity(target.GetOwner());
335 if (reporterInEditor)
341 else if (targetPlayerID > 0)
342 SCR_NotificationsComponent.SendLocal(
ENotification.EDITOR_PING_GM_TARGET_PLAYER, reporterID, targetPlayerID);
345 SCR_NotificationsComponent.SendLocal(
ENotification.EDITOR_PING_GM_TARGET_ENTITY, reporterID, targetID);
352 else if (targetPlayerID > 0)
353 SCR_NotificationsComponent.SendLocal(
ENotification.EDITOR_PING_PLAYER_TARGET_PLAYER, reporterID, targetPlayerID);
356 SCR_NotificationsComponent.SendLocal(
ENotification.EDITOR_PING_PLAYER_TARGET_ENTITY, reporterID, targetID);
363 SCR_NotificationsComponent.SendLocalUnlimitedEditor(
ENotification.EDITOR_GM_ONLY_PING,
position, reporterID);
365 else if (targetPlayerID > 0)
366 SCR_NotificationsComponent.SendLocalUnlimitedEditor(
ENotification.EDITOR_GM_ONLY_PING_TARGET_PLAYER, reporterID, targetPlayerID);
369 SCR_NotificationsComponent.SendLocalUnlimitedEditor(
ENotification.EDITOR_GM_ONLY_PING_TARGET_ENTITY, reporterID, targetID);
376 if (pingEntity &&
m_PlayerPings.Find(reporterID, currentPingEntity) && pingEntity == currentPingEntity)
ArmaReforgerScripted GetGame()
enum EAIGroupCombatMode ComponentEditorProps(category:"GameScripted/AI", description:"Component for utility AI system for groups")
void SCR_EditorManagerEntity(IEntitySource src, IEntity parent)
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
void Rpc(func method, void p0=NULL, void p1=NULL, void p2=NULL, void p3=NULL, void p4=NULL, void p5=NULL, void p6=NULL, void p7=NULL)
Replication item identifier.
void SCR_BaseEditorComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
EntityComponentPrefabData GetEditorComponentData()
SCR_EditorManagerEntity GetManager()
bool HasEntityFlag(EEditableEntityFlag flag)
bool HasAccessInHierarchy(EEditableEntityAccessKey accessKey)
bool Delete(bool changedByUser=false, bool updateNavmesh=false)
static SCR_EditableEntityComponent GetEditableEntity(IEntity owner)
Core component to manage SCR_EditorManagerEntity.
float m_fCurrentCooldownTime
ref ScriptInvoker Event_OnPingReceive
ref ScriptInvoker Event_OnPingEntityRegister
void ReceivePingOwner(int reporterID, bool reporterInEditor, bool unlimitedOnly, vector position, RplId targetID)
float m_fCooldownUpdateFreq
SCR_EditorManagerCore m_Core
ScriptInvoker GetOnPingReceive()
ScriptInvoker GetOnPingEntityUnregister()
ScriptInvoker GetOnPingSend()
SCR_EditableEntityComponent m_LastPingEntity
int GetPlayerPings(out notnull map< int, SCR_EditableEntityComponent > outPlayerPings)
ref ScriptInvoker Event_OnPingSend
ref ScriptInvoker Event_OnPingEntityUnregister
void SendPingServer(bool unlimitedOnly, vector position, RplId targetID)
float m_fPingEntityLifetime
void Expire(int reporterID, SCR_EditableEntityComponent pingEntity)
void ~SCR_PingEditorComponent()
ref map< int, SCR_EditableEntityComponent > m_PlayerPings
void SendPing(bool unlimitedOnly=false, vector position=vector.Zero, SCR_EditableEntityComponent target=null)
override void EOnEffect(SCR_BaseEditorEffect effect)
void SCR_PingEditorComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
void CallEvents(SCR_EditorManagerEntity manager, bool isReceiver, int reporterID, bool reporterInEditor, bool unlimitedOnly, vector position, SCR_EditableEntityComponent target)
ScriptInvoker GetOnPingEntityRegister()
void ReceivePing(int reporterID, bool reporterInEditor, SCR_EditableEntityComponent reporterEntity, bool unlimitedOnly, vector position, RplId targetID)
bool HasPlayerWithUnlimitedEditor()
EEditableEntityFlag
Unique flags of the entity.
SCR_FieldOfViewSettings Attribute
void RplRpc(RplChannel channel, RplRcver rcver, RplCondition condition=RplCondition.None, string customConditionName="")
RplChannel
Communication channel. Reliable is guaranteed to be delivered. Unreliable not.