DayZ 1.27
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 строка 2641

2642 {
2644
2645 if (validation.m_IsJuncture)
2646 {
2653
2654 return true;
2655 }
2656
2658 src.ReadFromContext(ctx);
2659
2660 #ifdef ENABLE_LOGGING
2662 {
2663 Debug.InventoryMoveLog("STS = " + GetDayZPlayerOwner().GetSimulationTimeStamp() + " src=" + InventoryLocation.DumpToStringNullSafe(src), "DESTROY" , "n/a", "ProcessInputData", GetDayZPlayerOwner().ToString() );
2664 }
2665 #endif
2666
2667 if (validation.m_IsRemote && !src.GetItem())
2668 {
2669 #ifdef ENABLE_LOGGING
2671 {
2672 Debug.InventoryMoveLog("Failed item not exist", "DESTROY" , "n/a", "ProcessInputData", GetDayZPlayerOwner().ToString() );
2673 }
2674 #endif
2675
2676 Error("[syncinv] HandleInputData remote input (cmd=DESTROY) dropped, item not in bubble");
2677 return true;
2678 }
2679
2684 {
2685 #ifdef ENABLE_LOGGING
2687 {
2688 Debug.InventoryMoveLog("Failed CheckRequestSrc", "DESTROY" , "n/a", "ProcessInputData", GetDayZPlayerOwner().ToString() );
2689 }
2690 #endif
2691
2692 return true;
2693 }
2694
2699 {
2700 #ifdef ENABLE_LOGGING
2702 {
2703 Debug.InventoryMoveLog("Failed CheckDropRequest", "DESTROY" , "n/a", "ProcessInputData", GetDayZPlayerOwner().ToString() );
2704 }
2705 #endif
2706
2707 return true;
2708 }
2709
2710 #ifdef ENABLE_LOGGING
2712 {
2713 Debug.InventoryMoveLog("Success ObjectDelete", "DESTROY" , "n/a", "ProcessInputData", GetDayZPlayerOwner().ToString() );
2714 }
2715 #endif
2716
2717 GetGame().ObjectDelete(src.GetItem());
2718
2719 validation.m_Result = InventoryValidationResult.SUCCESS;
2720 return true;
2721 }
InventoryCommandType
Определения Inventory.c:3
InventoryValidationResult
Определения Inventory.c:30
bool PlayerCheckDropRequest(notnull InventoryLocation src, float radius)
Определения DayZPlayerInventory.c:2581
bool PlayerCheckRequestSrc(notnull InventoryLocation src, float radius)
Определения DayZPlayerInventory.c:2466
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)
Определения Debug.c:137
Определения Debug.c:2
const float c_MaxItemDistanceRadius
anti-cheats
Определения Inventory.c:813
script counterpart to engine's class Inventory
Определения Inventory.c:79
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
bool m_IsJuncture
Определения Inventory.c:45
InventoryValidationResult m_Result
Определения Inventory.c:48
bool m_IsRemote
Определения Inventory.c:46
static bool IsInventoryMoveLogEnable()
Определения Debug.c:648
Определения 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().