Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_VotingManagerComponent.c File Reference

Go to the source code of this file.

Classes

class  SCR_VotingManagerComponentClass

Typedefs

typedef func ScriptInvoker_VotingManagerStartMethod
typedef ScriptInvokerBase< ScriptInvoker_VotingManagerStartMethodScriptInvoker_VotingManagerStart
typedef func ScriptInvoker_VotingManagerEndMethod
typedef ScriptInvokerBase< ScriptInvoker_VotingManagerEndMethodScriptInvoker_VotingManagerEnd
typedef func ScriptInvoker_VotingManagerPlayerMethod
typedef ScriptInvokerBase< ScriptInvoker_VotingManagerPlayerMethodScriptInvoker_VotingManagerPlayer
typedef func ScriptInvoker_VotingManagerVoteCountChangedMethod
typedef ScriptInvokerBase< ScriptInvoker_VotingManagerVoteCountChangedMethodScriptInvoker_VotingManagerVoteCountChanged

Functions

void ScriptInvoker_VotingManagerStartMethod (EVotingType type, int value)
void ScriptInvoker_VotingManagerEndMethod (EVotingType type, int value, int winner)
void ScriptInvoker_VotingManagerPlayerMethod (EVotingType type, int value, int playerID)
void ScriptInvoker_VotingManagerVoteCountChangedMethod (EVotingType type, int value, int voteCount)
SCR_VotingManagerComponentClass SCR_BaseGameModeComponentClass Attribute (desc:"Voting Templates, please use configs and the VotingManagerComponent prefab for default gamemode voting templates")] protected ref array< ref SCR_VotingBase > m_aVotingTemplates
void Vote (int playerID, EVotingType type, int value)
void RemoveVote (int playerID, EVotingType type, int value)
void RPC_PlayerVoteCountChanged (EVotingType type, int value, int voteCount)
bool StartVoting (EVotingType type, int startingPlayerID, int value=SCR_VotingBase.DEFAULT_VALUE)
void EndVoting (EVotingType type, int value=SCR_VotingBase.DEFAULT_VALUE, EVotingOutcome outcome=EVotingOutcome.EVALUATE)
int GetPlayerVote (int playerID, EVotingType type, int value=SCR_VotingBase.DEFAULT_VALUE)
bool GetVoteCounts (EVotingType type, int value, out int currentVotes, out int votesRequired)
int GetVoteAuthorId (EVotingType type, int value)
ScriptInvoker_VotingManagerStart GetOnVotingStart ()
ScriptInvoker_VotingManagerVoteCountChanged GetOnVoteCountChanged ()
ScriptInvoker_VotingManagerEnd GetOnVotingEnd ()
ScriptInvoker_VotingManagerPlayer GetOnVote ()
ScriptInvoker_VotingManagerPlayer GetOnRemoveVote ()
ScriptInvoker_VotingManagerStart GetOnVoteLocal ()
ScriptInvoker_VotingManagerStart GetOnRemoveVoteLocal ()
ScriptInvoker_VotingManagerStart GetOnAbstainVoteLocal ()
int GetHostPlayerID ()
bool IsVotingAvailable (EVotingType type, int value=SCR_VotingBase.DEFAULT_VALUE)
bool IsVoting (EVotingType type, int value=SCR_VotingBase.DEFAULT_VALUE)
bool IsVotingAboutPlayer (int playerID, EVotingType type)
void AbstainVoteLocally (EVotingType type, int value=SCR_VotingBase.DEFAULT_VALUE)
bool HasAbstainedLocally (EVotingType type, int value=SCR_VotingBase.DEFAULT_VALUE)
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)
int GetAllVotingsAboutPlayer (bool aboutPlayer, out notnull array< EVotingType > outVotingTypes, bool onlyTemplates=false, bool onlyAvailable=false)
int GetAllVotingsWithValue (out notnull array< EVotingType > outVotingTypes, array< EVotingType > outValues, bool onlyTemplates=false, bool onlyAvailable=false)
int GetAllVotingValues (EVotingType type, out notnull array< int > outValues, bool onlyTemplates=false, bool onlyAvailable=false)
int GetCurrentJoinServerVoteCooldown (EVotingType type)
int GetCurrentVoteCooldownTime (EVotingType type)
int GetCurrentVoteCooldownForLocalPlayer (EVotingType type)
float GetTimeStamp ()
SCR_VotingUIInfo GetVotingInfo (EVotingType type)
string GetValueName (EVotingType type, int value)
void PreVoteLocal (EVotingType type, int value)
void VoteLocal (EVotingType type, int value)
void RemoveVoteLocal (EVotingType type, int value)
int GetLocalVote (EVotingType type, int value=SCR_VotingBase.DEFAULT_VALUE)
bool IsLocalVote (EVotingType type, int value=SCR_VotingBase.DEFAULT_VALUE)
bool GetVoteAlwaysDisplayVoteSubjectVotingTimer (EVotingType type, int value=SCR_VotingBase.DEFAULT_VALUE)
bool GetVoteAlwaysDisplayVoteInitiatorVotingTimer (EVotingType type, int value=SCR_VotingBase.DEFAULT_VALUE)
void Log ()
 Print out information about all ongoing voting instances.
