aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs')
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs43
1 files changed, 42 insertions, 1 deletions
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs
index 34f66d8..2280022 100644
--- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs
@@ -51,6 +51,47 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
51 51
52 #region Events 52 #region Events
53 53
54 #region OnNewUser
55
56 private event OnNewUserDelegate _OnNewUser;
57 private bool _OnNewUserActive;
58
59 public event OnNewUserDelegate OnNewUser
60 {
61 add
62 {
63 if (!_OnNewUserActive)
64 {
65 _OnNewUserActive = true;
66 m_internalScene.EventManager.OnNewPresence += EventManager_OnNewPresence;
67 }
68
69 _OnNewUser += value;
70 }
71 remove
72 {
73 _OnNewUser -= value;
74
75 if (_OnNewUser == null)
76 {
77 _OnNewUserActive = false;
78 m_internalScene.EventManager.OnNewPresence -= EventManager_OnNewPresence;
79 }
80 }
81 }
82
83 void EventManager_OnNewPresence(ScenePresence presence)
84 {
85 if (_OnNewUser != null)
86 {
87 NewUserEventArgs e = new NewUserEventArgs();
88 e.Avatar = new SPAvatar(m_internalScene, presence.UUID);
89 _OnNewUser(this, e);
90 }
91 }
92
93 #endregion
94
54 #region OnChat 95 #region OnChat
55 private event OnChatDelegate _OnChat; 96 private event OnChatDelegate _OnChat;
56 private bool _OnChatActive; 97 private bool _OnChatActive;
@@ -81,7 +122,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
81 } 122 }
82 } 123 }
83 124
84 void EventManager_OnChatFromWorld(object sender, OpenSim.Framework.OSChatMessage chat) 125 void EventManager_OnChatFromWorld(object sender, OSChatMessage chat)
85 { 126 {
86 if (_OnChat != null) 127 if (_OnChat != null)
87 { 128 {