aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Helpers.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Helpers.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Helpers.cs45
1 files changed, 29 insertions, 16 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Helpers.cs b/OpenSim/Region/ScriptEngine/Shared/Helpers.cs
index 0108f44..9e5fb24 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Helpers.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Helpers.cs
@@ -35,6 +35,7 @@ using OpenMetaverse;
35using OpenSim.Framework; 35using OpenSim.Framework;
36using OpenSim.Region.CoreModules; 36using OpenSim.Region.CoreModules;
37using OpenSim.Region.Framework.Scenes; 37using OpenSim.Region.Framework.Scenes;
38using OpenSim.Services.Interfaces;
38using OpenSim.Region.Framework.Interfaces; 39using OpenSim.Region.Framework.Interfaces;
39 40
40namespace OpenSim.Region.ScriptEngine.Shared 41namespace OpenSim.Region.ScriptEngine.Shared
@@ -102,6 +103,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
102 Type = 0; 103 Type = 0;
103 Velocity = new LSL_Types.Vector3(); 104 Velocity = new LSL_Types.Vector3();
104 initializeSurfaceTouch(); 105 initializeSurfaceTouch();
106 Country = String.Empty;
105 } 107 }
106 108
107 public UUID Key; 109 public UUID Key;
@@ -133,6 +135,8 @@ namespace OpenSim.Region.ScriptEngine.Shared
133 private int touchFace; 135 private int touchFace;
134 public int TouchFace { get { return touchFace; } } 136 public int TouchFace { get { return touchFace; } }
135 137
138 public string Country;
139
136 // This can be done in two places including the constructor 140 // This can be done in two places including the constructor
137 // so be carefull what gets added here 141 // so be carefull what gets added here
138 private void initializeSurfaceTouch() 142 private void initializeSurfaceTouch()
@@ -180,6 +184,10 @@ namespace OpenSim.Region.ScriptEngine.Shared
180 return; 184 return;
181 185
182 Name = presence.Firstname + " " + presence.Lastname; 186 Name = presence.Firstname + " " + presence.Lastname;
187 UserAccount account = scene.UserAccountService.GetUserAccount(scene.RegionInfo.ScopeID, Key);
188 if (account != null)
189 Country = account.UserCountry;
190
183 Owner = Key; 191 Owner = Key;
184 Position = new LSL_Types.Vector3( 192 Position = new LSL_Types.Vector3(
185 presence.AbsolutePosition.X, 193 presence.AbsolutePosition.X,
@@ -195,22 +203,27 @@ namespace OpenSim.Region.ScriptEngine.Shared
195 presence.Velocity.Y, 203 presence.Velocity.Y,
196 presence.Velocity.Z); 204 presence.Velocity.Z);
197 205
198 if (presence.PresenceType != PresenceType.Npc) 206 Type = 0x01; // Avatar
199 { 207 if (presence.PresenceType == PresenceType.Npc)
200 Type = AGENT; 208 Type = 0x20;
201 } 209
202 else 210 // Cope Impl. We don't use OS_NPC.
203 { 211 //if (presence.PresenceType != PresenceType.Npc)
204 Type = OS_NPC; 212 //{
205 213 // Type = AGENT;
206 INPCModule npcModule = scene.RequestModuleInterface<INPCModule>(); 214 //}
207 INPC npcData = npcModule.GetNPC(presence.UUID, presence.Scene); 215 //else
208 216 //{
209 if (npcData.SenseAsAgent) 217 // Type = OS_NPC;
210 { 218
211 Type |= AGENT; 219 // INPCModule npcModule = scene.RequestModuleInterface<INPCModule>();
212 } 220 // INPC npcData = npcModule.GetNPC(presence.UUID, presence.Scene);
213 } 221
222 // if (npcData.SenseAsAgent)
223 // {
224 // Type |= AGENT;
225 // }
226 //}
214 227
215 if (presence.Velocity != Vector3.Zero) 228 if (presence.Velocity != Vector3.Zero)
216 Type |= ACTIVE; 229 Type |= ACTIVE;