mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 20:05:33 +08:00
use Random.Shared
This commit is contained in:
@@ -129,11 +129,10 @@ namespace OpenSim.Framework
|
||||
|
||||
private static string Boundary()
|
||||
{
|
||||
Random rnd = new Random();
|
||||
string formDataBoundary = String.Empty;
|
||||
|
||||
while (formDataBoundary.Length < 15)
|
||||
formDataBoundary = formDataBoundary + rnd.Next();
|
||||
formDataBoundary = formDataBoundary + Random.Shared.Next();
|
||||
|
||||
formDataBoundary = formDataBoundary.Substring(0, 15);
|
||||
formDataBoundary = "-----------------------------" + formDataBoundary;
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
// legacy Use Random.Shared instead
|
||||
|
||||
using System;
|
||||
|
||||
namespace OpenSim.Framework
|
||||
@@ -35,37 +37,38 @@ namespace OpenSim.Framework
|
||||
/// </summary>
|
||||
public class ThreadSafeRandom : Random
|
||||
{
|
||||
private readonly object mainLock = new();
|
||||
public ThreadSafeRandom() : base() {}
|
||||
|
||||
public ThreadSafeRandom(int seed): base (seed) {}
|
||||
|
||||
public override int Next()
|
||||
{
|
||||
lock (this)
|
||||
lock (mainLock)
|
||||
return base.Next();
|
||||
}
|
||||
|
||||
public override int Next(int maxValue)
|
||||
{
|
||||
lock (this)
|
||||
lock (mainLock)
|
||||
return base.Next(maxValue);
|
||||
}
|
||||
|
||||
public override int Next(int minValue, int maxValue)
|
||||
{
|
||||
lock (this)
|
||||
lock (mainLock)
|
||||
return base.Next(minValue, maxValue);
|
||||
}
|
||||
|
||||
public override void NextBytes(byte[] buffer)
|
||||
{
|
||||
lock (this)
|
||||
lock (mainLock)
|
||||
base.NextBytes(buffer);
|
||||
}
|
||||
|
||||
public override double NextDouble()
|
||||
{
|
||||
lock (this)
|
||||
lock (mainLock)
|
||||
return base.NextDouble();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,7 +166,6 @@ namespace OpenSim.Framework
|
||||
}
|
||||
|
||||
private static uint nextXferID = 5000;
|
||||
private static readonly Random randomClass = new ThreadSafeRandom();
|
||||
|
||||
// Get a list of invalid file characters (OS dependent)
|
||||
private static readonly string regexInvalidFileChars = $"[{new String(Path.GetInvalidFileNameChars())}]";
|
||||
@@ -412,9 +411,10 @@ namespace OpenSim.Framework
|
||||
}
|
||||
}
|
||||
|
||||
// legacy, do not use
|
||||
public static Random RandomClass
|
||||
{
|
||||
get { return randomClass; }
|
||||
get { return Random.Shared;}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
|
||||
@@ -335,7 +335,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
|
||||
if (m_dumpAssetToFile)
|
||||
{
|
||||
Util.SaveAssetToFile("updateditem" + Util.RandomClass.Next(1, 1000) + ".dat", data);
|
||||
Util.SaveAssetToFile("updateditem" + Random.Shared.Next(1, 1000) + ".dat", data);
|
||||
}
|
||||
|
||||
response.StatusCode = (int)HttpStatusCode.OK;
|
||||
@@ -417,7 +417,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
|
||||
if (m_dumpAssetToFile)
|
||||
{
|
||||
Util.SaveAssetToFile("updatedtaskscript" + Util.RandomClass.Next(1, 1000) + ".dat", data);
|
||||
Util.SaveAssetToFile("updatedtaskscript" + Random.Shared.Next(1, 1000) + ".dat", data);
|
||||
}
|
||||
|
||||
// m_log.InfoFormat("[CAPS]: TaskInventoryScriptUpdater.uploaderCaps res: {0}", res);
|
||||
|
||||
@@ -375,8 +375,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
m_ids[agentID]++;
|
||||
else
|
||||
{
|
||||
Random rnd = new Random(Environment.TickCount);
|
||||
m_ids[agentID] = rnd.Next(30000000);
|
||||
m_ids[agentID] = Random.Shared.Next(30000000);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -402,8 +401,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
m_ids[agentID] = -m_ids[agentID];
|
||||
else
|
||||
{
|
||||
Random rnd = new Random(Environment.TickCount);
|
||||
m_ids[agentID] = -rnd.Next(30000000);
|
||||
m_ids[agentID] = -Random.Shared.Next(30000000);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -417,8 +415,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
m_ids[agentID]++;
|
||||
else
|
||||
{
|
||||
Random rnd = new Random(Environment.TickCount);
|
||||
m_ids.Add(agentID, rnd.Next(30000000));
|
||||
m_ids.Add(agentID, Random.Shared.Next(30000000));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -518,8 +515,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
{
|
||||
if (element == null && negativeID)
|
||||
{
|
||||
Random rnd = new Random(Environment.TickCount);
|
||||
m_ids[pAgentId] = rnd.Next(30000000);
|
||||
m_ids[pAgentId] = Random.Shared.Next(30000000);
|
||||
}
|
||||
else
|
||||
m_ids[pAgentId] = thisID + 1;
|
||||
|
||||
@@ -105,12 +105,6 @@ namespace OpenMetaverse
|
||||
}
|
||||
|
||||
#region PacketDropDebugging
|
||||
/// <summary>
|
||||
/// For debugging purposes only... random number generator for dropping
|
||||
/// outbound packets.
|
||||
/// </summary>
|
||||
private Random m_dropRandomGenerator = new Random();
|
||||
|
||||
/// <summary>
|
||||
/// For debugging purposes only... parameters for a simplified
|
||||
/// model of packet loss with bursts, overall drop rate should
|
||||
@@ -135,7 +129,7 @@ namespace OpenMetaverse
|
||||
/// </summary>
|
||||
private bool DropOutgoingPacket()
|
||||
{
|
||||
double rnum = m_dropRandomGenerator.NextDouble();
|
||||
double rnum = Random.Shared.NextDouble();
|
||||
|
||||
// if the connection has been idle for awhile (more than m_dropResetTicks) then
|
||||
// reset the state to the default state, don't continue a burst
|
||||
|
||||
@@ -40,7 +40,6 @@ namespace OpenSim.Region.CoreModules.World.Wind.Plugins
|
||||
{
|
||||
private Vector2[] m_windSpeeds = new Vector2[16 * 16];
|
||||
private float m_strength = 1.0f;
|
||||
private Random m_rndnums = new Random(Environment.TickCount);
|
||||
|
||||
#region IPlugin Members
|
||||
|
||||
@@ -92,8 +91,8 @@ namespace OpenSim.Region.CoreModules.World.Wind.Plugins
|
||||
{
|
||||
for (int x = 0; x < 16; x++)
|
||||
{
|
||||
m_windSpeeds[y * 16 + x].X = (float)(m_rndnums.NextDouble() * 2d - 1d); // -1 to 1
|
||||
m_windSpeeds[y * 16 + x].Y = (float)(m_rndnums.NextDouble() * 2d - 1d); // -1 to 1
|
||||
m_windSpeeds[y * 16 + x].X = (float)(Random.Shared.NextDouble() * 2d - 1d); // -1 to 1
|
||||
m_windSpeeds[y * 16 + x].Y = (float)(Random.Shared.NextDouble() * 2d - 1d); // -1 to 1
|
||||
m_windSpeeds[y * 16 + x].X *= m_strength;
|
||||
m_windSpeeds[y * 16 + x].Y *= m_strength;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace OpenSim.Region.CoreModules
|
||||
private uint m_frame = 0;
|
||||
private int m_dataVersion = 0;
|
||||
private int m_frameUpdateRate = 150;
|
||||
//private Random m_rndnums = new Random(Environment.TickCount);
|
||||
|
||||
private Scene m_scene = null;
|
||||
private bool m_ready = false;
|
||||
private bool m_inUpdate = false;
|
||||
|
||||
@@ -167,19 +167,19 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||
Joints[0].Priority = 7;
|
||||
Joints[0].positionkeys = new binBVHJointKey[1];
|
||||
Joints[0].rotationkeys = new binBVHJointKey[1];
|
||||
Random rnd = new Random();
|
||||
|
||||
|
||||
Joints[0].rotationkeys[0] = new binBVHJointKey();
|
||||
Joints[0].rotationkeys[0].time = (0f);
|
||||
Joints[0].rotationkeys[0].key_element.X = ((float)rnd.NextDouble() * 2 - 1);
|
||||
Joints[0].rotationkeys[0].key_element.Y = ((float)rnd.NextDouble() * 2 - 1);
|
||||
Joints[0].rotationkeys[0].key_element.Z = ((float)rnd.NextDouble() * 2 - 1);
|
||||
Joints[0].rotationkeys[0].key_element.X = ((float)Random.Shared.NextDouble() * 2 - 1);
|
||||
Joints[0].rotationkeys[0].key_element.Y = ((float)Random.Shared.NextDouble() * 2 - 1);
|
||||
Joints[0].rotationkeys[0].key_element.Z = ((float)Random.Shared.NextDouble() * 2 - 1);
|
||||
|
||||
Joints[0].positionkeys[0] = new binBVHJointKey();
|
||||
Joints[0].positionkeys[0].time = (0f);
|
||||
Joints[0].positionkeys[0].key_element.X = ((float)rnd.NextDouble() * 2 - 1);
|
||||
Joints[0].positionkeys[0].key_element.Y = ((float)rnd.NextDouble() * 2 - 1);
|
||||
Joints[0].positionkeys[0].key_element.Z = ((float)rnd.NextDouble() * 2 - 1);
|
||||
Joints[0].positionkeys[0].key_element.X = ((float)Random.Shared.NextDouble() * 2 - 1);
|
||||
Joints[0].positionkeys[0].key_element.Y = ((float)Random.Shared.NextDouble() * 2 - 1);
|
||||
Joints[0].positionkeys[0].key_element.Z = ((float)Random.Shared.NextDouble() * 2 - 1);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -790,14 +790,13 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||
anim.Joints[j].Priority = 7;
|
||||
anim.Joints[j].positionkeys = new binBVHJointKey[rnditerations];
|
||||
anim.Joints[j].rotationkeys = new binBVHJointKey[rnditerations];
|
||||
Random rnd = new Random();
|
||||
for (int i = 0; i < rnditerations; i++)
|
||||
{
|
||||
anim.Joints[j].rotationkeys[i] = new binBVHJointKey();
|
||||
anim.Joints[j].rotationkeys[i].time = (i * .10f);
|
||||
anim.Joints[j].rotationkeys[i].key_element.X = ((float)rnd.NextDouble() * 2 - 1);
|
||||
anim.Joints[j].rotationkeys[i].key_element.Y = ((float)rnd.NextDouble() * 2 - 1);
|
||||
anim.Joints[j].rotationkeys[i].key_element.Z = ((float)rnd.NextDouble() * 2 - 1);
|
||||
anim.Joints[j].rotationkeys[i].key_element.X = ((float)Random.Shared.NextDouble() * 2 - 1);
|
||||
anim.Joints[j].rotationkeys[i].key_element.Y = ((float)Random.Shared.NextDouble() * 2 - 1);
|
||||
anim.Joints[j].rotationkeys[i].key_element.Z = ((float)Random.Shared.NextDouble() * 2 - 1);
|
||||
anim.Joints[j].positionkeys[i] = new binBVHJointKey();
|
||||
anim.Joints[j].positionkeys[i].time = (i * .10f);
|
||||
anim.Joints[j].positionkeys[i].key_element.X = 0;
|
||||
|
||||
@@ -146,9 +146,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
EntityBase[] entities = Entities.GetEntities();
|
||||
foreach (EntityBase ent in entities)
|
||||
{
|
||||
if (ent is SceneObjectGroup)
|
||||
if (ent is SceneObjectGroup sog)
|
||||
{
|
||||
SceneObjectGroup sog = ent as SceneObjectGroup;
|
||||
sog.CreateScriptInstances(0, false, DefaultScriptEngine, 0);
|
||||
sog.ResumeScripts();
|
||||
}
|
||||
@@ -797,10 +796,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
Normalized55FPS = true;
|
||||
SeeIntoRegion = true;
|
||||
|
||||
Random random = new();
|
||||
|
||||
m_lastAllocatedLocalId = (int)(random.NextDouble() * (uint.MaxValue / 4));
|
||||
m_lastAllocatedIntId = (int)(random.NextDouble() * (int.MaxValue / 4));
|
||||
m_lastAllocatedLocalId = (int)(Random.Shared.NextDouble() * (uint.MaxValue / 4));
|
||||
m_lastAllocatedIntId = (int)(Random.Shared.NextDouble() * (int.MaxValue / 4));
|
||||
m_authenticateHandler = authen;
|
||||
m_sceneGridService = new SceneCommunicationService();
|
||||
m_SimulationDataService = simDataService;
|
||||
@@ -6079,9 +6076,9 @@ Environment.Exit(1);
|
||||
return true;
|
||||
|
||||
// Permissions.IsAdministrator is the same as IsGod for now
|
||||
// bool isAdmin = Permissions.IsAdministrator(agentID);
|
||||
// if(isAdmin)
|
||||
// return true;
|
||||
//bool isAdmin = Permissions.IsAdministrator(agentID);
|
||||
//if(isAdmin)
|
||||
// return true;
|
||||
|
||||
// also honor estate managers access rights
|
||||
bool isManager = Permissions.IsEstateManager(agentID);
|
||||
|
||||
@@ -106,7 +106,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
else
|
||||
{
|
||||
if(EnvironmentVersion <= 0)
|
||||
EnvironmentVersion = 0x7000000 | Util.RandomClass.Next();
|
||||
EnvironmentVersion = 0x7000000 | Random.Shared.Next();
|
||||
else
|
||||
++EnvironmentVersion;
|
||||
m_environment.version = EnvironmentVersion;
|
||||
|
||||
@@ -661,7 +661,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
|
||||
|
||||
public uint CircuitCode
|
||||
{
|
||||
get { return (uint)Util.RandomClass.Next(0,int.MaxValue); }
|
||||
get { return (uint)Random.Shared.Next(0,int.MaxValue); }
|
||||
}
|
||||
|
||||
public IPEndPoint RemoteEndPoint
|
||||
|
||||
@@ -232,7 +232,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat
|
||||
// Generate an initial nickname
|
||||
|
||||
if (m_randomizeNick)
|
||||
m_nick = m_baseNick + Util.RandomClass.Next(1, 99);
|
||||
m_nick = m_baseNick + Random.Shared.Next(1, 99);
|
||||
else
|
||||
m_nick = m_baseNick;
|
||||
|
||||
@@ -673,7 +673,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat
|
||||
break;
|
||||
case "433": // Nickname in use
|
||||
// Gen a new name
|
||||
m_nick = m_baseNick + Util.RandomClass.Next(1, 99);
|
||||
m_nick = m_baseNick + Random.Shared.Next(1, 99);
|
||||
m_log.ErrorFormat("[IRC-Connector-{0}]: [{1}] IRC SERVER reports NicknameInUse, trying {2}", idn, cmd, m_nick);
|
||||
// Retry
|
||||
m_writer.WriteLine(String.Format("NICK {0}", m_nick));
|
||||
|
||||
@@ -190,7 +190,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||
}
|
||||
|
||||
agentID = npcAvatar.AgentId;
|
||||
uint circuit = (uint)Util.RandomClass.Next(0, int.MaxValue);
|
||||
uint circuit = (uint)Random.Shared.Next(0, int.MaxValue);
|
||||
npcAvatar.CircuitCode = circuit;
|
||||
|
||||
//m_log.DebugFormat(
|
||||
|
||||
@@ -698,7 +698,7 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator
|
||||
SceneObjectPart s_tree = sog.RootPart;
|
||||
if (s_tree.Scale.Z < maxscale)
|
||||
{
|
||||
ratescale = (float)Util.RandomClass.NextDouble();
|
||||
ratescale = (float)Random.Shared.NextDouble();
|
||||
if(ratescale < 0.2f)
|
||||
ratescale = 0.2f;
|
||||
s_tree.Scale += copse.m_rate * ratescale;
|
||||
@@ -727,7 +727,7 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator
|
||||
|
||||
bool low = copse.m_trees.Count < (int)(copse.m_tree_quantity * 0.8f);
|
||||
|
||||
if (!low && Util.RandomClass.NextDouble() < 0.75)
|
||||
if (!low && Random.Shared.NextDouble() < 0.75)
|
||||
return;
|
||||
|
||||
int maxbirths = (int)(copse.m_tree_quantity) - copse.m_trees.Count;
|
||||
@@ -746,7 +746,7 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator
|
||||
while(--maxbirths > 0)
|
||||
{
|
||||
if(current.Length > 1)
|
||||
i = Util.RandomClass.Next(current.Length -1);
|
||||
i = Random.Shared.Next(current.Length -1);
|
||||
|
||||
UUID tree = current[i];
|
||||
SceneObjectGroup sog = m_scene.GetSceneObjectGroup(tree);
|
||||
@@ -772,7 +772,7 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator
|
||||
if (copse.m_frozen)
|
||||
continue;
|
||||
|
||||
if (Util.RandomClass.NextDouble() < 0.25)
|
||||
if (Random.Shared.NextDouble() < 0.25)
|
||||
return;
|
||||
|
||||
int maxbdeaths = copse.m_trees.Count - (int)(copse.m_tree_quantity * .98f) ;
|
||||
@@ -787,7 +787,7 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator
|
||||
{
|
||||
int next = 0;
|
||||
if (copse.m_trees.Count > 1)
|
||||
next = Util.RandomClass.Next(copse.m_trees.Count - 1);
|
||||
next = Random.Shared.Next(copse.m_trees.Count - 1);
|
||||
UUID tree = copse.m_trees[next];
|
||||
SceneObjectGroup sog = m_scene.GetSceneObjectGroup(tree);
|
||||
if (sog != null && !sog.IsDeleted)
|
||||
@@ -796,11 +796,11 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator
|
||||
{
|
||||
odds = sog.RootPart.Scale.Z * scale;
|
||||
odds = odds * odds * odds;
|
||||
odds *= (float)Util.RandomClass.NextDouble();
|
||||
odds *= (float)Random.Shared.NextDouble();
|
||||
}
|
||||
else
|
||||
{
|
||||
odds = (float)Util.RandomClass.NextDouble();
|
||||
odds = (float)Random.Shared.NextDouble();
|
||||
odds = odds * odds * odds;
|
||||
}
|
||||
|
||||
@@ -824,15 +824,15 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator
|
||||
private void SpawnChild(Copse copse, SceneObjectPart s_tree, bool low)
|
||||
{
|
||||
Vector3 position = new Vector3();
|
||||
|
||||
|
||||
float randX = copse.m_maximum_scale.X * 1.25f;
|
||||
float randY = copse.m_maximum_scale.Y * 1.25f;
|
||||
|
||||
float r = (float)Util.RandomClass.NextDouble();
|
||||
|
||||
float r = (float)Random.Shared.NextDouble();
|
||||
randX *= 2.0f * r - 1.0f;
|
||||
position.X = s_tree.AbsolutePosition.X + (float)randX;
|
||||
|
||||
r = (float)Util.RandomClass.NextDouble();
|
||||
|
||||
r = (float)Random.Shared.NextDouble();
|
||||
randY *= 2.0f * r - 1.0f;
|
||||
position.Y = s_tree.AbsolutePosition.Y + (float)randY;
|
||||
|
||||
@@ -865,9 +865,9 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator
|
||||
try
|
||||
{
|
||||
float t;
|
||||
float r = (float)Util.RandomClass.NextDouble();
|
||||
r *= (float)Util.RandomClass.NextDouble();
|
||||
r *= (float)Util.RandomClass.NextDouble();
|
||||
float r = (float)Random.Shared.NextDouble();
|
||||
r *= (float)Random.Shared.NextDouble();
|
||||
r *= (float)Random.Shared.NextDouble();
|
||||
|
||||
t = copse.m_maximum_scale.X / copse.m_initial_scale.X;
|
||||
if(t < 1.0)
|
||||
|
||||
@@ -256,8 +256,6 @@ namespace OpenSim.Region.PhysicsModule.ODE
|
||||
/// </summary>
|
||||
private int latertickcount;
|
||||
|
||||
private Random fluidRandomizer = new Random(Environment.TickCount);
|
||||
|
||||
private uint m_regionWidth = Constants.RegionSize;
|
||||
private uint m_regionHeight = Constants.RegionSize;
|
||||
|
||||
|
||||
@@ -913,10 +913,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
public LSL_Float llFrand(double mag)
|
||||
{
|
||||
lock (Util.RandomClass)
|
||||
{
|
||||
return Util.RandomClass.NextDouble() * mag;
|
||||
}
|
||||
return Random.Shared.NextDouble() * mag;
|
||||
}
|
||||
|
||||
public LSL_Integer llFloor(double f)
|
||||
@@ -5985,12 +5982,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
public LSL_List llListRandomize(LSL_List src, int stride)
|
||||
{
|
||||
LSL_List result;
|
||||
Random rand = new Random();
|
||||
|
||||
int chunkk;
|
||||
int[] chunks;
|
||||
|
||||
|
||||
if (stride <= 0)
|
||||
{
|
||||
stride = 1;
|
||||
@@ -6015,7 +6010,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
for (int i = chunkk - 1; i > 0; i--)
|
||||
{
|
||||
// Elect an unrandomized chunk to swap
|
||||
int index = rand.Next(i + 1);
|
||||
int index = Random.Shared.Next(i + 1);
|
||||
|
||||
// and swap position with first unrandomized chunk
|
||||
int tmp = chunks[i];
|
||||
|
||||
@@ -142,7 +142,7 @@ namespace OpenSim.Services.GridService
|
||||
public GridRegion LinkRegion(UUID scopeID, string regionDescriptor)
|
||||
{
|
||||
string reason = string.Empty;
|
||||
uint xloc = Util.RegionToWorldLoc((uint)random.Next(0, Int16.MaxValue));
|
||||
uint xloc = Util.RegionToWorldLoc((uint)Random.Shared.Next(0, Int16.MaxValue));
|
||||
return TryLinkRegionToCoords(scopeID, regionDescriptor, (int)xloc, 0, out reason);
|
||||
}
|
||||
|
||||
@@ -157,7 +157,7 @@ namespace OpenSim.Services.GridService
|
||||
return null;
|
||||
}
|
||||
|
||||
int xloc = random.Next(0, short.MaxValue) << 8;
|
||||
int xloc = Random.Shared.Next(0, short.MaxValue) << 8;
|
||||
if(TryCreateLinkImpl(scopeID, xloc, 0, rurl, UUID.Zero, out GridRegion regInfo))
|
||||
return regInfo;
|
||||
return null;
|
||||
@@ -243,8 +243,6 @@ namespace OpenSim.Services.GridService
|
||||
return true;
|
||||
}
|
||||
|
||||
private static Random random = new Random();
|
||||
|
||||
// From the command line link-region (obsolete) and the map
|
||||
private GridRegion TryLinkRegionToCoords(UUID scopeID, string mapName, int xloc, int yloc, out string reason)
|
||||
{
|
||||
|
||||
@@ -888,7 +888,7 @@ namespace OpenSim.Services.LLLoginService
|
||||
if(simConnector == null)
|
||||
return null;
|
||||
|
||||
circuitCode = (uint)Util.RandomClass.Next();
|
||||
circuitCode = (uint)Random.Shared.Next();
|
||||
aCircuit = MakeAgent(destination, account, avatar, session, secureSession, circuitCode, position,
|
||||
clientIP.Address.ToString(), viewer, channel, mac, id0);
|
||||
|
||||
@@ -925,7 +925,7 @@ namespace OpenSim.Services.LLLoginService
|
||||
gatekeeper.HttpPort = (uint)port;
|
||||
gatekeeper.ServerURI = m_GatekeeperURL;
|
||||
}
|
||||
circuitCode = (uint)Util.RandomClass.Next(); ;
|
||||
circuitCode = (uint)Random.Shared.Next();
|
||||
aCircuit = MakeAgent(destination, account, avatar, session, secureSession, circuitCode, position,
|
||||
clientIP.Address.ToString(), viewer, channel, mac, id0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user