DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс ActionManagerServer
+ Граф наследования:ActionManagerServer:

Защищенные члены

void ActionManagerServer (PlayerBase player)
 
override void OnJumpStart ()
 
override bool OnInputUserDataProcess (int userDataType, ParamsReadContext ctx)
 
override void StartDeliveredAction ()
 
override void OnActionEnd ()
 
override void Update (int pCurrentCommandID)
 
override void Interrupt ()
 
override ActionReciveData GetReciveData ()
 

Защищенные данные

ActionBase m_PendingAction
 
ref ActionReciveData m_PendingActionReciveData
 

Подробное описание

Конструктор(ы)

◆ ActionManagerServer()

void ActionManagerServer ( PlayerBase player)
inlineprotected
7 {
10 }
ActionBase m_PendingAction
Definition ActionManagerServer.c:3
ref ActionReciveData m_PendingActionReciveData
Definition ActionManagerServer.c:4
Definition EntityAI.c:95

Перекрестные ссылки m_PendingAction и m_PendingActionReciveData.

Методы

◆ GetReciveData()

override ActionReciveData GetReciveData ( )
inlineprotected
308 {
310 }

Перекрестные ссылки m_PendingActionReciveData.

◆ Interrupt()

override void Interrupt ( )
inlineprotected
300 {
301 super.Interrupt();
302
305 }
ref ActionData m_CurrentActionData
Definition ActionManagerBase.c:61
DayZPlayer m_Player
Definition Hand_Events.c:42
Definition DayZPlayerSyncJunctures.c:5
static void SendActionInterrupt(DayZPlayer pPlayer)
Definition DayZPlayerSyncJunctures.c:265

Перекрестные ссылки m_CurrentActionData, m_Player и DayZPlayerSyncJunctures::SendActionInterrupt().

Используется в OnInputUserDataProcess(), StartDeliveredAction() и Update().

◆ OnActionEnd()

override void OnActionEnd ( )
inlineprotected
180 {
181 //Debug.Log("Action ended - hard, STS = " + m_Player.GetSimulationTimeStamp());
183 {
184 m_CurrentActionData.m_Action.ClearActionJuncture(m_CurrentActionData);
185
186 super.OnActionEnd();
187 }
188 }

Перекрестные ссылки m_CurrentActionData.

Используется в OnJumpStart() и Update().

◆ OnInputUserDataProcess()

override bool OnInputUserDataProcess ( int userDataType,
ParamsReadContext ctx )
inlineprotected
32 {
33 switch (userDataType)
34 {
36 {
37 bool success = true;
38
39 int actionID = 0;
40 if (!ctx.Read(actionID))
41 return false;
42
44 if (!recvAction)
45 return false;
46
47 if (!recvAction.ReadFromContext(ctx, m_PendingActionReciveData))
48 success = false;
49
51
52 if (recvAction.UseAcknowledgment())
53 {
54 int ackID;
55 if (!ctx.Read(ackID))
56 success = false;
57
59 }
60
61 break;
62
63 }
64
66 {
67 //Debug.Log("Action want end request, STS = " + m_Player.GetSimulationTimeStamp());
68 int commandID = -10;
69 ctx.Read(commandID);
70
71 if (commandID == DayZPlayerConstants.CMD_ACTIONINT_INTERRUPT)
72 {
73 //Print("INPUT_UDT_STANDARD_ACTION_END_REQUEST | CMD_ACTIONINT_INTERRUPT");
74 Interrupt();
75 }
76 else
77 {
78 //Print("INPUT_UDT_STANDARD_ACTION_END_REQUEST | m_ActionWantEndRequest");
80 }
81 }
82
84 {
85 //Debug.Log("Action input ended, STS = " + m_Player.GetSimulationTimeStamp());
87 }
88 default:
89 return false;
90 }
91
92 if (!success)
93 {
94 //Debug.Log("[AM] OnInputUserDataProcess INPUT_UDT_STANDARD_ACTION_START Error");
95 if (recvAction.UseAcknowledgment())
96 {
98 }
99 else
100 {
101 Interrupt();
102 }
103
104 return false;
105 }
106 return true;
107
108 }
const int INPUT_UDT_STANDARD_ACTION_END_REQUEST
Definition _constants.c:3
const int INPUT_UDT_STANDARD_ACTION_START
Definition _constants.c:2
const int INPUT_UDT_STANDARD_ACTION_INPUT_END
Definition _constants.c:4
override ActionBase GetAction()
Definition ActionInput.c:482
bool m_ActionInputWantEnd
Definition ActionManagerBase.c:53
int m_PendingActionAcknowledgmentID
Definition ActionManagerBase.c:59
bool m_ActionWantEndRequest
Definition ActionManagerBase.c:52
Definition ActionBase.c:53
override void Interrupt()
Definition ActionManagerServer.c:299
static void SendActionAcknowledgment(DayZPlayer pPlayer, int AckID, bool accept)
Definition DayZPlayerSyncJunctures.c:280
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602

