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

◆ ValidateDestroy()

bool ValidateDestroy ( inout Serializer ctx,
InventoryValidation validation )
protected

TODO(kumarjac): Probably should be called through inventory juncture, we shouldn't allow the client to delete until the server says it is okay as there can be more reasons than "cheater" for it to be rejected such as desync

Do not check for action validity on remotes or when performing through juncture. Juncture locks guarentee the item is safe to interact with and the server has validated the command at this point. Checking at this point is both wasteful and can result in a failure which leads to desync

Do not check for action validity on remotes or when performing through juncture. Juncture locks guarentee the item is safe to interact with and the server has validated the command at this point. Checking at this point is both wasteful and can result in a failure which leads to desync

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

4910 {
4912
4913 if (validation.m_IsJuncture)
4914 {
4921
4922 return true;
4923 }
4924
4926 src.ReadFromContext(ctx);
4927
4928 #ifdef ENABLE_LOGGING
4930 {
4931 Debug.InventoryMoveLog("STS = " + GetDayZPlayerOwner().GetSimulationTimeStamp() + " src=" + InventoryLocation.DumpToStringNullSafe(src), "DESTROY" , "n/a", "ProcessInputData", GetDayZPlayerOwner().ToString() );
4932 }
4933 #endif
4934
4935 if (validation.m_IsRemote && !src.GetItem())
4936 {
4937 #ifdef ENABLE_LOGGING
4939 {
4940 Debug.InventoryMoveLog("Failed item not exist", "DESTROY" , "n/a", "ProcessInputData", GetDayZPlayerOwner().ToString() );
4941 }
4942 #endif
4943
4944 Error("[syncinv] HandleInputData remote input (cmd=DESTROY) dropped, item not in bubble");
4945 return true;
4946 }
4947
4952 {
4953 #ifdef ENABLE_LOGGING
4955 {
4956 Debug.InventoryMoveLog("Failed CheckRequestSrc", "DESTROY" , "n/a", "ProcessInputData", GetDayZPlayerOwner().ToString() );
4957 }
4958 #endif
4959
4960 return true;
4961 }
4962
4967 {
4968 #ifdef ENABLE_LOGGING
4970 {
4971 Debug.InventoryMoveLog("Failed CheckDropRequest", "DESTROY" , "n/a", "ProcessInputData", GetDayZPlayerOwner().ToString() );
4972 }
4973 #endif
4974
4975 return true;
4976 }
4977
4978 if (GetInventoryOwner() != src.GetParent())
4979 {
4980 #ifdef ENABLE_LOGGING
4982 {
4983 Debug.InventoryMoveLog("Failed PlayerDoesNotOwnItem", "DESTROY", "n/a", "ProcessInputData", GetDayZPlayerOwner().ToString() );
4984 }
4985 #endif
4986
4987 return true;
4988 }
4989
4990 #ifdef ENABLE_LOGGING
4992 {
4993 Debug.InventoryMoveLog("Success ObjectDelete", "DESTROY" , "n/a", "ProcessInputData", GetDayZPlayerOwner().ToString() );
4994 }
4995 #endif
4996
4997 g_Game.ObjectDelete(src.GetItem());
4998
4999 validation.m_Result = InventoryValidationResult.SUCCESS;
5000 return true;
5001 }
InventoryCommandType
InventoryValidationResult
DayZGame g_Game
Определения DayZGame.c:4074
bool PlayerCheckDropRequest(notnull InventoryLocation src, float radius)
Определения DayZPlayerInventory.c:4849
bool PlayerCheckRequestSrc(notnull InventoryLocation src, float radius)
Определения DayZPlayerInventory.c:4644
DayZPlayer GetDayZPlayerOwner()
Определения DayZPlayerInventory.c:170
proto string ToString()
static void InventoryMoveLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Определения 3_Game/DayZ/tools/Debug.c:198
Определения 3_Game/DayZ/tools/Debug.c:2
const float c_MaxItemDistanceRadius
anti-cheats
script counterpart to engine's class Inventory
proto native EntityAI GetParent()
returns parent of current inventory location
static string DumpToStringNullSafe(InventoryLocation loc)
Определения InventoryLocation.c:233
bool ReadFromContext(ParamsReadContext ctx)
Определения InventoryLocation.c:310
proto native EntityAI GetItem()
returns item of current inventory location
InventoryLocation.
Определения InventoryLocation.c:30
InventoryValidationResult m_Result
static bool IsInventoryMoveLogEnable()
Определения 3_Game/DayZ/tools/Debug.c:759
void Error(string err)
Messagebox with error message.
Определения EnDebug.c:90

Перекрестные ссылки GameInventory::c_MaxItemDistanceRadius, InventoryLocation::DumpToStringNullSafe(), Error(), g_Game, GetDayZPlayerOwner(), InventoryLocation::GetItem(), InventoryLocation::GetParent(), Debug::InventoryMoveLog(), LogManager::IsInventoryMoveLogEnable(), InventoryValidation::m_IsJuncture, InventoryValidation::m_IsRemote, InventoryValidation::m_Result, PlayerCheckDropRequest(), PlayerCheckRequestSrc(), InventoryLocation::ReadFromContext() и ToString().