* encapsulated firstname/lastname on ScenePresence
* fixed 'users' console command * minor refactoringsafrisby
parent
1b100e17a5
commit
9924f35613
|
@ -65,7 +65,7 @@ namespace OpenSim
|
|||
|
||||
protected List<UDPServer> m_udpServers = new List<UDPServer>();
|
||||
protected List<RegionInfo> m_regionData = new List<RegionInfo>();
|
||||
protected List<IScene> m_localScenes = new List<IScene>();
|
||||
protected List<Scene> m_localScenes = new List<Scene>();
|
||||
|
||||
private bool m_silent;
|
||||
private string m_logFilename = ("region-console-" + Guid.NewGuid().ToString() + ".log");
|
||||
|
@ -430,16 +430,15 @@ namespace OpenSim
|
|||
m_log.Error("That is " + (DateTime.Now - m_startuptime).ToString());
|
||||
break;
|
||||
case "users":
|
||||
ScenePresence TempAv;
|
||||
m_log.Error(String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16}{5,-16}{6,-16}", "Firstname", "Lastname", "Agent ID", "Session ID", "Circuit", "IP", "World"));
|
||||
for (int i = 0; i < m_localScenes.Count; i++)
|
||||
{
|
||||
foreach (libsecondlife.LLUUID UUID in ((Scene)m_localScenes[i]).Entities.Keys)
|
||||
foreach (Entity entity in m_localScenes[i].Entities.Values )
|
||||
{
|
||||
if (((Scene)m_localScenes[i]).Entities[UUID].ToString() == "OpenSim.world.Avatar")
|
||||
if ( entity is ScenePresence )
|
||||
{
|
||||
TempAv = (ScenePresence)((Scene)m_localScenes[i]).Entities[UUID];
|
||||
m_log.Error(String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}{6,-16}", TempAv.firstname, TempAv.lastname, UUID, TempAv.ControllingClient.AgentId, "Unknown", "Unknown"), ((Scene)m_localScenes[i]).RegionInfo.RegionName);
|
||||
ScenePresence scenePrescence = entity as ScenePresence;
|
||||
m_log.Error(String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}{6,-16}", scenePrescence.Firstname, scenePrescence.Lastname, scenePrescence.UUID, scenePrescence.ControllingClient.AgentId, "Unknown", "Unknown"), ((Scene)m_localScenes[i]).RegionInfo.RegionName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -124,7 +124,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
// Local sim message
|
||||
ScenePresence fromAvatar = this.Avatars[fromAgentID];
|
||||
ScenePresence toAvatar = this.Avatars[toAgentID];
|
||||
string fromName = fromAvatar.firstname + " " + fromAvatar.lastname;
|
||||
string fromName = fromAvatar.Firstname + " " + fromAvatar.Lastname;
|
||||
toAvatar.ControllingClient.SendInstantMessage(message, toAgentID, fromName);
|
||||
}
|
||||
else
|
||||
|
@ -153,7 +153,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
{
|
||||
avatar = this.Avatars[fromAgentID];
|
||||
fromPos = avatar.Pos;
|
||||
fromName = avatar.firstname + " " + avatar.lastname;
|
||||
fromName = avatar.Firstname + " " + avatar.Lastname;
|
||||
avatar = null;
|
||||
}
|
||||
|
||||
|
|
|
@ -963,7 +963,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
{
|
||||
foreach (ScenePresence presence in this.Avatars.Values)
|
||||
{
|
||||
if ((presence.firstname == firstName) && (presence.lastname == lastName))
|
||||
if ((presence.Firstname == firstName) && (presence.Lastname == lastName))
|
||||
{
|
||||
presence.ControllingClient.SendAgentAlertMessage(message, modal);
|
||||
break;
|
||||
|
|
|
@ -43,8 +43,6 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
public static bool PhysicsEngineFlying = false;
|
||||
public static AvatarAnimations Animations;
|
||||
public static byte[] DefaultTexture;
|
||||
public string firstname;
|
||||
public string lastname;
|
||||
public IClientAPI ControllingClient;
|
||||
public LLUUID current_anim;
|
||||
public int anim_seq;
|
||||
|
@ -122,6 +120,18 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
get { return m_regionHandle; }
|
||||
}
|
||||
|
||||
private string m_firstname;
|
||||
public string Firstname
|
||||
{
|
||||
get { return m_firstname; }
|
||||
}
|
||||
|
||||
private string m_lastname;
|
||||
public string Lastname
|
||||
{
|
||||
get { return m_lastname; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructor(s)
|
||||
|
@ -142,8 +152,8 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
m_regionHandle = reginfo.RegionHandle;
|
||||
MainLog.Instance.Verbose("Avatar.cs ");
|
||||
ControllingClient = theClient;
|
||||
this.firstname = ControllingClient.FirstName;
|
||||
this.lastname = ControllingClient.LastName;
|
||||
this.m_firstname = ControllingClient.FirstName;
|
||||
this.m_lastname = ControllingClient.LastName;
|
||||
m_localId = m_scene.NextLocalId;
|
||||
Pos = ControllingClient.StartPos;
|
||||
|
||||
|
@ -434,7 +444,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
/// <param name="remoteAvatar"></param>
|
||||
public void SendFullUpdateToOtherClient(ScenePresence remoteAvatar)
|
||||
{
|
||||
remoteAvatar.ControllingClient.SendAvatarData(m_regionInfo.RegionHandle, this.firstname, this.lastname, this.m_uuid, this.LocalId, this.Pos, this.m_textureEntry.ToBytes());
|
||||
remoteAvatar.ControllingClient.SendAvatarData(m_regionInfo.RegionHandle, this.m_firstname, this.m_lastname, this.m_uuid, this.LocalId, this.Pos, this.m_textureEntry.ToBytes());
|
||||
}
|
||||
|
||||
public void SendFullUpdateToALLClients()
|
||||
|
@ -456,7 +466,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
/// </summary>
|
||||
public void SendInitialData()
|
||||
{
|
||||
this.ControllingClient.SendAvatarData(m_regionInfo.RegionHandle, this.firstname, this.lastname, this.m_uuid, this.LocalId, this.Pos, this.m_textureEntry.ToBytes());
|
||||
this.ControllingClient.SendAvatarData(m_regionInfo.RegionHandle, this.m_firstname, this.m_lastname, this.m_uuid, this.LocalId, this.Pos, this.m_textureEntry.ToBytes());
|
||||
if (this.newAvatar)
|
||||
{
|
||||
this.m_scene.InformClientOfNeighbours(this.ControllingClient);
|
||||
|
|
|
@ -10,7 +10,7 @@ namespace OpenSim.Region.Scripting.LSL
|
|||
class LSLScript : IScript
|
||||
{
|
||||
ScriptInfo scriptInfo;
|
||||
LSL.Engine lindenScriptEngine;
|
||||
Engine lindenScriptEngine;
|
||||
|
||||
public LSLScript(string filename, libsecondlife.LLUUID taskObject)
|
||||
{
|
||||
|
|
|
@ -53,7 +53,7 @@ namespace OpenSim.Region.Scripting
|
|||
|
||||
void events_OnNewPresence(ScenePresence presence)
|
||||
{
|
||||
script.logger.Verbose("Hello " + presence.firstname.ToString() + "!");
|
||||
script.logger.Verbose("Hello " + presence.Firstname.ToString() + "!");
|
||||
}
|
||||
|
||||
void events_OnFrame()
|
||||
|
|
|
@ -8,6 +8,7 @@ using LSLList = System.Collections.Generic.List<string>;
|
|||
|
||||
using OpenSim.Region.Environment.Scenes;
|
||||
using OpenSim.Region.Environment.LandManagement;
|
||||
using libsecondlife;
|
||||
|
||||
namespace OpenSim.Region.Scripting
|
||||
{
|
||||
|
@ -17,13 +18,13 @@ namespace OpenSim.Region.Scripting
|
|||
/// <remarks>Avoid at all costs. This should ONLY be used for LSL.</remarks>
|
||||
class ScriptInterpretedAPI
|
||||
{
|
||||
protected libsecondlife.LLUUID m_object;
|
||||
protected LLUUID m_object;
|
||||
protected Scene m_scene;
|
||||
|
||||
/// <summary>
|
||||
/// The scene in which this script is acting
|
||||
/// </summary>
|
||||
public Scene World
|
||||
public Scene Scene
|
||||
{
|
||||
get { return m_scene; }
|
||||
}
|
||||
|
@ -41,7 +42,7 @@ namespace OpenSim.Region.Scripting
|
|||
/// </summary>
|
||||
public SceneObject Task
|
||||
{
|
||||
get { return World.Objects[ObjectID]; }
|
||||
get { return Scene.Objects[ObjectID]; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -74,7 +75,7 @@ namespace OpenSim.Region.Scripting
|
|||
public void osAddToLandPassList(Key avatar, float hours)
|
||||
{
|
||||
Vector myPosition = Task.Pos;
|
||||
Land myParcel = World.LandManager.getLandObject(myPosition.X, myPosition.Y);
|
||||
Land myParcel = Scene.LandManager.getLandObject(myPosition.X, myPosition.Y);
|
||||
|
||||
OpenSim.Framework.Console.MainLog.Instance.Warn("script", "Unimplemented function called by script: osAddToLandPassList(Key avatar, float hours)");
|
||||
return;
|
||||
|
@ -228,8 +229,8 @@ namespace OpenSim.Region.Scripting
|
|||
|
||||
public void osCreateLink(Key target, int parent)
|
||||
{
|
||||
if(World.Entities[target] is SceneObject)
|
||||
Task.AddNewChildPrims((SceneObject)World.Entities[target]);
|
||||
if(Scene.Entities[target] is SceneObject)
|
||||
Task.AddNewChildPrims((SceneObject)Scene.Entities[target]);
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue