diff options
Diffstat (limited to 'OpenSim')
3 files changed, 143 insertions, 4 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index e98f0e7..8f62855 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs | |||
@@ -161,10 +161,18 @@ 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 | ||
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); | 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); |
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); | 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); |
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); | 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); |
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); | 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); |
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 | ||
168 | //bool heldTurnLeft = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_LEFT) == AgentManager.ControlFlags.AGENT_CONTROL_TURN_LEFT; | 176 | //bool heldTurnLeft = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_LEFT) == AgentManager.ControlFlags.AGENT_CONTROL_TURN_LEFT; |
169 | //bool heldTurnRight = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT) == AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT; | 177 | //bool heldTurnRight = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT) == AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT; |
170 | bool heldUp = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_UP_POS) == AgentManager.ControlFlags.AGENT_CONTROL_UP_POS; | 178 | 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 c3bc96a..f05fe59 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -173,8 +173,12 @@ 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 | ||
176 | private readonly Vector3[] Dir_Vectors = new Vector3[11]; | 177 | private readonly Vector3[] Dir_Vectors = new Vector3[11]; |
177 | private bool m_isNudging = false; | 178 | private bool m_isNudging = false; |
179 | ======= | ||
180 | private readonly Vector3[] Dir_Vectors = new Vector3[9]; | ||
181 | >>>>>>> master:OpenSim/Region/Framework/Scenes/ScenePresence.cs | ||
178 | 182 | ||
179 | // Position of agent's camera in world (region cordinates) | 183 | // Position of agent's camera in world (region cordinates) |
180 | protected Vector3 m_CameraCenter; | 184 | protected Vector3 m_CameraCenter; |
@@ -243,9 +247,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
243 | DIR_CONTROL_FLAG_UP = AgentManager.ControlFlags.AGENT_CONTROL_UP_POS, | 247 | DIR_CONTROL_FLAG_UP = AgentManager.ControlFlags.AGENT_CONTROL_UP_POS, |
244 | DIR_CONTROL_FLAG_DOWN = AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG, | 248 | DIR_CONTROL_FLAG_DOWN = AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG, |
245 | DIR_CONTROL_FLAG_FORWARD_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS, | 249 | DIR_CONTROL_FLAG_FORWARD_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS, |
250 | <<<<<<< HEAD:OpenSim/Region/Framework/Scenes/ScenePresence.cs | ||
246 | DIR_CONTROL_FLAG_BACK_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_NEG, | 251 | DIR_CONTROL_FLAG_BACK_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_NEG, |
247 | DIR_CONTROL_FLAG_LEFT_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_POS, | 252 | DIR_CONTROL_FLAG_LEFT_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_POS, |
248 | DIR_CONTROL_FLAG_RIGHT_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_NEG, | 253 | 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 | ||
249 | DIR_CONTROL_FLAG_DOWN_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_UP_NEG | 257 | DIR_CONTROL_FLAG_DOWN_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_UP_NEG |
250 | } | 258 | } |
251 | 259 | ||
@@ -727,27 +735,43 @@ namespace OpenSim.Region.Framework.Scenes | |||
727 | Dir_Vectors[3] = -Vector3.UnitY; //RIGHT | 735 | Dir_Vectors[3] = -Vector3.UnitY; //RIGHT |
728 | Dir_Vectors[4] = Vector3.UnitZ; //UP | 736 | Dir_Vectors[4] = Vector3.UnitZ; //UP |
729 | Dir_Vectors[5] = -Vector3.UnitZ; //DOWN | 737 | Dir_Vectors[5] = -Vector3.UnitZ; //DOWN |
738 | <<<<<<< HEAD:OpenSim/Region/Framework/Scenes/ScenePresence.cs | ||
730 | Dir_Vectors[6] = new Vector3(0.5f, 0f, 0f); //FORWARD_NUDGE | 739 | Dir_Vectors[6] = new Vector3(0.5f, 0f, 0f); //FORWARD_NUDGE |
731 | Dir_Vectors[7] = new Vector3(-0.5f, 0f, 0f); //BACK_NUDGE | 740 | Dir_Vectors[7] = new Vector3(-0.5f, 0f, 0f); //BACK_NUDGE |
732 | Dir_Vectors[8] = new Vector3(0f, 0.5f, 0f); //LEFT_NUDGE | 741 | Dir_Vectors[8] = new Vector3(0f, 0.5f, 0f); //LEFT_NUDGE |
733 | Dir_Vectors[9] = new Vector3(0f, -0.5f, 0f); //RIGHT_NUDGE | 742 | Dir_Vectors[9] = new Vector3(0f, -0.5f, 0f); //RIGHT_NUDGE |
734 | Dir_Vectors[10] = new Vector3(0f, 0f, -0.5f); //DOWN_Nudge | 743 | 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 | ||
735 | } | 749 | } |
736 | 750 | ||
737 | private Vector3[] GetWalkDirectionVectors() | 751 | private Vector3[] GetWalkDirectionVectors() |
738 | { | 752 | { |
753 | <<<<<<< HEAD:OpenSim/Region/Framework/Scenes/ScenePresence.cs | ||
739 | Vector3[] vector = new Vector3[11]; | 754 | Vector3[] vector = new Vector3[11]; |
755 | ======= | ||
756 | Vector3[] vector = new Vector3[9]; | ||
757 | >>>>>>> master:OpenSim/Region/Framework/Scenes/ScenePresence.cs | ||
740 | vector[0] = new Vector3(m_CameraUpAxis.Z, 0f, -m_CameraAtAxis.Z); //FORWARD | 758 | vector[0] = new Vector3(m_CameraUpAxis.Z, 0f, -m_CameraAtAxis.Z); //FORWARD |
741 | vector[1] = new Vector3(-m_CameraUpAxis.Z, 0f, m_CameraAtAxis.Z); //BACK | 759 | vector[1] = new Vector3(-m_CameraUpAxis.Z, 0f, m_CameraAtAxis.Z); //BACK |
742 | vector[2] = Vector3.UnitY; //LEFT | 760 | vector[2] = Vector3.UnitY; //LEFT |
743 | vector[3] = -Vector3.UnitY; //RIGHT | 761 | vector[3] = -Vector3.UnitY; //RIGHT |
744 | vector[4] = new Vector3(m_CameraAtAxis.Z, 0f, m_CameraUpAxis.Z); //UP | 762 | vector[4] = new Vector3(m_CameraAtAxis.Z, 0f, m_CameraUpAxis.Z); //UP |
745 | vector[5] = new Vector3(-m_CameraAtAxis.Z, 0f, -m_CameraUpAxis.Z); //DOWN | 763 | vector[5] = new Vector3(-m_CameraAtAxis.Z, 0f, -m_CameraUpAxis.Z); //DOWN |
764 | <<<<<<< HEAD:OpenSim/Region/Framework/Scenes/ScenePresence.cs | ||
746 | vector[6] = new Vector3(m_CameraUpAxis.Z, 0f, -m_CameraAtAxis.Z); //FORWARD_NUDGE | 765 | vector[6] = new Vector3(m_CameraUpAxis.Z, 0f, -m_CameraAtAxis.Z); //FORWARD_NUDGE |
747 | vector[7] = new Vector3(-m_CameraUpAxis.Z, 0f, m_CameraAtAxis.Z); //BACK_NUDGE | 766 | vector[7] = new Vector3(-m_CameraUpAxis.Z, 0f, m_CameraAtAxis.Z); //BACK_NUDGE |
748 | vector[8] = Vector3.UnitY; //LEFT_NUDGE | 767 | vector[8] = Vector3.UnitY; //LEFT_NUDGE |
749 | vector[9] = -Vector3.UnitY; //RIGHT_NUDGE | 768 | vector[9] = -Vector3.UnitY; //RIGHT_NUDGE |
750 | vector[10] = new Vector3(-m_CameraAtAxis.Z, 0f, -m_CameraUpAxis.Z); //DOWN_NUDGE | 769 | 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 | ||
751 | return vector; | 775 | return vector; |
752 | } | 776 | } |
753 | 777 | ||
@@ -1363,12 +1387,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
1363 | else | 1387 | else |
1364 | dirVectors = Dir_Vectors; | 1388 | dirVectors = Dir_Vectors; |
1365 | 1389 | ||
1390 | <<<<<<< HEAD:OpenSim/Region/Framework/Scenes/ScenePresence.cs | ||
1366 | bool[] isNudge = GetDirectionIsNudge(); | 1391 | bool[] isNudge = GetDirectionIsNudge(); |
1367 | 1392 | ||
1368 | 1393 | ||
1369 | 1394 | ||
1370 | 1395 | ||
1371 | 1396 | ||
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 | ||
1372 | foreach (Dir_ControlFlags DCF in DIR_CONTROL_FLAGS) | 1402 | foreach (Dir_ControlFlags DCF in DIR_CONTROL_FLAGS) |
1373 | { | 1403 | { |
1374 | if (((uint)flags & (uint)DCF) != 0) | 1404 | if (((uint)flags & (uint)DCF) != 0) |
@@ -1378,28 +1408,47 @@ namespace OpenSim.Region.Framework.Scenes | |||
1378 | try | 1408 | try |
1379 | { | 1409 | { |
1380 | agent_control_v3 += dirVectors[i]; | 1410 | agent_control_v3 += dirVectors[i]; |
1411 | <<<<<<< HEAD:OpenSim/Region/Framework/Scenes/ScenePresence.cs | ||
1381 | if (isNudge[i] == false) | 1412 | if (isNudge[i] == false) |
1382 | { | 1413 | { |
1383 | Nudging = false; | 1414 | Nudging = false; |
1384 | } | 1415 | } |
1416 | ======= | ||
1417 | //m_log.DebugFormat("[Motion]: {0}, {1}",i, dirVectors[i]); | ||
1418 | >>>>>>> master:OpenSim/Region/Framework/Scenes/ScenePresence.cs | ||
1385 | } | 1419 | } |
1386 | catch (IndexOutOfRangeException) | 1420 | catch (IndexOutOfRangeException) |
1387 | { | 1421 | { |
1388 | // Why did I get this? | 1422 | // Why did I get this? |
1389 | } | 1423 | } |
1390 | 1424 | ||
1391 | if ((m_movementflag & (uint)DCF) == 0) | 1425 | if ((m_movementflag & (byte)(uint)DCF) == 0) |
1392 | { | 1426 | { |
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 | } | ||
1393 | m_movementflag += (byte)(uint)DCF; | 1431 | m_movementflag += (byte)(uint)DCF; |
1394 | update_movementflag = true; | 1432 | update_movementflag = true; |
1395 | } | 1433 | } |
1396 | } | 1434 | } |
1397 | else | 1435 | else |
1398 | { | 1436 | { |
1399 | if ((m_movementflag & (uint)DCF) != 0) | 1437 | if ((m_movementflag & (byte)(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 | ||
1400 | { | 1441 | { |
1401 | m_movementflag -= (byte)(uint)DCF; | 1442 | m_movementflag -= ((byte)(uint)DCF); |
1443 | |||
1402 | update_movementflag = true; | 1444 | 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 | */ | ||
1403 | } | 1452 | } |
1404 | else | 1453 | else |
1405 | { | 1454 | { |
@@ -1540,7 +1589,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1540 | } | 1589 | } |
1541 | } | 1590 | } |
1542 | 1591 | ||
1543 | if (update_movementflag) | 1592 | if (update_movementflag && ((flags & AgentManager.ControlFlags.AGENT_CONTROL_SIT_ON_GROUND) == 0) && (m_parentID == 0)) |
1544 | Animator.UpdateMovementAnimations(); | 1593 | Animator.UpdateMovementAnimations(); |
1545 | 1594 | ||
1546 | m_scene.EventManager.TriggerOnClientMovement(this); | 1595 | m_scene.EventManager.TriggerOnClientMovement(this); |
diff --git a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs index 92f060b..1a99c83 100644 --- a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs +++ b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs | |||
@@ -88,7 +88,89 @@ 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 | { | ||
91 | RegionLoadedDoWork(scene); | 92 | 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 | } | ||
92 | } | 174 | } |
93 | 175 | ||
94 | private void RegionLoadedDoWork(Scene scene) | 176 | private void RegionLoadedDoWork(Scene scene) |