Thanks to T. Sado and nlin for a patch that partially implements llGetAgentInfo (AGENT_FLYING, AGENT_ALWAYS_RUN, AGENT_AWAY, AGENT_MOUSELOOK, AGENT_TYPING).
parent
901acddbdd
commit
227fd4eb11
|
@ -297,6 +297,41 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
set { m_allowMovement = value; }
|
||||
}
|
||||
|
||||
public bool SetAlwaysRun
|
||||
{
|
||||
get
|
||||
{
|
||||
if (PhysicsActor != null)
|
||||
{
|
||||
return PhysicsActor.SetAlwaysRun;
|
||||
}
|
||||
else
|
||||
{
|
||||
return m_setAlwaysRun;
|
||||
}
|
||||
}
|
||||
set
|
||||
{
|
||||
m_setAlwaysRun = value;
|
||||
if (PhysicsActor != null)
|
||||
{
|
||||
PhysicsActor.SetAlwaysRun = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public byte State
|
||||
{
|
||||
get { return m_state; }
|
||||
set { m_state = value; }
|
||||
}
|
||||
|
||||
public uint AgentControlFlags
|
||||
{
|
||||
get { return m_AgentControlFlags; }
|
||||
set { m_AgentControlFlags = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This works out to be the ClientView object associated with this avatar, or it's client connection manager
|
||||
/// </summary>
|
||||
|
@ -942,9 +977,9 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
// In the future, these values might need to go global.
|
||||
// Here's where you get them.
|
||||
|
||||
// m_AgentControlFlags = flags;
|
||||
// m_headrotation = agentData.AgentData.HeadRotation;
|
||||
// m_state = agentData.AgentData.State;
|
||||
m_AgentControlFlags = flags;
|
||||
m_headrotation = agentData.HeadRotation;
|
||||
m_state = agentData.State;
|
||||
|
||||
if (m_allowMovement)
|
||||
{
|
||||
|
|
|
@ -4455,10 +4455,53 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
public LSL_Integer llGetAgentInfo(string id)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
NotImplemented("llGetAgentInfo");
|
||||
|
||||
// This is partial implementation.
|
||||
|
||||
UUID key = new UUID();
|
||||
if (!UUID.TryParse(id, out key))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int flags = 0;
|
||||
|
||||
ScenePresence agent = World.GetScenePresence(key);
|
||||
if (agent == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (agent.SetAlwaysRun)
|
||||
{
|
||||
flags |= ScriptBaseClass.AGENT_ALWAYS_RUN;
|
||||
}
|
||||
|
||||
if ((agent.AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0)
|
||||
{
|
||||
flags |= ScriptBaseClass.AGENT_FLYING;
|
||||
}
|
||||
|
||||
if ((agent.AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_AWAY) != 0)
|
||||
{
|
||||
flags |= ScriptBaseClass.AGENT_AWAY;
|
||||
}
|
||||
|
||||
if ((agent.AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) != 0)
|
||||
{
|
||||
flags |= ScriptBaseClass.AGENT_MOUSELOOK;
|
||||
}
|
||||
|
||||
if ((agent.State & (byte)AgentManager.AgentState.Typing) != (byte)0)
|
||||
{
|
||||
flags |= ScriptBaseClass.AGENT_TYPING;
|
||||
}
|
||||
|
||||
//NotImplemented("llGetAgentInfo");
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
public LSL_String llGetAgentLanguage(string id)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
|
|
Loading…
Reference in New Issue