Package emu.grasscutter.server.game
Class GameSession
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
emu.grasscutter.netty.KcpChannel
emu.grasscutter.server.game.GameSession
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintlongintgetState()booleanprotected voidlogPacket(ByteBuffer buf) protected voidprotected voidvoidonMessage(io.netty.channel.ChannelHandlerContext ctx, io.netty.buffer.ByteBuf data) voidreplayPacket(int opcode, String name) voidsend(BasePacket packet) voidsetAccount(Account account) voidvoidsetState(GameSession.SessionState state) voidsetUseSecretKey(boolean useSecretKey) voidupdateLastPingTime(int clientTime) booleanMethods inherited from class emu.grasscutter.netty.KcpChannel
channelActive, channelInactive, channelRead, channelReadComplete, close, exceptionCaught, getChannel, isActive, logPacket, sendMethods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggeredMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.netty.channel.ChannelHandler
handlerAdded, handlerRemoved
-
Constructor Details
-
GameSession
-
-
Method Details
-
getServer
-
getAddress
-
useSecretKey
public boolean useSecretKey() -
getAccount
-
setAccount
-
getAccountId
-
getPlayer
-
setPlayer
-
getState
-
setState
-
isLoggedIn
public boolean isLoggedIn() -
setUseSecretKey
public void setUseSecretKey(boolean useSecretKey) -
getClientTime
public int getClientTime() -
getLastPingTime
public long getLastPingTime() -
updateLastPingTime
public void updateLastPingTime(int clientTime) -
getNextClientSequence
public int getNextClientSequence() -
onConnect
protected void onConnect()- Specified by:
onConnectin classKcpChannel
-
onDisconnect
protected void onDisconnect()- Specified by:
onDisconnectin classKcpChannel
-
logPacket
-
replayPacket
-
send
-
onMessage
public void onMessage(io.netty.channel.ChannelHandlerContext ctx, io.netty.buffer.ByteBuf data) - Specified by:
onMessagein classKcpChannel
-