28.12.2014, 15:47
|
#1
|
Новичок
Регистрация: 13.11.2014
Сообщений: 20
Сказал Спасибо: 2
Имеет 1 спасибку в 1 сообщении
|
Разговор про ОptCode
Просматриваю тут исходники, обьясните мне, в L2 используются opcodы разных размеров ? И в каких хрониках какие ?
Цитата:
/** Sets 3rd byte of packet (which holds packet opcode).
* Equivalent to call writeReset() and writeUChar() with parameter type.
* Moves write pointer to byte #3 (next after opcode)
* \param type new packet opcode. */
public virtual void setPacketType(byte type)
{
writeReset();
writeUChar(type);
}
/** Sets 3rd,4th,5th bytes of packet (which holds packet opcode and extended opcode).
* Equivalent to call writeReset(); writeUChar(); writeUShort() with parameter type.
* Moves write pointer!
* \param opcode new packet opcode.
* \param opcode2 extended opcode. */
public virtual void setPacketType2(byte opcode, ushort opcode2)
{
writeReset();
writeUChar(opcode);
writeUShort(opcode2);
}
/** Sets 3rd,4th,5th,6th,7th bytes of packet (which holds packet opcode, ext opcode, ext opcode 2).
* Equivalent to call writeReset(); writeUChar(); writeUShort() writeUShort() with parameter type.
* Moves write pointer!
* \param opcode new packet opcode.
* \param opcode2 extended opcode.
* \param opcode3 extended opcode 2.
*/
public virtual void setPacketType3(byte opcode, ushort opcode2, ushort opcode3)
{
writeReset();
writeUChar(opcode);
writeUShort(opcode2);
writeUShort(opcode3);
}
/** Reads packet opcode. Moves read pointer to byte #3 (next after opcode). Equivalent calls: readReset(); readUChar()
* \return read packet opcode. */
public virtual byte getPacketType()
{
readReset();
return readUChar();
}
|
|
|
|