diff options
author | Jeff Ames | 2008-03-14 00:41:09 +0000 |
---|---|---|
committer | Jeff Ames | 2008-03-14 00:41:09 +0000 |
commit | 94c39c793aba7d0ef1159c91a3ee598b18514240 (patch) | |
tree | 6d17978752df1dcd4003fe62e2ae68eeef056022 /OpenSim/Region/Examples/SimpleModule | |
parent | some hackery with the VectorRenderModule to let you pass in a canvas (diff) | |
download | opensim-SC_OLD-94c39c793aba7d0ef1159c91a3ee598b18514240.zip opensim-SC_OLD-94c39c793aba7d0ef1159c91a3ee598b18514240.tar.gz opensim-SC_OLD-94c39c793aba7d0ef1159c91a3ee598b18514240.tar.bz2 opensim-SC_OLD-94c39c793aba7d0ef1159c91a3ee598b18514240.tar.xz |
Update svn properties.
Diffstat (limited to 'OpenSim/Region/Examples/SimpleModule')
-rw-r--r-- | OpenSim/Region/Examples/SimpleModule/ComplexObject.cs | 272 | ||||
-rw-r--r-- | OpenSim/Region/Examples/SimpleModule/CpuCounterObject.cs | 136 | ||||
-rw-r--r-- | OpenSim/Region/Examples/SimpleModule/FileSystemObject.cs | 104 | ||||
-rw-r--r-- | OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs | 1108 | ||||
-rw-r--r-- | OpenSim/Region/Examples/SimpleModule/Properties/AssemblyInfo.cs | 72 | ||||
-rw-r--r-- | OpenSim/Region/Examples/SimpleModule/README.txt | 18 | ||||
-rw-r--r-- | OpenSim/Region/Examples/SimpleModule/RegionModule.cs | 228 |
7 files changed, 969 insertions, 969 deletions
diff --git a/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs b/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs index 42f517c..9941304 100644 --- a/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs +++ b/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs | |||
@@ -1,137 +1,137 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSim Project nor the | 12 | * * Neither the name of the OpenSim Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
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 | 28 | ||
29 | using libsecondlife; | 29 | using libsecondlife; |
30 | using OpenSim.Framework; | 30 | using OpenSim.Framework; |
31 | using OpenSim.Region.Environment.Scenes; | 31 | using OpenSim.Region.Environment.Scenes; |
32 | 32 | ||
33 | namespace OpenSim.Region.Examples.SimpleModule | 33 | namespace OpenSim.Region.Examples.SimpleModule |
34 | { | 34 | { |
35 | public class ComplexObject : SceneObjectGroup | 35 | public class ComplexObject : SceneObjectGroup |
36 | { | 36 | { |
37 | private readonly LLQuaternion m_rotationDirection; | 37 | private readonly LLQuaternion m_rotationDirection; |
38 | 38 | ||
39 | protected override bool InSceneBackup | 39 | protected override bool InSceneBackup |
40 | { | 40 | { |
41 | get | 41 | get |
42 | { | 42 | { |
43 | return false; | 43 | return false; |
44 | } | 44 | } |
45 | } | 45 | } |
46 | 46 | ||
47 | private class RotatingWheel : SceneObjectPart | 47 | private class RotatingWheel : SceneObjectPart |
48 | { | 48 | { |
49 | private readonly LLQuaternion m_rotationDirection; | 49 | private readonly LLQuaternion m_rotationDirection; |
50 | 50 | ||
51 | public RotatingWheel() | 51 | public RotatingWheel() |
52 | { | 52 | { |
53 | 53 | ||
54 | } | 54 | } |
55 | 55 | ||
56 | public RotatingWheel(ulong regionHandle, SceneObjectGroup parent, LLUUID ownerID, uint localID, | 56 | public RotatingWheel(ulong regionHandle, SceneObjectGroup parent, LLUUID ownerID, uint localID, |
57 | LLVector3 groupPosition, LLVector3 offsetPosition, LLQuaternion rotationDirection) | 57 | LLVector3 groupPosition, LLVector3 offsetPosition, LLQuaternion rotationDirection) |
58 | : base( | 58 | : base( |
59 | regionHandle, parent, ownerID, localID, PrimitiveBaseShape.Default, groupPosition, offsetPosition | 59 | regionHandle, parent, ownerID, localID, PrimitiveBaseShape.Default, groupPosition, offsetPosition |
60 | ) | 60 | ) |
61 | { | 61 | { |
62 | m_rotationDirection = rotationDirection; | 62 | m_rotationDirection = rotationDirection; |
63 | 63 | ||
64 | Flags |= LLObject.ObjectFlags.Touch; | 64 | Flags |= LLObject.ObjectFlags.Touch; |
65 | } | 65 | } |
66 | 66 | ||
67 | public override void UpdateMovement() | 67 | public override void UpdateMovement() |
68 | { | 68 | { |
69 | UpdateRotation(RotationOffset*m_rotationDirection); | 69 | UpdateRotation(RotationOffset*m_rotationDirection); |
70 | } | 70 | } |
71 | } | 71 | } |
72 | 72 | ||
73 | public override void UpdateMovement() | 73 | public override void UpdateMovement() |
74 | { | 74 | { |
75 | UpdateGroupRotation(GroupRotation*m_rotationDirection); | 75 | UpdateGroupRotation(GroupRotation*m_rotationDirection); |
76 | 76 | ||
77 | base.UpdateMovement(); | 77 | base.UpdateMovement(); |
78 | } | 78 | } |
79 | 79 | ||
80 | public ComplexObject() | 80 | public ComplexObject() |
81 | { | 81 | { |
82 | 82 | ||
83 | } | 83 | } |
84 | 84 | ||
85 | public ComplexObject(Scene scene, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos) | 85 | public ComplexObject(Scene scene, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos) |
86 | : base(scene, regionHandle, ownerID, localID, pos, PrimitiveBaseShape.Default) | 86 | : base(scene, regionHandle, ownerID, localID, pos, PrimitiveBaseShape.Default) |
87 | { | 87 | { |
88 | m_rotationDirection = new LLQuaternion(0.05f, 0.1f, 0.15f); | 88 | m_rotationDirection = new LLQuaternion(0.05f, 0.1f, 0.15f); |
89 | 89 | ||
90 | AddPart( | 90 | AddPart( |
91 | new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(0, 0, 0.75f), | 91 | new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(0, 0, 0.75f), |
92 | new LLQuaternion(0.05f, 0, 0))); | 92 | new LLQuaternion(0.05f, 0, 0))); |
93 | AddPart( | 93 | AddPart( |
94 | new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(0, 0, -0.75f), | 94 | new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(0, 0, -0.75f), |
95 | new LLQuaternion(-0.05f, 0, 0))); | 95 | new LLQuaternion(-0.05f, 0, 0))); |
96 | 96 | ||
97 | AddPart( | 97 | AddPart( |
98 | new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(0, 0.75f, 0), | 98 | new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(0, 0.75f, 0), |
99 | new LLQuaternion(0.5f, 0, 0.05f))); | 99 | new LLQuaternion(0.5f, 0, 0.05f))); |
100 | AddPart( | 100 | AddPart( |
101 | new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(0, -0.75f, 0), | 101 | new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(0, -0.75f, 0), |
102 | new LLQuaternion(-0.5f, 0, -0.05f))); | 102 | new LLQuaternion(-0.5f, 0, -0.05f))); |
103 | 103 | ||
104 | AddPart( | 104 | AddPart( |
105 | new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(0.75f, 0, 0), | 105 | new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(0.75f, 0, 0), |
106 | new LLQuaternion(0, 0.5f, 0.05f))); | 106 | new LLQuaternion(0, 0.5f, 0.05f))); |
107 | AddPart( | 107 | AddPart( |
108 | new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(-0.75f, 0, 0), | 108 | new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new LLVector3(-0.75f, 0, 0), |
109 | new LLQuaternion(0, -0.5f, -0.05f))); | 109 | new LLQuaternion(0, -0.5f, -0.05f))); |
110 | 110 | ||
111 | RootPart.Flags |= LLObject.ObjectFlags.Touch; | 111 | RootPart.Flags |= LLObject.ObjectFlags.Touch; |
112 | 112 | ||
113 | UpdateParentIDs(); | 113 | UpdateParentIDs(); |
114 | } | 114 | } |
115 | 115 | ||
116 | public override void OnGrabPart(SceneObjectPart part, LLVector3 offsetPos, IClientAPI remoteClient) | 116 | public override void OnGrabPart(SceneObjectPart part, LLVector3 offsetPos, IClientAPI remoteClient) |
117 | { | 117 | { |
118 | m_parts.Remove(part.UUID); | 118 | m_parts.Remove(part.UUID); |
119 | 119 | ||
120 | remoteClient.SendKillObject(m_regionHandle, part.LocalId); | 120 | remoteClient.SendKillObject(m_regionHandle, part.LocalId); |
121 | remoteClient.AddMoney(1); | 121 | remoteClient.AddMoney(1); |
122 | remoteClient.SendChatMessage("Poof!", 1, AbsolutePosition, "Party Party", LLUUID.Zero); | 122 | remoteClient.SendChatMessage("Poof!", 1, AbsolutePosition, "Party Party", LLUUID.Zero); |
123 | } | 123 | } |
124 | 124 | ||
125 | public override void OnGrabGroup(LLVector3 offsetPos, IClientAPI remoteClient) | 125 | public override void OnGrabGroup(LLVector3 offsetPos, IClientAPI remoteClient) |
126 | { | 126 | { |
127 | if (m_parts.Count == 1) | 127 | if (m_parts.Count == 1) |
128 | { | 128 | { |
129 | m_parts.Remove(m_rootPart.UUID); | 129 | m_parts.Remove(m_rootPart.UUID); |
130 | m_scene.RemoveEntity(this); | 130 | m_scene.RemoveEntity(this); |
131 | remoteClient.SendKillObject(m_regionHandle, m_rootPart.LocalId); | 131 | remoteClient.SendKillObject(m_regionHandle, m_rootPart.LocalId); |
132 | remoteClient.AddMoney(50); | 132 | remoteClient.AddMoney(50); |
133 | remoteClient.SendChatMessage("KABLAM!!!", 1, AbsolutePosition, "Groupie Groupie", LLUUID.Zero); | 133 | remoteClient.SendChatMessage("KABLAM!!!", 1, AbsolutePosition, "Groupie Groupie", LLUUID.Zero); |
134 | } | 134 | } |
135 | } | 135 | } |
136 | } | 136 | } |
137 | } \ No newline at end of file | 137 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Examples/SimpleModule/CpuCounterObject.cs b/OpenSim/Region/Examples/SimpleModule/CpuCounterObject.cs index 75f289b..184c1b7 100644 --- a/OpenSim/Region/Examples/SimpleModule/CpuCounterObject.cs +++ b/OpenSim/Region/Examples/SimpleModule/CpuCounterObject.cs | |||
@@ -1,69 +1,69 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSim Project nor the | 12 | * * Neither the name of the OpenSim Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
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 | 28 | ||
29 | using System; | 29 | using System; |
30 | using System.Diagnostics; | 30 | using System.Diagnostics; |
31 | using libsecondlife; | 31 | using libsecondlife; |
32 | using OpenSim.Framework; | 32 | using OpenSim.Framework; |
33 | using OpenSim.Region.Environment.Scenes; | 33 | using OpenSim.Region.Environment.Scenes; |
34 | 34 | ||
35 | namespace OpenSim.Region.Examples.SimpleModule | 35 | namespace OpenSim.Region.Examples.SimpleModule |
36 | { | 36 | { |
37 | public class CpuCounterObject : SceneObjectGroup | 37 | public class CpuCounterObject : SceneObjectGroup |
38 | { | 38 | { |
39 | protected override bool InSceneBackup | 39 | protected override bool InSceneBackup |
40 | { | 40 | { |
41 | get | 41 | get |
42 | { | 42 | { |
43 | return false; | 43 | return false; |
44 | } | 44 | } |
45 | } | 45 | } |
46 | 46 | ||
47 | private PerformanceCounter m_counter; | 47 | private PerformanceCounter m_counter; |
48 | 48 | ||
49 | public CpuCounterObject(Scene world, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos) | 49 | public CpuCounterObject(Scene world, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos) |
50 | : base(world, regionHandle, ownerID, localID, pos, PrimitiveBaseShape.Default) | 50 | : base(world, regionHandle, ownerID, localID, pos, PrimitiveBaseShape.Default) |
51 | { | 51 | { |
52 | String objectName = "Processor"; | 52 | String objectName = "Processor"; |
53 | String counterName = "% Processor Time"; | 53 | String counterName = "% Processor Time"; |
54 | String instanceName = "_Total"; | 54 | String instanceName = "_Total"; |
55 | 55 | ||
56 | m_counter = new PerformanceCounter(objectName, counterName, instanceName); | 56 | m_counter = new PerformanceCounter(objectName, counterName, instanceName); |
57 | } | 57 | } |
58 | 58 | ||
59 | public override void UpdateMovement() | 59 | public override void UpdateMovement() |
60 | { | 60 | { |
61 | float cpu = m_counter.NextValue()/40f; | 61 | float cpu = m_counter.NextValue()/40f; |
62 | LLVector3 size = new LLVector3(cpu, cpu, cpu); | 62 | LLVector3 size = new LLVector3(cpu, cpu, cpu); |
63 | 63 | ||
64 | RootPart.Resize( size ); | 64 | RootPart.Resize( size ); |
65 | 65 | ||
66 | base.UpdateMovement(); | 66 | base.UpdateMovement(); |
67 | } | 67 | } |
68 | } | 68 | } |
69 | } \ No newline at end of file | 69 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Examples/SimpleModule/FileSystemObject.cs b/OpenSim/Region/Examples/SimpleModule/FileSystemObject.cs index 6e06c63..84e8fa5 100644 --- a/OpenSim/Region/Examples/SimpleModule/FileSystemObject.cs +++ b/OpenSim/Region/Examples/SimpleModule/FileSystemObject.cs | |||
@@ -1,53 +1,53 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSim Project nor the | 12 | * * Neither the name of the OpenSim Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
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 | 28 | ||
29 | using System.IO; | 29 | using System.IO; |
30 | using libsecondlife; | 30 | using libsecondlife; |
31 | using OpenSim.Framework; | 31 | using OpenSim.Framework; |
32 | using OpenSim.Region.Environment.Scenes; | 32 | using OpenSim.Region.Environment.Scenes; |
33 | 33 | ||
34 | namespace OpenSim.Region.Examples.SimpleModule | 34 | namespace OpenSim.Region.Examples.SimpleModule |
35 | { | 35 | { |
36 | public class FileSystemObject : SceneObjectGroup | 36 | public class FileSystemObject : SceneObjectGroup |
37 | { | 37 | { |
38 | public FileSystemObject(Scene world, FileInfo fileInfo, LLVector3 pos) | 38 | public FileSystemObject(Scene world, FileInfo fileInfo, LLVector3 pos) |
39 | : base(world, world.RegionInfo.RegionHandle, LLUUID.Zero, world.NextLocalId, pos, PrimitiveBaseShape.Default) | 39 | : base(world, world.RegionInfo.RegionHandle, LLUUID.Zero, world.NextLocalId, pos, PrimitiveBaseShape.Default) |
40 | { | 40 | { |
41 | Text = fileInfo.Name; | 41 | Text = fileInfo.Name; |
42 | ScheduleGroupForFullUpdate(); | 42 | ScheduleGroupForFullUpdate(); |
43 | } | 43 | } |
44 | 44 | ||
45 | protected override bool InSceneBackup | 45 | protected override bool InSceneBackup |
46 | { | 46 | { |
47 | get | 47 | get |
48 | { | 48 | { |
49 | return false; | 49 | return false; |
50 | } | 50 | } |
51 | } | 51 | } |
52 | } | 52 | } |
53 | } \ No newline at end of file | 53 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs index 38d999b..d0241f8 100644 --- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs | |||
@@ -1,555 +1,555 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSim Project nor the | 12 | * * Neither the name of the OpenSim Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
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 | 28 | ||
29 | using System; | 29 | using System; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Net; | 31 | using System.Net; |
32 | using libsecondlife; | 32 | using libsecondlife; |
33 | using libsecondlife.Packets; | 33 | using libsecondlife.Packets; |
34 | using OpenSim.Framework; | 34 | using OpenSim.Framework; |
35 | using OpenSim.Region.Environment.Scenes; | 35 | using OpenSim.Region.Environment.Scenes; |
36 | 36 | ||
37 | namespace OpenSim.Region.Examples.SimpleModule | 37 | namespace OpenSim.Region.Examples.SimpleModule |
38 | { | 38 | { |
39 | public class MyNpcCharacter : IClientAPI | 39 | public class MyNpcCharacter : IClientAPI |
40 | { | 40 | { |
41 | private uint movementFlag = 0; | 41 | private uint movementFlag = 0; |
42 | private short flyState = 0; | 42 | private short flyState = 0; |
43 | private LLQuaternion bodyDirection = LLQuaternion.Identity; | 43 | private LLQuaternion bodyDirection = LLQuaternion.Identity; |
44 | private short count = 0; | 44 | private short count = 0; |
45 | 45 | ||
46 | #pragma warning disable 67 | 46 | #pragma warning disable 67 |
47 | 47 | ||
48 | public event Action<IClientAPI> OnLogout; | 48 | public event Action<IClientAPI> OnLogout; |
49 | public event ObjectPermissions OnObjectPermissions; | 49 | public event ObjectPermissions OnObjectPermissions; |
50 | 50 | ||
51 | public event MoneyTransferRequest OnMoneyTransferRequest; | 51 | public event MoneyTransferRequest OnMoneyTransferRequest; |
52 | public event Action<IClientAPI> OnConnectionClosed; | 52 | public event Action<IClientAPI> OnConnectionClosed; |
53 | 53 | ||
54 | public event ImprovedInstantMessage OnInstantMessage; | 54 | public event ImprovedInstantMessage OnInstantMessage; |
55 | public event ChatFromViewer OnChatFromViewer; | 55 | public event ChatFromViewer OnChatFromViewer; |
56 | public event TextureRequest OnRequestTexture; | 56 | public event TextureRequest OnRequestTexture; |
57 | public event RezObject OnRezObject; | 57 | public event RezObject OnRezObject; |
58 | public event ModifyTerrain OnModifyTerrain; | 58 | public event ModifyTerrain OnModifyTerrain; |
59 | public event SetAppearance OnSetAppearance; | 59 | public event SetAppearance OnSetAppearance; |
60 | public event AvatarNowWearing OnAvatarNowWearing; | 60 | public event AvatarNowWearing OnAvatarNowWearing; |
61 | public event RezSingleAttachmentFromInv OnRezSingleAttachmentFromInv; | 61 | public event RezSingleAttachmentFromInv OnRezSingleAttachmentFromInv; |
62 | public event ObjectAttach OnObjectAttach; | 62 | public event ObjectAttach OnObjectAttach; |
63 | public event StartAnim OnStartAnim; | 63 | public event StartAnim OnStartAnim; |
64 | public event StopAnim OnStopAnim; | 64 | public event StopAnim OnStopAnim; |
65 | public event LinkObjects OnLinkObjects; | 65 | public event LinkObjects OnLinkObjects; |
66 | public event DelinkObjects OnDelinkObjects; | 66 | public event DelinkObjects OnDelinkObjects; |
67 | public event RequestMapBlocks OnRequestMapBlocks; | 67 | public event RequestMapBlocks OnRequestMapBlocks; |
68 | public event RequestMapName OnMapNameRequest; | 68 | public event RequestMapName OnMapNameRequest; |
69 | public event TeleportLocationRequest OnTeleportLocationRequest; | 69 | public event TeleportLocationRequest OnTeleportLocationRequest; |
70 | public event DisconnectUser OnDisconnectUser; | 70 | public event DisconnectUser OnDisconnectUser; |
71 | public event RequestAvatarProperties OnRequestAvatarProperties; | 71 | public event RequestAvatarProperties OnRequestAvatarProperties; |
72 | public event SetAlwaysRun OnSetAlwaysRun; | 72 | public event SetAlwaysRun OnSetAlwaysRun; |
73 | 73 | ||
74 | public event GenericCall4 OnDeRezObject; | 74 | public event GenericCall4 OnDeRezObject; |
75 | public event Action<IClientAPI> OnRegionHandShakeReply; | 75 | public event Action<IClientAPI> OnRegionHandShakeReply; |
76 | public event GenericCall2 OnRequestWearables; | 76 | public event GenericCall2 OnRequestWearables; |
77 | public event GenericCall2 OnCompleteMovementToRegion; | 77 | public event GenericCall2 OnCompleteMovementToRegion; |
78 | public event UpdateAgent OnAgentUpdate; | 78 | public event UpdateAgent OnAgentUpdate; |
79 | public event AgentRequestSit OnAgentRequestSit; | 79 | public event AgentRequestSit OnAgentRequestSit; |
80 | public event AgentSit OnAgentSit; | 80 | public event AgentSit OnAgentSit; |
81 | public event AvatarPickerRequest OnAvatarPickerRequest; | 81 | public event AvatarPickerRequest OnAvatarPickerRequest; |
82 | public event Action<IClientAPI> OnRequestAvatarsData; | 82 | public event Action<IClientAPI> OnRequestAvatarsData; |
83 | public event AddNewPrim OnAddPrim; | 83 | public event AddNewPrim OnAddPrim; |
84 | public event RequestGodlikePowers OnRequestGodlikePowers; | 84 | public event RequestGodlikePowers OnRequestGodlikePowers; |
85 | public event GodKickUser OnGodKickUser; | 85 | public event GodKickUser OnGodKickUser; |
86 | public event ObjectDuplicate OnObjectDuplicate; | 86 | public event ObjectDuplicate OnObjectDuplicate; |
87 | public event UpdateVector OnGrabObject; | 87 | public event UpdateVector OnGrabObject; |
88 | public event ObjectSelect OnDeGrabObject; | 88 | public event ObjectSelect OnDeGrabObject; |
89 | public event MoveObject OnGrabUpdate; | 89 | public event MoveObject OnGrabUpdate; |
90 | public event ViewerEffectEventHandler OnViewerEffect; | 90 | public event ViewerEffectEventHandler OnViewerEffect; |
91 | 91 | ||
92 | public event FetchInventory OnAgentDataUpdateRequest; | 92 | public event FetchInventory OnAgentDataUpdateRequest; |
93 | public event FetchInventory OnUserInfoRequest; | 93 | public event FetchInventory OnUserInfoRequest; |
94 | public event TeleportLocationRequest OnSetStartLocationRequest; | 94 | public event TeleportLocationRequest OnSetStartLocationRequest; |
95 | 95 | ||
96 | public event UpdateShape OnUpdatePrimShape; | 96 | public event UpdateShape OnUpdatePrimShape; |
97 | public event ObjectExtraParams OnUpdateExtraParams; | 97 | public event ObjectExtraParams OnUpdateExtraParams; |
98 | public event RequestObjectPropertiesFamily OnRequestObjectPropertiesFamily; | 98 | public event RequestObjectPropertiesFamily OnRequestObjectPropertiesFamily; |
99 | public event ObjectSelect OnObjectSelect; | 99 | public event ObjectSelect OnObjectSelect; |
100 | public event GenericCall7 OnObjectDescription; | 100 | public event GenericCall7 OnObjectDescription; |
101 | public event GenericCall7 OnObjectName; | 101 | public event GenericCall7 OnObjectName; |
102 | public event UpdatePrimFlags OnUpdatePrimFlags; | 102 | public event UpdatePrimFlags OnUpdatePrimFlags; |
103 | public event UpdatePrimTexture OnUpdatePrimTexture; | 103 | public event UpdatePrimTexture OnUpdatePrimTexture; |
104 | public event UpdateVector OnUpdatePrimGroupPosition; | 104 | public event UpdateVector OnUpdatePrimGroupPosition; |
105 | public event UpdateVector OnUpdatePrimSinglePosition; | 105 | public event UpdateVector OnUpdatePrimSinglePosition; |
106 | public event UpdatePrimRotation OnUpdatePrimGroupRotation; | 106 | public event UpdatePrimRotation OnUpdatePrimGroupRotation; |
107 | public event UpdatePrimSingleRotation OnUpdatePrimSingleRotation; | 107 | public event UpdatePrimSingleRotation OnUpdatePrimSingleRotation; |
108 | public event UpdatePrimGroupRotation OnUpdatePrimGroupMouseRotation; | 108 | public event UpdatePrimGroupRotation OnUpdatePrimGroupMouseRotation; |
109 | public event UpdateVector OnUpdatePrimScale; | 109 | public event UpdateVector OnUpdatePrimScale; |
110 | public event StatusChange OnChildAgentStatus; | 110 | public event StatusChange OnChildAgentStatus; |
111 | public event GenericCall2 OnStopMovement; | 111 | public event GenericCall2 OnStopMovement; |
112 | public event Action<LLUUID> OnRemoveAvatar; | 112 | public event Action<LLUUID> OnRemoveAvatar; |
113 | 113 | ||
114 | public event CreateNewInventoryItem OnCreateNewInventoryItem; | 114 | public event CreateNewInventoryItem OnCreateNewInventoryItem; |
115 | public event CreateInventoryFolder OnCreateNewInventoryFolder; | 115 | public event CreateInventoryFolder OnCreateNewInventoryFolder; |
116 | public event UpdateInventoryFolder OnUpdateInventoryFolder; | 116 | public event UpdateInventoryFolder OnUpdateInventoryFolder; |
117 | public event MoveInventoryFolder OnMoveInventoryFolder; | 117 | public event MoveInventoryFolder OnMoveInventoryFolder; |
118 | public event RemoveInventoryFolder OnRemoveInventoryFolder; | 118 | public event RemoveInventoryFolder OnRemoveInventoryFolder; |
119 | public event RemoveInventoryItem OnRemoveInventoryItem; | 119 | public event RemoveInventoryItem OnRemoveInventoryItem; |
120 | public event FetchInventoryDescendents OnFetchInventoryDescendents; | 120 | public event FetchInventoryDescendents OnFetchInventoryDescendents; |
121 | public event PurgeInventoryDescendents OnPurgeInventoryDescendents; | 121 | public event PurgeInventoryDescendents OnPurgeInventoryDescendents; |
122 | public event FetchInventory OnFetchInventory; | 122 | public event FetchInventory OnFetchInventory; |
123 | public event RequestTaskInventory OnRequestTaskInventory; | 123 | public event RequestTaskInventory OnRequestTaskInventory; |
124 | public event UpdateInventoryItem OnUpdateInventoryItem; | 124 | public event UpdateInventoryItem OnUpdateInventoryItem; |
125 | public event CopyInventoryItem OnCopyInventoryItem; | 125 | public event CopyInventoryItem OnCopyInventoryItem; |
126 | public event MoveInventoryItem OnMoveInventoryItem; | 126 | public event MoveInventoryItem OnMoveInventoryItem; |
127 | public event UDPAssetUploadRequest OnAssetUploadRequest; | 127 | public event UDPAssetUploadRequest OnAssetUploadRequest; |
128 | public event XferReceive OnXferReceive; | 128 | public event XferReceive OnXferReceive; |
129 | public event RequestXfer OnRequestXfer; | 129 | public event RequestXfer OnRequestXfer; |
130 | public event ConfirmXfer OnConfirmXfer; | 130 | public event ConfirmXfer OnConfirmXfer; |
131 | public event RezScript OnRezScript; | 131 | public event RezScript OnRezScript; |
132 | public event UpdateTaskInventory OnUpdateTaskInventory; | 132 | public event UpdateTaskInventory OnUpdateTaskInventory; |
133 | public event RemoveTaskInventory OnRemoveTaskItem; | 133 | public event RemoveTaskInventory OnRemoveTaskItem; |
134 | public event RequestAsset OnRequestAsset; | 134 | public event RequestAsset OnRequestAsset; |
135 | 135 | ||
136 | public event UUIDNameRequest OnNameFromUUIDRequest; | 136 | public event UUIDNameRequest OnNameFromUUIDRequest; |
137 | 137 | ||
138 | public event ParcelPropertiesRequest OnParcelPropertiesRequest; | 138 | public event ParcelPropertiesRequest OnParcelPropertiesRequest; |
139 | public event ParcelDivideRequest OnParcelDivideRequest; | 139 | public event ParcelDivideRequest OnParcelDivideRequest; |
140 | public event ParcelJoinRequest OnParcelJoinRequest; | 140 | public event ParcelJoinRequest OnParcelJoinRequest; |
141 | public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest; | 141 | public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest; |
142 | 142 | ||
143 | public event ParcelAccessListRequest OnParcelAccessListRequest; | 143 | public event ParcelAccessListRequest OnParcelAccessListRequest; |
144 | public event ParcelAccessListUpdateRequest OnParcelAccessListUpdateRequest; | 144 | public event ParcelAccessListUpdateRequest OnParcelAccessListUpdateRequest; |
145 | public event ParcelSelectObjects OnParcelSelectObjects; | 145 | public event ParcelSelectObjects OnParcelSelectObjects; |
146 | public event ParcelObjectOwnerRequest OnParcelObjectOwnerRequest; | 146 | public event ParcelObjectOwnerRequest OnParcelObjectOwnerRequest; |
147 | public event ObjectDeselect OnObjectDeselect; | 147 | public event ObjectDeselect OnObjectDeselect; |
148 | public event EstateOwnerMessageRequest OnEstateOwnerMessage; | 148 | public event EstateOwnerMessageRequest OnEstateOwnerMessage; |
149 | public event RegionInfoRequest OnRegionInfoRequest; | 149 | public event RegionInfoRequest OnRegionInfoRequest; |
150 | public event EstateCovenantRequest OnEstateCovenantRequest; | 150 | public event EstateCovenantRequest OnEstateCovenantRequest; |
151 | 151 | ||
152 | public event FriendActionDelegate OnApproveFriendRequest; | 152 | public event FriendActionDelegate OnApproveFriendRequest; |
153 | public event FriendActionDelegate OnDenyFriendRequest; | 153 | public event FriendActionDelegate OnDenyFriendRequest; |
154 | public event FriendshipTermination OnTerminateFriendship; | 154 | public event FriendshipTermination OnTerminateFriendship; |
155 | public event PacketStats OnPacketStats; | 155 | public event PacketStats OnPacketStats; |
156 | public event MoneyBalanceRequest OnMoneyBalanceRequest; | 156 | public event MoneyBalanceRequest OnMoneyBalanceRequest; |
157 | public event UpdateAvatarProperties OnUpdateAvatarProperties; | 157 | public event UpdateAvatarProperties OnUpdateAvatarProperties; |
158 | 158 | ||
159 | 159 | ||
160 | #pragma warning restore 67 | 160 | #pragma warning restore 67 |
161 | 161 | ||
162 | private LLUUID myID = LLUUID.Random(); | 162 | private LLUUID myID = LLUUID.Random(); |
163 | 163 | ||
164 | public MyNpcCharacter(EventManager eventManager) | 164 | public MyNpcCharacter(EventManager eventManager) |
165 | { | 165 | { |
166 | // startPos = new LLVector3(128, (float)(Util.RandomClass.NextDouble()*100), 2); | 166 | // startPos = new LLVector3(128, (float)(Util.RandomClass.NextDouble()*100), 2); |
167 | eventManager.OnFrame += Update; | 167 | eventManager.OnFrame += Update; |
168 | } | 168 | } |
169 | 169 | ||
170 | private LLVector3 startPos = new LLVector3(128, 128, 2); | 170 | private LLVector3 startPos = new LLVector3(128, 128, 2); |
171 | 171 | ||
172 | public virtual LLVector3 StartPos | 172 | public virtual LLVector3 StartPos |
173 | { | 173 | { |
174 | get { return startPos; } | 174 | get { return startPos; } |
175 | set { } | 175 | set { } |
176 | } | 176 | } |
177 | 177 | ||
178 | public virtual LLUUID AgentId | 178 | public virtual LLUUID AgentId |
179 | { | 179 | { |
180 | get { return myID; } | 180 | get { return myID; } |
181 | } | 181 | } |
182 | 182 | ||
183 | public LLUUID SessionId | 183 | public LLUUID SessionId |
184 | { | 184 | { |
185 | get { return LLUUID.Zero; } | 185 | get { return LLUUID.Zero; } |
186 | } | 186 | } |
187 | 187 | ||
188 | public LLUUID SecureSessionId | 188 | public LLUUID SecureSessionId |
189 | { | 189 | { |
190 | get { return LLUUID.Zero; } | 190 | get { return LLUUID.Zero; } |
191 | } | 191 | } |
192 | 192 | ||
193 | public virtual string FirstName | 193 | public virtual string FirstName |
194 | { | 194 | { |
195 | get { return "Annoying"; } | 195 | get { return "Annoying"; } |
196 | } | 196 | } |
197 | 197 | ||
198 | private string lastName = "NPC" + Util.RandomClass.Next(1, 1000); | 198 | private string lastName = "NPC" + Util.RandomClass.Next(1, 1000); |
199 | 199 | ||
200 | public virtual string LastName | 200 | public virtual string LastName |
201 | { | 201 | { |
202 | get { return lastName; } | 202 | get { return lastName; } |
203 | } | 203 | } |
204 | 204 | ||
205 | public virtual String Name | 205 | public virtual String Name |
206 | { | 206 | { |
207 | get { return FirstName + LastName; } | 207 | get { return FirstName + LastName; } |
208 | } | 208 | } |
209 | 209 | ||
210 | 210 | ||
211 | public virtual void OutPacket(Packet newPack, ThrottleOutPacketType packType) | 211 | public virtual void OutPacket(Packet newPack, ThrottleOutPacketType packType) |
212 | { | 212 | { |
213 | } | 213 | } |
214 | 214 | ||
215 | public virtual void SendWearables(AvatarWearable[] wearables, int serial) | 215 | public virtual void SendWearables(AvatarWearable[] wearables, int serial) |
216 | { | 216 | { |
217 | } | 217 | } |
218 | 218 | ||
219 | public virtual void SendAppearance(LLUUID agentID, byte[] visualParams, byte[] textureEntry) | 219 | public virtual void SendAppearance(LLUUID agentID, byte[] visualParams, byte[] textureEntry) |
220 | { | 220 | { |
221 | } | 221 | } |
222 | 222 | ||
223 | public virtual void Kick(string message) | 223 | public virtual void Kick(string message) |
224 | { | 224 | { |
225 | } | 225 | } |
226 | 226 | ||
227 | public virtual void SendStartPingCheck(byte seq) | 227 | public virtual void SendStartPingCheck(byte seq) |
228 | { | 228 | { |
229 | } | 229 | } |
230 | 230 | ||
231 | public virtual void SendAvatarPickerReply(AvatarPickerReplyPacket response) | 231 | public virtual void SendAvatarPickerReply(AvatarPickerReplyPacket response) |
232 | { | 232 | { |
233 | } | 233 | } |
234 | 234 | ||
235 | public virtual void SendAgentDataUpdate(LLUUID agentid, LLUUID activegroupid, string firstname, string lastname, ulong grouppowers, string groupname, string grouptitle) | 235 | public virtual void SendAgentDataUpdate(LLUUID agentid, LLUUID activegroupid, string firstname, string lastname, ulong grouppowers, string groupname, string grouptitle) |
236 | { | 236 | { |
237 | 237 | ||
238 | } | 238 | } |
239 | 239 | ||
240 | public virtual void SendKillObject(ulong regionHandle, uint localID) | 240 | public virtual void SendKillObject(ulong regionHandle, uint localID) |
241 | { | 241 | { |
242 | } | 242 | } |
243 | 243 | ||
244 | public virtual void SetChildAgentThrottle(byte[] throttle) | 244 | public virtual void SetChildAgentThrottle(byte[] throttle) |
245 | { | 245 | { |
246 | } | 246 | } |
247 | public byte[] GetThrottlesPacked(float multiplier) | 247 | public byte[] GetThrottlesPacked(float multiplier) |
248 | { | 248 | { |
249 | return new byte[0]; | 249 | return new byte[0]; |
250 | } | 250 | } |
251 | 251 | ||
252 | 252 | ||
253 | public virtual void SendAnimations(LLUUID[] animations, int[] seqs, LLUUID sourceAgentId) | 253 | public virtual void SendAnimations(LLUUID[] animations, int[] seqs, LLUUID sourceAgentId) |
254 | { | 254 | { |
255 | } | 255 | } |
256 | 256 | ||
257 | public virtual void SendChatMessage(string message, byte type, LLVector3 fromPos, string fromName, | 257 | public virtual void SendChatMessage(string message, byte type, LLVector3 fromPos, string fromName, |
258 | LLUUID fromAgentID) | 258 | LLUUID fromAgentID) |
259 | { | 259 | { |
260 | } | 260 | } |
261 | 261 | ||
262 | public virtual void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, | 262 | public virtual void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, |
263 | LLUUID fromAgentID) | 263 | LLUUID fromAgentID) |
264 | { | 264 | { |
265 | } | 265 | } |
266 | 266 | ||
267 | public virtual void SendInstantMessage(LLUUID fromAgent, LLUUID fromAgentSession, string message, LLUUID toAgent, | 267 | public virtual void SendInstantMessage(LLUUID fromAgent, LLUUID fromAgentSession, string message, LLUUID toAgent, |
268 | LLUUID imSessionID, string fromName, byte dialog, uint timeStamp) | 268 | LLUUID imSessionID, string fromName, byte dialog, uint timeStamp) |
269 | { | 269 | { |
270 | } | 270 | } |
271 | 271 | ||
272 | public virtual void SendLayerData(float[] map) | 272 | public virtual void SendLayerData(float[] map) |
273 | { | 273 | { |
274 | } | 274 | } |
275 | 275 | ||
276 | public virtual void SendLayerData(int px, int py, float[] map) | 276 | public virtual void SendLayerData(int px, int py, float[] map) |
277 | { | 277 | { |
278 | } | 278 | } |
279 | 279 | ||
280 | public virtual void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look) | 280 | public virtual void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look) |
281 | { | 281 | { |
282 | } | 282 | } |
283 | 283 | ||
284 | public virtual void InformClientOfNeighbour(ulong neighbourHandle, IPEndPoint neighbourExternalEndPoint) | 284 | public virtual void InformClientOfNeighbour(ulong neighbourHandle, IPEndPoint neighbourExternalEndPoint) |
285 | { | 285 | { |
286 | } | 286 | } |
287 | 287 | ||
288 | public virtual AgentCircuitData RequestClientInfo() | 288 | public virtual AgentCircuitData RequestClientInfo() |
289 | { | 289 | { |
290 | return new AgentCircuitData(); | 290 | return new AgentCircuitData(); |
291 | } | 291 | } |
292 | 292 | ||
293 | public virtual void CrossRegion(ulong newRegionHandle, LLVector3 pos, LLVector3 lookAt, | 293 | public virtual void CrossRegion(ulong newRegionHandle, LLVector3 pos, LLVector3 lookAt, |
294 | IPEndPoint newRegionExternalEndPoint, string capsURL) | 294 | IPEndPoint newRegionExternalEndPoint, string capsURL) |
295 | { | 295 | { |
296 | } | 296 | } |
297 | 297 | ||
298 | public virtual void SendMapBlock(List<MapBlockData> mapBlocks) | 298 | public virtual void SendMapBlock(List<MapBlockData> mapBlocks) |
299 | { | 299 | { |
300 | } | 300 | } |
301 | 301 | ||
302 | public virtual void SendLocalTeleport(LLVector3 position, LLVector3 lookAt, uint flags) | 302 | public virtual void SendLocalTeleport(LLVector3 position, LLVector3 lookAt, uint flags) |
303 | { | 303 | { |
304 | } | 304 | } |
305 | 305 | ||
306 | public virtual void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, | 306 | public virtual void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, |
307 | uint locationID, uint flags, string capsURL) | 307 | uint locationID, uint flags, string capsURL) |
308 | { | 308 | { |
309 | } | 309 | } |
310 | 310 | ||
311 | public virtual void SendTeleportFailed(string reason) | 311 | public virtual void SendTeleportFailed(string reason) |
312 | { | 312 | { |
313 | } | 313 | } |
314 | 314 | ||
315 | public virtual void SendTeleportLocationStart() | 315 | public virtual void SendTeleportLocationStart() |
316 | { | 316 | { |
317 | } | 317 | } |
318 | 318 | ||
319 | public virtual void SendMoneyBalance(LLUUID transaction, bool success, byte[] description, int balance) | 319 | public virtual void SendMoneyBalance(LLUUID transaction, bool success, byte[] description, int balance) |
320 | { | 320 | { |
321 | } | 321 | } |
322 | 322 | ||
323 | public virtual void SendAvatarData(ulong regionHandle, string firstName, string lastName, LLUUID avatarID, | 323 | public virtual void SendAvatarData(ulong regionHandle, string firstName, string lastName, LLUUID avatarID, |
324 | uint avatarLocalID, LLVector3 Pos, byte[] textureEntry, uint parentID) | 324 | uint avatarLocalID, LLVector3 Pos, byte[] textureEntry, uint parentID) |
325 | { | 325 | { |
326 | } | 326 | } |
327 | 327 | ||
328 | public virtual void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, | 328 | public virtual void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, |
329 | LLVector3 position, LLVector3 velocity, LLQuaternion rotation) | 329 | LLVector3 position, LLVector3 velocity, LLQuaternion rotation) |
330 | { | 330 | { |
331 | } | 331 | } |
332 | 332 | ||
333 | public virtual void SendCoarseLocationUpdate(List<LLVector3> CoarseLocations) | 333 | public virtual void SendCoarseLocationUpdate(List<LLVector3> CoarseLocations) |
334 | { | 334 | { |
335 | } | 335 | } |
336 | 336 | ||
337 | public virtual void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint) | 337 | public virtual void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint) |
338 | { | 338 | { |
339 | } | 339 | } |
340 | 340 | ||
341 | public virtual void SendDialog(string objectname, LLUUID objectID, LLUUID ownerID, string msg, LLUUID textureID, int ch, string[] buttonlabels) | 341 | public virtual void SendDialog(string objectname, LLUUID objectID, LLUUID ownerID, string msg, LLUUID textureID, int ch, string[] buttonlabels) |
342 | { | 342 | { |
343 | } | 343 | } |
344 | 344 | ||
345 | public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, | 345 | public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, |
346 | PrimitiveBaseShape primShape, LLVector3 pos, uint flags, | 346 | PrimitiveBaseShape primShape, LLVector3 pos, uint flags, |
347 | LLUUID objectID, LLUUID ownerID, string text, byte[] color, | 347 | LLUUID objectID, LLUUID ownerID, string text, byte[] color, |
348 | uint parentID, | 348 | uint parentID, |
349 | byte[] particleSystem, LLQuaternion rotation, byte clickAction) | 349 | byte[] particleSystem, LLQuaternion rotation, byte clickAction) |
350 | { | 350 | { |
351 | } | 351 | } |
352 | public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, | 352 | public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, |
353 | PrimitiveBaseShape primShape, LLVector3 pos, uint flags, | 353 | PrimitiveBaseShape primShape, LLVector3 pos, uint flags, |
354 | LLUUID objectID, LLUUID ownerID, string text, byte[] color, | 354 | LLUUID objectID, LLUUID ownerID, string text, byte[] color, |
355 | uint parentID, | 355 | uint parentID, |
356 | byte[] particleSystem, LLQuaternion rotation, byte clickAction, byte[] textureanimation) | 356 | byte[] particleSystem, LLQuaternion rotation, byte clickAction, byte[] textureanimation) |
357 | { | 357 | { |
358 | } | 358 | } |
359 | public virtual void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, | 359 | public virtual void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, |
360 | LLVector3 position, LLQuaternion rotation, byte state) | 360 | LLVector3 position, LLQuaternion rotation, byte state) |
361 | { | 361 | { |
362 | } | 362 | } |
363 | 363 | ||
364 | public virtual void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, | 364 | public virtual void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, |
365 | LLVector3 position, LLQuaternion rotation, LLVector3 velocity, | 365 | LLVector3 position, LLQuaternion rotation, LLVector3 velocity, |
366 | LLVector3 rotationalvelocity) | 366 | LLVector3 rotationalvelocity) |
367 | { | 367 | { |
368 | } | 368 | } |
369 | 369 | ||
370 | public virtual void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, | 370 | public virtual void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, |
371 | List<InventoryItemBase> items, | 371 | List<InventoryItemBase> items, |
372 | List<InventoryFolderBase> folders, | 372 | List<InventoryFolderBase> folders, |
373 | bool fetchFolders, | 373 | bool fetchFolders, |
374 | bool fetchItems) | 374 | bool fetchItems) |
375 | { | 375 | { |
376 | } | 376 | } |
377 | 377 | ||
378 | public virtual void SendInventoryItemDetails(LLUUID ownerID, InventoryItemBase item) | 378 | public virtual void SendInventoryItemDetails(LLUUID ownerID, InventoryItemBase item) |
379 | { | 379 | { |
380 | } | 380 | } |
381 | 381 | ||
382 | public virtual void SendInventoryItemCreateUpdate(InventoryItemBase Item) | 382 | public virtual void SendInventoryItemCreateUpdate(InventoryItemBase Item) |
383 | { | 383 | { |
384 | } | 384 | } |
385 | 385 | ||
386 | public virtual void SendRemoveInventoryItem(LLUUID itemID) | 386 | public virtual void SendRemoveInventoryItem(LLUUID itemID) |
387 | { | 387 | { |
388 | } | 388 | } |
389 | 389 | ||
390 | public virtual void SendTaskInventory(LLUUID taskID, short serial, byte[] fileName) | 390 | public virtual void SendTaskInventory(LLUUID taskID, short serial, byte[] fileName) |
391 | { | 391 | { |
392 | } | 392 | } |
393 | 393 | ||
394 | public virtual void SendXferPacket(ulong xferID, uint packet, byte[] data) | 394 | public virtual void SendXferPacket(ulong xferID, uint packet, byte[] data) |
395 | { | 395 | { |
396 | } | 396 | } |
397 | 397 | ||
398 | public virtual void SendNameReply(LLUUID profileId, string firstname, string lastname) | 398 | public virtual void SendNameReply(LLUUID profileId, string firstname, string lastname) |
399 | { | 399 | { |
400 | } | 400 | } |
401 | 401 | ||
402 | public virtual void SendPreLoadSound(LLUUID objectID, LLUUID ownerID, LLUUID soundID) | 402 | public virtual void SendPreLoadSound(LLUUID objectID, LLUUID ownerID, LLUUID soundID) |
403 | { | 403 | { |
404 | } | 404 | } |
405 | 405 | ||
406 | public virtual void SendPlayAttachedSound(LLUUID soundID, LLUUID objectID, LLUUID ownerID, float gain, | 406 | public virtual void SendPlayAttachedSound(LLUUID soundID, LLUUID objectID, LLUUID ownerID, float gain, |
407 | byte flags) | 407 | byte flags) |
408 | { | 408 | { |
409 | } | 409 | } |
410 | 410 | ||
411 | public void SendTriggeredSound(LLUUID soundID, LLUUID ownerID, LLUUID objectID, LLUUID parentID, ulong handle, LLVector3 position, float gain) | 411 | public void SendTriggeredSound(LLUUID soundID, LLUUID ownerID, LLUUID objectID, LLUUID parentID, ulong handle, LLVector3 position, float gain) |
412 | { | 412 | { |
413 | } | 413 | } |
414 | 414 | ||
415 | public void SendAlertMessage(string message) | 415 | public void SendAlertMessage(string message) |
416 | { | 416 | { |
417 | } | 417 | } |
418 | 418 | ||
419 | public void SendAgentAlertMessage(string message, bool modal) | 419 | public void SendAgentAlertMessage(string message, bool modal) |
420 | { | 420 | { |
421 | } | 421 | } |
422 | 422 | ||
423 | public void SendSystemAlertMessage(string message) | 423 | public void SendSystemAlertMessage(string message) |
424 | { | 424 | { |
425 | } | 425 | } |
426 | 426 | ||
427 | public void SendLoadURL(string objectname, LLUUID objectID, LLUUID ownerID, bool groupOwned, string message, | 427 | public void SendLoadURL(string objectname, LLUUID objectID, LLUUID ownerID, bool groupOwned, string message, |
428 | string url) | 428 | string url) |
429 | { | 429 | { |
430 | } | 430 | } |
431 | 431 | ||
432 | public virtual void SendRegionHandshake(RegionInfo regionInfo) | 432 | public virtual void SendRegionHandshake(RegionInfo regionInfo) |
433 | { | 433 | { |
434 | if (OnRegionHandShakeReply != null) | 434 | if (OnRegionHandShakeReply != null) |
435 | { | 435 | { |
436 | OnRegionHandShakeReply(this); | 436 | OnRegionHandShakeReply(this); |
437 | } | 437 | } |
438 | 438 | ||
439 | if (OnCompleteMovementToRegion != null) | 439 | if (OnCompleteMovementToRegion != null) |
440 | { | 440 | { |
441 | OnCompleteMovementToRegion(); | 441 | OnCompleteMovementToRegion(); |
442 | } | 442 | } |
443 | } | 443 | } |
444 | 444 | ||
445 | private void Update() | 445 | private void Update() |
446 | { | 446 | { |
447 | if (OnAgentUpdate != null) | 447 | if (OnAgentUpdate != null) |
448 | { | 448 | { |
449 | AgentUpdatePacket pack = new AgentUpdatePacket(); | 449 | AgentUpdatePacket pack = new AgentUpdatePacket(); |
450 | pack.AgentData.ControlFlags = movementFlag; | 450 | pack.AgentData.ControlFlags = movementFlag; |
451 | pack.AgentData.BodyRotation = bodyDirection; | 451 | pack.AgentData.BodyRotation = bodyDirection; |
452 | OnAgentUpdate(this, pack); | 452 | OnAgentUpdate(this, pack); |
453 | } | 453 | } |
454 | if (flyState == 0) | 454 | if (flyState == 0) |
455 | { | 455 | { |
456 | movementFlag = (uint) AgentManager.ControlFlags.AGENT_CONTROL_FLY | | 456 | movementFlag = (uint) AgentManager.ControlFlags.AGENT_CONTROL_FLY | |
457 | (uint) AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG; | 457 | (uint) AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG; |
458 | flyState = 1; | 458 | flyState = 1; |
459 | } | 459 | } |
460 | else if (flyState == 1) | 460 | else if (flyState == 1) |
461 | { | 461 | { |
462 | movementFlag = (uint) AgentManager.ControlFlags.AGENT_CONTROL_FLY | | 462 | movementFlag = (uint) AgentManager.ControlFlags.AGENT_CONTROL_FLY | |
463 | (uint) AgentManager.ControlFlags.AGENT_CONTROL_UP_POS; | 463 | (uint) AgentManager.ControlFlags.AGENT_CONTROL_UP_POS; |
464 | flyState = 2; | 464 | flyState = 2; |
465 | } | 465 | } |
466 | else | 466 | else |
467 | { | 467 | { |
468 | movementFlag = (uint) AgentManager.ControlFlags.AGENT_CONTROL_FLY; | 468 | movementFlag = (uint) AgentManager.ControlFlags.AGENT_CONTROL_FLY; |
469 | flyState = 0; | 469 | flyState = 0; |
470 | } | 470 | } |
471 | 471 | ||
472 | if (count >= 200) | 472 | if (count >= 200) |
473 | { | 473 | { |
474 | if (OnChatFromViewer != null) | 474 | if (OnChatFromViewer != null) |
475 | { | 475 | { |
476 | ChatFromViewerArgs args = new ChatFromViewerArgs(); | 476 | ChatFromViewerArgs args = new ChatFromViewerArgs(); |
477 | args.Message = "Kinda quiet around here, isn't it?"; | 477 | args.Message = "Kinda quiet around here, isn't it?"; |
478 | args.Channel = 0; | 478 | args.Channel = 0; |
479 | args.From = FirstName + " " + LastName; | 479 | args.From = FirstName + " " + LastName; |
480 | args.Position = new LLVector3(128, 128, 26); | 480 | args.Position = new LLVector3(128, 128, 26); |
481 | args.Sender = this; | 481 | args.Sender = this; |
482 | args.Type = ChatTypeEnum.Shout; | 482 | args.Type = ChatTypeEnum.Shout; |
483 | 483 | ||
484 | OnChatFromViewer(this, args); | 484 | OnChatFromViewer(this, args); |
485 | } | 485 | } |
486 | count = -1; | 486 | count = -1; |
487 | } | 487 | } |
488 | 488 | ||
489 | count++; | 489 | count++; |
490 | } | 490 | } |
491 | 491 | ||
492 | public bool AddMoney(int debit) | 492 | public bool AddMoney(int debit) |
493 | { | 493 | { |
494 | return false; | 494 | return false; |
495 | } | 495 | } |
496 | 496 | ||
497 | public void SendSunPos(LLVector3 sunPos, LLVector3 sunVel) | 497 | public void SendSunPos(LLVector3 sunPos, LLVector3 sunVel) |
498 | { | 498 | { |
499 | } | 499 | } |
500 | 500 | ||
501 | public void SendViewerTime(int phase) | 501 | public void SendViewerTime(int phase) |
502 | { | 502 | { |
503 | } | 503 | } |
504 | 504 | ||
505 | public void SendAvatarProperties(LLUUID avatarID, string aboutText, string bornOn, string charterMember, | 505 | public void SendAvatarProperties(LLUUID avatarID, string aboutText, string bornOn, string charterMember, |
506 | string flAbout, uint flags, LLUUID flImageID, LLUUID imageID, string profileURL, | 506 | string flAbout, uint flags, LLUUID flImageID, LLUUID imageID, string profileURL, |
507 | LLUUID partnerID) | 507 | LLUUID partnerID) |
508 | { | 508 | { |
509 | } | 509 | } |
510 | 510 | ||
511 | public void SetDebug(int newDebug) | 511 | public void SetDebug(int newDebug) |
512 | { | 512 | { |
513 | } | 513 | } |
514 | 514 | ||
515 | public void InPacket(Packet NewPack) | 515 | public void InPacket(Packet NewPack) |
516 | { | 516 | { |
517 | } | 517 | } |
518 | 518 | ||
519 | public void Close(bool ShutdownCircuit) | 519 | public void Close(bool ShutdownCircuit) |
520 | { | 520 | { |
521 | } | 521 | } |
522 | 522 | ||
523 | public void Stop() | 523 | public void Stop() |
524 | { | 524 | { |
525 | } | 525 | } |
526 | 526 | ||
527 | private uint m_circuitCode; | 527 | private uint m_circuitCode; |
528 | 528 | ||
529 | public uint CircuitCode | 529 | public uint CircuitCode |
530 | { | 530 | { |
531 | get { return m_circuitCode; } | 531 | get { return m_circuitCode; } |
532 | set { m_circuitCode = value; } | 532 | set { m_circuitCode = value; } |
533 | } | 533 | } |
534 | public void SendBlueBoxMessage(LLUUID FromAvatarID, LLUUID fromSessionID, String FromAvatarName, String Message) | 534 | public void SendBlueBoxMessage(LLUUID FromAvatarID, LLUUID fromSessionID, String FromAvatarName, String Message) |
535 | { | 535 | { |
536 | 536 | ||
537 | } | 537 | } |
538 | public void SendLogoutPacket() | 538 | public void SendLogoutPacket() |
539 | { | 539 | { |
540 | } | 540 | } |
541 | 541 | ||
542 | public void Terminate() | 542 | public void Terminate() |
543 | { | 543 | { |
544 | } | 544 | } |
545 | 545 | ||
546 | public ClientInfo GetClientInfo() | 546 | public ClientInfo GetClientInfo() |
547 | { | 547 | { |
548 | return null; | 548 | return null; |
549 | } | 549 | } |
550 | 550 | ||
551 | public void SetClientInfo(ClientInfo info) | 551 | public void SetClientInfo(ClientInfo info) |
552 | { | 552 | { |
553 | } | 553 | } |
554 | } | 554 | } |
555 | } \ No newline at end of file | 555 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Examples/SimpleModule/Properties/AssemblyInfo.cs b/OpenSim/Region/Examples/SimpleModule/Properties/AssemblyInfo.cs index 67301c1..4a53612 100644 --- a/OpenSim/Region/Examples/SimpleModule/Properties/AssemblyInfo.cs +++ b/OpenSim/Region/Examples/SimpleModule/Properties/AssemblyInfo.cs | |||
@@ -1,36 +1,36 @@ | |||
1 | using System.Reflection; | 1 | using System.Reflection; |
2 | using System.Runtime.CompilerServices; | 2 | using System.Runtime.CompilerServices; |
3 | using System.Runtime.InteropServices; | 3 | using System.Runtime.InteropServices; |
4 | 4 | ||
5 | // General Information about an assembly is controlled through the following | 5 | // General Information about an assembly is controlled through the following |
6 | // set of attributes. Change these attribute values to modify the information | 6 | // set of attributes. Change these attribute values to modify the information |
7 | // associated with an assembly. | 7 | // associated with an assembly. |
8 | [assembly: AssemblyTitle("OpenSim.Region.Examples.SimpleModule")] | 8 | [assembly: AssemblyTitle("OpenSim.Region.Examples.SimpleModule")] |
9 | [assembly: AssemblyDescription("")] | 9 | [assembly: AssemblyDescription("")] |
10 | [assembly: AssemblyConfiguration("")] | 10 | [assembly: AssemblyConfiguration("")] |
11 | [assembly: AssemblyCompany("")] | 11 | [assembly: AssemblyCompany("")] |
12 | [assembly: AssemblyProduct("OpenSim.Region.Examples.SimpleModule")] | 12 | [assembly: AssemblyProduct("OpenSim.Region.Examples.SimpleModule")] |
13 | [assembly: AssemblyCopyright("Copyright © 2008")] | 13 | [assembly: AssemblyCopyright("Copyright © 2008")] |
14 | [assembly: AssemblyTrademark("")] | 14 | [assembly: AssemblyTrademark("")] |
15 | [assembly: AssemblyCulture("")] | 15 | [assembly: AssemblyCulture("")] |
16 | 16 | ||
17 | // Setting ComVisible to false makes the types in this assembly not visible | 17 | // Setting ComVisible to false makes the types in this assembly not visible |
18 | // to COM components. If you need to access a type in this assembly from | 18 | // to COM components. If you need to access a type in this assembly from |
19 | // COM, set the ComVisible attribute to true on that type. | 19 | // COM, set the ComVisible attribute to true on that type. |
20 | [assembly: ComVisible(false)] | 20 | [assembly: ComVisible(false)] |
21 | 21 | ||
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM |
23 | [assembly: Guid("f0caca77-7818-4a43-9200-0a8548009a05")] | 23 | [assembly: Guid("f0caca77-7818-4a43-9200-0a8548009a05")] |
24 | 24 | ||
25 | // Version information for an assembly consists of the following four values: | 25 | // Version information for an assembly consists of the following four values: |
26 | // | 26 | // |
27 | // Major Version | 27 | // Major Version |
28 | // Minor Version | 28 | // Minor Version |
29 | // Build Number | 29 | // Build Number |
30 | // Revision | 30 | // Revision |
31 | // | 31 | // |
32 | // You can specify all the values or you can default the Build and Revision Numbers | 32 | // You can specify all the values or you can default the Build and Revision Numbers |
33 | // by using the '*' as shown below: | 33 | // by using the '*' as shown below: |
34 | // [assembly: AssemblyVersion("1.0.*")] | 34 | // [assembly: AssemblyVersion("1.0.*")] |
35 | [assembly: AssemblyVersion("1.0.0.0")] | 35 | [assembly: AssemblyVersion("1.0.0.0")] |
36 | [assembly: AssemblyFileVersion("1.0.0.0")] | 36 | [assembly: AssemblyFileVersion("1.0.0.0")] |
diff --git a/OpenSim/Region/Examples/SimpleModule/README.txt b/OpenSim/Region/Examples/SimpleModule/README.txt index 8314a21..025e33d 100644 --- a/OpenSim/Region/Examples/SimpleModule/README.txt +++ b/OpenSim/Region/Examples/SimpleModule/README.txt | |||
@@ -1,9 +1,9 @@ | |||
1 | !!!IMPORTANT NOTE!!! | 1 | !!!IMPORTANT NOTE!!! |
2 | 2 | ||
3 | This code snippet provided as an example of coding functional content with region modules. | 3 | This code snippet provided as an example of coding functional content with region modules. |
4 | 4 | ||
5 | As of 13/3 2008 this module actually renders all regions within the instance unusable if enabled by dragging the dll from ./bin to global /bin. | 5 | As of 13/3 2008 this module actually renders all regions within the instance unusable if enabled by dragging the dll from ./bin to global /bin. |
6 | 6 | ||
7 | So, use at own peril and in dedicated instance. | 7 | So, use at own peril and in dedicated instance. |
8 | 8 | ||
9 | Peace. | 9 | Peace. |
diff --git a/OpenSim/Region/Examples/SimpleModule/RegionModule.cs b/OpenSim/Region/Examples/SimpleModule/RegionModule.cs index 37cbef5..1159d25 100644 --- a/OpenSim/Region/Examples/SimpleModule/RegionModule.cs +++ b/OpenSim/Region/Examples/SimpleModule/RegionModule.cs | |||
@@ -1,114 +1,114 @@ | |||
1 | using System; | 1 | using System; |
2 | using System.Collections.Generic; | 2 | using System.Collections.Generic; |
3 | using System.IO; | 3 | using System.IO; |
4 | using System.Text; | 4 | using System.Text; |
5 | using libsecondlife; | 5 | using libsecondlife; |
6 | using Nini.Config; | 6 | using Nini.Config; |
7 | using OpenSim.Framework; | 7 | using OpenSim.Framework; |
8 | using OpenSim.Region.Environment.Interfaces; | 8 | using OpenSim.Region.Environment.Interfaces; |
9 | using OpenSim.Region.Environment.Scenes; | 9 | using OpenSim.Region.Environment.Scenes; |
10 | 10 | ||
11 | namespace OpenSim.Region.Examples.SimpleModule | 11 | namespace OpenSim.Region.Examples.SimpleModule |
12 | { | 12 | { |
13 | public class RegionModule : IRegionModule | 13 | public class RegionModule : IRegionModule |
14 | { | 14 | { |
15 | #region IRegionModule Members | 15 | #region IRegionModule Members |
16 | 16 | ||
17 | private Scene m_scene; | 17 | private Scene m_scene; |
18 | 18 | ||
19 | 19 | ||
20 | public void Initialise(Scene scene, IConfigSource source) | 20 | public void Initialise(Scene scene, IConfigSource source) |
21 | { | 21 | { |
22 | m_scene = scene; | 22 | m_scene = scene; |
23 | } | 23 | } |
24 | 24 | ||
25 | public void PostInitialise() | 25 | public void PostInitialise() |
26 | { | 26 | { |
27 | RegionInfo regionInfo = m_scene.RegionInfo; | 27 | RegionInfo regionInfo = m_scene.RegionInfo; |
28 | 28 | ||
29 | LLVector3 pos = new LLVector3(110, 129, 27); | 29 | LLVector3 pos = new LLVector3(110, 129, 27); |
30 | 30 | ||
31 | AddCpuCounter(regionInfo, pos); | 31 | AddCpuCounter(regionInfo, pos); |
32 | AddComplexObjects(regionInfo, pos); | 32 | AddComplexObjects(regionInfo, pos); |
33 | AddAvatars(); | 33 | AddAvatars(); |
34 | AddFileSystemObjects(); | 34 | AddFileSystemObjects(); |
35 | } | 35 | } |
36 | 36 | ||
37 | private void AddFileSystemObjects() | 37 | private void AddFileSystemObjects() |
38 | { | 38 | { |
39 | DirectoryInfo dirInfo = new DirectoryInfo("."); | 39 | DirectoryInfo dirInfo = new DirectoryInfo("."); |
40 | 40 | ||
41 | float x = 0; | 41 | float x = 0; |
42 | float z = 0; | 42 | float z = 0; |
43 | 43 | ||
44 | foreach (FileInfo fileInfo in dirInfo.GetFiles()) | 44 | foreach (FileInfo fileInfo in dirInfo.GetFiles()) |
45 | { | 45 | { |
46 | LLVector3 filePos = new LLVector3(100 + x, 129, 27 + z); | 46 | LLVector3 filePos = new LLVector3(100 + x, 129, 27 + z); |
47 | x = x + 2; | 47 | x = x + 2; |
48 | if (x > 50) | 48 | if (x > 50) |
49 | { | 49 | { |
50 | x = 0; | 50 | x = 0; |
51 | z = z + 2; | 51 | z = z + 2; |
52 | } | 52 | } |
53 | 53 | ||
54 | FileSystemObject fileObject = new FileSystemObject(m_scene, fileInfo, filePos); | 54 | FileSystemObject fileObject = new FileSystemObject(m_scene, fileInfo, filePos); |
55 | m_scene.AddEntity(fileObject); | 55 | m_scene.AddEntity(fileObject); |
56 | } | 56 | } |
57 | } | 57 | } |
58 | 58 | ||
59 | private void AddAvatars() | 59 | private void AddAvatars() |
60 | { | 60 | { |
61 | for (int i = 0; i < 2; i++) | 61 | for (int i = 0; i < 2; i++) |
62 | { | 62 | { |
63 | MyNpcCharacter m_character = new MyNpcCharacter(m_scene.EventManager); | 63 | MyNpcCharacter m_character = new MyNpcCharacter(m_scene.EventManager); |
64 | m_scene.AddNewClient(m_character, false); | 64 | m_scene.AddNewClient(m_character, false); |
65 | } | 65 | } |
66 | 66 | ||
67 | List<ScenePresence> avatars = m_scene.GetAvatars(); | 67 | List<ScenePresence> avatars = m_scene.GetAvatars(); |
68 | foreach (ScenePresence avatar in avatars) | 68 | foreach (ScenePresence avatar in avatars) |
69 | { | 69 | { |
70 | avatar.AbsolutePosition = | 70 | avatar.AbsolutePosition = |
71 | new LLVector3((float)Util.RandomClass.Next(100, 200), (float)Util.RandomClass.Next(30, 200), 2); | 71 | new LLVector3((float)Util.RandomClass.Next(100, 200), (float)Util.RandomClass.Next(30, 200), 2); |
72 | } | 72 | } |
73 | } | 73 | } |
74 | 74 | ||
75 | private void AddComplexObjects(RegionInfo regionInfo, LLVector3 pos) | 75 | private void AddComplexObjects(RegionInfo regionInfo, LLVector3 pos) |
76 | { | 76 | { |
77 | int objs = 3; | 77 | int objs = 3; |
78 | 78 | ||
79 | for (int i = 0; i < (objs*objs*objs); i++) | 79 | for (int i = 0; i < (objs*objs*objs); i++) |
80 | { | 80 | { |
81 | LLVector3 posOffset = new LLVector3((i % objs) * 4, ((i % (objs*objs)) / ( objs )) * 4, (i / (objs*objs)) * 4); | 81 | LLVector3 posOffset = new LLVector3((i % objs) * 4, ((i % (objs*objs)) / ( objs )) * 4, (i / (objs*objs)) * 4); |
82 | ComplexObject complexObject = | 82 | ComplexObject complexObject = |
83 | new ComplexObject(m_scene, regionInfo.RegionHandle, LLUUID.Zero, m_scene.PrimIDAllocate(), | 83 | new ComplexObject(m_scene, regionInfo.RegionHandle, LLUUID.Zero, m_scene.PrimIDAllocate(), |
84 | pos + posOffset); | 84 | pos + posOffset); |
85 | m_scene.AddEntity(complexObject); | 85 | m_scene.AddEntity(complexObject); |
86 | } | 86 | } |
87 | } | 87 | } |
88 | 88 | ||
89 | private void AddCpuCounter(RegionInfo regionInfo, LLVector3 pos) | 89 | private void AddCpuCounter(RegionInfo regionInfo, LLVector3 pos) |
90 | { | 90 | { |
91 | SceneObjectGroup sceneObject = | 91 | SceneObjectGroup sceneObject = |
92 | new CpuCounterObject(m_scene, regionInfo.RegionHandle, LLUUID.Zero, m_scene.PrimIDAllocate(), | 92 | new CpuCounterObject(m_scene, regionInfo.RegionHandle, LLUUID.Zero, m_scene.PrimIDAllocate(), |
93 | pos + new LLVector3(1f, 1f, 1f)); | 93 | pos + new LLVector3(1f, 1f, 1f)); |
94 | m_scene.AddEntity(sceneObject); | 94 | m_scene.AddEntity(sceneObject); |
95 | } | 95 | } |
96 | 96 | ||
97 | public void Close() | 97 | public void Close() |
98 | { | 98 | { |
99 | m_scene = null; | 99 | m_scene = null; |
100 | } | 100 | } |
101 | 101 | ||
102 | public string Name | 102 | public string Name |
103 | { | 103 | { |
104 | get { return GetType().AssemblyQualifiedName; } | 104 | get { return GetType().AssemblyQualifiedName; } |
105 | } | 105 | } |
106 | 106 | ||
107 | public bool IsSharedModule | 107 | public bool IsSharedModule |
108 | { | 108 | { |
109 | get { return false; } | 109 | get { return false; } |
110 | } | 110 | } |
111 | 111 | ||
112 | #endregion | 112 | #endregion |
113 | } | 113 | } |
114 | } | 114 | } |