Arma Reforger Script API
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
SCR_VotingManagerComponent Interface Reference
Inheritance diagram for SCR_VotingManagerComponent:
[legend]

Public Member Functions

void Vote (int playerID, EVotingType type, int value)
 Vote! If the voting does not exist yet, start it.
 
void RemoveVote (int playerID, EVotingType type, int value)
 Remove previously cast vote.
 
bool StartVoting (EVotingType type, int value=SCR_VotingBase.DEFAULT_VALUE)
 Start voting.
 
void EndVoting (EVotingType type, int value=SCR_VotingBase.DEFAULT_VALUE, EVotingOutcome outcome=EVotingOutcome.EVALUATE)
 End voting.
 
int GetPlayerVote (int playerID, EVotingType type, int value=SCR_VotingBase.DEFAULT_VALUE)
 Get value cast by given player.
 
bool GetVoteCounts (EVotingType type, int value, out int currentVotes, out int votesRequired)
 Get the amount of players needed.
 
ScriptInvoker_VotingManagerStart GetOnVotingStart ()
 Get event called everywhere when a new voting is created.
 
ScriptInvoker_VotingManagerVoteCountChanged GetOnVoteCountChanged ()
 Get event called everywhere when a player voted or abstained.
 
ScriptInvoker_VotingManagerEnd GetOnVotingEnd ()
 Get event called everywhere when a voting ends (e.g., time runs out, number of votes reaches threshold, or the player about whom the voting was disconnects).
 
ScriptInvoker_VotingManagerPlayer GetOnVote ()
 Get event called on server when a player casts a vote.
 
ScriptInvoker_VotingManagerPlayer GetOnRemoveVote ()
 Get event called on server when a player removes their vote.
 
ScriptInvoker_VotingManagerStart GetOnVoteLocal ()
 Get event called on player when they cast a vote.
 
ScriptInvoker_VotingManagerStart GetOnRemoveVoteLocal ()
 Get event called on player when they remove their vote.
 
ScriptInvoker_VotingManagerStart GetOnAbstainVoteLocal ()
 Get event called on player when they remove their vote.
 
int GetHostPlayerID ()
 Get player ID of the host player.
 
bool IsVotingAvailable (EVotingType type, int value=SCR_VotingBase.DEFAULT_VALUE)
 Check if a voting is available in the current world.
 
bool IsVoting (EVotingType type, int value=SCR_VotingBase.DEFAULT_VALUE)
 Check if a voting with given params is currently in effect.
 
bool IsVotingAboutPlayer (int playerID, EVotingType type)
 Check if there is a vote of certain type about given player.
 
void AbstainVoteLocally (EVotingType type, int value=SCR_VotingBase.DEFAULT_VALUE)
 Local player has abstained from voting eg: VoteRemove was called.
 
bool HasAbstainedLocally (EVotingType type, int value=SCR_VotingBase.DEFAULT_VALUE)
 If local player has abstained from voting eg: VoteRemove was called.
 
float GetRemainingDurationOfVote (EVotingType type, int value=SCR_VotingBase.DEFAULT_VALUE)
 
int GetVotingsAboutPlayer (int playerID, out notnull array< EVotingType > outVotingTypes, bool onlyTemplates=false, bool onlyAvailable=false)
 Get all votings about given player.
 
int GetAllVotingsAboutPlayer (bool aboutPlayer, out notnull array< EVotingType > outVotingTypes, bool onlyTemplates=false, bool onlyAvailable=false)
 Get all active player vote types (not caring which player is the target) Does not care what player the target is or if it is a referendum or election.
 
int GetAllVotingsWithValue (out notnull array< EVotingType > outVotingTypes, array< EVotingType > outValues, bool onlyTemplates=false, bool onlyAvailable=false)
 Get all votings with value defined.
 
int GetAllVotingValues (EVotingType type, out notnull array< int > outValues, bool onlyTemplates=false, bool onlyAvailable=false)
 Get a array of all active votes with the specific voteType.
 
int GetCurrentVoteCooldownForLocalPlayer (EVotingType type)
 param[in] type The voting type to get current cooldown for
 
SCR_VotingUIInfo GetVotingInfo (EVotingType type)
 Get UI representation of given voting.
 
