Interface Request
- All Superinterfaces:
FutureMessage, RemoteMessage, UserIdentity
- All Known Subinterfaces:
CommunicationMessage
- All Known Implementing Classes:
AbstractCommunicationMessage, ExternalMessage, RequestMessage, SendMessage, UserRequestMessage
Represent an inbound request message carrying routing, identity, and attachment metadata.
Extends RemoteMessage for inter-server communication fields and UserIdentity
for user identification. Implementations carry hop-count tracking, logic-server binding,
per-request attachment data, and an optional sticky-routing hint.
- Since:
- 25.1
- Author:
- 渔民小镇
- date:
- 2025-09-15
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]Extended field.int[]The IDs of multiple game logic servers bound to the playerintGet the number of hops this request has traversed across logic servers.default intgetStick()Get the sticky-routing hint for this request.voidsetAttachment(byte[] attachment) Set the per-request attachment data.voidsetBindingLogicServerIds(int[] bindingLogicServerIds) Set the IDs of logic servers that this player is bound to.voidsetHopCount(int hopCount) Set the number of hops this request has traversed.default voidsetStick(int stick) Set the sticky-routing hint used to pin this request to a specific server instance.Methods inherited from interface FutureMessage
getFutureId, setFutureIdMethods inherited from interface RemoteMessage
getCmdInfo, getCmdMerge, getData, getExternalServerId, getLogicServerId, getNanoTime, getNetId, getSourceServerId, getTraceId, setCmdInfo, setCmdMerge, setData, setExternalServerId, setLogicServerId, setNanoTime, setNetId, setOutputError, setSourceServerId, setTraceIdMethods inherited from interface UserIdentity
bindingUserId, getUserId, isVerifyIdentity, setUserId, setUserIdentity, setVerifyIdentity, verifyIdentity
-
Method Details
-
getHopCount
int getHopCount()Get the number of hops this request has traversed across logic servers.- Returns:
- the current hop count
-
setHopCount
void setHopCount(int hopCount) Set the number of hops this request has traversed.- Parameters:
hopCount- the hop count to set
-
setBindingLogicServerIds
void setBindingLogicServerIds(int[] bindingLogicServerIds) Set the IDs of logic servers that this player is bound to.- Parameters:
bindingLogicServerIds- array of bound logic server IDs
-
getBindingLogicServerIds
int[] getBindingLogicServerIds()The IDs of multiple game logic servers bound to the playerAll requests related to this game logic server will be routed to the bound game logic server for processing. Even if multiple game logic servers of the same type are running, requests will still be directed to the originally bound server.- Returns:
- bindingLogicServerIds
-
setAttachment
void setAttachment(byte[] attachment) Set the per-request attachment data.- Parameters:
attachment- the attachment byte array
-
getAttachment
byte[] getAttachment()Extended field. Developers can use this field to extend meta-information for special business needs. The data in this field will be included with every request.- Returns:
- AttachmentData
-
setStick
default void setStick(int stick) Set the sticky-routing hint used to pin this request to a specific server instance.- Parameters:
stick- the sticky-routing value
-
getStick
default int getStick()Get the sticky-routing hint for this request.- Returns:
- the sticky-routing value, or 0 if not set
-