public TriggerOnChatBroadcast ( Object sender, OSChatMessage chat ) : void | ||
sender | Object | |
chat | OSChatMessage | |
Résultat | void |
/// <summary> /// Sends a chat message to clients in the region /// </summary> /// <param name="message">The message to send to users</param> /// <param name="type">The type of message (say, shout, whisper, owner say, etc)</param> /// <param name="channel">The channel to speak the message on</param> /// <param name="fromPos">The position of the speaker (the SceneObjectPart or ScenePresence)</param> /// <param name="fromName">The name of the speaker (the SceneObjectPart or ScenePresence)</param> /// <param name="fromID">The UUID of the speaker (the SceneObjectPart or ScenePresence)</param> /// <param name="destID">The user or object that is being spoken to (UUID.Zero specifies all users will get the message)</param> /// <param name="generatingAvatarID">The avatar ID that has generated this message regardless of /// if it is a script owned by this avatar, or the avatar itself</param> /// <param name="broadcast">Whether the message will be sent regardless of distance from the sender</param> public void SimChat(string message, ChatTypeEnum type, int channel, Vector3 fromPos, string fromName, UUID fromID, UUID destID, UUID generatingAvatarID, bool broadcast) { OSChatMessage args = new OSChatMessage() { Channel = channel, DestinationUUID = destID, From = fromName, GeneratingAvatarID = generatingAvatarID, Message = message, Position = fromPos, Scene = this, SenderUUID = fromID, Type = type }; if (broadcast) { EventManager.TriggerOnChatBroadcast(this, args); } else { EventManager.TriggerOnChatFromWorld(this, args); } }
/// <summary> /// Send chat to listeners. /// </summary> /// <param name='message'></param> /// <param name='type'>/param> /// <param name='channel'></param> /// <param name='fromPos'></param> /// <param name='fromName'></param> /// <param name='fromID'></param> /// <param name='targetID'></param> /// <param name='fromAgent'></param> /// <param name='broadcast'></param> public void SimChat(byte[] message, ChatTypeEnum type, int channel, Vector3 fromPos, string fromName, UUID fromID, UUID targetID, bool fromAgent, bool broadcast) { OSChatMessage args = new OSChatMessage(); args.Message = Utils.BytesToString(message); args.Channel = channel; args.Type = type; args.Position = fromPos; args.SenderUUID = fromID; args.Scene = this; args.Destination = targetID; if (fromAgent) { ScenePresence user = GetScenePresence(fromID); if (user != null) { args.Sender = user.ControllingClient; } } else { SceneObjectPart obj = GetSceneObjectPart(fromID); args.SenderObject = obj; } args.From = fromName; //args. // m_log.DebugFormat( // "[SCENE]: Sending message {0} on channel {1}, type {2} from {3}, broadcast {4}", // args.Message.Replace("\n", "\\n"), args.Channel, args.Type, fromName, broadcast); if (broadcast) { EventManager.TriggerOnChatBroadcast(this, args); } else { EventManager.TriggerOnChatFromWorld(this, args); } }
protected void SimChat(byte[] message, ChatTypeEnum type, int channel, Vector3 fromPos, string fromName, UUID fromID, bool fromAgent, bool broadcast) { OSChatMessage args = new OSChatMessage(); args.Message = Utils.BytesToString(message); args.Channel = channel; args.Type = type; args.Position = fromPos; args.SenderUUID = fromID; args.Scene = this; if (fromAgent) { ScenePresence user = GetScenePresence(fromID); if (user != null) { args.Sender = user.ControllingClient; } } else { SceneObjectPart obj = GetSceneObjectPart(fromID); args.SenderObject = obj; } args.From = fromName; //args. if (broadcast) { EventManager.TriggerOnChatBroadcast(this, args); } else { EventManager.TriggerOnChatFromWorld(this, args); } }