4 static const int INVALID_RADIO_MSG_PARAM = -1;
7 protected int m_iFactionId;
8 protected int m_iBaseCallsign = SCR_MilitaryBaseComponent.INVALID_BASE_CALLSIGN;
15 protected float m_fSeed = Math.RandomFloat01();
16 protected bool m_bIsPublic =
true;
17 protected int m_iParam = INVALID_RADIO_MSG_PARAM;
27 void SetFactionId(
int factionId)
29 m_iFactionId = factionId;
33 void SetBaseCallsign(
int callsign)
35 m_iBaseCallsign = callsign;
39 void SetCallerCallsign(
int companyID,
int platoonID,
int squadID)
41 m_iCallerCompanyID = companyID;
42 m_iCallerPlatoonID = platoonID;
43 m_iCallerSquadID = squadID;
47 void SetCalledCallsign(
int companyID,
int platoonID,
int squadID)
49 m_iCalledCompanyID = companyID;
50 m_iCalledPlatoonID = platoonID;
51 m_iCalledSquadID = squadID;
55 void SetIsPublic(
bool public)
61 void SetParam(
int param)
67 void SetPlayerID(
int playerID)
79 override void OnDelivery(
BaseTransceiver receiver,
int freq,
float quality)
81 IEntity owner = receiver.GetRadio().GetOwner();
83 ChimeraCharacter player;
86 while (!player && !base)
88 player = ChimeraCharacter.Cast(owner);
94 owner = owner.GetParent();
102 int playerID =
GetGame().GetPlayerManager().GetPlayerIdFromControlledEntity(owner);
103 PlayerController controller =
GetGame().GetPlayerManager().GetPlayerController(playerID);
108 SCR_CampaignNetworkComponent comp = SCR_CampaignNetworkComponent.Cast(controller.FindComponent(SCR_CampaignNetworkComponent));
111 comp.PlayRadioMsg(m_iRadioMsg, m_iFactionId, m_iBaseCallsign, m_iCallerCompanyID, m_iCallerPlatoonID, m_iCallerSquadID, m_iCalledCompanyID, m_iCalledPlatoonID, m_iCalledSquadID, m_bIsPublic, m_iParam, m_fSeed, quality,
m_iPlayerID);
119 if (freq != receiver.GetRadio().GetTransceiver(0).GetFrequency())
122 PlayerController controller =
GetGame().GetPlayerManager().GetPlayerController(
m_iPlayerID);
127 SCR_CampaignNetworkComponent comp = SCR_CampaignNetworkComponent.Cast(controller.FindComponent(SCR_CampaignNetworkComponent));
132 comp.SetLastHQRadioMessageTimestamp(world.GetServerTimestamp());