mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 03:06:05 +08:00
* Removed ClientThreads from avatar
* Deleted SimpleApp2 as it's getting wonkier and wonkier by the minute * Added avatar handling to SimpleApp, still don't have any avatar out on the playing field * Removed some warnings * Went from IWorld to Scene *
This commit is contained in:
@@ -87,7 +87,7 @@ namespace OpenSim.Region.Scenes
|
||||
/// </summary>
|
||||
public void SendInitialPosition()
|
||||
{
|
||||
this.ControllingClient.SendAvatarData(m_regionInfo, this.firstname, this.lastname, this.uuid, this.localid, this.Pos);
|
||||
this.ControllingClient.SendAvatarData(m_regionInfo, this.firstname, this.lastname, this.uuid, this.LocalId, this.Pos);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -59,7 +59,6 @@ namespace OpenSim.Region.Scenes
|
||||
private AvatarWearable[] Wearables;
|
||||
private LLVector3 positionLastFrame = new LLVector3(0, 0, 0);
|
||||
private ulong m_regionHandle;
|
||||
private Dictionary<uint, IClientAPI> m_clientThreads;
|
||||
private bool childAvatar = false;
|
||||
private bool newForce = false;
|
||||
|
||||
@@ -71,11 +70,10 @@ namespace OpenSim.Region.Scenes
|
||||
/// <param name="world"></param>
|
||||
/// <param name="clientThreads"></param>
|
||||
/// <param name="regionDat"></param>
|
||||
public Avatar(IClientAPI theClient, Scene world, Dictionary<uint, IClientAPI> clientThreads, RegionInfo reginfo)
|
||||
public Avatar(IClientAPI theClient, Scene world, RegionInfo reginfo)
|
||||
{
|
||||
|
||||
m_world = world;
|
||||
m_clientThreads = clientThreads;
|
||||
this.uuid = theClient.AgentId;
|
||||
|
||||
m_regionInfo = reginfo;
|
||||
@@ -84,7 +82,7 @@ namespace OpenSim.Region.Scenes
|
||||
ControllingClient = theClient;
|
||||
this.firstname = ControllingClient.FirstName;
|
||||
this.lastname = ControllingClient.LastName;
|
||||
localid = this.m_world.NextLocalId;
|
||||
m_localId = m_world.NextLocalId;
|
||||
Pos = ControllingClient.StartPos;
|
||||
visualParams = new byte[218];
|
||||
for (int i = 0; i < 218; i++)
|
||||
@@ -196,7 +194,7 @@ namespace OpenSim.Region.Scenes
|
||||
{
|
||||
LLVector3 pos = this.Pos;
|
||||
LLVector3 vel = this.Velocity;
|
||||
RemoteClient.SendAvatarTerseUpdate(this.m_regionHandle, 64096, this.localid, new LLVector3(pos.X, pos.Y, pos.Z), new LLVector3(vel.X, vel.Y, vel.Z));
|
||||
RemoteClient.SendAvatarTerseUpdate(this.m_regionHandle, 64096, this.LocalId, new LLVector3(pos.X, pos.Y, pos.Z), new LLVector3(vel.X, vel.Y, vel.Z));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -38,7 +38,6 @@ namespace OpenSim.Region.Scenes
|
||||
public abstract class Entity : IScriptReadonlyEntity
|
||||
{
|
||||
public libsecondlife.LLUUID uuid;
|
||||
public uint localid;
|
||||
public LLVector3 velocity;
|
||||
public Quaternion rotation;
|
||||
protected List<Entity> children;
|
||||
@@ -128,13 +127,20 @@ namespace OpenSim.Region.Scenes
|
||||
}
|
||||
}
|
||||
|
||||
protected uint m_localId;
|
||||
|
||||
public uint LocalId
|
||||
{
|
||||
get { return m_localId; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new Entity (should not occur on it's own)
|
||||
/// </summary>
|
||||
public Entity()
|
||||
{
|
||||
uuid = new libsecondlife.LLUUID();
|
||||
localid = 0;
|
||||
|
||||
m_pos = new LLVector3();
|
||||
velocity = new LLVector3();
|
||||
rotation = new Quaternion();
|
||||
|
||||
@@ -136,7 +136,7 @@ namespace OpenSim.Region.Scenes
|
||||
this.primData.CreationDate = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
|
||||
this.primData.OwnerID = owner;
|
||||
this.primData.FullID = this.uuid = fullID;
|
||||
this.primData.LocalID = this.localid = localID;
|
||||
this.primData.LocalID = m_localId = localID;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -156,7 +156,7 @@ namespace OpenSim.Region.Scenes
|
||||
inventoryItems = new Dictionary<LLUUID, InventoryItem>();
|
||||
this.primData = PrimData.DefaultCube();
|
||||
this.primData.OwnerID = owner;
|
||||
this.primData.LocalID = this.localid = localID;
|
||||
this.primData.LocalID = m_localId = localID;
|
||||
this.Pos = this.primData.Position = position;
|
||||
|
||||
this.updateFlag = 1;
|
||||
@@ -411,7 +411,7 @@ namespace OpenSim.Region.Scenes
|
||||
lPos = this.Pos;
|
||||
}
|
||||
|
||||
remoteClient.SendPrimitiveToClient(this.m_regionHandle, 64096, this.localid, this.primData, lPos, new LLUUID("00000000-0000-0000-5005-000000000005"));
|
||||
remoteClient.SendPrimitiveToClient(this.m_regionHandle, 64096, this.LocalId, this.primData, lPos, new LLUUID("00000000-0000-0000-5005-000000000005"));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -499,7 +499,7 @@ namespace OpenSim.Region.Scenes
|
||||
PData.PathTwistBegin = addPacket.ObjectData.PathTwistBegin;
|
||||
LLVector3 pos1 = addPacket.ObjectData.RayEnd;
|
||||
this.primData.FullID = this.uuid = LLUUID.Random();
|
||||
this.primData.LocalID = this.localid = (uint)(localID);
|
||||
this.primData.LocalID = m_localId = (uint)(localID);
|
||||
this.primData.Position = this.Pos = pos1;
|
||||
|
||||
this.updateFlag = 1;
|
||||
|
||||
@@ -212,7 +212,7 @@ namespace OpenSim.Region.Scenes
|
||||
{
|
||||
foreach (Entity ent in Entities.Values)
|
||||
{
|
||||
if (ent.localid == localID)
|
||||
if (ent.LocalId == localID)
|
||||
{
|
||||
((OpenSim.Region.Scenes.Primitive)ent).UpdatePosition(pos);
|
||||
break;
|
||||
|
||||
@@ -107,7 +107,7 @@ namespace OpenSim.Region.Scenes
|
||||
{
|
||||
if(this.scriptEngines.ContainsKey(scriptType))
|
||||
{
|
||||
this.scriptEngines[scriptType].LoadScript(script, scriptName, ent.localid);
|
||||
this.scriptEngines[scriptType].LoadScript(script, scriptName, ent.LocalId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ namespace OpenSim.Region.Scenes
|
||||
// Console.WriteLine("script- getting entity " + localID + " position");
|
||||
foreach (Entity entity in this.Entities.Values)
|
||||
{
|
||||
if (entity.localid == localID)
|
||||
if (entity.LocalId == localID)
|
||||
{
|
||||
res.X = entity.Pos.X;
|
||||
res.Y = entity.Pos.Y;
|
||||
@@ -145,7 +145,7 @@ namespace OpenSim.Region.Scenes
|
||||
{
|
||||
foreach (Entity entity in this.Entities.Values)
|
||||
{
|
||||
if (entity.localid == localID && entity is Primitive)
|
||||
if (entity.LocalId == localID && entity is Primitive)
|
||||
{
|
||||
LLVector3 pos = entity.Pos;
|
||||
pos.X = x;
|
||||
@@ -171,7 +171,7 @@ namespace OpenSim.Region.Scenes
|
||||
{
|
||||
if (entity is Avatar)
|
||||
{
|
||||
res = entity.localid;
|
||||
res = entity.LocalId;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
|
||||
@@ -564,7 +564,7 @@ namespace OpenSim.Region.Scenes
|
||||
try
|
||||
{
|
||||
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs:AddViewerAgent() - Creating new avatar for remote viewer agent");
|
||||
newAvatar = new Avatar(remoteClient, this, m_clientThreads, this.m_regInfo);
|
||||
newAvatar = new Avatar(remoteClient, this, this.m_regInfo);
|
||||
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs:AddViewerAgent() - Adding new avatar to world");
|
||||
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs:AddViewerAgent() - Starting RegionHandshake ");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user