void EndVoting (notnull 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 startingPlayerID, int value, float remainingDuration=-1, int currentVoteCount=-1)
void DeleteVotingInstance (EVotingType type, int value, int winner)
void StartVotingBroadcast (EVotingType type, int value, int startingPlayerID)
void EndVotingBroadcast (EVotingType type, int value, int winner)
override void OnPlayerConnected (int playerId)
override void OnPlayerRegistered (int playerId)
override void OnPlayerDisconnected (int playerId, KickCauseCode cause, int timeout)
override bool RplSave (ScriptBitWriter writer)
override bool RplLoad (ScriptBitReader reader)
void EOnFrame (IEntity owner, float timeSlice)
void SCR_VotingManagerComponent (IEntityComponentSource src, IEntity ent, IEntity parent)

Variables

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()

Typedef Documentation

◆ ScriptInvoker_VotingManagerEnd

◆ ScriptInvoker_VotingManagerEndMethod

◆ ScriptInvoker_VotingManagerPlayer

◆ ScriptInvoker_VotingManagerPlayerMethod

◆ ScriptInvoker_VotingManagerStart

◆ ScriptInvoker_VotingManagerStartMethod

◆ ScriptInvoker_VotingManagerVoteCountChanged

◆ ScriptInvoker_VotingManagerVoteCountChangedMethod

Function Documentation

◆ AbstainVoteLocally()

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

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)

Definition at line 345 of file SCR_VotingManagerComponent.c.

◆ Attribute()

