DayZ 1.29
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ OnFinishProgressServer()

override void ActionDeployBase::OnFinishProgressServer ( ActionData action_data)
inlineprotected

См. определение в файле ActionDeployBase.c строка 70

71 {
72 PlaceObjectActionData poActionData = PlaceObjectActionData.Cast(action_data);
73 if (!poActionData)
74 return;
75
76 if (!poActionData.m_MainItem)
77 return;
78
79 ClearActionJuncture(action_data);
80
81 EntityAI entity_for_placing = poActionData.m_MainItem;
82 vector position = vector.Zero;
83 vector orientation = vector.Zero;
84
85 // In case of placement action that requires hologram, look for it, or fail
87 {
88 if (poActionData.m_Player.GetHologramServer())
89 {
90 position = poActionData.m_Position;
91 orientation = poActionData.m_Orientation;
92
93 poActionData.m_Player.GetHologramServer().EvaluateCollision(poActionData.m_MainItem);
94 if (g_Game.IsMultiplayer() && poActionData.m_Player.GetHologramServer().IsColliding())
95 return;
96
97 poActionData.m_Player.GetHologramServer().PlaceEntity(entity_for_placing);
98
99 if (g_Game.IsMultiplayer())
100 poActionData.m_Player.GetHologramServer().CheckPowerSource();
101
102 #ifdef DEVELOPER
103 if (IsCLIParam("hologramLogs"))
104 {
105 Debug.Log(string.Format("Hologram of %1 found, deployment successful.", poActionData.m_MainItem), "hologramLogs");
106 Debug.Log(string.Format("Pos Comparison | player: %1 | hologram: %2 | action data: %3", poActionData.m_Player.GetPosition(),poActionData.m_Player.GetLocalProjectionPosition(),position), "hologramLogs");
107 }
108 #endif
109 }
110 else
111 {
112 Debug.Log(string.Format("Expected hologram of %1 not found, failing deployment!", poActionData.m_MainItem), Type().ToString());
113 return;
114 }
115 }
116 else //action does NOT require hologram in the first place, take player's info instead
117 {
118 position = poActionData.m_Player.GetPosition();
119 orientation = poActionData.m_Player.GetOrientation();
120 position = position + (poActionData.m_Player.GetDirection() * POSITION_OFFSET);
121 }
122
123 MoveEntityToFinalPosition(poActionData, position, orientation);
124 poActionData.m_MainItem.SetIsBeingPlaced(false);
125 poActionData.m_AlreadyPlaced = true;
126
127 entity_for_placing.OnPlacementComplete(poActionData.m_Player, position, orientation); //beware, this WILL fire on server before the item is moved to final position!
128 poActionData.m_Player.PlacingCompleteServer();
129
130 m_MovedItems.Clear();
131 }
class LogManager EntityAI
string Debug()
Определения CachedEquipmentStorageBase.c:29
DayZGame g_Game
Определения DayZGame.c:3942
proto string ToString()
string Type
Определения JsonDataContaminatedArea.c:11
void ClearActionJuncture(ActionData action_data)
Определения ActionBase.c:1104
bool ActionUsesHologram()
Определения ActionDeployBase.c:51
void MoveEntityToFinalPosition(ActionData action_data, vector position, vector orientation)
Определения ActionDeployBase.c:206
const float POSITION_OFFSET
Определения ActionDeployBase.c:21
ref array< ItemBase > m_MovedItems
Определения ActionDeployBase.c:23
vector m_Orientation
Определения ActionDeployBase.c:4
bool m_AlreadyPlaced
Определения ActionDeployBase.c:5
vector m_Position
Определения ActionDeployBase.c:3
proto native bool IsCLIParam(string param)
Returns if command line argument is present.

Перекрестные ссылки ActionData, ActionUsesHologram(), ActionBase::ClearActionJuncture(), g_Game, IsCLIParam(), Debug::Log(), PlaceObjectActionData::m_AlreadyPlaced, m_MovedItems, PlaceObjectActionData::m_Orientation, PlaceObjectActionData::m_Position, MoveEntityToFinalPosition(), POSITION_OFFSET, ToString(), Type и vector::Zero.