kumarjac: This indicates a failure in replication relationships as player full inventory should be synchronized always if player exists on the remote
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
kumarjac: This indicates a failure in replication relationships as player full inventory should be synchronized always if player exists on the remote
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
Check if this this is being executed on the server and not by a juncture or AI so we can lock the item and ensure replication relationships are setup
TODO(kumarjac): We should continue with the execution and not have this special block but making a change here now will require testing
Is called twice unfortunately...
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
748 {
750
753 bool success = true;
754
757
758 #ifdef ENABLE_LOGGING
760 {
762 }
763 #endif
764
767
768 if (validation.
m_IsRemote && (!itemSrc || !itemDst))
769 {
771
772#ifdef ENABLE_LOGGING
774 {
776 }
777
779 {
781 }
782#endif
783
784 return true;
785 }
786
788 {
789 #ifdef ENABLE_LOGGING
791 {
793 }
794
796 {
797 syncDebugPrint(
"[syncinv] HandleInputData Failed - src and dst are for different items src item =" + itemSrc +
" dst item =" + itemDst);
798 }
799 #endif
800
802 {
803 success = false;
804 }
805 else
806 {
807 return true;
808 }
809 }
810
812
817 {
819
820#ifdef ENABLE_LOGGING
822 {
824 }
825
827 {
829 }
830#endif
831
833
835 {
836 success = false;
837 #ifdef DIAG_DEVELOPER
838 if (PluginInventoryDebug.Cast(
GetPlugin(PluginInventoryDebug)).IsDesyncRepairEnable())
839 {
840 #endif
843 src.
GetItem().GetInventory().GetCurrentInventoryLocation(realIl);
844
845 if(src != realIl)
846 {
847 itemsToRepair.Insert(src.
GetItem());
849 }
850 #ifdef DIAG_DEVELOPER
851 }
852 #endif
853 }
854 else
855 {
856 return true;
857 }
858 }
859
864 {
865#ifdef ENABLE_LOGGING
867 {
869 }
870
872 {
874 }
875#endif
876
878
880 {
882 success = false;
883 }
884 else
885 {
886 return true;
887 }
888 }
889
891
892#ifdef ENABLE_LOGGING
894 {
896 }
897#endif
898
901 {
904 {
905 #ifdef ENABLE_LOGGING
907 {
909 }
910 #endif
911 if (success)
912 {
914
915 LocationSyncMoveEntity(src, dst);
916
918 }
919 return true;
920 }
922 {
923 #ifdef ENABLE_LOGGING
925 {
927 }
928 #endif
929
931 {
932 #ifdef ENABLE_LOGGING
933
934 #ifdef DEVELOPER
935 DumpInventoryDebug();
936 #endif
937
939 {
941 }
942 #endif
944 return true;
945 }
946
949 return true;
950 }
951 else
952 {
953 #ifdef ENABLE_LOGGING
955 {
957 }
958 #endif
959
962 return true;
963 }
964 }
965
967 {
968 bool hasJuncture = false;
969 if (itemSrc != null && itemDst != null)
970 {
972 }
973 else if (itemSrc != null)
974 {
976 }
977 else if (itemDst != null)
978 {
980 }
981
982 if (!hasJuncture)
983 {
984 success = false;
985 }
986 }
987
989 {
990 ClearInventoryReservationEx(itemDst, dst);
991 }
992
995 {
997 }
998
1003 {
1004 #ifdef ENABLE_LOGGING
1005
1006 #ifdef DEVELOPER
1007 DumpInventoryDebug();
1008 #endif
1009
1011 {
1013 }
1014 #endif
1015
1017 return true;
1018 }
1019
1020
1022 {
1023 #ifdef ENABLE_LOGGING
1025 {
1027 }
1028 #endif
1029 return false;
1030 }
1031
1032 #ifdef ENABLE_LOGGING
1034 {
1036 }
1037 #endif
1038
1039 if (success)
1040 {
1041 LocationSyncMoveEntity(src, dst);
1043 }
1044
1045 return true;
1046 }
void syncDebugPrint(string s)
InventoryValidationResult
InventoryValidationReason
void EnableMovableOverride(EntityAI item)
bool MoveCheckExclusionMaskLocal(notnull InventoryLocation src, notnull InventoryLocation dst)
Local, checks only stuff that is in guaranteed sync.
void CheckForRope(InventoryLocation src, InventoryLocation dst)
bool PlayerCheckRequestSrc(notnull InventoryLocation src, float radius)
void RemoveMovableOverride(EntityAI item)
void SendRepairToClientDst(notnull InventoryLocation dst)
DayZPlayer GetDayZPlayerOwner()
bool PlayerCheckRequestDst(notnull InventoryLocation src, notnull InventoryLocation dst, float radius)
bool TryAcquireInventoryJunctureFromServer(notnull Man player, notnull InventoryLocation src, notnull InventoryLocation dst)
PluginBase GetPlugin(typename plugin_type)
static void InventoryMoveLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
static proto native bool LocationCanMoveEntity(notnull InventoryLocation src, notnull InventoryLocation dst)
queries if the entity contained in inv_loc.m_item can be moved to another location This is a shorthan...
static bool LocationCanMoveEntitySyncCheck(notnull InventoryLocation src, notnull InventoryLocation dst)
const float c_MaxItemDistanceRadius
anti-cheats
script counterpart to engine's class Inventory
static string DumpToStringNullSafe(InventoryLocation loc)
bool ReadFromContext(ParamsReadContext ctx)
proto native EntityAI GetItem()
returns item of current inventory location
InventoryValidationResult m_Result
InventoryValidationReason m_Reason
static bool IsSyncLogEnable()
static bool IsInventoryMoveLogEnable()
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
DayZPlayerInstanceType
defined in C++
proto native DayZPlayerInstanceType GetInstanceType()
void Error(string err)
Messagebox with error message.