diff options
author | Melanie | 2009-12-30 20:13:18 +0000 |
---|---|---|
committer | Melanie | 2009-12-30 20:13:18 +0000 |
commit | cbe0841bc96d9ec834b06a0a012a50323698f719 (patch) | |
tree | 9639026f9ee63810209b891912dac81ee36fd69d /OpenSim | |
parent | Merge branch 'master' into careminster (diff) | |
download | opensim-SC-cbe0841bc96d9ec834b06a0a012a50323698f719.zip opensim-SC-cbe0841bc96d9ec834b06a0a012a50323698f719.tar.gz opensim-SC-cbe0841bc96d9ec834b06a0a012a50323698f719.tar.bz2 opensim-SC-cbe0841bc96d9ec834b06a0a012a50323698f719.tar.xz |
Revert "Merge branch 'master' into careminster"
This reverts commit 596af3f600462fb1e467714e5b898c10aa3d838b.
Diffstat (limited to 'OpenSim')
3 files changed, 4 insertions, 143 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index 8f62855..e98f0e7 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs | |||
@@ -161,18 +161,10 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
161 | Vector3 left = Vector3.Transform(Vector3.UnitY, rotMatrix); | 161 | Vector3 left = Vector3.Transform(Vector3.UnitY, rotMatrix); |
162 | 162 | ||
163 | // Check control flags | 163 | // Check control flags |
164 | <<<<<<< HEAD:OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs | ||
165 | bool heldForward = ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_AT_POS || (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS); | 164 | bool heldForward = ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_AT_POS || (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS); |
166 | bool heldBack = ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG || (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_NEG); | 165 | bool heldBack = ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG || (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_NEG); |
167 | bool heldLeft = ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS || (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_POS); | 166 | bool heldLeft = ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS || (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_POS); |
168 | bool heldRight = ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG || (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_NEG); | 167 | bool heldRight = ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG || (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_NEG); |
169 | ======= | ||
170 | bool heldForward = | ||
171 | (((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) || ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS)); | ||
172 | bool heldBack = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG; | ||
173 | bool heldLeft = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS; | ||
174 | bool heldRight = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG; | ||
175 | >>>>>>> master:OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs | ||
176 | //bool heldTurnLeft = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_LEFT) == AgentManager.ControlFlags.AGENT_CONTROL_TURN_LEFT; | 168 | //bool heldTurnLeft = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_LEFT) == AgentManager.ControlFlags.AGENT_CONTROL_TURN_LEFT; |
177 | //bool heldTurnRight = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT) == AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT; | 169 | //bool heldTurnRight = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT) == AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT; |
178 | bool heldUp = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_UP_POS) == AgentManager.ControlFlags.AGENT_CONTROL_UP_POS; | 170 | bool heldUp = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_UP_POS) == AgentManager.ControlFlags.AGENT_CONTROL_UP_POS; |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index f05fe59..c3bc96a 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -173,12 +173,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
173 | protected RegionInfo m_regionInfo; | 173 | protected RegionInfo m_regionInfo; |
174 | protected ulong crossingFromRegion; | 174 | protected ulong crossingFromRegion; |
175 | 175 | ||
176 | <<<<<<< HEAD:OpenSim/Region/Framework/Scenes/ScenePresence.cs | ||
177 | private readonly Vector3[] Dir_Vectors = new Vector3[11]; | 176 | private readonly Vector3[] Dir_Vectors = new Vector3[11]; |
178 | private bool m_isNudging = false; | 177 | private bool m_isNudging = false; |
179 | ======= | ||
180 | private readonly Vector3[] Dir_Vectors = new Vector3[9]; | ||
181 | >>>>>>> master:OpenSim/Region/Framework/Scenes/ScenePresence.cs | ||
182 | 178 | ||
183 | // Position of agent's camera in world (region cordinates) | 179 | // Position of agent's camera in world (region cordinates) |
184 | protected Vector3 m_CameraCenter; | 180 | protected Vector3 m_CameraCenter; |
@@ -247,13 +243,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
247 | DIR_CONTROL_FLAG_UP = AgentManager.ControlFlags.AGENT_CONTROL_UP_POS, | 243 | DIR_CONTROL_FLAG_UP = AgentManager.ControlFlags.AGENT_CONTROL_UP_POS, |
248 | DIR_CONTROL_FLAG_DOWN = AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG, | 244 | DIR_CONTROL_FLAG_DOWN = AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG, |
249 | DIR_CONTROL_FLAG_FORWARD_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS, | 245 | DIR_CONTROL_FLAG_FORWARD_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS, |
250 | <<<<<<< HEAD:OpenSim/Region/Framework/Scenes/ScenePresence.cs | ||
251 | DIR_CONTROL_FLAG_BACK_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_NEG, | 246 | DIR_CONTROL_FLAG_BACK_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_NEG, |
252 | DIR_CONTROL_FLAG_LEFT_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_POS, | 247 | DIR_CONTROL_FLAG_LEFT_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_POS, |
253 | DIR_CONTROL_FLAG_RIGHT_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_NEG, | 248 | DIR_CONTROL_FLAG_RIGHT_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_NEG, |
254 | ======= | ||
255 | DIR_CONTROL_FLAG_BACKWARD_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_NEG, | ||
256 | >>>>>>> master:OpenSim/Region/Framework/Scenes/ScenePresence.cs | ||
257 | DIR_CONTROL_FLAG_DOWN_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_UP_NEG | 249 | DIR_CONTROL_FLAG_DOWN_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_UP_NEG |
258 | } | 250 | } |
259 | 251 | ||
@@ -735,43 +727,27 @@ namespace OpenSim.Region.Framework.Scenes | |||
735 | Dir_Vectors[3] = -Vector3.UnitY; //RIGHT | 727 | Dir_Vectors[3] = -Vector3.UnitY; //RIGHT |
736 | Dir_Vectors[4] = Vector3.UnitZ; //UP | 728 | Dir_Vectors[4] = Vector3.UnitZ; //UP |
737 | Dir_Vectors[5] = -Vector3.UnitZ; //DOWN | 729 | Dir_Vectors[5] = -Vector3.UnitZ; //DOWN |
738 | <<<<<<< HEAD:OpenSim/Region/Framework/Scenes/ScenePresence.cs | ||
739 | Dir_Vectors[6] = new Vector3(0.5f, 0f, 0f); //FORWARD_NUDGE | 730 | Dir_Vectors[6] = new Vector3(0.5f, 0f, 0f); //FORWARD_NUDGE |
740 | Dir_Vectors[7] = new Vector3(-0.5f, 0f, 0f); //BACK_NUDGE | 731 | Dir_Vectors[7] = new Vector3(-0.5f, 0f, 0f); //BACK_NUDGE |
741 | Dir_Vectors[8] = new Vector3(0f, 0.5f, 0f); //LEFT_NUDGE | 732 | Dir_Vectors[8] = new Vector3(0f, 0.5f, 0f); //LEFT_NUDGE |
742 | Dir_Vectors[9] = new Vector3(0f, -0.5f, 0f); //RIGHT_NUDGE | 733 | Dir_Vectors[9] = new Vector3(0f, -0.5f, 0f); //RIGHT_NUDGE |
743 | Dir_Vectors[10] = new Vector3(0f, 0f, -0.5f); //DOWN_Nudge | 734 | Dir_Vectors[10] = new Vector3(0f, 0f, -0.5f); //DOWN_Nudge |
744 | ======= | ||
745 | Dir_Vectors[8] = new Vector3(0f, 0f, -0.5f); //DOWN_Nudge | ||
746 | Dir_Vectors[6] = Vector3.UnitX*2; //FORWARD | ||
747 | Dir_Vectors[7] = -Vector3.UnitX; //BACK | ||
748 | >>>>>>> master:OpenSim/Region/Framework/Scenes/ScenePresence.cs | ||
749 | } | 735 | } |
750 | 736 | ||
751 | private Vector3[] GetWalkDirectionVectors() | 737 | private Vector3[] GetWalkDirectionVectors() |
752 | { | 738 | { |
753 | <<<<<<< HEAD:OpenSim/Region/Framework/Scenes/ScenePresence.cs | ||
754 | Vector3[] vector = new Vector3[11]; | 739 | Vector3[] vector = new Vector3[11]; |
755 | ======= | ||
756 | Vector3[] vector = new Vector3[9]; | ||
757 | >>>>>>> master:OpenSim/Region/Framework/Scenes/ScenePresence.cs | ||
758 | vector[0] = new Vector3(m_CameraUpAxis.Z, 0f, -m_CameraAtAxis.Z); //FORWARD | 740 | vector[0] = new Vector3(m_CameraUpAxis.Z, 0f, -m_CameraAtAxis.Z); //FORWARD |
759 | vector[1] = new Vector3(-m_CameraUpAxis.Z, 0f, m_CameraAtAxis.Z); //BACK | 741 | vector[1] = new Vector3(-m_CameraUpAxis.Z, 0f, m_CameraAtAxis.Z); //BACK |
760 | vector[2] = Vector3.UnitY; //LEFT | 742 | vector[2] = Vector3.UnitY; //LEFT |
761 | vector[3] = -Vector3.UnitY; //RIGHT | 743 | vector[3] = -Vector3.UnitY; //RIGHT |
762 | vector[4] = new Vector3(m_CameraAtAxis.Z, 0f, m_CameraUpAxis.Z); //UP | 744 | vector[4] = new Vector3(m_CameraAtAxis.Z, 0f, m_CameraUpAxis.Z); //UP |
763 | vector[5] = new Vector3(-m_CameraAtAxis.Z, 0f, -m_CameraUpAxis.Z); //DOWN | 745 | vector[5] = new Vector3(-m_CameraAtAxis.Z, 0f, -m_CameraUpAxis.Z); //DOWN |
764 | <<<<<<< HEAD:OpenSim/Region/Framework/Scenes/ScenePresence.cs | ||
765 | vector[6] = new Vector3(m_CameraUpAxis.Z, 0f, -m_CameraAtAxis.Z); //FORWARD_NUDGE | 746 | vector[6] = new Vector3(m_CameraUpAxis.Z, 0f, -m_CameraAtAxis.Z); //FORWARD_NUDGE |
766 | vector[7] = new Vector3(-m_CameraUpAxis.Z, 0f, m_CameraAtAxis.Z); //BACK_NUDGE | 747 | vector[7] = new Vector3(-m_CameraUpAxis.Z, 0f, m_CameraAtAxis.Z); //BACK_NUDGE |
767 | vector[8] = Vector3.UnitY; //LEFT_NUDGE | 748 | vector[8] = Vector3.UnitY; //LEFT_NUDGE |
768 | vector[9] = -Vector3.UnitY; //RIGHT_NUDGE | 749 | vector[9] = -Vector3.UnitY; //RIGHT_NUDGE |
769 | vector[10] = new Vector3(-m_CameraAtAxis.Z, 0f, -m_CameraUpAxis.Z); //DOWN_NUDGE | 750 | vector[10] = new Vector3(-m_CameraAtAxis.Z, 0f, -m_CameraUpAxis.Z); //DOWN_NUDGE |
770 | ======= | ||
771 | vector[8] = new Vector3(-m_CameraAtAxis.Z, 0f, -m_CameraUpAxis.Z); //DOWN_Nudge | ||
772 | vector[6] = (new Vector3(m_CameraUpAxis.Z, 0f, -m_CameraAtAxis.Z) * 2); //FORWARD Nudge | ||
773 | vector[7] = new Vector3(-m_CameraUpAxis.Z, 0f, m_CameraAtAxis.Z); //BACK Nudge | ||
774 | >>>>>>> master:OpenSim/Region/Framework/Scenes/ScenePresence.cs | ||
775 | return vector; | 751 | return vector; |
776 | } | 752 | } |
777 | 753 | ||
@@ -1387,18 +1363,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
1387 | else | 1363 | else |
1388 | dirVectors = Dir_Vectors; | 1364 | dirVectors = Dir_Vectors; |
1389 | 1365 | ||
1390 | <<<<<<< HEAD:OpenSim/Region/Framework/Scenes/ScenePresence.cs | ||
1391 | bool[] isNudge = GetDirectionIsNudge(); | 1366 | bool[] isNudge = GetDirectionIsNudge(); |
1392 | 1367 | ||
1393 | 1368 | ||
1394 | 1369 | ||
1395 | 1370 | ||
1396 | 1371 | ||
1397 | ======= | ||
1398 | // The fact that m_movementflag is a byte needs to be fixed | ||
1399 | // it really should be a uint | ||
1400 | uint nudgehack = 250; | ||
1401 | >>>>>>> master:OpenSim/Region/Framework/Scenes/ScenePresence.cs | ||
1402 | foreach (Dir_ControlFlags DCF in DIR_CONTROL_FLAGS) | 1372 | foreach (Dir_ControlFlags DCF in DIR_CONTROL_FLAGS) |
1403 | { | 1373 | { |
1404 | if (((uint)flags & (uint)DCF) != 0) | 1374 | if (((uint)flags & (uint)DCF) != 0) |
@@ -1408,47 +1378,28 @@ namespace OpenSim.Region.Framework.Scenes | |||
1408 | try | 1378 | try |
1409 | { | 1379 | { |
1410 | agent_control_v3 += dirVectors[i]; | 1380 | agent_control_v3 += dirVectors[i]; |
1411 | <<<<<<< HEAD:OpenSim/Region/Framework/Scenes/ScenePresence.cs | ||
1412 | if (isNudge[i] == false) | 1381 | if (isNudge[i] == false) |
1413 | { | 1382 | { |
1414 | Nudging = false; | 1383 | Nudging = false; |
1415 | } | 1384 | } |
1416 | ======= | ||
1417 | //m_log.DebugFormat("[Motion]: {0}, {1}",i, dirVectors[i]); | ||
1418 | >>>>>>> master:OpenSim/Region/Framework/Scenes/ScenePresence.cs | ||
1419 | } | 1385 | } |
1420 | catch (IndexOutOfRangeException) | 1386 | catch (IndexOutOfRangeException) |
1421 | { | 1387 | { |
1422 | // Why did I get this? | 1388 | // Why did I get this? |
1423 | } | 1389 | } |
1424 | 1390 | ||
1425 | if ((m_movementflag & (byte)(uint)DCF) == 0) | 1391 | if ((m_movementflag & (uint)DCF) == 0) |
1426 | { | 1392 | { |
1427 | if (DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_FORWARD_NUDGE || DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_BACKWARD_NUDGE) | ||
1428 | { | ||
1429 | m_movementflag |= (byte)nudgehack; | ||
1430 | } | ||
1431 | m_movementflag += (byte)(uint)DCF; | 1393 | m_movementflag += (byte)(uint)DCF; |
1432 | update_movementflag = true; | 1394 | update_movementflag = true; |
1433 | } | 1395 | } |
1434 | } | 1396 | } |
1435 | else | 1397 | else |
1436 | { | 1398 | { |
1437 | if ((m_movementflag & (byte)(uint)DCF) != 0 || | 1399 | if ((m_movementflag & (uint)DCF) != 0) |
1438 | ((DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_FORWARD_NUDGE || DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_BACKWARD_NUDGE) | ||
1439 | && ((m_movementflag & (byte)nudgehack) == nudgehack)) | ||
1440 | ) // This or is for Nudge forward | ||
1441 | { | 1400 | { |
1442 | m_movementflag -= ((byte)(uint)DCF); | 1401 | m_movementflag -= (byte)(uint)DCF; |
1443 | |||
1444 | update_movementflag = true; | 1402 | update_movementflag = true; |
1445 | /* | ||
1446 | if ((DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_FORWARD_NUDGE || DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_BACKWARD_NUDGE) | ||
1447 | && ((m_movementflag & (byte)nudgehack) == nudgehack)) | ||
1448 | { | ||
1449 | m_log.Debug("Removed Hack flag"); | ||
1450 | } | ||
1451 | */ | ||
1452 | } | 1403 | } |
1453 | else | 1404 | else |
1454 | { | 1405 | { |
@@ -1589,7 +1540,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1589 | } | 1540 | } |
1590 | } | 1541 | } |
1591 | 1542 | ||
1592 | if (update_movementflag && ((flags & AgentManager.ControlFlags.AGENT_CONTROL_SIT_ON_GROUND) == 0) && (m_parentID == 0)) | 1543 | if (update_movementflag) |
1593 | Animator.UpdateMovementAnimations(); | 1544 | Animator.UpdateMovementAnimations(); |
1594 | 1545 | ||
1595 | m_scene.EventManager.TriggerOnClientMovement(this); | 1546 | m_scene.EventManager.TriggerOnClientMovement(this); |
diff --git a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs index 1a99c83..92f060b 100644 --- a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs +++ b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs | |||
@@ -88,89 +88,7 @@ namespace OpenSim.Region.RegionCombinerModule | |||
88 | public void RegionLoaded(Scene scene) | 88 | public void RegionLoaded(Scene scene) |
89 | { | 89 | { |
90 | if (enabledYN) | 90 | if (enabledYN) |
91 | { | ||
92 | RegionLoadedDoWork(scene); | 91 | RegionLoadedDoWork(scene); |
93 | |||
94 | scene.EventManager.OnNewPresence += NewPresence; | ||
95 | } | ||
96 | } | ||
97 | |||
98 | private void NewPresence(ScenePresence presence) | ||
99 | { | ||
100 | if (presence.IsChildAgent) | ||
101 | { | ||
102 | byte[] throttleData; | ||
103 | |||
104 | try | ||
105 | { | ||
106 | throttleData = presence.ControllingClient.GetThrottlesPacked(1); | ||
107 | } | ||
108 | catch (NotImplementedException) | ||
109 | { | ||
110 | return; | ||
111 | } | ||
112 | |||
113 | if (throttleData == null) | ||
114 | return; | ||
115 | |||
116 | if (throttleData.Length == 0) | ||
117 | return; | ||
118 | |||
119 | if (throttleData.Length != 28) | ||
120 | return; | ||
121 | |||
122 | byte[] adjData; | ||
123 | int pos = 0; | ||
124 | |||
125 | if (!BitConverter.IsLittleEndian) | ||
126 | { | ||
127 | byte[] newData = new byte[7 * 4]; | ||
128 | Buffer.BlockCopy(throttleData, 0, newData, 0, 7 * 4); | ||
129 | |||
130 | for (int i = 0; i < 7; i++) | ||
131 | Array.Reverse(newData, i * 4, 4); | ||
132 | |||
133 | adjData = newData; | ||
134 | } | ||
135 | else | ||
136 | { | ||
137 | adjData = throttleData; | ||
138 | } | ||
139 | |||
140 | // 0.125f converts from bits to bytes | ||
141 | int resend = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4; | ||
142 | int land = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4; | ||
143 | int wind = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4; | ||
144 | int cloud = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4; | ||
145 | int task = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4; | ||
146 | int texture = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4; | ||
147 | int asset = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); | ||
148 | // State is a subcategory of task that we allocate a percentage to | ||
149 | |||
150 | |||
151 | //int total = resend + land + wind + cloud + task + texture + asset; | ||
152 | |||
153 | byte[] data = new byte[7 * 4]; | ||
154 | int ii = 0; | ||
155 | |||
156 | Buffer.BlockCopy(Utils.FloatToBytes(resend), 0, data, ii, 4); ii += 4; | ||
157 | Buffer.BlockCopy(Utils.FloatToBytes(land * 50), 0, data, ii, 4); ii += 4; | ||
158 | Buffer.BlockCopy(Utils.FloatToBytes(wind), 0, data, ii, 4); ii += 4; | ||
159 | Buffer.BlockCopy(Utils.FloatToBytes(cloud), 0, data, ii, 4); ii += 4; | ||
160 | Buffer.BlockCopy(Utils.FloatToBytes(task), 0, data, ii, 4); ii += 4; | ||
161 | Buffer.BlockCopy(Utils.FloatToBytes(texture), 0, data, ii, 4); ii += 4; | ||
162 | Buffer.BlockCopy(Utils.FloatToBytes(asset), 0, data, ii, 4); | ||
163 | |||
164 | try | ||
165 | { | ||
166 | presence.ControllingClient.SetChildAgentThrottle(data); | ||
167 | } | ||
168 | catch (NotImplementedException) | ||
169 | { | ||
170 | return; | ||
171 | } | ||
172 | |||
173 | } | ||
174 | } | 92 | } |
175 | 93 | ||
176 | private void RegionLoadedDoWork(Scene scene) | 94 | private void RegionLoadedDoWork(Scene scene) |