aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r--OpenSim/Region/Environment/EstateManager.cs4
-rw-r--r--OpenSim/Region/Environment/LandManagement/Land.cs2
-rw-r--r--OpenSim/Region/Environment/Modules/ChatModule.cs12
-rw-r--r--OpenSim/Region/Environment/Scenes/Entity.cs26
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs4
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs4
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs26
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneManager.cs2
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs2
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectPart.cs4
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs101
11 files changed, 94 insertions, 93 deletions
diff --git a/OpenSim/Region/Environment/EstateManager.cs b/OpenSim/Region/Environment/EstateManager.cs
index ac710ad..8aaeace 100644
--- a/OpenSim/Region/Environment/EstateManager.cs
+++ b/OpenSim/Region/Environment/EstateManager.cs
@@ -335,7 +335,7 @@ namespace OpenSim.Region.Environment
335 335
336 for (int i = 0; i < avatars.Count; i++) 336 for (int i = 0; i < avatars.Count; i++)
337 { 337 {
338 sendRegionInfoPacket(avatars[i].ControllingClient); 338 sendRegionInfoPacket(avatars[i]._ControllingClient);
339 } 339 }
340 } 340 }
341 341
@@ -343,7 +343,7 @@ namespace OpenSim.Region.Environment
343 { 343 {
344 m_scene.ForEachScenePresence( delegate( ScenePresence scenePresence ) 344 m_scene.ForEachScenePresence( delegate( ScenePresence scenePresence )
345 { 345 {
346 sendRegionHandshake(scenePresence.ControllingClient); 346 sendRegionHandshake(scenePresence._ControllingClient);
347 }); 347 });
348 } 348 }
349 349
diff --git a/OpenSim/Region/Environment/LandManagement/Land.cs b/OpenSim/Region/Environment/LandManagement/Land.cs
index 6c177cd..0ec77c5 100644
--- a/OpenSim/Region/Environment/LandManagement/Land.cs
+++ b/OpenSim/Region/Environment/LandManagement/Land.cs
@@ -203,7 +203,7 @@ namespace OpenSim.Region.Environment.LandManagement
203 (int) Math.Round(avatars[i].AbsolutePosition.Y)); 203 (int) Math.Round(avatars[i].AbsolutePosition.Y));
204 if (over.landData.localID == landData.localID) 204 if (over.landData.localID == landData.localID)
205 { 205 {
206 sendLandProperties(0, false, 0, avatars[i].ControllingClient); 206 sendLandProperties(0, false, 0, avatars[i]._ControllingClient);
207 } 207 }
208 } 208 }
209 } 209 }
diff --git a/OpenSim/Region/Environment/Modules/ChatModule.cs b/OpenSim/Region/Environment/Modules/ChatModule.cs
index dfbb2bb..d19bae5 100644
--- a/OpenSim/Region/Environment/Modules/ChatModule.cs
+++ b/OpenSim/Region/Environment/Modules/ChatModule.cs
@@ -124,7 +124,7 @@ namespace OpenSim.Region.Environment.Modules
124 string mess = inputLine.Substring(inputLine.IndexOf(m_channel)); 124 string mess = inputLine.Substring(inputLine.IndexOf(m_channel));
125 m_scene.ForEachScenePresence(delegate(ScenePresence presence) 125 m_scene.ForEachScenePresence(delegate(ScenePresence presence)
126 { 126 {
127 presence.ControllingClient.SendChatMessage( 127 presence._ControllingClient.SendChatMessage(
128 Helpers.StringToField(mess), 255, pos, "IRC:", 128 Helpers.StringToField(mess), 255, pos, "IRC:",
129 LLUUID.Zero); 129 LLUUID.Zero);
130 }); 130 });
@@ -159,7 +159,7 @@ namespace OpenSim.Region.Environment.Modules
159 int dis = -1000; 159 int dis = -1000;
160 160
161 //err ??? the following code seems to be request a scenePresence when it already has a ref to it 161 //err ??? the following code seems to be request a scenePresence when it already has a ref to it
162 avatar = m_scene.GetScenePresence(presence.ControllingClient.AgentId); 162 avatar = m_scene.GetScenePresence(presence._ControllingClient.AgentId);
163 if (avatar != null) 163 if (avatar != null)
164 { 164 {
165 dis = (int) avatar.AbsolutePosition.GetDistanceTo(fromPos); 165 dis = (int) avatar.AbsolutePosition.GetDistanceTo(fromPos);
@@ -171,7 +171,7 @@ namespace OpenSim.Region.Environment.Modules
171 if ((dis < 10) && (dis > -10)) 171 if ((dis < 10) && (dis > -10))
172 { 172 {
173 //should change so the message is sent through the avatar rather than direct to the ClientView 173 //should change so the message is sent through the avatar rather than direct to the ClientView
174 presence.ControllingClient.SendChatMessage(message, 174 presence._ControllingClient.SendChatMessage(message,
175 type, 175 type,
176 fromPos, 176 fromPos,
177 fromName, 177 fromName,
@@ -182,7 +182,7 @@ namespace OpenSim.Region.Environment.Modules
182 if ((dis < 30) && (dis > -30)) 182 if ((dis < 30) && (dis > -30))
183 { 183 {
184 //Console.WriteLine("sending chat"); 184 //Console.WriteLine("sending chat");
185 presence.ControllingClient.SendChatMessage(message, 185 presence._ControllingClient.SendChatMessage(message,
186 type, 186 type,
187 fromPos, 187 fromPos,
188 fromName, 188 fromName,
@@ -192,7 +192,7 @@ namespace OpenSim.Region.Environment.Modules
192 case 2: // Shout 192 case 2: // Shout
193 if ((dis < 100) && (dis > -100)) 193 if ((dis < 100) && (dis > -100))
194 { 194 {
195 presence.ControllingClient.SendChatMessage(message, 195 presence._ControllingClient.SendChatMessage(message,
196 type, 196 type,
197 fromPos, 197 fromPos,
198 fromName, 198 fromName,
@@ -201,7 +201,7 @@ namespace OpenSim.Region.Environment.Modules
201 break; 201 break;
202 202
203 case 0xff: // Broadcast 203 case 0xff: // Broadcast
204 presence.ControllingClient.SendChatMessage(message, type, 204 presence._ControllingClient.SendChatMessage(message, type,
205 fromPos, 205 fromPos,
206 fromName, 206 fromName,
207 fromAgentID); 207 fromAgentID);
diff --git a/OpenSim/Region/Environment/Scenes/Entity.cs b/OpenSim/Region/Environment/Scenes/Entity.cs
index b67e816..49802ac 100644
--- a/OpenSim/Region/Environment/Scenes/Entity.cs
+++ b/OpenSim/Region/Environment/Scenes/Entity.cs
@@ -33,7 +33,7 @@ namespace OpenSim.Region.Environment.Scenes
33{ 33{
34 public abstract class Entity : EntityBase //this class (Entity) will be phased out 34 public abstract class Entity : EntityBase //this class (Entity) will be phased out
35 { 35 {
36 protected PhysicsActor _physActor; 36 protected PhysicsActor m_physicsActor;
37 37
38 /// <summary> 38 /// <summary>
39 /// 39 ///
@@ -42,24 +42,24 @@ namespace OpenSim.Region.Environment.Scenes
42 { 42 {
43 get 43 get
44 { 44 {
45 if (_physActor != null) 45 if (m_physicsActor != null)
46 { 46 {
47 m_pos.X = _physActor.Position.X; 47 m_pos.X = m_physicsActor.Position.X;
48 m_pos.Y = _physActor.Position.Y; 48 m_pos.Y = m_physicsActor.Position.Y;
49 m_pos.Z = _physActor.Position.Z; 49 m_pos.Z = m_physicsActor.Position.Z;
50 } 50 }
51 51
52 return m_pos; 52 return m_pos;
53 } 53 }
54 set 54 set
55 { 55 {
56 if (_physActor != null) 56 if (m_physicsActor != null)
57 { 57 {
58 try 58 try
59 { 59 {
60 lock (m_scene.SyncRoot) 60 lock (m_scene.SyncRoot)
61 { 61 {
62 _physActor.Position = new PhysicsVector(value.X, value.Y, value.Z); 62 m_physicsActor.Position = new PhysicsVector(value.X, value.Y, value.Z);
63 } 63 }
64 } 64 }
65 catch (Exception e) 65 catch (Exception e)
@@ -80,24 +80,24 @@ namespace OpenSim.Region.Environment.Scenes
80 { 80 {
81 get 81 get
82 { 82 {
83 if (_physActor != null) 83 if (m_physicsActor != null)
84 { 84 {
85 m_velocity.X = _physActor.Velocity.X; 85 m_velocity.X = m_physicsActor.Velocity.X;
86 m_velocity.Y = _physActor.Velocity.Y; 86 m_velocity.Y = m_physicsActor.Velocity.Y;
87 m_velocity.Z = _physActor.Velocity.Z; 87 m_velocity.Z = m_physicsActor.Velocity.Z;
88 } 88 }
89 89
90 return m_velocity; 90 return m_velocity;
91 } 91 }
92 set 92 set
93 { 93 {
94 if (_physActor != null) 94 if (m_physicsActor != null)
95 { 95 {
96 try 96 try
97 { 97 {
98 lock (m_scene.SyncRoot) 98 lock (m_scene.SyncRoot)
99 { 99 {
100 _physActor.Velocity = new PhysicsVector(value.X, value.Y, value.Z); 100 m_physicsActor.Velocity = new PhysicsVector(value.X, value.Y, value.Z);
101 } 101 }
102 } 102 }
103 catch (Exception e) 103 catch (Exception e)
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index a6e47f3..b0e2b80 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -21,7 +21,7 @@ namespace OpenSim.Region.Environment.Scenes
21 21
22 if ( TryGetAvatar( avatarId, out avatar )) 22 if ( TryGetAvatar( avatarId, out avatar ))
23 { 23 {
24 AddInventoryItem(avatar.ControllingClient, item); 24 AddInventoryItem(avatar._ControllingClient, item);
25 } 25 }
26 } 26 }
27 27
@@ -41,7 +41,7 @@ namespace OpenSim.Region.Environment.Scenes
41 41
42 if (TryGetAvatar(avatarId, out avatar)) 42 if (TryGetAvatar(avatarId, out avatar))
43 { 43 {
44 return CapsUpdateInventoryItemAsset(avatar.ControllingClient, itemID, data); 44 return CapsUpdateInventoryItemAsset(avatar._ControllingClient, itemID, data);
45 } 45 }
46 46
47 return LLUUID.Zero; 47 return LLUUID.Zero;
diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
index 91b9634..53da016 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
@@ -77,7 +77,7 @@ namespace OpenSim.Region.Environment.Scenes
77 ScenePresence fromAvatar = m_scenePresences[fromAgentID]; 77 ScenePresence fromAvatar = m_scenePresences[fromAgentID];
78 ScenePresence toAvatar = m_scenePresences[toAgentID]; 78 ScenePresence toAvatar = m_scenePresences[toAgentID];
79 string fromName = fromAvatar.Firstname + " " + fromAvatar.Lastname; 79 string fromName = fromAvatar.Firstname + " " + fromAvatar.Lastname;
80 toAvatar.ControllingClient.SendInstantMessage(fromAgentID, fromAgentSession, message, toAgentID, 80 toAvatar._ControllingClient.SendInstantMessage(fromAgentID, fromAgentSession, message, toAgentID,
81 imSessionID, fromName, dialog, timestamp); 81 imSessionID, fromName, dialog, timestamp);
82 } 82 }
83 else 83 else
@@ -508,7 +508,7 @@ namespace OpenSim.Region.Environment.Scenes
508 { 508 {
509 ForEachScenePresence(delegate(ScenePresence presence) 509 ForEachScenePresence(delegate(ScenePresence presence)
510 { 510 {
511 presence.ControllingClient.SendAnimation(animID, seq, client.AgentId); 511 presence._ControllingClient.SendAnimation(animID, seq, client.AgentId);
512 }); 512 });
513 } 513 }
514 514
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index e683bce..5b08155 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -310,7 +310,7 @@ namespace OpenSim.Region.Environment.Scenes
310 { 310 {
311 if (Terrain.Tainted(x * 16, y * 16)) 311 if (Terrain.Tainted(x * 16, y * 16))
312 { 312 {
313 SendLayerData(x, y, presence.ControllingClient, 313 SendLayerData(x, y, presence._ControllingClient,
314 terData); 314 terData);
315 } 315 }
316 } 316 }
@@ -344,7 +344,7 @@ namespace OpenSim.Region.Environment.Scenes
344 List<ScenePresence> avatars = GetAvatars(); 344 List<ScenePresence> avatars = GetAvatars();
345 foreach (ScenePresence avatar in avatars) 345 foreach (ScenePresence avatar in avatars)
346 { 346 {
347 avatar.ControllingClient.SendViewerTime(m_timePhase); 347 avatar._ControllingClient.SendViewerTime(m_timePhase);
348 } 348 }
349 349
350 m_timeUpdateCount = 0; 350 m_timeUpdateCount = 0;
@@ -396,7 +396,7 @@ namespace OpenSim.Region.Environment.Scenes
396 396
397 storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD()); 397 storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD());
398 398
399 ForEachScenePresence(delegate(ScenePresence presence) { SendLayerData(presence.ControllingClient); }); 399 ForEachScenePresence(delegate(ScenePresence presence) { SendLayerData(presence._ControllingClient); });
400 400
401 foreach (LLUUID UUID in Entities.Keys) 401 foreach (LLUUID UUID in Entities.Keys)
402 { 402 {
@@ -424,7 +424,7 @@ namespace OpenSim.Region.Environment.Scenes
424 } 424 }
425 storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD()); 425 storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD());
426 426
427 ForEachScenePresence(delegate(ScenePresence presence) { SendLayerData(presence.ControllingClient); }); 427 ForEachScenePresence(delegate(ScenePresence presence) { SendLayerData(presence._ControllingClient); });
428 428
429 foreach (LLUUID UUID in Entities.Keys) 429 foreach (LLUUID UUID in Entities.Keys)
430 { 430 {
@@ -829,10 +829,10 @@ namespace OpenSim.Region.Environment.Scenes
829 delegate(ScenePresence presence) 829 delegate(ScenePresence presence)
830 { 830 {
831 presence.CoarseLocationChange(avatar); 831 presence.CoarseLocationChange(avatar);
832 presence.ControllingClient.SendKillObject(avatar.RegionHandle, avatar.LocalId); 832 presence._ControllingClient.SendKillObject(avatar.RegionHandle, avatar.LocalId);
833 if (presence.PhysActor != null) 833 if (presence.PhysicsActor != null)
834 { 834 {
835 phyScene.RemoveAvatar(presence.PhysActor); 835 phyScene.RemoveAvatar(presence.PhysicsActor);
836 } 836 }
837 }); 837 });
838 838
@@ -953,7 +953,7 @@ namespace OpenSim.Region.Environment.Scenes
953 { 953 {
954 ForEachScenePresence(delegate(ScenePresence presence) 954 ForEachScenePresence(delegate(ScenePresence presence)
955 { 955 {
956 presence.ControllingClient.SendKillObject(m_regionHandle, localID); 956 presence._ControllingClient.SendKillObject(m_regionHandle, localID);
957 }); 957 });
958 } 958 }
959 959
@@ -1181,7 +1181,7 @@ namespace OpenSim.Region.Environment.Scenes
1181 { 1181 {
1182 if (m_scenePresences.ContainsKey(avatarID)) 1182 if (m_scenePresences.ContainsKey(avatarID))
1183 { 1183 {
1184 m_scenePresences[avatarID].ControllingClient.SendLoadURL(objectname, objectID, ownerID, groupOwned, message, url); 1184 m_scenePresences[avatarID]._ControllingClient.SendLoadURL(objectname, objectID, ownerID, groupOwned, message, url);
1185 } 1185 }
1186 } 1186 }
1187 1187
@@ -1197,7 +1197,7 @@ namespace OpenSim.Region.Environment.Scenes
1197 { 1197 {
1198 foreach (ScenePresence presence in m_scenePresences.Values) 1198 foreach (ScenePresence presence in m_scenePresences.Values)
1199 { 1199 {
1200 presence.ControllingClient.SendAlertMessage(message); 1200 presence._ControllingClient.SendAlertMessage(message);
1201 } 1201 }
1202 } 1202 }
1203 1203
@@ -1205,7 +1205,7 @@ namespace OpenSim.Region.Environment.Scenes
1205 { 1205 {
1206 if (m_scenePresences.ContainsKey(agentID)) 1206 if (m_scenePresences.ContainsKey(agentID))
1207 { 1207 {
1208 m_scenePresences[agentID].ControllingClient.SendAgentAlertMessage(message, modal); 1208 m_scenePresences[agentID]._ControllingClient.SendAgentAlertMessage(message, modal);
1209 } 1209 }
1210 } 1210 }
1211 1211
@@ -1215,7 +1215,7 @@ namespace OpenSim.Region.Environment.Scenes
1215 { 1215 {
1216 if ((presence.Firstname == firstName) && (presence.Lastname == lastName)) 1216 if ((presence.Firstname == firstName) && (presence.Lastname == lastName))
1217 { 1217 {
1218 presence.ControllingClient.SendAgentAlertMessage(message, modal); 1218 presence._ControllingClient.SendAgentAlertMessage(message, modal);
1219 break; 1219 break;
1220 } 1220 }
1221 } 1221 }
@@ -1303,7 +1303,7 @@ namespace OpenSim.Region.Environment.Scenes
1303 scenePrescence.Firstname, 1303 scenePrescence.Firstname,
1304 scenePrescence.Lastname, 1304 scenePrescence.Lastname,
1305 scenePrescence.UUID, 1305 scenePrescence.UUID,
1306 scenePrescence.ControllingClient.AgentId, 1306 scenePrescence._ControllingClient.AgentId,
1307 "Unknown", 1307 "Unknown",
1308 "Unknown", 1308 "Unknown",
1309 RegionInfo.RegionName)); 1309 RegionInfo.RegionName));
diff --git a/OpenSim/Region/Environment/Scenes/SceneManager.cs b/OpenSim/Region/Environment/Scenes/SceneManager.cs
index a97020e..27331ee 100644
--- a/OpenSim/Region/Environment/Scenes/SceneManager.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneManager.cs
@@ -151,7 +151,7 @@ namespace OpenSim.Region.Environment.Scenes
151 scenePrescence.Firstname, scenePrescence.Lastname, 151 scenePrescence.Firstname, scenePrescence.Lastname,
152 newDebug)); 152 newDebug));
153 153
154 scenePrescence.ControllingClient.SetDebug(newDebug); 154 scenePrescence._ControllingClient.SetDebug(newDebug);
155 } 155 }
156 } 156 }
157 } 157 }
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index 890008d..d1c4ae8 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -1236,7 +1236,7 @@ namespace OpenSim.Region.Environment.Scenes
1236 List<ScenePresence> avatars = GetScenePresences(); 1236 List<ScenePresence> avatars = GetScenePresences();
1237 for (int i = 0; i < avatars.Count; i++) 1237 for (int i = 0; i < avatars.Count; i++)
1238 { 1238 {
1239 avatars[i].ControllingClient.SendKillObject(m_regionHandle, part.LocalID); 1239 avatars[i]._ControllingClient.SendKillObject(m_regionHandle, part.LocalID);
1240 } 1240 }
1241 } 1241 }
1242 } 1242 }
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
index 468def0..1b667b8 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
@@ -700,7 +700,7 @@ namespace OpenSim.Region.Environment.Scenes
700 List<ScenePresence> avatars = m_parentGroup.GetScenePresences(); 700 List<ScenePresence> avatars = m_parentGroup.GetScenePresences();
701 for (int i = 0; i < avatars.Count; i++) 701 for (int i = 0; i < avatars.Count; i++)
702 { 702 {
703 m_parentGroup.SendPartFullUpdate(avatars[i].ControllingClient, this); 703 m_parentGroup.SendPartFullUpdate(avatars[i]._ControllingClient, this);
704 } 704 }
705 } 705 }
706 706
@@ -764,7 +764,7 @@ namespace OpenSim.Region.Environment.Scenes
764 List<ScenePresence> avatars = m_parentGroup.GetScenePresences(); 764 List<ScenePresence> avatars = m_parentGroup.GetScenePresences();
765 for (int i = 0; i < avatars.Count; i++) 765 for (int i = 0; i < avatars.Count; i++)
766 { 766 {
767 m_parentGroup.SendPartTerseUpdate(avatars[i].ControllingClient, this); 767 m_parentGroup.SendPartTerseUpdate(avatars[i]._ControllingClient, this);
768 } 768 }
769 } 769 }
770 770
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index bcffe39..c75136f 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -40,10 +40,8 @@ namespace OpenSim.Region.Environment.Scenes
40{ 40{
41 public partial class ScenePresence : Entity 41 public partial class ScenePresence : Entity
42 { 42 {
43 public static bool PhysicsEngineFlying = false;
44 public static AvatarAnimations Animations; 43 public static AvatarAnimations Animations;
45 public static byte[] DefaultTexture; 44 public static byte[] DefaultTexture;
46 public IClientAPI ControllingClient;
47 public LLUUID current_anim; 45 public LLUUID current_anim;
48 public int anim_seq; 46 public int anim_seq;
49 private bool updateflag = false; 47 private bool updateflag = false;
@@ -56,8 +54,6 @@ namespace OpenSim.Region.Environment.Scenes
56 private AvatarWearable[] Wearables; 54 private AvatarWearable[] Wearables;
57 private LLObject.TextureEntry m_textureEntry; 55 private LLObject.TextureEntry m_textureEntry;
58 56
59 private ulong m_regionHandle;
60
61 public bool childAgent = true; 57 public bool childAgent = true;
62 public bool IsRestrictedToRegion = false; 58 public bool IsRestrictedToRegion = false;
63 59
@@ -105,10 +101,10 @@ namespace OpenSim.Region.Environment.Scenes
105 /// <summary> 101 /// <summary>
106 /// 102 ///
107 /// </summary> 103 /// </summary>
108 public PhysicsActor PhysActor 104 public PhysicsActor PhysicsActor
109 { 105 {
110 set { _physActor = value; } 106 set { m_physicsActor = value; }
111 get { return _physActor; } 107 get { return m_physicsActor; }
112 } 108 }
113 109
114 public bool Updated 110 public bool Updated
@@ -117,25 +113,30 @@ namespace OpenSim.Region.Environment.Scenes
117 get { return updateflag; } 113 get { return updateflag; }
118 } 114 }
119 115
116 private readonly ulong m_regionHandle;
120 public ulong RegionHandle 117 public ulong RegionHandle
121 { 118 {
122 get { return m_regionHandle; } 119 get { return m_regionHandle; }
123 } 120 }
124 121
125 private string m_firstname; 122 private readonly string m_firstname;
126
127 public string Firstname 123 public string Firstname
128 { 124 {
129 get { return m_firstname; } 125 get { return m_firstname; }
130 } 126 }
131 127
132 private string m_lastname; 128 private readonly string m_lastname;
133
134 public string Lastname 129 public string Lastname
135 { 130 {
136 get { return m_lastname; } 131 get { return m_lastname; }
137 } 132 }
138 133
134 private readonly IClientAPI m_controllingClient;
135 public IClientAPI _ControllingClient
136 {
137 get { return m_controllingClient; }
138 }
139
139 #endregion 140 #endregion
140 141
141 #region Constructor(s) 142 #region Constructor(s)
@@ -143,23 +144,23 @@ namespace OpenSim.Region.Environment.Scenes
143 /// <summary> 144 /// <summary>
144 /// 145 ///
145 /// </summary> 146 /// </summary>
146 /// <param name="theClient"></param> 147 /// <param name="client"></param>
147 /// <param name="world"></param> 148 /// <param name="world"></param>
148 /// <param name="clientThreads"></param> 149 /// <param name="clientThreads"></param>
149 /// <param name="regionDat"></param> 150 /// <param name="regionDat"></param>
150 public ScenePresence(IClientAPI theClient, Scene world, RegionInfo reginfo) 151 public ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo)
151 { 152 {
152 m_scene = world; 153 m_scene = world;
153 m_uuid = theClient.AgentId; 154 m_uuid = client.AgentId;
154 155
155 m_regionInfo = reginfo; 156 m_regionInfo = reginfo;
156 m_regionHandle = reginfo.RegionHandle; 157 m_regionHandle = reginfo.RegionHandle;
157 MainLog.Instance.Verbose("Avatar.cs "); 158 MainLog.Instance.Verbose("Avatar.cs ");
158 ControllingClient = theClient; 159 m_controllingClient = client;
159 m_firstname = ControllingClient.FirstName; 160 m_firstname = m_controllingClient.FirstName;
160 m_lastname = ControllingClient.LastName; 161 m_lastname = m_controllingClient.LastName;
161 m_localId = m_scene.NextLocalId; 162 m_localId = m_scene.NextLocalId;
162 AbsolutePosition = ControllingClient.StartPos; 163 AbsolutePosition = m_controllingClient.StartPos;
163 164
164 visualParams = new byte[218]; 165 visualParams = new byte[218];
165 for (int i = 0; i < 218; i++) 166 for (int i = 0; i < 218; i++)
@@ -172,11 +173,11 @@ namespace OpenSim.Region.Environment.Scenes
172 Animations.LoadAnims(); 173 Animations.LoadAnims();
173 174
174 //register for events 175 //register for events
175 ControllingClient.OnRequestWearables += SendOurAppearance; 176 m_controllingClient.OnRequestWearables += SendOurAppearance;
176 ControllingClient.OnSetAppearance += new SetAppearance(SetAppearance); 177 m_controllingClient.OnSetAppearance += new SetAppearance(SetAppearance);
177 ControllingClient.OnCompleteMovementToRegion += CompleteMovement; 178 m_controllingClient.OnCompleteMovementToRegion += CompleteMovement;
178 ControllingClient.OnCompleteMovementToRegion += SendInitialData; 179 m_controllingClient.OnCompleteMovementToRegion += SendInitialData;
179 ControllingClient.OnAgentUpdate += HandleAgentUpdate; 180 m_controllingClient.OnAgentUpdate += HandleAgentUpdate;
180 // ControllingClient.OnStartAnim += new StartAnim(this.SendAnimPack); 181 // ControllingClient.OnStartAnim += new StartAnim(this.SendAnimPack);
181 // ControllingClient.OnChildAgentStatus += new StatusChange(this.ChildStatusChange); 182 // ControllingClient.OnChildAgentStatus += new StatusChange(this.ChildStatusChange);
182 //ControllingClient.OnStopMovement += new GenericCall2(this.StopMovement); 183 //ControllingClient.OnStopMovement += new GenericCall2(this.StopMovement);
@@ -221,7 +222,7 @@ namespace OpenSim.Region.Environment.Scenes
221 while (terse) 222 while (terse)
222 { 223 {
223 SceneObjectPart part = m_tersePartUpdates.Dequeue(); 224 SceneObjectPart part = m_tersePartUpdates.Dequeue();
224 part.SendTerseUpdate(ControllingClient); 225 part.SendTerseUpdate(m_controllingClient);
225 terseCount++; 226 terseCount++;
226 227
227 if ((m_tersePartUpdates.Count < 1) | (terseCount > 30)) 228 if ((m_tersePartUpdates.Count < 1) | (terseCount > 30))
@@ -238,7 +239,7 @@ namespace OpenSim.Region.Environment.Scenes
238 while (full) 239 while (full)
239 { 240 {
240 SceneObjectPart part = m_fullPartUpdates.Dequeue(); 241 SceneObjectPart part = m_fullPartUpdates.Dequeue();
241 part.SendFullUpdate(ControllingClient); 242 part.SendFullUpdate(m_controllingClient);
242 fullCount++; 243 fullCount++;
243 if ((m_fullPartUpdates.Count < 1) | (fullCount > 40)) 244 if ((m_fullPartUpdates.Count < 1) | (fullCount > 40))
244 { 245 {
@@ -273,7 +274,7 @@ namespace OpenSim.Region.Environment.Scenes
273 AbsolutePosition = pos; 274 AbsolutePosition = pos;
274 275
275 AddToPhysicalScene( ); 276 AddToPhysicalScene( );
276 _physActor.Flying = isFlying; 277 m_physicsActor.Flying = isFlying;
277 278
278 279
279 m_scene.SendAllSceneObjectsToClient(this); 280 m_scene.SendAllSceneObjectsToClient(this);
@@ -291,7 +292,7 @@ namespace OpenSim.Region.Environment.Scenes
291 292
292 private void RemoveFromPhysicalScene() 293 private void RemoveFromPhysicalScene()
293 { 294 {
294 m_scene.PhysScene.RemoveAvatar( this.PhysActor ); 295 m_scene.PhysScene.RemoveAvatar( this.PhysicsActor );
295 } 296 }
296 297
297 /// <summary> 298 /// <summary>
@@ -343,7 +344,7 @@ namespace OpenSim.Region.Environment.Scenes
343 { 344 {
344 look = new LLVector3(0.99f, 0.042f, 0); 345 look = new LLVector3(0.99f, 0.042f, 0);
345 } 346 }
346 ControllingClient.MoveAgentIntoRegion(m_regionInfo, AbsolutePosition, look); 347 m_controllingClient.MoveAgentIntoRegion(m_regionInfo, AbsolutePosition, look);
347 if (childAgent) 348 if (childAgent)
348 { 349 {
349 childAgent = false; 350 childAgent = false;
@@ -364,9 +365,9 @@ namespace OpenSim.Region.Environment.Scenes
364 bool DCFlagKeyPressed = false; 365 bool DCFlagKeyPressed = false;
365 Vector3 agent_control_v3 = new Vector3(0, 0, 0); 366 Vector3 agent_control_v3 = new Vector3(0, 0, 0);
366 Quaternion q = new Quaternion(bodyRotation.W, bodyRotation.X, bodyRotation.Y, bodyRotation.Z); 367 Quaternion q = new Quaternion(bodyRotation.W, bodyRotation.X, bodyRotation.Y, bodyRotation.Z);
367 bool oldflying = PhysActor.Flying; 368 bool oldflying = PhysicsActor.Flying;
368 PhysActor.Flying = ((flags & (uint) MainAvatar.ControlFlags.AGENT_CONTROL_FLY) != 0); 369 PhysicsActor.Flying = ((flags & (uint) MainAvatar.ControlFlags.AGENT_CONTROL_FLY) != 0);
369 if (PhysActor.Flying != oldflying) 370 if (PhysicsActor.Flying != oldflying)
370 { 371 {
371 update_movementflag = true; 372 update_movementflag = true;
372 } 373 }
@@ -411,7 +412,7 @@ namespace OpenSim.Region.Environment.Scenes
411 { 412 {
412 if (movementflag != 0) 413 if (movementflag != 0)
413 { 414 {
414 if (_physActor.Flying) 415 if (m_physicsActor.Flying)
415 { 416 {
416 SendAnimPack(Animations.AnimsLLUUID["FLY"], 1); 417 SendAnimPack(Animations.AnimsLLUUID["FLY"], 1);
417 } 418 }
@@ -435,7 +436,7 @@ namespace OpenSim.Region.Environment.Scenes
435 direc.Normalize(); 436 direc.Normalize();
436 437
437 direc = direc*((0.03f)*128f); 438 direc = direc*((0.03f)*128f);
438 if (_physActor.Flying) 439 if (m_physicsActor.Flying)
439 direc *= 4; 440 direc *= 4;
440 441
441 newVelocity.X = direc.x; 442 newVelocity.X = direc.x;
@@ -528,7 +529,7 @@ namespace OpenSim.Region.Environment.Scenes
528 { 529 {
529 m_scene.ForEachScenePresence(delegate(ScenePresence presence) 530 m_scene.ForEachScenePresence(delegate(ScenePresence presence)
530 { 531 {
531 SendTerseUpdateToClient(presence.ControllingClient); 532 SendTerseUpdateToClient(presence.m_controllingClient);
532 }); 533 });
533 } 534 }
534 535
@@ -545,7 +546,7 @@ namespace OpenSim.Region.Environment.Scenes
545 } 546 }
546 } 547 }
547 548
548 ControllingClient.SendCoarseLocationUpdate(CoarseLocations); 549 m_controllingClient.SendCoarseLocationUpdate(CoarseLocations);
549 } 550 }
550 551
551 public void CoarseLocationChange(ScenePresence avatar) 552 public void CoarseLocationChange(ScenePresence avatar)
@@ -571,7 +572,7 @@ namespace OpenSim.Region.Environment.Scenes
571 /// <param name="remoteAvatar"></param> 572 /// <param name="remoteAvatar"></param>
572 public void SendFullUpdateToOtherClient(ScenePresence remoteAvatar) 573 public void SendFullUpdateToOtherClient(ScenePresence remoteAvatar)
573 { 574 {
574 remoteAvatar.ControllingClient.SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_uuid, 575 remoteAvatar.m_controllingClient.SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_uuid,
575 LocalId, AbsolutePosition, m_textureEntry.ToBytes()); 576 LocalId, AbsolutePosition, m_textureEntry.ToBytes());
576 } 577 }
577 578
@@ -597,11 +598,11 @@ namespace OpenSim.Region.Environment.Scenes
597 /// </summary> 598 /// </summary>
598 public void SendInitialData() 599 public void SendInitialData()
599 { 600 {
600 ControllingClient.SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_uuid, LocalId, 601 m_controllingClient.SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_uuid, LocalId,
601 AbsolutePosition, m_textureEntry.ToBytes()); 602 AbsolutePosition, m_textureEntry.ToBytes());
602 if (!childAgent) 603 if (!childAgent)
603 { 604 {
604 m_scene.InformClientOfNeighbours(ControllingClient); 605 m_scene.InformClientOfNeighbours(m_controllingClient);
605 newAvatar = false; 606 newAvatar = false;
606 } 607 }
607 608
@@ -615,13 +616,13 @@ namespace OpenSim.Region.Environment.Scenes
615 /// <param name="OurClient"></param> 616 /// <param name="OurClient"></param>
616 public void SendOurAppearance(IClientAPI OurClient) 617 public void SendOurAppearance(IClientAPI OurClient)
617 { 618 {
618 ControllingClient.SendWearables(Wearables); 619 m_controllingClient.SendWearables(Wearables);
619 620
620 //this.SendFullUpdateToAllClients(); 621 //this.SendFullUpdateToAllClients();
621 //this.SendArrearanceToAllOtherAgents(); 622 //this.SendArrearanceToAllOtherAgents();
622 623
623 m_scene.SendAllSceneObjectsToClient(this); 624 m_scene.SendAllSceneObjectsToClient(this);
624 ControllingClient.SendViewerTime(m_scene.TimePhase); 625 m_controllingClient.SendViewerTime(m_scene.TimePhase);
625 626
626 //Please don't remove the following code (at least not yet), just leave it commented out 627 //Please don't remove the following code (at least not yet), just leave it commented out
627 //gives the user god powers, should help with debuging things in the future 628 //gives the user god powers, should help with debuging things in the future
@@ -651,7 +652,7 @@ namespace OpenSim.Region.Environment.Scenes
651 /// <param name="avatarInfo"></param> 652 /// <param name="avatarInfo"></param>
652 public void SendAppearanceToOtherAgent(ScenePresence avatarInfo) 653 public void SendAppearanceToOtherAgent(ScenePresence avatarInfo)
653 { 654 {
654 avatarInfo.ControllingClient.SendAppearance(ControllingClient.AgentId, visualParams, 655 avatarInfo.m_controllingClient.SendAppearance(m_controllingClient.AgentId, visualParams,
655 m_textureEntry.ToBytes()); 656 m_textureEntry.ToBytes());
656 } 657 }
657 658
@@ -667,8 +668,8 @@ namespace OpenSim.Region.Environment.Scenes
667 668
668 m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence) 669 m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence)
669 { 670 {
670 scenePresence.ControllingClient.SendAnimation(animID, seq, 671 scenePresence.m_controllingClient.SendAnimation(animID, seq,
671 ControllingClient.AgentId); 672 m_controllingClient.AgentId);
672 }); 673 });
673 } 674 }
674 675
@@ -691,7 +692,7 @@ namespace OpenSim.Region.Environment.Scenes
691 posLastSignificantMove = AbsolutePosition; 692 posLastSignificantMove = AbsolutePosition;
692 if (OnSignificantClientMovement != null) 693 if (OnSignificantClientMovement != null)
693 { 694 {
694 OnSignificantClientMovement(ControllingClient); 695 OnSignificantClientMovement(m_controllingClient);
695 NotifyMyCoarseLocationChange(); 696 NotifyMyCoarseLocationChange();
696 } 697 }
697 } 698 }
@@ -762,14 +763,14 @@ namespace OpenSim.Region.Environment.Scenes
762 if (neighbourRegion != null) 763 if (neighbourRegion != null)
763 { 764 {
764 bool res = 765 bool res =
765 m_scene.InformNeighbourOfCrossing(neighbourHandle, ControllingClient.AgentId, newpos, 766 m_scene.InformNeighbourOfCrossing(neighbourHandle, m_controllingClient.AgentId, newpos,
766 _physActor.Flying); 767 m_physicsActor.Flying);
767 if (res) 768 if (res)
768 { 769 {
769 //TODO: following line is hard coded to port 9000, really need to change this as soon as possible 770 //TODO: following line is hard coded to port 9000, really need to change this as soon as possible
770 AgentCircuitData circuitdata = ControllingClient.RequestClientInfo(); 771 AgentCircuitData circuitdata = m_controllingClient.RequestClientInfo();
771 string capsPath = Util.GetCapsURL(ControllingClient.AgentId); 772 string capsPath = Util.GetCapsURL(m_controllingClient.AgentId);
772 ControllingClient.CrossRegion(neighbourHandle, newpos, vel, neighbourRegion.ExternalEndPoint, 773 m_controllingClient.CrossRegion(neighbourHandle, newpos, vel, neighbourRegion.ExternalEndPoint,
773 capsPath); 774 capsPath);
774 MakeChildAgent(); 775 MakeChildAgent();
775 m_scene.SendKillObject(m_localId); 776 m_scene.SendKillObject(m_localId);
@@ -850,7 +851,7 @@ namespace OpenSim.Region.Environment.Scenes
850 new PhysicsVector(AbsolutePosition.X, AbsolutePosition.Y, 851 new PhysicsVector(AbsolutePosition.X, AbsolutePosition.Y,
851 AbsolutePosition.Z); 852 AbsolutePosition.Z);
852 853
853 _physActor = scene.AddAvatar(pVec); 854 m_physicsActor = scene.AddAvatar(pVec);
854 } 855 }
855 } 856 }
856} \ No newline at end of file 857} \ No newline at end of file