* minor: Move GetRandomCapsPath() to a CapsUtil class
parent
251387a391
commit
b1c2cb3d82
|
@ -334,14 +334,6 @@ namespace OpenSim.Framework
|
|||
return sb.ToString();
|
||||
}
|
||||
|
||||
public static string GetRandomCapsPath()
|
||||
{
|
||||
UUID caps = UUID.Random();
|
||||
string capsPath = caps.ToString();
|
||||
capsPath = capsPath.Remove(capsPath.Length - 4, 4);
|
||||
return capsPath;
|
||||
}
|
||||
|
||||
public static int fast_distance2d(int x, int y)
|
||||
{
|
||||
x = Math.Abs(x);
|
||||
|
|
|
@ -37,6 +37,7 @@ using OpenSim.Data;
|
|||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Communications;
|
||||
using OpenSim.Framework.Communications.Cache;
|
||||
using OpenSim.Framework.Communications.Capabilities;
|
||||
|
||||
namespace OpenSim.Grid.UserServer
|
||||
{
|
||||
|
@ -309,7 +310,7 @@ namespace OpenSim.Grid.UserServer
|
|||
response.RegionY = regionInfo.regionLocY;
|
||||
|
||||
//Not sure if the + "/CAPS/" should in fact be +"CAPS/" depending if there is already a / as part of httpServerURI
|
||||
string capsPath = Util.GetRandomCapsPath();
|
||||
string capsPath = CapsUtil.GetRandomCapsPath();
|
||||
response.SeedCapability = regionInfo.httpServerURI + "CAPS/" + capsPath + "0000/";
|
||||
|
||||
// Notify the target of an incoming user
|
||||
|
|
|
@ -35,6 +35,7 @@ using log4net;
|
|||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Communications;
|
||||
using OpenSim.Framework.Communications.Cache;
|
||||
using OpenSim.Framework.Communications.Capabilities;
|
||||
|
||||
namespace OpenSim.Region.Communications.Local
|
||||
{
|
||||
|
@ -295,7 +296,7 @@ namespace OpenSim.Region.Communications.Local
|
|||
response.RegionX = regionInfo.RegionLocX;
|
||||
response.RegionY = regionInfo.RegionLocY;
|
||||
|
||||
string capsPath = Util.GetRandomCapsPath();
|
||||
string capsPath = CapsUtil.GetRandomCapsPath();
|
||||
|
||||
// Don't use the following! It Fails for logging into any region not on the same port as the http server!
|
||||
// Kept here so it doesn't happen again!
|
||||
|
|
|
@ -42,6 +42,7 @@ using OpenMetaverse.Packets;
|
|||
using log4net;
|
||||
using Nini.Config;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Communications.Capabilities;
|
||||
using OpenSim.Framework.Servers;
|
||||
using OpenSim.Region.Environment.Interfaces;
|
||||
using OpenSim.Region.Environment.Scenes;
|
||||
|
@ -377,7 +378,6 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
|
|||
*/
|
||||
}
|
||||
|
||||
|
||||
public OSD RequestRezAvatarMethod(string path, OSD request)
|
||||
{
|
||||
//System.Console.WriteLine("[REQUESTREZAVATAR]: " + request.ToString());
|
||||
|
@ -468,28 +468,28 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
|
|||
// Generate a dummy agent for the user so we can get back a CAPS path
|
||||
AgentCircuitData agentData = new AgentCircuitData();
|
||||
agentData.AgentID = LocalAgentID;
|
||||
agentData.BaseFolder=UUID.Zero;
|
||||
agentData.CapsPath=Util.GetRandomCapsPath();
|
||||
agentData.BaseFolder = UUID.Zero;
|
||||
agentData.CapsPath = CapsUtil.GetRandomCapsPath();
|
||||
agentData.child = false;
|
||||
agentData.circuitcode = (uint)(Util.RandomClass.Next());
|
||||
agentData.firstname = FirstName;
|
||||
agentData.lastname = LastName;
|
||||
agentData.SecureSessionID=UUID.Random();
|
||||
agentData.SessionID=UUID.Random();
|
||||
agentData.SecureSessionID = UUID.Random();
|
||||
agentData.SessionID = UUID.Random();
|
||||
agentData.startpos = new Vector3(128f, 128f, 100f);
|
||||
|
||||
// Pre-Fill our region cache with information on the agent.
|
||||
UserAgentData useragent = new UserAgentData();
|
||||
useragent.AgentIP="unknown";
|
||||
useragent.AgentOnline=true;
|
||||
useragent.AgentIP = "unknown";
|
||||
useragent.AgentOnline = true;
|
||||
useragent.AgentPort = (uint)0;
|
||||
useragent.Handle = regionhandle;
|
||||
useragent.InitialRegion = reg.originRegionID;
|
||||
useragent.LoginTime=Util.UnixTimeSinceEpoch();
|
||||
useragent.LoginTime = Util.UnixTimeSinceEpoch();
|
||||
useragent.LogoutTime = 0;
|
||||
useragent.Position=agentData.startpos;
|
||||
useragent.Region=reg.originRegionID;
|
||||
useragent.SecureSessionID=agentData.SecureSessionID;
|
||||
useragent.Position = agentData.startpos;
|
||||
useragent.Region = reg.originRegionID;
|
||||
useragent.SecureSessionID = agentData.SecureSessionID;
|
||||
useragent.SessionID = agentData.SessionID;
|
||||
|
||||
UserProfileData userProfile = new UserProfileData();
|
||||
|
@ -565,7 +565,6 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
|
|||
string httpaddr = reg.ExternalHostName;
|
||||
string urlport = reg.HttpPort.ToString();
|
||||
|
||||
|
||||
if (httpSSL)
|
||||
{
|
||||
rezHttpProtocol = "https://";
|
||||
|
@ -576,8 +575,6 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
|
|||
httpaddr = httpsCN;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// DEPRECIATED
|
||||
responseMap["seed_capability"] = OSD.FromString(regionCapsHttpProtocol + httpaddr + ":" + reg.HttpPort + "/CAPS/" + userCap.CapsObjectPath + "0000/");
|
||||
|
||||
|
|
|
@ -31,17 +31,16 @@ using System.Collections.Generic;
|
|||
using System.Net;
|
||||
using System.Reflection;
|
||||
using System.Threading;
|
||||
|
||||
using OpenMetaverse;
|
||||
|
||||
using log4net;
|
||||
using OpenMetaverse;
|
||||
using OSD = OpenMetaverse.StructuredData.OSD;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Communications;
|
||||
using OpenSim.Framework.Communications.Cache;
|
||||
using OpenSim.Framework.Communications.Capabilities;
|
||||
using OpenSim.Region.Environment.Scenes;
|
||||
using OpenSim.Region.Environment;
|
||||
using OpenSim.Region.Interfaces;
|
||||
using OSD = OpenMetaverse.StructuredData.OSD;
|
||||
|
||||
namespace OpenSim.Region.Environment.Scenes.Hypergrid
|
||||
{
|
||||
|
@ -189,7 +188,7 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid
|
|||
if (Util.IsOutsideView(oldRegionX, newRegionX, oldRegionY, newRegionY))
|
||||
{
|
||||
// brand new agent, let's create a new caps seed
|
||||
agentCircuit.CapsPath = Util.GetRandomCapsPath();
|
||||
agentCircuit.CapsPath = CapsUtil.GetRandomCapsPath();
|
||||
}
|
||||
|
||||
//if (!m_commsProvider.InterRegion.InformRegionOfChildAgent(reg.RegionHandle, agentCircuit))
|
||||
|
|
|
@ -36,6 +36,7 @@ using log4net;
|
|||
using OpenSim.Region.Environment.Interfaces;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Communications;
|
||||
using OpenSim.Framework.Communications.Capabilities;
|
||||
using OpenSim.Region.Interfaces;
|
||||
using OSD = OpenMetaverse.StructuredData.OSD;
|
||||
|
||||
|
@ -393,7 +394,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
|
||||
if (newRegions.Contains(neighbour.RegionHandle))
|
||||
{
|
||||
agent.CapsPath = Util.GetRandomCapsPath();
|
||||
agent.CapsPath = CapsUtil.GetRandomCapsPath();
|
||||
avatar.AddNeighbourRegion(neighbour.RegionHandle, agent.CapsPath);
|
||||
seeds.Add(neighbour.RegionHandle, agent.CapsPath);
|
||||
}
|
||||
|
@ -784,7 +785,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
if (Util.IsOutsideView(oldRegionX, newRegionX, oldRegionY, newRegionY))
|
||||
{
|
||||
// brand new agent, let's create a new caps seed
|
||||
agentCircuit.CapsPath = Util.GetRandomCapsPath();
|
||||
agentCircuit.CapsPath = CapsUtil.GetRandomCapsPath();
|
||||
}
|
||||
|
||||
// Let's create an agent there if one doesn't exist yet.
|
||||
|
|
Loading…
Reference in New Issue