This repository was archived by the owner on Mar 7, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
src/main/java/com/aayushatharva/sourcecenginequerycacher Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55import com .aayushatharva .sourcecenginequerycacher .utils .Packets ;
66import io .netty .buffer .ByteBuf ;
77import io .netty .buffer .ByteBufUtil ;
8+ import io .netty .channel .ChannelHandler ;
89import io .netty .channel .ChannelHandlerContext ;
910import io .netty .channel .SimpleChannelInboundHandler ;
1011import io .netty .channel .socket .DatagramPacket ;
1415import java .util .Arrays ;
1516import java .util .Random ;
1617
18+ @ ChannelHandler .Sharable
1719final class Handler extends SimpleChannelInboundHandler <DatagramPacket > {
1820
1921 private static final Logger logger = LogManager .getLogger (Handler .class );
Original file line number Diff line number Diff line change 11package com .aayushatharva .sourcecenginequerycacher .gameserver .a2sinfo ;
22
33import com .aayushatharva .sourcecenginequerycacher .utils .CacheHub ;
4- import com .aayushatharva .sourcecenginequerycacher .utils .Packets ;
5- import io .netty .buffer .ByteBufUtil ;
64import io .netty .channel .ChannelHandlerContext ;
75import io .netty .channel .SimpleChannelInboundHandler ;
86import io .netty .channel .socket .DatagramPacket ;
@@ -15,14 +13,9 @@ final class InfoHandler extends SimpleChannelInboundHandler<DatagramPacket> {
1513
1614 @ Override
1715 protected void channelRead0 (ChannelHandlerContext channelHandlerContext , DatagramPacket datagramPacket ) {
16+ // Set new Packet Data
17+ CacheHub .A2S_INFO .clear ().writeBytes (datagramPacket .content ());
1818
19- if (ByteBufUtil .equals (Packets .A2S_INFO_RESPONSE_HEADER , datagramPacket .content ().slice (0 , 5 ))) {
20- // Set new Packet Data
21- CacheHub .A2S_INFO .clear ().writeBytes (datagramPacket .content ());
22-
23- logger .debug ("New A2SInfo Update Cached Successfully" );
24- } else {
25- logger .error ("Received unsupported A2S Info Response from Game Server: {}" , ByteBufUtil .hexDump (datagramPacket .content ()));
26- }
19+ logger .debug ("New A2SInfo Update Cached Successfully" );
2720 }
2821}
You can’t perform that action at this time.
0 commit comments