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...
Never end here, always return in send junture part MW 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
808 {
810
813 bool success = true;
814
817
818 #ifdef ENABLE_LOGGING
820 {
822 }
823 #endif
824
827
828 if (validation.
m_IsRemote && (!itemSrc || !itemDst))
829 {
831
832#ifdef ENABLE_LOGGING
834 {
836 }
837
839 {
841 }
842#endif
843
844 return true;
845 }
846
848 {
849 #ifdef ENABLE_LOGGING
851 {
853 }
854
856 {
857 syncDebugPrint(
"[syncinv] HandleInputData Failed - src and dst are for different items src item =" + itemSrc +
" dst item =" + itemDst);
858 }
859 #endif
860
862 {
863 success = false;
864 }
865 else
866 {
867 return true;
868 }
869 }
870
872
877 {
879
880#ifdef ENABLE_LOGGING
882 {
884 }
885
887 {
889 }
890#endif
891
893
895 {
896 success = false;
897 #ifdef DIAG_DEVELOPER
898 if (PluginInventoryDebug.Cast(
GetPlugin(PluginInventoryDebug)).IsDesyncRepairEnable())
899 {
900 #endif
903 src.
GetItem().GetInventory().GetCurrentInventoryLocation(realIl);
904
905 if(src != realIl)
906 {
907 itemsToRepair.Insert(src.
GetItem());
909 }
910 #ifdef DIAG_DEVELOPER
911 }
912 #endif
913 }
914 else
915 {
916 return true;
917 }
918 }
919
924 {
925#ifdef ENABLE_LOGGING
927 {
929 }
930
932 {
934 }
935#endif
936
938
940 {
942 success = false;
943 }
944 else
945 {
946 return true;
947 }
948 }
949
951
952#ifdef ENABLE_LOGGING
954 {
956 }
957#endif
958
961 {
964 {
965 #ifdef ENABLE_LOGGING
967 {
969 }
970 #endif
971 if (success)
972 {
974
975 LocationSyncMoveEntity(src, dst);
976
978 }
979 return true;
980 }
982 {
983 #ifdef ENABLE_LOGGING
985 {
987 }
988 #endif
989
991 {
992 #ifdef ENABLE_LOGGING
993
994 #ifdef DEVELOPER
995 DumpInventoryDebug();
996 #endif
997
999 {
1001 }
1002 #endif
1004 return true;
1005 }
1006
1009 return true;
1010 }
1011 else
1012 {
1013 #ifdef ENABLE_LOGGING
1015 {
1017 }
1018 #endif
1019
1022 return true;
1023 }
1024 }
1025
1027 {
1028 bool hasJuncture = false;
1029 if (itemSrc != null && itemDst != null)
1030 {
1032 }
1033 else if (itemSrc != null)
1034 {
1036 }
1037 else if (itemDst != null)
1038 {
1040 }
1041
1042 if (!hasJuncture)
1043 {
1044#ifdef ENABLE_LOGGING
1046 {
1048 }
1049#endif
1050 success = false;
1051 }
1052 }
1053
1055 {
1057 }
1058
1061 {
1063 }
1064
1070 {
1072 {
1073 #ifdef ENABLE_LOGGING
1074
1075 #ifdef DEVELOPER
1076 DumpInventoryDebug();
1077 #endif
1078
1080 {
1082 }
1083 #endif
1084
1086 return true;
1087 }
1089 {
1090 #ifdef ENABLE_LOGGING
1091
1092 #ifdef DEVELOPER
1093 DumpInventoryDebug();
1094 #endif
1095
1097 {
1099 }
1100 #endif
1101
1103 return true;
1104 }
1105 }
1106
1107
1108
1110 {
1111 #ifdef ENABLE_LOGGING
1113 {
1115 }
1116 #endif
1117 return false;
1118 }
1119
1120 #ifdef ENABLE_LOGGING
1122 {
1124 }
1125 #endif
1126
1127 if (success)
1128 {
1129 LocationSyncMoveEntity(src, dst);
1131 }
1132
1133 return true;
1134 }
void syncDebugPrint(string s)
InventoryValidationResult
InventoryValidationReason
void ClearInventoryReservationEx(ActionData action_data)
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 LocationTestAddEntity(notnull InventoryLocation inv_loc, bool do_resevation_check, bool do_item_check, bool do_lock_check, bool do_occupancy_test, bool do_script_check, bool do_script_load_check)
test if the entity contained in inv_loc.m_item can be added to ground/attachment/cargo/hands/....
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.