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

◆ ValidateDestroy()

bool ValidateDestroy ( inout Serializer ctx,
InventoryValidation validation )
protected

DEPRECATED.

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 строка 2651

2652 {
2654
2655 if (validation.m_IsJuncture)
2656 {
2663
2664 return true;
2665 }
2666
2668 src.ReadFromContext(ctx);
2669
2670 #ifdef ENABLE_LOGGING
2672 {
2673 Debug.InventoryMoveLog("STS = " + GetDayZPlayerOwner().GetSimulationTimeStamp() + " src=" + InventoryLocation.DumpToStringNullSafe(src), "DESTROY" , "n/a", "ProcessInputData", GetDayZPlayerOwner().ToString() );
2674 }
2675 #endif
2676
2677 if (validation.m_IsRemote && !src.GetItem())
2678 {
2679 #ifdef ENABLE_LOGGING
2681 {
2682 Debug.InventoryMoveLog("Failed item not exist", "DESTROY" , "n/a", "ProcessInputData", GetDayZPlayerOwner().ToString() );
2683 }
2684 #endif
2685
2686 Error("[syncinv] HandleInputData remote input (cmd=DESTROY) dropped, item not in bubble");
2687 return true;
2688 }
2689
2694 {
2695 #ifdef ENABLE_LOGGING
2697 {
2698 Debug.InventoryMoveLog("Failed CheckRequestSrc", "DESTROY" , "n/a", "ProcessInputData", GetDayZPlayerOwner().ToString() );
2699 }
2700 #endif
2701
2702 return true;
2703 }
2704
2709 {
2710 #ifdef ENABLE_LOGGING
2712 {
2713 Debug.InventoryMoveLog("Failed CheckDropRequest", "DESTROY" , "n/a", "ProcessInputData", GetDayZPlayerOwner().ToString() );
2714 }
2715 #endif
2716
2717 return true;
2718 }
2719
2720 #ifdef ENABLE_LOGGING
2722 {
2723 Debug.InventoryMoveLog("Success ObjectDelete", "DESTROY" , "n/a", "ProcessInputData", GetDayZPlayerOwner().ToString() );
2724 }
2725 #endif
2726
2727 GetGame().ObjectDelete(src.GetItem());
2728
2729 validation.m_Result = InventoryValidationResult.SUCCESS;
2730 return true;
2731 }
InventoryCommandType
InventoryValidationResult
bool PlayerCheckDropRequest(notnull InventoryLocation src, float radius)
Определения DayZPlayerInventory.c:2591
bool PlayerCheckRequestSrc(notnull InventoryLocation src, float radius)
Определения DayZPlayerInventory.c:2476
DayZPlayer GetDayZPlayerOwner()
Определения DayZPlayerInventory.c:168
proto string ToString()
proto native void ObjectDelete(Object obj)
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/tools/Debug.c:137
Определения 3_Game/tools/Debug.c:2
const float c_MaxItemDistanceRadius
anti-cheats
script counterpart to engine's class Inventory
static string DumpToStringNullSafe(InventoryLocation loc)
Определения InventoryLocation.c:226
bool ReadFromContext(ParamsReadContext ctx)
Определения InventoryLocation.c:296
proto native EntityAI GetItem()
returns item of current inventory location
InventoryLocation.
Определения InventoryLocation.c:29
InventoryValidationResult m_Result
static bool IsInventoryMoveLogEnable()
Определения 3_Game/tools/Debug.c:648
Определения 3_Game/tools/Debug.c:594
proto native CGame GetGame()
void Error(string err)
Messagebox with error message.
Определения EnDebug.c:90

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