Interface UserSession
- All Superinterfaces:
AttrOptionDynamic
- All Known Implementing Classes:
SocketUserSession
UserSession
- Author:
- 渔民小镇
- See Also:
- date:
- 2023-02-18
-
Method Summary
Modifier and TypeMethodDescriptionvoidemploy(CommunicationMessage message) Adds user info to request.int[]getIp()Get player IPgetState()UserSessionState of current playerlongGets the UserChannelId of the current user (player).longGets the ID of the current user (player).booleanisActive()activebooleanChecks if the identity has been verified.default CommunicationMessagevoidsetAttachment(byte[] attachment) voidsetBindingLogicServerIds(int[] bindingLogicServerIds) voidsetExternalJoin(ExternalJoinEnum externalJoin) voidsetUserId(long userId) Sets the ID of the current user (player).<T> TwriteAndFlush(Object message) writeAndFlushMethods inherited from interface AttrOptionDynamic
getOptions, ifNull, ifPresent, option, option, optionValue
-
Method Details
-
isActive
boolean isActive()active- Returns:
- true active
-
setExternalJoin
-
setUserId
void setUserId(long userId) Sets the ID of the current user (player).- Parameters:
userId- userId
-
getUserId
long getUserId()Gets the ID of the current user (player).- Returns:
- The ID of the current user (player)
-
isVerifyIdentity
boolean isVerifyIdentity()Checks if the identity has been verified.- Returns:
- true: if logged in
-
getState
-
getUserChannelId
long getUserChannelId()Gets the UserChannelId of the current user (player).- Returns:
- UserChannelId
-
employ
Adds user info to request. Developers can extend data via HeadMetadata.setAttachmentData(byte[]), which will be forwarded to the logic server.- Parameters:
message- message
-
writeAndFlush
writeAndFlush- Parameters:
message- message- Returns:
- ChannelFuture
-
getIp
-
setAttachment
void setAttachment(byte[] attachment) -
setBindingLogicServerIds
void setBindingLogicServerIds(int[] bindingLogicServerIds) -
getBindingLogicServerIds
int[] getBindingLogicServerIds() -
ofMessage
-