public class InteractionChain implements ChainSyncStorage
Class InteractionChain. Provides interactionchain functionality for the Hytale server.
java.lang.Object > InteractionChain
Field Summary
baseType
Field baseType.
chainId
Field chainId.
predicted
Field predicted.
rootInteraction
Field rootInteraction.
operationCounter
Field operationCounter.
simulatedCallStack
Field simulatedCallStack.
simulatedOperationCounter
Field simulatedOperationCounter.
simulatedRootInteraction
Field simulatedRootInteraction.
operationIndex
Field operationIndex.
operationIndexOffset
Field operationIndexOffset.
clientOperationIndex
Field clientOperationIndex.
tempSyncDataOffset
Field tempSyncDataOffset.
timestamp
Field timestamp.
waitingForServerFinished
Field waitingForServerFinished.
waitingForClientFinished
Field waitingForClientFinished.
clientState
Field clientState.
serverState
Field serverState.
finalState
Field finalState.
onCompletion
Field onCompletion.
sentInitial
Field sentInitial.
desynced
Field desynced.
timeShift
Field timeShift.
firstRun
Field firstRun.
isFirstRun
Field isFirstRun.
completed
Field completed.
preTicked
Field preTicked.
altId
Field altId.
entry
Field entry.
rootId
Field rootId.
opCounter
Field opCounter.
root
Field root.
op
Field op.
found
Field found.
iEntry
Field iEntry.
it
Field it.
tempChain
Field tempChain.
entryId
Field entryId.
chain
Field chain.
state
Field state.
diff
Field diff.
cooldown
Field cooldown.
cooldownTracker
Field cooldownTracker.
oIndex
Field oIndex.
tempIdx
Field tempIdx.
idx
Field idx.
fork
Field fork.
temp
Field temp.
tempForkedChainData
Field tempForkedChainData.
tempSyncData
Field tempSyncData.
Method Detail
InteractionChain
public
InteractionChain
(final InteractionType type, final InteractionContext context, final InteractionChainData chainData, @Nonnull final RootInteraction rootInteraction, @Nullable final Runnable onCompletion, final boolean requiresClient)
Method InteractionChain.
- Parameters:
final InteractionTypetypefinal InteractionContextcontextfinal InteractionChainDatachainData@Nonnull final RootInteractionrootInteraction@Nullable final RunnableonCompletionfinal booleanrequiresClient
getChainId
int
getChainId
()
Method getChainId.
getInitialRootInteraction
Method getInitialRootInteraction.
isPredicted
boolean
isPredicted
()
Method isPredicted.
requiresClient
boolean
requiresClient
()
Method requiresClient.
getSimulatedRootInteraction
Method getSimulatedRootInteraction.
getOperationCounter
int
getOperationCounter
()
Method getOperationCounter.
setOperationCounter
void
setOperationCounter
(final int operationCounter)
Method setOperationCounter.
- Parameters:
final intoperationCounter
getSimulatedOperationCounter
int
getSimulatedOperationCounter
()
Method getSimulatedOperationCounter.
setSimulatedOperationCounter
void
setSimulatedOperationCounter
(final int simulatedOperationCounter)
Method setSimulatedOperationCounter.
- Parameters:
final intsimulatedOperationCounter
wasPreTicked
boolean
wasPreTicked
()
Method wasPreTicked.
setPreTicked
void
setPreTicked
(final boolean preTicked)
Method setPreTicked.
- Parameters:
final booleanpreTicked
getOperationIndex
int
getOperationIndex
()
Method getOperationIndex.
nextOperationIndex
void
nextOperationIndex
()
Method nextOperationIndex.
getClientOperationIndex
int
getClientOperationIndex
()
Method getClientOperationIndex.
findForkedChain
InteractionChain
findForkedChain
(@Nonnull final ForkedChainId chainId, @Nullable final InteractionChainData data)
Method findForkedChain.
- Parameters:
@Nonnull final ForkedChainIdchainId@Nullable final InteractionChainDatadata
putForkedChain
void
putForkedChain
(@Nonnull final ForkedChainId chainId, @Nonnull final InteractionChain chain)
Method putForkedChain.
- Parameters:
@Nonnull final ForkedChainIdchainId@Nonnull final InteractionChainchain
if
else
if
(chainId.entryIndex < this.operationIndexOffset)
Method if.
- Parameters:
chainId.entryIndex <this.operationIndexOffset
TempChain
new
TempChain
()
Method TempChain.
removeTempForkedChain
TempChain
removeTempForkedChain
(@Nonnull final ForkedChainId chainId, final InteractionChain forkChain)
Method removeTempForkedChain.
- Parameters:
@Nonnull final ForkedChainIdchainIdfinal InteractionChainforkChain
hasSentInitial
boolean
hasSentInitial
()
Method hasSentInitial.
setSentInitial
void
setSentInitial
(final boolean sentInitial)
Method setSentInitial.
- Parameters:
final booleansentInitial
getTimeShift
float
getTimeShift
()
Method getTimeShift.
setTimeShift
void
setTimeShift
(final float timeShift)
Method setTimeShift.
- Parameters:
final floattimeShift
consumeFirstRun
boolean
consumeFirstRun
()
Method consumeFirstRun.
isFirstRun
boolean
isFirstRun
()
Method isFirstRun.
setFirstRun
void
setFirstRun
(final boolean firstRun)
Method setFirstRun.
- Parameters:
final booleanfirstRun
getCallDepth
int
getCallDepth
()
Method getCallDepth.
getSimulatedCallDepth
int
getSimulatedCallDepth
()
Method getSimulatedCallDepth.
CallState
new
CallState
(this.rootInteraction, this.operationCounter)
Method CallState.
- Parameters:
this.rootInteractionthis.rootInteractionthis.operationCounterthis.operationCounter
popRoot
void
popRoot
()
Method popRoot.
getTimeInSeconds
float
getTimeInSeconds
()
Method getTimeInSeconds.
setOnCompletion
void
setOnCompletion
(final Runnable onCompletion)
Method setOnCompletion.
- Parameters:
final RunnableonCompletion
onCompletion
Method onCompletion.
- Parameters:
final CooldownHandlercooldownHandlerfinal booleanisRemote
updateServerState
void
updateServerState
()
Method updateServerState.
updateSimulatedState
void
updateSimulatedState
()
Method updateSimulatedState.
getOrCreateInteractionEntry
Method getOrCreateInteractionEntry.
- Parameters:
final intindex
InteractionEntry
new
InteractionEntry
(index, this.operationCounter, RootInteraction.getRootInteractionIdOrUnknown(this.rootInteraction.getId()
Method InteractionEntry.
- Parameters:
indexindexthis.operationCounterthis.operationCounterRootInteraction.getRootInteractionIdOrUnknown(this.rootInteraction.getId(RootInteraction.getRootInteractionIdOrUnknown(this.rootInteraction.getId(
getInteraction
Method getInteraction.
- Parameters:
intindex
removeInteractionEntry
void
removeInteractionEntry
(@Nonnull final InteractionManager interactionManager, final int index)
Method removeInteractionEntry.
- Parameters:
@Nonnull final InteractionManagerinteractionManagerfinal intindex
putInteractionSyncData
Method putInteractionSyncData.
- Parameters:
intindexfinal InteractionSyncDatadata
clearInteractionSyncData
void
clearInteractionSyncData
(final int operationIndex)
Method clearInteractionSyncData.
- Parameters:
final intoperationIndex
removeInteractionSyncData
Method removeInteractionSyncData.
- Parameters:
intindex
updateSyncPosition
void
updateSyncPosition
(final int index)
Method updateSyncPosition.
- Parameters:
final intindex
isSyncDataOutOfOrder
boolean
isSyncDataOutOfOrder
(final int index)
Method isSyncDataOutOfOrder.
- Parameters:
final intindex
syncFork
void
syncFork
(@Nonnull final Ref ref, @Nonnull final InteractionManager manager, @Nonnull final SyncInteractionChain packet)
Method syncFork.
- Parameters:
@Nonnull final Refref@Nonnull final InteractionManagermanager@Nonnull final SyncInteractionChainpacket
copyTempFrom
void
copyTempFrom
(@Nonnull final TempChain temp)
Method copyTempFrom.
- Parameters:
@Nonnull final TempChaintemp
setChainId
void
setChainId
(final int chainId)
Method setChainId.
- Parameters:
final intchainId
getForkedChains
Long2ObjectMap
getForkedChains
()
Method getForkedChains.
getTempForkedChainData
Long2ObjectMap
getTempForkedChainData
()
Method getTempForkedChainData.
getTimestamp
long
getTimestamp
()
Method getTimestamp.
setTimestamp
void
setTimestamp
(final long timestamp)
Method setTimestamp.
- Parameters:
final longtimestamp
getWaitingForServerFinished
long
getWaitingForServerFinished
()
Method getWaitingForServerFinished.
setWaitingForServerFinished
void
setWaitingForServerFinished
(final long waitingForServerFinished)
Method setWaitingForServerFinished.
- Parameters:
final longwaitingForServerFinished
getWaitingForClientFinished
long
getWaitingForClientFinished
()
Method getWaitingForClientFinished.
setWaitingForClientFinished
void
setWaitingForClientFinished
(final long waitingForClientFinished)
Method setWaitingForClientFinished.
- Parameters:
final longwaitingForClientFinished
setPredicted
void
setPredicted
(final boolean predicted)
Method setPredicted.
- Parameters:
final booleanpredicted
flagDesync
void
flagDesync
()
Method flagDesync.
isDesynced
boolean
isDesynced
()
Method isDesynced.
getNewForks
List
getNewForks
()
Method getNewForks.
toString
String
toString
()
Method toString.
ForkedChainId
new
ForkedChainId
(-1, Integer.MAX_VALUE, null)
Method ForkedChainId.
- Parameters:
-1-1Integer.MAX_VALUEInteger.MAX_VALUEnullnull
getOrCreateTempForkedChain
Method getOrCreateTempForkedChain.
- Parameters:
@Nonnull final ForkedChainIdchainId