Limit the message length from llInstantMessage to 1024 characters http://wiki.secondlife.com/wiki/LlInstantMessage
Also truncate messages that may exceed the limit set by the packet size. The limit in OpenMetaverse is 1100 bytes including a zero byte terminator. Fixes Mantis #32440.6.4-rc1
parent
23b247c519
commit
aab1601642
|
@ -1206,7 +1206,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
msg.MessageBlock.RegionID = UUID.Zero;
|
msg.MessageBlock.RegionID = UUID.Zero;
|
||||||
msg.MessageBlock.Timestamp = timeStamp;
|
msg.MessageBlock.Timestamp = timeStamp;
|
||||||
msg.MessageBlock.ToAgentID = toAgent;
|
msg.MessageBlock.ToAgentID = toAgent;
|
||||||
msg.MessageBlock.Message = Utils.StringToBytes(message);
|
// Cap the message length at 1099. There is a limit in ImprovedInstantMessagePacket
|
||||||
|
// the limit is 1100 but a 0 byte gets added to mark the end of the string
|
||||||
|
if (message != null && message.Length > 1099)
|
||||||
|
msg.MessageBlock.Message = Utils.StringToBytes(message.Substring(0, 1099));
|
||||||
|
else
|
||||||
|
msg.MessageBlock.Message = Utils.StringToBytes(message);
|
||||||
msg.MessageBlock.BinaryBucket = binaryBucket;
|
msg.MessageBlock.BinaryBucket = binaryBucket;
|
||||||
|
|
||||||
if (message.StartsWith("[grouptest]"))
|
if (message.StartsWith("[grouptest]"))
|
||||||
|
|
|
@ -2717,7 +2717,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
//{
|
//{
|
||||||
// msg.fromAgentName = "(hippos)";// Added for posterity. This means that we can't figure out who sent it
|
// msg.fromAgentName = "(hippos)";// Added for posterity. This means that we can't figure out who sent it
|
||||||
//}
|
//}
|
||||||
msg.message = message;
|
// Cap the message length at 1024.
|
||||||
|
if (message != null && message.Length > 1024)
|
||||||
|
msg.message = message.Substring(0, 1024);
|
||||||
|
else
|
||||||
|
msg.message = message;
|
||||||
msg.dialog = (byte)19; // messgage from script ??? // dialog;
|
msg.dialog = (byte)19; // messgage from script ??? // dialog;
|
||||||
msg.fromGroup = false;// fromGroup;
|
msg.fromGroup = false;// fromGroup;
|
||||||
msg.offline = (byte)0; //offline;
|
msg.offline = (byte)0; //offline;
|
||||||
|
|
Loading…
Reference in New Issue