Перекрестные ссылки GetAction(), INPUT_UDT_STANDARD_ACTION_END_REQUEST, INPUT_UDT_STANDARD_ACTION_INPUT_END, INPUT_UDT_STANDARD_ACTION_START, Interrupt(), m_ActionInputWantEnd, m_ActionWantEndRequest, m_PendingAction, m_PendingActionAcknowledgmentID, m_PendingActionReciveData, m_Player и DayZPlayerSyncJunctures::SendActionAcknowledgment().

◆ OnJumpStart()

override void OnJumpStart ( )
inlineprotected
16 {
18 {
20 {
23 }
24 else
25 {
26 m_CurrentActionData.m_Action.Interrupt(m_CurrentActionData);
27 }
28 }
29 }
override void OnActionEnd()
Definition ActionManagerServer.c:179
const int UA_AM_ACCEPTED
Definition constants.c:454
const int UA_AM_REJECTED
Definition constants.c:455
const int UA_AM_PENDING
Definition constants.c:453

Перекрестные ссылки m_CurrentActionData, m_PendingActionAcknowledgmentID, OnActionEnd(), UA_AM_ACCEPTED, UA_AM_PENDING и UA_AM_REJECTED.

◆ StartDeliveredAction()

override void StartDeliveredAction ( )
inlineprotected

error - expected action data

111 {
113 {
115 return;
116 }
117
118 m_Interrupted = false;
119
120 bool accepted = false;
122 ActionTarget target = m_CurrentActionData.m_Target;
123 ItemBase item = m_CurrentActionData.m_MainItem;
124
126 {
127 if (target)
128 {
129 Debug.ActionLog("Item = " + item + ", " + target.DumpToString(), pickedAction.ToString() , "n/a", "DeliveredAction", m_Player.ToString());
130 }
131 else
132 {
133 Debug.ActionLog("Item = " + item + ", NULL", pickedAction.ToString() , "n/a", "DeliveredAction", m_Player.ToString());
134 }
135 }
136
137 if (!m_Player.GetCommandModifier_Action() && !m_Player.GetCommand_Action() && !m_Player.IsSprinting() && pickedAction && pickedAction.Can(m_Player,target,item))
138 {
139 if (pickedAction.AddActionJuncture(m_CurrentActionData))
140 accepted = true;
141 }
142
143 if (accepted)
144 {
146 {
147 Debug.ActionLog("Action accepted", pickedAction.ToString() , "n/a", "CheckDeliveredAction", m_Player.ToString() );
148 }
149 //Debug.Log("[AM] Action acccepted");
150 if (pickedAction.UseAcknowledgment())
151 {
152 //Unlock target
155 }
156 else
157 {
159 }
160 }
161 else
162 {
164 {
165 Debug.ActionLog("Action rejected", pickedAction.ToString() , "n/a", "CheckDeliveredAction", m_Player.ToString() );
166 }
167
168 if (pickedAction.UseAcknowledgment())
169 {
171 }
172 else
173 {
174 Interrupt();
175 }
176 }
177 }
bool m_Interrupted
Definition ActionManagerBase.c:49
Definition Debug.c:14
static void ActionLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Definition Debug.c:141
Definition InventoryItem.c:731
Definition Debug.c:600
static bool IsActionLogEnable()
Definition Debug.c:644