string GetValueName (EVotingType type, int value)
 Get name of the value.
 
void PreVoteLocal (EVotingType type, int value)
 Called before the vote is cased locally to make sure the cooldowns are set if the vote was initiated by the player.
 
void VoteLocal (EVotingType type, int value)
 Save local vote for given voting.
 
void RemoveVoteLocal (EVotingType type, int value)
 Remove local vote for given voting.
 
int GetLocalVote (EVotingType type, int value=SCR_VotingBase.DEFAULT_VALUE)
 Get local vote for given voting.
 
bool IsLocalVote (EVotingType type, int value=SCR_VotingBase.DEFAULT_VALUE)
 Check if local vote was cast.
 
void Log ()
 Print out information about all ongoing voting instances.
 
override void OnPlayerConnected (int playerId)
 Called after a player is connected.
 
override void OnPlayerRegistered (int playerId)
 Called on every machine after a player is registered (identity, name etc.).
 
override void OnPlayerDisconnected (int playerId, KickCauseCode cause, int timeout)
 Called after a player is disconnected.
 
override bool RplSave (ScriptBitWriter writer)
 
override bool RplLoad (ScriptBitReader reader)
 
void SCR_VotingManagerComponent (IEntityComponentSource src, IEntity ent, IEntity parent)
 
- Public Member Functions inherited from SCR_BaseGameModeComponent
SCR_BaseGameMode GetGameMode ()
 
void OnGameEnd ()
 Called on all machines when the world ends.
 
void OnGameStateChanged (SCR_EGameModeState state)
 Called when game mode state changes called on all machines.
 
void OnGameModeStart ()
 Called on every machine when game mode starts.
 
void OnGameModeEnd (SCR_GameModeEndData data)
 Called when game mode ends.
 
void OnPlayerConnected (int playerId)
 Called after a player is connected.
 
void OnPlayerAuditSuccess (int playerId)
 Event is called when player connecting Session hosting current Game Mode where is required authentication verification via.
 
void OnPlayerAuditFail (int playerId)
 Event is called when player connecting Session hosting current Game Mode AuditFail() call may be called under two occasions: 1) verification is required but failed (account is not valid, player is banned, internet issues) 2) player cannot be verified as authentication is not required or possible - where it may be valid behavior (server online connectivity turned off for example) Basically non-audited player cannot access persistency/ etc.
 
void OnPlayerAuditTimeouted (int playerId)
 Event is called when player connected to Session was kicked and did not reconnected in time This mean that slot reservation can be canceled.
 
void OnPlayerAuditRevived (int playerId)
 Event is called when player reconnected successfully back to Session after kick This mean that slot reservation need to be finished (closed).
 
void OnPlayerRegistered (int playerId)
 Called on every machine after a player is registered (identity, name etc.).
 
void OnPlayerDisconnected (int playerId, KickCauseCode cause, int timeout)
 Called after a player is disconnected.
 
void OnPlayerSpawned (int playerId, IEntity controlledEntity)
 Called after a player is spawned.
 
bool PreparePlayerEntity_S (SCR_SpawnRequestComponent requestComponent, SCR_SpawnHandlerComponent handlerComponent, SCR_SpawnData data, IEntity entity)
 
void OnSpawnPlayerEntityFailure_S (SCR_SpawnRequestComponent requestComponent, SCR_SpawnHandlerComponent handlerComponent, IEntity entity, SCR_SpawnData data, SCR_ESpawnResult reason)
 
void OnPlayerSpawnFinalize_S (SCR_SpawnRequestComponent requestComponent, SCR_SpawnHandlerComponent handlerComponent, SCR_SpawnData data, IEntity entity)
 
bool HandlePlayerKilled (int playerId, IEntity playerEntity, IEntity killerEntity, notnull Instigator killer)
 See SCR_BaseGameMode.HandlePlayerKilled.
 
void OnPlayerKilled (int playerId, IEntity playerEntity, IEntity killerEntity, notnull Instigator killer)
 Called after a player gets killed.
 
