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


Java ByteBuf.writeBoolean方法代码示例

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


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

示例1: writeToBuf

import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
public void writeToBuf(ByteBuf buf) {
    ByteBufUtils.writeUTF8String(buf, offeringPlayerName);
    ByteBufUtils.writeUTF8String(buf, offeringPlayerId);
    if (providingPosition != null) {
        buf.writeBoolean(true);
        buf.writeInt(providingPosition.getX());
        buf.writeInt(providingPosition.getY());
        buf.writeInt(providingPosition.getZ());
        buf.writeInt(providingDimensionId);
    } else {
        buf.writeBoolean(false);
    }
    if (returningPosition != null) {
        buf.writeBoolean(true);
        buf.writeInt(returningPosition.getX());
        buf.writeInt(returningPosition.getY());
        buf.writeInt(returningPosition.getZ());
        buf.writeInt(returningDimensionId);
    } else {
        buf.writeBoolean(false);
    }
    buf.writeInt(inStock);
    buf.writeInt(maxTrades);
    buf.writeInt(pendingPayments);
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:26,代码来源:AmadronOfferCustom.java

示例2: toBytes

import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf)
{
	if (cat != null)
	{
		buf.writeInt(ArcaneMagicAPI.getNotebookCategories().indexOf(cat));
	} else
	{
		buf.writeInt(-1);
	}
	buf.writeBoolean(showIfFail);
}
 
开发者ID:raphydaphy,项目名称:ArcaneMagic,代码行数:13,代码来源:PacketNotebookToastOrFail.java

示例3: toBytes

import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf) {
    if (pos != null) {
        buf.writeBoolean(true);
        NetworkTools.writePos(buf, pos);
    } else {
        buf.writeBoolean(false);
    }
    NetworkTools.writeString(buf, actionId);
    buf.writeBoolean(extended);
}
 
开发者ID:McJty,项目名称:interactionwheel,代码行数:12,代码来源:PacketPerformAction.java

示例4: toBuffer

import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void toBuffer(ByteBuf buf) throws IOException
{
	buf.writeBytes(this.uuid.toString().getBytes(StandardCharsets.UTF_8));
	buf.writeDouble(this.motionY);
	buf.writeDouble(this.fallStartY);
	buf.writeBoolean(this.isFalling);
	buf.writeDouble(this.playerX);
	buf.writeDouble(this.playerY);
}
 
开发者ID:raphydaphy,项目名称:RockSolid,代码行数:11,代码来源:PacketMovement.java

示例5: write

import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void write( ByteBuf buf ) throws IOException {
    writeVarInt( entityId, buf );
    buf.writeShort( deltaX );
    buf.writeShort( deltaY );
    buf.writeShort( deltaZ );
    buf.writeByte( toAngle( yaw ) );
    buf.writeByte( toAngle( pitch ) );
    buf.writeBoolean( onGround );
}
 
开发者ID:lukas81298,项目名称:FlexMC,代码行数:11,代码来源:MessageS27EntityRelMoveLook.java

示例6: toBytes

import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf)
{
    buf.writeDouble(this.x);
    buf.writeDouble(this.y);
    buf.writeDouble(this.z);
    buf.writeFloat(this.yaw);
    buf.writeFloat(this.pitch);

    buf.writeBoolean(this.setX);
    buf.writeBoolean(this.setY);
    buf.writeBoolean(this.setZ);
    buf.writeBoolean(this.setYaw);
    buf.writeBoolean(this.setPitch);
}
 
开发者ID:Yarichi,项目名称:Proyecto-DASI,代码行数:16,代码来源:AbsoluteMovementCommandsImplementation.java

示例7: write

import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void write(RakNetByteBuf out) {
    super.write(out);
    ByteBuf buf = Unpooled.buffer();

    int recodeCnt = 0;

    Integer[] records = this.records.toArray(new Integer[0]);
    Arrays.sort(records);

    for (int i = 0; i < records.length; i++) {
        int indexStart = records[i];
        int indexEnd = indexStart;

        while (i + 1 < records.length && records[i + 1] == (indexEnd + 1)) {
            indexEnd++;
            i++;
        }

        if (indexStart == indexEnd) {
            buf.writeBoolean(true); //No range
            buf.writeMediumLE(indexStart);
            recodeCnt++;
        } else {
            buf.writeBoolean(false); //Range
            buf.writeMediumLE(indexStart);
            buf.writeMediumLE(indexEnd);
            recodeCnt++;
        }
    }

    out.writeShort(recodeCnt);
    out.writeBytes(buf);
}
 
