Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_CampaignNetworkComponent.c File Reference

Go to the source code of this file.

Data Structures

class  SCR_CampaignNetworkComponentClass
 

Macros

#define ENABLE_BASE_DESTRUCTION
 

Functions

WorldTimestamp GetLastRequestTimestamp ()
 
void SetLastRequestTimestamp (WorldTimestamp timestamp)
 
protected bool IsProxy ()
 
void RepairComposition (int index, int repairCost, int destructibleID, SCR_SiteSlotEntity slotEnt, notnull SCR_CampaignMilitaryBaseComponent base)
 Repair destroyed mandatory part of composition. More...
 
void LoadSupplies (RplId suppliesID, IEntity player, SCR_CampaignMilitaryBaseComponent base, int amount=0)
 
void LoadSuppliesStandalone (RplId suppliesID, IEntity player, SCR_CampaignSuppliesComponent depot, int amount=0)
 
void StartLoading (RplId suppliesID, int supplies, bool IsUnloading=false)
 
void StopLoading (RplId suppliesID, bool IsUnloading=false)
 
void UnloadSupplies (RplId suppliesID, IEntity player, SCR_CampaignMilitaryBaseComponent base, int amount=0)
 
void AddRadio ()
 
protected void RpcAsk_AddRadio (int playerID)
 
protected void RpcDo_AddRadio (RplId ID)
 
protected void FindRadioDelayed (RplId ID)
 
void DeployMobileAsembly (notnull SCR_CampaignMobileAssemblyComponent comp, bool deploy)
 
protected void RpcAsk_DeployMobileAsembly (RplId assemblyComponentID, bool deploy, int playerID)
 
void CaptureBase (SCR_CampaignMilitaryBaseComponent base)
 
void CaptureBaseGM (SCR_CampaignMilitaryBaseComponent base, int factionIndex)
 
void ToggleBaseCapture (notnull SCR_CampaignMilitaryBaseComponent base, bool isBeingCaptured)
 
protected void RpcAsk_RepairComposition (int index, int repairCost, int destructibleID, RplId slotID, RplId baseID)
 Repair damaged entity in composition. More...
 
void AddSuppliesFromContextMenu (notnull SCR_CampaignMilitaryBaseComponent base, int suppliesCnt)
 
protected void RpcAsk_AddSuppliesFromContextMenu (RplId baseID, int suppliesCnt)
 
protected void SendToVehicleOccupants (ENotification messageID, IEntity vehicleEntity, int playerID, int number=0)
 
protected void RpcAsk_SuppliesLoadingStarted (RplId suppliesID, int playerID, int supplies, bool IsUnloading)
 
protected void RpcAsk_SuppliesLoadingCanceled (RplId suppliesID, int playerID, bool IsUnloading)
 
protected void RpcAsk_LoadSupplies (RplId suppliesID, int playerID, RplId baseID, int amount)
 
protected void RpcAsk_LoadSuppliesStandalone (RplId suppliesID, int playerID, RplId depotID, int amount)
 
protected void RpcAsk_UnloadSupplies (RplId suppliesID, int playerID, RplId baseID, int amount)
 
protected void RpcAsk_CaptureBaseBegin (RplId baseID, int factionIndex, int playerID)
 
protected void RpcAsk_CaptureBaseEnd (RplId baseID)
 
void SendPlayerMessage (SCR_ERadioMsg msgType, int baseCallsign=SCR_MilitaryBaseComponent.INVALID_BASE_CALLSIGN, int calledID=SCR_CampaignMilitaryBaseComponent.INVALID_PLAYER_INDEX, bool public=true, int param=SCR_CampaignRadioMsg.INVALID_RADIO_MSG_PARAM, bool checkHQReached=false)
 
void SetLastHQRadioMessageTimestamp (WorldTimestamp time)
 
protected int CompressCallsign (int company, int platoon, int squad)
 
protected void DecompressCallsign (int callsign, out int company, out int platoon, out int squad)
 
protected void RpcAsk_CaptureBase (RplId baseID, int factionIndex, int playerID)
 
protected void RpcDo_PlayerFeedback (int msgID)
 
