mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-06 17:08:23 +01:00
Core/PacketIO: Added WriteString method to ByteBuffer allowing to write strings without null-terminating them
This commit is contained in:
@@ -152,8 +152,8 @@ namespace Movement
|
||||
inline void MoveSplineInit::SetOrientationInversed() { args.flags.orientationInversed = true;}
|
||||
inline void MoveSplineInit::SetTransportEnter() { args.flags.EnableTransportEnter(); }
|
||||
inline void MoveSplineInit::SetTransportExit() { args.flags.EnableTransportExit(); }
|
||||
|
||||
inline void MoveSplineInit::SetOrientationFixed(bool enable) { args.flags.orientationFixed = enable; }
|
||||
|
||||
inline void MoveSplineInit::SetFall()
|
||||
{
|
||||
args.flags.EnableFalling();
|
||||
|
||||
@@ -452,6 +452,13 @@ class ByteBuffer
|
||||
return retval;
|
||||
}
|
||||
|
||||
//! Method for writing strings that have their length sent separately in packet
|
||||
//! without null-terminating the string
|
||||
void WriteString(std::string const& str)
|
||||
{
|
||||
append(str.c_str(), str.length());
|
||||
}
|
||||
|
||||
const uint8 *contents() const { return &_storage[0]; }
|
||||
|
||||
size_t size() const { return _storage.size(); }
|
||||
|
||||
Reference in New Issue
Block a user