예제 #1
0
void EC_DynamicComponent::DeserializeFromBinary(kNet::DataDeserializer& source, AttributeChange::Type change)
{
    u8 num_attributes = source.Read<u8>();
    std::vector<DeserializeData> deserializedAttributes;
    for (uint i = 0; i < num_attributes; ++i)
    {
        std::string name = source.ReadString();
        std::string type = source.ReadString();
        std::string value = source.ReadString();
        DeserializeData attributeData(name, type, value);
        deserializedAttributes.push_back(attributeData);
    }

    DeserializeCommon(deserializedAttributes, change);
}
예제 #2
0
파일: IAttribute.cpp 프로젝트: katik/naali
template<> void TUNDRACORE_API Attribute<AssetReferenceList>::FromBinary(kNet::DataDeserializer& source, AttributeChange::Type change)
{
    AssetReferenceList value;
    u8 numValues = source.Read<u8>();
    for(u32 i = 0; i < numValues; ++i)
        value.Append(AssetReference(source.ReadString().c_str()));

    Set(value, change);
}
예제 #3
0
파일: IAttribute.cpp 프로젝트: katik/naali
template<> void TUNDRACORE_API Attribute<QVariantList>::FromBinary(kNet::DataDeserializer& source, AttributeChange::Type change)
{
    QVariantList value;
    
    u8 numValues = source.Read<u8>();
    for(u32 i = 0; i < numValues; ++i)
    {
        std::string str = source.ReadString();
        value.append(QVariant(QString(str.c_str())));
    }
    
    Set(value, change);
}
예제 #4
0
파일: IAttribute.cpp 프로젝트: katik/naali
template<> void TUNDRACORE_API Attribute<QVariant>::FromBinary(kNet::DataDeserializer& source, AttributeChange::Type change)
{
    std::string str = source.ReadString();
    QVariant value(QString(str.c_str()));
    Set(value, change);
}
예제 #5
0
파일: IAttribute.cpp 프로젝트: katik/naali
template<> void TUNDRACORE_API Attribute<EntityReference>::FromBinary(kNet::DataDeserializer& source, AttributeChange::Type change)
{
    EntityReference value;
    value.ref = source.ReadString().c_str();
    Set(value, change);
}