3 static const int REPLICATION_MAX_FRAME_BUDGET = 10;
4 static const int GRACEFUL_HANDLES_MAX_FRAME_BUDGET = 10;
5 static const int GRACEFUL_HANDLES_POKED_THRESHOLD = 10000;
10 protected ref array<ref SCR_ResourceSystemSubscriptionListing>
m_aListings = {};
11 protected ref array<SCR_ResourceSystemSubscriptionHandleBase>
m_aHandles = {};
19 if (higherLimitPosition == 0)
25 while (
position < higherLimitPosition)
48 SCR_ResourceInteractor compareInteractor = listing.GetInteractor();
50 if (interactor > compareInteractor)
52 else if (interactor < compareInteractor)
53 higherLimitPosition = comparePosition;
71 if (higherLimitPosition == 0)
77 while (
position < higherLimitPosition)
103 RplId compareResourceComponentRplId = handle.GetResourceComponentRplId();
104 typename compareInteractorType = handle.GetInteractorType();
105 EResourceType compareResourceType = handle.GetResourceType();
109 if (resourceComponentRplId > compareResourceComponentRplId)
111 else if (resourceComponentRplId < compareResourceComponentRplId)
112 higherLimitPosition = comparePosition;
115 else if (interactorType.ToString() > compareInteractorType.ToString())
117 else if (interactorType.ToString() < compareInteractorType.ToString())
118 higherLimitPosition = comparePosition;
121 else if (resourceType > compareResourceType)
123 else if (resourceType < compareResourceType)
124 higherLimitPosition = comparePosition;
127 else if (resourceIdentifier > compareResourceIdentifier)
129 else if (resourceIdentifier < compareResourceIdentifier)
130 higherLimitPosition = comparePosition;
148 if (!listener.IsValid())
163 SCR_ResourceInteractor compareInteractor;
170 compareInteractor = compareListing.GetInteractor();
172 if (interactor > compareInteractor)
174 else if (interactor < compareInteractor)
175 maxPosition = comparePosition;
192 if (!listener.IsValid())
211 if (!listener.IsValid())
266 if (!ownerRplId.IsValid())
269 RplId resourceComponentRplId =
Replication.FindItemId(interactor.GetComponent());
271 if (!resourceComponentRplId.IsValid())
274 typename interactorType = interactor.Type();
287 RplId compareResourceComponentRplId;
288 typename compareInteractorType;
296 compareResourceComponentRplId = compareHandle.GetResourceComponentRplId();
297 compareInteractorType = compareHandle.GetInteractorType();
298 compareResourceType = compareHandle.GetResourceType();
299 compareResourceIdentifier = compareHandle.GetResourceIdentifier();
302 if (resourceComponentRplId > compareResourceComponentRplId)
304 else if (resourceComponentRplId < compareResourceComponentRplId)
305 maxPosition = comparePosition;
308 else if (interactorType.ToString() > compareInteractorType.ToString())
310 else if (interactorType.ToString() < compareInteractorType.ToString())
311 maxPosition = comparePosition;
314 else if (resourceType > compareResourceType)
316 else if (resourceType < compareResourceType)
317 maxPosition = comparePosition;
320 else if (resourceIdentifier > compareResourceIdentifier)
322 else if (resourceIdentifier < compareResourceIdentifier)
323 maxPosition = comparePosition;
342 if (!ownerRplId.IsValid())
345 RplId resourceComponentRplId =
Replication.FindItemId(interactor.GetComponent());
347 if (!resourceComponentRplId.IsValid())
350 typename interactorType = interactor.Type();
367 RplId compareResourceComponentRplId;
368 typename compareInteractorType;
376 compareResourceComponentRplId = compareHandle.GetResourceComponentRplId();
377 compareInteractorType = compareHandle.GetInteractorType();
378 compareResourceType = compareHandle.GetResourceType();
379 compareResourceIdentifier = compareHandle.GetResourceIdentifier();
382 if (resourceComponentRplId > compareResourceComponentRplId)
384 else if (resourceComponentRplId < compareResourceComponentRplId)
385 maxPosition = comparePosition;
388 else if (interactorType.ToString() > compareInteractorType.ToString())
390 else if (interactorType.ToString() < compareInteractorType.ToString())
391 maxPosition = comparePosition;
394 else if (resourceType > compareResourceType)
396 else if (resourceType < compareResourceType)
397 maxPosition = comparePosition;
400 else if (resourceIdentifier > compareResourceIdentifier)
402 else if (resourceIdentifier < compareResourceIdentifier)
403 maxPosition = comparePosition;
ArmaReforgerScripted GetGame()
Replication item identifier.
static SCR_ResourceSystemSubscriptionHandleBase CreateHandle(notnull SCR_ResourceSystemSubscriptionManager manager, RplId ownerRplId, RplId resourceComponentRplId, typename interactorType, EResourceType resourceType, EResourceGeneratorID resourceIdentifier)
WorldTimestamp GetLastPokedAt()
RplId GetResourceComponentRplId()
EResourceType GetResourceType()
EResourceGeneratorID GetResourceIdentifier()
void UnsubscribeListener(RplId listener)
SCR_ResourceInteractor GetInteractor()
void SubscribeListener(RplId listener)
ref array< ref SCR_ResourceSystemSubscriptionListing > m_aListings
SCR_ResourceSystemSubscriptionListing GetListing(notnull SCR_ResourceInteractor interactor)
ref array< ref SCR_ResourceSystemSubscriptionHandleBase > m_aGracefulHandles
SCR_ResourceSystemSubscriptionHandleBase RequestSubscriptionListenerHandle(notnull SCR_ResourceInteractor interactor, RplId ownerRplId)
int m_iGracefulHandlesPivot
ref array< SCR_ResourceSystemSubscriptionHandleBase > m_aHandles
void ProcessGracefulHandles()
void ReplicateListeners()
void OnSubscriptionListenerHandleDeleted(notnull SCR_ResourceSystemSubscriptionHandleBase handle)
bool SubscribeListener(RplId listener, notnull SCR_ResourceInteractor interactor)
bool GetNextListingCandidate(inout int position, inout int higherLimitPosition, inout SCR_ResourceSystemSubscriptionListing listing, notnull SCR_ResourceInteractor interactor)
int m_iReplicateListenersPivot
void OnResourceInteractorDeleted(notnull SCR_ResourceInteractor interactor)
void UnsubscribeListenerCompletely(RplId listener)
bool UnsubscribeListener(RplId listener, notnull SCR_ResourceInteractor interactor)
SCR_ResourceSystemSubscriptionHandleBase RequestSubscriptionListenerHandleGraceful(notnull SCR_ResourceInteractor interactor, RplId ownerRplId)
SCR_ResourceSystemSubscriptionHandleBase GetHandle(RplId resourceComponentRplId, typename interactorType, EResourceType resourceType, EResourceGeneratorID resourceIdentifier)
bool GetNextHandleCandidate(inout int position, inout int higherLimitPosition, inout SCR_ResourceSystemSubscriptionHandleBase handle, RplId resourceComponentRplId, typename interactorType, EResourceType resourceType, EResourceGeneratorID resourceIdentifier)