break; //------------------------- //------------------------- case PCKT_X_DEBUG: echo '[capsuleHandler] Debug message: ' . $CAPSULE->readString() . "\n"; break; //------------------------- //------------------------- default: $CAPSULE->modSeek(-2); echo '[capsuleHandler] Unknow packet cmdID ' . $CAPSULE->readWord() . '! STOP!' . "\n"; $CAPSULE->setSeek($CAPSULE->size()); //GoTo EOF break; } if ($CAPSULE->eof()) { break; } //break the loop, no more CMDs } //----------------------------------------------- //Delete the 5+length first bytes from the buffer $BUFFER->delete(5 + $length); //position to 5+length and read the rest //We already processed it, we no need anymore. Anyway keeping it //would totally screw up the code because the Seek is always set //to the begening remember? So trust me, delete it >:D //Oh well, whats next, the buffer might have move capsules in it //(except the one we just processed and deleted) //so, easy solution, lets do the loop one more time :P //But before looping, lets check if I was right