aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ExportBot/Commands/ShowEffectsCommand.cs
diff options
context:
space:
mode:
authorgareth2007-05-08 00:10:04 +0000
committergareth2007-05-08 00:10:04 +0000
commit5b6afeafbc249ba88dcc20d1fbc98ce12418b21b (patch)
tree78861e5f6ae871d63c83b4ab1cc4c55ea184ed6d /ExportBot/Commands/ShowEffectsCommand.cs
parentZOMG! (diff)
downloadopensim-SC_OLD-5b6afeafbc249ba88dcc20d1fbc98ce12418b21b.zip
opensim-SC_OLD-5b6afeafbc249ba88dcc20d1fbc98ce12418b21b.tar.gz
opensim-SC_OLD-5b6afeafbc249ba88dcc20d1fbc98ce12418b21b.tar.bz2
opensim-SC_OLD-5b6afeafbc249ba88dcc20d1fbc98ce12418b21b.tar.xz
Brought in TestClient code for teh fork
Diffstat (limited to 'ExportBot/Commands/ShowEffectsCommand.cs')
-rw-r--r--ExportBot/Commands/ShowEffectsCommand.cs76
1 files changed, 76 insertions, 0 deletions
diff --git a/ExportBot/Commands/ShowEffectsCommand.cs b/ExportBot/Commands/ShowEffectsCommand.cs
new file mode 100644
index 0000000..c0b20a7
--- /dev/null
+++ b/ExportBot/Commands/ShowEffectsCommand.cs
@@ -0,0 +1,76 @@
1using System;
2using libsecondlife;
3
4namespace libsecondlife.TestClient
5{
6 public class ShowEffectsCommand : Command
7 {
8 bool ShowEffects = false;
9
10 public ShowEffectsCommand(TestClient testClient)
11 {
12 Name = "showeffects";
13 Description = "Prints out information for every viewer effect that is received. Usage: showeffects [on/off]";
14
15 testClient.Avatars.OnEffect += new AvatarManager.EffectCallback(Avatars_OnEffect);
16 testClient.Avatars.OnLookAt += new AvatarManager.LookAtCallback(Avatars_OnLookAt);
17 testClient.Avatars.OnPointAt += new AvatarManager.PointAtCallback(Avatars_OnPointAt);
18 }
19
20 public override string Execute(string[] args, LLUUID fromAgentID)
21 {
22 if (args.Length == 0)
23 {
24 ShowEffects = true;
25 return "Viewer effects will be shown on the console";
26 }
27 else if (args.Length == 1)
28 {
29 if (args[0] == "on")
30 {
31 ShowEffects = true;
32 return "Viewer effects will be shown on the console";
33 }
34 else
35 {
36 ShowEffects = false;
37 return "Viewer effects will not be shown";
38 }
39 }
40 else
41 {
42 return "Usage: showeffects [on/off]";
43 }
44 }
45
46 private void Avatars_OnPointAt(LLUUID sourceID, LLUUID targetID, LLVector3d targetPos,
47 MainAvatar.PointAtType pointType, float duration, LLUUID id)
48 {
49 if (ShowEffects)
50 Console.WriteLine(
51 "ViewerEffect [PointAt]: SourceID: {0} TargetID: {1} TargetPos: {2} Type: {3} Duration: {4} ID: {5}",
52 sourceID.ToStringHyphenated(), targetID.ToStringHyphenated(), targetPos, pointType, duration,
53 id.ToStringHyphenated());
54 }
55
56 private void Avatars_OnLookAt(LLUUID sourceID, LLUUID targetID, LLVector3d targetPos,
57 MainAvatar.LookAtType lookType, float duration, LLUUID id)
58 {
59 if (ShowEffects)
60 Console.WriteLine(
61 "ViewerEffect [LookAt]: SourceID: {0} TargetID: {1} TargetPos: {2} Type: {3} Duration: {4} ID: {5}",
62 sourceID.ToStringHyphenated(), targetID.ToStringHyphenated(), targetPos, lookType, duration,
63 id.ToStringHyphenated());
64 }
65
66 private void Avatars_OnEffect(MainAvatar.EffectType type, LLUUID sourceID, LLUUID targetID,
67 LLVector3d targetPos, float duration, LLUUID id)
68 {
69 if (ShowEffects)
70 Console.WriteLine(
71 "ViewerEffect [{0}]: SourceID: {1} TargetID: {2} TargetPos: {3} Duration: {4} ID: {5}",
72 type, sourceID.ToStringHyphenated(), targetID.ToStringHyphenated(), targetPos, duration,
73 id.ToStringHyphenated());
74 }
75 }
76}