public void aaSayDistance(int channelID, LSL_Float Distance, string text) { ScriptProtection.CheckThreatLevel(ThreatLevel.VeryLow, "AASayDistance", m_host, "AA"); if (text.Length > 1023) { text = text.Substring(0, 1023); } IChatModule chatModule = World.RequestModuleInterface <IChatModule>(); if (chatModule != null) { chatModule.SimChat(text, ChatTypeEnum.Custom, channelID, m_host.ParentEntity.RootChild.AbsolutePosition, m_host.Name, m_host.UUID, false, false, (float)Distance.value, UUID.Zero, World); } IWorldComm wComm = World.RequestModuleInterface <IWorldComm>(); if (wComm != null) { wComm.DeliverMessage(ChatTypeEnum.Custom, channelID, m_host.Name, m_host.UUID, text, (float)Distance.value); } }
// //Dumps an error message on the debug console. // internal void MODShoutError(string message) { if (message.Length > 1023) message = message.Substring(0, 1023); World.SimChat(Utils.StringToBytes(message), ChatTypeEnum.Shout, ScriptBaseClass.DEBUG_CHANNEL, m_host.ParentGroup.RootPart.AbsolutePosition, m_host.Name, m_host.UUID, true); IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); wComm.DeliverMessage(ChatTypeEnum.Shout, ScriptBaseClass.DEBUG_CHANNEL, m_host.Name, m_host.UUID, message); }
// //Dumps an error message on the debug console. // internal void modShoutError(string message) { if (message.Length > 1023) { message = message.Substring(0, 1023); } IChatModule chatModule = World.RequestModuleInterface <IChatModule>(); if (chatModule != null) { chatModule.SimChat(message, ChatTypeEnum.Shout, ScriptBaseClass.DEBUG_CHANNEL, m_host.ParentEntity.RootChild.AbsolutePosition, m_host.Name, m_host.UUID, true, World); } IWorldComm wComm = World.RequestModuleInterface <IWorldComm>(); wComm.DeliverMessage(ChatTypeEnum.Shout, ScriptBaseClass.DEBUG_CHANNEL, m_host.Name, m_host.UUID, message); }
protected override byte[] ProcessRequest(string path, Stream requestData, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { try { String requestBody = new StreamReader(requestData).ReadToEnd(); BasicChatData data = JsonConvert.DeserializeObject <BasicChatData>(requestBody); byte[] binText = Util.StringToBytesNoTerm(data.Message, 1023); m_world.SimChat(binText, ChatTypeEnum.Region, data.Channel, new Vector3(128, 128, 20), data.Name, UUID.Random(), data.Agent); m_world.SimChatBroadcast(binText, ChatTypeEnum.Region, data.Channel, new Vector3(128, 128, 20), data.Name, UUID.Random(), data.Agent); IWorldComm wComm = m_world.RequestModuleInterface <IWorldComm>(); if (wComm != null) { wComm.DeliverMessage(ChatTypeEnum.Region, data.Channel, data.Name, UUID.Random(), Util.UTF8.GetString(binText)); } return(Encoding.UTF8.GetBytes("ok")); }catch (Exception error) { return(Encoding.UTF8.GetBytes("error: " + error.Message)); } }