replace my hack by others hack

0.9.1.0-post-fixes
UbitUmarov 2019-01-01 12:06:29 +00:00
parent 813fda90da
commit 02492f7b15
10 changed files with 71 additions and 62 deletions

View File

@ -119,6 +119,17 @@ namespace OpenSim.Framework.Capabilities
get { return m_externalCapsHandlers; }
}
[Flags]
public enum CapsFlags:uint
{
None = 0,
SentSeeds = 1,
ObjectAnim = 0x10
}
public CapsFlags Flags { get; set;}
public Caps(IHttpServer httpServer, string httpListen, uint httpPort, string capsPath,
UUID agent, string regionName)
{
@ -138,12 +149,18 @@ namespace OpenSim.Framework.Capabilities
m_agentID = agent;
m_capsHandlers = new CapsHandlers(httpServer, httpListen, httpPort);
m_regionName = regionName;
Flags = CapsFlags.None;
m_capsActive.Reset();
}
~Caps()
{
m_capsActive.Dispose();
Flags = CapsFlags.None;
if (m_capsActive!= null)
{
m_capsActive.Dispose();
m_capsActive = null;
}
}
/// <summary>
@ -262,6 +279,7 @@ namespace OpenSim.Framework.Capabilities
caps[kvp.Key] = kvp.Value;
}
Flags |= CapsFlags.SentSeeds;
return caps;
}

View File

@ -710,7 +710,7 @@ namespace OpenSim.Framework
Vector3 StartPos { get; set; }
UUID AgentId { get; }
bool DoObjectAnimations { get; set; }
bool SupportObjectAnimations { get; set; }
/// <summary>
/// The scene agent for this client. This will only be set if the client has an agent in a scene (i.e. if it

View File

@ -374,7 +374,12 @@ namespace OpenSim.Region.ClientStack.Linden
List<string> validCaps = new List<string>();
foreach (OSD c in capsRequested)
validCaps.Add(c.AsString());
{
string cstr = c.AsString();
if(cstr == "ObjectAnimation")
m_HostCapsObj.Flags |= Caps.CapsFlags.ObjectAnim;
validCaps.Add(cstr);
}
string result = LLSDHelpers.SerialiseLLSDReply(m_HostCapsObj.GetCapsDetails(true, validCaps));

View File

