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