// Process returned packet in comparison with sent query packet
if(!(sendingPacket instanceof UrpQuery)) throw new RuntimeException("The sending packet is not of type UrpQuery.");
else {
// Cast based on command type of the query packet
UrpQuery uq = (UrpQuery) sendingPacket;
switch(uq.getCommandId()) {
case RES_UCD:
queryPacket = (ResUcdQuery) sendingPacket;
break;
default:
break;