MW 2007-05-29 17:10:31 +00:00
parent b2eb26e4ba
commit 36bcda6cfa
3 changed files with 58 additions and 12 deletions

View File

@ -101,7 +101,7 @@ namespace OpenSim
avp.ObjectData.TextureEntry = textureEntry;
AvatarAppearancePacket.VisualParamBlock avblock = null;
for (int i = 0; i < 218; i++)
for (int i = 0; i < visualParams.Length; i++)
{
avblock = new AvatarAppearancePacket.VisualParamBlock();
avblock.ParamValue = visualParams[i];

View File

@ -37,15 +37,16 @@ namespace OpenSim.world
private ushort m_regionWaterHeight;
private bool m_regionTerraform;
private bool childAvatar = false;
private RegionInfo regionData;
public Avatar(IClientAPI TheClient, World world, string regionName, Dictionary<uint, IClientAPI> clientThreads, ulong regionHandle, bool regionTerraform, ushort regionWater)
public Avatar(IClientAPI TheClient, World world, Dictionary<uint, IClientAPI> clientThreads, RegionInfo regionDat)
{
m_world = world;
// m_clientThreads = clientThreads;
m_regionName = regionName;
m_regionHandle = regionHandle;
m_regionTerraform = regionTerraform;
m_regionWaterHeight = regionWater;
m_regionName = regionData.RegionName;
m_regionHandle = regionData.RegionHandle;
m_regionTerraform = regionData.RegionTerraform;
m_regionWaterHeight = regionData.RegionWaterHeight;
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Avatar.cs - Loading details from grid (DUMMY)");
ControllingClient = TheClient;

View File

@ -86,7 +86,7 @@ namespace OpenSim.world
this.SetDefaultScripts();
this.LoadScriptEngines();
}
catch (Exception e)
{
@ -459,7 +459,7 @@ namespace OpenSim.world
/// <param name="RemoteClient">Client to send to</param>
public void GetInitialPrims(IClientAPI RemoteClient)
{
}
/// <summary>
@ -484,7 +484,7 @@ namespace OpenSim.world
/// <param name="prim">The object to load</param>
public void PrimFromStorage(PrimData prim)
{
}
public void AddNewPrim(Packet addPacket, IClientAPI agentClient)
@ -494,7 +494,7 @@ namespace OpenSim.world
public void AddNewPrim(ObjectAddPacket addPacket, LLUUID ownerID)
{
}
#endregion
@ -503,12 +503,57 @@ namespace OpenSim.world
public override void AddNewAvatar(IClientAPI remoteClient, LLUUID agentID, bool child)
{
return ;
remoteClient.OnRegionHandShakeReply += new GenericCall(this.SendLayerData);
remoteClient.OnRequestWearables += new GenericCall(this.GetInitialPrims);
Avatar newAvatar = null;
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);
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 ");
newAvatar.SendRegionHandshake(this);
PhysicsVector pVec = new PhysicsVector(newAvatar.Pos.X, newAvatar.Pos.Y, newAvatar.Pos.Z);
lock (this.LockPhysicsEngine)
{
newAvatar.PhysActor = this.phyScene.AddAvatar(pVec);
}
lock (Entities)
{
if (!Entities.ContainsKey(agentID))
{
this.Entities.Add(agentID, newAvatar);
}
else
{
Entities[agentID] = newAvatar;
}
}
lock (Avatars)
{
if (Avatars.ContainsKey(agentID))
{
Avatars[agentID] = newAvatar;
}
else
{
this.Avatars.Add(agentID, newAvatar);
}
}
}
catch (Exception e)
{
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "World.cs: AddViewerAgent() - Failed with exception " + e.ToString());
}
return;
}
public override void RemoveAvatar(LLUUID agentID)
{
return ;
return;
}
#endregion