本文整理汇总了Java中io.netty.buffer.ByteBuf.readInt方法的典型用法代码示例。如果您正苦于以下问题:Java ByteBuf.readInt方法的具体用法?Java ByteBuf.readInt怎么用?Java ByteBuf.readInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类io.netty.buffer.ByteBuf
的用法示例。
在下文中一共展示了ByteBuf.readInt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: request
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void request( ChannelHandlerContext _ctx , ByteBuf _request ) {
final int UserLogin = 1;
final int UserRegist = 2;
int cmd = _request.readInt();
logger.info( "CommandService do command: CMD=[" + cmd + "]" );
ByteBuf response = _ctx.alloc().buffer();
//根据cmd来识别使用哪个模块来处理,
switch( cmd ){
case UserLogin:
demoModel.requestLogin( _request, response );
break;
case UserRegist:
demoModel.requestRegist( _request, response );
break;
}
response( _ctx, response );
}
示例2: fromBytes
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
entityId = buf.readInt();
progress = buf.readFloat();
}
示例3: fromBytes
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf)
{
serverID = buf.readInt();
}
示例4: fromBytes
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
entityID = buf.readInt();
animationName = ByteBufUtils.readUTF8String(buf);
loopAnim = buf.readBoolean();
transitionTime = buf.readFloat();
}
示例5: fromBytes
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public final void fromBytes(ByteBuf buf)
{
this.id = buf.readInt();
restoreState(buf);
}
示例6: fromBytes
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
type = EnumParticleTypes.values()[buf.readShort()];
x = buf.readDouble();
y = buf.readDouble();
z = buf.readDouble();
loopSize = buf.readInt();
}
示例7: fromBytes
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
type=EnumFailLoadImage.values()[buf.readInt()];
int imagenamelength = buf.readInt();
byte imagenamebyte[] = new byte[imagenamelength];
buf.readBytes(imagenamebyte);
imagename = new String(imagenamebyte);
}
示例8: fromBytes
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
int size = buf.readInt();
positions = new HashSet<>(size);
for (int i = 0 ; i < size ; i++) {
positions.add(NetworkTools.readPos(buf));
}
}
示例9: fromBytes
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
int dim = buf.readInt();
BlockPos pos = BlockPos.fromLong(buf.readLong());
World world = SimpleTubes.proxy.getWorld(dim);
if(world != null)
this.tile = world.getTileEntity(pos);
this.id = buf.readInt();
this.progress = buf.readFloat();
this.direction = buf.readByte();
this.color = buf.readInt();
}
示例10: fromBytes
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf)
{
player = buf.readInt();
where = ContainingInventory.VALUES[buf.readByte()];
slot = buf.readByte();
stack = ByteBufUtils.readItemStack(buf);
}
示例11: fromBytes
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
destination = new TeleportDestination(NetworkTools.readStringUTF8(buf), buf.readInt(),
BlockPos.fromLong(buf.readLong()),
EnumFacing.VALUES[buf.readByte()]);
destinationIndex = buf.readInt();
}
示例12: fromBytes
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buffer) {
buttonID = buffer.readInt();
}
示例13: readEnum
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
public static <T extends Enum> T readEnum(ByteBuf buf, T[] values) {
return values[buf.readInt()];
}
示例14: fromBytes
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
op = buf.readInt();
xp = buf.readInt();
}
示例15: fromBytes
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buffer) {
radiation = buffer.readInt();
}