@ -351,7 +351,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
#pragma warning restore 0414
private const uint MaxTransferBytesPerPacket = 600;
public bool DoObjectAnimations { get; set; }
public bool SupportObjectAnimations { get; set; }
/// <value>
/// Maintain a record of all the objects killed. This allows us to stop an update being sent from the
@ -3917,7 +3917,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public void SendObjectAnimations(UUID[] animations, int[] seqs, UUID senderId)
{
// m_log.DebugFormat("[LLCLIENTVIEW]: Sending Object animations for {0} to {1}", sourceAgentId, Name);
if(!DoObjectAnimations)
if(!SupportObjectAnimations)
return;
ObjectAnimationPacket ani = (ObjectAnimationPacket)PacketPool.Instance.GetPacket(PacketType.ObjectAnimation);
@ -4330,7 +4330,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (update.Entity is SceneObjectPart)
{
if (DoObjectAnimations && updateFlags.HasFlag(PrimUpdateFlags.Animations))
if (SupportObjectAnimations && updateFlags.HasFlag(PrimUpdateFlags.Animations))
{
SceneObjectPart sop = (SceneObjectPart)update.Entity;
if ( sop.Animations != null)

View File

@ -1919,38 +1919,28 @@ namespace OpenSim.Region.ClientStack.LindenUDP
uint circuitCode, UUID agentID, UUID sessionID, IPEndPoint remoteEndPoint, AuthenticateResponse sessionInfo)
{
IClientAPI client = null;
bool createNew = false;
// We currently synchronize this code across the whole scene to avoid issues such as
// http://opensimulator.org/mantis/view.php?id=5365 However, once locking per agent circuit can be done
// consistently, this lock could probably be removed.
lock (this)
{
if (!Scene.TryGetClient(agentID, out client))
if (Scene.TryGetClient(agentID, out client))
{
createNew = true;
}
else
{
if (client.SceneAgent == null)
{
Scene.CloseAgent(agentID, true);
createNew = true;
}
if (client.SceneAgent != null)
return client;
Scene.CloseAgent(agentID, true);
}
if (createNew)
{
LLUDPClient udpClient = new LLUDPClient(this, ThrottleRates, Throttle, circuitCode, agentID, remoteEndPoint, m_defaultRTO, m_maxRTO);
LLUDPClient udpClient = new LLUDPClient(this, ThrottleRates, Throttle, circuitCode, agentID, remoteEndPoint, m_defaultRTO, m_maxRTO);
client = new LLClientView(Scene, this, udpClient, sessionInfo, agentID, sessionID, circuitCode);
client.OnLogout += LogoutHandler;
client.DebugPacketLevel = DefaultClientPacketDebugLevel;
client = new LLClientView(Scene, this, udpClient, sessionInfo, agentID, sessionID, circuitCode);
client.OnLogout += LogoutHandler;
client.DebugPacketLevel = DefaultClientPacketDebugLevel;
((LLClientView)client).DisableFacelights = m_disableFacelights;
((LLClientView)client).DisableFacelights = m_disableFacelights;
client.Start();
}
client.Start();
}
return client;

View File

@ -3111,12 +3111,6 @@ namespace OpenSim.Region.Framework.Scenes
m_LastLogin = Util.EnvironmentTickCount();
//HACK only send object animations to fs beta for now
string viewername = Util.GetViewerName(aCircuit);
if(sp != null && viewername.StartsWith("Firestorm-Betax64 6"))
{
sp.ControllingClient.DoObjectAnimations = true;
}
return sp;
}
@ -3207,36 +3201,29 @@ namespace OpenSim.Region.Framework.Scenes
public override bool CheckClient(UUID agentID, System.Net.IPEndPoint ep)
{
AgentCircuitData aCircuit = m_authenticateHandler.GetAgentCircuitData(agentID);
if (aCircuit != null)
if (aCircuit == null)
return false;
bool vialogin = false;
if (VerifyClient(aCircuit, ep, out vialogin))
return true;
// if it doesn't pass, we remove the agentcircuitdata altogether
// and the scene presence and the client, if they exist
try
{
bool vialogin = false;
if (!VerifyClient(aCircuit, ep, out vialogin))
ScenePresence sp = WaitGetScenePresence(agentID);
if (sp != null)
{
// if it doesn't pass, we remove the agentcircuitdata altogether
// and the scene presence and the client, if they exist
try
{
ScenePresence sp = WaitGetScenePresence(agentID);
if (sp != null)
{
PresenceService.LogoutAgent(sp.ControllingClient.SessionId);
CloseAgent(sp.UUID, false);
}
// BANG! SLASH!
m_authenticateHandler.RemoveCircuit(agentID);
return false;
}
catch (Exception e)
{
m_log.DebugFormat("[SCENE]: Exception while closing aborted client: {0}", e.StackTrace);
}
PresenceService.LogoutAgent(sp.ControllingClient.SessionId);
CloseAgent(sp.UUID, false);
}
else
return true;
// BANG! SLASH!
m_authenticateHandler.RemoveCircuit(agentID);
}
catch (Exception e)
{
m_log.DebugFormat("[SCENE]: Exception while closing aborted client: {0}", e.StackTrace);
}
return false;

View File

@ -45,6 +45,7 @@ using OpenSim.Region.PhysicsModules.SharedBase;
using GridRegion = OpenSim.Services.Interfaces.GridRegion;
using OpenSim.Services.Interfaces;
using TeleportFlags = OpenSim.Framework.Constants.TeleportFlags;
using Caps = OpenSim.Framework.Capabilities.Caps;
namespace OpenSim.Region.Framework.Scenes
{
@ -1110,6 +1111,14 @@ namespace OpenSim.Region.Framework.Scenes
HealRate = 0.5f;
ControllingClient.SupportObjectAnimations = false;
if (m_scene.CapsModule != null)
{
Caps cap = m_scene.CapsModule.GetCapsForUser(ControllingClient.CircuitCode);
if (cap != null && (cap.Flags & Caps.CapsFlags.ObjectAnim) != 0)
ControllingClient.SupportObjectAnimations = true;
}
IConfig sconfig = m_scene.Config.Configs["EntityTransfer"];
if (sconfig != null)
{

View File

@ -60,7 +60,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
public int PingTimeMS { get { return 0; } }
public bool DoObjectAnimations { get; set; }
public bool SupportObjectAnimations { get; set; }
private string m_username;
private string m_nick;

View File

@ -73,7 +73,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
private UUID m_profileImage = UUID.Zero;
private string m_born;
public List<uint> SelectedObjects {get; private set;}
public bool DoObjectAnimations { get; set; }
public bool SupportObjectAnimations { get; set; }
public NPCAvatar(
string firstname, string lastname, Vector3 position, UUID ownerID, bool senseAsAgent, Scene scene)

View File

@ -354,7 +354,7 @@ namespace OpenSim.Tests.Common
public ISceneAgent SceneAgent { get; set; }
public bool DoObjectAnimations { get; set; }
public bool SupportObjectAnimations { get; set; }
/// <value>
/// The last caps seed url that this client was given.