From 648f55ed11eb11161a2c5939c0f4d6d7d61eaabd Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Sun, 22 Feb 2009 12:45:23 +0000 Subject: * 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. --- OpenSim/Client/MXP/ClientStack/MXPClientView.cs | 16 +++++++++++- .../Client/MXP/PacketHandler/MXPPacketServer.cs | 30 +++++++++++++++++++++- 2 files changed, 44 insertions(+), 2 deletions(-) (limited to 'OpenSim/Client/MXP') diff --git a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs index ccf3a1b..27bf078 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 2634717..1e343c4 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 { -- cgit v1.1