From 83562db1b7b99a2ebf7afcb72e113db84188eee2 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 4 Oct 2020 21:18:05 +0100 Subject: [PATCH] yes, yes... missing file --- .../ClientStack/Linden/UDP/LLUDPZeroEncoder.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPZeroEncoder.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPZeroEncoder.cs index aa8901453b..1efc893a99 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPZeroEncoder.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPZeroEncoder.cs @@ -351,5 +351,20 @@ namespace OpenSim.Region.ClientStack.LindenUDP AddByte((byte)(len)); AddBytes(data, len); } + + // maxlen <= 255 and includes null termination byte, maxchars == max len of utf16 source + public unsafe void AddShortLimitedUTF8(osUTF8 str) + { + int len = str.Length; + if (str.Length == 0) + { + AddZeros(1); + return; + } + + AddByte((byte)(len + 1)); // add null + AddBytes(str.GetArray(), len); + AddZeros(1); + } } } \ No newline at end of file