mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-07-13 17:28:06 +07:00
Refactored code so that processing log message will include resolved client id
This commit is contained in:
@ -237,13 +237,13 @@ public class Server implements MessageProcessor {
|
|||||||
int numCached = inPackets.drainTo(inCache);
|
int numCached = inPackets.drainTo(inCache);
|
||||||
if (DEBUG_RECEIVED_CACHE && numCached > 0) Gdx.app.debug(TAG, "Processing " + numCached + " packets...");
|
if (DEBUG_RECEIVED_CACHE && numCached > 0) Gdx.app.debug(TAG, "Processing " + numCached + " packets...");
|
||||||
for (InboundPacket<D2GS> packet : inCache) {
|
for (InboundPacket<D2GS> packet : inCache) {
|
||||||
|
packet.setId(cdata.get(packet.sender(), InboundPacket.INVALID_CLIENT));
|
||||||
|
if (packet.id() == InboundPacket.INVALID_CLIENT && packet.dataType() != D2GSData.Connection) {
|
||||||
|
Gdx.app.error(TAG, " " + packet + " from invalid client and not a connection request");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (DEBUG_RECEIVED_PACKETS && !ignoredPackets.get(packet.dataType())) Gdx.app.debug(TAG, "Processing " + packet);
|
if (DEBUG_RECEIVED_PACKETS && !ignoredPackets.get(packet.dataType())) Gdx.app.debug(TAG, "Processing " + packet);
|
||||||
try {
|
try {
|
||||||
packet.setId(cdata.get(packet.sender(), InboundPacket.INVALID_CLIENT));
|
|
||||||
if (packet.id() == InboundPacket.INVALID_CLIENT && packet.dataType() != D2GSData.Connection) {
|
|
||||||
Gdx.app.error(TAG, " " + packet + " from invalid client and not a connection request");
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
processPacket(packet);
|
processPacket(packet);
|
||||||
} finally {
|
} finally {
|
||||||
ReferenceCountUtil.release(packet);
|
ReferenceCountUtil.release(packet);
|
||||||
|
Reference in New Issue
Block a user