Перекрестные ссылки Debug::ActionLog(), Interrupt(), LogManager::IsActionLogEnable(), m_CurrentActionData, m_Interrupted, m_PendingActionAcknowledgmentID, m_Player, DayZPlayerSyncJunctures::SendActionAcknowledgment(), UA_AM_ACCEPTED и UA_AM_PENDING.

Используется в Update().

◆ Update()

override void Update ( int pCurrentCommandID)
inlineprotected
192 {
193 super.Update(pCurrentCommandID);
194 int currentCommandID = m_Player.GetCurrentCommandID();
195
196 //Debug.Log("m_ActionWantEnd " + m_ActionInputWantEnd);
197
198 if (m_PendingAction)
199 {
201 {
203 }
204 else
205 {
207 m_ActionInputWantEnd = false;
208
209 bool success = true;
210 ActionTarget target = new ActionTarget(null, null, -1, vector.Zero, 0);
211
213 {
214 Debug.ActionLog("n/a", m_PendingAction.ToString() , "n/a", "HandlePendingAction", m_Player.ToString() );
215 }
216
218 {
219 success = false;
220 }
221 //Debug.Log("[AM] Action data synced (" + m_Player + ") success: " + success);
222
223 if (success)
224 {
226 }
227 else
228 {
230 {
232 }
233 else
234 {
235 Interrupt();
236 }
237 }
238 }
239
242 }
243
245 {
247 {
248 m_CurrentActionData.m_Action.OnUpdateServer(m_CurrentActionData);
249 }
250
251 //Debug.Log("m_CurrentActionData.m_State: " + m_CurrentActionData.m_State +" m_ActionWantEnd: " + m_ActionWantEndRequest );
252 switch (m_CurrentActionData.m_State)
253 {
254 case UA_AM_PENDING:
255 break;
256
257 case UA_AM_ACCEPTED:
258 // check currentCommandID before start or reject
259
261 bool canActionPerform = ((condition_mask & m_CurrentActionData.m_Action.m_ConditionMask) == condition_mask);
263 {
266
267 if (m_CurrentActionData.m_Action && m_CurrentActionData.m_Action.IsInstant())
268 OnActionEnd();
269 }
270 else
271 {
272 Interrupt();
273 }
275 break;
276
277 case UA_AM_REJECTED:
278 OnActionEnd();
280 break;
281
282 default:
284 {
285 m_ActionInputWantEnd = false;
286 m_CurrentActionData.m_Action.EndInput(m_CurrentActionData);
287 }
288
290 {
292 m_CurrentActionData.m_Action.EndRequest(m_CurrentActionData);
293 }
294 break;
295 }
296 }
297 }
bool ActionPossibilityCheck(int pCurrentCommandID)
Definition ActionManagerBase.c:244
class ActionTargets ActionTarget
bool UseAcknowledgment()
Definition ActionBase.c:1019
static int ComputeConditionMask(PlayerBase player, ActionTarget target, ItemBase item)
Definition ActionBase.c:704
bool SetupAction(PlayerBase player, ActionTarget target, ItemBase item, out ActionData action_data, Param extra_data=NULL)
Definition ActionBase.c:156
override void StartDeliveredAction()
Definition ActionManagerServer.c:110
Definition EnConvert.c:106
static const vector Zero
Definition EnConvert.c:110
const int UA_START
Definition constants.c:446

Перекрестные ссылки Debug::ActionLog(), ActionPossibilityCheck(), ActionTarget, ActionBase::ComputeConditionMask(), Interrupt(), LogManager::IsActionLogEnable(), m_ActionInputWantEnd, m_ActionWantEndRequest, m_CurrentActionData, m_PendingAction, m_PendingActionAcknowledgmentID, m_PendingActionReciveData, m_Player, OnActionEnd(), DayZPlayerSyncJunctures::SendActionAcknowledgment(), ActionBase::SetupAction(), StartDeliveredAction(), UA_AM_ACCEPTED, UA_AM_PENDING, UA_AM_REJECTED, UA_START, ActionBase::UseAcknowledgment() и vector::Zero.

Поля

◆ m_PendingAction

ActionBase m_PendingAction
protected

Используется в ActionManagerServer(), OnInputUserDataProcess() и Update().

◆ m_PendingActionReciveData

ref ActionReciveData m_PendingActionReciveData
protected

Объявления и описания членов класса находятся в файле: