Merge remote-tracking branch 'origin/temp/more-patches-53' into ryzomclassic-develop

ryzomclassic-develop
kaetemi 4 years ago
commit ebc220fedb

@ -92,6 +92,11 @@ public:
/// exchange memory data
void swap(CMessage &other);
#ifdef NL_CPP14
/// Move operator
CMessage &operator=(CMessage &&other) noexcept { swap(other); }
#endif
/// Sets the message type as a string and put it in the buffer if we are in writing mode
void setType (const std::string &name, TMessageType type=OneWay);

@ -587,6 +587,8 @@ void CCDBSynchronised::pushDelta( CBitMemStream& s, CCDBStructNodeLeaf *node, ui
uint64 isNull = 1;
s.serialAndLog2( isNull, 1 );
bitsize += 1;
if ( VerboseDatabase )
nldebug( "CDB: Pushing permanent value NULL for index %d prop %s", index, node->buildTextId().toString().c_str() );
}
else
{
@ -639,26 +641,44 @@ void CCDBSynchronised::pushDeltaPermanent( NLMISC::CBitMemStream& s, CCDBStructN
uint64 value;
value = (uint64)_DataContainer.getValue64( index ); // "delta from 0"
if ( node->type() == ICDBStructNode::TEXT )
{
s.serialAndLog2( value, 32 );
bitsize += 32;
if ( VerboseDatabase )
nldebug( "CDB: Pushing permanent value %" NL_I64 "d (TEXT-32) for index %d prop %s", (sint64)value, index, node->buildTextId().toString().c_str() );
}
else if ( node->type() == ICDBStructNode::PACKED )
if ( node->nullable() && value == 0 )
{
uint bits;
pushPackedValue( s, value, bitsize, bits );
uint64 isNull = 1;
s.serialAndLog2( isNull, 1 );
bitsize += 1;
if ( VerboseDatabase )
nldebug( "CDB: Pushing permanent value %" NL_I64 "d (PACKED %u bits) for index %d prop %s", (sint64)value, bits, index, node->buildTextId().toString().c_str() );
nldebug( "CDB: Pushing permanent value NULL for index %d prop %s", index, node->buildTextId().toString().c_str() );
}
else
{
s.serialAndLog2( value, (uint)node->type() );
bitsize += (uint32)node->type();
if ( VerboseDatabase )
nldebug( "CDB: Pushing permanent value %" NL_I64 "d (%u bits) for index %d prop %s", (sint64)value, (uint32)node->type(), index, node->buildTextId().toString().c_str() );
if ( node->nullable() )
{
uint64 isNull = 0;
s.serialAndLog2( isNull, 1 );
bitsize += 1;
}
if ( node->type() == ICDBStructNode::TEXT )
{
s.serialAndLog2( value, 32 );
bitsize += 32;
if ( VerboseDatabase )
nldebug( "CDB: Pushing permanent value %" NL_I64 "d (TEXT-32) for index %d prop %s", (sint64)value, index, node->buildTextId().toString().c_str() );
}
else if ( node->type() == ICDBStructNode::PACKED )
{
uint bits;
pushPackedValue( s, value, bitsize, bits );
if ( VerboseDatabase )
nldebug( "CDB: Pushing permanent value %" NL_I64 "d (PACKED %u bits) for index %d prop %s", (sint64)value, bits, index, node->buildTextId().toString().c_str() );
}
else
{
s.serialAndLog2( value, (uint)node->type() );
bitsize += (uint32)node->type();
if ( VerboseDatabase )
nldebug( "CDB: Pushing permanent value %" NL_I64 "d (%u bits) for index %d prop %s", (sint64)value, (uint32)node->type(), index, node->buildTextId().toString().c_str() );
}
}
}
else

Loading…
Cancel
Save