From 648f55ed11eb11161a2c5939c0f4d6d7d61eaabd Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Sun, 22 Feb 2009 12:45:23 +0000 Subject: [PATCH] * MXP Clients are now treated as full root agents - including being given a default avatar. * MXP Clients now are capable of displaying primitives and objects within the Scene. --- .../Client/MXP/ClientStack/MXPClientView.cs | 16 +++++++++- .../MXP/PacketHandler/MXPPacketServer.cs | 30 ++++++++++++++++++- 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs index ccf3a1ba31..27bf078214 100644 --- a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs +++ b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs @@ -365,7 +365,7 @@ namespace OpenSim.Client.MXP.ClientStack public void Start() { - // We dont do this + Scene.AddNewClient(this); } public void Stop() @@ -403,6 +403,18 @@ namespace OpenSim.Client.MXP.ClientStack public void SendRegionHandshake(RegionInfo regionInfo, RegionHandshakeArgs args) { + m_log.Info("[MXP] Completing Handshake to Region"); + + if (OnRegionHandShakeReply != null) + { + OnRegionHandShakeReply(this); + } + + if (OnCompleteMovementToRegion != null) + { + OnCompleteMovementToRegion(); + } + // Need to translate to MXP somehow } @@ -552,6 +564,8 @@ namespace OpenSim.Client.MXP.ClientStack private void MXPSendPrimitive(uint localID, UUID ownerID, Vector3 acc, Vector3 rvel, PrimitiveBaseShape primShape, Vector3 pos, UUID objectID, Vector3 vel, Quaternion rotation) { + m_log.Info("[MXP] Transmitting Primitive"); + PerceptionEventMessage pe = new PerceptionEventMessage(); pe.ObjectFragment.ObjectIndex = localID; diff --git a/OpenSim/Client/MXP/PacketHandler/MXPPacketServer.cs b/OpenSim/Client/MXP/PacketHandler/MXPPacketServer.cs index 26347170d0..1e343c4ee3 100644 --- a/OpenSim/Client/MXP/PacketHandler/MXPPacketServer.cs +++ b/OpenSim/Client/MXP/PacketHandler/MXPPacketServer.cs @@ -4,11 +4,13 @@ using System; using System.Collections.Generic; using System.Reflection; +using System.Threading; using log4net; using MXP; using MXP.Messages; using OpenMetaverse; using OpenSim.Client.MXP.ClientStack; +using OpenSim.Framework; using OpenSim.Region.Framework.Scenes; namespace OpenSim.Client.MXP.PacketHandler @@ -24,6 +26,8 @@ namespace OpenSim.Client.MXP.PacketHandler private readonly Transmitter transmitter; + private readonly Thread m_clientThread; + private readonly IList sessions = new List(); private readonly IList sessionsToClient = new List(); private readonly IList sessionsToRemove = new List(); @@ -48,6 +52,16 @@ namespace OpenSim.Client.MXP.PacketHandler programName = "OpenSimulator"; transmitter = new Transmitter(port); + + m_clientThread = new Thread(StartListener); + m_clientThread.Name = "MXPThread"; + m_clientThread.IsBackground = true; + m_clientThread.Start(); + ThreadTracker.Add(m_clientThread); + } + + public void StartListener() + { transmitter.Startup(); } @@ -255,9 +269,23 @@ namespace OpenSim.Client.MXP.PacketHandler MXPClientView client = new MXPClientView(session, mxpSessionID, target, joinRequestMessage.ParticipantName); + m_log.Info("[MXP ClientStack] Created Client"); Clients.Add(client); - target.AddNewClient(client); + m_log.Info("[MXP ClientStack] Adding to Scene"); + target.ClientManager.Add(client.CircuitCode, client); + + m_log.Info("[MXP ClientStack] Initialising..."); + try + { + client.Start(); + } catch( Exception e) + { + m_log.Info(e); + } + + m_log.Info("[MXP ClientStack] Connected"); + //target.EventManager.TriggerOnNewClient(client); } else {