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


Java ByteBuf.readInt方法代码示例

本文整理汇总了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 );
}
 
开发者ID:aiyoyoyo,项目名称:jeesupport,代码行数:21,代码来源:CommandService.java

示例2: fromBytes

import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
	entityId = buf.readInt();
	progress = buf.readFloat();
}
 
开发者ID:blay09,项目名称:HardcoreRevival,代码行数:6,代码来源:MessageRevivalProgress.java

示例3: fromBytes

import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf)
{
    serverID = buf.readInt();
}
 
开发者ID:CreeperHost,项目名称:CreeperHostGui,代码行数:6,代码来源:PacketHandler.java

示例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();
}
 
开发者ID:ObsidianSuite,项目名称:ObsidianSuite,代码行数:8,代码来源:MessageAnimationStart.java

示例5: fromBytes

import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public final void fromBytes(ByteBuf buf)
{

	this.id = buf.readInt();
	restoreState(buf);
}
 
开发者ID:Yarichi,项目名称:Proyecto-DASI,代码行数:8,代码来源:ObservationFromServer.java

示例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();
}
 
开发者ID:bafomdad,项目名称:uniquecrops,代码行数:10,代码来源:PacketUCEffect.java

示例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);
}
 
开发者ID:PorPit,项目名称:MineCamera,代码行数:9,代码来源:MessageFailLoadImage.java

示例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));
    }
}
 
开发者ID:McJty,项目名称:interactionwheel,代码行数:9,代码来源:PackedInventoriesToClient.java

示例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();
}
 
开发者ID:oMilkyy,项目名称:SimpleTubes,代码行数:15,代码来源:PacketItemSync.java

示例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);
}
 
开发者ID:gigaherz,项目名称:ToolBelt,代码行数:9,代码来源:BeltContentsChange.java

示例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();
}
 
开发者ID:McJty,项目名称:MeeCreeps,代码行数:8,代码来源:PacketSetDestination.java

示例12: fromBytes

import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buffer) {
    buttonID = buffer.readInt();
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:5,代码来源:PacketGuiButton.java

示例13: readEnum

import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
public static <T extends Enum> T readEnum(ByteBuf buf, T[] values) {
    return values[buf.readInt()];
}
 
开发者ID:McJty,项目名称:interactionwheel,代码行数:4,代码来源:NetworkTools.java

示例14: fromBytes

import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
   op = buf.readInt();
   xp = buf.readInt();
}
 
开发者ID:arucil,项目名称:mc-XPBox,代码行数:6,代码来源:MessageOp.java

示例15: fromBytes

import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buffer) {
	radiation = buffer.readInt();
}
 
开发者ID:TwilightWingsStudio,项目名称:HazardsLib,代码行数:5,代码来源:MsgSyncRadiation.java


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