* Added AddToPhysicalScene and RemoveFromPhysicalScene and added to MakeAvatar and MakeChildAgent respectively

* Removed unused m_child from ClientView
afrisby
lbsa71 2007-09-19 04:19:27 +00:00
parent 440819fab9
commit 2afbf8b22b
6 changed files with 39 additions and 75 deletions

View File

@ -175,8 +175,6 @@ namespace OpenSim.Region.ClientStack
}
break;
case PacketType.AgentAnimation:
if (!m_child)
{
AgentAnimationPacket AgentAni = (AgentAnimationPacket)Pack;
for (int i = 0; i < AgentAni.AnimationList.Length; i++)
{
@ -189,7 +187,6 @@ namespace OpenSim.Region.ClientStack
}
}
}
}
break;
#endregion

View File

@ -62,7 +62,6 @@ namespace OpenSim.Region.ClientStack
public LLUUID SecureSessionID = LLUUID.Zero;
public string firstName;
public string lastName;
public bool m_child = false;
private UseCircuitCodePacket cirpack;
public Thread ClientThread;
public LLVector3 startpos;

View File

@ -71,53 +71,6 @@ namespace OpenSim.Region.ClientStack
m_clientManager.InPacket(circuitCode, packet);
}
/// <summary>
///
/// </summary>
/// <param name="circuitCode"></param>
/// <returns></returns>
public virtual bool AddNewCircuitCodeClient(uint circuitCode)
{
return false;
}
/// <summary>
///
/// </summary>
/// <param name="packet"></param>
public virtual void SendPacketToAllClients(Packet packet)
{
}
/// <summary>
///
/// </summary>
/// <param name="packet"></param>
/// <param name="simClient"></param>
public virtual void SendPacketToAllExcept(Packet packet, IClientAPI simClient)
{
}
/// <summary>
///
/// </summary>
/// <param name="packetType"></param>
/// <param name="handler"></param>
public virtual void AddClientPacketHandler(PacketType packetType, PacketMethod handler)
{
}
/// <summary>
///
/// </summary>
public virtual void RegisterClientPacketHandlers()
{
}
protected virtual IClientAPI CreateNewClient(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, ClientManager clientManager, IScene scene, AssetCache assetCache, PacketServer packServer, AgentCircuitManager authenSessions)
{
return new ClientView(remoteEP, initialcirpack, clientManager, scene, assetCache, packServer, authenSessions );

View File

@ -133,7 +133,7 @@ namespace OpenSim.Region.ClientStack
else if (packet.Type == PacketType.UseCircuitCode)
{
// new client
this.AddNewClient(packet);
AddNewClient(packet);
}
else
{ // invalid client

View File

@ -706,7 +706,9 @@ namespace OpenSim.Region.Environment.Scenes
{
SubscribeToClientEvents(client);
m_estateManager.sendRegionHandshake(client);
CreateAndAddScenePresence(client, child);
m_LandManager.sendParcelOverlay(client);
commsManager.UserProfiles.AddNewUser(client.AgentId);
commsManager.TransactionsManager.AddUser(client.AgentId);
@ -791,13 +793,7 @@ namespace OpenSim.Region.Environment.Scenes
MainLog.Instance.Verbose(RegionInfo.RegionName + ": Creating new root agent.");
MainLog.Instance.Verbose(RegionInfo.RegionName + ": Adding Physical agent.");
PhysicsVector pVec =
new PhysicsVector(newAvatar.AbsolutePosition.X, newAvatar.AbsolutePosition.Y,
newAvatar.AbsolutePosition.Z);
lock (m_syncRoot)
{
newAvatar.PhysActor = phyScene.AddAvatar(pVec);
}
newAvatar.AddToPhysicalScene( );
}
lock (Entities)

View File

@ -265,17 +265,17 @@ namespace OpenSim.Region.Environment.Scenes
}
}
/// <summary>
///
/// </summary>
/// <param name="pos"></param>
public void MakeAvatar(LLVector3 pos, bool isFlying)
{
//this.childAvatar = false;
AbsolutePosition = pos;
_physActor.Flying = isFlying;
newAvatar = true;
childAgent = false;
AbsolutePosition = pos;
AddToPhysicalScene( );
_physActor.Flying = isFlying;
m_scene.SendAllSceneObjectsToClient(this);
}
@ -283,9 +283,17 @@ namespace OpenSim.Region.Environment.Scenes
{
Velocity = new LLVector3(0, 0, 0);
childAgent = true;
RemoveFromPhysicalScene();
//this.Pos = new LLVector3(128, 128, 70);
}
private void RemoveFromPhysicalScene()
{
m_scene.phyScene.RemoveAvatar( this.PhysActor );
}
/// <summary>
///
/// </summary>
@ -832,7 +840,18 @@ namespace OpenSim.Region.Environment.Scenes
public override void SetText(string text, Vector3 color, double alpha)
{
throw new Exception("The method or operation is not implemented.");
throw new Exception("Can't set Text on avatar.");
}
public void AddToPhysicalScene( )
{
PhysicsScene scene = m_scene.phyScene;
PhysicsVector pVec =
new PhysicsVector(AbsolutePosition.X, AbsolutePosition.Y,
AbsolutePosition.Z);
_physActor = scene.AddAvatar(pVec);
}
}
}