DayZ 1.29
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 строка 3079

3080 {
3082
3083 if (validation.m_IsJuncture)
3084 {
3091
3092 return true;
3093 }
3094
3096 src.ReadFromContext(ctx);
3097
3098 #ifdef ENABLE_LOGGING
3100 {
3101 Debug.InventoryMoveLog("STS = " + GetDayZPlayerOwner().GetSimulationTimeStamp() + " src=" + InventoryLocation.DumpToStringNullSafe(src), "DESTROY" , "n/a", "ProcessInputData", GetDayZPlayerOwner().ToString() );
3102 }
3103 #endif
3104
3105 if (validation.m_IsRemote && !src.GetItem())
3106 {
3107 #ifdef ENABLE_LOGGING
3109 {
3110 Debug.InventoryMoveLog("Failed item not exist", "DESTROY" , "n/a", "ProcessInputData", GetDayZPlayerOwner().ToString() );
3111 }
3112 #endif
3113
3114 Error("[syncinv] HandleInputData remote input (cmd=DESTROY) dropped, item not in bubble");
3115 return true;
3116 }
3117
3122 {
3123 #ifdef ENABLE_LOGGING
3125 {
3126 Debug.InventoryMoveLog("Failed CheckRequestSrc", "DESTROY" , "n/a", "ProcessInputData", GetDayZPlayerOwner().ToString() );
3127 }
3128 #endif
3129
3130 return true;
3131 }
3132
3137 {
3138 #ifdef ENABLE_LOGGING
3140 {
3141 Debug.InventoryMoveLog("Failed CheckDropRequest", "DESTROY" , "n/a", "ProcessInputData", GetDayZPlayerOwner().ToString() );
3142 }
3143 #endif
3144
3145 return true;
3146 }
3147
3148 if (GetInventoryOwner() != src.GetParent())
3149 {
3150 #ifdef ENABLE_LOGGING
3152 {
3153 Debug.InventoryMoveLog("Failed PlayerDoesNotOwnItem", "DESTROY", "n/a", "ProcessInputData", GetDayZPlayerOwner().ToString() );
3154 }
3155 #endif
3156
3157 return true;
3158 }
3159
3160 #ifdef ENABLE_LOGGING
3162 {
3163 Debug.InventoryMoveLog("Success ObjectDelete", "DESTROY" , "n/a", "ProcessInputData", GetDayZPlayerOwner().ToString() );
3164 }
3165 #endif
3166
3167 g_Game.ObjectDelete(src.GetItem());
3168
3169 validation.m_Result = InventoryValidationResult.SUCCESS;
3170 return true;
3171 }
InventoryCommandType
InventoryValidationResult
DayZGame g_Game
Определения DayZGame.c:3942
bool PlayerCheckDropRequest(notnull InventoryLocation src, float radius)
Определения DayZPlayerInventory.c:3019
bool PlayerCheckRequestSrc(notnull InventoryLocation src, float radius)
Определения DayZPlayerInventory.c:2814
DayZPlayer GetDayZPlayerOwner()
Определения DayZPlayerInventory.c:167
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:197
Определения 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:746
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().