send agent view range to new child agents

0.9.1.0-post-fixes
UbitUmarov 2019-04-04 00:50:54 +01:00
parent 8e094887cd
commit 15b6d8c147
10 changed files with 31 additions and 3 deletions

View File

@ -173,6 +173,7 @@ namespace OpenSim.Framework
/// Position the Agent's Avatar starts in the region /// Position the Agent's Avatar starts in the region
/// </summary> /// </summary>
public Vector3 startpos; public Vector3 startpos;
public float startfar = -1.0f;
public Dictionary<string, object> ServiceURLs; public Dictionary<string, object> ServiceURLs;
@ -219,6 +220,8 @@ namespace OpenSim.Framework
args["channel"] = OSD.FromString(Channel); args["channel"] = OSD.FromString(Channel);
args["mac"] = OSD.FromString(Mac); args["mac"] = OSD.FromString(Mac);
args["id0"] = OSD.FromString(Id0); args["id0"] = OSD.FromString(Id0);
if(startfar > 0)
args["far"] = OSD.FromReal(startfar);
if (Appearance != null) if (Appearance != null)
{ {
@ -327,6 +330,9 @@ namespace OpenSim.Framework
if (args["start_pos"] != null) if (args["start_pos"] != null)
Vector3.TryParse(args["start_pos"].AsString(), out startpos); Vector3.TryParse(args["start_pos"].AsString(), out startpos);
if(args["far"] != null)
startfar = (float)args["far"].AsReal();
//m_log.InfoFormat("[AGENTCIRCUITDATA]: agentid={0}, child={1}, startpos={2}", AgentID, child, startpos); //m_log.InfoFormat("[AGENTCIRCUITDATA]: agentid={0}, child={1}, startpos={2}", AgentID, child, startpos);
try try

View File

@ -79,6 +79,7 @@ namespace OpenSim.Framework
user.LoginInfo.InventoryFolder = validcircuit.InventoryFolder; user.LoginInfo.InventoryFolder = validcircuit.InventoryFolder;
user.LoginInfo.BaseFolder = validcircuit.BaseFolder; user.LoginInfo.BaseFolder = validcircuit.BaseFolder;
user.LoginInfo.StartPos = validcircuit.startpos; user.LoginInfo.StartPos = validcircuit.startpos;
user.LoginInfo.StartFar = (float)validcircuit.startfar;
} }
else else
{ {
@ -176,6 +177,7 @@ namespace OpenSim.Framework
m_agentCircuits[(uint) agentData.circuitcode].firstname = agentData.firstname; m_agentCircuits[(uint) agentData.circuitcode].firstname = agentData.firstname;
m_agentCircuits[(uint) agentData.circuitcode].lastname = agentData.lastname; m_agentCircuits[(uint) agentData.circuitcode].lastname = agentData.lastname;
m_agentCircuits[(uint)agentData.circuitcode].startpos = agentData.startpos; m_agentCircuits[(uint)agentData.circuitcode].startpos = agentData.startpos;
m_agentCircuits[(uint)agentData.circuitcode].startfar = agentData.startfar;
// Updated for when we don't know them before calling Scene.NewUserConnection // Updated for when we don't know them before calling Scene.NewUserConnection
m_agentCircuits[(uint) agentData.circuitcode].SecureSessionID = agentData.SecureSessionID; m_agentCircuits[(uint) agentData.circuitcode].SecureSessionID = agentData.SecureSessionID;

View File

@ -707,6 +707,7 @@ namespace OpenSim.Framework
public interface IClientAPI public interface IClientAPI
{ {
Vector3 StartPos { get; set; } Vector3 StartPos { get; set; }
float StartFar { get; set; }
UUID AgentId { get; } UUID AgentId { get; }

View File

@ -42,11 +42,13 @@ namespace OpenSim.Framework
public UUID SecureSession = UUID.Zero; public UUID SecureSession = UUID.Zero;
public UUID Session; public UUID Session;
public Vector3 StartPos; public Vector3 StartPos;
public float StartFar;
public AvatarAppearance Appearance; public AvatarAppearance Appearance;
public Login() public Login()
{ {
StartPos = new Vector3(128, 128, 70); StartPos = new Vector3(128, 128, 70);
StartFar = -1;
} }
} }
} }

