feat(Core/Common): delete old Tokenizer (#10121)
This commit is contained in:
parent
a25ef74de3
commit
6d7f58e6ed
24 changed files with 284 additions and 225 deletions
|
|
@ -48,6 +48,8 @@
|
|||
#include "Vehicle.h"
|
||||
#include "World.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "Tokenize.h"
|
||||
#include "StringConvert.h"
|
||||
|
||||
// TODO: this import is not necessary for compilation and marked as unused by the IDE
|
||||
// however, for some reasons removing it would cause a damn linking issue
|
||||
|
|
@ -610,21 +612,29 @@ uint32 Object::GetUpdateFieldData(Player const* target, uint32*& flags) const
|
|||
return visibleFlag;
|
||||
}
|
||||
|
||||
void Object::_LoadIntoDataField(std::string const& data, uint32 startOffset, uint32 count)
|
||||
bool Object::_LoadIntoDataField(std::string const& data, uint32 startOffset, uint32 count)
|
||||
{
|
||||
if (data.empty())
|
||||
return;
|
||||
return false;
|
||||
|
||||
Tokenizer tokens(data, ' ', count);
|
||||
std::vector<std::string_view> tokens = Acore::Tokenize(data, ' ', false);
|
||||
|
||||
if (tokens.size() != count)
|
||||
return;
|
||||
return false;
|
||||
|
||||
for (uint32 index = 0; index < count; ++index)
|
||||
{
|
||||
m_uint32Values[startOffset + index] = atol(tokens[index]);
|
||||
Optional<uint32> val = Acore::StringTo<uint32>(tokens[index]);
|
||||
if (!val)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
m_uint32Values[startOffset + index] = *val;
|
||||
_changesMask.SetBit(startOffset + index);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void Object::SetInt32Value(uint16 index, int32 value)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue