Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,21 @@

package com.ibasco.agql.protocols.valve.source.query.info;

import static com.ibasco.agql.protocols.valve.source.query.SourceQuery.A2S_INFO_EDF_GAMEID;
import static com.ibasco.agql.protocols.valve.source.query.SourceQuery.A2S_INFO_EDF_PORT;
import static com.ibasco.agql.protocols.valve.source.query.SourceQuery.A2S_INFO_EDF_SOURCETV;
import static com.ibasco.agql.protocols.valve.source.query.SourceQuery.A2S_INFO_EDF_STEAMID;
import static com.ibasco.agql.protocols.valve.source.query.SourceQuery.A2S_INFO_EDF_TAGS;
import static com.ibasco.agql.protocols.valve.source.query.SourceQuery.SOURCE_QUERY_INFO_RES;
import com.ibasco.agql.core.NettyChannelContext;
import com.ibasco.agql.core.util.Netty;
import com.ibasco.agql.protocols.valve.source.query.common.handlers.SourceQueryAuthDecoder;
import com.ibasco.agql.protocols.valve.source.query.common.packets.SourceQuerySinglePacket;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;

import java.nio.charset.StandardCharsets;
import java.util.function.Function;
import static com.ibasco.agql.protocols.valve.source.query.SourceQuery.A2S_INFO_EDF_GAMEID;
import static com.ibasco.agql.protocols.valve.source.query.SourceQuery.A2S_INFO_EDF_PORT;
import static com.ibasco.agql.protocols.valve.source.query.SourceQuery.A2S_INFO_EDF_SOURCETV;
import static com.ibasco.agql.protocols.valve.source.query.SourceQuery.A2S_INFO_EDF_STEAMID;
import static com.ibasco.agql.protocols.valve.source.query.SourceQuery.A2S_INFO_EDF_TAGS;
import static com.ibasco.agql.protocols.valve.source.query.SourceQuery.SOURCE_QUERY_INFO_RES;

/**
* <p>SourceQueryInfoDecoder class.</p>
Expand Down Expand Up @@ -93,7 +94,7 @@ protected Object decodeQueryPacket(ChannelHandlerContext ctx, SourceQueryInfoReq
}

int flags = buf.readUnsignedByte();
decodeFlag("edfServerPort", buf, flags, A2S_INFO_EDF_PORT, buf::readShortLE, info::setGamePort, Short::intValue);
decodeFlag("edfServerPort", buf, flags, A2S_INFO_EDF_PORT, buf::readUnsignedShortLE, info::setGamePort, Integer::intValue);
decodeFlag("edfServerSteamId", buf, flags, A2S_INFO_EDF_STEAMID, buf::readLongLE, info::setServerId);
decodeFlag("edfSourceTvPort", buf, flags, A2S_INFO_EDF_SOURCETV, buf::readShortLE, info::setTvPort, Short::intValue);
decodeFlag("edfSourceTvName", buf, flags, A2S_INFO_EDF_SOURCETV, Netty::readString, info::setTvName);
Expand Down