SCR_VotingManagerComponentClass SCR_BaseGameModeComponentClass Attribute ( desc:"Voting Templates,
please use configs and the VotingManagerComponent prefab for default gamemode voting templates"  )

◆ CreateVotingInstance()

SCR_VotingBase CreateVotingInstance ( EVotingType type,
int startingPlayerID,
int value,
float remainingDuration = -1,
int currentVoteCount = -1 )
protected
Parameters
[in]typeType of the vote
[in]startingPlayerIDid of a player who started the vote
[in]valueTarget value, depends on the type (e.g., for KICK it's player ID)
[in]remainingDuration
[in]currentVoteCount
Returns
instance of a created vote, null otherwise

Definition at line 810 of file SCR_VotingManagerComponent.c.

◆ DeleteVotingInstance()

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

Definition at line 859 of file SCR_VotingManagerComponent.c.

◆ EndVoting() [1/2]

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

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

Definition at line 167 of file SCR_VotingManagerComponent.c.

◆ EndVoting() [2/2]

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

Definition at line 743 of file SCR_VotingManagerComponent.c.

◆ EndVotingBroadcast()

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

Definition at line 918 of file SCR_VotingManagerComponent.c.

◆ EOnFrame()

void EOnFrame ( IEntity owner,
float timeSlice )
protected

Definition at line 1035 of file SCR_VotingManagerComponent.c.

◆ FindTemplate()

SCR_VotingBase FindTemplate ( EVotingType type)
protected

Definition at line 790 of file SCR_VotingManagerComponent.c.

◆ FindVoting()

SCR_VotingBase FindVoting ( EVotingType type,
int value )
protected

Definition at line 779 of file SCR_VotingManagerComponent.c.

◆ GetAllVotingsAboutPlayer()

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

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

Definition at line 424 of file SCR_VotingManagerComponent.c.

◆ GetAllVotingsWithValue()

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

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

Definition at line 449 of file SCR_VotingManagerComponent.c.

◆ GetAllVotingValues()

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

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

Definition at line 476 of file SCR_VotingManagerComponent.c.

◆ GetCurrentJoinServerVoteCooldown()

int 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

Definition at line 496 of file SCR_VotingManagerComponent.c.

◆ GetCurrentVoteCooldownForLocalPlayer()

int GetCurrentVoteCooldownForLocalPlayer ( EVotingType type)
protected

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

Definition at line 538 of file SCR_VotingManagerComponent.c.

◆ GetCurrentVoteCooldownTime()

int 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

Definition at line 522 of file SCR_VotingManagerComponent.c.

◆ GetHostPlayerID()

int GetHostPlayerID ( )
protected

Get player ID of the host player.

Returns
Player ID. 0 on dedicated server.

Definition at line 293 of file SCR_VotingManagerComponent.c.

◆ GetLocalVote()

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

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

Definition at line 683 of file SCR_VotingManagerComponent.c.

◆ GetOnAbstainVoteLocal()

ScriptInvoker_VotingManagerStart GetOnAbstainVoteLocal ( )
protected

Get event called on player when they remove their vote.

Returns
Script invoker

Definition at line 282 of file SCR_VotingManagerComponent.c.

◆ GetOnRemoveVote()

ScriptInvoker_VotingManagerPlayer GetOnRemoveVote ( )
protected

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

Returns
Script invoker

Definition at line 258 of file SCR_VotingManagerComponent.c.

◆ GetOnRemoveVoteLocal()

ScriptInvoker_VotingManagerStart GetOnRemoveVoteLocal ( )
protected

Get event called on player when they remove their vote.

Returns
Script invoker

Definition at line 274 of file SCR_VotingManagerComponent.c.

◆ GetOnVote()

ScriptInvoker_VotingManagerPlayer GetOnVote ( )
protected

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

Returns
Script invoker

Definition at line 250 of file SCR_VotingManagerComponent.c.

◆ GetOnVoteCountChanged()

ScriptInvoker_VotingManagerVoteCountChanged GetOnVoteCountChanged ( )
protected

Get event called everywhere when a player voted or abstained

Returns
Script invoker

Definition at line 234 of file SCR_VotingManagerComponent.c.

◆ GetOnVoteLocal()

ScriptInvoker_VotingManagerStart GetOnVoteLocal ( )
protected

Get event called on player when they cast a vote.

Returns
Script invoker

Definition at line 266 of file SCR_VotingManagerComponent.c.

◆ GetOnVotingEnd()

ScriptInvoker_VotingManagerEnd GetOnVotingEnd ( )
protected

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

Definition at line 242 of file SCR_VotingManagerComponent.c.

◆ GetOnVotingStart()

ScriptInvoker_VotingManagerStart GetOnVotingStart ( )
protected

Get event called everywhere when a new voting is created.

Returns
Script invoker

Definition at line 226 of file SCR_VotingManagerComponent.c.

◆ GetPlayerVote()

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

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

Definition at line 180 of file SCR_VotingManagerComponent.c.

◆ GetRemainingDurationOfVote()

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

Definition at line 378 of file SCR_VotingManagerComponent.c.

◆ GetTimeStamp()

float GetTimeStamp ( )
protected

Definition at line 554 of file SCR_VotingManagerComponent.c.

◆ GetValueName()

string GetValueName ( EVotingType type,
int value )
protected

Get name of the value.

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

Definition at line 581 of file SCR_VotingManagerComponent.c.

◆ GetVoteAlwaysDisplayVoteInitiatorVotingTimer()

bool GetVoteAlwaysDisplayVoteInitiatorVotingTimer ( EVotingType type,
int value = SCR_VotingBase.DEFAULT_VALUE )
protected

Definition at line 717 of file SCR_VotingManagerComponent.c.

◆ GetVoteAlwaysDisplayVoteSubjectVotingTimer()

bool GetVoteAlwaysDisplayVoteSubjectVotingTimer ( EVotingType type,
int value = SCR_VotingBase.DEFAULT_VALUE )
protected
Parameters
[in]typeType of the vote
[in]valueTarget value, depends on the type (e.g., for KICK it's player ID)
Returns
whether vote always displays voting timer for subject of the vote or not based on vote type

Definition at line 707 of file SCR_VotingManagerComponent.c.

◆ GetVoteAuthorId()

int GetVoteAuthorId ( EVotingType type,
int value )
protected

Returns the id of the player who started the vote

Parameters
[in]typeType of the vote
[in]valueValue of the vote return playerId of the author

Definition at line 214 of file SCR_VotingManagerComponent.c.

◆ GetVoteCounts()

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

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

Definition at line 197 of file SCR_VotingManagerComponent.c.

◆ GetVotingInfo()

SCR_VotingUIInfo GetVotingInfo ( EVotingType type)
protected

Get UI representation of given voting.

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

Definition at line 567 of file SCR_VotingManagerComponent.c.

◆ GetVotingsAboutPlayer()

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

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

Definition at line 396 of file SCR_VotingManagerComponent.c.

◆ HasAbstainedLocally()

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

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

Definition at line 362 of file SCR_VotingManagerComponent.c.

◆ IsLocalVote()

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

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

Definition at line 698 of file SCR_VotingManagerComponent.c.

◆ IsVoting()

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

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

Definition at line 321 of file SCR_VotingManagerComponent.c.

◆ IsVotingAboutPlayer()

bool IsVotingAboutPlayer ( int playerID,
EVotingType type )
protected

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

Definition at line 332 of file SCR_VotingManagerComponent.c.

◆ IsVotingAvailable()

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

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

Definition at line 306 of file SCR_VotingManagerComponent.c.

◆ Log()

void Log ( )
protected

Print out information about all ongoing voting instances.

Definition at line 728 of file SCR_VotingManagerComponent.c.

◆ OnPlayerConnected()

override void OnPlayerConnected ( int playerId)
protected

Called after a player is connected. Server-only.

Parameters
[in]playerIdPlayerId of connected player.
[in]playerId

Definition at line 927 of file SCR_VotingManagerComponent.c.

◆ OnPlayerDisconnected()

override void OnPlayerDisconnected ( int playerId,
KickCauseCode cause,
int timeout )
protected

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

What happens when a player disconnects.

Parameters
[in]playerIDis a unique player identifier that defines which player has disconnected.
[in]cause
[in]timeout

Definition at line 965 of file SCR_VotingManagerComponent.c.

◆ PreVoteLocal()

void PreVoteLocal ( EVotingType type,
int value )
protected

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)

Definition at line 594 of file SCR_VotingManagerComponent.c.

◆ RemoveVote()

void RemoveVote ( int playerID,
EVotingType type,
int value )
protected

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)

Definition at line 115 of file SCR_VotingManagerComponent.c.

◆ RemoveVoteLocal()

void RemoveVoteLocal ( EVotingType type,
int value )
protected

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)

