mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-07-13 01:07:43 +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);
|
||||
if (DEBUG_RECEIVED_CACHE && numCached > 0) Gdx.app.debug(TAG, "Processing " + numCached + " packets...");
|
||||
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);
|
||||
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);
|
||||
} finally {
|
||||
ReferenceCountUtil.release(packet);
|
||||
|
Reference in New Issue
Block a user