1 [
EntityEditorProps(
category:
"GameScripted/GameMode", description:
"Takes care of loading and storing player profile data.", color:
"0 0 255 255")]
16 [
Attribute(
"1",
"Refresh time for profile loading. [s]")]
58 playerProfile.SetFaction(assignedFaction.GetFactionKey());
69 super.OnPlayerKilled(playerId, playerEntity, killerEntity, killer);
72 int killerId = killer.GetInstigatorPlayerID();
78 victimProfile.AddDeath();
81 if (playerId == killerId)
96 if (killerFaction && victimFaction)
99 if (killerFaction.IsFactionFriendly(victimFaction))
102 killerProfile.AddKill(
true);
110 killerProfile.AddKill();
130 if (!
GetGame().GetBackendApi())
137 if (!playerProfile || !
m_Callback || !campaign)
141 playerProfile.SetLogoutTime();
144 GetGame().GetBackendApi().PlayerRequest(EBackendRequest.EBREQ_GAME_CharacterUpdateS2S,
m_Callback,playerProfile,playerID);
146 GetGame().GetBackendApi().PlayerRequest(EBackendRequest.EBREQ_GAME_DevCharacterUpdate,
m_Callback,playerProfile,playerID);
158 if (
GetGame().GetBackendApi().GetDSSession() &&
GetGame().GetBackendApi().GetDSSession().Status() == EDsSessionState.EDSESSION_ACTIVE)
165 GetGame().GetBackendApi().PlayerData(playerProfile, playerID);
194 playerProfile.SetLoginTime();
199 override void EOnFrame(IEntity owner,
float timeSlice)
219 playerProfile.SetLoginTime();
228 SetEventMask(owner, EntityEvent.INIT | EntityEvent.FRAME);
229 owner.SetFlags(EntityFlags.NO_TREE | EntityFlags.NO_LINK);
237 SCR_RespawnSystemComponent respawnSystem = SCR_RespawnSystemComponent.Cast(owner.FindComponent(SCR_RespawnSystemComponent));
241 Print(
"There is no RespawnSystemComponent attached to the GameMode entity. Faction scoring will not work.", LogLevel.WARNING);