Definition at line 655 of file SCR_VotingManagerComponent.c.

◆ RPC_PlayerVoteCountChanged()

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

Definition at line 132 of file SCR_VotingManagerComponent.c.

◆ RplLoad()

override bool RplLoad ( ScriptBitReader reader)
protected

Definition at line 1008 of file SCR_VotingManagerComponent.c.

◆ RplSave()

override bool RplSave ( ScriptBitWriter writer)
protected

Definition at line 985 of file SCR_VotingManagerComponent.c.

◆ SCR_VotingManagerComponent()

void SCR_VotingManagerComponent ( IEntityComponentSource src,
IEntity ent,
IEntity parent )
protected
Parameters
[in]src
[in]ent
[in]parent
Examples
F:/Games/AReforger/scripts/Game/GameMode/SCR_GameModeEditor.c.

Definition at line 1083 of file SCR_VotingManagerComponent.c.

◆ ScriptInvoker_VotingManagerEndMethod()

◆ ScriptInvoker_VotingManagerPlayerMethod()

◆ ScriptInvoker_VotingManagerStartMethod()

◆ ScriptInvoker_VotingManagerVoteCountChangedMethod()

◆ StartVoting()

bool StartVoting ( EVotingType type,
int startingPlayerID,
int value = SCR_VotingBase.DEFAULT_VALUE )
protected

