- adding osGetAgents() which returns a list of all avatars in the region
in which the script is running. - found a bag of space characters under my desk, thought i'd donate them to the JSON OSSL function (aka clean up)0.6.5-rc1
parent
3ca1481c3d
commit
c8aaf538e4
OpenSim/Region/ScriptEngine/Shared/Api
|
@ -582,6 +582,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get a list of all the avatars/agents in the region
|
||||||
|
public LSL_List osGetAgents()
|
||||||
|
{
|
||||||
|
// threat level is None as we could get this information with an
|
||||||
|
// in-world script as well, just not as efficient
|
||||||
|
CheckThreatLevel(ThreatLevel.None, "osGetAgents");
|
||||||
|
|
||||||
|
LSL_List result = new LSL_List();
|
||||||
|
foreach (ScenePresence avatar in World.GetAvatars())
|
||||||
|
{
|
||||||
|
result.Add(avatar.Name);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
// Adam's super super custom animation functions
|
// Adam's super super custom animation functions
|
||||||
public void osAvatarPlayAnimation(string avatar, string animation)
|
public void osAvatarPlayAnimation(string avatar, string animation)
|
||||||
{
|
{
|
||||||
|
@ -1038,10 +1053,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
// clear the key
|
// clear the key
|
||||||
currentKey = null;
|
currentKey = null;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '}':
|
case '}':
|
||||||
// pop the hashtable off the stack
|
// pop the hashtable off the stack
|
||||||
objectStack.Pop();
|
objectStack.Pop();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '"':// string boundary
|
case '"':// string boundary
|
||||||
|
|
||||||
string tokenValue = "";
|
string tokenValue = "";
|
||||||
|
@ -1080,12 +1097,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ':':// key : value separator
|
case ':':// key : value separator
|
||||||
// just ignore
|
// just ignore
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ' ':// spaces
|
case ' ':// spaces
|
||||||
// just ignore
|
// just ignore
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '[': // array start
|
case '[': // array start
|
||||||
ArrayList currentArray = new ArrayList();
|
ArrayList currentArray = new ArrayList();
|
||||||
|
|
||||||
|
@ -1102,13 +1122,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
objectStack.Push(currentArray);
|
objectStack.Push(currentArray);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ',':// seperator
|
case ',':// seperator
|
||||||
// just ignore
|
// just ignore
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ']'://Array end
|
case ']'://Array end
|
||||||
// pop the array off the stack
|
// pop the array off the stack
|
||||||
objectStack.Pop();
|
objectStack.Pop();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 't': // we've found a character start not in quotes, it must be a boolean true
|
case 't': // we've found a character start not in quotes, it must be a boolean true
|
||||||
|
|
||||||
if (objectStack.Peek().ToString() == "System.Collections.ArrayList")
|
if (objectStack.Peek().ToString() == "System.Collections.ArrayList")
|
||||||
|
@ -1124,6 +1147,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
//advance the counter to the letter 'e'
|
//advance the counter to the letter 'e'
|
||||||
i = i + 3;
|
i = i + 3;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'f': // we've found a character start not in quotes, it must be a boolean false
|
case 'f': // we've found a character start not in quotes, it must be a boolean false
|
||||||
|
|
||||||
if (objectStack.Peek().ToString() == "System.Collections.ArrayList")
|
if (objectStack.Peek().ToString() == "System.Collections.ArrayList")
|
||||||
|
@ -1138,12 +1162,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
//advance the counter to the letter 'e'
|
//advance the counter to the letter 'e'
|
||||||
i = i + 4;
|
i = i + 4;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '\n':// carriage return
|
case '\n':// carriage return
|
||||||
// just ignore
|
// just ignore
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '\r':// carriage return
|
case '\r':// carriage return
|
||||||
// just ignore
|
// just ignore
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// ok here we're catching all numeric types int,double,long we might want to spit these up mr accurately
|
// ok here we're catching all numeric types int,double,long we might want to spit these up mr accurately
|
||||||
// but for now we'll just do them as strings
|
// but for now we'll just do them as strings
|
||||||
|
|
|
@ -69,6 +69,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
||||||
|
|
||||||
// Avatar Info Commands
|
// Avatar Info Commands
|
||||||
string osGetAgentIP(string agent);
|
string osGetAgentIP(string agent);
|
||||||
|
LSL_List osGetAgents();
|
||||||
|
|
||||||
// Teleport commands
|
// Teleport commands
|
||||||
void osTeleportAgent(string agent, string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat);
|
void osTeleportAgent(string agent, string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat);
|
||||||
|
|
|
@ -175,6 +175,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||||
return m_OSSL_Functions.osGetAgentIP(agent);
|
return m_OSSL_Functions.osGetAgentIP(agent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public LSL_List osGetAgents()
|
||||||
|
{
|
||||||
|
return m_OSSL_Functions.osGetAgents();
|
||||||
|
}
|
||||||
|
|
||||||
// Animation Functions
|
// Animation Functions
|
||||||
|
|
||||||
public void osAvatarPlayAnimation(string avatar, string animation)
|
public void osAvatarPlayAnimation(string avatar, string animation)
|
||||||
|
|
Loading…
Reference in New Issue