Package net.minecraft.server.jsonrpc
Class Connection
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.SimpleChannelInboundHandler<JsonElement>
net.minecraft.server.jsonrpc.Connection
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final io.netty.channel.Channelprivate final ClientInfoprivate static final AtomicIntegerprivate final JsonRpcLoggerprivate static final org.slf4j.Loggerprivate final ManagementServerprivate final MinecraftApiprivate final it.unimi.dsi.fastutil.ints.Int2ObjectMap<PendingRpcRequest<?>> private final AtomicInteger -
Constructor Summary
ConstructorsConstructorDescriptionConnection(io.netty.channel.Channel pChannel, ManagementServer pManagementServer, MinecraftApi pMinecraftApi, JsonRpcLogger pJsonRpcLogger) -
Method Summary
Modifier and TypeMethodDescriptionvoidchannelActive(io.netty.channel.ChannelHandlerContext pContext) voidchannelInactive(io.netty.channel.ChannelHandlerContext pContext) protected voidchannelRead0(io.netty.channel.ChannelHandlerContext pContext, JsonElement pJson) dispatchIncomingRequest(String pMethodName, JsonElement pParams) voidexceptionCaught(io.netty.channel.ChannelHandlerContext pContext, Throwable pException) private JsonArrayhandleBatchRequest(List<JsonElement> pRequests) private JsonObjecthandleError(JsonElement pRequestId, JsonObject pError) private JsonObjecthandleIncomingRequest(JsonElement pRequestId, String pMethodName, JsonElement pParams) (package private) JsonObjecthandleJsonObject(JsonObject pJson) private voidhandleRequestResponse(int pRequestId, JsonElement pResult) private static booleanisValidRequestId(JsonElement pJson) private static booleanisValidResponseId(JsonElement pJson) voidsendNotification(Holder.Reference<? extends OutgoingRpcMethod<Void, ?>> pMethod) <Params> voidsendNotification(Holder.Reference<? extends OutgoingRpcMethod<Params, ?>> pMethod, Params pParams) <Result> CompletableFuture<Result> sendRequest(Holder.Reference<? extends OutgoingRpcMethod<Void, Result>> pMethod) private <Params,Result>
CompletableFuture<Result> sendRequest(Holder.Reference<? extends OutgoingRpcMethod<Params, ? extends Result>> pMethod, Params pParams, boolean pExpectResponse) <Params,Result>
CompletableFuture<Result> sendRequest(Holder.Reference<? extends OutgoingRpcMethod<Params, Result>> pMethod, Params pParams) voidtick()Methods inherited from class io.netty.channel.SimpleChannelInboundHandler
acceptInboundMessage, channelReadMethods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelReadComplete, 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
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
CONNECTION_ID_COUNTER
-
jsonRpcLogger
-
clientInfo
-
managementServer
-
channel
private final io.netty.channel.Channel channel -
minecraftApi
-
transactionId
-
pendingRequests
-
-
Constructor Details
-
Connection
public Connection(io.netty.channel.Channel pChannel, ManagementServer pManagementServer, MinecraftApi pMinecraftApi, JsonRpcLogger pJsonRpcLogger)
-
-
Method Details
-
tick
public void tick() -
channelActive
- Specified by:
channelActivein interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelActivein classio.netty.channel.ChannelInboundHandlerAdapter- Throws:
Exception
-
channelInactive
- Specified by:
channelInactivein interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelInactivein classio.netty.channel.ChannelInboundHandlerAdapter- Throws:
Exception
-
exceptionCaught
public void exceptionCaught(io.netty.channel.ChannelHandlerContext pContext, Throwable pException) throws Exception - Specified by:
exceptionCaughtin interfaceio.netty.channel.ChannelHandler- Specified by:
exceptionCaughtin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
exceptionCaughtin classio.netty.channel.ChannelInboundHandlerAdapter- Throws:
Exception
-
channelRead0
- Specified by:
channelRead0in classio.netty.channel.SimpleChannelInboundHandler<JsonElement>
-
handleBatchRequest
-
sendNotification
-
sendNotification
public <Params> void sendNotification(Holder.Reference<? extends OutgoingRpcMethod<Params, ?>> pMethod, Params pParams) -
sendRequest
public <Result> CompletableFuture<Result> sendRequest(Holder.Reference<? extends OutgoingRpcMethod<Void, Result>> pMethod) -
sendRequest
public <Params,Result> CompletableFuture<Result> sendRequest(Holder.Reference<? extends OutgoingRpcMethod<Params, Result>> pMethod, Params pParams) -
sendRequest
@Nullable @Contract("_,_,false->null;_,_,true->!null") private <Params,Result> CompletableFuture<Result> sendRequest(Holder.Reference<? extends OutgoingRpcMethod<Params, ? extends Result>> pMethod, @Nullable Params pParams, boolean pExpectResponse) -
handleJsonObject
-
isValidRequestId
-
isValidResponseId
-
handleIncomingRequest
@Nullable private JsonObject handleIncomingRequest(@Nullable JsonElement pRequestId, String pMethodName, @Nullable JsonElement pParams) -
dispatchIncomingRequest
@Nullable public JsonElement dispatchIncomingRequest(String pMethodName, @Nullable JsonElement pParams) -
handleRequestResponse
-
handleError
-