View File

@ -408,6 +408,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
get { return m_startpos; } get { return m_startpos; }
set { m_startpos = value; } set { m_startpos = value; }
} }
public float StartFar { get; set; }
public bool DeliverPackets public bool DeliverPackets
{ {
get { return m_deliverPackets; } get { return m_deliverPackets; }
@ -540,6 +542,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
m_firstName = sessionInfo.LoginInfo.First; m_firstName = sessionInfo.LoginInfo.First;
m_lastName = sessionInfo.LoginInfo.Last; m_lastName = sessionInfo.LoginInfo.Last;
m_startpos = sessionInfo.LoginInfo.StartPos; m_startpos = sessionInfo.LoginInfo.StartPos;
StartFar = sessionInfo.LoginInfo.StartFar;
m_udpServer = udpServer; m_udpServer = udpServer;
m_udpClient = udpClient; m_udpClient = udpClient;

View File

@ -1946,6 +1946,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
agent.BaseFolder = UUID.Zero; agent.BaseFolder = UUID.Zero;
agent.InventoryFolder = UUID.Zero; agent.InventoryFolder = UUID.Zero;
agent.startpos = sp.AbsolutePosition + CalculateOffset(sp, region); agent.startpos = sp.AbsolutePosition + CalculateOffset(sp, region);
agent.startfar = sp.DrawDistance;
agent.child = true; agent.child = true;
agent.Appearance = new AvatarAppearance(); agent.Appearance = new AvatarAppearance();
agent.Appearance.AvatarHeight = sp.Appearance.AvatarHeight; agent.Appearance.AvatarHeight = sp.Appearance.AvatarHeight;
@ -2105,7 +2106,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
agent.child = true; agent.child = true;
agent.Appearance = new AvatarAppearance(); agent.Appearance = new AvatarAppearance();
agent.Appearance.AvatarHeight = sp.Appearance.AvatarHeight; agent.Appearance.AvatarHeight = sp.Appearance.AvatarHeight;
agent.startfar = sp.DrawDistance;
if (currentAgentCircuit != null) if (currentAgentCircuit != null)
{ {
agent.ServiceURLs = currentAgentCircuit.ServiceURLs; agent.ServiceURLs = currentAgentCircuit.ServiceURLs;

View File

@ -1079,7 +1079,14 @@ namespace OpenSim.Region.Framework.Scenes
Animator = new ScenePresenceAnimator(this); Animator = new ScenePresenceAnimator(this);
Overrides = new MovementAnimationOverrides(); Overrides = new MovementAnimationOverrides();
PresenceType = type; PresenceType = type;
DrawDistance = world.DefaultDrawDistance; m_drawDistance = client.StartFar;
if(m_drawDistance > 32)
{
if(m_drawDistance > world.MaxDrawDistance)
m_drawDistance = world.MaxDrawDistance;
}
else
m_drawDistance = world.DefaultDrawDistance;
RegionHandle = world.RegionInfo.RegionHandle; RegionHandle = world.RegionInfo.RegionHandle;
ControllingClient = client; ControllingClient = client;
Firstname = ControllingClient.FirstName; Firstname = ControllingClient.FirstName;

View File

@ -524,6 +524,8 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
set { } set { }
} }
public float StartFar { get; set; }
public bool TryGet<T>(out T iface) public bool TryGet<T>(out T iface)
{ {
iface = default(T); iface = default(T);

View File

@ -562,6 +562,8 @@ namespace OpenSim.Region.OptionalModules.World.NPC
set { } set { }
} }
public float StartFar { get; set; }
public virtual UUID AgentId public virtual UUID AgentId
{ {
get { return m_uuid; } get { return m_uuid; }

View File

@ -369,6 +369,8 @@ namespace OpenSim.Tests.Common
set { } set { }
} }
public float StartFar { get; set; }
public virtual UUID AgentId public virtual UUID AgentId
{ {
get { return m_agentId; } get { return m_agentId; }