本文整理汇总了C++中PacketBuffer::putString方法的典型用法代码示例。如果您正苦于以下问题:C++ PacketBuffer::putString方法的具体用法?C++ PacketBuffer::putString怎么用?C++ PacketBuffer::putString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PacketBuffer
的用法示例。
在下文中一共展示了PacketBuffer::putString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: write
void DataWatcher::write(PacketBuffer &buffer) {
for (byte_t index = 0; index < 23; ++index) {
if (type[index] == NONE)
continue;
buffer.putByte(type[index] << 5 | (index & 0x1f));
switch (type[index]) {
case BYTE:
buffer.putByte(getByte(index));
break;
case SHORT:
buffer.putShort(getShort(index));
break;
case INT:
buffer.putInt(getInt(index));
break;
case FLOAT:
buffer.putFloat(getFloat(index));
break;
case STRING:
buffer.putString(getString(index));
break;
case ITEMSTACK:
buffer.putItemStack(getItemStack(index));
break;
}
}
buffer.putByte(0x7f);
}
示例2: write
void PacketJoinGame::write(PacketBuffer &buffer) {
buffer.putInt(entityId);
buffer.putUByte(gameMode);
buffer.putByte(dimension);
buffer.putUByte(difficulty);
buffer.putUByte(maxPlayers);
buffer.putString(levelType);
buffer.putBool(reducedDebugInfo);
}