当前位置: 首页>>代码示例>>Java>>正文


Java ByteBuf.writeLongLE方法代码示例

本文整理汇总了Java中io.netty.buffer.ByteBuf.writeLongLE方法的典型用法代码示例。如果您正苦于以下问题:Java ByteBuf.writeLongLE方法的具体用法?Java ByteBuf.writeLongLE怎么用?Java ByteBuf.writeLongLE使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在io.netty.buffer.ByteBuf的用法示例。


在下文中一共展示了ByteBuf.writeLongLE方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: encode

import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void encode(Packet msg, ByteBuf buf) {
    AdventureSettingsPacket packet = (AdventureSettingsPacket) msg;
    ByteBufUtils.writeUnsignedVarInt(buf, BitMaskValue.getBitMask(packet.getFlags()));
    ByteBufUtils.writeUnsignedVarInt(buf, packet.getCommandPermissionLevel().getOrdinal());
    ByteBufUtils.writeUnsignedVarInt(buf, BitMaskValue.getBitMask(packet.getAbilities()));
    ByteBufUtils.writeUnsignedVarInt(buf, packet.getPlayerPermissionLevel().getOrdinal());
    ByteBufUtils.writeUnsignedVarInt(buf, packet.getSavedPermissionLevel().getOrdinal());
    buf.writeLongLE(packet.getEntityId());
}
 
开发者ID:JungleTree,项目名称:JungleTree,代码行数:11,代码来源:AdventureSettingsCodec.java

示例2: writePackInfo

import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
public static void writePackInfo(ByteBuf serializer, ResourcePack pack) {
	StringSerializer.writeString(serializer, ProtocolVersion.MINECRAFT_PE, pack.getPackId());
	StringSerializer.writeString(serializer, ProtocolVersion.MINECRAFT_PE, pack.getPackVersion());
	serializer.writeLongLE(pack.getPackSize());
	StringSerializer.writeString(serializer, ProtocolVersion.MINECRAFT_PE, ""); // ???
	StringSerializer.writeString(serializer, ProtocolVersion.MINECRAFT_PE, ""); // ???
}
 
开发者ID:ProtocolSupport,项目名称:ProtocolSupportPocketStuff,代码行数:8,代码来源:ResourcePackSerializer.java

示例3: toData

import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void toData(Connection connection, ByteBuf serializer) {
	StringSerializer.writeString(serializer, ProtocolVersion.MINECRAFT_PE, packId);
	serializer.writeIntLE(chunkIdx);
	serializer.writeLongLE(StuffUtils.CHUNK_SIZE * chunkIdx);
	serializer.writeIntLE(packChunk.length);
	serializer.writeBytes(packChunk);
}
 
开发者ID:ProtocolSupport,项目名称:ProtocolSupportPocketStuff,代码行数:9,代码来源:ResourcePackChunkDataPacket.java

示例4: toData

import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void toData(Connection connection, ByteBuf serializer) {
	StringSerializer.writeString(serializer, ProtocolVersion.MINECRAFT_PE, pack.getPackId());
	serializer.writeIntLE(StuffUtils.CHUNK_SIZE); // max chunk size 1MB
	serializer.writeIntLE(pack.getPackSize() / StuffUtils.CHUNK_SIZE); // chunk count
	serializer.writeLongLE(pack.getPackSize()); // res pack size

	byte[] hash = pack.getSha256();

	VarNumberSerializer.writeVarInt(serializer, hash.length);
	for (byte b : hash) {
		serializer.writeByte(b);
	}
}
 
开发者ID:ProtocolSupport,项目名称:ProtocolSupportPocketStuff,代码行数:15,代码来源:ResourcePackDataInfoPacket.java

示例5: toData

import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void toData(Connection connection, ByteBuf serializer) {
	MiscSerializer.writeUUID(serializer, connection.getVersion(), uuid);
	StringSerializer.writeString(serializer, connection.getVersion(), name);
	VarNumberSerializer.writeSVarLong(serializer, entityId); // entity ID
	VarNumberSerializer.writeVarLong(serializer, entityId); // runtime ID
	MiscSerializer.writeLFloat(serializer, x); // x
	MiscSerializer.writeLFloat(serializer, y); // y
	MiscSerializer.writeLFloat(serializer, z); // z
	MiscSerializer.writeLFloat(serializer, motionX); // motx
	MiscSerializer.writeLFloat(serializer, motionY); // moty
	MiscSerializer.writeLFloat(serializer, motionZ); // motz
	MiscSerializer.writeLFloat(serializer, pitch); // pitch
	MiscSerializer.writeLFloat(serializer, headYaw); // yaw
	MiscSerializer.writeLFloat(serializer, yaw); // yaw

	VarNumberSerializer.writeSVarInt(serializer, 0); // held item stack

	EntityMetadata.encodeMeta(serializer, connection.getVersion(), I18NData.DEFAULT_LOCALE, metadata);

	//adventure settings
	VarNumberSerializer.writeVarInt(serializer, 0);
	VarNumberSerializer.writeVarInt(serializer, 0);
	VarNumberSerializer.writeVarInt(serializer, 0);
	VarNumberSerializer.writeVarInt(serializer, 0);
	VarNumberSerializer.writeVarInt(serializer, 0);

	serializer.writeLongLE(0); //?

	VarNumberSerializer.writeSVarInt(serializer, 0); //links, not used
}
 
开发者ID:ProtocolSupport,项目名称:ProtocolSupportPocketStuff,代码行数:32,代码来源:SpawnPlayerPacket.java

示例6: encodeChat

import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
private void encodeChat(ByteBuf buf, ChatMessage message) {
    writeString(buf, message.getSender());
    writeString(buf, message.getMessage().encode());
    buf.writeLongLE(message.getXuid());
}
 
开发者ID:JungleTree,项目名称:JungleTree,代码行数:6,代码来源:TextMessageCodec.java

示例7: encodeRaw

import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
private void encodeRaw(ByteBuf buf, RawMessage message) {
    writeString(buf, message.getMessage().encode());
    buf.writeLongLE(message.getXuid());
}
 
开发者ID:JungleTree,项目名称:JungleTree,代码行数:5,代码来源:TextMessageCodec.java


注:本文中的io.netty.buffer.ByteBuf.writeLongLE方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。