void Packet::write(const Object* object) { SetBitFlag(flags, PacketFlags::Binary, true); SerializerBinary serializer(AllocatorGetThis(), 0); serializer.stream = &ms; serializer.save(object); }
Packet::Packet(PacketId id) : id(id) , ms(DefaultPacketSize) , packet(nullptr) , freePacket(false) , flags((PacketFlags)0) { SetBitFlag(flags, PacketFlags::Reliable, true); }
void Message::write(const Object* object) { SetBitFlag(flags, MessageFlags::Binary, true); Serializer* serializer = SerializerCreateBinary(AllocatorGetThis(), 0); serializer->stream = ms; SerializerSave(serializer, object); Deallocate(serializer); }
NAMESPACE_CORE_BEGIN //-----------------------------------// Message::Message(MessageId id) : id(id) , ms(nullptr) , packet(nullptr) , freePacket(false) , flags(0) { ms = StreamCreateFromMemory(AllocatorGetThis(), 512); SetBitFlag(flags, MessageFlags::Reliable, true); //SetBitFlag(flags, MessageFlags::Compressed, true); }
void Entity::setTag(int32 index, bool state) { SetBitFlag(tags, (uint32)(1 << index), state); }