28 using System.Collections.Generic;
30 using OpenSim.Framework;
31 using OpenSim.Region.Framework.Interfaces;
32 using OpenSim.Region.Framework.Scenes;
33 using OpenSim.Region.OptionalModules.Scripting.Minimodule.WorldX;
35 namespace OpenSim.
Region.OptionalModules.Scripting.Minimodule
39 private readonly
Scene m_internalScene;
47 m_security = securityCredential;
48 m_internalScene = internalScene;
49 m_heights =
new Heightmap(m_internalScene);
58 private bool _OnNewUserActive;
64 if (!_OnNewUserActive)
66 _OnNewUserActive =
true;
67 m_internalScene.EventManager.OnNewPresence += EventManager_OnNewPresence;
76 if (_OnNewUser == null)
78 _OnNewUserActive =
false;
79 m_internalScene.EventManager.OnNewPresence -= EventManager_OnNewPresence;
86 if (_OnNewUser != null)
89 e.Avatar =
new SPAvatar(m_internalScene, presence.
UUID, m_security);
98 private bool _OnChatActive;
111 _OnChatActive =
true;
112 m_internalScene.EventManager.OnChatFromClient += EventManager_OnChatFromClient;
113 m_internalScene.EventManager.OnChatFromWorld += EventManager_OnChatFromWorld;
124 _OnChatActive =
false;
125 m_internalScene.EventManager.OnChatFromClient -= EventManager_OnChatFromClient;
126 m_internalScene.EventManager.OnChatFromWorld -= EventManager_OnChatFromWorld;
131 void EventManager_OnChatFromWorld(
object sender,
OSChatMessage chat)
135 HandleChatPacket(chat);
142 if (
string.IsNullOrEmpty(chat.
Message))
148 ChatEventArgs e =
new ChatEventArgs();
150 e.Text = chat.Message;
151 e.Channel = chat.Channel;
159 ChatEventArgs e =
new ChatEventArgs();
160 e.Sender =
new SPAvatar(m_internalScene, chat.
SenderUUID, m_security);
161 e.Text = chat.Message;
162 e.Channel = chat.Channel;
170 void EventManager_OnChatFromClient(
object sender,
OSChatMessage chat)
174 HandleChatPacket(chat);
182 public IObjectAccessor Objects
184 get {
return m_objs; }
191 List<ILandObject> m_los = m_internalScene.LandChannel.AllParcels();
192 List<IParcel> m_parcels =
new List<IParcel>(m_los.Count);
199 return m_parcels.ToArray();
211 for (
int i = 0; i < ents.Length; i++)
214 rets[i] =
new SPAvatar(m_internalScene, ent.
UUID, m_security);
223 get {
return m_heights; }
226 #region Implementation of IWorldAudio
228 public void PlaySound(UUID audio, Vector3 position,
double volume)
231 if (soundModule != null)
233 soundModule.TriggerSound(audio, UUID.Zero, UUID.Zero, UUID.Zero, volume, position,
234 m_internalScene.RegionInfo.RegionHandle, 0);
241 if (soundModule != null)
243 soundModule.TriggerSound(audio, UUID.Zero, UUID.Zero, UUID.Zero, 1.0, position,
244 m_internalScene.RegionInfo.RegionHandle, 0);
void PlaySound(UUID audio, Vector3 position, double volume)
IClientAPI Sender
The client responsible for sending the message, or null.
World(Scene internalScene, ISecurityCredential securityCredential)
string Message
The message sent by the user
delegate void OnChatDelegate(IWorld sender, ChatEventArgs e)
object SenderObject
The object responsible for sending the message, or null.
delegate void OnNewUserDelegate(IWorld sender, NewUserEventArgs e)
void PlaySound(UUID audio, Vector3 position)
int LocalID
Internal ID of the parcel. Sometimes the client will try to use this value