change lsl say/whisper/shout text lenght limit

master
UbitUmarov 2020-02-24 05:57:54 +00:00
parent 6cadcb8bdf
commit d47ce25b5b
1 changed files with 9 additions and 11 deletions

View File

@ -1199,12 +1199,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (text.Length > 1023) if (text.Length > 1023)
text = text.Substring(0, 1023); text = text.Substring(0, 1023);
World.SimChat(Utils.StringToBytes(text), byte[] binText = Util.StringToBytes(text, 1023);
World.SimChat(binText,
ChatTypeEnum.Whisper, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID, false); ChatTypeEnum.Whisper, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID, false);
IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
if (wComm != null) if (wComm != null)
wComm.DeliverMessage(ChatTypeEnum.Whisper, channelID, m_host.Name, m_host.UUID, text); wComm.DeliverMessage(ChatTypeEnum.Whisper, channelID, m_host.Name, m_host.UUID, Util.UTF8.GetString(binText));
} }
private void CheckSayShoutTime() private void CheckSayShoutTime()
@ -1236,15 +1237,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} }
else else
{ {
if (text.Length > 1023) byte[] binText = Util.StringToBytes(text, 1023);
text = text.Substring(0, 1023); World.SimChat(binText,
World.SimChat(Utils.StringToBytes(text),
ChatTypeEnum.Say, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID, false); ChatTypeEnum.Say, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID, false);
IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
if (wComm != null) if (wComm != null)
wComm.DeliverMessage(ChatTypeEnum.Say, channelID, m_host.Name, m_host.UUID, text); wComm.DeliverMessage(ChatTypeEnum.Say, channelID, m_host.Name, m_host.UUID, Util.UTF8.GetString(binText));
} }
} }
@ -1259,15 +1258,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (m_SayShoutCount >= 11) if (m_SayShoutCount >= 11)
ScriptSleep(2000); ScriptSleep(2000);
if (text.Length > 1023) byte[] binText = Util.StringToBytes(text, 1023);
text = text.Substring(0, 1023);
World.SimChat(Utils.StringToBytes(text), World.SimChat(binText,
ChatTypeEnum.Shout, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID, true); ChatTypeEnum.Shout, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID, true);
IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
if (wComm != null) if (wComm != null)
wComm.DeliverMessage(ChatTypeEnum.Shout, channelID, m_host.Name, m_host.UUID, text); wComm.DeliverMessage(ChatTypeEnum.Shout, channelID, m_host.Name, m_host.UUID, Util.UTF8.GetString(binText));
} }
public void llRegionSay(int channelID, string text) public void llRegionSay(int channelID, string text)