Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server: Upgrade Netty to version 4.1 #114

Merged
merged 1 commit into from
Aug 16, 2024
Merged

Commits on Aug 5, 2024

  1. Server: Upgrade Netty to version 4.1

    The final release of the Netty 3.x line was in 2016 and ever
    since, it has been EOL
    (https://netty.io/news/2016/06/29/3-10-6-Final.html). Nowadays it has
    multiple unpatched security issues. This patch migrates the server to
    the latest Netty release. 4.1.112. The 4.0 branch is skipped since it is
    also EOL since 2018.
    
    There are a bunch of breaking changes between the versions:
    - Channel attachments were removed in favor of attributes, so now
      ClientState and Player objects are stored as attributes
    - `flush` needs to be called to actually send messages to clients so all
      calls to `write` are replaced with `writeAndFlush`. In theory this can
      be optimized to buffer multiple writes but since the server is not
      performance critical, I opted to keep it simple and always flush
      writes.
    - All Netty imports had their package changed from org.jboss to io.netty
    - ChannelBuffer was renamed to ByteBuf
    - A bunch of handler methods were renamed (e.g. channelConnected ->
      channelActive, messageReceived -> channelRead, channelClosed ->
      channelInactive)
    - IdleStateAwareChannelHandler was removed and now idle events are be
      processed by `userEventTriggered`. `getLastActivityTimeMillis` was
      also removed from idle events, so I reimplemented that functionality
      in ClientState.
    - OneToOneDecoder and OneToOneEncoder were replaced with more strongly
      typed classes, ByteToMessageDecoder and MessageToByteEncoder. They no
      longer return values, instead they add to the output list passed in as
      a parameter.
    - The ServerBootstrap API was redesigned to use a fluent API and a
      ChannelInitializer instead of a pipeline factory. The new API is
      mostly compatible with the old one though.
    StenAL committed Aug 5, 2024
    Configuration menu
    Copy the full SHA
    ad7dc66 View commit details
    Browse the repository at this point in the history