123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Net;
- using System.Reflection;
- using System.Text;
- using System.Threading;
- using log4net;
- using Nini.Config;
- using NUnit.Framework;
- using OpenMetaverse;
- using OpenSim.Framework;
- using OpenSim.Framework.Communications;
- using OpenSim.Framework.Servers;
- using OpenSim.Region.Framework.Interfaces;
- using OpenSim.Region.Framework.Scenes;
- using OpenSim.Region.CoreModules.Framework;
- using OpenSim.Tests.Common;
- namespace OpenSim.Tests.Common
- {
- public static class EntityTransferHelpers
- {
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
-
-
-
-
-
-
-
-
- public static void SetupInformClientOfNeighbourTriggersNeighbourClientCreate(
- TestClient tc, List<TestClient> neighbourTcs)
- {
-
-
- tc.OnTestClientInformClientOfNeighbour += (neighbourHandle, neighbourExternalEndPoint) =>
- {
- uint x, y;
- Util.RegionHandleToRegionLoc(neighbourHandle, out x, out y);
- m_log.DebugFormat(
- "[TEST CLIENT]: Processing inform client of neighbour located at {0},{1} at {2}",
- x, y, neighbourExternalEndPoint);
- AgentCircuitData newAgent = tc.RequestClientInfo();
- Scene neighbourScene;
- SceneManager.Instance.TryGetScene(x, y, out neighbourScene);
- TestClient neighbourTc = new TestClient(newAgent, neighbourScene);
- neighbourTcs.Add(neighbourTc);
- neighbourScene.AddNewAgent(neighbourTc, PresenceType.User);
- };
- }
-
-
-
-
-
-
-
-
-
- public static void SetupSendRegionTeleportTriggersDestinationClientCreateAndCompleteMovement(
- TestClient client, List<TestClient> destinationClients)
- {
- client.OnTestClientSendRegionTeleport
- += (regionHandle, simAccess, regionExternalEndPoint, locationID, flags, capsURL) =>
- {
- uint x, y;
- Util.RegionHandleToRegionLoc(regionHandle, out x, out y);
- m_log.DebugFormat(
- "[TEST CLIENT]: Processing send region teleport for destination at {0},{1} at {2}",
- x, y, regionExternalEndPoint);
- AgentCircuitData newAgent = client.RequestClientInfo();
- Scene destinationScene;
- SceneManager.Instance.TryGetScene(x, y, out destinationScene);
- TestClient destinationClient = new TestClient(newAgent, destinationScene);
- destinationClients.Add(destinationClient);
- destinationScene.AddNewAgent(destinationClient, PresenceType.User);
- ThreadPool.UnsafeQueueUserWorkItem(o => destinationClient.CompleteMovement(), null);
- };
- }
- }
- }
|