开发者ID:MagicDroidX,项目名称:RakNetty,代码行数:35,代码来源:AcknowledgePacket.java

示例8: toBytes

import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf)
{
    buf.writeInt(this.pos.getX());
    buf.writeInt(this.pos.getY());
    buf.writeInt(this.pos.getZ());
    ByteBufUtils.writeItemStack(buf, this.itemStack);
    buf.writeInt(this.face.ordinal());
    buf.writeBoolean(this.standOnPlacedBlock);
}
 
开发者ID:Yarichi,项目名称:Proyecto-DASI,代码行数:11,代码来源:DiscreteMovementCommandsImplementation.java

示例9: encode

import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void encode(Packet msg, ByteBuf buf) {
    TextMessagePacket packet = (TextMessagePacket) msg;
    TextMessageType type = packet.getMessage().getType();

    buf.writeByte(type.getOrdinal());
    buf.writeBoolean(packet.isLocalized());

    switch (type) {
        case RAW: {
            encodeRaw(buf, ((RawMessage) packet.getMessage()));
            break;
        }
        case CHAT: {
            encodeChat(buf, ((ChatMessage) packet.getMessage()));
            break;
        }
        case LOCALIZED: {
            encodeLocalized(buf, ((LocalizedMessage) packet.getMessage()));
            break;
        }
        case POPUP: {
            encodePopup(buf, ((PopupMessage) packet.getMessage()));
            break;
        }
        case JUKEBOX_POPUP: {
            encodeJukeboxPopup(buf, ((JukeboxPopupMessage) packet.getMessage()));
            break;
        }
        case TIP: {
            encodeTip(buf, ((TipMessage) packet.getMessage()));
            break;
        }
        case SYSTEM: {
            encodeSystem(buf, ((SystemMessage) packet.getMessage()));
            break;
        }
        case WHISPER: {
            encodeWhisper(buf, ((WhisperMessage) packet.getMessage()));
            break;
        }
        case ANNOUNCEMENT: {
            encodeAnnouncement(buf, ((AnnouncementMessage) packet.getMessage()));
            break;
        }
    }
}
 
开发者ID:JungleTree,项目名称:JungleTree,代码行数:48,代码来源:TextMessageCodec.java

示例10: toBytes

import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf) {
	buf.writeInt(this.tile.getWorld().provider.getDimension());
	buf.writeLong(this.tile.getPos().toLong());
	buf.writeBoolean(this.hasFilter);
}
 
开发者ID:oMilkyy,项目名称:SimpleTubes,代码行数:7,代码来源:PacketDisplacerSync.java

示例11: serialize

import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void serialize(ByteBuf buf) {
  buf.writeInt(interceptIndex);
  buf.writeBoolean(fitIntercept);
  buf.writeBoolean(standardization);
}
 
开发者ID:Tencent,项目名称:angel,代码行数:7,代码来源:RegLoss.java

示例12: toBytes

import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf)
{
	buf.writeBoolean(roleplayMode);
}
 
开发者ID:Zundrel,项目名称:Ye-Olde-Chat,代码行数:6,代码来源:MessageSyncRoleplayMode.java

示例13: writeData

import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void writeData(ByteBuf buf) {
    buf.writeInt(mProtcolVersion);
    buf.writeBoolean(status);
}
 
开发者ID:AlexMog,项目名称:SurvivalMMO,代码行数:6,代码来源:HandshakeAnswer.java

示例14: toBytes

import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf) {
    buf.writeByte(part.id);
    buf.writeBoolean(hand == EnumHand.MAIN_HAND);
}
 
开发者ID:ichttt,项目名称:FirstAid,代码行数:6,代码来源:MessageApplyHealingItem.java

示例15: toBytes

import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf) {
	buf.writeInt(x);
	buf.writeInt(y);
	buf.writeBoolean(b);
}
 
开发者ID:trigg,项目名称:Firma,代码行数:7,代码来源:KnapToServer.java


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