void OnPlayerKilledHandled (int playerId, IEntity playerEntity, IEntity killerEntity, notnull Instigator killer)
 Called after player gets killed in cases where the kill was handled by the game mode, supressing the default OnPlayerKilled behaviour.
 
void OnPlayerDeleted (int playerId, IEntity player)
 Called after a player gets deleted.
 
void OnPlayerRoleChange (int playerId, EPlayerRole roleFlags)
 Called when player role changes.
 
void OnWorldPostProcess (World world)
 Called once loading of all entities of the world have been finished (still within the loading)
 
void HandleOnLoadoutAssigned (int playerID, SCR_BasePlayerLoadout assignedLoadout)
 What happens when a player is assigned a loadout.
 
void HandleOnFactionAssigned (int playerID, Faction assignedFaction)
 What happens when a player is assigned a faction.
 
void HandleOnSpawnPointAssigned (int playerID, SCR_SpawnPoint spawnPoint)
 What happens when a player is assigned a spawn point.
 
void OnControllableSpawned (IEntity entity)
 When a controllable entity is spawned, this event is raised.
 
void OnControllableDestroyed (IEntity entity, IEntity killerEntity, notnull Instigator killer)
 When a controllable entity is destroyed, this event is raised.
 
void OnControllableDeleted (IEntity entity)
 Prior to a controllable entity being DELETED, this event is raised.
 
void SCR_BaseGameModeComponent (IEntityComponentSource src, IEntity ent, IEntity parent)
 

Static Public Member Functions

static SCR_VotingManagerComponent GetInstance ()
 Get local instance of this component.
 

Static Public Attributes

static const LocalizedString VOTE_TIMEOUT_FORMAT = "#AR-Voting_TimeOut"
 

Protected Member Functions

void RPC_PlayerVoteCountChanged (EVotingType type, int value, int voteCount)
 
int GetCurrentJoinServerVoteCooldown (EVotingType type)
 
int GetCurrentVoteCooldownTime (EVotingType type)
 
float GetTimeStamp ()
 
void EndVoting (SCR_VotingBase voting, EVotingOutcome outcome=EVotingOutcome.EVALUATE)
 
SCR_VotingBase FindVoting (EVotingType type, int value)
 
SCR_VotingBase FindTemplate (EVotingType type)
 
SCR_VotingBase CreateVotingInstance (EVotingType type, int value, float remainingDuration=-1, int currentVoteCount=-1)
 
void DeleteVotingInstance (EVotingType type, int value, int winner)
 
void StartVotingBroadcast (EVotingType type, int value)
 
void EndVotingBroadcast (EVotingType type, int value, int winner)
 
override void EOnFrame (IEntity owner, float timeSlice)
 

Protected Attributes

ref array< ref SCR_VotingBasem_aVotingTemplates
 
float m_fUpdateStep
 
int m_iHostPlayerID = -1
 
float m_fUpdateLength
 
ref array< ref SCR_VotingBasem_aVotingInstances = {}
 
ref set< SCR_VotingBasem_aAbstainedVotingInstances = new set<SCR_VotingBase>()
 
ref array< ref Tuple2< int, int > > m_LocalVoteRecords = {}
 
ref ScriptInvoker_VotingManagerStart m_OnVotingStart = new ScriptInvoker_VotingManagerStart()
 
ref ScriptInvoker_VotingManagerEnd m_OnVotingEnd = new ScriptInvoker_VotingManagerEnd()
 
ref ScriptInvoker_VotingManagerPlayer m_OnVote = new ScriptInvoker_VotingManagerPlayer()
 
ref ScriptInvoker_VotingManagerPlayer m_OnRemoveVote = new ScriptInvoker_VotingManagerPlayer()
 
ref ScriptInvoker_VotingManagerStart m_OnVoteLocal = new ScriptInvoker_VotingManagerStart()
 
ref ScriptInvoker_VotingManagerStart m_OnRemoveVoteLocal = new ScriptInvoker_VotingManagerStart()
 
ref ScriptInvoker_VotingManagerStart m_OnAbstainVoteLocal = new ScriptInvoker_VotingManagerStart()
 
ref ScriptInvoker_VotingManagerVoteCountChanged m_PlayerVoteCountChanged = new ScriptInvoker_VotingManagerVoteCountChanged()
 
