TODO(kumarjac): Is this one correct to be 'RemoveMovableOverride' or are the other Validate methdos wrong with 'EnableMovableOverride'?
Juncture locks guarentee the item is safe to interact with and the server has validated the command at this point.
1841 {
1842 bool success = true;
1843
1845 if (e.m_Player != GetManOwner())
1846 {
1847 Error(
"[syncinv] Inventory owner " + GetManOwner() +
" and event sender " + e.m_Player +
" not match.");
1848 return true;
1849 }
1850
1851 e.m_IsJuncture = false;
1852 e.m_IsRemote = false;
1853
1854 EntityAI itemSrc = e.GetSrcEntity();
1856
1857#ifdef ENABLE_LOGGING
1859 {
1860 Debug.
InventoryMoveLog(
"STS = " + e.m_Player.GetSimulationTimeStamp() +
" event= " + e.
DumpToString(),
"HAND_EVENT" ,
"n/a",
"ValidateHandEventServer", e.m_Player.ToString() );
1861 }
1862#endif
1863
1865 {
1866 Error(
"[syncinv] ValidateHandEvent This event " + e.GetDebugName() +
" should not be use for synchronization.");
1867 return true;
1868 }
1869
1871 if (itemSrc)
1872 {
1874 }
1875 if (itemDst)
1876 {
1878 }
1879
1882 {
1883#ifdef ENABLE_LOGGING
1885 {
1886 Debug.
InventoryMoveLog(
"Failed - CheckRequestSrc",
"HAND_EVENT" ,
"n/a",
"ValidateHandEventServer", e.m_Player.ToString() );
1887 }
1888#endif
1889
1892
1893 success = false;
1894#ifdef DIAG_DEVELOPER
1895 if (PluginInventoryDebug.Cast(
GetPlugin(PluginInventoryDebug)).IsDesyncRepairEnable())
1896 {
1897#endif
1900 if(itemSrc)
1901 {
1902 itemSrc.GetInventory().GetCurrentInventoryLocation(repairIl);
1903
1904 if(e.GetSrc() != repairIl)
1905 {
1906 itemsToRepair.Insert(itemSrc);
1907 }
1908
1909 if(itemDst && itemSrc != itemDst )
1910 {
1911 itemDst.GetInventory().GetCurrentInventoryLocation(repairIl);
1913 {
1914 itemsToRepair.Insert(itemDst);
1915 }
1916 }
1917
1918 if (itemsToRepair.Count())
1919 {
1921 }
1922 }
1923#ifdef DIAG_DEVELOPER
1924 }
1925#endif
1926 }
1927
1928 if (success && !e.CheckRequestEx(validation))
1929 {
1930#ifdef ENABLE_LOGGING
1932 {
1933 Debug.
InventoryMoveLog(
"Failed - CheckRequest",
"HAND_EVENT" ,
"n/a",
"ValidateHandEventServer", e.m_Player.ToString() );
1934 }
1935#endif
1936
1938
1941
1942#ifdef ENABLE_LOGGING
1944 {
1946 }
1947#endif
1948
1949 success = false;
1950 }
1951
1953 {
1954#ifdef ENABLE_LOGGING
1956 {
1957 Debug.
InventoryMoveLog(
"Failed - CanPerformEvent",
"HAND_EVENT" ,
"n/a",
"ValidateHandEventServer", e.m_Player.ToString() );
1958 }
1959#endif
1960
1962
1965
1966#ifdef ENABLE_LOGGING
1968 {
1970 }
1971#endif
1972
1974 if (ilDst)
1975 {
1977 }
1978
1980 if (ilDst)
1981 {
1983 }
1984
1985 success = false;
1986 }
1987
1990 {
1991#ifdef ENABLE_LOGGING
1993 {
1994 Debug.
InventoryMoveLog(
"Juncture not required",
"HAND_EVENT" ,
"n/a",
"ValidateHandEventServer", e.m_Player.ToString() );
1995 }
1996#endif
1998#ifdef ENABLE_LOGGING
2000 {
2001 Debug.
InventoryMoveLog(
"Success - ProcessHandEvent",
"HAND_EVENT" ,
"n/a",
"ValidateHandEventServer", e.m_Player.ToString() );
2002 }
2003#endif
2005 return e.m_Player.GetHumanInventory().ProcessHandEvent(e);
2007 }
2009 {
2010#ifdef ENABLE_LOGGING
2012 {
2013 Debug.
InventoryMoveLog(
"Juncture sended",
"HAND_EVENT" ,
"n/a",
"ValidateHandEventServer", e.m_Player.ToString() );
2014 }
2015#endif
2016
2019
2021
2022 if (itemSrc)
2023 {
2025 }
2026 if (itemDst)
2027 {
2029 }
2030 return true;
2031 }
2032 else
2033 {
2034#ifdef ENABLE_LOGGING
2036 {
2037 Debug.
InventoryMoveLog(
"Juncture denied",
"HAND_EVENT" ,
"n/a",
"ValidateHandEventServer", e.m_Player.ToString() );
2038 }
2039#endif
2040
2043 return true;
2044 }
2045 }
void syncDebugPrint(string s)
InventoryValidationResult
InventoryValidationReason
void EnableMovableOverride(EntityAI item)
void CheckForRope(InventoryLocation src, InventoryLocation dst)
void RemoveMovableOverride(EntityAI item)
void SendRepairToClientDst(notnull InventoryLocation dst)
DayZPlayer GetDayZPlayerOwner()
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)
override InventoryLocation GetSecondDst()
override InventoryLocation GetDst()
override bool AcquireInventoryJunctureFromServer(notnull Man player)
override EntityAI GetSecondSrcEntity()
override bool IsServerSideOnly()
override string DumpToString()
override bool CheckRequestSrc()
override bool CanPerformEventEx(InventoryValidation validation)
override InventoryLocation GetSecondSrc()
Abstracted event, not to be used, only inherited.
InventoryValidationResult m_Result
InventoryValidationReason m_Reason
static bool IsSyncLogEnable()
static bool IsInventoryMoveLogEnable()
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
void Error(string err)
Messagebox with error message.