protected void RpcDo_PlayerFeedbackValueBase (int msgID, float value, int baseID)
 
protected void RpcDo_PlayerFeedbackBase (int msgID, int baseID)
 
protected void PlayerFeedbackImpl (int msgID, float value=0, int assetID=-1, int baseID=-1)
 
void SendVehicleSpawnHint (int hintID)
 
protected void RpcDo_VehicleSpawnHint (int hintID)
 
void RespawnLocationPopup (int baseID)
 
void OnPlayerAliveStateChanged (bool alive)
 
void RpcDo_PlayerEnableShowingSpawnPosition (bool enable)
 
protected void HandleRadioRespawnTimer (RplId spawnPointId)
 
protected void RpcAsk_HandleRadioRespawnTimer (RplId selectedSpawnPointId)
 
void PlayRadioMsg (SCR_ERadioMsg msg, int FactionId, int baseCallsign, int callerCallsignCompany, int callerCallsignPlatoon, int callerCallsignSquad, int calledCallsignCompany, int calledCallsignPlatoon, int calledCallsignSquad, bool isPublic, int param, float seed, float quality, int playerID)
 
void RpcDo_PlayRadioMsg (SCR_ERadioMsg msg, int factionId, int baseCallsign, int callerCallsign, int calledCallsign, int param, float seed, float quality)
 
void CheckHQReached ()
 
void OnPlayerSuppliesInteraction (EResourcePlayerInteractionType interactionType, PlayerController playerController, SCR_ResourceComponent resourceComponentFrom, SCR_ResourceComponent resourceComponentTo, EResourceType resourceType, float resourceValue)
 
protected void OnSuppliesLoaded (vector position, float amount)
 
protected void OnSuppliesUnloaded (vector position, float amount, int playerId)
 
void ResetSavedSupplies ()
 
override void EOnInit (IEntity owner)
 
override void OnPostInit (IEntity owner)
 Called on PostInit when all components are added. More...
 
void ~SCR_CampaignNetworkComponent ()
 

Variables

SCR_CampaignNetworkComponentClass VEHICLE_SPAWNED
 Used to identify various notifications for client. More...
 
SCR_CampaignNetworkComponentClass NO_SPACE
 
SCR_CampaignNetworkComponentClass OUT_OF_STOCK
 
SCR_CampaignNetworkComponentClass SUPPLIES_LOADED
 
SCR_CampaignNetworkComponentClass SUPPLIES_UNLOADED
 
SCR_CampaignNetworkComponentClass m_PlayerController
 Takes care of Campaign-specific server <> client communication and requests. More...
 
protected RplComponent m_RplComponent
 
protected bool m_bFirstSpawn = true
 
protected vector m_vLastLoadedAt
 
protected vector m_vLastUnloadedAt
 
protected float m_fNoRewardSupplies
 
protected int m_iTotalSuppliesDelivered
 
protected WorldTimestamp m_fLastAssetRequestTimestamp
 
protected WorldTimestamp m_fLastHQRadioMessageTimestamp
 

Macro Definition Documentation

◆ ENABLE_BASE_DESTRUCTION

#define ENABLE_BASE_DESTRUCTION

Definition at line 1 of file SCR_CampaignNetworkComponent.c.

Function Documentation

◆ AddRadio()

void AddRadio ( )

Definition at line 193 of file SCR_CampaignNetworkComponent.c.

◆ AddSuppliesFromContextMenu()

void AddSuppliesFromContextMenu ( notnull SCR_CampaignMilitaryBaseComponent  base,
int  suppliesCnt 
)
Parameters
[in]base
[in]suppliesCnt

Definition at line 421 of file SCR_CampaignNetworkComponent.c.

◆ CaptureBase()

void CaptureBase ( SCR_CampaignMilitaryBaseComponent  base)

Send server request to capture a base (change its owner)

Parameters
[in]baseBase to be captured

Definition at line 308 of file SCR_CampaignNetworkComponent.c.

◆ CaptureBaseGM()

void CaptureBaseGM ( SCR_CampaignMilitaryBaseComponent  base,
int  factionIndex 
)
Parameters
[in]base
[in]factionIndex

Definition at line 336 of file SCR_CampaignNetworkComponent.c.

◆ CheckHQReached()

void CheckHQReached ( )

Definition at line 1238 of file SCR_CampaignNetworkComponent.c.

◆ CompressCallsign()

protected int CompressCallsign ( int  company,
int  platoon,
int  squad 
)

Definition at line 850 of file SCR_CampaignNetworkComponent.c.

◆ DecompressCallsign()

protected void DecompressCallsign ( int  callsign,
out int  company,
out int  platoon,
out int  squad 
)

Definition at line 856 of file SCR_CampaignNetworkComponent.c.

◆ DeployMobileAsembly()

void DeployMobileAsembly ( notnull SCR_CampaignMobileAssemblyComponent  comp,
bool  deploy 
)
Parameters
[in]comp
[in]deploy

Definition at line 277 of file SCR_CampaignNetworkComponent.c.

◆ FindRadioDelayed()

protected void FindRadioDelayed ( RplId  ID)

Definition at line 247 of file SCR_CampaignNetworkComponent.c.

◆ GetLastRequestTimestamp()

WorldTimestamp GetLastRequestTimestamp ( )
Returns
request cooldown

Definition at line 69 of file SCR_CampaignNetworkComponent.c.

◆ HandleRadioRespawnTimer()

protected void HandleRadioRespawnTimer ( RplId  spawnPointId)

Definition at line 1118 of file SCR_CampaignNetworkComponent.c.

◆ IsProxy()

protected bool IsProxy ( )
Returns
if the session is run as client

Definition at line 97 of file SCR_CampaignNetworkComponent.c.

◆ LoadSupplies()

void LoadSupplies ( RplId  suppliesID,
IEntity  player,
SCR_CampaignMilitaryBaseComponent  base,
int  amount = 0 
)

Send server request to load supplies at a base

Parameters
[in]suppliesIDUnique ID identifying the supplies
[in]playerPlayer trying to unload supplies
[in]baseBase at which the supplies are being unloaded
[in]amount

Definition at line 117 of file SCR_CampaignNetworkComponent.c.

◆ LoadSuppliesStandalone()

void LoadSuppliesStandalone ( RplId  suppliesID,
IEntity  player,
SCR_CampaignSuppliesComponent  depot,
int  amount = 0 
)
Parameters
[in]suppliesID
[in]player
[in]depot
[in]amount

Definition at line 137 of file SCR_CampaignNetworkComponent.c.

◆ OnPlayerAliveStateChanged()

void OnPlayerAliveStateChanged ( bool  alive)
Parameters
[in]alive

Definition at line 1074 of file SCR_CampaignNetworkComponent.c.

◆ OnPlayerSuppliesInteraction()

void OnPlayerSuppliesInteraction ( EResourcePlayerInteractionType  interactionType,
PlayerController  playerController,
SCR_ResourceComponent  resourceComponentFrom,
SCR_ResourceComponent  resourceComponentTo,
EResourceType  resourceType,
float  resourceValue 
)
Parameters
[in]interactionType
[in]playerController
[in]resourceComponentFrom
[in]resourceComponentTo
[in]resourceType
[in]resourceValue

Definition at line 1252 of file SCR_CampaignNetworkComponent.c.

◆ OnSuppliesLoaded()

protected void OnSuppliesLoaded ( vector  position,
float  amount 
)

Definition at line 1293 of file SCR_CampaignNetworkComponent.c.

◆ OnSuppliesUnloaded()

protected void OnSuppliesUnloaded ( vector  position,
float  amount,
int  playerId 
)

Definition at line 1299 of file SCR_CampaignNetworkComponent.c.

◆ PlayerFeedbackImpl()

protected void PlayerFeedbackImpl ( int  msgID,
float  value = 0,
int  assetID = -1,
int  baseID = -1 
)

Show notification about request result to the requester

Parameters
[in]msgIDMessage ID (see ECampaignClientNotificationID)
[in]value
[in]assetID
[in]baseID

Definition at line 929 of file SCR_CampaignNetworkComponent.c.

◆ PlayRadioMsg()

void PlayRadioMsg ( SCR_ERadioMsg  msg,
int  FactionId,
int  baseCallsign,
int  callerCallsignCompany,
int  callerCallsignPlatoon,
int  callerCallsignSquad,
int  calledCallsignCompany,
int  calledCallsignPlatoon,
int  calledCallsignSquad,
bool  isPublic,
int  param,
float  seed,
float  quality,
int  playerID 
)
Parameters
[in]msg
[in]FactionId
[in]baseCallsign
[in]callerCallsignCompany
[in]callerCallsignPlatoon
[in]callerCallsignSquad
[in]calledCallsignCompany
[in]calledCallsignPlatoon
[in]calledCallsignSquad
[in]isPublic
[in]param
[in]seed
[in]quality
[in]playerID

Definition at line 1187 of file SCR_CampaignNetworkComponent.c.

◆ RepairComposition()

void RepairComposition ( int  index,
int  repairCost,
int  destructibleID,
SCR_SiteSlotEntity  slotEnt,
notnull SCR_CampaignMilitaryBaseComponent  base 
)

Repair destroyed mandatory part of composition.

Definition at line 104 of file SCR_CampaignNetworkComponent.c.

◆ ResetSavedSupplies()

void ResetSavedSupplies ( )

Definition at line 1317 of file SCR_CampaignNetworkComponent.c.

◆ RespawnLocationPopup()

void RespawnLocationPopup ( int  baseID)
Parameters
[in]baseID

Definition at line 1067 of file SCR_CampaignNetworkComponent.c.

◆ RpcAsk_AddRadio()

protected void RpcAsk_AddRadio ( int  playerID)

Definition at line 200 of file SCR_CampaignNetworkComponent.c.

◆ RpcAsk_AddSuppliesFromContextMenu()

protected void RpcAsk_AddSuppliesFromContextMenu ( RplId  baseID,
int  suppliesCnt 
)

Definition at line 433 of file SCR_CampaignNetworkComponent.c.

◆ RpcAsk_CaptureBase()

protected void RpcAsk_CaptureBase ( RplId  baseID,
int  factionIndex,
int  playerID 
)

Capture a base (change its owner)

Parameters
[in]baseIDBase entity ID
[in]factionIndexIndex of new faction to own the base
[in]playerID

Definition at line 873 of file SCR_CampaignNetworkComponent.c.

◆ RpcAsk_CaptureBaseBegin()

protected void RpcAsk_CaptureBaseBegin ( RplId  baseID,
int  factionIndex,
int  playerID 
)

Definition at line 731 of file SCR_CampaignNetworkComponent.c.

◆ RpcAsk_CaptureBaseEnd()

protected void RpcAsk_CaptureBaseEnd ( RplId  baseID)

Definition at line 748 of file SCR_CampaignNetworkComponent.c.

◆ RpcAsk_DeployMobileAsembly()

protected void RpcAsk_DeployMobileAsembly ( RplId  assemblyComponentID,
bool  deploy,
int  playerID 
)

Definition at line 284 of file SCR_CampaignNetworkComponent.c.

◆ RpcAsk_HandleRadioRespawnTimer()

protected void RpcAsk_HandleRadioRespawnTimer ( RplId  selectedSpawnPointId)

Definition at line 1130 of file SCR_CampaignNetworkComponent.c.

◆ RpcAsk_LoadSupplies()

protected void RpcAsk_LoadSupplies ( RplId  suppliesID,
int  playerID,
RplId  baseID,
int  amount 
)

Load supplies at a base

Parameters
[in]suppliesIDsupplies entity ID
[in]playerIDplayer entity ID
[in]baseIDbase entity ID
[in]amount

Definition at line 540 of file SCR_CampaignNetworkComponent.c.

◆ RpcAsk_LoadSuppliesStandalone()

protected void RpcAsk_LoadSuppliesStandalone ( RplId  suppliesID,
int  playerID,
RplId  depotID,
int  amount 
)

Definition at line 606 of file SCR_CampaignNetworkComponent.c.

◆ RpcAsk_RepairComposition()

protected void RpcAsk_RepairComposition ( int  index,
int  repairCost,
int  destructibleID,
RplId  slotID,
RplId  baseID 
)

Repair damaged entity in composition.

Definition at line 368 of file SCR_CampaignNetworkComponent.c.

◆ RpcAsk_SuppliesLoadingCanceled()

protected void RpcAsk_SuppliesLoadingCanceled ( RplId  suppliesID,
int  playerID,
bool  IsUnloading 
)

Definition at line 510 of file SCR_CampaignNetworkComponent.c.

◆ RpcAsk_SuppliesLoadingStarted()

protected void RpcAsk_SuppliesLoadingStarted ( RplId  suppliesID,
int  playerID,
int  supplies,
bool  IsUnloading 
)

Definition at line 484 of file SCR_CampaignNetworkComponent.c.

◆ RpcAsk_UnloadSupplies()

protected void RpcAsk_UnloadSupplies ( RplId  suppliesID,
int  playerID,
RplId  baseID,
int  amount 
)

Unload supplies at a base

Parameters
[in]vehicleIDVehicle entity ID
[in]playerIDVehicle entity ID
[in]baseIDVehicle entity ID

Definition at line 654 of file SCR_CampaignNetworkComponent.c.

◆ RpcDo_AddRadio()

protected void RpcDo_AddRadio ( RplId  ID)

Definition at line 241 of file SCR_CampaignNetworkComponent.c.

◆ RpcDo_PlayerEnableShowingSpawnPosition()

void RpcDo_PlayerEnableShowingSpawnPosition ( bool  enable)
Parameters
[in]enable

Definition at line 1107 of file SCR_CampaignNetworkComponent.c.

◆ RpcDo_PlayerFeedback()

protected void RpcDo_PlayerFeedback ( int  msgID)

Show notification about request result to the requester

Parameters
[in]msgIDMessage ID (see ECampaignClientNotificationID)

Definition at line 896 of file SCR_CampaignNetworkComponent.c.

◆ RpcDo_PlayerFeedbackBase()

protected void RpcDo_PlayerFeedbackBase ( int  msgID,
int  baseID 
)

Show notification about request result to the requester

Parameters
[in]msgIDMessage ID (see ECampaignClientNotificationID)
[in]baseID

Definition at line 918 of file SCR_CampaignNetworkComponent.c.

◆ RpcDo_PlayerFeedbackValueBase()

protected void RpcDo_PlayerFeedbackValueBase ( int  msgID,
float  value,
int  baseID 
)

Show notification about request result to the requester

Parameters
[in]msgIDMessage ID (see ECampaignClientNotificationID)
[in]value
[in]baseID

Definition at line 907 of file SCR_CampaignNetworkComponent.c.

◆ RpcDo_PlayRadioMsg()

void RpcDo_PlayRadioMsg ( SCR_ERadioMsg  msg,
int  factionId,
int  baseCallsign,
int  callerCallsign,
int  calledCallsign,
int  param,
float  seed,
float  quality 
)
Parameters
[in]msg
[in]factionId
[in]baseCallsign
[in]callerCallsign
[in]calledCallsign
[in]param
[in]seed
[in]quality

Definition at line 1217 of file SCR_CampaignNetworkComponent.c.

◆ RpcDo_VehicleSpawnHint()

protected void RpcDo_VehicleSpawnHint ( int  hintID)

Definition at line 1054 of file SCR_CampaignNetworkComponent.c.

◆ SendPlayerMessage()

void SendPlayerMessage ( SCR_ERadioMsg  msgType,
int  baseCallsign = SCR_MilitaryBaseComponent.INVALID_BASE_CALLSIGN,
int  calledID = SCR_CampaignMilitaryBaseComponent.INVALID_PLAYER_INDEX,
bool  public = true,
int  param = SCR_CampaignRadioMsg.INVALID_RADIO_MSG_PARAM,
bool  checkHQReached = false 
)
Parameters
[in]msgType
[in]baseCallsign
[in]calledID
[in]public
[in]param
[in]checkHQReached

Definition at line 766 of file SCR_CampaignNetworkComponent.c.

◆ SendToVehicleOccupants()