Start voting.

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

Definition at line 148 of file SCR_VotingManagerComponent.c.

◆ StartVotingBroadcast()

void StartVotingBroadcast ( EVotingType type,
int value,
int startingPlayerID )
protected

Definition at line 898 of file SCR_VotingManagerComponent.c.

◆ Vote()

void Vote ( int playerID,
EVotingType type,
int value )
protected

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)

Definition at line 71 of file SCR_VotingManagerComponent.c.

◆ VoteLocal()

void VoteLocal ( EVotingType type,
int value )
protected

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)

Definition at line 624 of file SCR_VotingManagerComponent.c.

Variable Documentation

◆ m_aAbstainedVotingInstances

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

Definition at line 33 of file SCR_VotingManagerComponent.c.

◆ m_aVotingInstances

ref array<ref SCR_VotingBase> m_aVotingInstances = {}
protected

Definition at line 32 of file SCR_VotingManagerComponent.c.

◆ m_fUpdateLength

float m_fUpdateLength
protected

Definition at line 31 of file SCR_VotingManagerComponent.c.

◆ m_fUpdateStep

float m_fUpdateStep
protected

Definition at line 28 of file SCR_VotingManagerComponent.c.

◆ m_iHostPlayerID

int m_iHostPlayerID = -1
protected

Definition at line 30 of file SCR_VotingManagerComponent.c.

◆ m_LocalVoteRecords

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

Definition at line 34 of file SCR_VotingManagerComponent.c.

◆ m_OnAbstainVoteLocal

ref ScriptInvoker_VotingManagerStart m_OnAbstainVoteLocal = new ScriptInvoker_VotingManagerStart()
protected

Definition at line 42 of file SCR_VotingManagerComponent.c.

◆ m_OnRemoveVote

Definition at line 39 of file SCR_VotingManagerComponent.c.

◆ m_OnRemoveVoteLocal

ref ScriptInvoker_VotingManagerStart m_OnRemoveVoteLocal = new ScriptInvoker_VotingManagerStart()
protected

Definition at line 41 of file SCR_VotingManagerComponent.c.

◆ m_OnVote

Definition at line 38 of file SCR_VotingManagerComponent.c.

◆ m_OnVoteLocal

Definition at line 40 of file SCR_VotingManagerComponent.c.

◆ m_OnVotingEnd

Definition at line 37 of file SCR_VotingManagerComponent.c.

◆ m_OnVotingStart

Definition at line 36 of file SCR_VotingManagerComponent.c.

◆ m_PlayerVoteCountChanged

Definition at line 43 of file SCR_VotingManagerComponent.c.