Exemplo n.º 1
0
             echo '[capsuleHandler] List complete!' . "\n";
             $BA->addCmd(PCKT_C_GETWORLDLIST);
             socket_write($SOCKET, $BA->getPacket());
             $BA->clear();
             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