protected void SendToVehicleOccupants ( ENotification  messageID,
IEntity  vehicleEntity,
int  playerID,
int  number = 0 
)
Parameters
[in]messageID
[in]vehicleEntityentity of vehicle
[in]playerIDID of player to notify about
[in]numberoptional second parameter for another int number

Definition at line 451 of file SCR_CampaignNetworkComponent.c.

◆ SendVehicleSpawnHint()

void SendVehicleSpawnHint ( int  hintID)
Parameters
[in]hintID

Definition at line 1047 of file SCR_CampaignNetworkComponent.c.

◆ SetLastHQRadioMessageTimestamp()

void SetLastHQRadioMessageTimestamp ( WorldTimestamp  time)
Parameters
[in]time

Definition at line 843 of file SCR_CampaignNetworkComponent.c.

◆ SetLastRequestTimestamp()

void SetLastRequestTimestamp ( WorldTimestamp  timestamp)
Parameters
[in]requestcooldown timestamp

Definition at line 76 of file SCR_CampaignNetworkComponent.c.

◆ StartLoading()

void StartLoading ( RplId  suppliesID,
int  supplies,
bool  IsUnloading = false 
)
Parameters
[in]suppliesID
[in]supplies
[in]IsUnloading

Definition at line 156 of file SCR_CampaignNetworkComponent.c.

◆ StopLoading()

void StopLoading ( RplId  suppliesID,
bool  IsUnloading = false 
)
Parameters
[in]suppliesID
[in]IsUnloading

Definition at line 166 of file SCR_CampaignNetworkComponent.c.

◆ ToggleBaseCapture()

void ToggleBaseCapture ( notnull SCR_CampaignMilitaryBaseComponent  base,
bool  isBeingCaptured 
)
Parameters
[in]base
[in]isBeingCaptured

Definition at line 348 of file SCR_CampaignNetworkComponent.c.

◆ UnloadSupplies()

void UnloadSupplies ( RplId  suppliesID,
IEntity  player,
SCR_CampaignMilitaryBaseComponent  base,
int  amount = 0 
)

Send server request to unload supplies at a base

Parameters
[in]truckIDUnique ID identifying the supply truck
[in]playerPlayer trying to unload supplies
[in]baseBase at which the supplies are being unloaded

Definition at line 177 of file SCR_CampaignNetworkComponent.c.

◆ ~SCR_CampaignNetworkComponent()

void ~SCR_CampaignNetworkComponent ( )

Definition at line 1357 of file SCR_CampaignNetworkComponent.c.

Variable Documentation

◆ m_bFirstSpawn

protected bool m_bFirstSpawn = true

Definition at line 24 of file SCR_CampaignNetworkComponent.c.

◆ m_fLastAssetRequestTimestamp

protected WorldTimestamp m_fLastAssetRequestTimestamp

Definition at line 43 of file SCR_CampaignNetworkComponent.c.

◆ m_fLastHQRadioMessageTimestamp

protected WorldTimestamp m_fLastHQRadioMessageTimestamp

Definition at line 46 of file SCR_CampaignNetworkComponent.c.

◆ m_fNoRewardSupplies

protected float m_fNoRewardSupplies

Definition at line 29 of file SCR_CampaignNetworkComponent.c.

◆ m_iTotalSuppliesDelivered

protected int m_iTotalSuppliesDelivered

Definition at line 31 of file SCR_CampaignNetworkComponent.c.

◆ m_PlayerController

Takes care of Campaign-specific server <> client communication and requests.

◆ m_RplComponent

protected RplComponent m_RplComponent

Definition at line 23 of file SCR_CampaignNetworkComponent.c.

◆ m_vLastLoadedAt

protected vector m_vLastLoadedAt

Definition at line 26 of file SCR_CampaignNetworkComponent.c.

◆ m_vLastUnloadedAt

protected vector m_vLastUnloadedAt

Definition at line 27 of file SCR_CampaignNetworkComponent.c.

◆ NO_SPACE

◆ OUT_OF_STOCK

◆ SUPPLIES_LOADED

◆ SUPPLIES_UNLOADED

◆ VEHICLE_SPAWNED

Used to identify various notifications for client.