當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。