- Protected Attributes inherited from SCR_BaseGameModeComponent
SCR_BaseGameMode m_pGameMode
 The game mode entity this component is attached to.
 

Detailed Description

Examples
d:/jenkins/workspace/ar_data_branches_stable_1.2.0/A4Data/scripts/Game/GameMode/SCR_GameModeEditor.c.

Constructor & Destructor Documentation

◆ SCR_VotingManagerComponent()

void SCR_VotingManagerComponent.SCR_VotingManagerComponent ( IEntityComponentSource  src,
IEntity  ent,
IEntity  parent 
)
Parameters
[in]src
[in]ent
[in]parent

Member Function Documentation

◆ AbstainVoteLocally()

void SCR_VotingManagerComponent.AbstainVoteLocally ( EVotingType  type,
int  value = SCR_VotingBase::DEFAULT_VALUE 
)

Local player has abstained from voting eg: VoteRemove was called.

Parameters
[in]typeType of the vote
[in]valueTarget value, depends on the type (e.g., for KICK it's player ID)

◆ CreateVotingInstance()

SCR_VotingBase SCR_VotingManagerComponent.CreateVotingInstance ( EVotingType  type,
int  value,
float  remainingDuration = -1,
int  currentVoteCount = -1 
)
protected

◆ DeleteVotingInstance()

void SCR_VotingManagerComponent.DeleteVotingInstance ( EVotingType  type,
int  value,
int  winner 
)
protected

◆ EndVoting() [1/2]

void SCR_VotingManagerComponent.EndVoting ( EVotingType  type,
int  value = SCR_VotingBase::DEFAULT_VALUE,
EVotingOutcome  outcome = EVotingOutcome::EVALUATE 
)

End voting.

Parameters
[in]typeType of the vote
[in]valueTarget value, depends on the type (e.g., for KICK it's player ID)
[in]outcomeHow should the winner be evaluated
Examples
d:/jenkins/workspace/ar_data_branches_stable_1.2.0/A4Data/scripts/Game/GameMode/SCR_GameModeEditor.c.

◆ EndVoting() [2/2]

void SCR_VotingManagerComponent.EndVoting ( SCR_VotingBase  voting,
EVotingOutcome  outcome = EVotingOutcome::EVALUATE 
)
protected

◆ EndVotingBroadcast()

void SCR_VotingManagerComponent.EndVotingBroadcast ( EVotingType  type,
int  value,
int  winner 
)
protected

◆ EOnFrame()

override void SCR_VotingManagerComponent.EOnFrame ( IEntity  owner,
float  timeSlice 
)
protected

◆ FindTemplate()

SCR_VotingBase SCR_VotingManagerComponent.FindTemplate ( EVotingType  type)
protected

◆ FindVoting()

SCR_VotingBase SCR_VotingManagerComponent.FindVoting ( EVotingType  type,
int  value 
)
protected

◆ GetAllVotingsAboutPlayer()

int SCR_VotingManagerComponent.GetAllVotingsAboutPlayer ( bool  aboutPlayer,
out notnull array< EVotingType >  outVotingTypes,
bool  onlyTemplates = false,
bool  onlyAvailable = false 
)

Get all active player vote types (not caring which player is the target) Does not care what player the target is or if it is a referendum or election.

Parameters
[in]aboutPlayerPlayer True to return votings that are about players, false to return those which are not about players
[out]outVotingTypesArray to be filled with vote types
[in]onlyTemplatesTrue to scan all voting templates, not only active votings
[in]onlyAvailableTrue to scan only votings which can be available in current situation, evaluated by SCR_VotingBase.IsAvailable(). Note that Vote class specific values such as m_bFactionSpecific in SCR_VotingKick are not properly checked and need a IsVotingAvailable specifically if not checking for templates only
Returns
Number of votings

◆ GetAllVotingsWithValue()

int SCR_VotingManagerComponent.GetAllVotingsWithValue ( out notnull array< EVotingType >  outVotingTypes,
array< EVotingType >  outValues,
bool  onlyTemplates = false,
bool  onlyAvailable = false 
)

Get all votings with value defined.

Returns only referendums, not elections

Parameters
[out]outVotingTypesArray to be filled with vote types
[out]outValuesArray to be filled with vote values
[in]onlyTemplatesTrue to scan all voting templates, not only active votings
[in]onlyAvailableTrue to scan only votings which can be available in current situation, evaluated by SCR_VotingBase.IsAvailable(). Note that Vote class specific values such as m_bFactionSpecific in SCR_VotingKick are not properly checked and need a IsVotingAvailable specifically if not checking for templates only
Returns
Number of votings

◆ GetAllVotingValues()

int SCR_VotingManagerComponent.GetAllVotingValues ( EVotingType  type,
out notnull array< int >  outValues,
bool  onlyTemplates = false,
bool  onlyAvailable = false 
)

Get a array of all active votes with the specific voteType.

Parameters
[in]typeThe type of active vote that needs to be searched
[out]outValueslist of all active vote values of the given type
[in]onlyTemplatesTrue to scan all voting templates, not only active votings
[in]onlyAvailableTrue to scan only votings which can be available in current situation, evaluated by SCR_VotingBase.IsAvailable(). Note that Vote class specific values such as m_bFactionSpecific in SCR_VotingKick are not properly checked and need a IsVotingAvailable specifically if not checking for templates only
Returns
count of active vote values

◆ GetCurrentJoinServerVoteCooldown()

int SCR_VotingManagerComponent.GetCurrentJoinServerVoteCooldown ( EVotingType  type)
protected
Parameters
[in]typeThe type to which to get the delay time
Returns
Gets the current Time left before the player can vote when they join the server

◆ GetCurrentVoteCooldownForLocalPlayer()

int SCR_VotingManagerComponent.GetCurrentVoteCooldownForLocalPlayer ( EVotingType  type)

param[in] type The voting type to get current cooldown for

Returns
The current cooldown of the voting type. This can be server join cooldown or between voting cooldown

◆ GetCurrentVoteCooldownTime()

int SCR_VotingManagerComponent.GetCurrentVoteCooldownTime ( EVotingType  type)
protected
Parameters
[in]typeThe type to which to get the cooldown time
Returns
Gets the current Time left before the player can vote when they join the server

◆ GetHostPlayerID()

int SCR_VotingManagerComponent.GetHostPlayerID ( )

Get player ID of the host player.

Returns
Player ID. 0 on dedicated server.

◆ GetInstance()

static SCR_VotingManagerComponent SCR_VotingManagerComponent.GetInstance ( )
static

Get local instance of this component.

Returns
Local voting manager component
Examples
d:/jenkins/workspace/ar_data_branches_stable_1.2.0/A4Data/scripts/Game/GameMode/SCR_GameModeEditor.c.

◆ GetLocalVote()

int SCR_VotingManagerComponent.GetLocalVote ( EVotingType  type,
int  value = SCR_VotingBase::DEFAULT_VALUE 
)

Get local vote for given voting.

It is purely informative and does not affect voting outcome

Parameters
[in]typeType of the vote
[in]valueTarget value, depends on the type (e.g., for KICK it's player ID)
Returns
Voted value

◆ GetOnAbstainVoteLocal()

ScriptInvoker_VotingManagerStart SCR_VotingManagerComponent.GetOnAbstainVoteLocal ( )

Get event called on player when they remove their vote.

Returns
Script invoker

◆ GetOnRemoveVote()

ScriptInvoker_VotingManagerPlayer SCR_VotingManagerComponent.GetOnRemoveVote ( )

Get event called on server when a player removes their vote.

Returns
Script invoker

◆ GetOnRemoveVoteLocal()

ScriptInvoker_VotingManagerStart SCR_VotingManagerComponent.GetOnRemoveVoteLocal ( )

Get event called on player when they remove their vote.

Returns
Script invoker

◆ GetOnVote()

ScriptInvoker_VotingManagerPlayer SCR_VotingManagerComponent.GetOnVote ( )

Get event called on server when a player casts a vote.

Returns
Script invoker

◆ GetOnVoteCountChanged()

ScriptInvoker_VotingManagerVoteCountChanged SCR_VotingManagerComponent.GetOnVoteCountChanged ( )

Get event called everywhere when a player voted or abstained.

Returns
Script invoker

◆ GetOnVoteLocal()

ScriptInvoker_VotingManagerStart SCR_VotingManagerComponent.GetOnVoteLocal ( )

Get event called on player when they cast a vote.

Returns
Script invoker

◆ GetOnVotingEnd()

ScriptInvoker_VotingManagerEnd SCR_VotingManagerComponent.GetOnVotingEnd ( )

Get event called everywhere when a voting ends (e.g., time runs out, number of votes reaches threshold, or the player about whom the voting was disconnects).

Returns
Script invoker

◆ GetOnVotingStart()

ScriptInvoker_VotingManagerStart SCR_VotingManagerComponent.GetOnVotingStart ( )

Get event called everywhere when a new voting is created.

Returns
Script invoker

◆ GetPlayerVote()

int SCR_VotingManagerComponent.GetPlayerVote ( int  playerID,
EVotingType  type,
int  value = SCR_VotingBase::DEFAULT_VALUE 
)

Get value cast by given player.

Parameters
[in]playerIDPlayer who cast the vote
[in]typeType of the vote
[in]valueTarget value, depends on the type (e.g., for KICK it's player ID)
Returns
Cast value, or default when player did not vote

◆ GetRemainingDurationOfVote()

float SCR_VotingManagerComponent.GetRemainingDurationOfVote ( EVotingType  type,
int  value = SCR_VotingBase::DEFAULT_VALUE 
)
Parameters
[in]type
[in]value
Returns

◆ GetTimeStamp()

float SCR_VotingManagerComponent.GetTimeStamp ( )
protected

◆ GetValueName()

string SCR_VotingManagerComponent.GetValueName ( EVotingType  type,
int  value 
)

Get name of the value.

Parameters
[in]typeType of the vote
[in]valueValue
Returns
Value name

◆ GetVoteCounts()

bool SCR_VotingManagerComponent.GetVoteCounts ( EVotingType  type,
int  value,
out int  currentVotes,
out int  votesRequired 
)

Get the amount of players needed.

Parameters
[in]typeType of the vote
[in]valueValue of the vote
[out]currentVotesCurrent votes the vote has
[out]votesRequiredVotes required to be successfull return True if successfully obtained the requirement data

◆ GetVotingInfo()

SCR_VotingUIInfo SCR_VotingManagerComponent.GetVotingInfo ( EVotingType  type)

Get UI representation of given voting.

Parameters
[in]typeType of the vote
Returns
Voting UI info

◆ GetVotingsAboutPlayer()

int SCR_VotingManagerComponent.GetVotingsAboutPlayer ( int  playerID,
out notnull array< EVotingType >  outVotingTypes,
bool  onlyTemplates = false,
bool  onlyAvailable = false 
)

Get all votings about given player.

Returns only referendums, not elections e.g., vote to KICK a player is a referendum, but vote to make him/her an ADMIN is election in which multiple players can compete, therefore it's not a vote about the player)

Parameters
[in]playerIDPlayer ID
[out]outVotingTypesArray to be filled with vote types
[in]onlyTemplatesTrue to scan all voting templates, not only active votings
[in]onlyAvailableTrue to scan only votings which can be available in current situation, evaluated by SCR_VotingBase.IsAvailable(). Note that Vote class specific values such as m_bFactionSpecific in SCR_VotingKick are not properly checked and need a IsVotingAvailable specifically if not checking for templates only
Returns
Number of votings

◆ HasAbstainedLocally()

bool SCR_VotingManagerComponent.HasAbstainedLocally ( EVotingType  type,
int  value = SCR_VotingBase::DEFAULT_VALUE 
)

If local player has abstained from voting eg: VoteRemove was called.

Parameters
[in]typeType of the vote
[in]valueTarget value, depends on the type (e.g., for KICK it's player ID)
Returns
True if the voting was abstained

◆ IsLocalVote()

bool SCR_VotingManagerComponent.IsLocalVote ( EVotingType  type,
int  value = SCR_VotingBase::DEFAULT_VALUE 
)

Check if local vote was cast.

It is purely informative and does not affect voting outcome

Parameters
[in]typeType of the vote
[in]valueTarget value, depends on the type (e.g., for KICK it's player ID)
Returns
True if the vote was cast

◆ IsVoting()

bool SCR_VotingManagerComponent.IsVoting ( EVotingType  type,
int  value = SCR_VotingBase::DEFAULT_VALUE 
)

Check if a voting with given params is currently in effect.

Parameters
[in]typeType of the vote
[in]valueTarget value, depends on the type (e.g., for KICK it's player ID)
Returns
True if the voting is ongoing

◆ IsVotingAboutPlayer()

bool SCR_VotingManagerComponent.IsVotingAboutPlayer ( int  playerID,
EVotingType  type 
)

Check if there is a vote of certain type about given player.

e.g., is there a vote about player being kicked?

Parameters
[in]playerIDPlayer ID
[in]typeType of the vote
Returns
True if the voting is ongoing

◆ IsVotingAvailable()

bool SCR_VotingManagerComponent.IsVotingAvailable ( EVotingType  type,
int  value = SCR_VotingBase::DEFAULT_VALUE 
)

Check if a voting is available in the current world.

Parameters
[in]typeType of the vote
[in]valueTarget value, depends on the type (e.g., for KICK it's player ID)
Returns
True if available

◆ Log()

void SCR_VotingManagerComponent.Log ( )

Print out information about all ongoing voting instances.

◆ OnPlayerConnected()

override void SCR_VotingManagerComponent.OnPlayerConnected ( int  playerId)

Called after a player is connected.

Server-only.

Parameters
[in]playerIdPlayerId of connected player.

Implements SCR_BaseGameModeComponent.

◆ OnPlayerDisconnected()

override void SCR_VotingManagerComponent.OnPlayerDisconnected ( int  playerId,
KickCauseCode  cause,
int  timeout 
)

Called after a player is disconnected.

Parameters
[in]playerIdPlayerId of disconnected player.
[in]causeReason player disconnected
[in]timeoutTimeout for when players are allowed to connect again. -1 means Ban without an assigned timeout

Implements SCR_BaseGameModeComponent.

◆ OnPlayerRegistered()

override void SCR_VotingManagerComponent.OnPlayerRegistered ( int  playerId)

Called on every machine after a player is registered (identity, name etc.).

Always called after OnPlayerConnected.

Parameters
[in]playerIdPlayerId of registered player.

Implements SCR_BaseGameModeComponent.

◆ PreVoteLocal()

void SCR_VotingManagerComponent.PreVoteLocal ( EVotingType  type,
int  value 
)

Called before the vote is cased locally to make sure the cooldowns are set if the vote was initiated by the player.

Parameters
[in]typeType of the vote
[in]valueVoted value, depends on the type (e.g., for KICK it's player ID)

◆ RemoveVote()

void SCR_VotingManagerComponent.RemoveVote ( int  playerID,
EVotingType  type,
int  value 
)

Remove previously cast vote.

To be called from SCR_VoterComponent! Do not call from elsewhere unless you want to subvert democracy!

Parameters
[in]playerIDPlayer who cast the vote
[in]typeType of the vote
[in]valueVoted value, depends on the type (e.g., for KICK it's player ID)

◆ RemoveVoteLocal()

void SCR_VotingManagerComponent.RemoveVoteLocal ( EVotingType  type,
int  value 
)

Remove local vote for given voting.

It is purely informative and does not affect voting outcome To be called from SCR_VoterComponent!

Parameters
[in]typeType of the vote
[in]valueVoted value, depends on the type (e.g., for KICK it's player ID)

◆ RPC_PlayerVoteCountChanged()

void SCR_VotingManagerComponent.RPC_PlayerVoteCountChanged ( EVotingType  type,
int  value,
int  voteCount 
)
protected

◆ RplLoad()

override bool SCR_VotingManagerComponent.RplLoad ( ScriptBitReader  reader)

◆ RplSave()

override bool SCR_VotingManagerComponent.RplSave ( ScriptBitWriter  writer)

◆ StartVoting()

bool SCR_VotingManagerComponent.StartVoting ( EVotingType  type,
int  value = SCR_VotingBase::DEFAULT_VALUE 
)

Start voting.

Parameters
[in]typeType of the vote
[in]valueTarget value, depends on the type (e.g., for KICK it's player ID)
Returns
True if the voting started
Examples
d:/jenkins/workspace/ar_data_branches_stable_1.2.0/A4Data/scripts/Game/GameMode/SCR_GameModeEditor.c.

◆ StartVotingBroadcast()

void SCR_VotingManagerComponent.StartVotingBroadcast ( EVotingType  type,
int  value 
)
protected

◆ Vote()

void SCR_VotingManagerComponent.Vote ( int  playerID,
EVotingType  type,
int  value 
)

Vote! If the voting does not exist yet, start it.

To be called from SCR_VoterComponent! Do not call from elsewhere unless you want to subvert democracy!

Parameters
[in]playerIDPlayer who cast the vote
[in]typeType of the vote
[in]valueVoted value, depends on the type (e.g., for KICK it's player ID)

◆ VoteLocal()

void SCR_VotingManagerComponent.VoteLocal ( EVotingType  type,
int  value 
)

Save local vote for given voting.

It is purely informative and does not affect voting outcome To be called from SCR_VoterComponent!

Parameters
[in]typeType of the vote
[in]valueVoted value, depends on the type (e.g., for KICK it's player ID)

Member Data Documentation

◆ m_aAbstainedVotingInstances

ref set<SCR_VotingBase> SCR_VotingManagerComponent.m_aAbstainedVotingInstances = new set<SCR_VotingBase>()
protected

◆ m_aVotingInstances

ref array<ref SCR_VotingBase> SCR_VotingManagerComponent.m_aVotingInstances = {}
protected

◆ m_aVotingTemplates

ref array<ref SCR_VotingBase> SCR_VotingManagerComponent.m_aVotingTemplates
protected

◆ m_fUpdateLength

float SCR_VotingManagerComponent.m_fUpdateLength
protected

◆ m_fUpdateStep

float SCR_VotingManagerComponent.m_fUpdateStep
protected

◆ m_iHostPlayerID

int SCR_VotingManagerComponent.m_iHostPlayerID = -1
protected

◆ m_LocalVoteRecords

ref array<ref Tuple2<int, int> > SCR_VotingManagerComponent.m_LocalVoteRecords = {}
protected

◆ m_OnAbstainVoteLocal

ref ScriptInvoker_VotingManagerStart SCR_VotingManagerComponent.m_OnAbstainVoteLocal = new ScriptInvoker_VotingManagerStart()
protected

◆ m_OnRemoveVote

ref ScriptInvoker_VotingManagerPlayer SCR_VotingManagerComponent.m_OnRemoveVote = new ScriptInvoker_VotingManagerPlayer()
protected

◆ m_OnRemoveVoteLocal

ref ScriptInvoker_VotingManagerStart SCR_VotingManagerComponent.m_OnRemoveVoteLocal = new ScriptInvoker_VotingManagerStart()
protected

◆ m_OnVote

ref ScriptInvoker_VotingManagerPlayer SCR_VotingManagerComponent.m_OnVote = new ScriptInvoker_VotingManagerPlayer()
protected

◆ m_OnVoteLocal

ref ScriptInvoker_VotingManagerStart SCR_VotingManagerComponent.m_OnVoteLocal = new ScriptInvoker_VotingManagerStart()
protected

◆ m_OnVotingEnd

ref ScriptInvoker_VotingManagerEnd SCR_VotingManagerComponent.m_OnVotingEnd = new ScriptInvoker_VotingManagerEnd()
protected

◆ m_OnVotingStart

ref ScriptInvoker_VotingManagerStart SCR_VotingManagerComponent.m_OnVotingStart = new ScriptInvoker_VotingManagerStart()
protected

◆ m_PlayerVoteCountChanged

ref ScriptInvoker_VotingManagerVoteCountChanged SCR_VotingManagerComponent.m_PlayerVoteCountChanged = new ScriptInvoker_VotingManagerVoteCountChanged()
protected

◆ VOTE_TIMEOUT_FORMAT

const LocalizedString SCR_VotingManagerComponent.VOTE_TIMEOUT_FORMAT = "#AR-Voting_TimeOut"
static

The documentation for this interface was generated from the following file: