satoshinm / WebSandboxMC

Bukkit plugin providing a web-based interface with an interactive WebGL 3D preview or glimpse of your server 🕷⏳📦 ⛺
https://www.spigotmc.org/resources/websandboxmc.39415/
MIT License
19 stars 5 forks source link

Cleanup web clients on disconnect #11

Closed satoshinm closed 7 years ago

satoshinm commented 7 years ago

Remove the entity and notify other web clients it deleted (D command), remove from maps

problem: how to detect when a websocket disconnects in netty? (there is a regular heartbeat/ping I believe)

satoshinm commented 7 years ago

public void userEventTriggered(final ChannelHandlerContext ctx, Object evt) throws Exception { is not called when the channel closes, but public void channelInactive(ChannelHandlerContext ctx) { is, documented in http://netty.io/4.0/api/io/netty/channel/ChannelInboundHandler.html#channelInactive-io.netty.channel.ChannelHandlerContext-

satoshinm commented 7 years ago

Implemented, but note Glowstone bug: https://github.com/GlowstoneMC/Glowstone/issues/453