- Возвращает
- false on malformed data, true on anything else, including cheats
It should be impossible for juncture to be ran on remote
Serializer can be updated and re-written to when we may want to only correct the client instead of denying the inventory command
Only inform client about failure
General purpose serializer change from read to write here if the validation doesn't update it
Only send juncture back to client
См. определение в файле DayZPlayerInventory.c строка 1530
1531 {
1532 if (isJuncture && isRemote)
1533 {
1535 return false;
1536 }
1537
1538 int type = -1;
1539 if (!ctx.
Read(type))
1540 {
1541 return false;
1542 }
1543
1547
1550
1551 switch (type)
1552 {
1554 if (!ValidateUserReservationCancel(serializer, validation))
1555 {
1556 return false;
1557 }
1558 break;
1561 {
1562 return false;
1563 }
1564 break;
1567 {
1568 return false;
1569 }
1570 break;
1573 {
1574 return false;
1575 }
1576 break;
1577 default:
1578 break;
1579 }
1580
1582
1584 {
1586 if (canSendJuncture)
1587 {
1590 {
1592 writeableSerializer.CopyFrom(serializer);
1593 serializer = writeableSerializer;
1594 }
1595
1597
1599 }
1600 break;
1602 if (canSendJuncture)
1603 {
1605
1606 }
1607 else
1608 {
1609 Error(
"InventoryValidationResult.JUNCTURE returned when not possible to send!");
1610 }
1611 break;
1614 break;
1615 }
1616
1617 return true;
1618 }
InventoryValidationResult
bool ValidateSyncMove(inout Serializer ctx, InventoryValidation validation)
bool ValidateHandEvent(inout Serializer ctx, InventoryValidation validation)
DayZPlayer GetDayZPlayerOwner()
bool ValidateSwap(inout Serializer ctx, InventoryValidation validation)
bool StoreInputForRemotes(bool handling_juncture, bool remote, ParamsReadContext ctx)
static const int SJ_INVENTORY_FAILURE
static const int SJ_INVENTORY
InventoryValidationResult m_Result
InventoryValidationReason m_Reason
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native bool CanWrite()
Serialization general interface. Serializer API works with:
DayZPlayerInstanceType
defined in C++
void Error(string err)
Messagebox with error message.
Перекрестные ссылки Serializer::CanWrite(), ScriptInputUserData::CopyFrom(), Error(), GetDayZPlayerOwner(), InventoryValidation::m_IsJuncture, InventoryValidation::m_IsRemote, InventoryValidation::m_Reason, InventoryValidation::m_Result, Serializer::Read(), DayZPlayerSyncJunctures::SJ_INVENTORY, DayZPlayerSyncJunctures::SJ_INVENTORY_FAILURE, StoreInputForRemotes(), ValidateHandEvent(), ValidateSwap(), ValidateSyncMove() и Serializer::Write().
Используется в OnHandleStoredInputUserData(), OnHandleStoredJunctureData(), OnInputUserDataForRemote() и OnServerInventoryCommand().