aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
diff options
context:
space:
mode:
authorMW2007-09-04 13:43:56 +0000
committerMW2007-09-04 13:43:56 +0000
commitbfd36e2e836f92539e68bba077104d5016c5bf8b (patch)
tree36491a61df9cb936500cf349fa7a1ac377b2f350 /OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
parentreverting opensim.ini to proper default state (diff)
downloadopensim-SC_OLD-bfd36e2e836f92539e68bba077104d5016c5bf8b.zip
opensim-SC_OLD-bfd36e2e836f92539e68bba077104d5016c5bf8b.tar.gz
opensim-SC_OLD-bfd36e2e836f92539e68bba077104d5016c5bf8b.tar.bz2
opensim-SC_OLD-bfd36e2e836f92539e68bba077104d5016c5bf8b.tar.xz
Some work on Module loading/management.
Some more modules templates classes (hoping that someone will pick some of these and work on implementing them). Early version of the "Dynamic Texture Module", although currently there are no render modules included (so not really functional without them). Added osSetDynamicTextureURL script function, for attaching a dynamic texture to a prim. Some work on the console command handling. Added "change-region <regionname>" and "exit-region" so that after the use of change-region, the commands entered will apply to that region only. Then use exit-region to return to the top level (so commands then function as they did before and either apply to all regions or to the first region) (Note: this hasn't been tested very much)
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs53
1 files changed, 4 insertions, 49 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
index a9ded3f..90e4a1f 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
@@ -35,6 +35,7 @@ using OpenSim.Framework.Types;
35using OpenSim.Framework.Communications.Caches; 35using OpenSim.Framework.Communications.Caches;
36using OpenSim.Framework.Data; 36using OpenSim.Framework.Data;
37using OpenSim.Framework.Utilities; 37using OpenSim.Framework.Utilities;
38using OpenSim.Region.Environment.Interfaces;
38 39
39namespace OpenSim.Region.Environment.Scenes 40namespace OpenSim.Region.Environment.Scenes
40{ 41{
@@ -94,7 +95,7 @@ namespace OpenSim.Region.Environment.Scenes
94 } 95 }
95 96
96 /// <summary> 97 /// <summary>
97 /// Should be removed soon as the Chat modules should take over this function 98 ///
98 /// </summary> 99 /// </summary>
99 /// <param name="message"></param> 100 /// <param name="message"></param>
100 /// <param name="type"></param> 101 /// <param name="type"></param>
@@ -103,56 +104,10 @@ namespace OpenSim.Region.Environment.Scenes
103 /// <param name="fromAgentID"></param> 104 /// <param name="fromAgentID"></param>
104 public void SimChat(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID) 105 public void SimChat(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID)
105 { 106 {
106 ScenePresence avatar = null; 107 if (m_simChatModule != null)
107 if (this.Avatars.ContainsKey(fromAgentID))
108 { 108 {
109 avatar = this.Avatars[fromAgentID]; 109 m_simChatModule.SimChat(message, type, fromPos, fromName, fromAgentID);
110 fromPos = avatar.AbsolutePosition;
111 fromName = avatar.Firstname + " " + avatar.Lastname;
112 avatar = null;
113 } 110 }
114
115 this.ForEachScenePresence(delegate(ScenePresence presence)
116 {
117 int dis = -1000;
118 if (this.Avatars.ContainsKey(presence.ControllingClient.AgentId))
119 {
120 avatar = this.Avatars[presence.ControllingClient.AgentId];
121 dis = (int)avatar.AbsolutePosition.GetDistanceTo(fromPos);
122 }
123
124 switch (type)
125 {
126 case 0: // Whisper
127 if ((dis < 10) && (dis > -10))
128 {
129 //should change so the message is sent through the avatar rather than direct to the ClientView
130 presence.ControllingClient.SendChatMessage(message, type, fromPos, fromName,
131 fromAgentID);
132 }
133 break;
134 case 1: // Say
135 if ((dis < 30) && (dis > -30))
136 {
137 //Console.WriteLine("sending chat");
138 presence.ControllingClient.SendChatMessage(message, type, fromPos, fromName,
139 fromAgentID);
140 }
141 break;
142 case 2: // Shout
143 if ((dis < 100) && (dis > -100))
144 {
145 presence.ControllingClient.SendChatMessage(message, type, fromPos, fromName,
146 fromAgentID);
147 }
148 break;
149
150 case 0xff: // Broadcast
151 presence.ControllingClient.SendChatMessage(message, type, fromPos, fromName,
152 fromAgentID);
153 break;
154 }
155 });
156 } 111 }
157 112
158 /// <summary> 113 /// <summary>