Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_PossessSpawnRequestComponent.c
Go to the documentation of this file.
1
[
ComponentEditorProps
(
category
:
"GameScripted/Respawn/PlayerController"
)]
2
class
SCR_PossessSpawnRequestComponentClass
:
SCR_SpawnRequestComponentClass
3
{
4
}
5
6
class
SCR_PossessSpawnRequestComponent : SCR_SpawnRequestComponent
7
{
8
//------------------------------------------------------------------------------------------------
9
override
typename
GetHandlerType
()
10
{
11
return
SCR_PossessSpawnHandlerComponent;
12
}
13
14
//------------------------------------------------------------------------------------------------
15
override
typename
GetDataType
()
16
{
17
return
SCR_PossessSpawnData
;
18
}
19
20
//------------------------------------------------------------------------------------------------
21
protected
override
bool
DoCanRequestRespawn
(
SCR_SpawnData
data
)
22
{
23
#ifdef _ENABLE_RESPAWN_LOGS
24
Print
(
string
.Format(
"%1::DoCanRequestRespawn(playerId: %2, data: %3)"
,
Type
().
ToString
(),
25
GetPlayerController
().
GetPlayerId
(),
data
),
LogLevel
.NORMAL);
26
#endif
27
28
SCR_PossessSpawnData
possessData =
SCR_PossessSpawnData
.Cast(
data
);
29
if
(!possessData)
30
return
false
;
31
32
Rpc(Rpc_CanRequestRespawn_S, possessData.
GetRplId
());
33
return
true
;
34
}
35
36
//------------------------------------------------------------------------------------------------
37
[
RplRpc
(
RplChannel
.Reliable,
RplRcver
.Server)]
38
private
void
Rpc_CanRequestRespawn_S(
RplId
entityRplId)
39
{
40
#ifdef _ENABLE_RESPAWN_LOGS
41
Print
(
string
.Format(
"%1::Rpc_CanRequestRespawn_S(playerId: %2, entityRplId: %3)"
,
Type
().
ToString
(),
42
GetPlayerController
().
GetPlayerId
(),
43
entityRplId),
LogLevel
.NORMAL);
44
#endif
45
46
SCR_PossessSpawnData
data
= SCR_PossessSpawnData.FromRplId(entityRplId);
47
ProcessCanRequest_S
(
data
);
48
}
49
50
//------------------------------------------------------------------------------------------------
51
protected
override
bool
DoRequestRespawn
(
SCR_SpawnData
data
)
52
{
53
#ifdef _ENABLE_RESPAWN_LOGS
54
Print
(
string
.Format(
"%1::DoRequestRespawn(playerId: %2, data: %3)"
,
Type
().
ToString
(),
55
GetPlayerController
().
GetPlayerId
(),
data
),
LogLevel
.NORMAL);
56
#endif
57
58
SCR_PossessSpawnData
possessData =
SCR_PossessSpawnData
.Cast(
data
);
59
if
(!possessData)
60
return
false
;
61
62
Rpc(Rpc_RequestRespawn_S, possessData.
GetRplId
(), possessData.
GetSkipPreload
());
63
return
true
;
64
}
65
66
//------------------------------------------------------------------------------------------------
67
[
RplRpc
(
RplChannel
.Reliable,
RplRcver
.Server)]
68
private
void
Rpc_RequestRespawn_S(
RplId
entityRplId,
bool
skipPreload)
69
{
70
#ifdef _ENABLE_RESPAWN_LOGS
71
Print
(
string
.Format(
"%1::Rpc_RequestRespawn_S(playerId: %2, entityRplId: %3)"
,
Type
().
ToString
(),
72
GetPlayerController
().
GetPlayerId
(),
73
entityRplId),
LogLevel
.NORMAL);
74
#endif
75
76
SCR_PossessSpawnData possessData = SCR_PossessSpawnData.FromRplId(entityRplId);
77
possessData.
SetSkipPreload
(skipPreload);
78
ProcessRequest_S
(possessData);
79
}
80
81
#ifdef ENABLE_DIAG
82
//------------------------------------------------------------------------------------------------
83
override
SCR_BaseRespawnDiag CreateDiag()
84
{
85
return
new
SCR_PossessRespawnDiag();
86
}
87
#endif
88
}
89
90
#ifdef ENABLE_DIAG
91
class
SCR_PossessRespawnDiag : SCR_RespawnDiag<SCR_PossessSpawnRequestComponent>
92
{
93
protected
int
m_RplId;
94
95
//------------------------------------------------------------------------------------------------
96
override
void
DrawContent()
97
{
98
super.DrawContent();
99
DbgUI.InputInt(
"Entity RplId: "
, m_RplId);
100
}
101
102
//------------------------------------------------------------------------------------------------
103
protected
override
SCR_SpawnData CreateData()
104
{
105
return
SCR_PossessSpawnData.FromRplId(m_RplId);
106
}
107
}
108
#endif
ComponentEditorProps
enum EAIGroupCombatMode ComponentEditorProps(category:"GameScripted/AI", description:"Component for utility AI system for groups")
Definition
SCR_AIGroupUtilityComponent.c:12
data
Get all prefabs that have the spawner data
Definition
SCR_EntityCatalogManagerComponent.c:320
GetHandlerType
SCR_FreeSpawnRequestComponentClass SCR_SpawnRequestComponentClass GetHandlerType()
Definition
SCR_FreeSpawnRequestComponent.c:9
GetDataType
override GetDataType()
Definition
SCR_FreeSpawnRequestComponent.c:15
DoRequestRespawn
bool DoRequestRespawn(SCR_SpawnData data)
Definition
SCR_SpawnRequestComponent.c:334
ProcessRequest_S
void ProcessRequest_S(SCR_SpawnData data)
Definition
SCR_SpawnRequestComponent.c:344
ProcessCanRequest_S
void ProcessCanRequest_S(SCR_SpawnData data)
Definition
SCR_SpawnRequestComponent.c:211
DoCanRequestRespawn
bool DoCanRequestRespawn(SCR_SpawnData data)
Definition
SCR_SpawnRequestComponent.c:201
category
params category
Definition
SCR_VehicleDamageManagerComponent.c:302
Type
int Type
Definition
ScriptCamera.c:17
SCR_PossessSpawnData
Definition
SCR_PossessSpawnData.c:3
SCR_PossessSpawnData::GetRplId
RplId GetRplId()
Definition
SCR_PossessSpawnData.c:10
SCR_PossessSpawnData::GetSkipPreload
override bool GetSkipPreload()
Definition
SCR_PossessSpawnData.c:56
SCR_PossessSpawnData::SetSkipPreload
override void SetSkipPreload(bool skip)
Definition
SCR_PossessSpawnData.c:51
SCR_PossessSpawnRequestComponentClass
Definition
SCR_PossessSpawnRequestComponent.c:3
SCR_SpawnData
Definition
SCR_SpawnData.c:10
SCR_SpawnRequestComponentClass
Definition
SCR_SpawnRequestComponent.c:2
Print
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
LogLevel
Enum with severity of the logging message.
Definition
LogLevel.c:14
GetPlayerController
proto external PlayerController GetPlayerController()
Definition
SCR_PlayerDeployMenuHandlerComponent.c:307
GetPlayerId
proto external int GetPlayerId()
Definition
SCR_SpawnRequestComponent.c:39
RplRpc
void RplRpc(RplChannel channel, RplRcver rcver, RplCondition condition=RplCondition.None, string customConditionName="")
Definition
EnNetwork.c:95
RplRcver
RplRcver
Definition
RplRcver.c:59
RplChannel
RplChannel
Communication channel. Reliable is guaranteed to be delivered. Unreliable not.
Definition
RplChannel.c:14
RplId
int RplId
Definition
EnNetwork.c:33
ToString
proto external string ToString()
Plain C++ pointer, no weak pointers, no memory management.
scripts
Game
Respawn
RequestHandling
Implementation
PossessSpawn
SCR_PossessSpawnRequestComponent.c
Generated by
1.17.0