diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Tools/pCampBot/Behaviours/TwitchyBehaviour.cs (renamed from OpenSim/Tests/Clients/InstantMessage/IMClient.cs) | 66 |
1 files changed, 32 insertions, 34 deletions
diff --git a/OpenSim/Tests/Clients/InstantMessage/IMClient.cs b/OpenSim/Tools/pCampBot/Behaviours/TwitchyBehaviour.cs index e7304a2..7b4639d 100644 --- a/OpenSim/Tests/Clients/InstantMessage/IMClient.cs +++ b/OpenSim/Tools/pCampBot/Behaviours/TwitchyBehaviour.cs | |||
@@ -25,51 +25,49 @@ | |||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using OpenMetaverse; | ||
28 | using System; | 29 | using System; |
29 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
30 | using System.Text; | 31 | using System.Linq; |
31 | using System.Reflection; | 32 | using System.Reflection; |
32 | |||
33 | using OpenMetaverse; | ||
34 | using log4net; | 33 | using log4net; |
35 | using log4net.Appender; | 34 | using pCampBot.Interfaces; |
36 | using log4net.Layout; | ||
37 | 35 | ||
38 | using OpenSim.Framework; | 36 | namespace pCampBot |
39 | using OpenSim.Services.Interfaces; | ||
40 | using OpenSim.Services.Connectors.InstantMessage; | ||
41 | |||
42 | namespace OpenSim.Tests.Clients.InstantMessage | ||
43 | { | 37 | { |
44 | public class IMClient | 38 | /// <summary> |
39 | /// This behavior is for the systematic study of some performance improvements made | ||
40 | /// for OSCC'13. | ||
41 | /// Do nothing, but send AgentUpdate packets all the time that have only slightly | ||
42 | /// different state. The delta of difference will be filtered by OpenSim early on | ||
43 | /// in the packet processing pipeline. These filters did not exist before OSCC'13. | ||
44 | /// </summary> | ||
45 | public class TwitchyBehaviour : AbstractBehaviour | ||
45 | { | 46 | { |
46 | private static readonly ILog m_log = | 47 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
47 | LogManager.GetLogger( | ||
48 | MethodBase.GetCurrentMethod().DeclaringType); | ||
49 | |||
50 | public static void Main(string[] args) | ||
51 | { | ||
52 | ConsoleAppender consoleAppender = new ConsoleAppender(); | ||
53 | consoleAppender.Layout = | ||
54 | new PatternLayout("%date [%thread] %-5level %logger [%property{NDC}] - %message%newline"); | ||
55 | log4net.Config.BasicConfigurator.Configure(consoleAppender); | ||
56 | 48 | ||
57 | string serverURI = "http://127.0.0.1:8002"; | 49 | public TwitchyBehaviour() |
58 | GridInstantMessage im = new GridInstantMessage(); | 50 | { |
59 | im.fromAgentID = new Guid(); | 51 | AbbreviatedName = "tw"; |
60 | im.toAgentID = new Guid(); | 52 | Name = "Twitchy"; |
61 | im.message = "Hello"; | 53 | } |
62 | im.imSessionID = new Guid(); | 54 | |
55 | private const float TWITCH = 0.0001f; | ||
56 | private int direction = 1; | ||
57 | |||
58 | public override void Action() | ||
59 | { | ||
60 | Bot.Client.Self.Movement.BodyRotation = new Quaternion(Bot.Client.Self.Movement.BodyRotation.X + direction * TWITCH, | ||
61 | Bot.Client.Self.Movement.BodyRotation.Y, | ||
62 | Bot.Client.Self.Movement.BodyRotation.Z, | ||
63 | Bot.Client.Self.Movement.BodyRotation.W); | ||
63 | 64 | ||
64 | bool success = InstantMessageServiceConnector.SendInstantMessage(serverURI, im); | 65 | //m_log.DebugFormat("[TWITCH]: BodyRot {0}", Bot.Client.Self.Movement.BodyRotation); |
66 | direction = -direction; | ||
65 | 67 | ||
66 | if (success) | 68 | Bot.Client.Self.Movement.SendUpdate(); |
67 | m_log.InfoFormat("[IM CLIENT]: Successfully IMed {0}", serverURI); | ||
68 | else | ||
69 | m_log.InfoFormat("[IM CLIENT]: failed to IM {0}", serverURI); | ||
70 | 69 | ||
71 | System.Console.WriteLine("\n"); | ||
72 | } | 70 | } |
73 | 71 | ||
74 | } | 72 | } |
75 | } | 73 | } \ No newline at end of file |