96 void SCR_PlayerData (
int id,
bool hasPlayerBeenAuditted,
bool requestFromBackend =
true)
109 for (
int i = tEnum.GetVariableCount(); i > 0; i--)
114 if (requestFromBackend)
116 else if (!hasPlayerBeenAuditted)
125 EInputDeviceType device =
GetGame().GetInputManager().GetLastUsedInputDevice();
152 int currentTickCount =
System.GetTickCount();
157 case EInputDeviceType.GAMEPAD:
case EInputDeviceType.JOYSTICK:
160 case EInputDeviceType.MOUSE:
case EInputDeviceType.KEYBOARD:
203 Print(
"SCR_PlayerData:RequestLoadData: Backend api is null!",
LogLevel.WARNING);
208 if (HasPlayerBeenAuditted)
217 Print(
"SCR_PlayerData:RequestLoadData: The character data callback is null",
LogLevel.WARNING);
224 Print(
"Making menuCallback request for PlayerData",
LogLevel.VERBOSE);
233 Print(
"SCR_PlayerData:RequestLoadData: Requesting data before player has been authenticated!",
LogLevel.WARNING);
249 if (
m_aStats.Count() != characterDataEnum.GetVariableCount())
251 Print(
"SCR:PlayerDataStats:FillWithProfile: The CharacterData from this player seems incomplete or empty. A full profile should have "+characterDataEnum.GetVariableCount()+
" stats, but this one has "+
m_aStats.Count()+
". Is it a new player?",
LogLevel.VERBOSE);
255 Print(
"SCR_PlayerData of this player is not empty, but the size is not correct either. We will override their profile with a new one, which will erase their old profile.",
LogLevel.DEBUG);
271 int count = characterDataEnum.GetVariableCount();
275 for (
int i = 0; i < count; i++)
322 Print(
"Maybe a problem: DataProgression is not ready but the analytics event was requested",
LogLevel.WARNING);
326 EInputDeviceType device =
GetGame().GetInputManager().GetLastUsedInputDevice();
389 Print(
"SCR_PlayerData:DebugCalculateStats: This method calls calculateStatsChange providing fake stats for debugging purposes.",
LogLevel.DEBUG);
425 Print(
"SCR_PlayerData:CalculateStatsChange: Specialization stats, experience or rank stats were modified prematurely. The career data for this session might be compromised",
LogLevel.WARNING);
430 int totalSpecializationPointsGain = 0;
513 if (qualityTimeRatio > 1.5)
514 Print(
"SCR_PlayerData:CalculateStatsChange: totalSpecializationPointsGain is suspiciously high. That means player performed better than we expected which could point an an oversight from our side, or even a player cheating. Player with session id " +
m_iPlayerID +
" gained " + totalSpecializationPointsGain +
" points on a session of " + (
m_aStatsGained[
SCR_EDataStats.SESSION_DURATION] / 60) +
" minutes, ending with a qualityTimeRatio of " + qualityTimeRatio,
LogLevel.WARNING);
516 Print(
"SCR_PlayerData:CalculateStatsChange: QualityTimeRatio (aka how well player performed) is: " + qualityTimeRatio,
LogLevel.DEBUG);
542 int currentSpPoints, gainedRawPoints;
543 for (i = 0; i <
m_Configs.SPECIALIZATIONS_COUNT; i++)
563 if (currentSpPoints >=
m_Configs.SPECIALIZATION_MAX)
568 gainedRawPoints *= (1 -
m_Configs.WARCRIMES_PUNISHMENT);
577 Print (
"SCR_PlayerData:CalculateStatsChange: currentSpPoints outside of the accepted ranges.",
LogLevel.WARNING);
634 for (
int i = 0; i <
m_Configs.SPECIALIZATIONS_COUNT; i++)
643 array<float> StatsToReturn = {};
648 for (
int i = 0; i < count; i++)
653 return StatsToReturn;
674 Print (
"SCR_PlayerData:GetSpecializationPoints: WRONG SPECIALIZATION ID.",
LogLevel.WARNING);
691 Print (
"SCR_PlayerData:GetSpecializationPoints: WRONG SPECIALIZATION ID.",
LogLevel.WARNING);
713 Print (
"SCR_PlayerData:AddPointsToSpecialization: WRONG SPECIALIZATION ID.",
LogLevel.WARNING);
745 Print(
"Requesting statsDifference in PrepareSpecializationProgressionStatsDisplay but array is empty. Recalculating it!",
LogLevel.DEBUG);
854 array<float> copy = {};
908 case 0:
return m_Configs.SPECIALIZATION_0_COUNT;
909 case 1:
return m_Configs.SPECIALIZATION_1_COUNT;
910 case 2:
return m_Configs.SPECIALIZATION_2_COUNT;
ArmaReforgerScripted GetGame()
SCR_DataCollectorComponent GetDataCollector()
@ LIGHTBAN_SESSION_DURATION
Session duration at the time player was lightbanned the last time.
@ FRIENDLY_ROADKILLS
Human friendlies killed with a vehicle.
@ SALINE_FRIENDLIES
Number of times player salined friendlies (not including themself).
@ CRIME_ACCELERATION
Kick & Ban acceleration.
@ BANDAGE_FRIENDLIES
Number of times player bandaged friendlies (not including themself).
@ GRENADES_THROWN
Grenades thrown.
@ WARCRIMES
War criminal points.
@ PLAYERS_DIED_IN_VEHICLE
Players that died inside a vehicle while the player drives it.
@ KICK_STREAK
How many times was the player kicked in a row after last kick in a short succession.
@ FRIENDLY_AI_KILLS
Friendly AI kills.
@ HEAVYBAN_STREAK
How many times was the player heavybanned in a row after the last heavyban in a short succession.
@ AI_ROADKILLS
AI enemies killed with a vehicle.
@ MORPHINE_FRIENDLIES
Number of times player morphined friendlies (not including themself).
@ SALINE_SELF
Number of times player salined themself.
@ FRIENDLY_KILLS
Friendly human kills.
@ MORPHINE_SELF
Number of times player morphined themself.
@ SESSION_DURATION
Total duration of sessions.
@ POINTS_AS_DRIVER_OF_PLAYERS
Points obtained for driving players around.
@ FRIENDLY_AI_ROADKILLS
AI friendlies killed with a vehicle.
@ KICK_SESSION_DURATION
Session duration at the time player was kicked the last time.
@ LEVEL_EXPERIENCE
XP points.
@ AI_KILLS
AI enemies killed.
@ LIGHTBAN_STREAK
How many times was the player lightbanned in a row after the last lightban in a short succession.
@ HEAVYBAN_SESSION_DURATION
Session duration at the time player was heavybanned the last time.
@ ROADKILLS
Human enemies killed with a vehicle.
@ BANDAGE_SELF
Number of times player bandaged themself.
@ TOURNIQUET_SELF
Number of times player tourniquetted themself.
@ RANK
Rank of the player.
@ DISTANCE_DRIVEN
Distance driven with a vehicle.
@ DISTANCE_AS_OCCUPANT
Distance the player was driven around with a vehicle.
@ TOURNIQUET_FRIENDLIES
Number of times player tourniquetted friendlies (not including themself).
@ DISTANCE_WALKED
Distance walked on foot.
@ WARCRIME_HARMING_FRIENDLIES
Harming friendlies.
SCR_ESpecialization2Display
SCR_ESpecialization0Display
SCR_ESpecialization1Display
base classes for filtering in server browser
static SCR_PlayerDataConfigs GetInstance()
array< float > GetAccumulatedActions()
ref BackendCallback m_CharacterDataCallback
ref SCR_PlayerDataEvent dataEvent
int GetLatestCriminalScoreUpdateTick()
int m_iSecondsAsController
int m_iAccumulatedActionsTick
SCR_PlayerDataConfigs GetConfigs()
ref SCR_PlayerDataConfigs m_Configs
int GetAccumulatedActionsTick()
ref array< float > m_aPreviousStats
sealed array< float > CalculateStatsDifference()
int GetLatestActionTick()
void PrepareSpecializationProgressionStatsDisplay()
This method sets the SCR_PlayerDataSpecializationDisplay arrays from the PlayerDataConfigs....
sealed void StoreProfile()
void SetStats(array< float > stats)
ref BackendCallback m_StoringCallback
ref array< float > m_aEarnt
array< float > GetStats()
void AddStat(SCR_EDataStats stat, float amount=1, bool temp=true)
void SetTimeOut(int time)
Called manually from the SCR_DataCollectorCrimesModule.
array< float > GetArrayEarntPoints()
void CalculateSessionDuration()
float GetStat(SCR_EDataStats stat, bool newStat=true)
int m_iLatestCriminalScoreUpdateTick
void RequestLoadData(bool HasPlayerBeenAuditted=false)
ref array< float > m_aAccumulatedActions
ref array< float > m_aStats
sealed void DebugCalculateStats()
float GetSpecializationPoints(int n, bool newStats=true)
void SetPreviousStats(array< float > previousStats)
static SCR_PlayerData GetPlayerData(int playerID)
int m_iLastEvaluationCurrentController
Managed GetDataEventStats()
void SCR_PlayerData(int id, bool hasPlayerBeenAuditted, bool requestFromBackend=true)
bool IsDataProgressionReady()
array< float > GetPreviousStats()
ScriptInvoker GetDataReadyInvoker()
static ref ScriptInvoker s_OnStatAdded
void FillArrayWithSpecializationPoints(inout array< float > SpPoints, bool newStats=true)
void ResetAccumulatedActions()
int m_iSessionStartedTickCount
sealed void CalculateStatsChange()
void OverrideStat(SCR_EDataStats stat, float amount=1)
ref array< float > m_aStatsGained
void AddPointsToSpecialization(int n, float value)
ref ScriptInvoker m_OnDataReady
void PrepareSpecializationStatsDisplay()
This method sets the SCR_PlayerDataSpecializationDisplay arrays from the PlayerDataConfigs....
float GetSpecializationCount(int n)
void SetCriminalScore(float score)
void UpdateTrackingController(EInputDeviceType oldDevice, EInputDeviceType newDevice)
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.