diff options
author | Sean Dague | 2007-07-16 15:40:11 +0000 |
---|---|---|
committer | Sean Dague | 2007-07-16 15:40:11 +0000 |
commit | 2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6 (patch) | |
tree | e3f80ad51736cf17e856547b1bcf956010927434 /OpenSim/Framework | |
parent | *Trunk compiles now (diff) | |
download | opensim-SC_OLD-2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6.zip opensim-SC_OLD-2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6.tar.gz opensim-SC_OLD-2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6.tar.bz2 opensim-SC_OLD-2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6.tar.xz |
changed to native line ending encoding
Diffstat (limited to 'OpenSim/Framework')
87 files changed, 10637 insertions, 10637 deletions
diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs index 550372f..db34d1b 100644 --- a/OpenSim/Framework/Communications/CommunicationsManager.cs +++ b/OpenSim/Framework/Communications/CommunicationsManager.cs | |||
@@ -1,71 +1,71 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using System.Text; | 28 | using System.Text; |
29 | using libsecondlife; | 29 | using libsecondlife; |
30 | using libsecondlife.Packets; | 30 | using libsecondlife.Packets; |
31 | using OpenSim.Framework.Data; | 31 | using OpenSim.Framework.Data; |
32 | using OpenSim.Framework.Interfaces; | 32 | using OpenSim.Framework.Interfaces; |
33 | using OpenSim.Framework.Types; | 33 | using OpenSim.Framework.Types; |
34 | using OpenSim.Framework.Servers; | 34 | using OpenSim.Framework.Servers; |
35 | using OpenSim.Framework.Communications.Caches; | 35 | using OpenSim.Framework.Communications.Caches; |
36 | 36 | ||
37 | namespace OpenSim.Framework.Communications | 37 | namespace OpenSim.Framework.Communications |
38 | { | 38 | { |
39 | 39 | ||
40 | public class CommunicationsManager | 40 | public class CommunicationsManager |
41 | { | 41 | { |
42 | public IUserServices UserServer; | 42 | public IUserServices UserServer; |
43 | public IGridServices GridServer; | 43 | public IGridServices GridServer; |
44 | public IInventoryServices InventoryServer; | 44 | public IInventoryServices InventoryServer; |
45 | public IInterRegionCommunications InterRegion; | 45 | public IInterRegionCommunications InterRegion; |
46 | public UserProfileCache UserProfilesCache; | 46 | public UserProfileCache UserProfilesCache; |
47 | 47 | ||
48 | public NetworkServersInfo ServersInfo; | 48 | public NetworkServersInfo ServersInfo; |
49 | public CommunicationsManager(NetworkServersInfo serversInfo, BaseHttpServer httpServer) | 49 | public CommunicationsManager(NetworkServersInfo serversInfo, BaseHttpServer httpServer) |
50 | { | 50 | { |
51 | ServersInfo = serversInfo; | 51 | ServersInfo = serversInfo; |
52 | UserProfilesCache = new UserProfileCache(this); | 52 | UserProfilesCache = new UserProfileCache(this); |
53 | } | 53 | } |
54 | 54 | ||
55 | #region Packet Handlers | 55 | #region Packet Handlers |
56 | public void HandleUUIDNameRequest(LLUUID uuid, IClientAPI remote_client) | 56 | public void HandleUUIDNameRequest(LLUUID uuid, IClientAPI remote_client) |
57 | { | 57 | { |
58 | UserProfileData profileData = this.UserServer.GetUserProfile(uuid); | 58 | UserProfileData profileData = this.UserServer.GetUserProfile(uuid); |
59 | if (profileData != null) | 59 | if (profileData != null) |
60 | { | 60 | { |
61 | LLUUID profileId = profileData.UUID; | 61 | LLUUID profileId = profileData.UUID; |
62 | string firstname = profileData.username; | 62 | string firstname = profileData.username; |
63 | string lastname = profileData.surname; | 63 | string lastname = profileData.surname; |
64 | 64 | ||
65 | remote_client.SendNameReply(profileId, firstname, lastname); | 65 | remote_client.SendNameReply(profileId, firstname, lastname); |
66 | } | 66 | } |
67 | } | 67 | } |
68 | 68 | ||
69 | #endregion | 69 | #endregion |
70 | } | 70 | } |
71 | } | 71 | } |
diff --git a/OpenSim/Framework/Communications/IGridServices.cs b/OpenSim/Framework/Communications/IGridServices.cs index d2e5ab6..1cfe2b6 100644 --- a/OpenSim/Framework/Communications/IGridServices.cs +++ b/OpenSim/Framework/Communications/IGridServices.cs | |||
@@ -1,41 +1,41 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using OpenSim.Framework.Types; | 30 | using OpenSim.Framework.Types; |
31 | 31 | ||
32 | namespace OpenSim.Framework.Communications | 32 | namespace OpenSim.Framework.Communications |
33 | { | 33 | { |
34 | public interface IGridServices | 34 | public interface IGridServices |
35 | { | 35 | { |
36 | RegionCommsListener RegisterRegion(RegionInfo regionInfos); | 36 | RegionCommsListener RegisterRegion(RegionInfo regionInfos); |
37 | List<RegionInfo> RequestNeighbours(RegionInfo regionInfo); | 37 | List<RegionInfo> RequestNeighbours(RegionInfo regionInfo); |
38 | RegionInfo RequestNeighbourInfo(ulong regionHandle); | 38 | RegionInfo RequestNeighbourInfo(ulong regionHandle); |
39 | List<MapBlockData> RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY); | 39 | List<MapBlockData> RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY); |
40 | } | 40 | } |
41 | } | 41 | } |
diff --git a/OpenSim/Framework/Communications/IInterRegionCommunications.cs b/OpenSim/Framework/Communications/IInterRegionCommunications.cs index 55f12ac..7758f2b 100644 --- a/OpenSim/Framework/Communications/IInterRegionCommunications.cs +++ b/OpenSim/Framework/Communications/IInterRegionCommunications.cs | |||
@@ -1,38 +1,38 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using libsecondlife; | 28 | using libsecondlife; |
29 | using OpenSim.Framework.Types; | 29 | using OpenSim.Framework.Types; |
30 | 30 | ||
31 | namespace OpenSim.Framework.Communications | 31 | namespace OpenSim.Framework.Communications |
32 | { | 32 | { |
33 | public interface IInterRegionCommunications | 33 | public interface IInterRegionCommunications |
34 | { | 34 | { |
35 | bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData); | 35 | bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData); |
36 | bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position); | 36 | bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position); |
37 | } | 37 | } |
38 | } | 38 | } |
diff --git a/OpenSim/Framework/Communications/IInventoryServices.cs b/OpenSim/Framework/Communications/IInventoryServices.cs index 0b05834..807952c 100644 --- a/OpenSim/Framework/Communications/IInventoryServices.cs +++ b/OpenSim/Framework/Communications/IInventoryServices.cs | |||
@@ -1,17 +1,17 @@ | |||
1 | using System; | 1 | using System; |
2 | using System.Collections.Generic; | 2 | using System.Collections.Generic; |
3 | using System.Text; | 3 | using System.Text; |
4 | using OpenSim.Framework.Data; | 4 | using OpenSim.Framework.Data; |
5 | using libsecondlife; | 5 | using libsecondlife; |
6 | using OpenSim.Framework.Communications.Caches; | 6 | using OpenSim.Framework.Communications.Caches; |
7 | 7 | ||
8 | namespace OpenSim.Framework.Communications | 8 | namespace OpenSim.Framework.Communications |
9 | { | 9 | { |
10 | public delegate void InventoryFolderInfo(LLUUID userID, InventoryFolder folderInfo); | 10 | public delegate void InventoryFolderInfo(LLUUID userID, InventoryFolder folderInfo); |
11 | public delegate void InventoryItemInfo(LLUUID userID, InventoryItemBase itemInfo); | 11 | public delegate void InventoryItemInfo(LLUUID userID, InventoryItemBase itemInfo); |
12 | 12 | ||
13 | public interface IInventoryServices | 13 | public interface IInventoryServices |
14 | { | 14 | { |
15 | void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack); | 15 | void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack); |
16 | } | 16 | } |
17 | } | 17 | } |
diff --git a/OpenSim/Framework/Communications/IUserServices.cs b/OpenSim/Framework/Communications/IUserServices.cs index 0b1f86c..cd97b52 100644 --- a/OpenSim/Framework/Communications/IUserServices.cs +++ b/OpenSim/Framework/Communications/IUserServices.cs | |||
@@ -1,43 +1,43 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using libsecondlife; | 28 | using libsecondlife; |
29 | using OpenSim.Framework.Data; | 29 | using OpenSim.Framework.Data; |
30 | 30 | ||
31 | namespace OpenSim.Framework.Communications | 31 | namespace OpenSim.Framework.Communications |
32 | { | 32 | { |
33 | public interface IUserServices | 33 | public interface IUserServices |
34 | { | 34 | { |
35 | UserProfileData GetUserProfile(string firstName, string lastName); | 35 | UserProfileData GetUserProfile(string firstName, string lastName); |
36 | UserProfileData GetUserProfile(string name); | 36 | UserProfileData GetUserProfile(string name); |
37 | UserProfileData GetUserProfile(LLUUID avatarID); | 37 | UserProfileData GetUserProfile(LLUUID avatarID); |
38 | 38 | ||
39 | UserProfileData SetupMasterUser(string firstName, string lastName); | 39 | UserProfileData SetupMasterUser(string firstName, string lastName); |
40 | UserProfileData SetupMasterUser(string firstName, string lastName, string password); | 40 | UserProfileData SetupMasterUser(string firstName, string lastName, string password); |
41 | 41 | ||
42 | } | 42 | } |
43 | } | 43 | } |
diff --git a/OpenSim/Framework/Communications/Properties/AssemblyInfo.cs b/OpenSim/Framework/Communications/Properties/AssemblyInfo.cs index 09f6473..79f3e30 100644 --- a/OpenSim/Framework/Communications/Properties/AssemblyInfo.cs +++ b/OpenSim/Framework/Communications/Properties/AssemblyInfo.cs | |||
@@ -1,60 +1,60 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using System.Reflection; | 28 | using System.Reflection; |
29 | using System.Runtime.InteropServices; | 29 | using System.Runtime.InteropServices; |
30 | // General Information about an assembly is controlled through the following | 30 | // General Information about an assembly is controlled through the following |
31 | // set of attributes. Change these attribute values to modify the information | 31 | // set of attributes. Change these attribute values to modify the information |
32 | // associated with an assembly. | 32 | // associated with an assembly. |
33 | [assembly: AssemblyTitle("OpenGrid.Framework.Communications")] | 33 | [assembly: AssemblyTitle("OpenGrid.Framework.Communications")] |
34 | [assembly: AssemblyDescription("")] | 34 | [assembly: AssemblyDescription("")] |
35 | [assembly: AssemblyConfiguration("")] | 35 | [assembly: AssemblyConfiguration("")] |
36 | [assembly: AssemblyCompany("")] | 36 | [assembly: AssemblyCompany("")] |
37 | [assembly: AssemblyProduct("OpenGrid.Framework.Communications")] | 37 | [assembly: AssemblyProduct("OpenGrid.Framework.Communications")] |
38 | [assembly: AssemblyCopyright("Copyright © 2007")] | 38 | [assembly: AssemblyCopyright("Copyright © 2007")] |
39 | [assembly: AssemblyTrademark("")] | 39 | [assembly: AssemblyTrademark("")] |
40 | [assembly: AssemblyCulture("")] | 40 | [assembly: AssemblyCulture("")] |
41 | 41 | ||
42 | // Setting ComVisible to false makes the types in this assembly not visible | 42 | // Setting ComVisible to false makes the types in this assembly not visible |
43 | // to COM components. If you need to access a type in this assembly from | 43 | // to COM components. If you need to access a type in this assembly from |
44 | // COM, set the ComVisible attribute to true on that type. | 44 | // COM, set the ComVisible attribute to true on that type. |
45 | [assembly: ComVisible(false)] | 45 | [assembly: ComVisible(false)] |
46 | 46 | ||
47 | // The following GUID is for the ID of the typelib if this project is exposed to COM | 47 | // The following GUID is for the ID of the typelib if this project is exposed to COM |
48 | [assembly: Guid("13e7c396-78a9-4a5c-baf2-6f980ea75d95")] | 48 | [assembly: Guid("13e7c396-78a9-4a5c-baf2-6f980ea75d95")] |
49 | 49 | ||
50 | // Version information for an assembly consists of the following four values: | 50 | // Version information for an assembly consists of the following four values: |
51 | // | 51 | // |
52 | // Major Version | 52 | // Major Version |
53 | // Minor Version | 53 | // Minor Version |
54 | // Build Number | 54 | // Build Number |
55 | // Revision | 55 | // Revision |
56 | // | 56 | // |
57 | // You can specify all the values or you can default the Revision and Build Numbers | 57 | // You can specify all the values or you can default the Revision and Build Numbers |
58 | // by using the '*' as shown below: | 58 | // by using the '*' as shown below: |
59 | [assembly: AssemblyVersion("1.0.0.0")] | 59 | [assembly: AssemblyVersion("1.0.0.0")] |
60 | [assembly: AssemblyFileVersion("1.0.0.0")] | 60 | [assembly: AssemblyFileVersion("1.0.0.0")] |
diff --git a/OpenSim/Framework/Communications/caches/CachedUserInfo.cs b/OpenSim/Framework/Communications/caches/CachedUserInfo.cs index 1c779e9..b8d8847 100644 --- a/OpenSim/Framework/Communications/caches/CachedUserInfo.cs +++ b/OpenSim/Framework/Communications/caches/CachedUserInfo.cs | |||
@@ -1,77 +1,77 @@ | |||
1 | using System; | 1 | using System; |
2 | using System.Collections.Generic; | 2 | using System.Collections.Generic; |
3 | using System.Text; | 3 | using System.Text; |
4 | using OpenSim.Framework.Data; | 4 | using OpenSim.Framework.Data; |
5 | using libsecondlife; | 5 | using libsecondlife; |
6 | 6 | ||
7 | namespace OpenSim.Framework.Communications.Caches | 7 | namespace OpenSim.Framework.Communications.Caches |
8 | { | 8 | { |
9 | public class CachedUserInfo | 9 | public class CachedUserInfo |
10 | { | 10 | { |
11 | public UserProfileData UserProfile; | 11 | public UserProfileData UserProfile; |
12 | //public Dictionary<LLUUID, InventoryFolder> Folders = new Dictionary<LLUUID, InventoryFolder>(); | 12 | //public Dictionary<LLUUID, InventoryFolder> Folders = new Dictionary<LLUUID, InventoryFolder>(); |
13 | public InventoryFolder RootFolder; | 13 | public InventoryFolder RootFolder; |
14 | 14 | ||
15 | public CachedUserInfo() | 15 | public CachedUserInfo() |
16 | { | 16 | { |
17 | 17 | ||
18 | } | 18 | } |
19 | 19 | ||
20 | /// <summary> | 20 | /// <summary> |
21 | /// | 21 | /// |
22 | /// </summary> | 22 | /// </summary> |
23 | /// <param name="userID"></param> | 23 | /// <param name="userID"></param> |
24 | /// <param name="folderInfo"></param> | 24 | /// <param name="folderInfo"></param> |
25 | public void FolderReceive(LLUUID userID, InventoryFolder folderInfo) | 25 | public void FolderReceive(LLUUID userID, InventoryFolder folderInfo) |
26 | { | 26 | { |
27 | if (userID == UserProfile.UUID) | 27 | if (userID == UserProfile.UUID) |
28 | { | 28 | { |
29 | if (this.RootFolder == null) | 29 | if (this.RootFolder == null) |
30 | { | 30 | { |
31 | if (folderInfo.parentID == LLUUID.Zero) | 31 | if (folderInfo.parentID == LLUUID.Zero) |
32 | { | 32 | { |
33 | this.RootFolder = folderInfo; | 33 | this.RootFolder = folderInfo; |
34 | } | 34 | } |
35 | } | 35 | } |
36 | else | 36 | else |
37 | { | 37 | { |
38 | if (this.RootFolder.folderID == folderInfo.parentID) | 38 | if (this.RootFolder.folderID == folderInfo.parentID) |
39 | { | 39 | { |
40 | this.RootFolder.SubFolders.Add(folderInfo.folderID, folderInfo); | 40 | this.RootFolder.SubFolders.Add(folderInfo.folderID, folderInfo); |
41 | } | 41 | } |
42 | else | 42 | else |
43 | { | 43 | { |
44 | InventoryFolder pFolder = this.RootFolder.HasSubFolder(folderInfo.parentID); | 44 | InventoryFolder pFolder = this.RootFolder.HasSubFolder(folderInfo.parentID); |
45 | if (pFolder != null) | 45 | if (pFolder != null) |
46 | { | 46 | { |
47 | pFolder.SubFolders.Add(folderInfo.folderID, folderInfo); | 47 | pFolder.SubFolders.Add(folderInfo.folderID, folderInfo); |
48 | } | 48 | } |
49 | } | 49 | } |
50 | } | 50 | } |
51 | } | 51 | } |
52 | } | 52 | } |
53 | 53 | ||
54 | public void ItemReceive(LLUUID userID, InventoryItemBase itemInfo) | 54 | public void ItemReceive(LLUUID userID, InventoryItemBase itemInfo) |
55 | { | 55 | { |
56 | if (userID == UserProfile.UUID) | 56 | if (userID == UserProfile.UUID) |
57 | { | 57 | { |
58 | if (this.RootFolder != null) | 58 | if (this.RootFolder != null) |
59 | { | 59 | { |
60 | if (itemInfo.parentFolderID == this.RootFolder.folderID) | 60 | if (itemInfo.parentFolderID == this.RootFolder.folderID) |
61 | { | 61 | { |
62 | this.RootFolder.Items.Add(itemInfo.inventoryID, itemInfo); | 62 | this.RootFolder.Items.Add(itemInfo.inventoryID, itemInfo); |
63 | } | 63 | } |
64 | else | 64 | else |
65 | { | 65 | { |
66 | InventoryFolder pFolder = this.RootFolder.HasSubFolder(itemInfo.parentFolderID); | 66 | InventoryFolder pFolder = this.RootFolder.HasSubFolder(itemInfo.parentFolderID); |
67 | if (pFolder != null) | 67 | if (pFolder != null) |
68 | { | 68 | { |
69 | pFolder.Items.Add(itemInfo.inventoryID, itemInfo); | 69 | pFolder.Items.Add(itemInfo.inventoryID, itemInfo); |
70 | } | 70 | } |
71 | } | 71 | } |
72 | } | 72 | } |
73 | 73 | ||
74 | } | 74 | } |
75 | } | 75 | } |
76 | } | 76 | } |
77 | } | 77 | } |
diff --git a/OpenSim/Framework/Communications/caches/InventoryFolder.cs b/OpenSim/Framework/Communications/caches/InventoryFolder.cs index eaddf19..af38b12 100644 --- a/OpenSim/Framework/Communications/caches/InventoryFolder.cs +++ b/OpenSim/Framework/Communications/caches/InventoryFolder.cs | |||
@@ -1,51 +1,51 @@ | |||
1 | using System; | 1 | using System; |
2 | using System.Collections.Generic; | 2 | using System.Collections.Generic; |
3 | using System.Text; | 3 | using System.Text; |
4 | using libsecondlife; | 4 | using libsecondlife; |
5 | using OpenSim.Framework.Data; | 5 | using OpenSim.Framework.Data; |
6 | 6 | ||
7 | namespace OpenSim.Framework.Communications.Caches | 7 | namespace OpenSim.Framework.Communications.Caches |
8 | { | 8 | { |
9 | public class InventoryFolder : InventoryFolderBase | 9 | public class InventoryFolder : InventoryFolderBase |
10 | { | 10 | { |
11 | public Dictionary<LLUUID, InventoryFolder> SubFolders = new Dictionary<LLUUID, InventoryFolder>(); | 11 | public Dictionary<LLUUID, InventoryFolder> SubFolders = new Dictionary<LLUUID, InventoryFolder>(); |
12 | public Dictionary<LLUUID, InventoryItemBase> Items = new Dictionary<LLUUID, InventoryItemBase>(); | 12 | public Dictionary<LLUUID, InventoryItemBase> Items = new Dictionary<LLUUID, InventoryItemBase>(); |
13 | 13 | ||
14 | public InventoryFolder() | 14 | public InventoryFolder() |
15 | { | 15 | { |
16 | } | 16 | } |
17 | 17 | ||
18 | public InventoryFolder HasSubFolder(LLUUID folderID) | 18 | public InventoryFolder HasSubFolder(LLUUID folderID) |
19 | { | 19 | { |
20 | InventoryFolder returnFolder = null; | 20 | InventoryFolder returnFolder = null; |
21 | if (this.SubFolders.ContainsKey(folderID)) | 21 | if (this.SubFolders.ContainsKey(folderID)) |
22 | { | 22 | { |
23 | returnFolder = this.SubFolders[folderID]; | 23 | returnFolder = this.SubFolders[folderID]; |
24 | } | 24 | } |
25 | else | 25 | else |
26 | { | 26 | { |
27 | foreach (InventoryFolder folder in this.SubFolders.Values) | 27 | foreach (InventoryFolder folder in this.SubFolders.Values) |
28 | { | 28 | { |
29 | returnFolder = folder.HasSubFolder(folderID); | 29 | returnFolder = folder.HasSubFolder(folderID); |
30 | if (returnFolder != null) | 30 | if (returnFolder != null) |
31 | { | 31 | { |
32 | break; | 32 | break; |
33 | } | 33 | } |
34 | } | 34 | } |
35 | } | 35 | } |
36 | return returnFolder; | 36 | return returnFolder; |
37 | } | 37 | } |
38 | 38 | ||
39 | public InventoryFolder CreateNewSubFolder(LLUUID folderID, string folderName, ushort type) | 39 | public InventoryFolder CreateNewSubFolder(LLUUID folderID, string folderName, ushort type) |
40 | { | 40 | { |
41 | InventoryFolder subFold = new InventoryFolder(); | 41 | InventoryFolder subFold = new InventoryFolder(); |
42 | subFold.name = folderName; | 42 | subFold.name = folderName; |
43 | subFold.folderID = folderID; | 43 | subFold.folderID = folderID; |
44 | subFold.type = type; | 44 | subFold.type = type; |
45 | subFold.parentID = this.folderID; | 45 | subFold.parentID = this.folderID; |
46 | subFold.agentID = this.agentID; | 46 | subFold.agentID = this.agentID; |
47 | this.SubFolders.Add(subFold.folderID, subFold); | 47 | this.SubFolders.Add(subFold.folderID, subFold); |
48 | return subFold; | 48 | return subFold; |
49 | } | 49 | } |
50 | } | 50 | } |
51 | } | 51 | } |
diff --git a/OpenSim/Framework/Communications/caches/UserProfileCache.cs b/OpenSim/Framework/Communications/caches/UserProfileCache.cs index 0ee63ba..f651b8a 100644 --- a/OpenSim/Framework/Communications/caches/UserProfileCache.cs +++ b/OpenSim/Framework/Communications/caches/UserProfileCache.cs | |||
@@ -1,107 +1,107 @@ | |||
1 | using System; | 1 | using System; |
2 | using System.Collections.Generic; | 2 | using System.Collections.Generic; |
3 | using System.Text; | 3 | using System.Text; |
4 | using libsecondlife; | 4 | using libsecondlife; |
5 | using OpenSim.Framework.Data; | 5 | using OpenSim.Framework.Data; |
6 | using OpenSim.Framework.Communications; | 6 | using OpenSim.Framework.Communications; |
7 | 7 | ||
8 | namespace OpenSim.Framework.Communications.Caches | 8 | namespace OpenSim.Framework.Communications.Caches |
9 | { | 9 | { |
10 | public class UserProfileCache | 10 | public class UserProfileCache |
11 | { | 11 | { |
12 | public Dictionary<LLUUID, CachedUserInfo> UserProfiles = new Dictionary<LLUUID, CachedUserInfo>(); | 12 | public Dictionary<LLUUID, CachedUserInfo> UserProfiles = new Dictionary<LLUUID, CachedUserInfo>(); |
13 | 13 | ||
14 | private CommunicationsManager m_parent; | 14 | private CommunicationsManager m_parent; |
15 | 15 | ||
16 | public UserProfileCache(CommunicationsManager parent) | 16 | public UserProfileCache(CommunicationsManager parent) |
17 | { | 17 | { |
18 | m_parent = parent; | 18 | m_parent = parent; |
19 | } | 19 | } |
20 | 20 | ||
21 | /// <summary> | 21 | /// <summary> |
22 | /// A new user has moved into a region in this instance | 22 | /// A new user has moved into a region in this instance |
23 | /// so get info from servers | 23 | /// so get info from servers |
24 | /// </summary> | 24 | /// </summary> |
25 | /// <param name="userID"></param> | 25 | /// <param name="userID"></param> |
26 | public void AddNewUser(LLUUID userID) | 26 | public void AddNewUser(LLUUID userID) |
27 | { | 27 | { |
28 | if (!this.UserProfiles.ContainsKey(userID)) | 28 | if (!this.UserProfiles.ContainsKey(userID)) |
29 | { | 29 | { |
30 | CachedUserInfo userInfo = new CachedUserInfo(); | 30 | CachedUserInfo userInfo = new CachedUserInfo(); |
31 | userInfo.UserProfile = this.RequestUserProfileForUser(userID); | 31 | userInfo.UserProfile = this.RequestUserProfileForUser(userID); |
32 | this.m_parent.InventoryServer.RequestInventoryForUser(userID, userInfo.FolderReceive, userInfo.ItemReceive); | 32 | this.m_parent.InventoryServer.RequestInventoryForUser(userID, userInfo.FolderReceive, userInfo.ItemReceive); |
33 | if (userInfo.UserProfile != null) | 33 | if (userInfo.UserProfile != null) |
34 | { | 34 | { |
35 | this.UserProfiles.Add(userID, userInfo); | 35 | this.UserProfiles.Add(userID, userInfo); |
36 | } | 36 | } |
37 | else | 37 | else |
38 | { | 38 | { |
39 | //no profile for this user, what do we do now? | 39 | //no profile for this user, what do we do now? |
40 | } | 40 | } |
41 | } | 41 | } |
42 | else | 42 | else |
43 | { | 43 | { |
44 | //already have a cached profile for this user | 44 | //already have a cached profile for this user |
45 | //we should make sure its upto date with the user server version | 45 | //we should make sure its upto date with the user server version |
46 | } | 46 | } |
47 | } | 47 | } |
48 | 48 | ||
49 | /// <summary> | 49 | /// <summary> |
50 | /// A new user has moved into a region in this instance | 50 | /// A new user has moved into a region in this instance |
51 | /// so get info from servers | 51 | /// so get info from servers |
52 | /// </summary> | 52 | /// </summary> |
53 | /// <param name="firstName"></param> | 53 | /// <param name="firstName"></param> |
54 | /// <param name="lastName"></param> | 54 | /// <param name="lastName"></param> |
55 | public void AddNewUser(string firstName, string lastName) | 55 | public void AddNewUser(string firstName, string lastName) |
56 | { | 56 | { |
57 | 57 | ||
58 | } | 58 | } |
59 | 59 | ||
60 | /// <summary> | 60 | /// <summary> |
61 | /// A user has left this instance | 61 | /// A user has left this instance |
62 | /// so make sure servers have been updated | 62 | /// so make sure servers have been updated |
63 | /// Then remove cached info | 63 | /// Then remove cached info |
64 | /// </summary> | 64 | /// </summary> |
65 | /// <param name="userID"></param> | 65 | /// <param name="userID"></param> |
66 | public void UserLogOut(LLUUID userID) | 66 | public void UserLogOut(LLUUID userID) |
67 | { | 67 | { |
68 | 68 | ||
69 | } | 69 | } |
70 | 70 | ||
71 | /// <summary> | 71 | /// <summary> |
72 | /// Request the user profile from User server | 72 | /// Request the user profile from User server |
73 | /// </summary> | 73 | /// </summary> |
74 | /// <param name="userID"></param> | 74 | /// <param name="userID"></param> |
75 | private UserProfileData RequestUserProfileForUser(LLUUID userID) | 75 | private UserProfileData RequestUserProfileForUser(LLUUID userID) |
76 | { | 76 | { |
77 | return this.m_parent.UserServer.GetUserProfile(userID); | 77 | return this.m_parent.UserServer.GetUserProfile(userID); |
78 | } | 78 | } |
79 | 79 | ||
80 | /// <summary> | 80 | /// <summary> |
81 | /// Request Iventory Info from Inventory server | 81 | /// Request Iventory Info from Inventory server |
82 | /// </summary> | 82 | /// </summary> |
83 | /// <param name="userID"></param> | 83 | /// <param name="userID"></param> |
84 | private void RequestInventoryForUser(LLUUID userID) | 84 | private void RequestInventoryForUser(LLUUID userID) |
85 | { | 85 | { |
86 | 86 | ||
87 | } | 87 | } |
88 | 88 | ||
89 | /// <summary> | 89 | /// <summary> |
90 | /// Make sure UserProfile is updated on user server | 90 | /// Make sure UserProfile is updated on user server |
91 | /// </summary> | 91 | /// </summary> |
92 | /// <param name="userID"></param> | 92 | /// <param name="userID"></param> |
93 | private void UpdateUserProfileToServer(LLUUID userID) | 93 | private void UpdateUserProfileToServer(LLUUID userID) |
94 | { | 94 | { |
95 | 95 | ||
96 | } | 96 | } |
97 | 97 | ||
98 | /// <summary> | 98 | /// <summary> |
99 | /// Update Inventory data to Inventory server | 99 | /// Update Inventory data to Inventory server |
100 | /// </summary> | 100 | /// </summary> |
101 | /// <param name="userID"></param> | 101 | /// <param name="userID"></param> |
102 | private void UpdateInventoryToServer(LLUUID userID) | 102 | private void UpdateInventoryToServer(LLUUID userID) |
103 | { | 103 | { |
104 | 104 | ||
105 | } | 105 | } |
106 | } | 106 | } |
107 | } | 107 | } |
diff --git a/OpenSim/Framework/Console/AssemblyInfo.cs b/OpenSim/Framework/Console/AssemblyInfo.cs index 30f6167..61bd423 100644 --- a/OpenSim/Framework/Console/AssemblyInfo.cs +++ b/OpenSim/Framework/Console/AssemblyInfo.cs | |||
@@ -1,56 +1,56 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using System.Reflection; | 28 | using System.Reflection; |
29 | using System.Runtime.InteropServices; | 29 | using System.Runtime.InteropServices; |
30 | // Information about this assembly is defined by the following | 30 | // Information about this assembly is defined by the following |
31 | // attributes. | 31 | // attributes. |
32 | // | 32 | // |
33 | // change them to the information which is associated with the assembly | 33 | // change them to the information which is associated with the assembly |
34 | // you compile. | 34 | // you compile. |
35 | 35 | ||
36 | [assembly: AssemblyTitle("ServerConsole")] | 36 | [assembly: AssemblyTitle("ServerConsole")] |
37 | [assembly: AssemblyDescription("")] | 37 | [assembly: AssemblyDescription("")] |
38 | [assembly: AssemblyConfiguration("")] | 38 | [assembly: AssemblyConfiguration("")] |
39 | [assembly: AssemblyCompany("")] | 39 | [assembly: AssemblyCompany("")] |
40 | [assembly: AssemblyProduct("ServerConsole")] | 40 | [assembly: AssemblyProduct("ServerConsole")] |
41 | [assembly: AssemblyCopyright("")] | 41 | [assembly: AssemblyCopyright("")] |
42 | [assembly: AssemblyTrademark("")] | 42 | [assembly: AssemblyTrademark("")] |
43 | [assembly: AssemblyCulture("")] | 43 | [assembly: AssemblyCulture("")] |
44 | 44 | ||
45 | // This sets the default COM visibility of types in the assembly to invisible. | 45 | // This sets the default COM visibility of types in the assembly to invisible. |
46 | // If you need to expose a type to COM, use [ComVisible(true)] on that type. | 46 | // If you need to expose a type to COM, use [ComVisible(true)] on that type. |
47 | [assembly: ComVisible(false)] | 47 | [assembly: ComVisible(false)] |
48 | 48 | ||
49 | // The assembly version has following format : | 49 | // The assembly version has following format : |
50 | // | 50 | // |
51 | // Major.Minor.Build.Revision | 51 | // Major.Minor.Build.Revision |
52 | // | 52 | // |
53 | // You can specify all values by your own or you can build default build and revision | 53 | // You can specify all values by your own or you can build default build and revision |
54 | // numbers with the '*' character (the default): | 54 | // numbers with the '*' character (the default): |
55 | 55 | ||
56 | [assembly: AssemblyVersion("1.0.*")] | 56 | [assembly: AssemblyVersion("1.0.*")] |
diff --git a/OpenSim/Framework/Console/ConsoleCallbacksBase.cs b/OpenSim/Framework/Console/ConsoleCallbacksBase.cs index 346cfe6..1dea251 100644 --- a/OpenSim/Framework/Console/ConsoleCallbacksBase.cs +++ b/OpenSim/Framework/Console/ConsoleCallbacksBase.cs | |||
@@ -1,35 +1,35 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | namespace OpenSim.Framework.Console | 28 | namespace OpenSim.Framework.Console |
29 | { | 29 | { |
30 | public interface conscmd_callback | 30 | public interface conscmd_callback |
31 | { | 31 | { |
32 | void RunCmd(string cmd, string[] cmdparams); | 32 | void RunCmd(string cmd, string[] cmdparams); |
33 | void Show(string ShowWhat); | 33 | void Show(string ShowWhat); |
34 | } | 34 | } |
35 | } | 35 | } |
diff --git a/OpenSim/Framework/Console/LogBase.cs b/OpenSim/Framework/Console/LogBase.cs index f73e15e..1eb6ff0 100644 --- a/OpenSim/Framework/Console/LogBase.cs +++ b/OpenSim/Framework/Console/LogBase.cs | |||
@@ -1,282 +1,282 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using System; | 28 | using System; |
29 | using System.IO; | 29 | using System.IO; |
30 | using System.Net; | 30 | using System.Net; |
31 | 31 | ||
32 | namespace OpenSim.Framework.Console | 32 | namespace OpenSim.Framework.Console |
33 | { | 33 | { |
34 | public enum LogPriority : int | 34 | public enum LogPriority : int |
35 | { | 35 | { |
36 | CRITICAL, | 36 | CRITICAL, |
37 | HIGH, | 37 | HIGH, |
38 | MEDIUM, | 38 | MEDIUM, |
39 | NORMAL, | 39 | NORMAL, |
40 | LOW, | 40 | LOW, |
41 | VERBOSE, | 41 | VERBOSE, |
42 | EXTRAVERBOSE | 42 | EXTRAVERBOSE |
43 | } | 43 | } |
44 | 44 | ||
45 | public class LogBase | 45 | public class LogBase |
46 | { | 46 | { |
47 | StreamWriter Log; | 47 | StreamWriter Log; |
48 | public conscmd_callback cmdparser; | 48 | public conscmd_callback cmdparser; |
49 | public string componentname; | 49 | public string componentname; |
50 | private bool m_silent; | 50 | private bool m_silent; |
51 | 51 | ||
52 | public LogBase(string LogFile, string componentname, conscmd_callback cmdparser, bool silent) | 52 | public LogBase(string LogFile, string componentname, conscmd_callback cmdparser, bool silent) |
53 | { | 53 | { |
54 | this.componentname = componentname; | 54 | this.componentname = componentname; |
55 | this.cmdparser = cmdparser; | 55 | this.cmdparser = cmdparser; |
56 | this.m_silent = silent; | 56 | this.m_silent = silent; |
57 | System.Console.WriteLine("ServerConsole.cs - creating new local console"); | 57 | System.Console.WriteLine("ServerConsole.cs - creating new local console"); |
58 | 58 | ||
59 | if (String.IsNullOrEmpty(LogFile)) | 59 | if (String.IsNullOrEmpty(LogFile)) |
60 | { | 60 | { |
61 | LogFile = componentname + ".log"; | 61 | LogFile = componentname + ".log"; |
62 | } | 62 | } |
63 | 63 | ||
64 | System.Console.WriteLine("Logs will be saved to current directory in " + LogFile); | 64 | System.Console.WriteLine("Logs will be saved to current directory in " + LogFile); |
65 | Log = File.AppendText(LogFile); | 65 | Log = File.AppendText(LogFile); |
66 | Log.WriteLine("========================================================================"); | 66 | Log.WriteLine("========================================================================"); |
67 | Log.WriteLine(componentname + " Started at " + DateTime.Now.ToString()); | 67 | Log.WriteLine(componentname + " Started at " + DateTime.Now.ToString()); |
68 | } | 68 | } |
69 | 69 | ||
70 | public void Close() | 70 | public void Close() |
71 | { | 71 | { |
72 | Log.WriteLine("Shutdown at " + DateTime.Now.ToString()); | 72 | Log.WriteLine("Shutdown at " + DateTime.Now.ToString()); |
73 | Log.Close(); | 73 | Log.Close(); |
74 | } | 74 | } |
75 | 75 | ||
76 | public void Write(string format, params object[] args) | 76 | public void Write(string format, params object[] args) |
77 | { | 77 | { |
78 | Notice(format, args); | 78 | Notice(format, args); |
79 | return; | 79 | return; |
80 | } | 80 | } |
81 | 81 | ||
82 | public void WriteLine(LogPriority importance, string format, params object[] args) | 82 | public void WriteLine(LogPriority importance, string format, params object[] args) |
83 | { | 83 | { |
84 | Log.WriteLine(format, args); | 84 | Log.WriteLine(format, args); |
85 | Log.Flush(); | 85 | Log.Flush(); |
86 | if (!m_silent) | 86 | if (!m_silent) |
87 | { | 87 | { |
88 | System.Console.WriteLine(format, args); | 88 | System.Console.WriteLine(format, args); |
89 | } | 89 | } |
90 | return; | 90 | return; |
91 | } | 91 | } |
92 | 92 | ||
93 | public void Warn(string format, params object[] args) | 93 | public void Warn(string format, params object[] args) |
94 | { | 94 | { |
95 | WriteNewLine(ConsoleColor.Yellow, format, args); | 95 | WriteNewLine(ConsoleColor.Yellow, format, args); |
96 | return; | 96 | return; |
97 | } | 97 | } |
98 | 98 | ||
99 | public void Notice(string format, params object[] args) | 99 | public void Notice(string format, params object[] args) |
100 | { | 100 | { |
101 | WriteNewLine(ConsoleColor.White, format, args); | 101 | WriteNewLine(ConsoleColor.White, format, args); |
102 | return; | 102 | return; |
103 | } | 103 | } |
104 | 104 | ||
105 | public void Error(string format, params object[] args) | 105 | public void Error(string format, params object[] args) |
106 | { | 106 | { |
107 | WriteNewLine(ConsoleColor.Red, format, args); | 107 | WriteNewLine(ConsoleColor.Red, format, args); |
108 | return; | 108 | return; |
109 | } | 109 | } |
110 | 110 | ||
111 | public void Verbose(string format, params object[] args) | 111 | public void Verbose(string format, params object[] args) |
112 | { | 112 | { |
113 | WriteNewLine(ConsoleColor.Gray, format, args); | 113 | WriteNewLine(ConsoleColor.Gray, format, args); |
114 | return; | 114 | return; |
115 | } | 115 | } |
116 | 116 | ||
117 | public void Status(string format, params object[] args) | 117 | public void Status(string format, params object[] args) |
118 | { | 118 | { |
119 | WriteNewLine(ConsoleColor.Blue, format, args); | 119 | WriteNewLine(ConsoleColor.Blue, format, args); |
120 | return; | 120 | return; |
121 | } | 121 | } |
122 | 122 | ||
123 | private void WriteNewLine(ConsoleColor color, string format, params object[] args) | 123 | private void WriteNewLine(ConsoleColor color, string format, params object[] args) |
124 | { | 124 | { |
125 | Log.WriteLine(format, args); | 125 | Log.WriteLine(format, args); |
126 | Log.Flush(); | 126 | Log.Flush(); |
127 | if (!m_silent) | 127 | if (!m_silent) |
128 | { | 128 | { |
129 | try | 129 | try |
130 | { | 130 | { |
131 | System.Console.ForegroundColor = color; | 131 | System.Console.ForegroundColor = color; |
132 | System.Console.WriteLine(format, args); | 132 | System.Console.WriteLine(format, args); |
133 | System.Console.ResetColor(); | 133 | System.Console.ResetColor(); |
134 | } | 134 | } |
135 | catch (ArgumentNullException) | 135 | catch (ArgumentNullException) |
136 | { | 136 | { |
137 | // Some older systems dont support coloured text. | 137 | // Some older systems dont support coloured text. |
138 | System.Console.WriteLine(format, args); | 138 | System.Console.WriteLine(format, args); |
139 | } | 139 | } |
140 | } | 140 | } |
141 | return; | 141 | return; |
142 | } | 142 | } |
143 | 143 | ||
144 | public string ReadLine() | 144 | public string ReadLine() |
145 | { | 145 | { |
146 | string TempStr = System.Console.ReadLine(); | 146 | string TempStr = System.Console.ReadLine(); |
147 | Log.WriteLine(TempStr); | 147 | Log.WriteLine(TempStr); |
148 | return TempStr; | 148 | return TempStr; |
149 | } | 149 | } |
150 | 150 | ||
151 | public int Read() | 151 | public int Read() |
152 | { | 152 | { |
153 | int TempInt = System.Console.Read(); | 153 | int TempInt = System.Console.Read(); |
154 | Log.Write((char)TempInt); | 154 | Log.Write((char)TempInt); |
155 | return TempInt; | 155 | return TempInt; |
156 | } | 156 | } |
157 | 157 | ||
158 | public IPAddress CmdPromptIPAddress(string prompt, string defaultvalue) | 158 | public IPAddress CmdPromptIPAddress(string prompt, string defaultvalue) |
159 | { | 159 | { |
160 | IPAddress address; | 160 | IPAddress address; |
161 | string addressStr; | 161 | string addressStr; |
162 | 162 | ||
163 | while (true) | 163 | while (true) |
164 | { | 164 | { |
165 | addressStr = MainLog.Instance.CmdPrompt(prompt, defaultvalue); | 165 | addressStr = MainLog.Instance.CmdPrompt(prompt, defaultvalue); |
166 | if (IPAddress.TryParse(addressStr, out address)) | 166 | if (IPAddress.TryParse(addressStr, out address)) |
167 | { | 167 | { |
168 | break; | 168 | break; |
169 | } | 169 | } |
170 | else | 170 | else |
171 | { | 171 | { |
172 | MainLog.Instance.Error("Illegal address. Please re-enter."); | 172 | MainLog.Instance.Error("Illegal address. Please re-enter."); |
173 | } | 173 | } |
174 | } | 174 | } |
175 | 175 | ||
176 | return address; | 176 | return address; |
177 | } | 177 | } |
178 | 178 | ||
179 | public int CmdPromptIPPort(string prompt, string defaultvalue) | 179 | public int CmdPromptIPPort(string prompt, string defaultvalue) |
180 | { | 180 | { |
181 | int port; | 181 | int port; |
182 | string portStr; | 182 | string portStr; |
183 | 183 | ||
184 | while (true) | 184 | while (true) |
185 | { | 185 | { |
186 | portStr = MainLog.Instance.CmdPrompt(prompt, defaultvalue); | 186 | portStr = MainLog.Instance.CmdPrompt(prompt, defaultvalue); |
187 | if (int.TryParse(portStr, out port)) | 187 | if (int.TryParse(portStr, out port)) |
188 | { | 188 | { |
189 | if (port >= IPEndPoint.MinPort && port <= IPEndPoint.MaxPort) | 189 | if (port >= IPEndPoint.MinPort && port <= IPEndPoint.MaxPort) |
190 | { | 190 | { |
191 | break; | 191 | break; |
192 | } | 192 | } |
193 | } | 193 | } |
194 | 194 | ||
195 | MainLog.Instance.Error("Illegal address. Please re-enter."); | 195 | MainLog.Instance.Error("Illegal address. Please re-enter."); |
196 | } | 196 | } |
197 | 197 | ||
198 | return port; | 198 | return port; |
199 | } | 199 | } |
200 | 200 | ||
201 | // Displays a prompt and waits for the user to enter a string, then returns that string | 201 | // Displays a prompt and waits for the user to enter a string, then returns that string |
202 | // Done with no echo and suitable for passwords | 202 | // Done with no echo and suitable for passwords |
203 | public string PasswdPrompt(string prompt) | 203 | public string PasswdPrompt(string prompt) |
204 | { | 204 | { |
205 | // FIXME: Needs to be better abstracted | 205 | // FIXME: Needs to be better abstracted |
206 | Log.WriteLine(prompt); | 206 | Log.WriteLine(prompt); |
207 | this.Write(prompt); | 207 | this.Write(prompt); |
208 | ConsoleColor oldfg = System.Console.ForegroundColor; | 208 | ConsoleColor oldfg = System.Console.ForegroundColor; |
209 | System.Console.ForegroundColor = System.Console.BackgroundColor; | 209 | System.Console.ForegroundColor = System.Console.BackgroundColor; |
210 | string temp = System.Console.ReadLine(); | 210 | string temp = System.Console.ReadLine(); |
211 | System.Console.ForegroundColor = oldfg; | 211 | System.Console.ForegroundColor = oldfg; |
212 | return temp; | 212 | return temp; |
213 | } | 213 | } |
214 | 214 | ||
215 | // Displays a command prompt and waits for the user to enter a string, then returns that string | 215 | // Displays a command prompt and waits for the user to enter a string, then returns that string |
216 | public string CmdPrompt(string prompt) | 216 | public string CmdPrompt(string prompt) |
217 | { | 217 | { |
218 | this.Write(String.Format("{0}: ", prompt)); | 218 | this.Write(String.Format("{0}: ", prompt)); |
219 | return this.ReadLine(); | 219 | return this.ReadLine(); |
220 | } | 220 | } |
221 | 221 | ||
222 | // Displays a command prompt and returns a default value if the user simply presses enter | 222 | // Displays a command prompt and returns a default value if the user simply presses enter |
223 | public string CmdPrompt(string prompt, string defaultresponse) | 223 | public string CmdPrompt(string prompt, string defaultresponse) |
224 | { | 224 | { |
225 | string temp = CmdPrompt(String.Format("{0} [{1}]", prompt, defaultresponse)); | 225 | string temp = CmdPrompt(String.Format("{0} [{1}]", prompt, defaultresponse)); |
226 | if (temp == "") | 226 | if (temp == "") |
227 | { | 227 | { |
228 | return defaultresponse; | 228 | return defaultresponse; |
229 | } | 229 | } |
230 | else | 230 | else |
231 | { | 231 | { |
232 | return temp; | 232 | return temp; |
233 | } | 233 | } |
234 | } | 234 | } |
235 | 235 | ||
236 | // Displays a command prompt and returns a default value, user may only enter 1 of 2 options | 236 | // Displays a command prompt and returns a default value, user may only enter 1 of 2 options |
237 | public string CmdPrompt(string prompt, string defaultresponse, string OptionA, string OptionB) | 237 | public string CmdPrompt(string prompt, string defaultresponse, string OptionA, string OptionB) |
238 | { | 238 | { |
239 | bool itisdone = false; | 239 | bool itisdone = false; |
240 | string temp = CmdPrompt(prompt, defaultresponse); | 240 | string temp = CmdPrompt(prompt, defaultresponse); |
241 | while (itisdone == false) | 241 | while (itisdone == false) |
242 | { | 242 | { |
243 | if ((temp == OptionA) || (temp == OptionB)) | 243 | if ((temp == OptionA) || (temp == OptionB)) |
244 | { | 244 | { |
245 | itisdone = true; | 245 | itisdone = true; |
246 | } | 246 | } |
247 | else | 247 | else |
248 | { | 248 | { |
249 | Notice("Valid options are " + OptionA + " or " + OptionB); | 249 | Notice("Valid options are " + OptionA + " or " + OptionB); |
250 | temp = CmdPrompt(prompt, defaultresponse); | 250 | temp = CmdPrompt(prompt, defaultresponse); |
251 | } | 251 | } |
252 | } | 252 | } |
253 | return temp; | 253 | return temp; |
254 | } | 254 | } |
255 | 255 | ||
256 | // Runs a command with a number of parameters | 256 | // Runs a command with a number of parameters |
257 | public Object RunCmd(string Cmd, string[] cmdparams) | 257 | public Object RunCmd(string Cmd, string[] cmdparams) |
258 | { | 258 | { |
259 | cmdparser.RunCmd(Cmd, cmdparams); | 259 | cmdparser.RunCmd(Cmd, cmdparams); |
260 | return null; | 260 | return null; |
261 | } | 261 | } |
262 | 262 | ||
263 | // Shows data about something | 263 | // Shows data about something |
264 | public void ShowCommands(string ShowWhat) | 264 | public void ShowCommands(string ShowWhat) |
265 | { | 265 | { |
266 | cmdparser.Show(ShowWhat); | 266 | cmdparser.Show(ShowWhat); |
267 | } | 267 | } |
268 | 268 | ||
269 | public void MainLogPrompt() | 269 | public void MainLogPrompt() |
270 | { | 270 | { |
271 | string[] tempstrarray; | 271 | string[] tempstrarray; |
272 | string tempstr = this.CmdPrompt(this.componentname + "# "); | 272 | string tempstr = this.CmdPrompt(this.componentname + "# "); |
273 | tempstrarray = tempstr.Split(' '); | 273 | tempstrarray = tempstr.Split(' '); |
274 | string cmd = tempstrarray[0]; | 274 | string cmd = tempstrarray[0]; |
275 | Array.Reverse(tempstrarray); | 275 | Array.Reverse(tempstrarray); |
276 | Array.Resize<string>(ref tempstrarray, tempstrarray.Length - 1); | 276 | Array.Resize<string>(ref tempstrarray, tempstrarray.Length - 1); |
277 | Array.Reverse(tempstrarray); | 277 | Array.Reverse(tempstrarray); |
278 | string[] cmdparams = (string[])tempstrarray; | 278 | string[] cmdparams = (string[])tempstrarray; |
279 | RunCmd(cmd, cmdparams); | 279 | RunCmd(cmd, cmdparams); |
280 | } | 280 | } |
281 | } | 281 | } |
282 | } | 282 | } |
diff --git a/OpenSim/Framework/Console/MainLog.cs b/OpenSim/Framework/Console/MainLog.cs index 7d52622..e6bf9d9 100644 --- a/OpenSim/Framework/Console/MainLog.cs +++ b/OpenSim/Framework/Console/MainLog.cs | |||
@@ -1,47 +1,47 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | namespace OpenSim.Framework.Console | 28 | namespace OpenSim.Framework.Console |
29 | { | 29 | { |
30 | public class MainLog { | 30 | public class MainLog { |
31 | 31 | ||
32 | private static LogBase instance; | 32 | private static LogBase instance; |
33 | 33 | ||
34 | public static LogBase Instance | 34 | public static LogBase Instance |
35 | { | 35 | { |
36 | get | 36 | get |
37 | { | 37 | { |
38 | return instance; | 38 | return instance; |
39 | } | 39 | } |
40 | set | 40 | set |
41 | { | 41 | { |
42 | instance = value; | 42 | instance = value; |
43 | } | 43 | } |
44 | } | 44 | } |
45 | } | 45 | } |
46 | 46 | ||
47 | } | 47 | } |
diff --git a/OpenSim/Framework/Data.DB4o/DB4oGridData.cs b/OpenSim/Framework/Data.DB4o/DB4oGridData.cs index 5fec367..e57a3aa 100644 --- a/OpenSim/Framework/Data.DB4o/DB4oGridData.cs +++ b/OpenSim/Framework/Data.DB4o/DB4oGridData.cs | |||
@@ -1,162 +1,162 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 libsecondlife; | 30 | using libsecondlife; |
31 | 31 | ||
32 | namespace OpenSim.Framework.Data.DB4o | 32 | namespace OpenSim.Framework.Data.DB4o |
33 | { | 33 | { |
34 | /// <summary> | 34 | /// <summary> |
35 | /// A grid server storage mechanism employing the DB4o database system | 35 | /// A grid server storage mechanism employing the DB4o database system |
36 | /// </summary> | 36 | /// </summary> |
37 | class DB4oGridData : IGridData | 37 | class DB4oGridData : IGridData |
38 | { | 38 | { |
39 | /// <summary> | 39 | /// <summary> |
40 | /// The database manager object | 40 | /// The database manager object |
41 | /// </summary> | 41 | /// </summary> |
42 | DB4oGridManager manager; | 42 | DB4oGridManager manager; |
43 | 43 | ||
44 | /// <summary> | 44 | /// <summary> |
45 | /// Called when the plugin is first loaded (as constructors are not called) | 45 | /// Called when the plugin is first loaded (as constructors are not called) |
46 | /// </summary> | 46 | /// </summary> |
47 | public void Initialise() { | 47 | public void Initialise() { |
48 | manager = new DB4oGridManager("gridserver.yap"); | 48 | manager = new DB4oGridManager("gridserver.yap"); |
49 | } | 49 | } |
50 | 50 | ||
51 | /// <summary> | 51 | /// <summary> |
52 | /// Returns a list of regions within the specified ranges | 52 | /// Returns a list of regions within the specified ranges |
53 | /// </summary> | 53 | /// </summary> |
54 | /// <param name="a">minimum X coordinate</param> | 54 | /// <param name="a">minimum X coordinate</param> |
55 | /// <param name="b">minimum Y coordinate</param> | 55 | /// <param name="b">minimum Y coordinate</param> |
56 | /// <param name="c">maximum X coordinate</param> | 56 | /// <param name="c">maximum X coordinate</param> |
57 | /// <param name="d">maximum Y coordinate</param> | 57 | /// <param name="d">maximum Y coordinate</param> |
58 | /// <returns>An array of region profiles</returns> | 58 | /// <returns>An array of region profiles</returns> |
59 | public SimProfileData[] GetProfilesInRange(uint a, uint b, uint c, uint d) | 59 | public SimProfileData[] GetProfilesInRange(uint a, uint b, uint c, uint d) |
60 | { | 60 | { |
61 | return null; | 61 | return null; |
62 | } | 62 | } |
63 | 63 | ||
64 | /// <summary> | 64 | /// <summary> |
65 | /// Returns a region located at the specified regionHandle (warning multiple regions may occupy the one spot, first found is returned) | 65 | /// Returns a region located at the specified regionHandle (warning multiple regions may occupy the one spot, first found is returned) |
66 | /// </summary> | 66 | /// </summary> |
67 | /// <param name="handle">The handle to search for</param> | 67 | /// <param name="handle">The handle to search for</param> |
68 | /// <returns>A region profile</returns> | 68 | /// <returns>A region profile</returns> |
69 | public SimProfileData GetProfileByHandle(ulong handle) { | 69 | public SimProfileData GetProfileByHandle(ulong handle) { |
70 | lock (manager.simProfiles) | 70 | lock (manager.simProfiles) |
71 | { | 71 | { |
72 | foreach (LLUUID UUID in manager.simProfiles.Keys) | 72 | foreach (LLUUID UUID in manager.simProfiles.Keys) |
73 | { | 73 | { |
74 | if (manager.simProfiles[UUID].regionHandle == handle) | 74 | if (manager.simProfiles[UUID].regionHandle == handle) |
75 | { | 75 | { |
76 | return manager.simProfiles[UUID]; | 76 | return manager.simProfiles[UUID]; |
77 | } | 77 | } |
78 | } | 78 | } |
79 | } | 79 | } |
80 | throw new Exception("Unable to find profile with handle (" + handle.ToString() + ")"); | 80 | throw new Exception("Unable to find profile with handle (" + handle.ToString() + ")"); |
81 | } | 81 | } |
82 | 82 | ||
83 | /// <summary> | 83 | /// <summary> |
84 | /// Returns a specific region | 84 | /// Returns a specific region |
85 | /// </summary> | 85 | /// </summary> |
86 | /// <param name="uuid">The region ID code</param> | 86 | /// <param name="uuid">The region ID code</param> |
87 | /// <returns>A region profile</returns> | 87 | /// <returns>A region profile</returns> |
88 | public SimProfileData GetProfileByLLUUID(LLUUID uuid) | 88 | public SimProfileData GetProfileByLLUUID(LLUUID uuid) |
89 | { | 89 | { |
90 | lock (manager.simProfiles) | 90 | lock (manager.simProfiles) |
91 | { | 91 | { |
92 | if (manager.simProfiles.ContainsKey(uuid)) | 92 | if (manager.simProfiles.ContainsKey(uuid)) |
93 | return manager.simProfiles[uuid]; | 93 | return manager.simProfiles[uuid]; |
94 | } | 94 | } |
95 | throw new Exception("Unable to find profile with UUID (" + uuid.ToStringHyphenated() + "). Total Registered Regions: " + manager.simProfiles.Count); | 95 | throw new Exception("Unable to find profile with UUID (" + uuid.ToStringHyphenated() + "). Total Registered Regions: " + manager.simProfiles.Count); |
96 | } | 96 | } |
97 | 97 | ||
98 | /// <summary> | 98 | /// <summary> |
99 | /// Adds a new specified region to the database | 99 | /// Adds a new specified region to the database |
100 | /// </summary> | 100 | /// </summary> |
101 | /// <param name="profile">The profile to add</param> | 101 | /// <param name="profile">The profile to add</param> |
102 | /// <returns>A dataresponse enum indicating success</returns> | 102 | /// <returns>A dataresponse enum indicating success</returns> |
103 | public DataResponse AddProfile(SimProfileData profile) | 103 | public DataResponse AddProfile(SimProfileData profile) |
104 | { | 104 | { |
105 | lock (manager.simProfiles) | 105 | lock (manager.simProfiles) |
106 | { | 106 | { |
107 | if (manager.AddRow(profile)) | 107 | if (manager.AddRow(profile)) |
108 | { | 108 | { |
109 | return DataResponse.RESPONSE_OK; | 109 | return DataResponse.RESPONSE_OK; |
110 | } | 110 | } |
111 | else | 111 | else |
112 | { | 112 | { |
113 | return DataResponse.RESPONSE_ERROR; | 113 | return DataResponse.RESPONSE_ERROR; |
114 | } | 114 | } |
115 | } | 115 | } |
116 | } | 116 | } |
117 | 117 | ||
118 | /// <summary> | 118 | /// <summary> |
119 | /// Authenticates a new region using the shared secrets. NOT SECURE. | 119 | /// Authenticates a new region using the shared secrets. NOT SECURE. |
120 | /// </summary> | 120 | /// </summary> |
121 | /// <param name="uuid">The UUID the region is authenticating with</param> | 121 | /// <param name="uuid">The UUID the region is authenticating with</param> |
122 | /// <param name="handle">The location the region is logging into (unused in Db4o)</param> | 122 | /// <param name="handle">The location the region is logging into (unused in Db4o)</param> |
123 | /// <param name="key">The shared secret</param> | 123 | /// <param name="key">The shared secret</param> |
124 | /// <returns>Authenticated?</returns> | 124 | /// <returns>Authenticated?</returns> |
125 | public bool AuthenticateSim(LLUUID uuid, ulong handle, string key) { | 125 | public bool AuthenticateSim(LLUUID uuid, ulong handle, string key) { |
126 | if (manager.simProfiles[uuid].regionRecvKey == key) | 126 | if (manager.simProfiles[uuid].regionRecvKey == key) |
127 | return true; | 127 | return true; |
128 | return false; | 128 | return false; |
129 | } | 129 | } |
130 | 130 | ||
131 | /// <summary> | 131 | /// <summary> |
132 | /// Shuts down the database | 132 | /// Shuts down the database |
133 | /// </summary> | 133 | /// </summary> |
134 | public void Close() | 134 | public void Close() |
135 | { | 135 | { |
136 | manager = null; | 136 | manager = null; |
137 | } | 137 | } |
138 | 138 | ||
139 | /// <summary> | 139 | /// <summary> |
140 | /// Returns the providers name | 140 | /// Returns the providers name |
141 | /// </summary> | 141 | /// </summary> |
142 | /// <returns>The name of the storage system</returns> | 142 | /// <returns>The name of the storage system</returns> |
143 | public string getName() | 143 | public string getName() |
144 | { | 144 | { |
145 | return "DB4o Grid Provider"; | 145 | return "DB4o Grid Provider"; |
146 | } | 146 | } |
147 | 147 | ||
148 | /// <summary> | 148 | /// <summary> |
149 | /// Returns the providers version | 149 | /// Returns the providers version |
150 | /// </summary> | 150 | /// </summary> |
151 | /// <returns>The version of the storage system</returns> | 151 | /// <returns>The version of the storage system</returns> |
152 | public string getVersion() | 152 | public string getVersion() |
153 | { | 153 | { |
154 | return "0.1"; | 154 | return "0.1"; |
155 | } | 155 | } |
156 | 156 | ||
157 | public ReservationData GetReservationAtPoint(uint x, uint y) | 157 | public ReservationData GetReservationAtPoint(uint x, uint y) |
158 | { | 158 | { |
159 | return null; | 159 | return null; |
160 | } | 160 | } |
161 | } | 161 | } |
162 | } | 162 | } |
diff --git a/OpenSim/Framework/Data.DB4o/DB4oManager.cs b/OpenSim/Framework/Data.DB4o/DB4oManager.cs index 0df6350..43f9095 100644 --- a/OpenSim/Framework/Data.DB4o/DB4oManager.cs +++ b/OpenSim/Framework/Data.DB4o/DB4oManager.cs | |||
@@ -1,163 +1,163 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using Db4objects.Db4o; | 30 | using Db4objects.Db4o; |
31 | using libsecondlife; | 31 | using libsecondlife; |
32 | 32 | ||
33 | namespace OpenSim.Framework.Data.DB4o | 33 | namespace OpenSim.Framework.Data.DB4o |
34 | { | 34 | { |
35 | /// <summary> | 35 | /// <summary> |
36 | /// A Database manager for Db4o | 36 | /// A Database manager for Db4o |
37 | /// </summary> | 37 | /// </summary> |
38 | class DB4oGridManager | 38 | class DB4oGridManager |
39 | { | 39 | { |
40 | /// <summary> | 40 | /// <summary> |
41 | /// A list of the current regions connected (in-memory cache) | 41 | /// A list of the current regions connected (in-memory cache) |
42 | /// </summary> | 42 | /// </summary> |
43 | public Dictionary<LLUUID, SimProfileData> simProfiles = new Dictionary<LLUUID, SimProfileData>(); | 43 | public Dictionary<LLUUID, SimProfileData> simProfiles = new Dictionary<LLUUID, SimProfileData>(); |
44 | /// <summary> | 44 | /// <summary> |
45 | /// Database File Name | 45 | /// Database File Name |
46 | /// </summary> | 46 | /// </summary> |
47 | string dbfl; | 47 | string dbfl; |
48 | 48 | ||
49 | /// <summary> | 49 | /// <summary> |
50 | /// Creates a new grid storage manager | 50 | /// Creates a new grid storage manager |
51 | /// </summary> | 51 | /// </summary> |
52 | /// <param name="db4odb">Filename to the database file</param> | 52 | /// <param name="db4odb">Filename to the database file</param> |
53 | public DB4oGridManager(string db4odb) | 53 | public DB4oGridManager(string db4odb) |
54 | { | 54 | { |
55 | dbfl = db4odb; | 55 | dbfl = db4odb; |
56 | IObjectContainer database; | 56 | IObjectContainer database; |
57 | database = Db4oFactory.OpenFile(dbfl); | 57 | database = Db4oFactory.OpenFile(dbfl); |
58 | IObjectSet result = database.Get(typeof(SimProfileData)); | 58 | IObjectSet result = database.Get(typeof(SimProfileData)); |
59 | // Loads the file into the in-memory cache | 59 | // Loads the file into the in-memory cache |
60 | foreach(SimProfileData row in result) { | 60 | foreach(SimProfileData row in result) { |
61 | simProfiles.Add(row.UUID, row); | 61 | simProfiles.Add(row.UUID, row); |
62 | } | 62 | } |
63 | database.Close(); | 63 | database.Close(); |
64 | } | 64 | } |
65 | 65 | ||
66 | /// <summary> | 66 | /// <summary> |
67 | /// Adds a new profile to the database (Warning: Probably slow.) | 67 | /// Adds a new profile to the database (Warning: Probably slow.) |
68 | /// </summary> | 68 | /// </summary> |
69 | /// <param name="row">The profile to add</param> | 69 | /// <param name="row">The profile to add</param> |
70 | /// <returns>Successful?</returns> | 70 | /// <returns>Successful?</returns> |
71 | public bool AddRow(SimProfileData row) | 71 | public bool AddRow(SimProfileData row) |
72 | { | 72 | { |
73 | if (simProfiles.ContainsKey(row.UUID)) | 73 | if (simProfiles.ContainsKey(row.UUID)) |
74 | { | 74 | { |
75 | simProfiles[row.UUID] = row; | 75 | simProfiles[row.UUID] = row; |
76 | } | 76 | } |
77 | else | 77 | else |
78 | { | 78 | { |
79 | simProfiles.Add(row.UUID, row); | 79 | simProfiles.Add(row.UUID, row); |
80 | } | 80 | } |
81 | 81 | ||
82 | try | 82 | try |
83 | { | 83 | { |
84 | IObjectContainer database; | 84 | IObjectContainer database; |
85 | database = Db4oFactory.OpenFile(dbfl); | 85 | database = Db4oFactory.OpenFile(dbfl); |
86 | database.Set(row); | 86 | database.Set(row); |
87 | database.Close(); | 87 | database.Close(); |
88 | return true; | 88 | return true; |
89 | } | 89 | } |
90 | catch (Exception) | 90 | catch (Exception) |
91 | { | 91 | { |
92 | return false; | 92 | return false; |
93 | } | 93 | } |
94 | } | 94 | } |
95 | 95 | ||
96 | 96 | ||
97 | } | 97 | } |
98 | 98 | ||
99 | /// <summary> | 99 | /// <summary> |
100 | /// A manager for the DB4o database (user profiles) | 100 | /// A manager for the DB4o database (user profiles) |
101 | /// </summary> | 101 | /// </summary> |
102 | class DB4oUserManager | 102 | class DB4oUserManager |
103 | { | 103 | { |
104 | /// <summary> | 104 | /// <summary> |
105 | /// A list of the user profiles (in memory cache) | 105 | /// A list of the user profiles (in memory cache) |
106 | /// </summary> | 106 | /// </summary> |
107 | public Dictionary<LLUUID, UserProfileData> userProfiles = new Dictionary<LLUUID, UserProfileData>(); | 107 | public Dictionary<LLUUID, UserProfileData> userProfiles = new Dictionary<LLUUID, UserProfileData>(); |
108 | /// <summary> | 108 | /// <summary> |
109 | /// Database filename | 109 | /// Database filename |
110 | /// </summary> | 110 | /// </summary> |
111 | string dbfl; | 111 | string dbfl; |
112 | 112 | ||
113 | /// <summary> | 113 | /// <summary> |
114 | /// Initialises a new DB manager | 114 | /// Initialises a new DB manager |
115 | /// </summary> | 115 | /// </summary> |
116 | /// <param name="db4odb">The filename to the database</param> | 116 | /// <param name="db4odb">The filename to the database</param> |
117 | public DB4oUserManager(string db4odb) | 117 | public DB4oUserManager(string db4odb) |
118 | { | 118 | { |
119 | dbfl = db4odb; | 119 | dbfl = db4odb; |
120 | IObjectContainer database; | 120 | IObjectContainer database; |
121 | database = Db4oFactory.OpenFile(dbfl); | 121 | database = Db4oFactory.OpenFile(dbfl); |
122 | // Load to cache | 122 | // Load to cache |
123 | IObjectSet result = database.Get(typeof(UserProfileData)); | 123 | IObjectSet result = database.Get(typeof(UserProfileData)); |
124 | foreach (UserProfileData row in result) | 124 | foreach (UserProfileData row in result) |
125 | { | 125 | { |
126 | userProfiles.Add(row.UUID, row); | 126 | userProfiles.Add(row.UUID, row); |
127 | } | 127 | } |
128 | database.Close(); | 128 | database.Close(); |
129 | } | 129 | } |
130 | 130 | ||
131 | /// <summary> | 131 | /// <summary> |
132 | /// Adds a new profile to the database (Warning: Probably slow.) | 132 | /// Adds a new profile to the database (Warning: Probably slow.) |
133 | /// </summary> | 133 | /// </summary> |
134 | /// <param name="row">The profile to add</param> | 134 | /// <param name="row">The profile to add</param> |
135 | /// <returns>Successful?</returns> | 135 | /// <returns>Successful?</returns> |
136 | public bool AddRow(UserProfileData row) | 136 | public bool AddRow(UserProfileData row) |
137 | { | 137 | { |
138 | if (userProfiles.ContainsKey(row.UUID)) | 138 | if (userProfiles.ContainsKey(row.UUID)) |
139 | { | 139 | { |
140 | userProfiles[row.UUID] = row; | 140 | userProfiles[row.UUID] = row; |
141 | } | 141 | } |
142 | else | 142 | else |
143 | { | 143 | { |
144 | userProfiles.Add(row.UUID, row); | 144 | userProfiles.Add(row.UUID, row); |
145 | } | 145 | } |
146 | 146 | ||
147 | try | 147 | try |
148 | { | 148 | { |
149 | IObjectContainer database; | 149 | IObjectContainer database; |
150 | database = Db4oFactory.OpenFile(dbfl); | 150 | database = Db4oFactory.OpenFile(dbfl); |
151 | database.Set(row); | 151 | database.Set(row); |
152 | database.Close(); | 152 | database.Close(); |
153 | return true; | 153 | return true; |
154 | } | 154 | } |
155 | catch (Exception) | 155 | catch (Exception) |
156 | { | 156 | { |
157 | return false; | 157 | return false; |
158 | } | 158 | } |
159 | } | 159 | } |
160 | 160 | ||
161 | 161 | ||
162 | } | 162 | } |
163 | } | 163 | } |
diff --git a/OpenSim/Framework/Data.DB4o/DB4oUserData.cs b/OpenSim/Framework/Data.DB4o/DB4oUserData.cs index 2e33ab0..845b764 100644 --- a/OpenSim/Framework/Data.DB4o/DB4oUserData.cs +++ b/OpenSim/Framework/Data.DB4o/DB4oUserData.cs | |||
@@ -1,202 +1,202 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using System; | 28 | using System; |
29 | using libsecondlife; | 29 | using libsecondlife; |
30 | 30 | ||
31 | namespace OpenSim.Framework.Data.DB4o | 31 | namespace OpenSim.Framework.Data.DB4o |
32 | { | 32 | { |
33 | /// <summary> | 33 | /// <summary> |
34 | /// A User storage interface for the DB4o database system | 34 | /// A User storage interface for the DB4o database system |
35 | /// </summary> | 35 | /// </summary> |
36 | public class DB4oUserData : IUserData | 36 | public class DB4oUserData : IUserData |
37 | { | 37 | { |
38 | /// <summary> | 38 | /// <summary> |
39 | /// The database manager | 39 | /// The database manager |
40 | /// </summary> | 40 | /// </summary> |
41 | DB4oUserManager manager; | 41 | DB4oUserManager manager; |
42 | 42 | ||
43 | /// <summary> | 43 | /// <summary> |
44 | /// Artificial constructor called upon plugin load | 44 | /// Artificial constructor called upon plugin load |
45 | /// </summary> | 45 | /// </summary> |
46 | public void Initialise() | 46 | public void Initialise() |
47 | { | 47 | { |
48 | manager = new DB4oUserManager("userprofiles.yap"); | 48 | manager = new DB4oUserManager("userprofiles.yap"); |
49 | } | 49 | } |
50 | 50 | ||
51 | /// <summary> | 51 | /// <summary> |
52 | /// Loads a specified user profile from a UUID | 52 | /// Loads a specified user profile from a UUID |
53 | /// </summary> | 53 | /// </summary> |
54 | /// <param name="uuid">The users UUID</param> | 54 | /// <param name="uuid">The users UUID</param> |
55 | /// <returns>A user profile</returns> | 55 | /// <returns>A user profile</returns> |
56 | public UserProfileData getUserByUUID(LLUUID uuid) | 56 | public UserProfileData getUserByUUID(LLUUID uuid) |
57 | { | 57 | { |
58 | if(manager.userProfiles.ContainsKey(uuid)) | 58 | if(manager.userProfiles.ContainsKey(uuid)) |
59 | return manager.userProfiles[uuid]; | 59 | return manager.userProfiles[uuid]; |
60 | return null; | 60 | return null; |
61 | } | 61 | } |
62 | 62 | ||
63 | /// <summary> | 63 | /// <summary> |
64 | /// Returns a user by searching for its name | 64 | /// Returns a user by searching for its name |
65 | /// </summary> | 65 | /// </summary> |
66 | /// <param name="name">The users account name</param> | 66 | /// <param name="name">The users account name</param> |
67 | /// <returns>A matching users profile</returns> | 67 | /// <returns>A matching users profile</returns> |
68 | public UserProfileData getUserByName(string name) | 68 | public UserProfileData getUserByName(string name) |
69 | { | 69 | { |
70 | return getUserByName(name.Split(' ')[0], name.Split(' ')[1]); | 70 | return getUserByName(name.Split(' ')[0], name.Split(' ')[1]); |
71 | } | 71 | } |
72 | 72 | ||
73 | /// <summary> | 73 | /// <summary> |
74 | /// Returns a user by searching for its name | 74 | /// Returns a user by searching for its name |
75 | /// </summary> | 75 | /// </summary> |
76 | /// <param name="fname">The first part of the users account name</param> | 76 | /// <param name="fname">The first part of the users account name</param> |
77 | /// <param name="lname">The second part of the users account name</param> | 77 | /// <param name="lname">The second part of the users account name</param> |
78 | /// <returns>A matching users profile</returns> | 78 | /// <returns>A matching users profile</returns> |
79 | public UserProfileData getUserByName(string fname, string lname) | 79 | public UserProfileData getUserByName(string fname, string lname) |
80 | { | 80 | { |
81 | foreach (UserProfileData profile in manager.userProfiles.Values) | 81 | foreach (UserProfileData profile in manager.userProfiles.Values) |
82 | { | 82 | { |
83 | if (profile.username == fname && profile.surname == lname) | 83 | if (profile.username == fname && profile.surname == lname) |
84 | return profile; | 84 | return profile; |
85 | } | 85 | } |
86 | return null; | 86 | return null; |
87 | } | 87 | } |
88 | 88 | ||
89 | /// <summary> | 89 | /// <summary> |
90 | /// Returns a user by UUID direct | 90 | /// Returns a user by UUID direct |
91 | /// </summary> | 91 | /// </summary> |
92 | /// <param name="uuid">The users account ID</param> | 92 | /// <param name="uuid">The users account ID</param> |
93 | /// <returns>A matching users profile</returns> | 93 | /// <returns>A matching users profile</returns> |
94 | public UserAgentData getAgentByUUID(LLUUID uuid) | 94 | public UserAgentData getAgentByUUID(LLUUID uuid) |
95 | { | 95 | { |
96 | try | 96 | try |
97 | { | 97 | { |
98 | return getUserByUUID(uuid).currentAgent; | 98 | return getUserByUUID(uuid).currentAgent; |
99 | } | 99 | } |
100 | catch (Exception) | 100 | catch (Exception) |
101 | { | 101 | { |
102 | return null; | 102 | return null; |
103 | } | 103 | } |
104 | } | 104 | } |
105 | 105 | ||
106 | /// <summary> | 106 | /// <summary> |
107 | /// Returns a session by account name | 107 | /// Returns a session by account name |
108 | /// </summary> | 108 | /// </summary> |
109 | /// <param name="name">The account name</param> | 109 | /// <param name="name">The account name</param> |
110 | /// <returns>The users session agent</returns> | 110 | /// <returns>The users session agent</returns> |
111 | public UserAgentData getAgentByName(string name) | 111 | public UserAgentData getAgentByName(string name) |
112 | { | 112 | { |
113 | return getAgentByName(name.Split(' ')[0], name.Split(' ')[1]); | 113 | return getAgentByName(name.Split(' ')[0], name.Split(' ')[1]); |
114 | } | 114 | } |
115 | 115 | ||
116 | /// <summary> | 116 | /// <summary> |
117 | /// Returns a session by account name | 117 | /// Returns a session by account name |
118 | /// </summary> | 118 | /// </summary> |
119 | /// <param name="fname">The first part of the users account name</param> | 119 | /// <param name="fname">The first part of the users account name</param> |
120 | /// <param name="lname">The second part of the users account name</param> | 120 | /// <param name="lname">The second part of the users account name</param> |
121 | /// <returns>A user agent</returns> | 121 | /// <returns>A user agent</returns> |
122 | public UserAgentData getAgentByName(string fname, string lname) | 122 | public UserAgentData getAgentByName(string fname, string lname) |
123 | { | 123 | { |
124 | try | 124 | try |
125 | { | 125 | { |
126 | return getUserByName(fname,lname).currentAgent; | 126 | return getUserByName(fname,lname).currentAgent; |
127 | } | 127 | } |
128 | catch (Exception) | 128 | catch (Exception) |
129 | { | 129 | { |
130 | return null; | 130 | return null; |
131 | } | 131 | } |
132 | } | 132 | } |
133 | 133 | ||
134 | /// <summary> | 134 | /// <summary> |
135 | /// Creates a new user profile | 135 | /// Creates a new user profile |
136 | /// </summary> | 136 | /// </summary> |
137 | /// <param name="user">The profile to add to the database</param> | 137 | /// <param name="user">The profile to add to the database</param> |
138 | public void addNewUserProfile(UserProfileData user) | 138 | public void addNewUserProfile(UserProfileData user) |
139 | { | 139 | { |
140 | try | 140 | try |
141 | { | 141 | { |
142 | manager.AddRow(user); | 142 | manager.AddRow(user); |
143 | } | 143 | } |
144 | catch (Exception e) | 144 | catch (Exception e) |
145 | { | 145 | { |
146 | Console.WriteLine(e.ToString()); | 146 | Console.WriteLine(e.ToString()); |
147 | } | 147 | } |
148 | } | 148 | } |
149 | 149 | ||
150 | /// <summary> | 150 | /// <summary> |
151 | /// Creates a new user agent | 151 | /// Creates a new user agent |
152 | /// </summary> | 152 | /// </summary> |
153 | /// <param name="agent">The agent to add to the database</param> | 153 | /// <param name="agent">The agent to add to the database</param> |
154 | public void addNewUserAgent(UserAgentData agent) | 154 | public void addNewUserAgent(UserAgentData agent) |
155 | { | 155 | { |
156 | // Do nothing. yet. | 156 | // Do nothing. yet. |
157 | } | 157 | } |
158 | 158 | ||
159 | /// <summary> | 159 | /// <summary> |
160 | /// Transfers money between two user accounts | 160 | /// Transfers money between two user accounts |
161 | /// </summary> | 161 | /// </summary> |
162 | /// <param name="from">Starting account</param> | 162 | /// <param name="from">Starting account</param> |
163 | /// <param name="to">End account</param> | 163 | /// <param name="to">End account</param> |
164 | /// <param name="amount">The amount to move</param> | 164 | /// <param name="amount">The amount to move</param> |
165 | /// <returns>Success?</returns> | 165 | /// <returns>Success?</returns> |
166 | public bool moneyTransferRequest(LLUUID from, LLUUID to, uint amount) | 166 | public bool moneyTransferRequest(LLUUID from, LLUUID to, uint amount) |
167 | { | 167 | { |
168 | return true; | 168 | return true; |
169 | } | 169 | } |
170 | 170 | ||
171 | /// <summary> | 171 | /// <summary> |
172 | /// Transfers inventory between two accounts | 172 | /// Transfers inventory between two accounts |
173 | /// </summary> | 173 | /// </summary> |
174 | /// <remarks>Move to inventory server</remarks> | 174 | /// <remarks>Move to inventory server</remarks> |
175 | /// <param name="from">Senders account</param> | 175 | /// <param name="from">Senders account</param> |
176 | /// <param name="to">Recievers account</param> | 176 | /// <param name="to">Recievers account</param> |
177 | /// <param name="item">Inventory item</param> | 177 | /// <param name="item">Inventory item</param> |
178 | /// <returns>Success?</returns> | 178 | /// <returns>Success?</returns> |
179 | public bool inventoryTransferRequest(LLUUID from, LLUUID to, LLUUID item) | 179 | public bool inventoryTransferRequest(LLUUID from, LLUUID to, LLUUID item) |
180 | { | 180 | { |
181 | return true; | 181 | return true; |
182 | } | 182 | } |
183 | 183 | ||
184 | /// <summary> | 184 | /// <summary> |
185 | /// Returns the name of the storage provider | 185 | /// Returns the name of the storage provider |
186 | /// </summary> | 186 | /// </summary> |
187 | /// <returns>Storage provider name</returns> | 187 | /// <returns>Storage provider name</returns> |
188 | public string getName() | 188 | public string getName() |
189 | { | 189 | { |
190 | return "DB4o Userdata"; | 190 | return "DB4o Userdata"; |
191 | } | 191 | } |
192 | 192 | ||
193 | /// <summary> | 193 | /// <summary> |
194 | /// Returns the version of the storage provider | 194 | /// Returns the version of the storage provider |
195 | /// </summary> | 195 | /// </summary> |
196 | /// <returns>Storage provider version</returns> | 196 | /// <returns>Storage provider version</returns> |
197 | public string getVersion() | 197 | public string getVersion() |
198 | { | 198 | { |
199 | return "0.1"; | 199 | return "0.1"; |
200 | } | 200 | } |
201 | } | 201 | } |
202 | } | 202 | } |
diff --git a/OpenSim/Framework/Data.DB4o/Properties/AssemblyInfo.cs b/OpenSim/Framework/Data.DB4o/Properties/AssemblyInfo.cs index 905cd9b..52d09fa 100644 --- a/OpenSim/Framework/Data.DB4o/Properties/AssemblyInfo.cs +++ b/OpenSim/Framework/Data.DB4o/Properties/AssemblyInfo.cs | |||
@@ -1,33 +1,33 @@ | |||
1 | using System.Reflection; | 1 | using System.Reflection; |
2 | using System.Runtime.InteropServices; | 2 | using System.Runtime.InteropServices; |
3 | // General Information about an assembly is controlled through the following | 3 | // General Information about an assembly is controlled through the following |
4 | // set of attributes. Change these attribute values to modify the information | 4 | // set of attributes. Change these attribute values to modify the information |
5 | // associated with an assembly. | 5 | // associated with an assembly. |
6 | [assembly: AssemblyTitle("OpenSim.Framework.Data.DB4o")] | 6 | [assembly: AssemblyTitle("OpenSim.Framework.Data.DB4o")] |
7 | [assembly: AssemblyDescription("")] | 7 | [assembly: AssemblyDescription("")] |
8 | [assembly: AssemblyConfiguration("")] | 8 | [assembly: AssemblyConfiguration("")] |
9 | [assembly: AssemblyCompany("")] | 9 | [assembly: AssemblyCompany("")] |
10 | [assembly: AssemblyProduct("OpenSim.Framework.Data.DB4o")] | 10 | [assembly: AssemblyProduct("OpenSim.Framework.Data.DB4o")] |
11 | [assembly: AssemblyCopyright("Copyright © 2007")] | 11 | [assembly: AssemblyCopyright("Copyright © 2007")] |
12 | [assembly: AssemblyTrademark("")] | 12 | [assembly: AssemblyTrademark("")] |
13 | [assembly: AssemblyCulture("")] | 13 | [assembly: AssemblyCulture("")] |
14 | 14 | ||
15 | // Setting ComVisible to false makes the types in this assembly not visible | 15 | // Setting ComVisible to false makes the types in this assembly not visible |
16 | // to COM components. If you need to access a type in this assembly from | 16 | // to COM components. If you need to access a type in this assembly from |
17 | // COM, set the ComVisible attribute to true on that type. | 17 | // COM, set the ComVisible attribute to true on that type. |
18 | [assembly: ComVisible(false)] | 18 | [assembly: ComVisible(false)] |
19 | 19 | ||
20 | // The following GUID is for the ID of the typelib if this project is exposed to COM | 20 | // The following GUID is for the ID of the typelib if this project is exposed to COM |
21 | [assembly: Guid("57991e15-79da-41b7-aa06-2e6b49165a63")] | 21 | [assembly: Guid("57991e15-79da-41b7-aa06-2e6b49165a63")] |
22 | 22 | ||
23 | // Version information for an assembly consists of the following four values: | 23 | // Version information for an assembly consists of the following four values: |
24 | // | 24 | // |
25 | // Major Version | 25 | // Major Version |
26 | // Minor Version | 26 | // Minor Version |
27 | // Build Number | 27 | // Build Number |
28 | // Revision | 28 | // Revision |
29 | // | 29 | // |
30 | // You can specify all the values or you can default the Revision and Build Numbers | 30 | // You can specify all the values or you can default the Revision and Build Numbers |
31 | // by using the '*' as shown below: | 31 | // by using the '*' as shown below: |
32 | [assembly: AssemblyVersion("1.0.0.0")] | 32 | [assembly: AssemblyVersion("1.0.0.0")] |
33 | [assembly: AssemblyFileVersion("1.0.0.0")] | 33 | [assembly: AssemblyFileVersion("1.0.0.0")] |
diff --git a/OpenSim/Framework/Data.MSSQL/MSSQLGridData.cs b/OpenSim/Framework/Data.MSSQL/MSSQLGridData.cs index ca9196a5..dc60ca4 100644 --- a/OpenSim/Framework/Data.MSSQL/MSSQLGridData.cs +++ b/OpenSim/Framework/Data.MSSQL/MSSQLGridData.cs | |||
@@ -1,194 +1,194 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Data; | 30 | using System.Data; |
31 | using System.Security.Cryptography; | 31 | using System.Security.Cryptography; |
32 | using System.Text; | 32 | using System.Text; |
33 | using libsecondlife; | 33 | using libsecondlife; |
34 | 34 | ||
35 | namespace OpenSim.Framework.Data.MSSQL | 35 | namespace OpenSim.Framework.Data.MSSQL |
36 | { | 36 | { |
37 | /// <summary> | 37 | /// <summary> |
38 | /// A grid data interface for Microsoft SQL Server | 38 | /// A grid data interface for Microsoft SQL Server |
39 | /// </summary> | 39 | /// </summary> |
40 | public class SqlGridData : IGridData | 40 | public class SqlGridData : IGridData |
41 | { | 41 | { |
42 | /// <summary> | 42 | /// <summary> |
43 | /// Database manager | 43 | /// Database manager |
44 | /// </summary> | 44 | /// </summary> |
45 | private MSSqlManager database; | 45 | private MSSqlManager database; |
46 | 46 | ||
47 | /// <summary> | 47 | /// <summary> |
48 | /// Initialises the Grid Interface | 48 | /// Initialises the Grid Interface |
49 | /// </summary> | 49 | /// </summary> |
50 | public void Initialise() | 50 | public void Initialise() |
51 | { | 51 | { |
52 | database = new MSSqlManager("localhost", "db", "user", "password", "false"); | 52 | database = new MSSqlManager("localhost", "db", "user", "password", "false"); |
53 | } | 53 | } |
54 | 54 | ||
55 | /// <summary> | 55 | /// <summary> |
56 | /// Shuts down the grid interface | 56 | /// Shuts down the grid interface |
57 | /// </summary> | 57 | /// </summary> |
58 | public void Close() | 58 | public void Close() |
59 | { | 59 | { |
60 | database.Close(); | 60 | database.Close(); |
61 | } | 61 | } |
62 | 62 | ||
63 | /// <summary> | 63 | /// <summary> |
64 | /// Returns the storage system name | 64 | /// Returns the storage system name |
65 | /// </summary> | 65 | /// </summary> |
66 | /// <returns>A string containing the storage system name</returns> | 66 | /// <returns>A string containing the storage system name</returns> |
67 | public string getName() | 67 | public string getName() |
68 | { | 68 | { |
69 | return "Sql OpenGridData"; | 69 | return "Sql OpenGridData"; |
70 | } | 70 | } |
71 | 71 | ||
72 | /// <summary> | 72 | /// <summary> |
73 | /// Returns the storage system version | 73 | /// Returns the storage system version |
74 | /// </summary> | 74 | /// </summary> |
75 | /// <returns>A string containing the storage system version</returns> | 75 | /// <returns>A string containing the storage system version</returns> |
76 | public string getVersion() | 76 | public string getVersion() |
77 | { | 77 | { |
78 | return "0.1"; | 78 | return "0.1"; |
79 | } | 79 | } |
80 | 80 | ||
81 | /// <summary> | 81 | /// <summary> |
82 | /// Returns a list of regions within the specified ranges | 82 | /// Returns a list of regions within the specified ranges |
83 | /// </summary> | 83 | /// </summary> |
84 | /// <param name="a">minimum X coordinate</param> | 84 | /// <param name="a">minimum X coordinate</param> |
85 | /// <param name="b">minimum Y coordinate</param> | 85 | /// <param name="b">minimum Y coordinate</param> |
86 | /// <param name="c">maximum X coordinate</param> | 86 | /// <param name="c">maximum X coordinate</param> |
87 | /// <param name="d">maximum Y coordinate</param> | 87 | /// <param name="d">maximum Y coordinate</param> |
88 | /// <returns>An array of region profiles</returns> | 88 | /// <returns>An array of region profiles</returns> |
89 | public SimProfileData[] GetProfilesInRange(uint a, uint b, uint c, uint d) | 89 | public SimProfileData[] GetProfilesInRange(uint a, uint b, uint c, uint d) |
90 | { | 90 | { |
91 | return null; | 91 | return null; |
92 | } | 92 | } |
93 | 93 | ||
94 | /// <summary> | 94 | /// <summary> |
95 | /// Returns a sim profile from it's location | 95 | /// Returns a sim profile from it's location |
96 | /// </summary> | 96 | /// </summary> |
97 | /// <param name="handle">Region location handle</param> | 97 | /// <param name="handle">Region location handle</param> |
98 | /// <returns>Sim profile</returns> | 98 | /// <returns>Sim profile</returns> |
99 | public SimProfileData GetProfileByHandle(ulong handle) | 99 | public SimProfileData GetProfileByHandle(ulong handle) |
100 | { | 100 | { |
101 | Dictionary<string, string> param = new Dictionary<string, string>(); | 101 | Dictionary<string, string> param = new Dictionary<string, string>(); |
102 | param["handle"] = handle.ToString(); | 102 | param["handle"] = handle.ToString(); |
103 | 103 | ||
104 | IDbCommand result = database.Query("SELECT * FROM regions WHERE handle = @handle", param); | 104 | IDbCommand result = database.Query("SELECT * FROM regions WHERE handle = @handle", param); |
105 | IDataReader reader = result.ExecuteReader(); | 105 | IDataReader reader = result.ExecuteReader(); |
106 | 106 | ||
107 | SimProfileData row = database.getRow(reader); | 107 | SimProfileData row = database.getRow(reader); |
108 | reader.Close(); | 108 | reader.Close(); |
109 | result.Dispose(); | 109 | result.Dispose(); |
110 | 110 | ||
111 | return row; | 111 | return row; |
112 | } | 112 | } |
113 | 113 | ||
114 | /// <summary> | 114 | /// <summary> |
115 | /// Returns a sim profile from it's UUID | 115 | /// Returns a sim profile from it's UUID |
116 | /// </summary> | 116 | /// </summary> |
117 | /// <param name="uuid">The region UUID</param> | 117 | /// <param name="uuid">The region UUID</param> |
118 | /// <returns>The sim profile</returns> | 118 | /// <returns>The sim profile</returns> |
119 | public SimProfileData GetProfileByLLUUID(LLUUID uuid) | 119 | public SimProfileData GetProfileByLLUUID(LLUUID uuid) |
120 | { | 120 | { |
121 | Dictionary<string, string> param = new Dictionary<string, string>(); | 121 | Dictionary<string, string> param = new Dictionary<string, string>(); |
122 | param["uuid"] = uuid.ToStringHyphenated(); | 122 | param["uuid"] = uuid.ToStringHyphenated(); |
123 | 123 | ||
124 | IDbCommand result = database.Query("SELECT * FROM regions WHERE uuid = @uuid", param); | 124 | IDbCommand result = database.Query("SELECT * FROM regions WHERE uuid = @uuid", param); |
125 | IDataReader reader = result.ExecuteReader(); | 125 | IDataReader reader = result.ExecuteReader(); |
126 | 126 | ||
127 | SimProfileData row = database.getRow(reader); | 127 | SimProfileData row = database.getRow(reader); |
128 | reader.Close(); | 128 | reader.Close(); |
129 | result.Dispose(); | 129 | result.Dispose(); |
130 | 130 | ||
131 | return row; | 131 | return row; |
132 | } | 132 | } |
133 | 133 | ||
134 | /// <summary> | 134 | /// <summary> |
135 | /// Adds a new specified region to the database | 135 | /// Adds a new specified region to the database |
136 | /// </summary> | 136 | /// </summary> |
137 | /// <param name="profile">The profile to add</param> | 137 | /// <param name="profile">The profile to add</param> |
138 | /// <returns>A dataresponse enum indicating success</returns> | 138 | /// <returns>A dataresponse enum indicating success</returns> |
139 | public DataResponse AddProfile(SimProfileData profile) | 139 | public DataResponse AddProfile(SimProfileData profile) |
140 | { | 140 | { |
141 | if (database.insertRow(profile)) | 141 | if (database.insertRow(profile)) |
142 | { | 142 | { |
143 | return DataResponse.RESPONSE_OK; | 143 | return DataResponse.RESPONSE_OK; |
144 | } | 144 | } |
145 | else | 145 | else |
146 | { | 146 | { |
147 | return DataResponse.RESPONSE_ERROR; | 147 | return DataResponse.RESPONSE_ERROR; |
148 | } | 148 | } |
149 | } | 149 | } |
150 | 150 | ||
151 | /// <summary> | 151 | /// <summary> |
152 | /// DEPRECIATED. Attempts to authenticate a region by comparing a shared secret. | 152 | /// DEPRECIATED. Attempts to authenticate a region by comparing a shared secret. |
153 | /// </summary> | 153 | /// </summary> |
154 | /// <param name="uuid">The UUID of the challenger</param> | 154 | /// <param name="uuid">The UUID of the challenger</param> |
155 | /// <param name="handle">The attempted regionHandle of the challenger</param> | 155 | /// <param name="handle">The attempted regionHandle of the challenger</param> |
156 | /// <param name="authkey">The secret</param> | 156 | /// <param name="authkey">The secret</param> |
157 | /// <returns>Whether the secret and regionhandle match the database entry for UUID</returns> | 157 | /// <returns>Whether the secret and regionhandle match the database entry for UUID</returns> |
158 | public bool AuthenticateSim(LLUUID uuid, ulong handle, string authkey) | 158 | public bool AuthenticateSim(LLUUID uuid, ulong handle, string authkey) |
159 | { | 159 | { |
160 | bool throwHissyFit = false; // Should be true by 1.0 | 160 | bool throwHissyFit = false; // Should be true by 1.0 |
161 | 161 | ||
162 | if (throwHissyFit) | 162 | if (throwHissyFit) |
163 | throw new Exception("CRYPTOWEAK AUTHENTICATE: Refusing to authenticate due to replay potential."); | 163 | throw new Exception("CRYPTOWEAK AUTHENTICATE: Refusing to authenticate due to replay potential."); |
164 | 164 | ||
165 | SimProfileData data = GetProfileByLLUUID(uuid); | 165 | SimProfileData data = GetProfileByLLUUID(uuid); |
166 | 166 | ||
167 | return (handle == data.regionHandle && authkey == data.regionSecret); | 167 | return (handle == data.regionHandle && authkey == data.regionSecret); |
168 | } | 168 | } |
169 | 169 | ||
170 | /// <summary> | 170 | /// <summary> |
171 | /// NOT YET FUNCTIONAL. Provides a cryptographic authentication of a region | 171 | /// NOT YET FUNCTIONAL. Provides a cryptographic authentication of a region |
172 | /// </summary> | 172 | /// </summary> |
173 | /// <remarks>This requires a security audit.</remarks> | 173 | /// <remarks>This requires a security audit.</remarks> |
174 | /// <param name="uuid"></param> | 174 | /// <param name="uuid"></param> |
175 | /// <param name="handle"></param> | 175 | /// <param name="handle"></param> |
176 | /// <param name="authhash"></param> | 176 | /// <param name="authhash"></param> |
177 | /// <param name="challenge"></param> | 177 | /// <param name="challenge"></param> |
178 | /// <returns></returns> | 178 | /// <returns></returns> |
179 | public bool AuthenticateSim(LLUUID uuid, ulong handle, string authhash, string challenge) | 179 | public bool AuthenticateSim(LLUUID uuid, ulong handle, string authhash, string challenge) |
180 | { | 180 | { |
181 | SHA512Managed HashProvider = new SHA512Managed(); | 181 | SHA512Managed HashProvider = new SHA512Managed(); |
182 | ASCIIEncoding TextProvider = new ASCIIEncoding(); | 182 | ASCIIEncoding TextProvider = new ASCIIEncoding(); |
183 | 183 | ||
184 | byte[] stream = TextProvider.GetBytes(uuid.ToStringHyphenated() + ":" + handle.ToString() + ":" + challenge); | 184 | byte[] stream = TextProvider.GetBytes(uuid.ToStringHyphenated() + ":" + handle.ToString() + ":" + challenge); |
185 | byte[] hash = HashProvider.ComputeHash(stream); | 185 | byte[] hash = HashProvider.ComputeHash(stream); |
186 | return false; | 186 | return false; |
187 | } | 187 | } |
188 | public ReservationData GetReservationAtPoint(uint x, uint y) | 188 | public ReservationData GetReservationAtPoint(uint x, uint y) |
189 | { | 189 | { |
190 | return null; | 190 | return null; |
191 | } | 191 | } |
192 | } | 192 | } |
193 | 193 | ||
194 | } | 194 | } |
diff --git a/OpenSim/Framework/Data.MSSQL/MSSQLManager.cs b/OpenSim/Framework/Data.MSSQL/MSSQLManager.cs index 49bf31c..26677a5 100644 --- a/OpenSim/Framework/Data.MSSQL/MSSQLManager.cs +++ b/OpenSim/Framework/Data.MSSQL/MSSQLManager.cs | |||
@@ -1,211 +1,211 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Data; | 30 | using System.Data; |
31 | using System.Data.SqlClient; | 31 | using System.Data.SqlClient; |
32 | using libsecondlife; | 32 | using libsecondlife; |
33 | 33 | ||
34 | namespace OpenSim.Framework.Data.MSSQL | 34 | namespace OpenSim.Framework.Data.MSSQL |
35 | { | 35 | { |
36 | /// <summary> | 36 | /// <summary> |
37 | /// A management class for the MS SQL Storage Engine | 37 | /// A management class for the MS SQL Storage Engine |
38 | /// </summary> | 38 | /// </summary> |
39 | class MSSqlManager | 39 | class MSSqlManager |
40 | { | 40 | { |
41 | /// <summary> | 41 | /// <summary> |
42 | /// The database connection object | 42 | /// The database connection object |
43 | /// </summary> | 43 | /// </summary> |
44 | IDbConnection dbcon; | 44 | IDbConnection dbcon; |
45 | 45 | ||
46 | /// <summary> | 46 | /// <summary> |
47 | /// Initialises and creates a new Sql connection and maintains it. | 47 | /// Initialises and creates a new Sql connection and maintains it. |
48 | /// </summary> | 48 | /// </summary> |
49 | /// <param name="hostname">The Sql server being connected to</param> | 49 | /// <param name="hostname">The Sql server being connected to</param> |
50 | /// <param name="database">The name of the Sql database being used</param> | 50 | /// <param name="database">The name of the Sql database being used</param> |
51 | /// <param name="username">The username logging into the database</param> | 51 | /// <param name="username">The username logging into the database</param> |
52 | /// <param name="password">The password for the user logging in</param> | 52 | /// <param name="password">The password for the user logging in</param> |
53 | /// <param name="cpooling">Whether to use connection pooling or not, can be one of the following: 'yes', 'true', 'no' or 'false', if unsure use 'false'.</param> | 53 | /// <param name="cpooling">Whether to use connection pooling or not, can be one of the following: 'yes', 'true', 'no' or 'false', if unsure use 'false'.</param> |
54 | public MSSqlManager(string hostname, string database, string username, string password, string cpooling) | 54 | public MSSqlManager(string hostname, string database, string username, string password, string cpooling) |
55 | { | 55 | { |
56 | try | 56 | try |
57 | { | 57 | { |
58 | string connectionString = "Server=" + hostname + ";Database=" + database + ";User ID=" + username + ";Password=" + password + ";Pooling=" + cpooling + ";"; | 58 | string connectionString = "Server=" + hostname + ";Database=" + database + ";User ID=" + username + ";Password=" + password + ";Pooling=" + cpooling + ";"; |
59 | dbcon = new SqlConnection(connectionString); | 59 | dbcon = new SqlConnection(connectionString); |
60 | 60 | ||
61 | dbcon.Open(); | 61 | dbcon.Open(); |
62 | } | 62 | } |
63 | catch (Exception e) | 63 | catch (Exception e) |
64 | { | 64 | { |
65 | throw new Exception("Error initialising Sql Database: " + e.ToString()); | 65 | throw new Exception("Error initialising Sql Database: " + e.ToString()); |
66 | } | 66 | } |
67 | } | 67 | } |
68 | 68 | ||
69 | /// <summary> | 69 | /// <summary> |
70 | /// Shuts down the database connection | 70 | /// Shuts down the database connection |
71 | /// </summary> | 71 | /// </summary> |
72 | public void Close() | 72 | public void Close() |
73 | { | 73 | { |
74 | dbcon.Close(); | 74 | dbcon.Close(); |
75 | dbcon = null; | 75 | dbcon = null; |
76 | } | 76 | } |
77 | 77 | ||
78 | /// <summary> | 78 | /// <summary> |
79 | /// Runs a query with protection against SQL Injection by using parameterised input. | 79 | /// Runs a query with protection against SQL Injection by using parameterised input. |
80 | /// </summary> | 80 | /// </summary> |
81 | /// <param name="sql">The SQL string - replace any variables such as WHERE x = "y" with WHERE x = @y</param> | 81 | /// <param name="sql">The SQL string - replace any variables such as WHERE x = "y" with WHERE x = @y</param> |
82 | /// <param name="parameters">The parameters - index so that @y is indexed as 'y'</param> | 82 | /// <param name="parameters">The parameters - index so that @y is indexed as 'y'</param> |
83 | /// <returns>A Sql DB Command</returns> | 83 | /// <returns>A Sql DB Command</returns> |
84 | public IDbCommand Query(string sql, Dictionary<string, string> parameters) | 84 | public IDbCommand Query(string sql, Dictionary<string, string> parameters) |
85 | { | 85 | { |
86 | SqlCommand dbcommand = (SqlCommand)dbcon.CreateCommand(); | 86 | SqlCommand dbcommand = (SqlCommand)dbcon.CreateCommand(); |
87 | dbcommand.CommandText = sql; | 87 | dbcommand.CommandText = sql; |
88 | foreach (KeyValuePair<string, string> param in parameters) | 88 | foreach (KeyValuePair<string, string> param in parameters) |
89 | { | 89 | { |
90 | dbcommand.Parameters.AddWithValue(param.Key, param.Value); | 90 | dbcommand.Parameters.AddWithValue(param.Key, param.Value); |
91 | } | 91 | } |
92 | 92 | ||
93 | return (IDbCommand)dbcommand; | 93 | return (IDbCommand)dbcommand; |
94 | } | 94 | } |
95 | 95 | ||
96 | /// <summary> | 96 | /// <summary> |
97 | /// Runs a database reader object and returns a region row | 97 | /// Runs a database reader object and returns a region row |
98 | /// </summary> | 98 | /// </summary> |
99 | /// <param name="reader">An active database reader</param> | 99 | /// <param name="reader">An active database reader</param> |
100 | /// <returns>A region row</returns> | 100 | /// <returns>A region row</returns> |
101 | public SimProfileData getRow(IDataReader reader) | 101 | public SimProfileData getRow(IDataReader reader) |
102 | { | 102 | { |
103 | SimProfileData regionprofile = new SimProfileData(); | 103 | SimProfileData regionprofile = new SimProfileData(); |
104 | 104 | ||
105 | if (reader.Read()) | 105 | if (reader.Read()) |
106 | { | 106 | { |
107 | // Region Main | 107 | // Region Main |
108 | regionprofile.regionHandle = (ulong)reader["regionHandle"]; | 108 | regionprofile.regionHandle = (ulong)reader["regionHandle"]; |
109 | regionprofile.regionName = (string)reader["regionName"]; | 109 | regionprofile.regionName = (string)reader["regionName"]; |
110 | regionprofile.UUID = new LLUUID((string)reader["uuid"]); | 110 | regionprofile.UUID = new LLUUID((string)reader["uuid"]); |
111 | 111 | ||
112 | // Secrets | 112 | // Secrets |
113 | regionprofile.regionRecvKey = (string)reader["regionRecvKey"]; | 113 | regionprofile.regionRecvKey = (string)reader["regionRecvKey"]; |
114 | regionprofile.regionSecret = (string)reader["regionSecret"]; | 114 | regionprofile.regionSecret = (string)reader["regionSecret"]; |
115 | regionprofile.regionSendKey = (string)reader["regionSendKey"]; | 115 | regionprofile.regionSendKey = (string)reader["regionSendKey"]; |
116 | 116 | ||
117 | // Region Server | 117 | // Region Server |
118 | regionprofile.regionDataURI = (string)reader["regionDataURI"]; | 118 | regionprofile.regionDataURI = (string)reader["regionDataURI"]; |
119 | regionprofile.regionOnline = false; // Needs to be pinged before this can be set. | 119 | regionprofile.regionOnline = false; // Needs to be pinged before this can be set. |
120 | regionprofile.serverIP = (string)reader["serverIP"]; | 120 | regionprofile.serverIP = (string)reader["serverIP"]; |
121 | regionprofile.serverPort = (uint)reader["serverPort"]; | 121 | regionprofile.serverPort = (uint)reader["serverPort"]; |
122 | regionprofile.serverURI = (string)reader["serverURI"]; | 122 | regionprofile.serverURI = (string)reader["serverURI"]; |
123 | 123 | ||
124 | // Location | 124 | // Location |
125 | regionprofile.regionLocX = (uint)((int)reader["locX"]); | 125 | regionprofile.regionLocX = (uint)((int)reader["locX"]); |
126 | regionprofile.regionLocY = (uint)((int)reader["locY"]); | 126 | regionprofile.regionLocY = (uint)((int)reader["locY"]); |
127 | regionprofile.regionLocZ = (uint)((int)reader["locZ"]); | 127 | regionprofile.regionLocZ = (uint)((int)reader["locZ"]); |
128 | 128 | ||
129 | // Neighbours - 0 = No Override | 129 | // Neighbours - 0 = No Override |
130 | regionprofile.regionEastOverrideHandle = (ulong)reader["eastOverrideHandle"]; | 130 | regionprofile.regionEastOverrideHandle = (ulong)reader["eastOverrideHandle"]; |
131 | regionprofile.regionWestOverrideHandle = (ulong)reader["westOverrideHandle"]; | 131 | regionprofile.regionWestOverrideHandle = (ulong)reader["westOverrideHandle"]; |
132 | regionprofile.regionSouthOverrideHandle = (ulong)reader["southOverrideHandle"]; | 132 | regionprofile.regionSouthOverrideHandle = (ulong)reader["southOverrideHandle"]; |
133 | regionprofile.regionNorthOverrideHandle = (ulong)reader["northOverrideHandle"]; | 133 | regionprofile.regionNorthOverrideHandle = (ulong)reader["northOverrideHandle"]; |
134 | 134 | ||
135 | // Assets | 135 | // Assets |
136 | regionprofile.regionAssetURI = (string)reader["regionAssetURI"]; | 136 | regionprofile.regionAssetURI = (string)reader["regionAssetURI"]; |
137 | regionprofile.regionAssetRecvKey = (string)reader["regionAssetRecvKey"]; | 137 | regionprofile.regionAssetRecvKey = (string)reader["regionAssetRecvKey"]; |
138 | regionprofile.regionAssetSendKey = (string)reader["regionAssetSendKey"]; | 138 | regionprofile.regionAssetSendKey = (string)reader["regionAssetSendKey"]; |
139 | 139 | ||
140 | // Userserver | 140 | // Userserver |
141 | regionprofile.regionUserURI = (string)reader["regionUserURI"]; | 141 | regionprofile.regionUserURI = (string)reader["regionUserURI"]; |
142 | regionprofile.regionUserRecvKey = (string)reader["regionUserRecvKey"]; | 142 | regionprofile.regionUserRecvKey = (string)reader["regionUserRecvKey"]; |
143 | regionprofile.regionUserSendKey = (string)reader["regionUserSendKey"]; | 143 | regionprofile.regionUserSendKey = (string)reader["regionUserSendKey"]; |
144 | } | 144 | } |
145 | else | 145 | else |
146 | { | 146 | { |
147 | throw new Exception("No rows to return"); | 147 | throw new Exception("No rows to return"); |
148 | } | 148 | } |
149 | return regionprofile; | 149 | return regionprofile; |
150 | } | 150 | } |
151 | 151 | ||
152 | /// <summary> | 152 | /// <summary> |
153 | /// Creates a new region in the database | 153 | /// Creates a new region in the database |
154 | /// </summary> | 154 | /// </summary> |
155 | /// <param name="profile">The region profile to insert</param> | 155 | /// <param name="profile">The region profile to insert</param> |
156 | /// <returns>Successful?</returns> | 156 | /// <returns>Successful?</returns> |
157 | public bool insertRow(SimProfileData profile) | 157 | public bool insertRow(SimProfileData profile) |
158 | { | 158 | { |
159 | string sql = "REPLACE INTO regions VALUES (regionHandle, regionName, uuid, regionRecvKey, regionSecret, regionSendKey, regionDataURI, "; | 159 | string sql = "REPLACE INTO regions VALUES (regionHandle, regionName, uuid, regionRecvKey, regionSecret, regionSendKey, regionDataURI, "; |
160 | sql += "serverIP, serverPort, serverURI, locX, locY, locZ, eastOverrideHandle, westOverrideHandle, southOverrideHandle, northOverrideHandle, regionAssetURI, regionAssetRecvKey, "; | 160 | sql += "serverIP, serverPort, serverURI, locX, locY, locZ, eastOverrideHandle, westOverrideHandle, southOverrideHandle, northOverrideHandle, regionAssetURI, regionAssetRecvKey, "; |
161 | sql += "regionAssetSendKey, regionUserURI, regionUserRecvKey, regionUserSendKey) VALUES "; | 161 | sql += "regionAssetSendKey, regionUserURI, regionUserRecvKey, regionUserSendKey) VALUES "; |
162 | 162 | ||
163 | sql += "(@regionHandle, @regionName, @uuid, @regionRecvKey, @regionSecret, @regionSendKey, @regionDataURI, "; | 163 | sql += "(@regionHandle, @regionName, @uuid, @regionRecvKey, @regionSecret, @regionSendKey, @regionDataURI, "; |
164 | sql += "@serverIP, @serverPort, @serverURI, @locX, @locY, @locZ, @eastOverrideHandle, @westOverrideHandle, @southOverrideHandle, @northOverrideHandle, @regionAssetURI, @regionAssetRecvKey, "; | 164 | sql += "@serverIP, @serverPort, @serverURI, @locX, @locY, @locZ, @eastOverrideHandle, @westOverrideHandle, @southOverrideHandle, @northOverrideHandle, @regionAssetURI, @regionAssetRecvKey, "; |
165 | sql += "@regionAssetSendKey, @regionUserURI, @regionUserRecvKey, @regionUserSendKey);"; | 165 | sql += "@regionAssetSendKey, @regionUserURI, @regionUserRecvKey, @regionUserSendKey);"; |
166 | 166 | ||
167 | Dictionary<string, string> parameters = new Dictionary<string, string>(); | 167 | Dictionary<string, string> parameters = new Dictionary<string, string>(); |
168 | 168 | ||
169 | parameters["regionHandle"] = profile.regionHandle.ToString(); | 169 | parameters["regionHandle"] = profile.regionHandle.ToString(); |
170 | parameters["regionName"] = profile.regionName; | 170 | parameters["regionName"] = profile.regionName; |
171 | parameters["uuid"] = profile.UUID.ToString(); | 171 | parameters["uuid"] = profile.UUID.ToString(); |
172 | parameters["regionRecvKey"] = profile.regionRecvKey; | 172 | parameters["regionRecvKey"] = profile.regionRecvKey; |
173 | parameters["regionSendKey"] = profile.regionSendKey; | 173 | parameters["regionSendKey"] = profile.regionSendKey; |
174 | parameters["regionDataURI"] = profile.regionDataURI; | 174 | parameters["regionDataURI"] = profile.regionDataURI; |
175 | parameters["serverIP"] = profile.serverIP; | 175 | parameters["serverIP"] = profile.serverIP; |
176 | parameters["serverPort"] = profile.serverPort.ToString(); | 176 | parameters["serverPort"] = profile.serverPort.ToString(); |
177 | parameters["serverURI"] = profile.serverURI; | 177 | parameters["serverURI"] = profile.serverURI; |
178 | parameters["locX"] = profile.regionLocX.ToString(); | 178 | parameters["locX"] = profile.regionLocX.ToString(); |
179 | parameters["locY"] = profile.regionLocY.ToString(); | 179 | parameters["locY"] = profile.regionLocY.ToString(); |
180 | parameters["locZ"] = profile.regionLocZ.ToString(); | 180 | parameters["locZ"] = profile.regionLocZ.ToString(); |
181 | parameters["eastOverrideHandle"] = profile.regionEastOverrideHandle.ToString(); | 181 | parameters["eastOverrideHandle"] = profile.regionEastOverrideHandle.ToString(); |
182 | parameters["westOverrideHandle"] = profile.regionWestOverrideHandle.ToString(); | 182 | parameters["westOverrideHandle"] = profile.regionWestOverrideHandle.ToString(); |
183 | parameters["northOverrideHandle"] = profile.regionNorthOverrideHandle.ToString(); | 183 | parameters["northOverrideHandle"] = profile.regionNorthOverrideHandle.ToString(); |
184 | parameters["southOverrideHandle"] = profile.regionSouthOverrideHandle.ToString(); | 184 | parameters["southOverrideHandle"] = profile.regionSouthOverrideHandle.ToString(); |
185 | parameters["regionAssetURI"] = profile.regionAssetURI; | 185 | parameters["regionAssetURI"] = profile.regionAssetURI; |
186 | parameters["regionAssetRecvKey"] = profile.regionAssetRecvKey; | 186 | parameters["regionAssetRecvKey"] = profile.regionAssetRecvKey; |
187 | parameters["regionAssetSendKey"] = profile.regionAssetSendKey; | 187 | parameters["regionAssetSendKey"] = profile.regionAssetSendKey; |
188 | parameters["regionUserURI"] = profile.regionUserURI; | 188 | parameters["regionUserURI"] = profile.regionUserURI; |
189 | parameters["regionUserRecvKey"] = profile.regionUserRecvKey; | 189 | parameters["regionUserRecvKey"] = profile.regionUserRecvKey; |
190 | parameters["regionUserSendKey"] = profile.regionUserSendKey; | 190 | parameters["regionUserSendKey"] = profile.regionUserSendKey; |
191 | 191 | ||
192 | bool returnval = false; | 192 | bool returnval = false; |
193 | 193 | ||
194 | try | 194 | try |
195 | { | 195 | { |
196 | IDbCommand result = Query(sql, parameters); | 196 | IDbCommand result = Query(sql, parameters); |
197 | 197 | ||
198 | if (result.ExecuteNonQuery() == 1) | 198 | if (result.ExecuteNonQuery() == 1) |
199 | returnval = true; | 199 | returnval = true; |
200 | 200 | ||
201 | result.Dispose(); | 201 | result.Dispose(); |
202 | } | 202 | } |
203 | catch (Exception) | 203 | catch (Exception) |
204 | { | 204 | { |
205 | return false; | 205 | return false; |
206 | } | 206 | } |
207 | 207 | ||
208 | return returnval; | 208 | return returnval; |
209 | } | 209 | } |
210 | } | 210 | } |
211 | } | 211 | } |
diff --git a/OpenSim/Framework/Data.MSSQL/Properties/AssemblyInfo.cs b/OpenSim/Framework/Data.MSSQL/Properties/AssemblyInfo.cs index 066c739..eeac06c 100644 --- a/OpenSim/Framework/Data.MSSQL/Properties/AssemblyInfo.cs +++ b/OpenSim/Framework/Data.MSSQL/Properties/AssemblyInfo.cs | |||
@@ -1,33 +1,33 @@ | |||
1 | using System.Reflection; | 1 | using System.Reflection; |
2 | using System.Runtime.InteropServices; | 2 | using System.Runtime.InteropServices; |
3 | // General Information about an assembly is controlled through the following | 3 | // General Information about an assembly is controlled through the following |
4 | // set of attributes. Change these attribute values to modify the information | 4 | // set of attributes. Change these attribute values to modify the information |
5 | // associated with an assembly. | 5 | // associated with an assembly. |
6 | [assembly: AssemblyTitle("OpenSim.Framework.Data.MSSQL")] | 6 | [assembly: AssemblyTitle("OpenSim.Framework.Data.MSSQL")] |
7 | [assembly: AssemblyDescription("")] | 7 | [assembly: AssemblyDescription("")] |
8 | [assembly: AssemblyConfiguration("")] | 8 | [assembly: AssemblyConfiguration("")] |
9 | [assembly: AssemblyCompany("")] | 9 | [assembly: AssemblyCompany("")] |
10 | [assembly: AssemblyProduct("OpenSim.Framework.Data.MSSQL")] | 10 | [assembly: AssemblyProduct("OpenSim.Framework.Data.MSSQL")] |
11 | [assembly: AssemblyCopyright("Copyright © 2007")] | 11 | [assembly: AssemblyCopyright("Copyright © 2007")] |
12 | [assembly: AssemblyTrademark("")] | 12 | [assembly: AssemblyTrademark("")] |
13 | [assembly: AssemblyCulture("")] | 13 | [assembly: AssemblyCulture("")] |
14 | 14 | ||
15 | // Setting ComVisible to false makes the types in this assembly not visible | 15 | // Setting ComVisible to false makes the types in this assembly not visible |
16 | // to COM components. If you need to access a type in this assembly from | 16 | // to COM components. If you need to access a type in this assembly from |
17 | // COM, set the ComVisible attribute to true on that type. | 17 | // COM, set the ComVisible attribute to true on that type. |
18 | [assembly: ComVisible(false)] | 18 | [assembly: ComVisible(false)] |
19 | 19 | ||
20 | // The following GUID is for the ID of the typelib if this project is exposed to COM | 20 | // The following GUID is for the ID of the typelib if this project is exposed to COM |
21 | [assembly: Guid("0e1c1ca4-2cf2-4315-b0e7-432c02feea8a")] | 21 | [assembly: Guid("0e1c1ca4-2cf2-4315-b0e7-432c02feea8a")] |
22 | 22 | ||
23 | // Version information for an assembly consists of the following four values: | 23 | // Version information for an assembly consists of the following four values: |
24 | // | 24 | // |
25 | // Major Version | 25 | // Major Version |
26 | // Minor Version | 26 | // Minor Version |
27 | // Build Number | 27 | // Build Number |
28 | // Revision | 28 | // Revision |
29 | // | 29 | // |
30 | // You can specify all the values or you can default the Revision and Build Numbers | 30 | // You can specify all the values or you can default the Revision and Build Numbers |
31 | // by using the '*' as shown below: | 31 | // by using the '*' as shown below: |
32 | [assembly: AssemblyVersion("1.0.0.0")] | 32 | [assembly: AssemblyVersion("1.0.0.0")] |
33 | [assembly: AssemblyFileVersion("1.0.0.0")] | 33 | [assembly: AssemblyFileVersion("1.0.0.0")] |
diff --git a/OpenSim/Framework/Data.MySQL/MySQLGridData.cs b/OpenSim/Framework/Data.MySQL/MySQLGridData.cs index ef643d2..09f5e83 100644 --- a/OpenSim/Framework/Data.MySQL/MySQLGridData.cs +++ b/OpenSim/Framework/Data.MySQL/MySQLGridData.cs | |||
@@ -1,287 +1,287 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Data; | 30 | using System.Data; |
31 | using System.Security.Cryptography; | 31 | using System.Security.Cryptography; |
32 | using System.Text; | 32 | using System.Text; |
33 | using libsecondlife; | 33 | using libsecondlife; |
34 | 34 | ||
35 | namespace OpenSim.Framework.Data.MySQL | 35 | namespace OpenSim.Framework.Data.MySQL |
36 | { | 36 | { |
37 | /// <summary> | 37 | /// <summary> |
38 | /// A MySQL Interface for the Grid Server | 38 | /// A MySQL Interface for the Grid Server |
39 | /// </summary> | 39 | /// </summary> |
40 | public class MySQLGridData : IGridData | 40 | public class MySQLGridData : IGridData |
41 | { | 41 | { |
42 | /// <summary> | 42 | /// <summary> |
43 | /// MySQL Database Manager | 43 | /// MySQL Database Manager |
44 | /// </summary> | 44 | /// </summary> |
45 | private MySQLManager database; | 45 | private MySQLManager database; |
46 | 46 | ||
47 | /// <summary> | 47 | /// <summary> |
48 | /// Initialises the Grid Interface | 48 | /// Initialises the Grid Interface |
49 | /// </summary> | 49 | /// </summary> |
50 | public void Initialise() | 50 | public void Initialise() |
51 | { | 51 | { |
52 | IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini"); | 52 | IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini"); |
53 | string settingHostname = GridDataMySqlFile.ParseFileReadValue("hostname"); | 53 | string settingHostname = GridDataMySqlFile.ParseFileReadValue("hostname"); |
54 | string settingDatabase = GridDataMySqlFile.ParseFileReadValue("database"); | 54 | string settingDatabase = GridDataMySqlFile.ParseFileReadValue("database"); |
55 | string settingUsername = GridDataMySqlFile.ParseFileReadValue("username"); | 55 | string settingUsername = GridDataMySqlFile.ParseFileReadValue("username"); |
56 | string settingPassword = GridDataMySqlFile.ParseFileReadValue("password"); | 56 | string settingPassword = GridDataMySqlFile.ParseFileReadValue("password"); |
57 | string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling"); | 57 | string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling"); |
58 | string settingPort = GridDataMySqlFile.ParseFileReadValue("port"); | 58 | string settingPort = GridDataMySqlFile.ParseFileReadValue("port"); |
59 | 59 | ||
60 | database = new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, settingPort); | 60 | database = new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, settingPort); |
61 | } | 61 | } |
62 | 62 | ||
63 | /// <summary> | 63 | /// <summary> |
64 | /// Shuts down the grid interface | 64 | /// Shuts down the grid interface |
65 | /// </summary> | 65 | /// </summary> |
66 | public void Close() | 66 | public void Close() |
67 | { | 67 | { |
68 | database.Close(); | 68 | database.Close(); |
69 | } | 69 | } |
70 | 70 | ||
71 | /// <summary> | 71 | /// <summary> |
72 | /// Returns the plugin name | 72 | /// Returns the plugin name |
73 | /// </summary> | 73 | /// </summary> |
74 | /// <returns>Plugin name</returns> | 74 | /// <returns>Plugin name</returns> |
75 | public string getName() | 75 | public string getName() |
76 | { | 76 | { |
77 | return "MySql OpenGridData"; | 77 | return "MySql OpenGridData"; |
78 | } | 78 | } |
79 | 79 | ||
80 | /// <summary> | 80 | /// <summary> |
81 | /// Returns the plugin version | 81 | /// Returns the plugin version |
82 | /// </summary> | 82 | /// </summary> |
83 | /// <returns>Plugin version</returns> | 83 | /// <returns>Plugin version</returns> |
84 | public string getVersion() | 84 | public string getVersion() |
85 | { | 85 | { |
86 | return "0.1"; | 86 | return "0.1"; |
87 | } | 87 | } |
88 | 88 | ||
89 | /// <summary> | 89 | /// <summary> |
90 | /// Returns all the specified region profiles within coordates -- coordinates are inclusive | 90 | /// Returns all the specified region profiles within coordates -- coordinates are inclusive |
91 | /// </summary> | 91 | /// </summary> |
92 | /// <param name="xmin">Minimum X coordinate</param> | 92 | /// <param name="xmin">Minimum X coordinate</param> |
93 | /// <param name="ymin">Minimum Y coordinate</param> | 93 | /// <param name="ymin">Minimum Y coordinate</param> |
94 | /// <param name="xmax">Maximum X coordinate</param> | 94 | /// <param name="xmax">Maximum X coordinate</param> |
95 | /// <param name="ymax">Maximum Y coordinate</param> | 95 | /// <param name="ymax">Maximum Y coordinate</param> |
96 | /// <returns></returns> | 96 | /// <returns></returns> |
97 | public SimProfileData[] GetProfilesInRange(uint xmin, uint ymin, uint xmax, uint ymax) | 97 | public SimProfileData[] GetProfilesInRange(uint xmin, uint ymin, uint xmax, uint ymax) |
98 | { | 98 | { |
99 | try | 99 | try |
100 | { | 100 | { |
101 | lock (database) | 101 | lock (database) |
102 | { | 102 | { |
103 | Dictionary<string, string> param = new Dictionary<string, string>(); | 103 | Dictionary<string, string> param = new Dictionary<string, string>(); |
104 | param["?xmin"] = xmin.ToString(); | 104 | param["?xmin"] = xmin.ToString(); |
105 | param["?ymin"] = ymin.ToString(); | 105 | param["?ymin"] = ymin.ToString(); |
106 | param["?xmax"] = xmax.ToString(); | 106 | param["?xmax"] = xmax.ToString(); |
107 | param["?ymax"] = ymax.ToString(); | 107 | param["?ymax"] = ymax.ToString(); |
108 | 108 | ||
109 | IDbCommand result = database.Query("SELECT * FROM regions WHERE locX >= ?xmin AND locX <= ?xmax AND locY >= ?ymin AND locY <= ?ymax", param); | 109 | IDbCommand result = database.Query("SELECT * FROM regions WHERE locX >= ?xmin AND locX <= ?xmax AND locY >= ?ymin AND locY <= ?ymax", param); |
110 | IDataReader reader = result.ExecuteReader(); | 110 | IDataReader reader = result.ExecuteReader(); |
111 | 111 | ||
112 | SimProfileData row; | 112 | SimProfileData row; |
113 | 113 | ||
114 | List<SimProfileData> rows = new List<SimProfileData>(); | 114 | List<SimProfileData> rows = new List<SimProfileData>(); |
115 | 115 | ||
116 | while ((row = database.readSimRow(reader)) != null) | 116 | while ((row = database.readSimRow(reader)) != null) |
117 | { | 117 | { |
118 | rows.Add(row); | 118 | rows.Add(row); |
119 | } | 119 | } |
120 | reader.Close(); | 120 | reader.Close(); |
121 | result.Dispose(); | 121 | result.Dispose(); |
122 | 122 | ||
123 | return rows.ToArray(); | 123 | return rows.ToArray(); |
124 | 124 | ||
125 | } | 125 | } |
126 | } | 126 | } |
127 | catch (Exception e) | 127 | catch (Exception e) |
128 | { | 128 | { |
129 | database.Reconnect(); | 129 | database.Reconnect(); |
130 | Console.WriteLine(e.ToString()); | 130 | Console.WriteLine(e.ToString()); |
131 | return null; | 131 | return null; |
132 | } | 132 | } |
133 | } | 133 | } |
134 | 134 | ||
135 | /// <summary> | 135 | /// <summary> |
136 | /// Returns a sim profile from it's location | 136 | /// Returns a sim profile from it's location |
137 | /// </summary> | 137 | /// </summary> |
138 | /// <param name="handle">Region location handle</param> | 138 | /// <param name="handle">Region location handle</param> |
139 | /// <returns>Sim profile</returns> | 139 | /// <returns>Sim profile</returns> |
140 | public SimProfileData GetProfileByHandle(ulong handle) | 140 | public SimProfileData GetProfileByHandle(ulong handle) |
141 | { | 141 | { |
142 | try | 142 | try |
143 | { | 143 | { |
144 | lock (database) | 144 | lock (database) |
145 | { | 145 | { |
146 | Dictionary<string, string> param = new Dictionary<string, string>(); | 146 | Dictionary<string, string> param = new Dictionary<string, string>(); |
147 | param["?handle"] = handle.ToString(); | 147 | param["?handle"] = handle.ToString(); |
148 | 148 | ||
149 | IDbCommand result = database.Query("SELECT * FROM regions WHERE regionHandle = ?handle", param); | 149 | IDbCommand result = database.Query("SELECT * FROM regions WHERE regionHandle = ?handle", param); |
150 | IDataReader reader = result.ExecuteReader(); | 150 | IDataReader reader = result.ExecuteReader(); |
151 | 151 | ||
152 | SimProfileData row = database.readSimRow(reader); | 152 | SimProfileData row = database.readSimRow(reader); |
153 | reader.Close(); | 153 | reader.Close(); |
154 | result.Dispose(); | 154 | result.Dispose(); |
155 | 155 | ||
156 | return row; | 156 | return row; |
157 | } | 157 | } |
158 | } | 158 | } |
159 | catch (Exception e) | 159 | catch (Exception e) |
160 | { | 160 | { |
161 | database.Reconnect(); | 161 | database.Reconnect(); |
162 | Console.WriteLine(e.ToString()); | 162 | Console.WriteLine(e.ToString()); |
163 | return null; | 163 | return null; |
164 | } | 164 | } |
165 | } | 165 | } |
166 | 166 | ||
167 | /// <summary> | 167 | /// <summary> |
168 | /// Returns a sim profile from it's UUID | 168 | /// Returns a sim profile from it's UUID |
169 | /// </summary> | 169 | /// </summary> |
170 | /// <param name="uuid">The region UUID</param> | 170 | /// <param name="uuid">The region UUID</param> |
171 | /// <returns>The sim profile</returns> | 171 | /// <returns>The sim profile</returns> |
172 | public SimProfileData GetProfileByLLUUID(LLUUID uuid) | 172 | public SimProfileData GetProfileByLLUUID(LLUUID uuid) |
173 | { | 173 | { |
174 | try | 174 | try |
175 | { | 175 | { |
176 | lock (database) | 176 | lock (database) |
177 | { | 177 | { |
178 | Dictionary<string, string> param = new Dictionary<string, string>(); | 178 | Dictionary<string, string> param = new Dictionary<string, string>(); |
179 | param["?uuid"] = uuid.ToStringHyphenated(); | 179 | param["?uuid"] = uuid.ToStringHyphenated(); |
180 | 180 | ||
181 | IDbCommand result = database.Query("SELECT * FROM regions WHERE uuid = ?uuid", param); | 181 | IDbCommand result = database.Query("SELECT * FROM regions WHERE uuid = ?uuid", param); |
182 | IDataReader reader = result.ExecuteReader(); | 182 | IDataReader reader = result.ExecuteReader(); |
183 | 183 | ||
184 | SimProfileData row = database.readSimRow(reader); | 184 | SimProfileData row = database.readSimRow(reader); |
185 | reader.Close(); | 185 | reader.Close(); |
186 | result.Dispose(); | 186 | result.Dispose(); |
187 | 187 | ||
188 | return row; | 188 | return row; |
189 | } | 189 | } |
190 | } | 190 | } |
191 | catch (Exception e) | 191 | catch (Exception e) |
192 | { | 192 | { |
193 | database.Reconnect(); | 193 | database.Reconnect(); |
194 | Console.WriteLine(e.ToString()); | 194 | Console.WriteLine(e.ToString()); |
195 | return null; | 195 | return null; |
196 | } | 196 | } |
197 | } | 197 | } |
198 | 198 | ||
199 | /// <summary> | 199 | /// <summary> |
200 | /// Adds a new profile to the database | 200 | /// Adds a new profile to the database |
201 | /// </summary> | 201 | /// </summary> |
202 | /// <param name="profile">The profile to add</param> | 202 | /// <param name="profile">The profile to add</param> |
203 | /// <returns>Successful?</returns> | 203 | /// <returns>Successful?</returns> |
204 | public DataResponse AddProfile(SimProfileData profile) | 204 | public DataResponse AddProfile(SimProfileData profile) |
205 | { | 205 | { |
206 | lock (database) | 206 | lock (database) |
207 | { | 207 | { |
208 | if (database.insertRegion(profile)) | 208 | if (database.insertRegion(profile)) |
209 | { | 209 | { |
210 | return DataResponse.RESPONSE_OK; | 210 | return DataResponse.RESPONSE_OK; |
211 | } | 211 | } |
212 | else | 212 | else |
213 | { | 213 | { |
214 | return DataResponse.RESPONSE_ERROR; | 214 | return DataResponse.RESPONSE_ERROR; |
215 | } | 215 | } |
216 | } | 216 | } |
217 | } | 217 | } |
218 | 218 | ||
219 | /// <summary> | 219 | /// <summary> |
220 | /// DEPRECIATED. Attempts to authenticate a region by comparing a shared secret. | 220 | /// DEPRECIATED. Attempts to authenticate a region by comparing a shared secret. |
221 | /// </summary> | 221 | /// </summary> |
222 | /// <param name="uuid">The UUID of the challenger</param> | 222 | /// <param name="uuid">The UUID of the challenger</param> |
223 | /// <param name="handle">The attempted regionHandle of the challenger</param> | 223 | /// <param name="handle">The attempted regionHandle of the challenger</param> |
224 | /// <param name="authkey">The secret</param> | 224 | /// <param name="authkey">The secret</param> |
225 | /// <returns>Whether the secret and regionhandle match the database entry for UUID</returns> | 225 | /// <returns>Whether the secret and regionhandle match the database entry for UUID</returns> |
226 | public bool AuthenticateSim(LLUUID uuid, ulong handle, string authkey) | 226 | public bool AuthenticateSim(LLUUID uuid, ulong handle, string authkey) |
227 | { | 227 | { |
228 | bool throwHissyFit = false; // Should be true by 1.0 | 228 | bool throwHissyFit = false; // Should be true by 1.0 |
229 | 229 | ||
230 | if (throwHissyFit) | 230 | if (throwHissyFit) |
231 | throw new Exception("CRYPTOWEAK AUTHENTICATE: Refusing to authenticate due to replay potential."); | 231 | throw new Exception("CRYPTOWEAK AUTHENTICATE: Refusing to authenticate due to replay potential."); |
232 | 232 | ||
233 | SimProfileData data = GetProfileByLLUUID(uuid); | 233 | SimProfileData data = GetProfileByLLUUID(uuid); |
234 | 234 | ||
235 | return (handle == data.regionHandle && authkey == data.regionSecret); | 235 | return (handle == data.regionHandle && authkey == data.regionSecret); |
236 | } | 236 | } |
237 | 237 | ||
238 | /// <summary> | 238 | /// <summary> |
239 | /// NOT YET FUNCTIONAL. Provides a cryptographic authentication of a region | 239 | /// NOT YET FUNCTIONAL. Provides a cryptographic authentication of a region |
240 | /// </summary> | 240 | /// </summary> |
241 | /// <remarks>This requires a security audit.</remarks> | 241 | /// <remarks>This requires a security audit.</remarks> |
242 | /// <param name="uuid"></param> | 242 | /// <param name="uuid"></param> |
243 | /// <param name="handle"></param> | 243 | /// <param name="handle"></param> |
244 | /// <param name="authhash"></param> | 244 | /// <param name="authhash"></param> |
245 | /// <param name="challenge"></param> | 245 | /// <param name="challenge"></param> |
246 | /// <returns></returns> | 246 | /// <returns></returns> |
247 | public bool AuthenticateSim(LLUUID uuid, ulong handle, string authhash, string challenge) | 247 | public bool AuthenticateSim(LLUUID uuid, ulong handle, string authhash, string challenge) |
248 | { | 248 | { |
249 | SHA512Managed HashProvider = new SHA512Managed(); | 249 | SHA512Managed HashProvider = new SHA512Managed(); |
250 | ASCIIEncoding TextProvider = new ASCIIEncoding(); | 250 | ASCIIEncoding TextProvider = new ASCIIEncoding(); |
251 | 251 | ||
252 | byte[] stream = TextProvider.GetBytes(uuid.ToStringHyphenated() + ":" + handle.ToString() + ":" + challenge); | 252 | byte[] stream = TextProvider.GetBytes(uuid.ToStringHyphenated() + ":" + handle.ToString() + ":" + challenge); |
253 | byte[] hash = HashProvider.ComputeHash(stream); | 253 | byte[] hash = HashProvider.ComputeHash(stream); |
254 | 254 | ||
255 | return false; | 255 | return false; |
256 | } | 256 | } |
257 | 257 | ||
258 | public ReservationData GetReservationAtPoint(uint x, uint y) | 258 | public ReservationData GetReservationAtPoint(uint x, uint y) |
259 | { | 259 | { |
260 | try | 260 | try |
261 | { | 261 | { |
262 | lock (database) | 262 | lock (database) |
263 | { | 263 | { |
264 | Dictionary<string, string> param = new Dictionary<string, string>(); | 264 | Dictionary<string, string> param = new Dictionary<string, string>(); |
265 | param["?x"] = x.ToString(); | 265 | param["?x"] = x.ToString(); |
266 | param["?y"] = y.ToString(); | 266 | param["?y"] = y.ToString(); |
267 | IDbCommand result = database.Query("SELECT * FROM reservations WHERE resXMin <= ?x AND resXMax >= ?x AND resYMin <= ?y AND resYMax >= ?y", param); | 267 | IDbCommand result = database.Query("SELECT * FROM reservations WHERE resXMin <= ?x AND resXMax >= ?x AND resYMin <= ?y AND resYMax >= ?y", param); |
268 | IDataReader reader = result.ExecuteReader(); | 268 | IDataReader reader = result.ExecuteReader(); |
269 | 269 | ||
270 | ReservationData row = database.readReservationRow(reader); | 270 | ReservationData row = database.readReservationRow(reader); |
271 | reader.Close(); | 271 | reader.Close(); |
272 | result.Dispose(); | 272 | result.Dispose(); |
273 | 273 | ||
274 | return row; | 274 | return row; |
275 | } | 275 | } |
276 | } | 276 | } |
277 | catch (Exception e) | 277 | catch (Exception e) |
278 | { | 278 | { |
279 | database.Reconnect(); | 279 | database.Reconnect(); |
280 | Console.WriteLine(e.ToString()); | 280 | Console.WriteLine(e.ToString()); |
281 | return null; | 281 | return null; |
282 | } | 282 | } |
283 | } | 283 | } |
284 | } | 284 | } |
285 | 285 | ||
286 | 286 | ||
287 | } | 287 | } |
diff --git a/OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs b/OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs index 790759a..d32db1b 100644 --- a/OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs +++ b/OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs | |||
@@ -1,309 +1,309 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Data; | 30 | using System.Data; |
31 | using libsecondlife; | 31 | using libsecondlife; |
32 | 32 | ||
33 | namespace OpenSim.Framework.Data.MySQL | 33 | namespace OpenSim.Framework.Data.MySQL |
34 | { | 34 | { |
35 | /// <summary> | 35 | /// <summary> |
36 | /// A MySQL interface for the inventory server | 36 | /// A MySQL interface for the inventory server |
37 | /// </summary> | 37 | /// </summary> |
38 | class MySQLInventoryData : IInventoryData | 38 | class MySQLInventoryData : IInventoryData |
39 | { | 39 | { |
40 | /// <summary> | 40 | /// <summary> |
41 | /// The database manager | 41 | /// The database manager |
42 | /// </summary> | 42 | /// </summary> |
43 | public MySQLManager database; | 43 | public MySQLManager database; |
44 | 44 | ||
45 | /// <summary> | 45 | /// <summary> |
46 | /// Loads and initialises this database plugin | 46 | /// Loads and initialises this database plugin |
47 | /// </summary> | 47 | /// </summary> |
48 | public void Initialise() | 48 | public void Initialise() |
49 | { | 49 | { |
50 | IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini"); | 50 | IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini"); |
51 | string settingHostname = GridDataMySqlFile.ParseFileReadValue("hostname"); | 51 | string settingHostname = GridDataMySqlFile.ParseFileReadValue("hostname"); |
52 | string settingDatabase = GridDataMySqlFile.ParseFileReadValue("database"); | 52 | string settingDatabase = GridDataMySqlFile.ParseFileReadValue("database"); |
53 | string settingUsername = GridDataMySqlFile.ParseFileReadValue("username"); | 53 | string settingUsername = GridDataMySqlFile.ParseFileReadValue("username"); |
54 | string settingPassword = GridDataMySqlFile.ParseFileReadValue("password"); | 54 | string settingPassword = GridDataMySqlFile.ParseFileReadValue("password"); |
55 | string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling"); | 55 | string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling"); |
56 | string settingPort = GridDataMySqlFile.ParseFileReadValue("port"); | 56 | string settingPort = GridDataMySqlFile.ParseFileReadValue("port"); |
57 | 57 | ||
58 | database = new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, settingPort); | 58 | database = new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, settingPort); |
59 | } | 59 | } |
60 | 60 | ||
61 | /// <summary> | 61 | /// <summary> |
62 | /// The name of this DB provider | 62 | /// The name of this DB provider |
63 | /// </summary> | 63 | /// </summary> |
64 | /// <returns>Name of DB provider</returns> | 64 | /// <returns>Name of DB provider</returns> |
65 | public string getName() | 65 | public string getName() |
66 | { | 66 | { |
67 | return "MySQL Inventory Data Interface"; | 67 | return "MySQL Inventory Data Interface"; |
68 | } | 68 | } |
69 | 69 | ||
70 | /// <summary> | 70 | /// <summary> |
71 | /// Closes this DB provider | 71 | /// Closes this DB provider |
72 | /// </summary> | 72 | /// </summary> |
73 | public void Close() | 73 | public void Close() |
74 | { | 74 | { |
75 | // Do nothing. | 75 | // Do nothing. |
76 | } | 76 | } |
77 | 77 | ||
78 | /// <summary> | 78 | /// <summary> |
79 | /// Returns the version of this DB provider | 79 | /// Returns the version of this DB provider |
80 | /// </summary> | 80 | /// </summary> |
81 | /// <returns>A string containing the DB provider</returns> | 81 | /// <returns>A string containing the DB provider</returns> |
82 | public string getVersion() | 82 | public string getVersion() |
83 | { | 83 | { |
84 | return "0.1"; | 84 | return "0.1"; |
85 | } | 85 | } |
86 | 86 | ||
87 | /// <summary> | 87 | /// <summary> |
88 | /// Returns a list of items in a specified folder | 88 | /// Returns a list of items in a specified folder |
89 | /// </summary> | 89 | /// </summary> |
90 | /// <param name="folderID">The folder to search</param> | 90 | /// <param name="folderID">The folder to search</param> |
91 | /// <returns>A list containing inventory items</returns> | 91 | /// <returns>A list containing inventory items</returns> |
92 | public List<InventoryItemBase> getInventoryInFolder(LLUUID folderID) | 92 | public List<InventoryItemBase> getInventoryInFolder(LLUUID folderID) |
93 | { | 93 | { |
94 | try | 94 | try |
95 | { | 95 | { |
96 | lock (database) | 96 | lock (database) |
97 | { | 97 | { |
98 | Dictionary<string, string> param = new Dictionary<string, string>(); | 98 | Dictionary<string, string> param = new Dictionary<string, string>(); |
99 | param["?uuid"] = folderID.ToStringHyphenated(); | 99 | param["?uuid"] = folderID.ToStringHyphenated(); |
100 | 100 | ||
101 | IDbCommand result = database.Query("SELECT * FROM inventoryitems WHERE parentFolderID = ?uuid", param); | 101 | IDbCommand result = database.Query("SELECT * FROM inventoryitems WHERE parentFolderID = ?uuid", param); |
102 | IDataReader reader = result.ExecuteReader(); | 102 | IDataReader reader = result.ExecuteReader(); |
103 | 103 | ||
104 | List<InventoryItemBase> items = database.readInventoryItems(reader); | 104 | List<InventoryItemBase> items = database.readInventoryItems(reader); |
105 | 105 | ||
106 | reader.Close(); | 106 | reader.Close(); |
107 | result.Dispose(); | 107 | result.Dispose(); |
108 | 108 | ||
109 | return items; | 109 | return items; |
110 | } | 110 | } |
111 | } | 111 | } |
112 | catch (Exception e) | 112 | catch (Exception e) |
113 | { | 113 | { |
114 | database.Reconnect(); | 114 | database.Reconnect(); |
115 | Console.WriteLine(e.ToString()); | 115 | Console.WriteLine(e.ToString()); |
116 | return null; | 116 | return null; |
117 | } | 117 | } |
118 | } | 118 | } |
119 | 119 | ||
120 | /// <summary> | 120 | /// <summary> |
121 | /// Returns a list of the root folders within a users inventory | 121 | /// Returns a list of the root folders within a users inventory |
122 | /// </summary> | 122 | /// </summary> |
123 | /// <param name="user">The user whos inventory is to be searched</param> | 123 | /// <param name="user">The user whos inventory is to be searched</param> |
124 | /// <returns>A list of folder objects</returns> | 124 | /// <returns>A list of folder objects</returns> |
125 | public List<InventoryFolderBase> getUserRootFolders(LLUUID user) | 125 | public List<InventoryFolderBase> getUserRootFolders(LLUUID user) |
126 | { | 126 | { |
127 | try | 127 | try |
128 | { | 128 | { |
129 | lock (database) | 129 | lock (database) |
130 | { | 130 | { |
131 | Dictionary<string, string> param = new Dictionary<string, string>(); | 131 | Dictionary<string, string> param = new Dictionary<string, string>(); |
132 | param["?uuid"] = user.ToStringHyphenated(); | 132 | param["?uuid"] = user.ToStringHyphenated(); |
133 | param["?zero"] = LLUUID.Zero.ToStringHyphenated(); | 133 | param["?zero"] = LLUUID.Zero.ToStringHyphenated(); |
134 | 134 | ||
135 | IDbCommand result = database.Query("SELECT * FROM inventoryfolders WHERE parentFolderID = ?zero AND agentID = ?uuid", param); | 135 | IDbCommand result = database.Query("SELECT * FROM inventoryfolders WHERE parentFolderID = ?zero AND agentID = ?uuid", param); |
136 | IDataReader reader = result.ExecuteReader(); | 136 | IDataReader reader = result.ExecuteReader(); |
137 | 137 | ||
138 | List<InventoryFolderBase> items = database.readInventoryFolders(reader); | 138 | List<InventoryFolderBase> items = database.readInventoryFolders(reader); |
139 | 139 | ||
140 | reader.Close(); | 140 | reader.Close(); |
141 | result.Dispose(); | 141 | result.Dispose(); |
142 | 142 | ||
143 | return items; | 143 | return items; |
144 | } | 144 | } |
145 | } | 145 | } |
146 | catch (Exception e) | 146 | catch (Exception e) |
147 | { | 147 | { |
148 | database.Reconnect(); | 148 | database.Reconnect(); |
149 | Console.WriteLine(e.ToString()); | 149 | Console.WriteLine(e.ToString()); |
150 | return null; | 150 | return null; |
151 | } | 151 | } |
152 | } | 152 | } |
153 | 153 | ||
154 | /// <summary> | 154 | /// <summary> |
155 | /// Returns a list of folders in a users inventory contained within the specified folder | 155 | /// Returns a list of folders in a users inventory contained within the specified folder |
156 | /// </summary> | 156 | /// </summary> |
157 | /// <param name="parentID">The folder to search</param> | 157 | /// <param name="parentID">The folder to search</param> |
158 | /// <returns>A list of inventory folders</returns> | 158 | /// <returns>A list of inventory folders</returns> |
159 | public List<InventoryFolderBase> getInventoryFolders(LLUUID parentID) | 159 | public List<InventoryFolderBase> getInventoryFolders(LLUUID parentID) |
160 | { | 160 | { |
161 | try | 161 | try |
162 | { | 162 | { |
163 | lock (database) | 163 | lock (database) |
164 | { | 164 | { |
165 | Dictionary<string, string> param = new Dictionary<string, string>(); | 165 | Dictionary<string, string> param = new Dictionary<string, string>(); |
166 | param["?uuid"] = parentID.ToStringHyphenated(); | 166 | param["?uuid"] = parentID.ToStringHyphenated(); |
167 | 167 | ||
168 | IDbCommand result = database.Query("SELECT * FROM inventoryfolders WHERE parentFolderID = ?uuid", param); | 168 | IDbCommand result = database.Query("SELECT * FROM inventoryfolders WHERE parentFolderID = ?uuid", param); |
169 | IDataReader reader = result.ExecuteReader(); | 169 | IDataReader reader = result.ExecuteReader(); |
170 | 170 | ||
171 | List<InventoryFolderBase> items = database.readInventoryFolders(reader); | 171 | List<InventoryFolderBase> items = database.readInventoryFolders(reader); |
172 | 172 | ||
173 | reader.Close(); | 173 | reader.Close(); |
174 | result.Dispose(); | 174 | result.Dispose(); |
175 | 175 | ||
176 | return items; | 176 | return items; |
177 | } | 177 | } |
178 | } | 178 | } |
179 | catch (Exception e) | 179 | catch (Exception e) |
180 | { | 180 | { |
181 | database.Reconnect(); | 181 | database.Reconnect(); |
182 | Console.WriteLine(e.ToString()); | 182 | Console.WriteLine(e.ToString()); |
183 | return null; | 183 | return null; |
184 | } | 184 | } |
185 | } | 185 | } |
186 | 186 | ||
187 | /// <summary> | 187 | /// <summary> |
188 | /// Returns a specified inventory item | 188 | /// Returns a specified inventory item |
189 | /// </summary> | 189 | /// </summary> |
190 | /// <param name="item">The item to return</param> | 190 | /// <param name="item">The item to return</param> |
191 | /// <returns>An inventory item</returns> | 191 | /// <returns>An inventory item</returns> |
192 | public InventoryItemBase getInventoryItem(LLUUID item) | 192 | public InventoryItemBase getInventoryItem(LLUUID item) |
193 | { | 193 | { |
194 | try | 194 | try |
195 | { | 195 | { |
196 | lock (database) | 196 | lock (database) |
197 | { | 197 | { |
198 | Dictionary<string, string> param = new Dictionary<string, string>(); | 198 | Dictionary<string, string> param = new Dictionary<string, string>(); |
199 | param["?uuid"] = item.ToStringHyphenated(); | 199 | param["?uuid"] = item.ToStringHyphenated(); |
200 | 200 | ||
201 | IDbCommand result = database.Query("SELECT * FROM inventoryitems WHERE inventoryID = ?uuid", param); | 201 | IDbCommand result = database.Query("SELECT * FROM inventoryitems WHERE inventoryID = ?uuid", param); |
202 | IDataReader reader = result.ExecuteReader(); | 202 | IDataReader reader = result.ExecuteReader(); |
203 | 203 | ||
204 | List<InventoryItemBase> items = database.readInventoryItems(reader); | 204 | List<InventoryItemBase> items = database.readInventoryItems(reader); |
205 | 205 | ||
206 | reader.Close(); | 206 | reader.Close(); |
207 | result.Dispose(); | 207 | result.Dispose(); |
208 | 208 | ||
209 | if (items.Count > 0) | 209 | if (items.Count > 0) |
210 | { | 210 | { |
211 | return items[0]; | 211 | return items[0]; |
212 | } | 212 | } |
213 | else | 213 | else |
214 | { | 214 | { |
215 | return null; | 215 | return null; |
216 | } | 216 | } |
217 | } | 217 | } |
218 | } | 218 | } |
219 | catch (Exception e) | 219 | catch (Exception e) |
220 | { | 220 | { |
221 | database.Reconnect(); | 221 | database.Reconnect(); |
222 | Console.WriteLine(e.ToString()); | 222 | Console.WriteLine(e.ToString()); |
223 | return null; | 223 | return null; |
224 | } | 224 | } |
225 | } | 225 | } |
226 | 226 | ||
227 | /// <summary> | 227 | /// <summary> |
228 | /// Returns a specified inventory folder | 228 | /// Returns a specified inventory folder |
229 | /// </summary> | 229 | /// </summary> |
230 | /// <param name="folder">The folder to return</param> | 230 | /// <param name="folder">The folder to return</param> |
231 | /// <returns>A folder class</returns> | 231 | /// <returns>A folder class</returns> |
232 | public InventoryFolderBase getInventoryFolder(LLUUID folder) | 232 | public InventoryFolderBase getInventoryFolder(LLUUID folder) |
233 | { | 233 | { |
234 | try | 234 | try |
235 | { | 235 | { |
236 | lock (database) | 236 | lock (database) |
237 | { | 237 | { |
238 | Dictionary<string, string> param = new Dictionary<string, string>(); | 238 | Dictionary<string, string> param = new Dictionary<string, string>(); |
239 | param["?uuid"] = folder.ToStringHyphenated(); | 239 | param["?uuid"] = folder.ToStringHyphenated(); |
240 | 240 | ||
241 | IDbCommand result = database.Query("SELECT * FROM inventoryfolders WHERE folderID = ?uuid", param); | 241 | IDbCommand result = database.Query("SELECT * FROM inventoryfolders WHERE folderID = ?uuid", param); |
242 | IDataReader reader = result.ExecuteReader(); | 242 | IDataReader reader = result.ExecuteReader(); |
243 | 243 | ||
244 | List<InventoryFolderBase> items = database.readInventoryFolders(reader); | 244 | List<InventoryFolderBase> items = database.readInventoryFolders(reader); |
245 | 245 | ||
246 | reader.Close(); | 246 | reader.Close(); |
247 | result.Dispose(); | 247 | result.Dispose(); |
248 | 248 | ||
249 | if (items.Count > 0) | 249 | if (items.Count > 0) |
250 | { | 250 | { |
251 | return items[0]; | 251 | return items[0]; |
252 | } | 252 | } |
253 | else | 253 | else |
254 | { | 254 | { |
255 | return null; | 255 | return null; |
256 | } | 256 | } |
257 | } | 257 | } |
258 | } | 258 | } |
259 | catch (Exception e) | 259 | catch (Exception e) |
260 | { | 260 | { |
261 | database.Reconnect(); | 261 | database.Reconnect(); |
262 | Console.WriteLine(e.ToString()); | 262 | Console.WriteLine(e.ToString()); |
263 | return null; | 263 | return null; |
264 | } | 264 | } |
265 | } | 265 | } |
266 | 266 | ||
267 | /// <summary> | 267 | /// <summary> |
268 | /// Adds a specified item to the database | 268 | /// Adds a specified item to the database |
269 | /// </summary> | 269 | /// </summary> |
270 | /// <param name="item">The inventory item</param> | 270 | /// <param name="item">The inventory item</param> |
271 | public void addInventoryItem(InventoryItemBase item) | 271 | public void addInventoryItem(InventoryItemBase item) |
272 | { | 272 | { |
273 | lock (database) | 273 | lock (database) |
274 | { | 274 | { |
275 | database.insertItem(item); | 275 | database.insertItem(item); |
276 | } | 276 | } |
277 | } | 277 | } |
278 | 278 | ||
279 | /// <summary> | 279 | /// <summary> |
280 | /// Updates the specified inventory item | 280 | /// Updates the specified inventory item |
281 | /// </summary> | 281 | /// </summary> |
282 | /// <param name="item">Inventory item to update</param> | 282 | /// <param name="item">Inventory item to update</param> |
283 | public void updateInventoryItem(InventoryItemBase item) | 283 | public void updateInventoryItem(InventoryItemBase item) |
284 | { | 284 | { |
285 | addInventoryItem(item); | 285 | addInventoryItem(item); |
286 | } | 286 | } |
287 | 287 | ||
288 | /// <summary> | 288 | /// <summary> |
289 | /// Creates a new inventory folder | 289 | /// Creates a new inventory folder |
290 | /// </summary> | 290 | /// </summary> |
291 | /// <param name="folder">Folder to create</param> | 291 | /// <param name="folder">Folder to create</param> |
292 | public void addInventoryFolder(InventoryFolderBase folder) | 292 | public void addInventoryFolder(InventoryFolderBase folder) |
293 | { | 293 | { |
294 | lock (database) | 294 | lock (database) |
295 | { | 295 | { |
296 | database.insertFolder(folder); | 296 | database.insertFolder(folder); |
297 | } | 297 | } |
298 | } | 298 | } |
299 | 299 | ||
300 | /// <summary> | 300 | /// <summary> |
301 | /// Updates an inventory folder | 301 | /// Updates an inventory folder |
302 | /// </summary> | 302 | /// </summary> |
303 | /// <param name="folder">Folder to update</param> | 303 | /// <param name="folder">Folder to update</param> |
304 | public void updateInventoryFolder(InventoryFolderBase folder) | 304 | public void updateInventoryFolder(InventoryFolderBase folder) |
305 | { | 305 | { |
306 | addInventoryFolder(folder); | 306 | addInventoryFolder(folder); |
307 | } | 307 | } |
308 | } | 308 | } |
309 | } | 309 | } |
diff --git a/OpenSim/Framework/Data.MySQL/MySQLLogData.cs b/OpenSim/Framework/Data.MySQL/MySQLLogData.cs index 38f9fd3..2ba9c3d 100644 --- a/OpenSim/Framework/Data.MySQL/MySQLLogData.cs +++ b/OpenSim/Framework/Data.MySQL/MySQLLogData.cs | |||
@@ -1,105 +1,105 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using System; | 28 | using System; |
29 | 29 | ||
30 | namespace OpenSim.Framework.Data.MySQL | 30 | namespace OpenSim.Framework.Data.MySQL |
31 | { | 31 | { |
32 | /// <summary> | 32 | /// <summary> |
33 | /// An interface to the log database for MySQL | 33 | /// An interface to the log database for MySQL |
34 | /// </summary> | 34 | /// </summary> |
35 | class MySQLLogData : ILogData | 35 | class MySQLLogData : ILogData |
36 | { | 36 | { |
37 | /// <summary> | 37 | /// <summary> |
38 | /// The database manager | 38 | /// The database manager |
39 | /// </summary> | 39 | /// </summary> |
40 | public MySQLManager database; | 40 | public MySQLManager database; |
41 | 41 | ||
42 | /// <summary> | 42 | /// <summary> |
43 | /// Artificial constructor called when the plugin is loaded | 43 | /// Artificial constructor called when the plugin is loaded |
44 | /// </summary> | 44 | /// </summary> |
45 | public void Initialise() | 45 | public void Initialise() |
46 | { | 46 | { |
47 | IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini"); | 47 | IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini"); |
48 | string settingHostname = GridDataMySqlFile.ParseFileReadValue("hostname"); | 48 | string settingHostname = GridDataMySqlFile.ParseFileReadValue("hostname"); |
49 | string settingDatabase = GridDataMySqlFile.ParseFileReadValue("database"); | 49 | string settingDatabase = GridDataMySqlFile.ParseFileReadValue("database"); |
50 | string settingUsername = GridDataMySqlFile.ParseFileReadValue("username"); | 50 | string settingUsername = GridDataMySqlFile.ParseFileReadValue("username"); |
51 | string settingPassword = GridDataMySqlFile.ParseFileReadValue("password"); | 51 | string settingPassword = GridDataMySqlFile.ParseFileReadValue("password"); |
52 | string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling"); | 52 | string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling"); |
53 | string settingPort = GridDataMySqlFile.ParseFileReadValue("port"); | 53 | string settingPort = GridDataMySqlFile.ParseFileReadValue("port"); |
54 | 54 | ||
55 | database = new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, settingPort); | 55 | database = new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, settingPort); |
56 | } | 56 | } |
57 | 57 | ||
58 | /// <summary> | 58 | /// <summary> |
59 | /// Saves a log item to the database | 59 | /// Saves a log item to the database |
60 | /// </summary> | 60 | /// </summary> |
61 | /// <param name="serverDaemon">The daemon triggering the event</param> | 61 | /// <param name="serverDaemon">The daemon triggering the event</param> |
62 | /// <param name="target">The target of the action (region / agent UUID, etc)</param> | 62 | /// <param name="target">The target of the action (region / agent UUID, etc)</param> |
63 | /// <param name="methodCall">The method call where the problem occured</param> | 63 | /// <param name="methodCall">The method call where the problem occured</param> |
64 | /// <param name="arguments">The arguments passed to the method</param> | 64 | /// <param name="arguments">The arguments passed to the method</param> |
65 | /// <param name="priority">How critical is this?</param> | 65 | /// <param name="priority">How critical is this?</param> |
66 | /// <param name="logMessage">The message to log</param> | 66 | /// <param name="logMessage">The message to log</param> |
67 | public void saveLog(string serverDaemon, string target, string methodCall, string arguments, int priority, string logMessage) | 67 | public void saveLog(string serverDaemon, string target, string methodCall, string arguments, int priority, string logMessage) |
68 | { | 68 | { |
69 | try | 69 | try |
70 | { | 70 | { |
71 | database.insertLogRow(serverDaemon, target, methodCall, arguments, priority, logMessage); | 71 | database.insertLogRow(serverDaemon, target, methodCall, arguments, priority, logMessage); |
72 | } | 72 | } |
73 | catch | 73 | catch |
74 | { | 74 | { |
75 | database.Reconnect(); | 75 | database.Reconnect(); |
76 | } | 76 | } |
77 | } | 77 | } |
78 | 78 | ||
79 | /// <summary> | 79 | /// <summary> |
80 | /// Returns the name of this DB provider | 80 | /// Returns the name of this DB provider |
81 | /// </summary> | 81 | /// </summary> |
82 | /// <returns>A string containing the DB provider name</returns> | 82 | /// <returns>A string containing the DB provider name</returns> |
83 | public string getName() | 83 | public string getName() |
84 | { | 84 | { |
85 | return "MySQL Logdata Interface"; | 85 | return "MySQL Logdata Interface"; |
86 | } | 86 | } |
87 | 87 | ||
88 | /// <summary> | 88 | /// <summary> |
89 | /// Closes the database provider | 89 | /// Closes the database provider |
90 | /// </summary> | 90 | /// </summary> |
91 | public void Close() | 91 | public void Close() |
92 | { | 92 | { |
93 | // Do nothing. | 93 | // Do nothing. |
94 | } | 94 | } |
95 | 95 | ||
96 | /// <summary> | 96 | /// <summary> |
97 | /// Returns the version of this DB provider | 97 | /// Returns the version of this DB provider |
98 | /// </summary> | 98 | /// </summary> |
99 | /// <returns>A string containing the provider version</returns> | 99 | /// <returns>A string containing the provider version</returns> |
100 | public string getVersion() | 100 | public string getVersion() |
101 | { | 101 | { |
102 | return "0.1"; | 102 | return "0.1"; |
103 | } | 103 | } |
104 | } | 104 | } |
105 | } | 105 | } |
diff --git a/OpenSim/Framework/Data.MySQL/MySQLManager.cs b/OpenSim/Framework/Data.MySQL/MySQLManager.cs index ab7f277..a5434c8 100644 --- a/OpenSim/Framework/Data.MySQL/MySQLManager.cs +++ b/OpenSim/Framework/Data.MySQL/MySQLManager.cs | |||
@@ -1,606 +1,606 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Data; | 30 | using System.Data; |
31 | using libsecondlife; | 31 | using libsecondlife; |
32 | using MySql.Data.MySqlClient; | 32 | using MySql.Data.MySqlClient; |
33 | 33 | ||
34 | namespace OpenSim.Framework.Data.MySQL | 34 | namespace OpenSim.Framework.Data.MySQL |
35 | { | 35 | { |
36 | /// <summary> | 36 | /// <summary> |
37 | /// A MySQL Database manager | 37 | /// A MySQL Database manager |
38 | /// </summary> | 38 | /// </summary> |
39 | class MySQLManager | 39 | class MySQLManager |
40 | { | 40 | { |
41 | /// <summary> | 41 | /// <summary> |
42 | /// The database connection object | 42 | /// The database connection object |
43 | /// </summary> | 43 | /// </summary> |
44 | IDbConnection dbcon; | 44 | IDbConnection dbcon; |
45 | /// <summary> | 45 | /// <summary> |
46 | /// Connection string for ADO.net | 46 | /// Connection string for ADO.net |
47 | /// </summary> | 47 | /// </summary> |
48 | string connectionString; | 48 | string connectionString; |
49 | 49 | ||
50 | /// <summary> | 50 | /// <summary> |
51 | /// Initialises and creates a new MySQL connection and maintains it. | 51 | /// Initialises and creates a new MySQL connection and maintains it. |
52 | /// </summary> | 52 | /// </summary> |
53 | /// <param name="hostname">The MySQL server being connected to</param> | 53 | /// <param name="hostname">The MySQL server being connected to</param> |
54 | /// <param name="database">The name of the MySQL database being used</param> | 54 | /// <param name="database">The name of the MySQL database being used</param> |
55 | /// <param name="username">The username logging into the database</param> | 55 | /// <param name="username">The username logging into the database</param> |
56 | /// <param name="password">The password for the user logging in</param> | 56 | /// <param name="password">The password for the user logging in</param> |
57 | /// <param name="cpooling">Whether to use connection pooling or not, can be one of the following: 'yes', 'true', 'no' or 'false', if unsure use 'false'.</param> | 57 | /// <param name="cpooling">Whether to use connection pooling or not, can be one of the following: 'yes', 'true', 'no' or 'false', if unsure use 'false'.</param> |
58 | public MySQLManager(string hostname, string database, string username, string password, string cpooling, string port) | 58 | public MySQLManager(string hostname, string database, string username, string password, string cpooling, string port) |
59 | { | 59 | { |
60 | try | 60 | try |
61 | { | 61 | { |
62 | connectionString = "Server=" + hostname + ";Port=" + port + ";Database=" + database + ";User ID=" + username + ";Password=" + password + ";Pooling=" + cpooling + ";"; | 62 | connectionString = "Server=" + hostname + ";Port=" + port + ";Database=" + database + ";User ID=" + username + ";Password=" + password + ";Pooling=" + cpooling + ";"; |
63 | dbcon = new MySqlConnection(connectionString); | 63 | dbcon = new MySqlConnection(connectionString); |
64 | 64 | ||
65 | dbcon.Open(); | 65 | dbcon.Open(); |
66 | 66 | ||
67 | Console.WriteLine("MySQL connection established"); | 67 | Console.WriteLine("MySQL connection established"); |
68 | } | 68 | } |
69 | catch (Exception e) | 69 | catch (Exception e) |
70 | { | 70 | { |
71 | throw new Exception("Error initialising MySql Database: " + e.ToString()); | 71 | throw new Exception("Error initialising MySql Database: " + e.ToString()); |
72 | } | 72 | } |
73 | } | 73 | } |
74 | 74 | ||
75 | /// <summary> | 75 | /// <summary> |
76 | /// Shuts down the database connection | 76 | /// Shuts down the database connection |
77 | /// </summary> | 77 | /// </summary> |
78 | public void Close() | 78 | public void Close() |
79 | { | 79 | { |
80 | dbcon.Close(); | 80 | dbcon.Close(); |
81 | dbcon = null; | 81 | dbcon = null; |
82 | } | 82 | } |
83 | 83 | ||
84 | /// <summary> | 84 | /// <summary> |
85 | /// Reconnects to the database | 85 | /// Reconnects to the database |
86 | /// </summary> | 86 | /// </summary> |
87 | public void Reconnect() | 87 | public void Reconnect() |
88 | { | 88 | { |
89 | lock (dbcon) | 89 | lock (dbcon) |
90 | { | 90 | { |
91 | try | 91 | try |
92 | { | 92 | { |
93 | // Close the DB connection | 93 | // Close the DB connection |
94 | dbcon.Close(); | 94 | dbcon.Close(); |
95 | // Try reopen it | 95 | // Try reopen it |
96 | dbcon = new MySqlConnection(connectionString); | 96 | dbcon = new MySqlConnection(connectionString); |
97 | dbcon.Open(); | 97 | dbcon.Open(); |
98 | } | 98 | } |
99 | catch (Exception e) | 99 | catch (Exception e) |
100 | { | 100 | { |
101 | Console.WriteLine("Unable to reconnect to database " + e.ToString()); | 101 | Console.WriteLine("Unable to reconnect to database " + e.ToString()); |
102 | } | 102 | } |
103 | } | 103 | } |
104 | } | 104 | } |
105 | 105 | ||
106 | /// <summary> | 106 | /// <summary> |
107 | /// Runs a query with protection against SQL Injection by using parameterised input. | 107 | /// Runs a query with protection against SQL Injection by using parameterised input. |
108 | /// </summary> | 108 | /// </summary> |
109 | /// <param name="sql">The SQL string - replace any variables such as WHERE x = "y" with WHERE x = @y</param> | 109 | /// <param name="sql">The SQL string - replace any variables such as WHERE x = "y" with WHERE x = @y</param> |
110 | /// <param name="parameters">The parameters - index so that @y is indexed as 'y'</param> | 110 | /// <param name="parameters">The parameters - index so that @y is indexed as 'y'</param> |
111 | /// <returns>A MySQL DB Command</returns> | 111 | /// <returns>A MySQL DB Command</returns> |
112 | public IDbCommand Query(string sql, Dictionary<string, string> parameters) | 112 | public IDbCommand Query(string sql, Dictionary<string, string> parameters) |
113 | { | 113 | { |
114 | try | 114 | try |
115 | { | 115 | { |
116 | MySqlCommand dbcommand = (MySqlCommand)dbcon.CreateCommand(); | 116 | MySqlCommand dbcommand = (MySqlCommand)dbcon.CreateCommand(); |
117 | dbcommand.CommandText = sql; | 117 | dbcommand.CommandText = sql; |
118 | foreach (KeyValuePair<string, string> param in parameters) | 118 | foreach (KeyValuePair<string, string> param in parameters) |
119 | { | 119 | { |
120 | dbcommand.Parameters.Add(param.Key, param.Value); | 120 | dbcommand.Parameters.Add(param.Key, param.Value); |
121 | } | 121 | } |
122 | 122 | ||
123 | return (IDbCommand)dbcommand; | 123 | return (IDbCommand)dbcommand; |
124 | } | 124 | } |
125 | catch | 125 | catch |
126 | { | 126 | { |
127 | lock (dbcon) | 127 | lock (dbcon) |
128 | { | 128 | { |
129 | // Close the DB connection | 129 | // Close the DB connection |
130 | try | 130 | try |
131 | { | 131 | { |
132 | dbcon.Close(); | 132 | dbcon.Close(); |
133 | } | 133 | } |
134 | catch { } | 134 | catch { } |
135 | 135 | ||
136 | // Try reopen it | 136 | // Try reopen it |
137 | try | 137 | try |
138 | { | 138 | { |
139 | dbcon = new MySqlConnection(connectionString); | 139 | dbcon = new MySqlConnection(connectionString); |
140 | dbcon.Open(); | 140 | dbcon.Open(); |
141 | } | 141 | } |
142 | catch (Exception e) | 142 | catch (Exception e) |
143 | { | 143 | { |
144 | Console.WriteLine("Unable to reconnect to database " + e.ToString()); | 144 | Console.WriteLine("Unable to reconnect to database " + e.ToString()); |
145 | } | 145 | } |
146 | 146 | ||
147 | // Run the query again | 147 | // Run the query again |
148 | try | 148 | try |
149 | { | 149 | { |
150 | MySqlCommand dbcommand = (MySqlCommand)dbcon.CreateCommand(); | 150 | MySqlCommand dbcommand = (MySqlCommand)dbcon.CreateCommand(); |
151 | dbcommand.CommandText = sql; | 151 | dbcommand.CommandText = sql; |
152 | foreach (KeyValuePair<string, string> param in parameters) | 152 | foreach (KeyValuePair<string, string> param in parameters) |
153 | { | 153 | { |
154 | dbcommand.Parameters.Add(param.Key, param.Value); | 154 | dbcommand.Parameters.Add(param.Key, param.Value); |
155 | } | 155 | } |
156 | 156 | ||
157 | return (IDbCommand)dbcommand; | 157 | return (IDbCommand)dbcommand; |
158 | } | 158 | } |
159 | catch (Exception e) | 159 | catch (Exception e) |
160 | { | 160 | { |
161 | // Return null if it fails. | 161 | // Return null if it fails. |
162 | Console.WriteLine("Failed during Query generation: " + e.ToString()); | 162 | Console.WriteLine("Failed during Query generation: " + e.ToString()); |
163 | return null; | 163 | return null; |
164 | } | 164 | } |
165 | } | 165 | } |
166 | } | 166 | } |
167 | } | 167 | } |
168 | 168 | ||
169 | /// <summary> | 169 | /// <summary> |
170 | /// Reads a region row from a database reader | 170 | /// Reads a region row from a database reader |
171 | /// </summary> | 171 | /// </summary> |
172 | /// <param name="reader">An active database reader</param> | 172 | /// <param name="reader">An active database reader</param> |
173 | /// <returns>A region profile</returns> | 173 | /// <returns>A region profile</returns> |
174 | public SimProfileData readSimRow(IDataReader reader) | 174 | public SimProfileData readSimRow(IDataReader reader) |
175 | { | 175 | { |
176 | SimProfileData retval = new SimProfileData(); | 176 | SimProfileData retval = new SimProfileData(); |
177 | 177 | ||
178 | if (reader.Read()) | 178 | if (reader.Read()) |
179 | { | 179 | { |
180 | // Region Main | 180 | // Region Main |
181 | retval.regionHandle = Convert.ToUInt64(reader["regionHandle"].ToString()); | 181 | retval.regionHandle = Convert.ToUInt64(reader["regionHandle"].ToString()); |
182 | retval.regionName = (string)reader["regionName"]; | 182 | retval.regionName = (string)reader["regionName"]; |
183 | retval.UUID = new LLUUID((string)reader["uuid"]); | 183 | retval.UUID = new LLUUID((string)reader["uuid"]); |
184 | 184 | ||
185 | // Secrets | 185 | // Secrets |
186 | retval.regionRecvKey = (string)reader["regionRecvKey"]; | 186 | retval.regionRecvKey = (string)reader["regionRecvKey"]; |
187 | retval.regionSecret = (string)reader["regionSecret"]; | 187 | retval.regionSecret = (string)reader["regionSecret"]; |
188 | retval.regionSendKey = (string)reader["regionSendKey"]; | 188 | retval.regionSendKey = (string)reader["regionSendKey"]; |
189 | 189 | ||
190 | // Region Server | 190 | // Region Server |
191 | retval.regionDataURI = (string)reader["regionDataURI"]; | 191 | retval.regionDataURI = (string)reader["regionDataURI"]; |
192 | retval.regionOnline = false; // Needs to be pinged before this can be set. | 192 | retval.regionOnline = false; // Needs to be pinged before this can be set. |
193 | retval.serverIP = (string)reader["serverIP"]; | 193 | retval.serverIP = (string)reader["serverIP"]; |
194 | retval.serverPort = (uint)reader["serverPort"]; | 194 | retval.serverPort = (uint)reader["serverPort"]; |
195 | retval.serverURI = (string)reader["serverURI"]; | 195 | retval.serverURI = (string)reader["serverURI"]; |
196 | retval.httpPort = Convert.ToUInt32(reader["serverHttpPort"].ToString()); | 196 | retval.httpPort = Convert.ToUInt32(reader["serverHttpPort"].ToString()); |
197 | retval.remotingPort = Convert.ToUInt32(reader["serverRemotingPort"].ToString()); | 197 | retval.remotingPort = Convert.ToUInt32(reader["serverRemotingPort"].ToString()); |
198 | 198 | ||
199 | // Location | 199 | // Location |
200 | retval.regionLocX = Convert.ToUInt32(reader["locX"].ToString()); | 200 | retval.regionLocX = Convert.ToUInt32(reader["locX"].ToString()); |
201 | retval.regionLocY = Convert.ToUInt32(reader["locY"].ToString()); | 201 | retval.regionLocY = Convert.ToUInt32(reader["locY"].ToString()); |
202 | retval.regionLocZ = Convert.ToUInt32(reader["locZ"].ToString()); | 202 | retval.regionLocZ = Convert.ToUInt32(reader["locZ"].ToString()); |
203 | 203 | ||
204 | // Neighbours - 0 = No Override | 204 | // Neighbours - 0 = No Override |
205 | retval.regionEastOverrideHandle = Convert.ToUInt64(reader["eastOverrideHandle"].ToString()); | 205 | retval.regionEastOverrideHandle = Convert.ToUInt64(reader["eastOverrideHandle"].ToString()); |
206 | retval.regionWestOverrideHandle = Convert.ToUInt64(reader["westOverrideHandle"].ToString()); | 206 | retval.regionWestOverrideHandle = Convert.ToUInt64(reader["westOverrideHandle"].ToString()); |
207 | retval.regionSouthOverrideHandle = Convert.ToUInt64(reader["southOverrideHandle"].ToString()); | 207 | retval.regionSouthOverrideHandle = Convert.ToUInt64(reader["southOverrideHandle"].ToString()); |
208 | retval.regionNorthOverrideHandle = Convert.ToUInt64(reader["northOverrideHandle"].ToString()); | 208 | retval.regionNorthOverrideHandle = Convert.ToUInt64(reader["northOverrideHandle"].ToString()); |
209 | 209 | ||
210 | // Assets | 210 | // Assets |
211 | retval.regionAssetURI = (string)reader["regionAssetURI"]; | 211 | retval.regionAssetURI = (string)reader["regionAssetURI"]; |
212 | retval.regionAssetRecvKey = (string)reader["regionAssetRecvKey"]; | 212 | retval.regionAssetRecvKey = (string)reader["regionAssetRecvKey"]; |
213 | retval.regionAssetSendKey = (string)reader["regionAssetSendKey"]; | 213 | retval.regionAssetSendKey = (string)reader["regionAssetSendKey"]; |
214 | 214 | ||
215 | // Userserver | 215 | // Userserver |
216 | retval.regionUserURI = (string)reader["regionUserURI"]; | 216 | retval.regionUserURI = (string)reader["regionUserURI"]; |
217 | retval.regionUserRecvKey = (string)reader["regionUserRecvKey"]; | 217 | retval.regionUserRecvKey = (string)reader["regionUserRecvKey"]; |
218 | retval.regionUserSendKey = (string)reader["regionUserSendKey"]; | 218 | retval.regionUserSendKey = (string)reader["regionUserSendKey"]; |
219 | 219 | ||
220 | // World Map Addition | 220 | // World Map Addition |
221 | string tempRegionMap = reader["regionMapTexture"].ToString(); | 221 | string tempRegionMap = reader["regionMapTexture"].ToString(); |
222 | if (tempRegionMap != "") | 222 | if (tempRegionMap != "") |
223 | { | 223 | { |
224 | retval.regionMapTextureID = new LLUUID(tempRegionMap); | 224 | retval.regionMapTextureID = new LLUUID(tempRegionMap); |
225 | } | 225 | } |
226 | else | 226 | else |
227 | { | 227 | { |
228 | retval.regionMapTextureID = new LLUUID(); | 228 | retval.regionMapTextureID = new LLUUID(); |
229 | } | 229 | } |
230 | } | 230 | } |
231 | else | 231 | else |
232 | { | 232 | { |
233 | return null; | 233 | return null; |
234 | } | 234 | } |
235 | return retval; | 235 | return retval; |
236 | } | 236 | } |
237 | 237 | ||
238 | /// <summary> | 238 | /// <summary> |
239 | /// Reads a reservation row from a database reader | 239 | /// Reads a reservation row from a database reader |
240 | /// </summary> | 240 | /// </summary> |
241 | /// <param name="reader">An active database reader</param> | 241 | /// <param name="reader">An active database reader</param> |
242 | /// <returns>A reservation data object</returns> | 242 | /// <returns>A reservation data object</returns> |
243 | public ReservationData readReservationRow(IDataReader reader) | 243 | public ReservationData readReservationRow(IDataReader reader) |
244 | { | 244 | { |
245 | ReservationData retval = new ReservationData(); | 245 | ReservationData retval = new ReservationData(); |
246 | if (reader.Read()) | 246 | if (reader.Read()) |
247 | { | 247 | { |
248 | retval.gridRecvKey = (string)reader["gridRecvKey"]; | 248 | retval.gridRecvKey = (string)reader["gridRecvKey"]; |
249 | retval.gridSendKey = (string)reader["gridSendKey"]; | 249 | retval.gridSendKey = (string)reader["gridSendKey"]; |
250 | retval.reservationCompany = (string)reader["resCompany"]; | 250 | retval.reservationCompany = (string)reader["resCompany"]; |
251 | retval.reservationMaxX = Convert.ToInt32(reader["resXMax"].ToString()); | 251 | retval.reservationMaxX = Convert.ToInt32(reader["resXMax"].ToString()); |
252 | retval.reservationMaxY = Convert.ToInt32(reader["resYMax"].ToString()); | 252 | retval.reservationMaxY = Convert.ToInt32(reader["resYMax"].ToString()); |
253 | retval.reservationMinX = Convert.ToInt32(reader["resXMin"].ToString()); | 253 | retval.reservationMinX = Convert.ToInt32(reader["resXMin"].ToString()); |
254 | retval.reservationMinY = Convert.ToInt32(reader["resYMin"].ToString()); | 254 | retval.reservationMinY = Convert.ToInt32(reader["resYMin"].ToString()); |
255 | retval.reservationName = (string)reader["resName"]; | 255 | retval.reservationName = (string)reader["resName"]; |
256 | retval.status = Convert.ToInt32(reader["status"].ToString()) == 1; | 256 | retval.status = Convert.ToInt32(reader["status"].ToString()) == 1; |
257 | retval.userUUID = new LLUUID((string)reader["userUUID"]); | 257 | retval.userUUID = new LLUUID((string)reader["userUUID"]); |
258 | 258 | ||
259 | } | 259 | } |
260 | else | 260 | else |
261 | { | 261 | { |
262 | return null; | 262 | return null; |
263 | } | 263 | } |
264 | return retval; | 264 | return retval; |
265 | } | 265 | } |
266 | /// <summary> | 266 | /// <summary> |
267 | /// Reads an agent row from a database reader | 267 | /// Reads an agent row from a database reader |
268 | /// </summary> | 268 | /// </summary> |
269 | /// <param name="reader">An active database reader</param> | 269 | /// <param name="reader">An active database reader</param> |
270 | /// <returns>A user session agent</returns> | 270 | /// <returns>A user session agent</returns> |
271 | public UserAgentData readAgentRow(IDataReader reader) | 271 | public UserAgentData readAgentRow(IDataReader reader) |
272 | { | 272 | { |
273 | UserAgentData retval = new UserAgentData(); | 273 | UserAgentData retval = new UserAgentData(); |
274 | 274 | ||
275 | if (reader.Read()) | 275 | if (reader.Read()) |
276 | { | 276 | { |
277 | // Agent IDs | 277 | // Agent IDs |
278 | retval.UUID = new LLUUID((string)reader["UUID"]); | 278 | retval.UUID = new LLUUID((string)reader["UUID"]); |
279 | retval.sessionID = new LLUUID((string)reader["sessionID"]); | 279 | retval.sessionID = new LLUUID((string)reader["sessionID"]); |
280 | retval.secureSessionID = new LLUUID((string)reader["secureSessionID"]); | 280 | retval.secureSessionID = new LLUUID((string)reader["secureSessionID"]); |
281 | 281 | ||
282 | // Agent Who? | 282 | // Agent Who? |
283 | retval.agentIP = (string)reader["agentIP"]; | 283 | retval.agentIP = (string)reader["agentIP"]; |
284 | retval.agentPort = Convert.ToUInt32(reader["agentPort"].ToString()); | 284 | retval.agentPort = Convert.ToUInt32(reader["agentPort"].ToString()); |
285 | retval.agentOnline = Convert.ToBoolean(reader["agentOnline"].ToString()); | 285 | retval.agentOnline = Convert.ToBoolean(reader["agentOnline"].ToString()); |
286 | 286 | ||
287 | // Login/Logout times (UNIX Epoch) | 287 | // Login/Logout times (UNIX Epoch) |
288 | retval.loginTime = Convert.ToInt32(reader["loginTime"].ToString()); | 288 | retval.loginTime = Convert.ToInt32(reader["loginTime"].ToString()); |
289 | retval.logoutTime = Convert.ToInt32(reader["logoutTime"].ToString()); | 289 | retval.logoutTime = Convert.ToInt32(reader["logoutTime"].ToString()); |
290 | 290 | ||
291 | // Current position | 291 | // Current position |
292 | retval.currentRegion = (string)reader["currentRegion"]; | 292 | retval.currentRegion = (string)reader["currentRegion"]; |
293 | retval.currentHandle = Convert.ToUInt64(reader["currentHandle"].ToString()); | 293 | retval.currentHandle = Convert.ToUInt64(reader["currentHandle"].ToString()); |
294 | LLVector3.TryParse((string)reader["currentPos"], out retval.currentPos); | 294 | LLVector3.TryParse((string)reader["currentPos"], out retval.currentPos); |
295 | } | 295 | } |
296 | else | 296 | else |
297 | { | 297 | { |
298 | return null; | 298 | return null; |
299 | } | 299 | } |
300 | return retval; | 300 | return retval; |
301 | } | 301 | } |
302 | 302 | ||
303 | /// <summary> | 303 | /// <summary> |
304 | /// Reads a user profile from an active data reader | 304 | /// Reads a user profile from an active data reader |
305 | /// </summary> | 305 | /// </summary> |
306 | /// <param name="reader">An active database reader</param> | 306 | /// <param name="reader">An active database reader</param> |
307 | /// <returns>A user profile</returns> | 307 | /// <returns>A user profile</returns> |
308 | public UserProfileData readUserRow(IDataReader reader) | 308 | public UserProfileData readUserRow(IDataReader reader) |
309 | { | 309 | { |
310 | UserProfileData retval = new UserProfileData(); | 310 | UserProfileData retval = new UserProfileData(); |
311 | 311 | ||
312 | if (reader.Read()) | 312 | if (reader.Read()) |
313 | { | 313 | { |
314 | retval.UUID = new LLUUID((string)reader["UUID"]); | 314 | retval.UUID = new LLUUID((string)reader["UUID"]); |
315 | retval.username = (string)reader["username"]; | 315 | retval.username = (string)reader["username"]; |
316 | retval.surname = (string)reader["lastname"]; | 316 | retval.surname = (string)reader["lastname"]; |
317 | 317 | ||
318 | retval.passwordHash = (string)reader["passwordHash"]; | 318 | retval.passwordHash = (string)reader["passwordHash"]; |
319 | retval.passwordSalt = (string)reader["passwordSalt"]; | 319 | retval.passwordSalt = (string)reader["passwordSalt"]; |
320 | 320 | ||
321 | retval.homeRegion = Convert.ToUInt64(reader["homeRegion"].ToString()); | 321 | retval.homeRegion = Convert.ToUInt64(reader["homeRegion"].ToString()); |
322 | retval.homeLocation = new LLVector3( | 322 | retval.homeLocation = new LLVector3( |
323 | Convert.ToSingle(reader["homeLocationX"].ToString()), | 323 | Convert.ToSingle(reader["homeLocationX"].ToString()), |
324 | Convert.ToSingle(reader["homeLocationY"].ToString()), | 324 | Convert.ToSingle(reader["homeLocationY"].ToString()), |
325 | Convert.ToSingle(reader["homeLocationZ"].ToString())); | 325 | Convert.ToSingle(reader["homeLocationZ"].ToString())); |
326 | retval.homeLookAt = new LLVector3( | 326 | retval.homeLookAt = new LLVector3( |
327 | Convert.ToSingle(reader["homeLookAtX"].ToString()), | 327 | Convert.ToSingle(reader["homeLookAtX"].ToString()), |
328 | Convert.ToSingle(reader["homeLookAtY"].ToString()), | 328 | Convert.ToSingle(reader["homeLookAtY"].ToString()), |
329 | Convert.ToSingle(reader["homeLookAtZ"].ToString())); | 329 | Convert.ToSingle(reader["homeLookAtZ"].ToString())); |
330 | 330 | ||
331 | retval.created = Convert.ToInt32(reader["created"].ToString()); | 331 | retval.created = Convert.ToInt32(reader["created"].ToString()); |
332 | retval.lastLogin = Convert.ToInt32(reader["lastLogin"].ToString()); | 332 | retval.lastLogin = Convert.ToInt32(reader["lastLogin"].ToString()); |
333 | 333 | ||
334 | retval.userInventoryURI = (string)reader["userInventoryURI"]; | 334 | retval.userInventoryURI = (string)reader["userInventoryURI"]; |
335 | retval.userAssetURI = (string)reader["userAssetURI"]; | 335 | retval.userAssetURI = (string)reader["userAssetURI"]; |
336 | 336 | ||
337 | retval.profileCanDoMask = Convert.ToUInt32(reader["profileCanDoMask"].ToString()); | 337 | retval.profileCanDoMask = Convert.ToUInt32(reader["profileCanDoMask"].ToString()); |
338 | retval.profileWantDoMask = Convert.ToUInt32(reader["profileWantDoMask"].ToString()); | 338 | retval.profileWantDoMask = Convert.ToUInt32(reader["profileWantDoMask"].ToString()); |
339 | 339 | ||
340 | retval.profileAboutText = (string)reader["profileAboutText"]; | 340 | retval.profileAboutText = (string)reader["profileAboutText"]; |
341 | retval.profileFirstText = (string)reader["profileFirstText"]; | 341 | retval.profileFirstText = (string)reader["profileFirstText"]; |
342 | 342 | ||
343 | retval.profileImage = new LLUUID((string)reader["profileImage"]); | 343 | retval.profileImage = new LLUUID((string)reader["profileImage"]); |
344 | retval.profileFirstImage = new LLUUID((string)reader["profileFirstImage"]); | 344 | retval.profileFirstImage = new LLUUID((string)reader["profileFirstImage"]); |
345 | 345 | ||
346 | } | 346 | } |
347 | else | 347 | else |
348 | { | 348 | { |
349 | return null; | 349 | return null; |
350 | } | 350 | } |
351 | return retval; | 351 | return retval; |
352 | } | 352 | } |
353 | 353 | ||
354 | /// <summary> | 354 | /// <summary> |
355 | /// Reads a list of inventory folders returned by a query. | 355 | /// Reads a list of inventory folders returned by a query. |
356 | /// </summary> | 356 | /// </summary> |
357 | /// <param name="reader">A MySQL Data Reader</param> | 357 | /// <param name="reader">A MySQL Data Reader</param> |
358 | /// <returns>A List containing inventory folders</returns> | 358 | /// <returns>A List containing inventory folders</returns> |
359 | public List<InventoryFolderBase> readInventoryFolders(IDataReader reader) | 359 | public List<InventoryFolderBase> readInventoryFolders(IDataReader reader) |
360 | { | 360 | { |
361 | List<InventoryFolderBase> rows = new List<InventoryFolderBase>(); | 361 | List<InventoryFolderBase> rows = new List<InventoryFolderBase>(); |
362 | 362 | ||
363 | while(reader.Read()) | 363 | while(reader.Read()) |
364 | { | 364 | { |
365 | try | 365 | try |
366 | { | 366 | { |
367 | InventoryFolderBase folder = new InventoryFolderBase(); | 367 | InventoryFolderBase folder = new InventoryFolderBase(); |
368 | 368 | ||
369 | folder.agentID = new LLUUID((string)reader["agentID"]); | 369 | folder.agentID = new LLUUID((string)reader["agentID"]); |
370 | folder.parentID = new LLUUID((string)reader["parentFolderID"]); | 370 | folder.parentID = new LLUUID((string)reader["parentFolderID"]); |
371 | folder.folderID = new LLUUID((string)reader["folderID"]); | 371 | folder.folderID = new LLUUID((string)reader["folderID"]); |
372 | folder.name = (string)reader["folderName"]; | 372 | folder.name = (string)reader["folderName"]; |
373 | 373 | ||
374 | rows.Add(folder); | 374 | rows.Add(folder); |
375 | } | 375 | } |
376 | catch (Exception e) | 376 | catch (Exception e) |
377 | { | 377 | { |
378 | Console.WriteLine(e.ToString()); | 378 | Console.WriteLine(e.ToString()); |
379 | } | 379 | } |
380 | } | 380 | } |
381 | 381 | ||
382 | return rows; | 382 | return rows; |
383 | } | 383 | } |
384 | 384 | ||
385 | /// <summary> | 385 | /// <summary> |
386 | /// Reads a collection of items from an SQL result | 386 | /// Reads a collection of items from an SQL result |
387 | /// </summary> | 387 | /// </summary> |
388 | /// <param name="reader">The SQL Result</param> | 388 | /// <param name="reader">The SQL Result</param> |
389 | /// <returns>A List containing Inventory Items</returns> | 389 | /// <returns>A List containing Inventory Items</returns> |
390 | public List<InventoryItemBase> readInventoryItems(IDataReader reader) | 390 | public List<InventoryItemBase> readInventoryItems(IDataReader reader) |
391 | { | 391 | { |
392 | List<InventoryItemBase> rows = new List<InventoryItemBase>(); | 392 | List<InventoryItemBase> rows = new List<InventoryItemBase>(); |
393 | 393 | ||
394 | while (reader.Read()) | 394 | while (reader.Read()) |
395 | { | 395 | { |
396 | try | 396 | try |
397 | { | 397 | { |
398 | InventoryItemBase item = new InventoryItemBase(); | 398 | InventoryItemBase item = new InventoryItemBase(); |
399 | 399 | ||
400 | item.assetID = new LLUUID((string)reader["assetID"]); | 400 | item.assetID = new LLUUID((string)reader["assetID"]); |
401 | item.avatarID = new LLUUID((string)reader["avatarID"]); | 401 | item.avatarID = new LLUUID((string)reader["avatarID"]); |
402 | item.inventoryCurrentPermissions = Convert.ToUInt32(reader["inventoryCurrentPermissions"].ToString()); | 402 | item.inventoryCurrentPermissions = Convert.ToUInt32(reader["inventoryCurrentPermissions"].ToString()); |
403 | item.inventoryDescription = (string)reader["inventoryDescription"]; | 403 | item.inventoryDescription = (string)reader["inventoryDescription"]; |
404 | item.inventoryID = new LLUUID((string)reader["inventoryID"]); | 404 | item.inventoryID = new LLUUID((string)reader["inventoryID"]); |
405 | item.inventoryName = (string)reader["inventoryName"]; | 405 | item.inventoryName = (string)reader["inventoryName"]; |
406 | item.inventoryNextPermissions = Convert.ToUInt32(reader["inventoryNextPermissions"].ToString()); | 406 | item.inventoryNextPermissions = Convert.ToUInt32(reader["inventoryNextPermissions"].ToString()); |
407 | item.parentFolderID = new LLUUID((string)reader["parentFolderID"]); | 407 | item.parentFolderID = new LLUUID((string)reader["parentFolderID"]); |
408 | item.type = Convert.ToInt32(reader["type"].ToString()); | 408 | item.type = Convert.ToInt32(reader["type"].ToString()); |
409 | 409 | ||
410 | rows.Add(item); | 410 | rows.Add(item); |
411 | } | 411 | } |
412 | catch (Exception e) | 412 | catch (Exception e) |
413 | { | 413 | { |
414 | Console.WriteLine(e.ToString()); | 414 | Console.WriteLine(e.ToString()); |
415 | } | 415 | } |
416 | } | 416 | } |
417 | 417 | ||
418 | return rows; | 418 | return rows; |
419 | } | 419 | } |
420 | 420 | ||
421 | /// <summary> | 421 | /// <summary> |
422 | /// Inserts a new row into the log database | 422 | /// Inserts a new row into the log database |
423 | /// </summary> | 423 | /// </summary> |
424 | /// <param name="serverDaemon">The daemon which triggered this event</param> | 424 | /// <param name="serverDaemon">The daemon which triggered this event</param> |
425 | /// <param name="target">Who were we operating on when this occured (region UUID, user UUID, etc)</param> | 425 | /// <param name="target">Who were we operating on when this occured (region UUID, user UUID, etc)</param> |
426 | /// <param name="methodCall">The method call where the problem occured</param> | 426 | /// <param name="methodCall">The method call where the problem occured</param> |
427 | /// <param name="arguments">The arguments passed to the method</param> | 427 | /// <param name="arguments">The arguments passed to the method</param> |
428 | /// <param name="priority">How critical is this?</param> | 428 | /// <param name="priority">How critical is this?</param> |
429 | /// <param name="logMessage">Extra message info</param> | 429 | /// <param name="logMessage">Extra message info</param> |
430 | /// <returns>Saved successfully?</returns> | 430 | /// <returns>Saved successfully?</returns> |
431 | public bool insertLogRow(string serverDaemon, string target, string methodCall, string arguments, int priority, string logMessage) | 431 | public bool insertLogRow(string serverDaemon, string target, string methodCall, string arguments, int priority, string logMessage) |
432 | { | 432 | { |
433 | string sql = "INSERT INTO logs (`target`, `server`, `method`, `arguments`, `priority`, `message`) VALUES "; | 433 | string sql = "INSERT INTO logs (`target`, `server`, `method`, `arguments`, `priority`, `message`) VALUES "; |
434 | sql += "(?target, ?server, ?method, ?arguments, ?priority, ?message)"; | 434 | sql += "(?target, ?server, ?method, ?arguments, ?priority, ?message)"; |
435 | 435 | ||
436 | Dictionary<string, string> parameters = new Dictionary<string, string>(); | 436 | Dictionary<string, string> parameters = new Dictionary<string, string>(); |
437 | parameters["?server"] = serverDaemon; | 437 | parameters["?server"] = serverDaemon; |
438 | parameters["?target"] = target; | 438 | parameters["?target"] = target; |
439 | parameters["?method"] = methodCall; | 439 | parameters["?method"] = methodCall; |
440 | parameters["?arguments"] = arguments; | 440 | parameters["?arguments"] = arguments; |
441 | parameters["?priority"] = priority.ToString(); | 441 | parameters["?priority"] = priority.ToString(); |
442 | parameters["?message"] = logMessage; | 442 | parameters["?message"] = logMessage; |
443 | 443 | ||
444 | bool returnval = false; | 444 | bool returnval = false; |
445 | 445 | ||
446 | try | 446 | try |
447 | { | 447 | { |
448 | IDbCommand result = Query(sql, parameters); | 448 | IDbCommand result = Query(sql, parameters); |
449 | 449 | ||
450 | if (result.ExecuteNonQuery() == 1) | 450 | if (result.ExecuteNonQuery() == 1) |
451 | returnval = true; | 451 | returnval = true; |
452 | 452 | ||
453 | result.Dispose(); | 453 | result.Dispose(); |
454 | } | 454 | } |
455 | catch (Exception e) | 455 | catch (Exception e) |
456 | { | 456 | { |
457 | Console.WriteLine(e.ToString()); | 457 | Console.WriteLine(e.ToString()); |
458 | return false; | 458 | return false; |
459 | } | 459 | } |
460 | 460 | ||
461 | return returnval; | 461 | return returnval; |
462 | } | 462 | } |
463 | 463 | ||
464 | /// <summary> | 464 | /// <summary> |
465 | /// Inserts a new item into the database | 465 | /// Inserts a new item into the database |
466 | /// </summary> | 466 | /// </summary> |
467 | /// <param name="item">The item</param> | 467 | /// <param name="item">The item</param> |
468 | /// <returns>Success?</returns> | 468 | /// <returns>Success?</returns> |
469 | public bool insertItem(InventoryItemBase item) | 469 | public bool insertItem(InventoryItemBase item) |
470 | { | 470 | { |
471 | string sql = "REPLACE INTO inventoryitems (inventoryID, assetID, type, parentFolderID, avatarID, inventoryName, inventoryDescription, inventoryNextPermissions, inventoryCurrentPermissions) VALUES "; | 471 | string sql = "REPLACE INTO inventoryitems (inventoryID, assetID, type, parentFolderID, avatarID, inventoryName, inventoryDescription, inventoryNextPermissions, inventoryCurrentPermissions) VALUES "; |
472 | sql += "(?inventoryID, ?assetID, ?type, ?parentFolderID, ?avatarID, ?inventoryName, ?inventoryDescription, ?inventoryNextPermissions, ?inventoryCurrentPermissions)"; | 472 | sql += "(?inventoryID, ?assetID, ?type, ?parentFolderID, ?avatarID, ?inventoryName, ?inventoryDescription, ?inventoryNextPermissions, ?inventoryCurrentPermissions)"; |
473 | 473 | ||
474 | Dictionary<string, string> parameters = new Dictionary<string, string>(); | 474 | Dictionary<string, string> parameters = new Dictionary<string, string>(); |
475 | parameters["?inventoryID"] = item.inventoryID.ToStringHyphenated(); | 475 | parameters["?inventoryID"] = item.inventoryID.ToStringHyphenated(); |
476 | parameters["?assetID"] = item.assetID.ToStringHyphenated(); | 476 | parameters["?assetID"] = item.assetID.ToStringHyphenated(); |
477 | parameters["?type"] = item.type.ToString(); | 477 | parameters["?type"] = item.type.ToString(); |
478 | parameters["?parentFolderID"] = item.parentFolderID.ToStringHyphenated(); | 478 | parameters["?parentFolderID"] = item.parentFolderID.ToStringHyphenated(); |
479 | parameters["?avatarID"] = item.avatarID.ToStringHyphenated(); | 479 | parameters["?avatarID"] = item.avatarID.ToStringHyphenated(); |
480 | parameters["?inventoryName"] = item.inventoryName; | 480 | parameters["?inventoryName"] = item.inventoryName; |
481 | parameters["?inventoryDescription"] = item.inventoryDescription; | 481 | parameters["?inventoryDescription"] = item.inventoryDescription; |
482 | parameters["?inventoryNextPermissions"] = item.inventoryNextPermissions.ToString(); | 482 | parameters["?inventoryNextPermissions"] = item.inventoryNextPermissions.ToString(); |
483 | parameters["?inventoryCurrentPermissions"] = item.inventoryCurrentPermissions.ToString(); | 483 | parameters["?inventoryCurrentPermissions"] = item.inventoryCurrentPermissions.ToString(); |
484 | 484 | ||
485 | bool returnval = false; | 485 | bool returnval = false; |
486 | 486 | ||
487 | try | 487 | try |
488 | { | 488 | { |
489 | IDbCommand result = Query(sql, parameters); | 489 | IDbCommand result = Query(sql, parameters); |
490 | 490 | ||
491 | if (result.ExecuteNonQuery() == 1) | 491 | if (result.ExecuteNonQuery() == 1) |
492 | returnval = true; | 492 | returnval = true; |
493 | 493 | ||
494 | result.Dispose(); | 494 | result.Dispose(); |
495 | } | 495 | } |
496 | catch (Exception e) | 496 | catch (Exception e) |
497 | { | 497 | { |
498 | Console.WriteLine(e.ToString()); | 498 | Console.WriteLine(e.ToString()); |
499 | return false; | 499 | return false; |
500 | } | 500 | } |
501 | 501 | ||
502 | return returnval; | 502 | return returnval; |
503 | } | 503 | } |
504 | 504 | ||
505 | /// <summary> | 505 | /// <summary> |
506 | /// Inserts a new folder into the database | 506 | /// Inserts a new folder into the database |
507 | /// </summary> | 507 | /// </summary> |
508 | /// <param name="folder">The folder</param> | 508 | /// <param name="folder">The folder</param> |
509 | /// <returns>Success?</returns> | 509 | /// <returns>Success?</returns> |
510 | public bool insertFolder(InventoryFolderBase folder) | 510 | public bool insertFolder(InventoryFolderBase folder) |
511 | { | 511 | { |
512 | string sql = "REPLACE INTO inventoryfolders (folderID, agentID, parentFolderID, folderName) VALUES "; | 512 | string sql = "REPLACE INTO inventoryfolders (folderID, agentID, parentFolderID, folderName) VALUES "; |
513 | sql += "(?folderID, ?agentID, ?parentFolderID, ?folderName)"; | 513 | sql += "(?folderID, ?agentID, ?parentFolderID, ?folderName)"; |
514 | 514 | ||
515 | Dictionary<string, string> parameters = new Dictionary<string, string>(); | 515 | Dictionary<string, string> parameters = new Dictionary<string, string>(); |
516 | parameters["?folderID"] = folder.folderID.ToStringHyphenated(); | 516 | parameters["?folderID"] = folder.folderID.ToStringHyphenated(); |
517 | parameters["?agentID"] = folder.agentID.ToStringHyphenated(); | 517 | parameters["?agentID"] = folder.agentID.ToStringHyphenated(); |
518 | parameters["?parentFolderID"] = folder.parentID.ToStringHyphenated(); | 518 | parameters["?parentFolderID"] = folder.parentID.ToStringHyphenated(); |
519 | parameters["?folderName"] = folder.name; | 519 | parameters["?folderName"] = folder.name; |
520 | 520 | ||
521 | bool returnval = false; | 521 | bool returnval = false; |
522 | try | 522 | try |
523 | { | 523 | { |
524 | IDbCommand result = Query(sql, parameters); | 524 | IDbCommand result = Query(sql, parameters); |
525 | 525 | ||
526 | if (result.ExecuteNonQuery() == 1) | 526 | if (result.ExecuteNonQuery() == 1) |
527 | returnval = true; | 527 | returnval = true; |
528 | 528 | ||
529 | result.Dispose(); | 529 | result.Dispose(); |
530 | } | 530 | } |
531 | catch (Exception e) | 531 | catch (Exception e) |
532 | { | 532 | { |
533 | Console.WriteLine(e.ToString()); | 533 | Console.WriteLine(e.ToString()); |
534 | return false; | 534 | return false; |
535 | } | 535 | } |
536 | return returnval; | 536 | return returnval; |
537 | } | 537 | } |
538 | 538 | ||
539 | /// <summary> | 539 | /// <summary> |
540 | /// Inserts a new region into the database | 540 | /// Inserts a new region into the database |
541 | /// </summary> | 541 | /// </summary> |
542 | /// <param name="profile">The region to insert</param> | 542 | /// <param name="profile">The region to insert</param> |
543 | /// <returns>Success?</returns> | 543 | /// <returns>Success?</returns> |
544 | public bool insertRegion(SimProfileData regiondata) | 544 | public bool insertRegion(SimProfileData regiondata) |
545 | { | 545 | { |
546 | string sql = "REPLACE INTO regions (regionHandle, regionName, uuid, regionRecvKey, regionSecret, regionSendKey, regionDataURI, "; | 546 | string sql = "REPLACE INTO regions (regionHandle, regionName, uuid, regionRecvKey, regionSecret, regionSendKey, regionDataURI, "; |
547 | sql += "serverIP, serverPort, serverURI, locX, locY, locZ, eastOverrideHandle, westOverrideHandle, southOverrideHandle, northOverrideHandle, regionAssetURI, regionAssetRecvKey, "; | 547 | sql += "serverIP, serverPort, serverURI, locX, locY, locZ, eastOverrideHandle, westOverrideHandle, southOverrideHandle, northOverrideHandle, regionAssetURI, regionAssetRecvKey, "; |
548 | sql += "regionAssetSendKey, regionUserURI, regionUserRecvKey, regionUserSendKey, regionMapTexture, serverHttpPort, serverRemotingPort) VALUES "; | 548 | sql += "regionAssetSendKey, regionUserURI, regionUserRecvKey, regionUserSendKey, regionMapTexture, serverHttpPort, serverRemotingPort) VALUES "; |
549 | 549 | ||
550 | sql += "(?regionHandle, ?regionName, ?uuid, ?regionRecvKey, ?regionSecret, ?regionSendKey, ?regionDataURI, "; | 550 | sql += "(?regionHandle, ?regionName, ?uuid, ?regionRecvKey, ?regionSecret, ?regionSendKey, ?regionDataURI, "; |
551 | sql += "?serverIP, ?serverPort, ?serverURI, ?locX, ?locY, ?locZ, ?eastOverrideHandle, ?westOverrideHandle, ?southOverrideHandle, ?northOverrideHandle, ?regionAssetURI, ?regionAssetRecvKey, "; | 551 | sql += "?serverIP, ?serverPort, ?serverURI, ?locX, ?locY, ?locZ, ?eastOverrideHandle, ?westOverrideHandle, ?southOverrideHandle, ?northOverrideHandle, ?regionAssetURI, ?regionAssetRecvKey, "; |
552 | sql += "?regionAssetSendKey, ?regionUserURI, ?regionUserRecvKey, ?regionUserSendKey, ?regionMapTexture, ?serverHttpPort, ?serverRemotingPort);"; | 552 | sql += "?regionAssetSendKey, ?regionUserURI, ?regionUserRecvKey, ?regionUserSendKey, ?regionMapTexture, ?serverHttpPort, ?serverRemotingPort);"; |
553 | 553 | ||
554 | Dictionary<string, string> parameters = new Dictionary<string, string>(); | 554 | Dictionary<string, string> parameters = new Dictionary<string, string>(); |
555 | 555 | ||
556 | parameters["?regionHandle"] = regiondata.regionHandle.ToString(); | 556 | parameters["?regionHandle"] = regiondata.regionHandle.ToString(); |
557 | parameters["?regionName"] = regiondata.regionName.ToString(); | 557 | parameters["?regionName"] = regiondata.regionName.ToString(); |
558 | parameters["?uuid"] = regiondata.UUID.ToStringHyphenated(); | 558 | parameters["?uuid"] = regiondata.UUID.ToStringHyphenated(); |
559 | parameters["?regionRecvKey"] = regiondata.regionRecvKey.ToString(); | 559 | parameters["?regionRecvKey"] = regiondata.regionRecvKey.ToString(); |
560 | parameters["?regionSecret"] = regiondata.regionSecret.ToString(); | 560 | parameters["?regionSecret"] = regiondata.regionSecret.ToString(); |
561 | parameters["?regionSendKey"] = regiondata.regionSendKey.ToString(); | 561 | parameters["?regionSendKey"] = regiondata.regionSendKey.ToString(); |
562 | parameters["?regionDataURI"] = regiondata.regionDataURI.ToString(); | 562 | parameters["?regionDataURI"] = regiondata.regionDataURI.ToString(); |
563 | parameters["?serverIP"] = regiondata.serverIP.ToString(); | 563 | parameters["?serverIP"] = regiondata.serverIP.ToString(); |
564 | parameters["?serverPort"] = regiondata.serverPort.ToString(); | 564 | parameters["?serverPort"] = regiondata.serverPort.ToString(); |
565 | parameters["?serverURI"] = regiondata.serverURI.ToString(); | 565 | parameters["?serverURI"] = regiondata.serverURI.ToString(); |
566 | parameters["?locX"] = regiondata.regionLocX.ToString(); | 566 | parameters["?locX"] = regiondata.regionLocX.ToString(); |
567 | parameters["?locY"] = regiondata.regionLocY.ToString(); | 567 | parameters["?locY"] = regiondata.regionLocY.ToString(); |
568 | parameters["?locZ"] = regiondata.regionLocZ.ToString(); | 568 | parameters["?locZ"] = regiondata.regionLocZ.ToString(); |
569 | parameters["?eastOverrideHandle"] = regiondata.regionEastOverrideHandle.ToString(); | 569 | parameters["?eastOverrideHandle"] = regiondata.regionEastOverrideHandle.ToString(); |
570 | parameters["?westOverrideHandle"] = regiondata.regionWestOverrideHandle.ToString(); | 570 | parameters["?westOverrideHandle"] = regiondata.regionWestOverrideHandle.ToString(); |
571 | parameters["?northOverrideHandle"] = regiondata.regionNorthOverrideHandle.ToString(); | 571 | parameters["?northOverrideHandle"] = regiondata.regionNorthOverrideHandle.ToString(); |
572 | parameters["?southOverrideHandle"] = regiondata.regionSouthOverrideHandle.ToString(); | 572 | parameters["?southOverrideHandle"] = regiondata.regionSouthOverrideHandle.ToString(); |
573 | parameters["?regionAssetURI"] = regiondata.regionAssetURI.ToString(); | 573 | parameters["?regionAssetURI"] = regiondata.regionAssetURI.ToString(); |
574 | parameters["?regionAssetRecvKey"] = regiondata.regionAssetRecvKey.ToString(); | 574 | parameters["?regionAssetRecvKey"] = regiondata.regionAssetRecvKey.ToString(); |
575 | parameters["?regionAssetSendKey"] = regiondata.regionAssetSendKey.ToString(); | 575 | parameters["?regionAssetSendKey"] = regiondata.regionAssetSendKey.ToString(); |
576 | parameters["?regionUserURI"] = regiondata.regionUserURI.ToString(); | 576 | parameters["?regionUserURI"] = regiondata.regionUserURI.ToString(); |
577 | parameters["?regionUserRecvKey"] = regiondata.regionUserRecvKey.ToString(); | 577 | parameters["?regionUserRecvKey"] = regiondata.regionUserRecvKey.ToString(); |
578 | parameters["?regionUserSendKey"] = regiondata.regionUserSendKey.ToString(); | 578 | parameters["?regionUserSendKey"] = regiondata.regionUserSendKey.ToString(); |
579 | parameters["?regionMapTexture"] = regiondata.regionMapTextureID.ToStringHyphenated(); | 579 | parameters["?regionMapTexture"] = regiondata.regionMapTextureID.ToStringHyphenated(); |
580 | parameters["?serverHttpPort"] = regiondata.httpPort.ToString(); | 580 | parameters["?serverHttpPort"] = regiondata.httpPort.ToString(); |
581 | parameters["?serverRemotingPort"] = regiondata.remotingPort.ToString(); | 581 | parameters["?serverRemotingPort"] = regiondata.remotingPort.ToString(); |
582 | 582 | ||
583 | bool returnval = false; | 583 | bool returnval = false; |
584 | 584 | ||
585 | try | 585 | try |
586 | { | 586 | { |
587 | 587 | ||
588 | IDbCommand result = Query(sql, parameters); | 588 | IDbCommand result = Query(sql, parameters); |
589 | 589 | ||
590 | //Console.WriteLine(result.CommandText); | 590 | //Console.WriteLine(result.CommandText); |
591 | 591 | ||
592 | if (result.ExecuteNonQuery() == 1) | 592 | if (result.ExecuteNonQuery() == 1) |
593 | returnval = true; | 593 | returnval = true; |
594 | 594 | ||
595 | result.Dispose(); | 595 | result.Dispose(); |
596 | } | 596 | } |
597 | catch (Exception e) | 597 | catch (Exception e) |
598 | { | 598 | { |
599 | Console.WriteLine(e.ToString()); | 599 | Console.WriteLine(e.ToString()); |
600 | return false; | 600 | return false; |
601 | } | 601 | } |
602 | 602 | ||
603 | return returnval; | 603 | return returnval; |
604 | } | 604 | } |
605 | } | 605 | } |
606 | } | 606 | } |
diff --git a/OpenSim/Framework/Data.MySQL/MySQLUserData.cs b/OpenSim/Framework/Data.MySQL/MySQLUserData.cs index c116536..b044bdd 100644 --- a/OpenSim/Framework/Data.MySQL/MySQLUserData.cs +++ b/OpenSim/Framework/Data.MySQL/MySQLUserData.cs | |||
@@ -1,256 +1,256 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Data; | 30 | using System.Data; |
31 | using libsecondlife; | 31 | using libsecondlife; |
32 | 32 | ||
33 | namespace OpenSim.Framework.Data.MySQL | 33 | namespace OpenSim.Framework.Data.MySQL |
34 | { | 34 | { |
35 | /// <summary> | 35 | /// <summary> |
36 | /// A database interface class to a user profile storage system | 36 | /// A database interface class to a user profile storage system |
37 | /// </summary> | 37 | /// </summary> |
38 | class MySQLUserData : IUserData | 38 | class MySQLUserData : IUserData |
39 | { | 39 | { |
40 | /// <summary> | 40 | /// <summary> |
41 | /// Database manager for MySQL | 41 | /// Database manager for MySQL |
42 | /// </summary> | 42 | /// </summary> |
43 | public MySQLManager database; | 43 | public MySQLManager database; |
44 | 44 | ||
45 | /// <summary> | 45 | /// <summary> |
46 | /// Loads and initialises the MySQL storage plugin | 46 | /// Loads and initialises the MySQL storage plugin |
47 | /// </summary> | 47 | /// </summary> |
48 | public void Initialise() | 48 | public void Initialise() |
49 | { | 49 | { |
50 | // Load from an INI file connection details | 50 | // Load from an INI file connection details |
51 | // TODO: move this to XML? | 51 | // TODO: move this to XML? |
52 | IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini"); | 52 | IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini"); |
53 | string settingHostname = GridDataMySqlFile.ParseFileReadValue("hostname"); | 53 | string settingHostname = GridDataMySqlFile.ParseFileReadValue("hostname"); |
54 | string settingDatabase = GridDataMySqlFile.ParseFileReadValue("database"); | 54 | string settingDatabase = GridDataMySqlFile.ParseFileReadValue("database"); |
55 | string settingUsername = GridDataMySqlFile.ParseFileReadValue("username"); | 55 | string settingUsername = GridDataMySqlFile.ParseFileReadValue("username"); |
56 | string settingPassword = GridDataMySqlFile.ParseFileReadValue("password"); | 56 | string settingPassword = GridDataMySqlFile.ParseFileReadValue("password"); |
57 | string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling"); | 57 | string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling"); |
58 | string settingPort = GridDataMySqlFile.ParseFileReadValue("port"); | 58 | string settingPort = GridDataMySqlFile.ParseFileReadValue("port"); |
59 | 59 | ||
60 | database = new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, settingPort); | 60 | database = new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, settingPort); |
61 | } | 61 | } |
62 | 62 | ||
63 | /// <summary> | 63 | /// <summary> |
64 | /// Searches the database for a specified user profile | 64 | /// Searches the database for a specified user profile |
65 | /// </summary> | 65 | /// </summary> |
66 | /// <param name="name">The account name of the user</param> | 66 | /// <param name="name">The account name of the user</param> |
67 | /// <returns>A user profile</returns> | 67 | /// <returns>A user profile</returns> |
68 | public UserProfileData getUserByName(string name) | 68 | public UserProfileData getUserByName(string name) |
69 | { | 69 | { |
70 | return getUserByName(name.Split(' ')[0], name.Split(' ')[1]); | 70 | return getUserByName(name.Split(' ')[0], name.Split(' ')[1]); |
71 | } | 71 | } |
72 | 72 | ||
73 | /// <summary> | 73 | /// <summary> |
74 | /// Searches the database for a specified user profile by name components | 74 | /// Searches the database for a specified user profile by name components |
75 | /// </summary> | 75 | /// </summary> |
76 | /// <param name="user">The first part of the account name</param> | 76 | /// <param name="user">The first part of the account name</param> |
77 | /// <param name="last">The second part of the account name</param> | 77 | /// <param name="last">The second part of the account name</param> |
78 | /// <returns>A user profile</returns> | 78 | /// <returns>A user profile</returns> |
79 | public UserProfileData getUserByName(string user, string last) | 79 | public UserProfileData getUserByName(string user, string last) |
80 | { | 80 | { |
81 | try | 81 | try |
82 | { | 82 | { |
83 | lock (database) | 83 | lock (database) |
84 | { | 84 | { |
85 | Dictionary<string, string> param = new Dictionary<string, string>(); | 85 | Dictionary<string, string> param = new Dictionary<string, string>(); |
86 | param["?first"] = user; | 86 | param["?first"] = user; |
87 | param["?second"] = last; | 87 | param["?second"] = last; |
88 | 88 | ||
89 | IDbCommand result = database.Query("SELECT * FROM users WHERE username = ?first AND lastname = ?second", param); | 89 | IDbCommand result = database.Query("SELECT * FROM users WHERE username = ?first AND lastname = ?second", param); |
90 | IDataReader reader = result.ExecuteReader(); | 90 | IDataReader reader = result.ExecuteReader(); |
91 | 91 | ||
92 | UserProfileData row = database.readUserRow(reader); | 92 | UserProfileData row = database.readUserRow(reader); |
93 | 93 | ||
94 | reader.Close(); | 94 | reader.Close(); |
95 | result.Dispose(); | 95 | result.Dispose(); |
96 | 96 | ||
97 | return row; | 97 | return row; |
98 | } | 98 | } |
99 | } | 99 | } |
100 | catch (Exception e) | 100 | catch (Exception e) |
101 | { | 101 | { |
102 | database.Reconnect(); | 102 | database.Reconnect(); |
103 | Console.WriteLine(e.ToString()); | 103 | Console.WriteLine(e.ToString()); |
104 | return null; | 104 | return null; |
105 | } | 105 | } |
106 | } | 106 | } |
107 | 107 | ||
108 | /// <summary> | 108 | /// <summary> |
109 | /// Searches the database for a specified user profile by UUID | 109 | /// Searches the database for a specified user profile by UUID |
110 | /// </summary> | 110 | /// </summary> |
111 | /// <param name="uuid">The account ID</param> | 111 | /// <param name="uuid">The account ID</param> |
112 | /// <returns>The users profile</returns> | 112 | /// <returns>The users profile</returns> |
113 | public UserProfileData getUserByUUID(LLUUID uuid) | 113 | public UserProfileData getUserByUUID(LLUUID uuid) |
114 | { | 114 | { |
115 | try | 115 | try |
116 | { | 116 | { |
117 | lock (database) | 117 | lock (database) |
118 | { | 118 | { |
119 | Dictionary<string, string> param = new Dictionary<string, string>(); | 119 | Dictionary<string, string> param = new Dictionary<string, string>(); |
120 | param["?uuid"] = uuid.ToStringHyphenated(); | 120 | param["?uuid"] = uuid.ToStringHyphenated(); |
121 | 121 | ||
122 | IDbCommand result = database.Query("SELECT * FROM users WHERE UUID = ?uuid", param); | 122 | IDbCommand result = database.Query("SELECT * FROM users WHERE UUID = ?uuid", param); |
123 | IDataReader reader = result.ExecuteReader(); | 123 | IDataReader reader = result.ExecuteReader(); |
124 | 124 | ||
125 | UserProfileData row = database.readUserRow(reader); | 125 | UserProfileData row = database.readUserRow(reader); |
126 | 126 | ||
127 | reader.Close(); | 127 | reader.Close(); |
128 | result.Dispose(); | 128 | result.Dispose(); |
129 | 129 | ||
130 | return row; | 130 | return row; |
131 | } | 131 | } |
132 | } | 132 | } |
133 | catch (Exception e) | 133 | catch (Exception e) |
134 | { | 134 | { |
135 | database.Reconnect(); | 135 | database.Reconnect(); |
136 | Console.WriteLine(e.ToString()); | 136 | Console.WriteLine(e.ToString()); |
137 | return null; | 137 | return null; |
138 | } | 138 | } |
139 | } | 139 | } |
140 | 140 | ||
141 | /// <summary> | 141 | /// <summary> |
142 | /// Returns a user session searching by name | 142 | /// Returns a user session searching by name |
143 | /// </summary> | 143 | /// </summary> |
144 | /// <param name="name">The account name</param> | 144 | /// <param name="name">The account name</param> |
145 | /// <returns>The users session</returns> | 145 | /// <returns>The users session</returns> |
146 | public UserAgentData getAgentByName(string name) | 146 | public UserAgentData getAgentByName(string name) |
147 | { | 147 | { |
148 | return getAgentByName(name.Split(' ')[0], name.Split(' ')[1]); | 148 | return getAgentByName(name.Split(' ')[0], name.Split(' ')[1]); |
149 | } | 149 | } |
150 | 150 | ||
151 | /// <summary> | 151 | /// <summary> |
152 | /// Returns a user session by account name | 152 | /// Returns a user session by account name |
153 | /// </summary> | 153 | /// </summary> |
154 | /// <param name="user">First part of the users account name</param> | 154 | /// <param name="user">First part of the users account name</param> |
155 | /// <param name="last">Second part of the users account name</param> | 155 | /// <param name="last">Second part of the users account name</param> |
156 | /// <returns>The users session</returns> | 156 | /// <returns>The users session</returns> |
157 | public UserAgentData getAgentByName(string user, string last) | 157 | public UserAgentData getAgentByName(string user, string last) |
158 | { | 158 | { |
159 | UserProfileData profile = getUserByName(user, last); | 159 | UserProfileData profile = getUserByName(user, last); |
160 | return getAgentByUUID(profile.UUID); | 160 | return getAgentByUUID(profile.UUID); |
161 | } | 161 | } |
162 | 162 | ||
163 | /// <summary> | 163 | /// <summary> |
164 | /// Returns an agent session by account UUID | 164 | /// Returns an agent session by account UUID |
165 | /// </summary> | 165 | /// </summary> |
166 | /// <param name="uuid">The accounts UUID</param> | 166 | /// <param name="uuid">The accounts UUID</param> |
167 | /// <returns>The users session</returns> | 167 | /// <returns>The users session</returns> |
168 | public UserAgentData getAgentByUUID(LLUUID uuid) | 168 | public UserAgentData getAgentByUUID(LLUUID uuid) |
169 | { | 169 | { |
170 | try | 170 | try |
171 | { | 171 | { |
172 | lock (database) | 172 | lock (database) |
173 | { | 173 | { |
174 | Dictionary<string, string> param = new Dictionary<string, string>(); | 174 | Dictionary<string, string> param = new Dictionary<string, string>(); |
175 | param["?uuid"] = uuid.ToStringHyphenated(); | 175 | param["?uuid"] = uuid.ToStringHyphenated(); |
176 | 176 | ||
177 | IDbCommand result = database.Query("SELECT * FROM agents WHERE UUID = ?uuid", param); | 177 | IDbCommand result = database.Query("SELECT * FROM agents WHERE UUID = ?uuid", param); |
178 | IDataReader reader = result.ExecuteReader(); | 178 | IDataReader reader = result.ExecuteReader(); |
179 | 179 | ||
180 | UserAgentData row = database.readAgentRow(reader); | 180 | UserAgentData row = database.readAgentRow(reader); |
181 | 181 | ||
182 | reader.Close(); | 182 | reader.Close(); |
183 | result.Dispose(); | 183 | result.Dispose(); |
184 | 184 | ||
185 | return row; | 185 | return row; |
186 | } | 186 | } |
187 | } | 187 | } |
188 | catch (Exception e) | 188 | catch (Exception e) |
189 | { | 189 | { |
190 | database.Reconnect(); | 190 | database.Reconnect(); |
191 | Console.WriteLine(e.ToString()); | 191 | Console.WriteLine(e.ToString()); |
192 | return null; | 192 | return null; |
193 | } | 193 | } |
194 | } | 194 | } |
195 | 195 | ||
196 | /// <summary> | 196 | /// <summary> |
197 | /// Creates a new users profile | 197 | /// Creates a new users profile |
198 | /// </summary> | 198 | /// </summary> |
199 | /// <param name="user">The user profile to create</param> | 199 | /// <param name="user">The user profile to create</param> |
200 | public void addNewUserProfile(UserProfileData user) | 200 | public void addNewUserProfile(UserProfileData user) |
201 | { | 201 | { |
202 | } | 202 | } |
203 | 203 | ||
204 | /// <summary> | 204 | /// <summary> |
205 | /// Creates a new agent | 205 | /// Creates a new agent |
206 | /// </summary> | 206 | /// </summary> |
207 | /// <param name="agent">The agent to create</param> | 207 | /// <param name="agent">The agent to create</param> |
208 | public void addNewUserAgent(UserAgentData agent) | 208 | public void addNewUserAgent(UserAgentData agent) |
209 | { | 209 | { |
210 | // Do nothing. | 210 | // Do nothing. |
211 | } | 211 | } |
212 | 212 | ||
213 | /// <summary> | 213 | /// <summary> |
214 | /// Performs a money transfer request between two accounts | 214 | /// Performs a money transfer request between two accounts |
215 | /// </summary> | 215 | /// </summary> |
216 | /// <param name="from">The senders account ID</param> | 216 | /// <param name="from">The senders account ID</param> |
217 | /// <param name="to">The recievers account ID</param> | 217 | /// <param name="to">The recievers account ID</param> |
218 | /// <param name="amount">The amount to transfer</param> | 218 | /// <param name="amount">The amount to transfer</param> |
219 | /// <returns>Success?</returns> | 219 | /// <returns>Success?</returns> |
220 | public bool moneyTransferRequest(LLUUID from, LLUUID to, uint amount) | 220 | public bool moneyTransferRequest(LLUUID from, LLUUID to, uint amount) |
221 | { | 221 | { |
222 | return false; | 222 | return false; |
223 | } | 223 | } |
224 | 224 | ||
225 | /// <summary> | 225 | /// <summary> |
226 | /// Performs an inventory transfer request between two accounts | 226 | /// Performs an inventory transfer request between two accounts |
227 | /// </summary> | 227 | /// </summary> |
228 | /// <remarks>TODO: Move to inventory server</remarks> | 228 | /// <remarks>TODO: Move to inventory server</remarks> |
229 | /// <param name="from">The senders account ID</param> | 229 | /// <param name="from">The senders account ID</param> |
230 | /// <param name="to">The recievers account ID</param> | 230 | /// <param name="to">The recievers account ID</param> |
231 | /// <param name="item">The item to transfer</param> | 231 | /// <param name="item">The item to transfer</param> |
232 | /// <returns>Success?</returns> | 232 | /// <returns>Success?</returns> |
233 | public bool inventoryTransferRequest(LLUUID from, LLUUID to, LLUUID item) | 233 | public bool inventoryTransferRequest(LLUUID from, LLUUID to, LLUUID item) |
234 | { | 234 | { |
235 | return false; | 235 | return false; |
236 | } | 236 | } |
237 | 237 | ||
238 | /// <summary> | 238 | /// <summary> |
239 | /// Database provider name | 239 | /// Database provider name |
240 | /// </summary> | 240 | /// </summary> |
241 | /// <returns>Provider name</returns> | 241 | /// <returns>Provider name</returns> |
242 | public string getName() | 242 | public string getName() |
243 | { | 243 | { |
244 | return "MySQL Userdata Interface"; | 244 | return "MySQL Userdata Interface"; |
245 | } | 245 | } |
246 | 246 | ||
247 | /// <summary> | 247 | /// <summary> |
248 | /// Database provider version | 248 | /// Database provider version |
249 | /// </summary> | 249 | /// </summary> |
250 | /// <returns>provider version</returns> | 250 | /// <returns>provider version</returns> |
251 | public string getVersion() | 251 | public string getVersion() |
252 | { | 252 | { |
253 | return "0.1"; | 253 | return "0.1"; |
254 | } | 254 | } |
255 | } | 255 | } |
256 | } | 256 | } |
diff --git a/OpenSim/Framework/Data.MySQL/Properties/AssemblyInfo.cs b/OpenSim/Framework/Data.MySQL/Properties/AssemblyInfo.cs index 52d6a54..46c0ae0 100644 --- a/OpenSim/Framework/Data.MySQL/Properties/AssemblyInfo.cs +++ b/OpenSim/Framework/Data.MySQL/Properties/AssemblyInfo.cs | |||
@@ -1,33 +1,33 @@ | |||
1 | using System.Reflection; | 1 | using System.Reflection; |
2 | using System.Runtime.InteropServices; | 2 | using System.Runtime.InteropServices; |
3 | // General Information about an assembly is controlled through the following | 3 | // General Information about an assembly is controlled through the following |
4 | // set of attributes. Change these attribute values to modify the information | 4 | // set of attributes. Change these attribute values to modify the information |
5 | // associated with an assembly. | 5 | // associated with an assembly. |
6 | [assembly: AssemblyTitle("OpenSim.Framework.Data.MySQL")] | 6 | [assembly: AssemblyTitle("OpenSim.Framework.Data.MySQL")] |
7 | [assembly: AssemblyDescription("")] | 7 | [assembly: AssemblyDescription("")] |
8 | [assembly: AssemblyConfiguration("")] | 8 | [assembly: AssemblyConfiguration("")] |
9 | [assembly: AssemblyCompany("")] | 9 | [assembly: AssemblyCompany("")] |
10 | [assembly: AssemblyProduct("OpenSim.Framework.Data.MySQL")] | 10 | [assembly: AssemblyProduct("OpenSim.Framework.Data.MySQL")] |
11 | [assembly: AssemblyCopyright("Copyright © 2007")] | 11 | [assembly: AssemblyCopyright("Copyright © 2007")] |
12 | [assembly: AssemblyTrademark("")] | 12 | [assembly: AssemblyTrademark("")] |
13 | [assembly: AssemblyCulture("")] | 13 | [assembly: AssemblyCulture("")] |
14 | 14 | ||
15 | // Setting ComVisible to false makes the types in this assembly not visible | 15 | // Setting ComVisible to false makes the types in this assembly not visible |
16 | // to COM components. If you need to access a type in this assembly from | 16 | // to COM components. If you need to access a type in this assembly from |
17 | // COM, set the ComVisible attribute to true on that type. | 17 | // COM, set the ComVisible attribute to true on that type. |
18 | [assembly: ComVisible(false)] | 18 | [assembly: ComVisible(false)] |
19 | 19 | ||
20 | // The following GUID is for the ID of the typelib if this project is exposed to COM | 20 | // The following GUID is for the ID of the typelib if this project is exposed to COM |
21 | [assembly: Guid("e49826b2-dcef-41be-a5bd-596733fa3304")] | 21 | [assembly: Guid("e49826b2-dcef-41be-a5bd-596733fa3304")] |
22 | 22 | ||
23 | // Version information for an assembly consists of the following four values: | 23 | // Version information for an assembly consists of the following four values: |
24 | // | 24 | // |
25 | // Major Version | 25 | // Major Version |
26 | // Minor Version | 26 | // Minor Version |
27 | // Build Number | 27 | // Build Number |
28 | // Revision | 28 | // Revision |
29 | // | 29 | // |
30 | // You can specify all the values or you can default the Revision and Build Numbers | 30 | // You can specify all the values or you can default the Revision and Build Numbers |
31 | // by using the '*' as shown below: | 31 | // by using the '*' as shown below: |
32 | [assembly: AssemblyVersion("1.0.0.0")] | 32 | [assembly: AssemblyVersion("1.0.0.0")] |
33 | [assembly: AssemblyFileVersion("1.0.0.0")] | 33 | [assembly: AssemblyFileVersion("1.0.0.0")] |
diff --git a/OpenSim/Framework/Data.SQLite/Properties/AssemblyInfo.cs b/OpenSim/Framework/Data.SQLite/Properties/AssemblyInfo.cs index 9de5edb..8136bc1 100644 --- a/OpenSim/Framework/Data.SQLite/Properties/AssemblyInfo.cs +++ b/OpenSim/Framework/Data.SQLite/Properties/AssemblyInfo.cs | |||
@@ -1,33 +1,33 @@ | |||
1 | using System.Reflection; | 1 | using System.Reflection; |
2 | using System.Runtime.InteropServices; | 2 | using System.Runtime.InteropServices; |
3 | // General Information about an assembly is controlled through the following | 3 | // General Information about an assembly is controlled through the following |
4 | // set of attributes. Change these attribute values to modify the information | 4 | // set of attributes. Change these attribute values to modify the information |
5 | // associated with an assembly. | 5 | // associated with an assembly. |
6 | [assembly: AssemblyTitle("OpenSim.Framework.Data.SQLite")] | 6 | [assembly: AssemblyTitle("OpenSim.Framework.Data.SQLite")] |
7 | [assembly: AssemblyDescription("")] | 7 | [assembly: AssemblyDescription("")] |
8 | [assembly: AssemblyConfiguration("")] | 8 | [assembly: AssemblyConfiguration("")] |
9 | [assembly: AssemblyCompany("")] | 9 | [assembly: AssemblyCompany("")] |
10 | [assembly: AssemblyProduct("OpenSim.Framework.Data.SQLite")] | 10 | [assembly: AssemblyProduct("OpenSim.Framework.Data.SQLite")] |
11 | [assembly: AssemblyCopyright("Copyright © 2007")] | 11 | [assembly: AssemblyCopyright("Copyright © 2007")] |
12 | [assembly: AssemblyTrademark("")] | 12 | [assembly: AssemblyTrademark("")] |
13 | [assembly: AssemblyCulture("")] | 13 | [assembly: AssemblyCulture("")] |
14 | 14 | ||
15 | // Setting ComVisible to false makes the types in this assembly not visible | 15 | // Setting ComVisible to false makes the types in this assembly not visible |
16 | // to COM components. If you need to access a type in this assembly from | 16 | // to COM components. If you need to access a type in this assembly from |
17 | // COM, set the ComVisible attribute to true on that type. | 17 | // COM, set the ComVisible attribute to true on that type. |
18 | [assembly: ComVisible(false)] | 18 | [assembly: ComVisible(false)] |
19 | 19 | ||
20 | // The following GUID is for the ID of the typelib if this project is exposed to COM | 20 | // The following GUID is for the ID of the typelib if this project is exposed to COM |
21 | [assembly: Guid("6113d5ce-4547-49f4-9236-0dcc503457b1")] | 21 | [assembly: Guid("6113d5ce-4547-49f4-9236-0dcc503457b1")] |
22 | 22 | ||
23 | // Version information for an assembly consists of the following four values: | 23 | // Version information for an assembly consists of the following four values: |
24 | // | 24 | // |
25 | // Major Version | 25 | // Major Version |
26 | // Minor Version | 26 | // Minor Version |
27 | // Build Number | 27 | // Build Number |
28 | // Revision | 28 | // Revision |
29 | // | 29 | // |
30 | // You can specify all the values or you can default the Revision and Build Numbers | 30 | // You can specify all the values or you can default the Revision and Build Numbers |
31 | // by using the '*' as shown below: | 31 | // by using the '*' as shown below: |
32 | [assembly: AssemblyVersion("1.0.0.0")] | 32 | [assembly: AssemblyVersion("1.0.0.0")] |
33 | [assembly: AssemblyFileVersion("1.0.0.0")] | 33 | [assembly: AssemblyFileVersion("1.0.0.0")] |
diff --git a/OpenSim/Framework/Data.SQLite/SQLiteGridData.cs b/OpenSim/Framework/Data.SQLite/SQLiteGridData.cs index 511c5f0..c1d74ae 100644 --- a/OpenSim/Framework/Data.SQLite/SQLiteGridData.cs +++ b/OpenSim/Framework/Data.SQLite/SQLiteGridData.cs | |||
@@ -1,197 +1,197 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Data; | 30 | using System.Data; |
31 | using System.Security.Cryptography; | 31 | using System.Security.Cryptography; |
32 | using System.Text; | 32 | using System.Text; |
33 | using libsecondlife; | 33 | using libsecondlife; |
34 | 34 | ||
35 | namespace OpenSim.Framework.Data.SQLite | 35 | namespace OpenSim.Framework.Data.SQLite |
36 | { | 36 | { |
37 | /// <summary> | 37 | /// <summary> |
38 | /// A Grid Interface to the SQLite database | 38 | /// A Grid Interface to the SQLite database |
39 | /// </summary> | 39 | /// </summary> |
40 | public class SQLiteGridData : IGridData | 40 | public class SQLiteGridData : IGridData |
41 | { | 41 | { |
42 | /// <summary> | 42 | /// <summary> |
43 | /// A database manager | 43 | /// A database manager |
44 | /// </summary> | 44 | /// </summary> |
45 | private SQLiteManager database; | 45 | private SQLiteManager database; |
46 | 46 | ||
47 | /// <summary> | 47 | /// <summary> |
48 | /// Initialises the Grid Interface | 48 | /// Initialises the Grid Interface |
49 | /// </summary> | 49 | /// </summary> |
50 | public void Initialise() | 50 | public void Initialise() |
51 | { | 51 | { |
52 | database = new SQLiteManager("localhost", "db", "user", "password", "false"); | 52 | database = new SQLiteManager("localhost", "db", "user", "password", "false"); |
53 | } | 53 | } |
54 | 54 | ||
55 | /// <summary> | 55 | /// <summary> |
56 | /// Shuts down the grid interface | 56 | /// Shuts down the grid interface |
57 | /// </summary> | 57 | /// </summary> |
58 | public void Close() | 58 | public void Close() |
59 | { | 59 | { |
60 | database.Close(); | 60 | database.Close(); |
61 | } | 61 | } |
62 | 62 | ||
63 | /// <summary> | 63 | /// <summary> |
64 | /// Returns the name of this grid interface | 64 | /// Returns the name of this grid interface |
65 | /// </summary> | 65 | /// </summary> |
66 | /// <returns>A string containing the grid interface</returns> | 66 | /// <returns>A string containing the grid interface</returns> |
67 | public string getName() | 67 | public string getName() |
68 | { | 68 | { |
69 | return "SQLite OpenGridData"; | 69 | return "SQLite OpenGridData"; |
70 | } | 70 | } |
71 | 71 | ||
72 | /// <summary> | 72 | /// <summary> |
73 | /// Returns the version of this grid interface | 73 | /// Returns the version of this grid interface |
74 | /// </summary> | 74 | /// </summary> |
75 | /// <returns>A string containing the version</returns> | 75 | /// <returns>A string containing the version</returns> |
76 | public string getVersion() | 76 | public string getVersion() |
77 | { | 77 | { |
78 | return "0.1"; | 78 | return "0.1"; |
79 | } | 79 | } |
80 | 80 | ||
81 | /// <summary> | 81 | /// <summary> |
82 | /// Returns a list of regions within the specified ranges | 82 | /// Returns a list of regions within the specified ranges |
83 | /// </summary> | 83 | /// </summary> |
84 | /// <param name="a">minimum X coordinate</param> | 84 | /// <param name="a">minimum X coordinate</param> |
85 | /// <param name="b">minimum Y coordinate</param> | 85 | /// <param name="b">minimum Y coordinate</param> |
86 | /// <param name="c">maximum X coordinate</param> | 86 | /// <param name="c">maximum X coordinate</param> |
87 | /// <param name="d">maximum Y coordinate</param> | 87 | /// <param name="d">maximum Y coordinate</param> |
88 | /// <returns>An array of region profiles</returns> | 88 | /// <returns>An array of region profiles</returns> |
89 | public SimProfileData[] GetProfilesInRange(uint a, uint b, uint c, uint d) | 89 | public SimProfileData[] GetProfilesInRange(uint a, uint b, uint c, uint d) |
90 | { | 90 | { |
91 | return null; | 91 | return null; |
92 | } | 92 | } |
93 | 93 | ||
94 | /// <summary> | 94 | /// <summary> |
95 | /// Returns a sim profile from it's location | 95 | /// Returns a sim profile from it's location |
96 | /// </summary> | 96 | /// </summary> |
97 | /// <param name="handle">Region location handle</param> | 97 | /// <param name="handle">Region location handle</param> |
98 | /// <returns>Sim profile</returns> | 98 | /// <returns>Sim profile</returns> |
99 | public SimProfileData GetProfileByHandle(ulong handle) | 99 | public SimProfileData GetProfileByHandle(ulong handle) |
100 | { | 100 | { |
101 | Dictionary<string, string> param = new Dictionary<string, string>(); | 101 | Dictionary<string, string> param = new Dictionary<string, string>(); |
102 | param["handle"] = handle.ToString(); | 102 | param["handle"] = handle.ToString(); |
103 | 103 | ||
104 | IDbCommand result = database.Query("SELECT * FROM regions WHERE handle = @handle", param); | 104 | IDbCommand result = database.Query("SELECT * FROM regions WHERE handle = @handle", param); |
105 | IDataReader reader = result.ExecuteReader(); | 105 | IDataReader reader = result.ExecuteReader(); |
106 | 106 | ||
107 | SimProfileData row = database.getRow(reader); | 107 | SimProfileData row = database.getRow(reader); |
108 | reader.Close(); | 108 | reader.Close(); |
109 | result.Dispose(); | 109 | result.Dispose(); |
110 | 110 | ||
111 | return row; | 111 | return row; |
112 | } | 112 | } |
113 | 113 | ||
114 | /// <summary> | 114 | /// <summary> |
115 | /// Returns a sim profile from it's UUID | 115 | /// Returns a sim profile from it's UUID |
116 | /// </summary> | 116 | /// </summary> |
117 | /// <param name="uuid">The region UUID</param> | 117 | /// <param name="uuid">The region UUID</param> |
118 | /// <returns>The sim profile</returns> | 118 | /// <returns>The sim profile</returns> |
119 | public SimProfileData GetProfileByLLUUID(LLUUID uuid) | 119 | public SimProfileData GetProfileByLLUUID(LLUUID uuid) |
120 | { | 120 | { |
121 | Dictionary<string, string> param = new Dictionary<string, string>(); | 121 | Dictionary<string, string> param = new Dictionary<string, string>(); |
122 | param["uuid"] = uuid.ToStringHyphenated(); | 122 | param["uuid"] = uuid.ToStringHyphenated(); |
123 | 123 | ||
124 | IDbCommand result = database.Query("SELECT * FROM regions WHERE uuid = @uuid", param); | 124 | IDbCommand result = database.Query("SELECT * FROM regions WHERE uuid = @uuid", param); |
125 | IDataReader reader = result.ExecuteReader(); | 125 | IDataReader reader = result.ExecuteReader(); |
126 | 126 | ||
127 | SimProfileData row = database.getRow(reader); | 127 | SimProfileData row = database.getRow(reader); |
128 | reader.Close(); | 128 | reader.Close(); |
129 | result.Dispose(); | 129 | result.Dispose(); |
130 | 130 | ||
131 | return row; | 131 | return row; |
132 | } | 132 | } |
133 | 133 | ||
134 | /// <summary> | 134 | /// <summary> |
135 | /// Adds a new specified region to the database | 135 | /// Adds a new specified region to the database |
136 | /// </summary> | 136 | /// </summary> |
137 | /// <param name="profile">The profile to add</param> | 137 | /// <param name="profile">The profile to add</param> |
138 | /// <returns>A dataresponse enum indicating success</returns> | 138 | /// <returns>A dataresponse enum indicating success</returns> |
139 | public DataResponse AddProfile(SimProfileData profile) | 139 | public DataResponse AddProfile(SimProfileData profile) |
140 | { | 140 | { |
141 | if (database.insertRow(profile)) | 141 | if (database.insertRow(profile)) |
142 | { | 142 | { |
143 | return DataResponse.RESPONSE_OK; | 143 | return DataResponse.RESPONSE_OK; |
144 | } | 144 | } |
145 | else | 145 | else |
146 | { | 146 | { |
147 | return DataResponse.RESPONSE_ERROR; | 147 | return DataResponse.RESPONSE_ERROR; |
148 | } | 148 | } |
149 | } | 149 | } |
150 | 150 | ||
151 | /// <summary> | 151 | /// <summary> |
152 | /// DEPRECIATED. Attempts to authenticate a region by comparing a shared secret. | 152 | /// DEPRECIATED. Attempts to authenticate a region by comparing a shared secret. |
153 | /// </summary> | 153 | /// </summary> |
154 | /// <param name="uuid">The UUID of the challenger</param> | 154 | /// <param name="uuid">The UUID of the challenger</param> |
155 | /// <param name="handle">The attempted regionHandle of the challenger</param> | 155 | /// <param name="handle">The attempted regionHandle of the challenger</param> |
156 | /// <param name="authkey">The secret</param> | 156 | /// <param name="authkey">The secret</param> |
157 | /// <returns>Whether the secret and regionhandle match the database entry for UUID</returns> | 157 | /// <returns>Whether the secret and regionhandle match the database entry for UUID</returns> |
158 | public bool AuthenticateSim(LLUUID uuid, ulong handle, string authkey) | 158 | public bool AuthenticateSim(LLUUID uuid, ulong handle, string authkey) |
159 | { | 159 | { |
160 | bool throwHissyFit = false; // Should be true by 1.0 | 160 | bool throwHissyFit = false; // Should be true by 1.0 |
161 | 161 | ||
162 | if (throwHissyFit) | 162 | if (throwHissyFit) |
163 | throw new Exception("CRYPTOWEAK AUTHENTICATE: Refusing to authenticate due to replay potential."); | 163 | throw new Exception("CRYPTOWEAK AUTHENTICATE: Refusing to authenticate due to replay potential."); |
164 | 164 | ||
165 | SimProfileData data = GetProfileByLLUUID(uuid); | 165 | SimProfileData data = GetProfileByLLUUID(uuid); |
166 | 166 | ||
167 | return (handle == data.regionHandle && authkey == data.regionSecret); | 167 | return (handle == data.regionHandle && authkey == data.regionSecret); |
168 | } | 168 | } |
169 | 169 | ||
170 | /// <summary> | 170 | /// <summary> |
171 | /// NOT YET FUNCTIONAL. Provides a cryptographic authentication of a region | 171 | /// NOT YET FUNCTIONAL. Provides a cryptographic authentication of a region |
172 | /// </summary> | 172 | /// </summary> |
173 | /// <remarks>This requires a security audit.</remarks> | 173 | /// <remarks>This requires a security audit.</remarks> |
174 | /// <param name="uuid"></param> | 174 | /// <param name="uuid"></param> |
175 | /// <param name="handle"></param> | 175 | /// <param name="handle"></param> |
176 | /// <param name="authhash"></param> | 176 | /// <param name="authhash"></param> |
177 | /// <param name="challenge"></param> | 177 | /// <param name="challenge"></param> |
178 | /// <returns></returns> | 178 | /// <returns></returns> |
179 | public bool AuthenticateSim(LLUUID uuid, ulong handle, string authhash, string challenge) | 179 | public bool AuthenticateSim(LLUUID uuid, ulong handle, string authhash, string challenge) |
180 | { | 180 | { |
181 | SHA512Managed HashProvider = new SHA512Managed(); | 181 | SHA512Managed HashProvider = new SHA512Managed(); |
182 | ASCIIEncoding TextProvider = new ASCIIEncoding(); | 182 | ASCIIEncoding TextProvider = new ASCIIEncoding(); |
183 | 183 | ||
184 | byte[] stream = TextProvider.GetBytes(uuid.ToStringHyphenated() + ":" + handle.ToString() + ":" + challenge); | 184 | byte[] stream = TextProvider.GetBytes(uuid.ToStringHyphenated() + ":" + handle.ToString() + ":" + challenge); |
185 | byte[] hash = HashProvider.ComputeHash(stream); | 185 | byte[] hash = HashProvider.ComputeHash(stream); |
186 | 186 | ||
187 | return false; | 187 | return false; |
188 | } | 188 | } |
189 | 189 | ||
190 | public ReservationData GetReservationAtPoint(uint x, uint y) | 190 | public ReservationData GetReservationAtPoint(uint x, uint y) |
191 | { | 191 | { |
192 | return null; | 192 | return null; |
193 | } | 193 | } |
194 | } | 194 | } |
195 | 195 | ||
196 | 196 | ||
197 | } | 197 | } |
diff --git a/OpenSim/Framework/Data.SQLite/SQLiteManager.cs b/OpenSim/Framework/Data.SQLite/SQLiteManager.cs index c9931ab..a69611a 100644 --- a/OpenSim/Framework/Data.SQLite/SQLiteManager.cs +++ b/OpenSim/Framework/Data.SQLite/SQLiteManager.cs | |||
@@ -1,206 +1,206 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Data; | 30 | using System.Data; |
31 | using System.Data.SQLite; | 31 | using System.Data.SQLite; |
32 | using libsecondlife; | 32 | using libsecondlife; |
33 | 33 | ||
34 | namespace OpenSim.Framework.Data.SQLite | 34 | namespace OpenSim.Framework.Data.SQLite |
35 | { | 35 | { |
36 | class SQLiteManager | 36 | class SQLiteManager |
37 | { | 37 | { |
38 | IDbConnection dbcon; | 38 | IDbConnection dbcon; |
39 | 39 | ||
40 | /// <summary> | 40 | /// <summary> |
41 | /// Initialises and creates a new SQLite connection and maintains it. | 41 | /// Initialises and creates a new SQLite connection and maintains it. |
42 | /// </summary> | 42 | /// </summary> |
43 | /// <param name="hostname">The SQLite server being connected to</param> | 43 | /// <param name="hostname">The SQLite server being connected to</param> |
44 | /// <param name="database">The name of the SQLite database being used</param> | 44 | /// <param name="database">The name of the SQLite database being used</param> |
45 | /// <param name="username">The username logging into the database</param> | 45 | /// <param name="username">The username logging into the database</param> |
46 | /// <param name="password">The password for the user logging in</param> | 46 | /// <param name="password">The password for the user logging in</param> |
47 | /// <param name="cpooling">Whether to use connection pooling or not, can be one of the following: 'yes', 'true', 'no' or 'false', if unsure use 'false'.</param> | 47 | /// <param name="cpooling">Whether to use connection pooling or not, can be one of the following: 'yes', 'true', 'no' or 'false', if unsure use 'false'.</param> |
48 | public SQLiteManager(string hostname, string database, string username, string password, string cpooling) | 48 | public SQLiteManager(string hostname, string database, string username, string password, string cpooling) |
49 | { | 49 | { |
50 | try | 50 | try |
51 | { | 51 | { |
52 | string connectionString = "URI=file:GridServerSqlite.db;"; | 52 | string connectionString = "URI=file:GridServerSqlite.db;"; |
53 | dbcon = new SQLiteConnection(connectionString); | 53 | dbcon = new SQLiteConnection(connectionString); |
54 | 54 | ||
55 | dbcon.Open(); | 55 | dbcon.Open(); |
56 | } | 56 | } |
57 | catch (Exception e) | 57 | catch (Exception e) |
58 | { | 58 | { |
59 | throw new Exception("Error initialising SQLite Database: " + e.ToString()); | 59 | throw new Exception("Error initialising SQLite Database: " + e.ToString()); |
60 | } | 60 | } |
61 | } | 61 | } |
62 | 62 | ||
63 | /// <summary> | 63 | /// <summary> |
64 | /// Shuts down the database connection | 64 | /// Shuts down the database connection |
65 | /// </summary> | 65 | /// </summary> |
66 | public void Close() | 66 | public void Close() |
67 | { | 67 | { |
68 | dbcon.Close(); | 68 | dbcon.Close(); |
69 | dbcon = null; | 69 | dbcon = null; |
70 | } | 70 | } |
71 | 71 | ||
72 | /// <summary> | 72 | /// <summary> |
73 | /// Runs a query with protection against SQL Injection by using parameterised input. | 73 | /// Runs a query with protection against SQL Injection by using parameterised input. |
74 | /// </summary> | 74 | /// </summary> |
75 | /// <param name="sql">The SQL string - replace any variables such as WHERE x = "y" with WHERE x = @y</param> | 75 | /// <param name="sql">The SQL string - replace any variables such as WHERE x = "y" with WHERE x = @y</param> |
76 | /// <param name="parameters">The parameters - index so that @y is indexed as 'y'</param> | 76 | /// <param name="parameters">The parameters - index so that @y is indexed as 'y'</param> |
77 | /// <returns>A SQLite DB Command</returns> | 77 | /// <returns>A SQLite DB Command</returns> |
78 | public IDbCommand Query(string sql, Dictionary<string, string> parameters) | 78 | public IDbCommand Query(string sql, Dictionary<string, string> parameters) |
79 | { | 79 | { |
80 | SQLiteCommand dbcommand = (SQLiteCommand)dbcon.CreateCommand(); | 80 | SQLiteCommand dbcommand = (SQLiteCommand)dbcon.CreateCommand(); |
81 | dbcommand.CommandText = sql; | 81 | dbcommand.CommandText = sql; |
82 | foreach (KeyValuePair<string, string> param in parameters) | 82 | foreach (KeyValuePair<string, string> param in parameters) |
83 | { | 83 | { |
84 | SQLiteParameter paramx = new SQLiteParameter(param.Key,param.Value); | 84 | SQLiteParameter paramx = new SQLiteParameter(param.Key,param.Value); |
85 | dbcommand.Parameters.Add(paramx); | 85 | dbcommand.Parameters.Add(paramx); |
86 | } | 86 | } |
87 | 87 | ||
88 | return (IDbCommand)dbcommand; | 88 | return (IDbCommand)dbcommand; |
89 | } | 89 | } |
90 | 90 | ||
91 | /// <summary> | 91 | /// <summary> |
92 | /// Reads a region row from a database reader | 92 | /// Reads a region row from a database reader |
93 | /// </summary> | 93 | /// </summary> |
94 | /// <param name="reader">An active database reader</param> | 94 | /// <param name="reader">An active database reader</param> |
95 | /// <returns>A region profile</returns> | 95 | /// <returns>A region profile</returns> |
96 | public SimProfileData getRow(IDataReader reader) | 96 | public SimProfileData getRow(IDataReader reader) |
97 | { | 97 | { |
98 | SimProfileData retval = new SimProfileData(); | 98 | SimProfileData retval = new SimProfileData(); |
99 | 99 | ||
100 | if (reader.Read()) | 100 | if (reader.Read()) |
101 | { | 101 | { |
102 | // Region Main | 102 | // Region Main |
103 | retval.regionHandle = (ulong)reader["regionHandle"]; | 103 | retval.regionHandle = (ulong)reader["regionHandle"]; |
104 | retval.regionName = (string)reader["regionName"]; | 104 | retval.regionName = (string)reader["regionName"]; |
105 | retval.UUID = new LLUUID((string)reader["uuid"]); | 105 | retval.UUID = new LLUUID((string)reader["uuid"]); |
106 | 106 | ||
107 | // Secrets | 107 | // Secrets |
108 | retval.regionRecvKey = (string)reader["regionRecvKey"]; | 108 | retval.regionRecvKey = (string)reader["regionRecvKey"]; |
109 | retval.regionSecret = (string)reader["regionSecret"]; | 109 | retval.regionSecret = (string)reader["regionSecret"]; |
110 | retval.regionSendKey = (string)reader["regionSendKey"]; | 110 | retval.regionSendKey = (string)reader["regionSendKey"]; |
111 | 111 | ||
112 | // Region Server | 112 | // Region Server |
113 | retval.regionDataURI = (string)reader["regionDataURI"]; | 113 | retval.regionDataURI = (string)reader["regionDataURI"]; |
114 | retval.regionOnline = false; // Needs to be pinged before this can be set. | 114 | retval.regionOnline = false; // Needs to be pinged before this can be set. |
115 | retval.serverIP = (string)reader["serverIP"]; | 115 | retval.serverIP = (string)reader["serverIP"]; |
116 | retval.serverPort = (uint)reader["serverPort"]; | 116 | retval.serverPort = (uint)reader["serverPort"]; |
117 | retval.serverURI = (string)reader["serverURI"]; | 117 | retval.serverURI = (string)reader["serverURI"]; |
118 | 118 | ||
119 | // Location | 119 | // Location |
120 | retval.regionLocX = (uint)((int)reader["locX"]); | 120 | retval.regionLocX = (uint)((int)reader["locX"]); |
121 | retval.regionLocY = (uint)((int)reader["locY"]); | 121 | retval.regionLocY = (uint)((int)reader["locY"]); |
122 | retval.regionLocZ = (uint)((int)reader["locZ"]); | 122 | retval.regionLocZ = (uint)((int)reader["locZ"]); |
123 | 123 | ||
124 | // Neighbours - 0 = No Override | 124 | // Neighbours - 0 = No Override |
125 | retval.regionEastOverrideHandle = (ulong)reader["eastOverrideHandle"]; | 125 | retval.regionEastOverrideHandle = (ulong)reader["eastOverrideHandle"]; |
126 | retval.regionWestOverrideHandle = (ulong)reader["westOverrideHandle"]; | 126 | retval.regionWestOverrideHandle = (ulong)reader["westOverrideHandle"]; |
127 | retval.regionSouthOverrideHandle = (ulong)reader["southOverrideHandle"]; | 127 | retval.regionSouthOverrideHandle = (ulong)reader["southOverrideHandle"]; |
128 | retval.regionNorthOverrideHandle = (ulong)reader["northOverrideHandle"]; | 128 | retval.regionNorthOverrideHandle = (ulong)reader["northOverrideHandle"]; |
129 | 129 | ||
130 | // Assets | 130 | // Assets |
131 | retval.regionAssetURI = (string)reader["regionAssetURI"]; | 131 | retval.regionAssetURI = (string)reader["regionAssetURI"]; |
132 | retval.regionAssetRecvKey = (string)reader["regionAssetRecvKey"]; | 132 | retval.regionAssetRecvKey = (string)reader["regionAssetRecvKey"]; |
133 | retval.regionAssetSendKey = (string)reader["regionAssetSendKey"]; | 133 | retval.regionAssetSendKey = (string)reader["regionAssetSendKey"]; |
134 | 134 | ||
135 | // Userserver | 135 | // Userserver |
136 | retval.regionUserURI = (string)reader["regionUserURI"]; | 136 | retval.regionUserURI = (string)reader["regionUserURI"]; |
137 | retval.regionUserRecvKey = (string)reader["regionUserRecvKey"]; | 137 | retval.regionUserRecvKey = (string)reader["regionUserRecvKey"]; |
138 | retval.regionUserSendKey = (string)reader["regionUserSendKey"]; | 138 | retval.regionUserSendKey = (string)reader["regionUserSendKey"]; |
139 | } | 139 | } |
140 | else | 140 | else |
141 | { | 141 | { |
142 | throw new Exception("No rows to return"); | 142 | throw new Exception("No rows to return"); |
143 | } | 143 | } |
144 | return retval; | 144 | return retval; |
145 | } | 145 | } |
146 | 146 | ||
147 | /// <summary> | 147 | /// <summary> |
148 | /// Inserts a new region into the database | 148 | /// Inserts a new region into the database |
149 | /// </summary> | 149 | /// </summary> |
150 | /// <param name="profile">The region to insert</param> | 150 | /// <param name="profile">The region to insert</param> |
151 | /// <returns>Success?</returns> | 151 | /// <returns>Success?</returns> |
152 | public bool insertRow(SimProfileData profile) | 152 | public bool insertRow(SimProfileData profile) |
153 | { | 153 | { |
154 | string sql = "REPLACE INTO regions VALUES (regionHandle, regionName, uuid, regionRecvKey, regionSecret, regionSendKey, regionDataURI, "; | 154 | string sql = "REPLACE INTO regions VALUES (regionHandle, regionName, uuid, regionRecvKey, regionSecret, regionSendKey, regionDataURI, "; |
155 | sql += "serverIP, serverPort, serverURI, locX, locY, locZ, eastOverrideHandle, westOverrideHandle, southOverrideHandle, northOverrideHandle, regionAssetURI, regionAssetRecvKey, "; | 155 | sql += "serverIP, serverPort, serverURI, locX, locY, locZ, eastOverrideHandle, westOverrideHandle, southOverrideHandle, northOverrideHandle, regionAssetURI, regionAssetRecvKey, "; |
156 | sql += "regionAssetSendKey, regionUserURI, regionUserRecvKey, regionUserSendKey) VALUES "; | 156 | sql += "regionAssetSendKey, regionUserURI, regionUserRecvKey, regionUserSendKey) VALUES "; |
157 | 157 | ||
158 | sql += "(@regionHandle, @regionName, @uuid, @regionRecvKey, @regionSecret, @regionSendKey, @regionDataURI, "; | 158 | sql += "(@regionHandle, @regionName, @uuid, @regionRecvKey, @regionSecret, @regionSendKey, @regionDataURI, "; |
159 | sql += "@serverIP, @serverPort, @serverURI, @locX, @locY, @locZ, @eastOverrideHandle, @westOverrideHandle, @southOverrideHandle, @northOverrideHandle, @regionAssetURI, @regionAssetRecvKey, "; | 159 | sql += "@serverIP, @serverPort, @serverURI, @locX, @locY, @locZ, @eastOverrideHandle, @westOverrideHandle, @southOverrideHandle, @northOverrideHandle, @regionAssetURI, @regionAssetRecvKey, "; |
160 | sql += "@regionAssetSendKey, @regionUserURI, @regionUserRecvKey, @regionUserSendKey);"; | 160 | sql += "@regionAssetSendKey, @regionUserURI, @regionUserRecvKey, @regionUserSendKey);"; |
161 | 161 | ||
162 | Dictionary<string, string> parameters = new Dictionary<string, string>(); | 162 | Dictionary<string, string> parameters = new Dictionary<string, string>(); |
163 | 163 | ||
164 | parameters["regionHandle"] = profile.regionHandle.ToString(); | 164 | parameters["regionHandle"] = profile.regionHandle.ToString(); |
165 | parameters["regionName"] = profile.regionName; | 165 | parameters["regionName"] = profile.regionName; |
166 | parameters["uuid"] = profile.UUID.ToString(); | 166 | parameters["uuid"] = profile.UUID.ToString(); |
167 | parameters["regionRecvKey"] = profile.regionRecvKey; | 167 | parameters["regionRecvKey"] = profile.regionRecvKey; |
168 | parameters["regionSendKey"] = profile.regionSendKey; | 168 | parameters["regionSendKey"] = profile.regionSendKey; |
169 | parameters["regionDataURI"] = profile.regionDataURI; | 169 | parameters["regionDataURI"] = profile.regionDataURI; |
170 | parameters["serverIP"] = profile.serverIP; | 170 | parameters["serverIP"] = profile.serverIP; |
171 | parameters["serverPort"] = profile.serverPort.ToString(); | 171 | parameters["serverPort"] = profile.serverPort.ToString(); |
172 | parameters["serverURI"] = profile.serverURI; | 172 | parameters["serverURI"] = profile.serverURI; |
173 | parameters["locX"] = profile.regionLocX.ToString(); | 173 | parameters["locX"] = profile.regionLocX.ToString(); |
174 | parameters["locY"] = profile.regionLocY.ToString(); | 174 | parameters["locY"] = profile.regionLocY.ToString(); |
175 | parameters["locZ"] = profile.regionLocZ.ToString(); | 175 | parameters["locZ"] = profile.regionLocZ.ToString(); |
176 | parameters["eastOverrideHandle"] = profile.regionEastOverrideHandle.ToString(); | 176 | parameters["eastOverrideHandle"] = profile.regionEastOverrideHandle.ToString(); |
177 | parameters["westOverrideHandle"] = profile.regionWestOverrideHandle.ToString(); | 177 | parameters["westOverrideHandle"] = profile.regionWestOverrideHandle.ToString(); |
178 | parameters["northOverrideHandle"] = profile.regionNorthOverrideHandle.ToString(); | 178 | parameters["northOverrideHandle"] = profile.regionNorthOverrideHandle.ToString(); |
179 | parameters["southOverrideHandle"] = profile.regionSouthOverrideHandle.ToString(); | 179 | parameters["southOverrideHandle"] = profile.regionSouthOverrideHandle.ToString(); |
180 | parameters["regionAssetURI"] = profile.regionAssetURI; | 180 | parameters["regionAssetURI"] = profile.regionAssetURI; |
181 | parameters["regionAssetRecvKey"] = profile.regionAssetRecvKey; | 181 | parameters["regionAssetRecvKey"] = profile.regionAssetRecvKey; |
182 | parameters["regionAssetSendKey"] = profile.regionAssetSendKey; | 182 | parameters["regionAssetSendKey"] = profile.regionAssetSendKey; |
183 | parameters["regionUserURI"] = profile.regionUserURI; | 183 | parameters["regionUserURI"] = profile.regionUserURI; |
184 | parameters["regionUserRecvKey"] = profile.regionUserRecvKey; | 184 | parameters["regionUserRecvKey"] = profile.regionUserRecvKey; |
185 | parameters["regionUserSendKey"] = profile.regionUserSendKey; | 185 | parameters["regionUserSendKey"] = profile.regionUserSendKey; |
186 | 186 | ||
187 | bool returnval = false; | 187 | bool returnval = false; |
188 | 188 | ||
189 | try | 189 | try |
190 | { | 190 | { |
191 | IDbCommand result = Query(sql, parameters); | 191 | IDbCommand result = Query(sql, parameters); |
192 | 192 | ||
193 | if (result.ExecuteNonQuery() == 1) | 193 | if (result.ExecuteNonQuery() == 1) |
194 | returnval = true; | 194 | returnval = true; |
195 | 195 | ||
196 | result.Dispose(); | 196 | result.Dispose(); |
197 | } | 197 | } |
198 | catch (Exception) | 198 | catch (Exception) |
199 | { | 199 | { |
200 | return false; | 200 | return false; |
201 | } | 201 | } |
202 | 202 | ||
203 | return returnval; | 203 | return returnval; |
204 | } | 204 | } |
205 | } | 205 | } |
206 | } | 206 | } |
diff --git a/OpenSim/Framework/Data/GridData.cs b/OpenSim/Framework/Data/GridData.cs index 5a17d20..c96353b 100644 --- a/OpenSim/Framework/Data/GridData.cs +++ b/OpenSim/Framework/Data/GridData.cs | |||
@@ -1,111 +1,111 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using libsecondlife; | 28 | using libsecondlife; |
29 | 29 | ||
30 | namespace OpenSim.Framework.Data | 30 | namespace OpenSim.Framework.Data |
31 | { | 31 | { |
32 | public enum DataResponse | 32 | public enum DataResponse |
33 | { | 33 | { |
34 | RESPONSE_OK, | 34 | RESPONSE_OK, |
35 | RESPONSE_AUTHREQUIRED, | 35 | RESPONSE_AUTHREQUIRED, |
36 | RESPONSE_INVALIDCREDENTIALS, | 36 | RESPONSE_INVALIDCREDENTIALS, |
37 | RESPONSE_ERROR | 37 | RESPONSE_ERROR |
38 | } | 38 | } |
39 | 39 | ||
40 | /// <summary> | 40 | /// <summary> |
41 | /// A standard grid interface | 41 | /// A standard grid interface |
42 | /// </summary> | 42 | /// </summary> |
43 | public interface IGridData | 43 | public interface IGridData |
44 | { | 44 | { |
45 | /// <summary> | 45 | /// <summary> |
46 | /// Returns a sim profile from a regionHandle | 46 | /// Returns a sim profile from a regionHandle |
47 | /// </summary> | 47 | /// </summary> |
48 | /// <param name="regionHandle">A 64bit Region Handle</param> | 48 | /// <param name="regionHandle">A 64bit Region Handle</param> |
49 | /// <returns>A simprofile</returns> | 49 | /// <returns>A simprofile</returns> |
50 | SimProfileData GetProfileByHandle(ulong regionHandle); | 50 | SimProfileData GetProfileByHandle(ulong regionHandle); |
51 | 51 | ||
52 | /// <summary> | 52 | /// <summary> |
53 | /// Returns a sim profile from a UUID | 53 | /// Returns a sim profile from a UUID |
54 | /// </summary> | 54 | /// </summary> |
55 | /// <param name="UUID">A 128bit UUID</param> | 55 | /// <param name="UUID">A 128bit UUID</param> |
56 | /// <returns>A sim profile</returns> | 56 | /// <returns>A sim profile</returns> |
57 | SimProfileData GetProfileByLLUUID(LLUUID UUID); | 57 | SimProfileData GetProfileByLLUUID(LLUUID UUID); |
58 | 58 | ||
59 | /// <summary> | 59 | /// <summary> |
60 | /// Returns all profiles within the specified range | 60 | /// Returns all profiles within the specified range |
61 | /// </summary> | 61 | /// </summary> |
62 | /// <param name="Xmin">Minimum sim coordinate (X)</param> | 62 | /// <param name="Xmin">Minimum sim coordinate (X)</param> |
63 | /// <param name="Ymin">Minimum sim coordinate (Y)</param> | 63 | /// <param name="Ymin">Minimum sim coordinate (Y)</param> |
64 | /// <param name="Xmax">Maximum sim coordinate (X)</param> | 64 | /// <param name="Xmax">Maximum sim coordinate (X)</param> |
65 | /// <param name="Ymin">Maximum sim coordinate (Y)</param> | 65 | /// <param name="Ymin">Maximum sim coordinate (Y)</param> |
66 | /// <returns>An array containing all the sim profiles in the specified range</returns> | 66 | /// <returns>An array containing all the sim profiles in the specified range</returns> |
67 | SimProfileData[] GetProfilesInRange(uint Xmin, uint Ymin, uint Xmax, uint Ymax); | 67 | SimProfileData[] GetProfilesInRange(uint Xmin, uint Ymin, uint Xmax, uint Ymax); |
68 | 68 | ||
69 | /// <summary> | 69 | /// <summary> |
70 | /// Authenticates a sim by use of it's recv key. | 70 | /// Authenticates a sim by use of it's recv key. |
71 | /// WARNING: Insecure | 71 | /// WARNING: Insecure |
72 | /// </summary> | 72 | /// </summary> |
73 | /// <param name="UUID">The UUID sent by the sim</param> | 73 | /// <param name="UUID">The UUID sent by the sim</param> |
74 | /// <param name="regionHandle">The regionhandle sent by the sim</param> | 74 | /// <param name="regionHandle">The regionhandle sent by the sim</param> |
75 | /// <param name="simrecvkey">The recieving key sent by the sim</param> | 75 | /// <param name="simrecvkey">The recieving key sent by the sim</param> |
76 | /// <returns>Whether the sim has been authenticated</returns> | 76 | /// <returns>Whether the sim has been authenticated</returns> |
77 | bool AuthenticateSim(LLUUID UUID, ulong regionHandle, string simrecvkey); | 77 | bool AuthenticateSim(LLUUID UUID, ulong regionHandle, string simrecvkey); |
78 | 78 | ||
79 | /// <summary> | 79 | /// <summary> |
80 | /// Initialises the interface | 80 | /// Initialises the interface |
81 | /// </summary> | 81 | /// </summary> |
82 | void Initialise(); | 82 | void Initialise(); |
83 | 83 | ||
84 | /// <summary> | 84 | /// <summary> |
85 | /// Closes the interface | 85 | /// Closes the interface |
86 | /// </summary> | 86 | /// </summary> |
87 | void Close(); | 87 | void Close(); |
88 | 88 | ||
89 | /// <summary> | 89 | /// <summary> |
90 | /// The plugin being loaded | 90 | /// The plugin being loaded |
91 | /// </summary> | 91 | /// </summary> |
92 | /// <returns>A string containing the plugin name</returns> | 92 | /// <returns>A string containing the plugin name</returns> |
93 | string getName(); | 93 | string getName(); |
94 | 94 | ||
95 | /// <summary> | 95 | /// <summary> |
96 | /// The plugins version | 96 | /// The plugins version |
97 | /// </summary> | 97 | /// </summary> |
98 | /// <returns>A string containing the plugin version</returns> | 98 | /// <returns>A string containing the plugin version</returns> |
99 | string getVersion(); | 99 | string getVersion(); |
100 | 100 | ||
101 | /// <summary> | 101 | /// <summary> |
102 | /// Adds a new profile to the database | 102 | /// Adds a new profile to the database |
103 | /// </summary> | 103 | /// </summary> |
104 | /// <param name="profile">The profile to add</param> | 104 | /// <param name="profile">The profile to add</param> |
105 | /// <returns>RESPONSE_OK if successful, error if not.</returns> | 105 | /// <returns>RESPONSE_OK if successful, error if not.</returns> |
106 | DataResponse AddProfile(SimProfileData profile); | 106 | DataResponse AddProfile(SimProfileData profile); |
107 | 107 | ||
108 | ReservationData GetReservationAtPoint(uint x, uint y); | 108 | ReservationData GetReservationAtPoint(uint x, uint y); |
109 | 109 | ||
110 | } | 110 | } |
111 | } | 111 | } |
diff --git a/OpenSim/Framework/Data/ILogData.cs b/OpenSim/Framework/Data/ILogData.cs index 059fef5..a827c0c 100644 --- a/OpenSim/Framework/Data/ILogData.cs +++ b/OpenSim/Framework/Data/ILogData.cs | |||
@@ -1,90 +1,90 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | namespace OpenSim.Framework.Data | 28 | namespace OpenSim.Framework.Data |
29 | { | 29 | { |
30 | /// <summary> | 30 | /// <summary> |
31 | /// The severity of an individual log message | 31 | /// The severity of an individual log message |
32 | /// </summary> | 32 | /// </summary> |
33 | public enum LogSeverity : int | 33 | public enum LogSeverity : int |
34 | { | 34 | { |
35 | /// <summary> | 35 | /// <summary> |
36 | /// Critical: systems failure | 36 | /// Critical: systems failure |
37 | /// </summary> | 37 | /// </summary> |
38 | CRITICAL = 1, | 38 | CRITICAL = 1, |
39 | /// <summary> | 39 | /// <summary> |
40 | /// Major: warning prior to systems failure | 40 | /// Major: warning prior to systems failure |
41 | /// </summary> | 41 | /// </summary> |
42 | MAJOR = 2, | 42 | MAJOR = 2, |
43 | /// <summary> | 43 | /// <summary> |
44 | /// Medium: an individual non-critical task failed | 44 | /// Medium: an individual non-critical task failed |
45 | /// </summary> | 45 | /// </summary> |
46 | MEDIUM = 3, | 46 | MEDIUM = 3, |
47 | /// <summary> | 47 | /// <summary> |
48 | /// Low: Informational warning | 48 | /// Low: Informational warning |
49 | /// </summary> | 49 | /// </summary> |
50 | LOW = 4, | 50 | LOW = 4, |
51 | /// <summary> | 51 | /// <summary> |
52 | /// Info: Information | 52 | /// Info: Information |
53 | /// </summary> | 53 | /// </summary> |
54 | INFO = 5, | 54 | INFO = 5, |
55 | /// <summary> | 55 | /// <summary> |
56 | /// Verbose: Debug Information | 56 | /// Verbose: Debug Information |
57 | /// </summary> | 57 | /// </summary> |
58 | VERBOSE = 6 | 58 | VERBOSE = 6 |
59 | } | 59 | } |
60 | 60 | ||
61 | /// <summary> | 61 | /// <summary> |
62 | /// An interface to a LogData storage system | 62 | /// An interface to a LogData storage system |
63 | /// </summary> | 63 | /// </summary> |
64 | public interface ILogData | 64 | public interface ILogData |
65 | { | 65 | { |
66 | void saveLog(string serverDaemon, string target, string methodCall, string arguments, int priority,string logMessage); | 66 | void saveLog(string serverDaemon, string target, string methodCall, string arguments, int priority,string logMessage); |
67 | /// <summary> | 67 | /// <summary> |
68 | /// Initialises the interface | 68 | /// Initialises the interface |
69 | /// </summary> | 69 | /// </summary> |
70 | void Initialise(); | 70 | void Initialise(); |
71 | 71 | ||
72 | /// <summary> | 72 | /// <summary> |
73 | /// Closes the interface | 73 | /// Closes the interface |
74 | /// </summary> | 74 | /// </summary> |
75 | void Close(); | 75 | void Close(); |
76 | 76 | ||
77 | /// <summary> | 77 | /// <summary> |
78 | /// The plugin being loaded | 78 | /// The plugin being loaded |
79 | /// </summary> | 79 | /// </summary> |
80 | /// <returns>A string containing the plugin name</returns> | 80 | /// <returns>A string containing the plugin name</returns> |
81 | string getName(); | 81 | string getName(); |
82 | 82 | ||
83 | /// <summary> | 83 | /// <summary> |
84 | /// The plugins version | 84 | /// The plugins version |
85 | /// </summary> | 85 | /// </summary> |
86 | /// <returns>A string containing the plugin version</returns> | 86 | /// <returns>A string containing the plugin version</returns> |
87 | string getVersion(); | 87 | string getVersion(); |
88 | } | 88 | } |
89 | 89 | ||
90 | } | 90 | } |
diff --git a/OpenSim/Framework/Data/IniConfig.cs b/OpenSim/Framework/Data/IniConfig.cs index 2b52fd1..5dcb2fd 100644 --- a/OpenSim/Framework/Data/IniConfig.cs +++ b/OpenSim/Framework/Data/IniConfig.cs | |||
@@ -1,96 +1,96 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using System.IO; | 28 | using System.IO; |
29 | using System.Text.RegularExpressions; | 29 | using System.Text.RegularExpressions; |
30 | /* | 30 | /* |
31 | Taken from public code listing at by Alex Pinsker | 31 | Taken from public code listing at by Alex Pinsker |
32 | http://alexpinsker.blogspot.com/2005/12/reading-ini-file-from-c_113432097333021549.html | 32 | http://alexpinsker.blogspot.com/2005/12/reading-ini-file-from-c_113432097333021549.html |
33 | */ | 33 | */ |
34 | 34 | ||
35 | namespace OpenSim.Framework.Data | 35 | namespace OpenSim.Framework.Data |
36 | { | 36 | { |
37 | /// <summary> | 37 | /// <summary> |
38 | /// Parse settings from ini-like files | 38 | /// Parse settings from ini-like files |
39 | /// </summary> | 39 | /// </summary> |
40 | public class IniFile | 40 | public class IniFile |
41 | { | 41 | { |
42 | static IniFile() | 42 | static IniFile() |
43 | { | 43 | { |
44 | _iniKeyValuePatternRegex = new Regex( | 44 | _iniKeyValuePatternRegex = new Regex( |
45 | @"((\s)*(?<Key>([^\=^\s^\n]+))[\s^\n]* | 45 | @"((\s)*(?<Key>([^\=^\s^\n]+))[\s^\n]* |
46 | # key part (surrounding whitespace stripped) | 46 | # key part (surrounding whitespace stripped) |
47 | \= | 47 | \= |
48 | (\s)*(?<Value>([^\n^\s]+(\n){0,1}))) | 48 | (\s)*(?<Value>([^\n^\s]+(\n){0,1}))) |
49 | # value part (surrounding whitespace stripped) | 49 | # value part (surrounding whitespace stripped) |
50 | ", | 50 | ", |
51 | RegexOptions.IgnorePatternWhitespace | | 51 | RegexOptions.IgnorePatternWhitespace | |
52 | RegexOptions.Compiled | | 52 | RegexOptions.Compiled | |
53 | RegexOptions.CultureInvariant); | 53 | RegexOptions.CultureInvariant); |
54 | } | 54 | } |
55 | static private Regex _iniKeyValuePatternRegex; | 55 | static private Regex _iniKeyValuePatternRegex; |
56 | 56 | ||
57 | public IniFile(string iniFileName) | 57 | public IniFile(string iniFileName) |
58 | { | 58 | { |
59 | _iniFileName = iniFileName; | 59 | _iniFileName = iniFileName; |
60 | } | 60 | } |
61 | 61 | ||
62 | public string ParseFileReadValue(string key) | 62 | public string ParseFileReadValue(string key) |
63 | { | 63 | { |
64 | using (StreamReader reader = | 64 | using (StreamReader reader = |
65 | new StreamReader(_iniFileName)) | 65 | new StreamReader(_iniFileName)) |
66 | { | 66 | { |
67 | do | 67 | do |
68 | { | 68 | { |
69 | string line = reader.ReadLine(); | 69 | string line = reader.ReadLine(); |
70 | Match match = | 70 | Match match = |
71 | _iniKeyValuePatternRegex.Match(line); | 71 | _iniKeyValuePatternRegex.Match(line); |
72 | if (match.Success) | 72 | if (match.Success) |
73 | { | 73 | { |
74 | string currentKey = | 74 | string currentKey = |
75 | match.Groups["Key"].Value as string; | 75 | match.Groups["Key"].Value as string; |
76 | if (currentKey != null && | 76 | if (currentKey != null && |
77 | currentKey.Trim().CompareTo(key) == 0) | 77 | currentKey.Trim().CompareTo(key) == 0) |
78 | { | 78 | { |
79 | string value = | 79 | string value = |
80 | match.Groups["Value"].Value as string; | 80 | match.Groups["Value"].Value as string; |
81 | return value; | 81 | return value; |
82 | } | 82 | } |
83 | } | 83 | } |
84 | 84 | ||
85 | } | 85 | } |
86 | while (reader.Peek() != -1); | 86 | while (reader.Peek() != -1); |
87 | } | 87 | } |
88 | return null; | 88 | return null; |
89 | } | 89 | } |
90 | 90 | ||
91 | public string IniFileName | 91 | public string IniFileName |
92 | { | 92 | { |
93 | get { return _iniFileName; } | 93 | get { return _iniFileName; } |
94 | } private string _iniFileName; | 94 | } private string _iniFileName; |
95 | } | 95 | } |
96 | } | 96 | } |
diff --git a/OpenSim/Framework/Data/InventoryData.cs b/OpenSim/Framework/Data/InventoryData.cs index 7253cc7..f6aeb58 100644 --- a/OpenSim/Framework/Data/InventoryData.cs +++ b/OpenSim/Framework/Data/InventoryData.cs | |||
@@ -1,197 +1,197 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using System.Collections.Generic; | 28 | using System.Collections.Generic; |
29 | using libsecondlife; | 29 | using libsecondlife; |
30 | 30 | ||
31 | namespace OpenSim.Framework.Data | 31 | namespace OpenSim.Framework.Data |
32 | { | 32 | { |
33 | /// <summary> | 33 | /// <summary> |
34 | /// Inventory Item - contains all the properties associated with an individual inventory piece. | 34 | /// Inventory Item - contains all the properties associated with an individual inventory piece. |
35 | /// </summary> | 35 | /// </summary> |
36 | public class InventoryItemBase | 36 | public class InventoryItemBase |
37 | { | 37 | { |
38 | /// <summary> | 38 | /// <summary> |
39 | /// A UUID containing the ID for the inventory item itself | 39 | /// A UUID containing the ID for the inventory item itself |
40 | /// </summary> | 40 | /// </summary> |
41 | public LLUUID inventoryID; | 41 | public LLUUID inventoryID; |
42 | /// <summary> | 42 | /// <summary> |
43 | /// The UUID of the associated asset on the asset server | 43 | /// The UUID of the associated asset on the asset server |
44 | /// </summary> | 44 | /// </summary> |
45 | public LLUUID assetID; | 45 | public LLUUID assetID; |
46 | /// <summary> | 46 | /// <summary> |
47 | /// This is an enumerated value determining the type of asset (eg Notecard, Sound, Object, etc) | 47 | /// This is an enumerated value determining the type of asset (eg Notecard, Sound, Object, etc) |
48 | /// </summary> | 48 | /// </summary> |
49 | public int type; | 49 | public int type; |
50 | /// <summary> | 50 | /// <summary> |
51 | /// The folder this item is contained in | 51 | /// The folder this item is contained in |
52 | /// </summary> | 52 | /// </summary> |
53 | public LLUUID parentFolderID; | 53 | public LLUUID parentFolderID; |
54 | /// <summary> | 54 | /// <summary> |
55 | /// The owner of this inventory item | 55 | /// The owner of this inventory item |
56 | /// </summary> | 56 | /// </summary> |
57 | public LLUUID avatarID; | 57 | public LLUUID avatarID; |
58 | /// <summary> | 58 | /// <summary> |
59 | /// The creator of this item | 59 | /// The creator of this item |
60 | /// </summary> | 60 | /// </summary> |
61 | public LLUUID creatorsID; | 61 | public LLUUID creatorsID; |
62 | /// <summary> | 62 | /// <summary> |
63 | /// The name of the inventory item (must be less than 64 characters) | 63 | /// The name of the inventory item (must be less than 64 characters) |
64 | /// </summary> | 64 | /// </summary> |
65 | public string inventoryName; | 65 | public string inventoryName; |
66 | /// <summary> | 66 | /// <summary> |
67 | /// The description of the inventory item (must be less than 64 characters) | 67 | /// The description of the inventory item (must be less than 64 characters) |
68 | /// </summary> | 68 | /// </summary> |
69 | public string inventoryDescription; | 69 | public string inventoryDescription; |
70 | /// <summary> | 70 | /// <summary> |
71 | /// A mask containing the permissions for the next owner (cannot be enforced) | 71 | /// A mask containing the permissions for the next owner (cannot be enforced) |
72 | /// </summary> | 72 | /// </summary> |
73 | public uint inventoryNextPermissions; | 73 | public uint inventoryNextPermissions; |
74 | /// <summary> | 74 | /// <summary> |
75 | /// A mask containing permissions for the current owner (cannot be enforced) | 75 | /// A mask containing permissions for the current owner (cannot be enforced) |
76 | /// </summary> | 76 | /// </summary> |
77 | public uint inventoryCurrentPermissions; | 77 | public uint inventoryCurrentPermissions; |
78 | } | 78 | } |
79 | 79 | ||
80 | /// <summary> | 80 | /// <summary> |
81 | /// A Class for folders which contain users inventory | 81 | /// A Class for folders which contain users inventory |
82 | /// </summary> | 82 | /// </summary> |
83 | public class InventoryFolderBase | 83 | public class InventoryFolderBase |
84 | { | 84 | { |
85 | /// <summary> | 85 | /// <summary> |
86 | /// The name of the folder (64 characters or less) | 86 | /// The name of the folder (64 characters or less) |
87 | /// </summary> | 87 | /// </summary> |
88 | public string name; | 88 | public string name; |
89 | /// <summary> | 89 | /// <summary> |
90 | /// The agent who's inventory this is contained by | 90 | /// The agent who's inventory this is contained by |
91 | /// </summary> | 91 | /// </summary> |
92 | public LLUUID agentID; | 92 | public LLUUID agentID; |
93 | /// <summary> | 93 | /// <summary> |
94 | /// The folder this folder is contained in | 94 | /// The folder this folder is contained in |
95 | /// </summary> | 95 | /// </summary> |
96 | public LLUUID parentID; | 96 | public LLUUID parentID; |
97 | /// <summary> | 97 | /// <summary> |
98 | /// The UUID for this folder | 98 | /// The UUID for this folder |
99 | /// </summary> | 99 | /// </summary> |
100 | public LLUUID folderID; | 100 | public LLUUID folderID; |
101 | /// <summary> | 101 | /// <summary> |
102 | /// Tyep of Items normally stored in this folder | 102 | /// Tyep of Items normally stored in this folder |
103 | /// </summary> | 103 | /// </summary> |
104 | public ushort type; | 104 | public ushort type; |
105 | /// <summary> | 105 | /// <summary> |
106 | /// | 106 | /// |
107 | /// </summary> | 107 | /// </summary> |
108 | public ushort version; | 108 | public ushort version; |
109 | } | 109 | } |
110 | 110 | ||
111 | /// <summary> | 111 | /// <summary> |
112 | /// An interface for accessing inventory data from a storage server | 112 | /// An interface for accessing inventory data from a storage server |
113 | /// </summary> | 113 | /// </summary> |
114 | public interface IInventoryData | 114 | public interface IInventoryData |
115 | { | 115 | { |
116 | /// <summary> | 116 | /// <summary> |
117 | /// Initialises the interface | 117 | /// Initialises the interface |
118 | /// </summary> | 118 | /// </summary> |
119 | void Initialise(); | 119 | void Initialise(); |
120 | 120 | ||
121 | /// <summary> | 121 | /// <summary> |
122 | /// Closes the interface | 122 | /// Closes the interface |
123 | /// </summary> | 123 | /// </summary> |
124 | void Close(); | 124 | void Close(); |
125 | 125 | ||
126 | /// <summary> | 126 | /// <summary> |
127 | /// The plugin being loaded | 127 | /// The plugin being loaded |
128 | /// </summary> | 128 | /// </summary> |
129 | /// <returns>A string containing the plugin name</returns> | 129 | /// <returns>A string containing the plugin name</returns> |
130 | string getName(); | 130 | string getName(); |
131 | 131 | ||
132 | /// <summary> | 132 | /// <summary> |
133 | /// The plugins version | 133 | /// The plugins version |
134 | /// </summary> | 134 | /// </summary> |
135 | /// <returns>A string containing the plugin version</returns> | 135 | /// <returns>A string containing the plugin version</returns> |
136 | string getVersion(); | 136 | string getVersion(); |
137 | 137 | ||
138 | /// <summary> | 138 | /// <summary> |
139 | /// Returns a list of inventory items contained within the specified folder | 139 | /// Returns a list of inventory items contained within the specified folder |
140 | /// </summary> | 140 | /// </summary> |
141 | /// <param name="folderID">The UUID of the target folder</param> | 141 | /// <param name="folderID">The UUID of the target folder</param> |
142 | /// <returns>A List of InventoryItemBase items</returns> | 142 | /// <returns>A List of InventoryItemBase items</returns> |
143 | List<InventoryItemBase> getInventoryInFolder(LLUUID folderID); | 143 | List<InventoryItemBase> getInventoryInFolder(LLUUID folderID); |
144 | 144 | ||
145 | /// <summary> | 145 | /// <summary> |
146 | /// Returns a list of folders in the users inventory root. | 146 | /// Returns a list of folders in the users inventory root. |
147 | /// </summary> | 147 | /// </summary> |
148 | /// <param name="user">The UUID of the user who is having inventory being returned</param> | 148 | /// <param name="user">The UUID of the user who is having inventory being returned</param> |
149 | /// <returns>A list of folders</returns> | 149 | /// <returns>A list of folders</returns> |
150 | List<InventoryFolderBase> getUserRootFolders(LLUUID user); | 150 | List<InventoryFolderBase> getUserRootFolders(LLUUID user); |
151 | 151 | ||
152 | /// <summary> | 152 | /// <summary> |
153 | /// Returns a list of inventory folders contained in the folder 'parentID' | 153 | /// Returns a list of inventory folders contained in the folder 'parentID' |
154 | /// </summary> | 154 | /// </summary> |
155 | /// <param name="parentID">The folder to get subfolders for</param> | 155 | /// <param name="parentID">The folder to get subfolders for</param> |
156 | /// <returns>A list of inventory folders</returns> | 156 | /// <returns>A list of inventory folders</returns> |
157 | List<InventoryFolderBase> getInventoryFolders(LLUUID parentID); | 157 | List<InventoryFolderBase> getInventoryFolders(LLUUID parentID); |
158 | 158 | ||
159 | /// <summary> | 159 | /// <summary> |
160 | /// Returns an inventory item by its UUID | 160 | /// Returns an inventory item by its UUID |
161 | /// </summary> | 161 | /// </summary> |
162 | /// <param name="item">The UUID of the item to be returned</param> | 162 | /// <param name="item">The UUID of the item to be returned</param> |
163 | /// <returns>A class containing item information</returns> | 163 | /// <returns>A class containing item information</returns> |
164 | InventoryItemBase getInventoryItem(LLUUID item); | 164 | InventoryItemBase getInventoryItem(LLUUID item); |
165 | 165 | ||
166 | /// <summary> | 166 | /// <summary> |
167 | /// Returns a specified inventory folder by its UUID | 167 | /// Returns a specified inventory folder by its UUID |
168 | /// </summary> | 168 | /// </summary> |
169 | /// <param name="folder">The UUID of the folder to be returned</param> | 169 | /// <param name="folder">The UUID of the folder to be returned</param> |
170 | /// <returns>A class containing folder information</returns> | 170 | /// <returns>A class containing folder information</returns> |
171 | InventoryFolderBase getInventoryFolder(LLUUID folder); | 171 | InventoryFolderBase getInventoryFolder(LLUUID folder); |
172 | 172 | ||
173 | /// <summary> | 173 | /// <summary> |
174 | /// Creates a new inventory item based on item | 174 | /// Creates a new inventory item based on item |
175 | /// </summary> | 175 | /// </summary> |
176 | /// <param name="item">The item to be created</param> | 176 | /// <param name="item">The item to be created</param> |
177 | void addInventoryItem(InventoryItemBase item); | 177 | void addInventoryItem(InventoryItemBase item); |
178 | 178 | ||
179 | /// <summary> | 179 | /// <summary> |
180 | /// Updates an inventory item with item (updates based on ID) | 180 | /// Updates an inventory item with item (updates based on ID) |
181 | /// </summary> | 181 | /// </summary> |
182 | /// <param name="item">The updated item</param> | 182 | /// <param name="item">The updated item</param> |
183 | void updateInventoryItem(InventoryItemBase item); | 183 | void updateInventoryItem(InventoryItemBase item); |
184 | 184 | ||
185 | /// <summary> | 185 | /// <summary> |
186 | /// Adds a new folder specified by folder | 186 | /// Adds a new folder specified by folder |
187 | /// </summary> | 187 | /// </summary> |
188 | /// <param name="folder">The inventory folder</param> | 188 | /// <param name="folder">The inventory folder</param> |
189 | void addInventoryFolder(InventoryFolderBase folder); | 189 | void addInventoryFolder(InventoryFolderBase folder); |
190 | 190 | ||
191 | /// <summary> | 191 | /// <summary> |
192 | /// Updates a folder based on its ID with folder | 192 | /// Updates a folder based on its ID with folder |
193 | /// </summary> | 193 | /// </summary> |
194 | /// <param name="folder">The inventory folder</param> | 194 | /// <param name="folder">The inventory folder</param> |
195 | void updateInventoryFolder(InventoryFolderBase folder); | 195 | void updateInventoryFolder(InventoryFolderBase folder); |
196 | } | 196 | } |
197 | } | 197 | } |
diff --git a/OpenSim/Framework/Data/Properties/AssemblyInfo.cs b/OpenSim/Framework/Data/Properties/AssemblyInfo.cs index f9260a1..556d589 100644 --- a/OpenSim/Framework/Data/Properties/AssemblyInfo.cs +++ b/OpenSim/Framework/Data/Properties/AssemblyInfo.cs | |||
@@ -1,33 +1,33 @@ | |||
1 | using System.Reflection; | 1 | using System.Reflection; |
2 | using System.Runtime.InteropServices; | 2 | using System.Runtime.InteropServices; |
3 | // General Information about an assembly is controlled through the following | 3 | // General Information about an assembly is controlled through the following |
4 | // set of attributes. Change these attribute values to modify the information | 4 | // set of attributes. Change these attribute values to modify the information |
5 | // associated with an assembly. | 5 | // associated with an assembly. |
6 | [assembly: AssemblyTitle("OpenSim.Framework.Data")] | 6 | [assembly: AssemblyTitle("OpenSim.Framework.Data")] |
7 | [assembly: AssemblyDescription("")] | 7 | [assembly: AssemblyDescription("")] |
8 | [assembly: AssemblyConfiguration("")] | 8 | [assembly: AssemblyConfiguration("")] |
9 | [assembly: AssemblyCompany("")] | 9 | [assembly: AssemblyCompany("")] |
10 | [assembly: AssemblyProduct("OpenSim.Framework.Data")] | 10 | [assembly: AssemblyProduct("OpenSim.Framework.Data")] |
11 | [assembly: AssemblyCopyright("Copyright © 2007")] | 11 | [assembly: AssemblyCopyright("Copyright © 2007")] |
12 | [assembly: AssemblyTrademark("")] | 12 | [assembly: AssemblyTrademark("")] |
13 | [assembly: AssemblyCulture("")] | 13 | [assembly: AssemblyCulture("")] |
14 | 14 | ||
15 | // Setting ComVisible to false makes the types in this assembly not visible | 15 | // Setting ComVisible to false makes the types in this assembly not visible |
16 | // to COM components. If you need to access a type in this assembly from | 16 | // to COM components. If you need to access a type in this assembly from |
17 | // COM, set the ComVisible attribute to true on that type. | 17 | // COM, set the ComVisible attribute to true on that type. |
18 | [assembly: ComVisible(false)] | 18 | [assembly: ComVisible(false)] |
19 | 19 | ||
20 | // The following GUID is for the ID of the typelib if this project is exposed to COM | 20 | // The following GUID is for the ID of the typelib if this project is exposed to COM |
21 | [assembly: Guid("3a711c34-b0c0-4264-b0fe-f366eabf9d7b")] | 21 | [assembly: Guid("3a711c34-b0c0-4264-b0fe-f366eabf9d7b")] |
22 | 22 | ||
23 | // Version information for an assembly consists of the following four values: | 23 | // Version information for an assembly consists of the following four values: |
24 | // | 24 | // |
25 | // Major Version | 25 | // Major Version |
26 | // Minor Version | 26 | // Minor Version |
27 | // Build Number | 27 | // Build Number |
28 | // Revision | 28 | // Revision |
29 | // | 29 | // |
30 | // You can specify all the values or you can default the Revision and Build Numbers | 30 | // You can specify all the values or you can default the Revision and Build Numbers |
31 | // by using the '*' as shown below: | 31 | // by using the '*' as shown below: |
32 | [assembly: AssemblyVersion("1.0.0.0")] | 32 | [assembly: AssemblyVersion("1.0.0.0")] |
33 | [assembly: AssemblyFileVersion("1.0.0.0")] | 33 | [assembly: AssemblyFileVersion("1.0.0.0")] |
diff --git a/OpenSim/Framework/Data/ReservationData.cs b/OpenSim/Framework/Data/ReservationData.cs index 0078df0..8344d6c 100644 --- a/OpenSim/Framework/Data/ReservationData.cs +++ b/OpenSim/Framework/Data/ReservationData.cs | |||
@@ -1,47 +1,47 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using libsecondlife; | 28 | using libsecondlife; |
29 | 29 | ||
30 | namespace OpenSim.Framework.Data | 30 | namespace OpenSim.Framework.Data |
31 | { | 31 | { |
32 | public class ReservationData | 32 | public class ReservationData |
33 | { | 33 | { |
34 | public LLUUID userUUID = new LLUUID(); | 34 | public LLUUID userUUID = new LLUUID(); |
35 | public int reservationMinX = 0; | 35 | public int reservationMinX = 0; |
36 | public int reservationMinY = 0; | 36 | public int reservationMinY = 0; |
37 | public int reservationMaxX = 65536; | 37 | public int reservationMaxX = 65536; |
38 | public int reservationMaxY = 65536; | 38 | public int reservationMaxY = 65536; |
39 | 39 | ||
40 | public string reservationName = ""; | 40 | public string reservationName = ""; |
41 | public string reservationCompany = ""; | 41 | public string reservationCompany = ""; |
42 | public bool status = true; | 42 | public bool status = true; |
43 | 43 | ||
44 | public string gridSendKey = ""; | 44 | public string gridSendKey = ""; |
45 | public string gridRecvKey = ""; | 45 | public string gridRecvKey = ""; |
46 | } | 46 | } |
47 | } | 47 | } |
diff --git a/OpenSim/Framework/Data/SimProfileData.cs b/OpenSim/Framework/Data/SimProfileData.cs index b920cab..c963455 100644 --- a/OpenSim/Framework/Data/SimProfileData.cs +++ b/OpenSim/Framework/Data/SimProfileData.cs | |||
@@ -1,192 +1,192 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using libsecondlife; | 28 | using libsecondlife; |
29 | using Nwc.XmlRpc; | 29 | using Nwc.XmlRpc; |
30 | 30 | ||
31 | using System; | 31 | using System; |
32 | using System.Collections; | 32 | using System.Collections; |
33 | 33 | ||
34 | namespace OpenSim.Framework.Data | 34 | namespace OpenSim.Framework.Data |
35 | { | 35 | { |
36 | /// <summary> | 36 | /// <summary> |
37 | /// A class which contains information known to the grid server about a region | 37 | /// A class which contains information known to the grid server about a region |
38 | /// </summary> | 38 | /// </summary> |
39 | public class SimProfileData | 39 | public class SimProfileData |
40 | { | 40 | { |
41 | /// <summary> | 41 | /// <summary> |
42 | /// The name of the region | 42 | /// The name of the region |
43 | /// </summary> | 43 | /// </summary> |
44 | public string regionName = ""; | 44 | public string regionName = ""; |
45 | 45 | ||
46 | /// <summary> | 46 | /// <summary> |
47 | /// A 64-bit number combining map position into a (mostly) unique ID | 47 | /// A 64-bit number combining map position into a (mostly) unique ID |
48 | /// </summary> | 48 | /// </summary> |
49 | public ulong regionHandle; | 49 | public ulong regionHandle; |
50 | 50 | ||
51 | /// <summary> | 51 | /// <summary> |
52 | /// OGS/OpenSim Specific ID for a region | 52 | /// OGS/OpenSim Specific ID for a region |
53 | /// </summary> | 53 | /// </summary> |
54 | public LLUUID UUID; | 54 | public LLUUID UUID; |
55 | 55 | ||
56 | /// <summary> | 56 | /// <summary> |
57 | /// Coordinates of the region | 57 | /// Coordinates of the region |
58 | /// </summary> | 58 | /// </summary> |
59 | public uint regionLocX; | 59 | public uint regionLocX; |
60 | public uint regionLocY; | 60 | public uint regionLocY; |
61 | public uint regionLocZ; // Reserved (round-robin, layers, etc) | 61 | public uint regionLocZ; // Reserved (round-robin, layers, etc) |
62 | 62 | ||
63 | /// <summary> | 63 | /// <summary> |
64 | /// Authentication secrets | 64 | /// Authentication secrets |
65 | /// </summary> | 65 | /// </summary> |
66 | /// <remarks>Not very secure, needs improvement.</remarks> | 66 | /// <remarks>Not very secure, needs improvement.</remarks> |
67 | public string regionSendKey = ""; | 67 | public string regionSendKey = ""; |
68 | public string regionRecvKey = ""; | 68 | public string regionRecvKey = ""; |
69 | public string regionSecret = ""; | 69 | public string regionSecret = ""; |
70 | 70 | ||
71 | /// <summary> | 71 | /// <summary> |
72 | /// Whether the region is online | 72 | /// Whether the region is online |
73 | /// </summary> | 73 | /// </summary> |
74 | public bool regionOnline; | 74 | public bool regionOnline; |
75 | 75 | ||
76 | /// <summary> | 76 | /// <summary> |
77 | /// Information about the server that the region is currently hosted on | 77 | /// Information about the server that the region is currently hosted on |
78 | /// </summary> | 78 | /// </summary> |
79 | public string serverIP = ""; | 79 | public string serverIP = ""; |
80 | public uint serverPort; | 80 | public uint serverPort; |
81 | public string serverURI = ""; | 81 | public string serverURI = ""; |
82 | 82 | ||
83 | public uint httpPort; | 83 | public uint httpPort; |
84 | public uint remotingPort; | 84 | public uint remotingPort; |
85 | public string httpServerURI = ""; | 85 | public string httpServerURI = ""; |
86 | 86 | ||
87 | /// <summary> | 87 | /// <summary> |
88 | /// Set of optional overrides. Can be used to create non-eulicidean spaces. | 88 | /// Set of optional overrides. Can be used to create non-eulicidean spaces. |
89 | /// </summary> | 89 | /// </summary> |
90 | public ulong regionNorthOverrideHandle; | 90 | public ulong regionNorthOverrideHandle; |
91 | public ulong regionSouthOverrideHandle; | 91 | public ulong regionSouthOverrideHandle; |
92 | public ulong regionEastOverrideHandle; | 92 | public ulong regionEastOverrideHandle; |
93 | public ulong regionWestOverrideHandle; | 93 | public ulong regionWestOverrideHandle; |
94 | 94 | ||
95 | /// <summary> | 95 | /// <summary> |
96 | /// Optional: URI Location of the region database | 96 | /// Optional: URI Location of the region database |
97 | /// </summary> | 97 | /// </summary> |
98 | /// <remarks>Used for floating sim pools where the region data is not nessecarily coupled to a specific server</remarks> | 98 | /// <remarks>Used for floating sim pools where the region data is not nessecarily coupled to a specific server</remarks> |
99 | public string regionDataURI = ""; | 99 | public string regionDataURI = ""; |
100 | 100 | ||
101 | /// <summary> | 101 | /// <summary> |
102 | /// Region Asset Details | 102 | /// Region Asset Details |
103 | /// </summary> | 103 | /// </summary> |
104 | public string regionAssetURI = ""; | 104 | public string regionAssetURI = ""; |
105 | public string regionAssetSendKey = ""; | 105 | public string regionAssetSendKey = ""; |
106 | public string regionAssetRecvKey = ""; | 106 | public string regionAssetRecvKey = ""; |
107 | 107 | ||
108 | /// <summary> | 108 | /// <summary> |
109 | /// Region Userserver Details | 109 | /// Region Userserver Details |
110 | /// </summary> | 110 | /// </summary> |
111 | public string regionUserURI = ""; | 111 | public string regionUserURI = ""; |
112 | public string regionUserSendKey = ""; | 112 | public string regionUserSendKey = ""; |
113 | public string regionUserRecvKey = ""; | 113 | public string regionUserRecvKey = ""; |
114 | 114 | ||
115 | /// <summary> | 115 | /// <summary> |
116 | /// Region Map Texture Asset | 116 | /// Region Map Texture Asset |
117 | /// </summary> | 117 | /// </summary> |
118 | public LLUUID regionMapTextureID = new LLUUID("00000000-0000-0000-9999-000000000006"); | 118 | public LLUUID regionMapTextureID = new LLUUID("00000000-0000-0000-9999-000000000006"); |
119 | 119 | ||
120 | /// <summary> | 120 | /// <summary> |
121 | /// Get Sim profile data from grid server when in grid mode | 121 | /// Get Sim profile data from grid server when in grid mode |
122 | /// </summary> | 122 | /// </summary> |
123 | /// <param name="region_uuid"></param> | 123 | /// <param name="region_uuid"></param> |
124 | /// <param name="gridserver_url"></param> | 124 | /// <param name="gridserver_url"></param> |
125 | /// <param name="?"></param> | 125 | /// <param name="?"></param> |
126 | /// <returns></returns> | 126 | /// <returns></returns> |
127 | public SimProfileData RequestSimProfileData(LLUUID region_uuid, string gridserver_url, string gridserver_sendkey, string gridserver_recvkey) | 127 | public SimProfileData RequestSimProfileData(LLUUID region_uuid, string gridserver_url, string gridserver_sendkey, string gridserver_recvkey) |
128 | { | 128 | { |
129 | Hashtable requestData = new Hashtable(); | 129 | Hashtable requestData = new Hashtable(); |
130 | requestData["region_uuid"] = region_uuid.UUID.ToString(); | 130 | requestData["region_uuid"] = region_uuid.UUID.ToString(); |
131 | requestData["authkey"] = gridserver_sendkey; | 131 | requestData["authkey"] = gridserver_sendkey; |
132 | ArrayList SendParams = new ArrayList(); | 132 | ArrayList SendParams = new ArrayList(); |
133 | SendParams.Add(requestData); | 133 | SendParams.Add(requestData); |
134 | XmlRpcRequest GridReq = new XmlRpcRequest("simulator_data_request", SendParams); | 134 | XmlRpcRequest GridReq = new XmlRpcRequest("simulator_data_request", SendParams); |
135 | XmlRpcResponse GridResp = GridReq.Send(gridserver_url, 3000); | 135 | XmlRpcResponse GridResp = GridReq.Send(gridserver_url, 3000); |
136 | 136 | ||
137 | Hashtable responseData = (Hashtable)GridResp.Value; | 137 | Hashtable responseData = (Hashtable)GridResp.Value; |
138 | 138 | ||
139 | if (responseData.ContainsKey("error")) | 139 | if (responseData.ContainsKey("error")) |
140 | { | 140 | { |
141 | return null; | 141 | return null; |
142 | } | 142 | } |
143 | 143 | ||
144 | SimProfileData simData = new SimProfileData(); | 144 | SimProfileData simData = new SimProfileData(); |
145 | simData.regionLocX = Convert.ToUInt32((string)responseData["region_locx"]); | 145 | simData.regionLocX = Convert.ToUInt32((string)responseData["region_locx"]); |
146 | simData.regionLocY = Convert.ToUInt32((string)responseData["region_locy"]); | 146 | simData.regionLocY = Convert.ToUInt32((string)responseData["region_locy"]); |
147 | simData.regionHandle = Helpers.UIntsToLong((simData.regionLocX * 256), (simData.regionLocY * 256)); | 147 | simData.regionHandle = Helpers.UIntsToLong((simData.regionLocX * 256), (simData.regionLocY * 256)); |
148 | simData.serverIP = (string)responseData["sim_ip"]; | 148 | simData.serverIP = (string)responseData["sim_ip"]; |
149 | simData.serverPort = Convert.ToUInt32((string)responseData["sim_port"]); | 149 | simData.serverPort = Convert.ToUInt32((string)responseData["sim_port"]); |
150 | simData.httpPort = Convert.ToUInt32((string)responseData["http_port"]); | 150 | simData.httpPort = Convert.ToUInt32((string)responseData["http_port"]); |
151 | simData.remotingPort = Convert.ToUInt32((string)responseData["remoting_port"]); | 151 | simData.remotingPort = Convert.ToUInt32((string)responseData["remoting_port"]); |
152 | simData.serverURI = "http://" + simData.serverIP + ":" + simData.serverPort.ToString() + "/"; | 152 | simData.serverURI = "http://" + simData.serverIP + ":" + simData.serverPort.ToString() + "/"; |
153 | simData.httpServerURI = "http://" + simData.serverIP + ":" + simData.httpPort.ToString() + "/"; | 153 | simData.httpServerURI = "http://" + simData.serverIP + ":" + simData.httpPort.ToString() + "/"; |
154 | simData.UUID = new LLUUID((string)responseData["region_UUID"]); | 154 | simData.UUID = new LLUUID((string)responseData["region_UUID"]); |
155 | simData.regionName = (string)responseData["region_name"]; | 155 | simData.regionName = (string)responseData["region_name"]; |
156 | 156 | ||
157 | return simData; | 157 | return simData; |
158 | } | 158 | } |
159 | public SimProfileData RequestSimProfileData(ulong region_handle, string gridserver_url, string gridserver_sendkey, string gridserver_recvkey) | 159 | public SimProfileData RequestSimProfileData(ulong region_handle, string gridserver_url, string gridserver_sendkey, string gridserver_recvkey) |
160 | { | 160 | { |
161 | Hashtable requestData = new Hashtable(); | 161 | Hashtable requestData = new Hashtable(); |
162 | requestData["region_handle"] = region_handle.ToString(); | 162 | requestData["region_handle"] = region_handle.ToString(); |
163 | requestData["authkey"] = gridserver_sendkey; | 163 | requestData["authkey"] = gridserver_sendkey; |
164 | ArrayList SendParams = new ArrayList(); | 164 | ArrayList SendParams = new ArrayList(); |
165 | SendParams.Add(requestData); | 165 | SendParams.Add(requestData); |
166 | XmlRpcRequest GridReq = new XmlRpcRequest("simulator_data_request", SendParams); | 166 | XmlRpcRequest GridReq = new XmlRpcRequest("simulator_data_request", SendParams); |
167 | XmlRpcResponse GridResp = GridReq.Send(gridserver_url, 3000); | 167 | XmlRpcResponse GridResp = GridReq.Send(gridserver_url, 3000); |
168 | 168 | ||
169 | Hashtable responseData = (Hashtable)GridResp.Value; | 169 | Hashtable responseData = (Hashtable)GridResp.Value; |
170 | 170 | ||
171 | if (responseData.ContainsKey("error")) | 171 | if (responseData.ContainsKey("error")) |
172 | { | 172 | { |
173 | return null; | 173 | return null; |
174 | } | 174 | } |
175 | 175 | ||
176 | SimProfileData simData = new SimProfileData(); | 176 | SimProfileData simData = new SimProfileData(); |
177 | simData.regionLocX = Convert.ToUInt32((string)responseData["region_locx"]); | 177 | simData.regionLocX = Convert.ToUInt32((string)responseData["region_locx"]); |
178 | simData.regionLocY = Convert.ToUInt32((string)responseData["region_locy"]); | 178 | simData.regionLocY = Convert.ToUInt32((string)responseData["region_locy"]); |
179 | simData.regionHandle = Helpers.UIntsToLong((simData.regionLocX * 256), (simData.regionLocY * 256)); | 179 | simData.regionHandle = Helpers.UIntsToLong((simData.regionLocX * 256), (simData.regionLocY * 256)); |
180 | simData.serverIP = (string)responseData["sim_ip"]; | 180 | simData.serverIP = (string)responseData["sim_ip"]; |
181 | simData.serverPort = Convert.ToUInt32((string)responseData["sim_port"]); | 181 | simData.serverPort = Convert.ToUInt32((string)responseData["sim_port"]); |
182 | simData.httpPort = Convert.ToUInt32((string)responseData["http_port"]); | 182 | simData.httpPort = Convert.ToUInt32((string)responseData["http_port"]); |
183 | simData.remotingPort = Convert.ToUInt32((string)responseData["remoting_port"]); | 183 | simData.remotingPort = Convert.ToUInt32((string)responseData["remoting_port"]); |
184 | simData.httpServerURI = "http://" + simData.serverIP + ":" + simData.httpPort.ToString() + "/"; | 184 | simData.httpServerURI = "http://" + simData.serverIP + ":" + simData.httpPort.ToString() + "/"; |
185 | simData.serverURI = "http://" + simData.serverIP + ":" + simData.serverPort.ToString() + "/"; | 185 | simData.serverURI = "http://" + simData.serverIP + ":" + simData.serverPort.ToString() + "/"; |
186 | simData.UUID = new LLUUID((string)responseData["region_UUID"]); | 186 | simData.UUID = new LLUUID((string)responseData["region_UUID"]); |
187 | simData.regionName = (string)responseData["region_name"]; | 187 | simData.regionName = (string)responseData["region_name"]; |
188 | 188 | ||
189 | return simData; | 189 | return simData; |
190 | } | 190 | } |
191 | } | 191 | } |
192 | } | 192 | } |
diff --git a/OpenSim/Framework/Data/UserData.cs b/OpenSim/Framework/Data/UserData.cs index c65f9fd..d849e12 100644 --- a/OpenSim/Framework/Data/UserData.cs +++ b/OpenSim/Framework/Data/UserData.cs | |||
@@ -1,128 +1,128 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using libsecondlife; | 28 | using libsecondlife; |
29 | 29 | ||
30 | namespace OpenSim.Framework.Data | 30 | namespace OpenSim.Framework.Data |
31 | { | 31 | { |
32 | /// <summary> | 32 | /// <summary> |
33 | /// An interface for connecting to user storage servers. | 33 | /// An interface for connecting to user storage servers. |
34 | /// </summary> | 34 | /// </summary> |
35 | public interface IUserData | 35 | public interface IUserData |
36 | { | 36 | { |
37 | /// <summary> | 37 | /// <summary> |
38 | /// Returns a user profile from a database via their UUID | 38 | /// Returns a user profile from a database via their UUID |
39 | /// </summary> | 39 | /// </summary> |
40 | /// <param name="user">The accounts UUID</param> | 40 | /// <param name="user">The accounts UUID</param> |
41 | /// <returns>The user data profile</returns> | 41 | /// <returns>The user data profile</returns> |
42 | UserProfileData getUserByUUID(LLUUID user); | 42 | UserProfileData getUserByUUID(LLUUID user); |
43 | 43 | ||
44 | /// <summary> | 44 | /// <summary> |
45 | /// Returns a users profile by searching their username | 45 | /// Returns a users profile by searching their username |
46 | /// </summary> | 46 | /// </summary> |
47 | /// <param name="name">The users username</param> | 47 | /// <param name="name">The users username</param> |
48 | /// <returns>The user data profile</returns> | 48 | /// <returns>The user data profile</returns> |
49 | UserProfileData getUserByName(string name); | 49 | UserProfileData getUserByName(string name); |
50 | 50 | ||
51 | /// <summary> | 51 | /// <summary> |
52 | /// Returns a users profile by searching their username parts | 52 | /// Returns a users profile by searching their username parts |
53 | /// </summary> | 53 | /// </summary> |
54 | /// <param name="fname">Account firstname</param> | 54 | /// <param name="fname">Account firstname</param> |
55 | /// <param name="lname">Account lastname</param> | 55 | /// <param name="lname">Account lastname</param> |
56 | /// <returns>The user data profile</returns> | 56 | /// <returns>The user data profile</returns> |
57 | UserProfileData getUserByName(string fname, string lname); | 57 | UserProfileData getUserByName(string fname, string lname); |
58 | 58 | ||
59 | /// <summary> | 59 | /// <summary> |
60 | /// Returns the current agent for a user searching by it's UUID | 60 | /// Returns the current agent for a user searching by it's UUID |
61 | /// </summary> | 61 | /// </summary> |
62 | /// <param name="user">The users UUID</param> | 62 | /// <param name="user">The users UUID</param> |
63 | /// <returns>The current agent session</returns> | 63 | /// <returns>The current agent session</returns> |
64 | UserAgentData getAgentByUUID(LLUUID user); | 64 | UserAgentData getAgentByUUID(LLUUID user); |
65 | 65 | ||
66 | /// <summary> | 66 | /// <summary> |
67 | /// Returns the current session agent for a user searching by username | 67 | /// Returns the current session agent for a user searching by username |
68 | /// </summary> | 68 | /// </summary> |
69 | /// <param name="name">The users account name</param> | 69 | /// <param name="name">The users account name</param> |
70 | /// <returns>The current agent session</returns> | 70 | /// <returns>The current agent session</returns> |
71 | UserAgentData getAgentByName(string name); | 71 | UserAgentData getAgentByName(string name); |
72 | 72 | ||
73 | /// <summary> | 73 | /// <summary> |
74 | /// Returns the current session agent for a user searching by username parts | 74 | /// Returns the current session agent for a user searching by username parts |
75 | /// </summary> | 75 | /// </summary> |
76 | /// <param name="fname">The users first account name</param> | 76 | /// <param name="fname">The users first account name</param> |
77 | /// <param name="lname">The users account surname</param> | 77 | /// <param name="lname">The users account surname</param> |
78 | /// <returns>The current agent session</returns> | 78 | /// <returns>The current agent session</returns> |
79 | UserAgentData getAgentByName(string fname, string lname); | 79 | UserAgentData getAgentByName(string fname, string lname); |
80 | 80 | ||
81 | /// <summary> | 81 | /// <summary> |
82 | /// Adds a new User profile to the database | 82 | /// Adds a new User profile to the database |
83 | /// </summary> | 83 | /// </summary> |
84 | /// <param name="user">UserProfile to add</param> | 84 | /// <param name="user">UserProfile to add</param> |
85 | void addNewUserProfile(UserProfileData user); | 85 | void addNewUserProfile(UserProfileData user); |
86 | 86 | ||
87 | /// <summary> | 87 | /// <summary> |
88 | /// Adds a new agent to the database | 88 | /// Adds a new agent to the database |
89 | /// </summary> | 89 | /// </summary> |
90 | /// <param name="agent">The agent to add</param> | 90 | /// <param name="agent">The agent to add</param> |
91 | void addNewUserAgent(UserAgentData agent); | 91 | void addNewUserAgent(UserAgentData agent); |
92 | 92 | ||
93 | /// <summary> | 93 | /// <summary> |
94 | /// Attempts to move currency units between accounts (NOT RELIABLE / TRUSTWORTHY. DONT TRY RUN YOUR OWN CURRENCY EXCHANGE WITH REAL VALUES) | 94 | /// Attempts to move currency units between accounts (NOT RELIABLE / TRUSTWORTHY. DONT TRY RUN YOUR OWN CURRENCY EXCHANGE WITH REAL VALUES) |
95 | /// </summary> | 95 | /// </summary> |
96 | /// <param name="from">The account to transfer from</param> | 96 | /// <param name="from">The account to transfer from</param> |
97 | /// <param name="to">The account to transfer to</param> | 97 | /// <param name="to">The account to transfer to</param> |
98 | /// <param name="amount">The amount to transfer</param> | 98 | /// <param name="amount">The amount to transfer</param> |
99 | /// <returns>Successful?</returns> | 99 | /// <returns>Successful?</returns> |
100 | bool moneyTransferRequest(LLUUID from, LLUUID to, uint amount); | 100 | bool moneyTransferRequest(LLUUID from, LLUUID to, uint amount); |
101 | 101 | ||
102 | /// <summary> | 102 | /// <summary> |
103 | /// Attempts to move inventory between accounts, if inventory is copyable it will be copied into the target account. | 103 | /// Attempts to move inventory between accounts, if inventory is copyable it will be copied into the target account. |
104 | /// </summary> | 104 | /// </summary> |
105 | /// <param name="from">User to transfer from</param> | 105 | /// <param name="from">User to transfer from</param> |
106 | /// <param name="to">User to transfer to</param> | 106 | /// <param name="to">User to transfer to</param> |
107 | /// <param name="inventory">Specified inventory item</param> | 107 | /// <param name="inventory">Specified inventory item</param> |
108 | /// <returns>Successful?</returns> | 108 | /// <returns>Successful?</returns> |
109 | bool inventoryTransferRequest(LLUUID from, LLUUID to, LLUUID inventory); | 109 | bool inventoryTransferRequest(LLUUID from, LLUUID to, LLUUID inventory); |
110 | 110 | ||
111 | /// <summary> | 111 | /// <summary> |
112 | /// Returns the plugin version | 112 | /// Returns the plugin version |
113 | /// </summary> | 113 | /// </summary> |
114 | /// <returns>Plugin version in MAJOR.MINOR.REVISION.BUILD format</returns> | 114 | /// <returns>Plugin version in MAJOR.MINOR.REVISION.BUILD format</returns> |
115 | string getVersion(); | 115 | string getVersion(); |
116 | 116 | ||
117 | /// <summary> | 117 | /// <summary> |
118 | /// Returns the plugin name | 118 | /// Returns the plugin name |
119 | /// </summary> | 119 | /// </summary> |
120 | /// <returns>Plugin name, eg MySQL User Provider</returns> | 120 | /// <returns>Plugin name, eg MySQL User Provider</returns> |
121 | string getName(); | 121 | string getName(); |
122 | 122 | ||
123 | /// <summary> | 123 | /// <summary> |
124 | /// Initialises the plugin (artificial constructor) | 124 | /// Initialises the plugin (artificial constructor) |
125 | /// </summary> | 125 | /// </summary> |
126 | void Initialise(); | 126 | void Initialise(); |
127 | } | 127 | } |
128 | } | 128 | } |
diff --git a/OpenSim/Framework/Data/UserProfileData.cs b/OpenSim/Framework/Data/UserProfileData.cs index bb7d48c..88f956f 100644 --- a/OpenSim/Framework/Data/UserProfileData.cs +++ b/OpenSim/Framework/Data/UserProfileData.cs | |||
@@ -1,180 +1,180 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using System; | 28 | using System; |
29 | using libsecondlife; | 29 | using libsecondlife; |
30 | 30 | ||
31 | namespace OpenSim.Framework.Data | 31 | namespace OpenSim.Framework.Data |
32 | { | 32 | { |
33 | /// <summary> | 33 | /// <summary> |
34 | /// Information about a particular user known to the userserver | 34 | /// Information about a particular user known to the userserver |
35 | /// </summary> | 35 | /// </summary> |
36 | public class UserProfileData | 36 | public class UserProfileData |
37 | { | 37 | { |
38 | /// <summary> | 38 | /// <summary> |
39 | /// The ID value for this user | 39 | /// The ID value for this user |
40 | /// </summary> | 40 | /// </summary> |
41 | public LLUUID UUID; | 41 | public LLUUID UUID; |
42 | 42 | ||
43 | /// <summary> | 43 | /// <summary> |
44 | /// The first component of a users account name | 44 | /// The first component of a users account name |
45 | /// </summary> | 45 | /// </summary> |
46 | public string username; | 46 | public string username; |
47 | /// <summary> | 47 | /// <summary> |
48 | /// The second component of a users account name | 48 | /// The second component of a users account name |
49 | /// </summary> | 49 | /// </summary> |
50 | public string surname; | 50 | public string surname; |
51 | 51 | ||
52 | /// <summary> | 52 | /// <summary> |
53 | /// A salted hash containing the users password, in the format md5(md5(password) + ":" + salt) | 53 | /// A salted hash containing the users password, in the format md5(md5(password) + ":" + salt) |
54 | /// </summary> | 54 | /// </summary> |
55 | /// <remarks>This is double MD5'd because the client sends an unsalted MD5 to the loginserver</remarks> | 55 | /// <remarks>This is double MD5'd because the client sends an unsalted MD5 to the loginserver</remarks> |
56 | public string passwordHash; | 56 | public string passwordHash; |
57 | /// <summary> | 57 | /// <summary> |
58 | /// The salt used for the users hash, should be 32 bytes or longer | 58 | /// The salt used for the users hash, should be 32 bytes or longer |
59 | /// </summary> | 59 | /// </summary> |
60 | public string passwordSalt; | 60 | public string passwordSalt; |
61 | 61 | ||
62 | /// <summary> | 62 | /// <summary> |
63 | /// The regionhandle of the users preffered home region. If multiple sims occupy the same spot, the grid may decide which region the user logs into | 63 | /// The regionhandle of the users preffered home region. If multiple sims occupy the same spot, the grid may decide which region the user logs into |
64 | /// </summary> | 64 | /// </summary> |
65 | public ulong homeRegion; | 65 | public ulong homeRegion; |
66 | /// <summary> | 66 | /// <summary> |
67 | /// The coordinates inside the region of the home location | 67 | /// The coordinates inside the region of the home location |
68 | /// </summary> | 68 | /// </summary> |
69 | public LLVector3 homeLocation; | 69 | public LLVector3 homeLocation; |
70 | /// <summary> | 70 | /// <summary> |
71 | /// Where the user will be looking when they rez. | 71 | /// Where the user will be looking when they rez. |
72 | /// </summary> | 72 | /// </summary> |
73 | public LLVector3 homeLookAt; | 73 | public LLVector3 homeLookAt; |
74 | 74 | ||
75 | /// <summary> | 75 | /// <summary> |
76 | /// A UNIX Timestamp (seconds since epoch) for the users creation | 76 | /// A UNIX Timestamp (seconds since epoch) for the users creation |
77 | /// </summary> | 77 | /// </summary> |
78 | public int created; | 78 | public int created; |
79 | /// <summary> | 79 | /// <summary> |
80 | /// A UNIX Timestamp for the users last login date / time | 80 | /// A UNIX Timestamp for the users last login date / time |
81 | /// </summary> | 81 | /// </summary> |
82 | public int lastLogin; | 82 | public int lastLogin; |
83 | 83 | ||
84 | /// <summary> | 84 | /// <summary> |
85 | /// A URI to the users inventory server, used for foreigners and large grids | 85 | /// A URI to the users inventory server, used for foreigners and large grids |
86 | /// </summary> | 86 | /// </summary> |
87 | public string userInventoryURI; | 87 | public string userInventoryURI; |
88 | /// <summary> | 88 | /// <summary> |
89 | /// A URI to the users asset server, used for foreigners and large grids. | 89 | /// A URI to the users asset server, used for foreigners and large grids. |
90 | /// </summary> | 90 | /// </summary> |
91 | public string userAssetURI; | 91 | public string userAssetURI; |
92 | 92 | ||
93 | /// <summary> | 93 | /// <summary> |
94 | /// A uint mask containing the "I can do" fields of the users profile | 94 | /// A uint mask containing the "I can do" fields of the users profile |
95 | /// </summary> | 95 | /// </summary> |
96 | public uint profileCanDoMask; | 96 | public uint profileCanDoMask; |
97 | /// <summary> | 97 | /// <summary> |
98 | /// A uint mask containing the "I want to do" part of the users profile | 98 | /// A uint mask containing the "I want to do" part of the users profile |
99 | /// </summary> | 99 | /// </summary> |
100 | public uint profileWantDoMask; // Profile window "I want to" mask | 100 | public uint profileWantDoMask; // Profile window "I want to" mask |
101 | 101 | ||
102 | /// <summary> | 102 | /// <summary> |
103 | /// The about text listed in a users profile. | 103 | /// The about text listed in a users profile. |
104 | /// </summary> | 104 | /// </summary> |
105 | public string profileAboutText; | 105 | public string profileAboutText; |
106 | /// <summary> | 106 | /// <summary> |
107 | /// The first life about text listed in a users profile | 107 | /// The first life about text listed in a users profile |
108 | /// </summary> | 108 | /// </summary> |
109 | public string profileFirstText; | 109 | public string profileFirstText; |
110 | 110 | ||
111 | /// <summary> | 111 | /// <summary> |
112 | /// The profile image for an avatar stored on the asset server | 112 | /// The profile image for an avatar stored on the asset server |
113 | /// </summary> | 113 | /// </summary> |
114 | public LLUUID profileImage; | 114 | public LLUUID profileImage; |
115 | /// <summary> | 115 | /// <summary> |
116 | /// The profile image for the users first life tab | 116 | /// The profile image for the users first life tab |
117 | /// </summary> | 117 | /// </summary> |
118 | public LLUUID profileFirstImage; | 118 | public LLUUID profileFirstImage; |
119 | /// <summary> | 119 | /// <summary> |
120 | /// The users last registered agent (filled in on the user server) | 120 | /// The users last registered agent (filled in on the user server) |
121 | /// </summary> | 121 | /// </summary> |
122 | public UserAgentData currentAgent; | 122 | public UserAgentData currentAgent; |
123 | } | 123 | } |
124 | 124 | ||
125 | /// <summary> | 125 | /// <summary> |
126 | /// Information about a users session | 126 | /// Information about a users session |
127 | /// </summary> | 127 | /// </summary> |
128 | public class UserAgentData | 128 | public class UserAgentData |
129 | { | 129 | { |
130 | /// <summary> | 130 | /// <summary> |
131 | /// The UUID of the users avatar (not the agent!) | 131 | /// The UUID of the users avatar (not the agent!) |
132 | /// </summary> | 132 | /// </summary> |
133 | public LLUUID UUID; | 133 | public LLUUID UUID; |
134 | /// <summary> | 134 | /// <summary> |
135 | /// The IP address of the user | 135 | /// The IP address of the user |
136 | /// </summary> | 136 | /// </summary> |
137 | public string agentIP = String.Empty; | 137 | public string agentIP = String.Empty; |
138 | /// <summary> | 138 | /// <summary> |
139 | /// The port of the user | 139 | /// The port of the user |
140 | /// </summary> | 140 | /// </summary> |
141 | public uint agentPort; | 141 | public uint agentPort; |
142 | /// <summary> | 142 | /// <summary> |
143 | /// Is the user online? | 143 | /// Is the user online? |
144 | /// </summary> | 144 | /// </summary> |
145 | public bool agentOnline; | 145 | public bool agentOnline; |
146 | /// <summary> | 146 | /// <summary> |
147 | /// The session ID for the user (also the agent ID) | 147 | /// The session ID for the user (also the agent ID) |
148 | /// </summary> | 148 | /// </summary> |
149 | public LLUUID sessionID; | 149 | public LLUUID sessionID; |
150 | /// <summary> | 150 | /// <summary> |
151 | /// The "secure" session ID for the user | 151 | /// The "secure" session ID for the user |
152 | /// </summary> | 152 | /// </summary> |
153 | /// <remarks>Not very secure. Dont rely on it for anything more than Linden Lab does.</remarks> | 153 | /// <remarks>Not very secure. Dont rely on it for anything more than Linden Lab does.</remarks> |
154 | public LLUUID secureSessionID; | 154 | public LLUUID secureSessionID; |
155 | /// <summary> | 155 | /// <summary> |
156 | /// The region the user logged into initially | 156 | /// The region the user logged into initially |
157 | /// </summary> | 157 | /// </summary> |
158 | public LLUUID regionID; | 158 | public LLUUID regionID; |
159 | /// <summary> | 159 | /// <summary> |
160 | /// A unix timestamp from when the user logged in | 160 | /// A unix timestamp from when the user logged in |
161 | /// </summary> | 161 | /// </summary> |
162 | public int loginTime; | 162 | public int loginTime; |
163 | /// <summary> | 163 | /// <summary> |
164 | /// When this agent expired and logged out, 0 if still online | 164 | /// When this agent expired and logged out, 0 if still online |
165 | /// </summary> | 165 | /// </summary> |
166 | public int logoutTime; | 166 | public int logoutTime; |
167 | /// <summary> | 167 | /// <summary> |
168 | /// Current region the user is logged into | 168 | /// Current region the user is logged into |
169 | /// </summary> | 169 | /// </summary> |
170 | public LLUUID currentRegion; | 170 | public LLUUID currentRegion; |
171 | /// <summary> | 171 | /// <summary> |
172 | /// Region handle of the current region the user is in | 172 | /// Region handle of the current region the user is in |
173 | /// </summary> | 173 | /// </summary> |
174 | public ulong currentHandle; | 174 | public ulong currentHandle; |
175 | /// <summary> | 175 | /// <summary> |
176 | /// The position of the user within the region | 176 | /// The position of the user within the region |
177 | /// </summary> | 177 | /// </summary> |
178 | public LLVector3 currentPos; | 178 | public LLVector3 currentPos; |
179 | } | 179 | } |
180 | } | 180 | } |
diff --git a/OpenSim/Framework/General/AgentInventory.cs b/OpenSim/Framework/General/AgentInventory.cs index e45a0cd..0aeb0b3 100644 --- a/OpenSim/Framework/General/AgentInventory.cs +++ b/OpenSim/Framework/General/AgentInventory.cs | |||
@@ -1,265 +1,265 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using System.Collections.Generic; | 28 | using System.Collections.Generic; |
29 | using libsecondlife; | 29 | using libsecondlife; |
30 | using libsecondlife.Packets; | 30 | using libsecondlife.Packets; |
31 | using OpenSim.Framework.Types; | 31 | using OpenSim.Framework.Types; |
32 | using OpenSim.Framework.Utilities; | 32 | using OpenSim.Framework.Utilities; |
33 | 33 | ||
34 | namespace OpenSim.Framework.Inventory | 34 | namespace OpenSim.Framework.Inventory |
35 | { | 35 | { |
36 | public class AgentInventory | 36 | public class AgentInventory |
37 | { | 37 | { |
38 | //Holds the local copy of Inventory info for a agent | 38 | //Holds the local copy of Inventory info for a agent |
39 | public Dictionary<LLUUID, InventoryFolder> InventoryFolders; | 39 | public Dictionary<LLUUID, InventoryFolder> InventoryFolders; |
40 | public Dictionary<LLUUID, InventoryItem> InventoryItems; | 40 | public Dictionary<LLUUID, InventoryItem> InventoryItems; |
41 | public InventoryFolder InventoryRoot; | 41 | public InventoryFolder InventoryRoot; |
42 | public int LastCached; //maybe used by opensim app, time this was last stored/compared to user server | 42 | public int LastCached; //maybe used by opensim app, time this was last stored/compared to user server |
43 | public LLUUID AgentID; | 43 | public LLUUID AgentID; |
44 | public AvatarWearable[] Wearables; | 44 | public AvatarWearable[] Wearables; |
45 | 45 | ||
46 | public AgentInventory() | 46 | public AgentInventory() |
47 | { | 47 | { |
48 | InventoryFolders = new Dictionary<LLUUID, InventoryFolder>(); | 48 | InventoryFolders = new Dictionary<LLUUID, InventoryFolder>(); |
49 | InventoryItems = new Dictionary<LLUUID, InventoryItem>(); | 49 | InventoryItems = new Dictionary<LLUUID, InventoryItem>(); |
50 | this.Initialise(); | 50 | this.Initialise(); |
51 | } | 51 | } |
52 | 52 | ||
53 | public virtual void Initialise() | 53 | public virtual void Initialise() |
54 | { | 54 | { |
55 | Wearables = new AvatarWearable[13]; //should be 12 of these | 55 | Wearables = new AvatarWearable[13]; //should be 12 of these |
56 | for (int i = 0; i < 13; i++) | 56 | for (int i = 0; i < 13; i++) |
57 | { | 57 | { |
58 | Wearables[i] = new AvatarWearable(); | 58 | Wearables[i] = new AvatarWearable(); |
59 | } | 59 | } |
60 | 60 | ||
61 | } | 61 | } |
62 | 62 | ||
63 | public bool CreateNewFolder(LLUUID folderID, ushort type) | 63 | public bool CreateNewFolder(LLUUID folderID, ushort type) |
64 | { | 64 | { |
65 | InventoryFolder Folder = new InventoryFolder(); | 65 | InventoryFolder Folder = new InventoryFolder(); |
66 | Folder.FolderID = folderID; | 66 | Folder.FolderID = folderID; |
67 | Folder.OwnerID = this.AgentID; | 67 | Folder.OwnerID = this.AgentID; |
68 | Folder.DefaultType = type; | 68 | Folder.DefaultType = type; |
69 | this.InventoryFolders.Add(Folder.FolderID, Folder); | 69 | this.InventoryFolders.Add(Folder.FolderID, Folder); |
70 | return (true); | 70 | return (true); |
71 | } | 71 | } |
72 | 72 | ||
73 | public void CreateRootFolder(LLUUID newAgentID, bool createTextures) | 73 | public void CreateRootFolder(LLUUID newAgentID, bool createTextures) |
74 | { | 74 | { |
75 | this.AgentID = newAgentID; | 75 | this.AgentID = newAgentID; |
76 | InventoryRoot = new InventoryFolder(); | 76 | InventoryRoot = new InventoryFolder(); |
77 | InventoryRoot.FolderID = LLUUID.Random(); | 77 | InventoryRoot.FolderID = LLUUID.Random(); |
78 | InventoryRoot.ParentID = new LLUUID(); | 78 | InventoryRoot.ParentID = new LLUUID(); |
79 | InventoryRoot.Version = 1; | 79 | InventoryRoot.Version = 1; |
80 | InventoryRoot.DefaultType = 8; | 80 | InventoryRoot.DefaultType = 8; |
81 | InventoryRoot.OwnerID = this.AgentID; | 81 | InventoryRoot.OwnerID = this.AgentID; |
82 | InventoryRoot.FolderName = "My Inventory"; | 82 | InventoryRoot.FolderName = "My Inventory"; |
83 | InventoryFolders.Add(InventoryRoot.FolderID, InventoryRoot); | 83 | InventoryFolders.Add(InventoryRoot.FolderID, InventoryRoot); |
84 | InventoryRoot.OwnerID = this.AgentID; | 84 | InventoryRoot.OwnerID = this.AgentID; |
85 | if (createTextures) | 85 | if (createTextures) |
86 | { | 86 | { |
87 | this.CreateNewFolder(LLUUID.Random(), 0, "Textures", InventoryRoot.FolderID); | 87 | this.CreateNewFolder(LLUUID.Random(), 0, "Textures", InventoryRoot.FolderID); |
88 | } | 88 | } |
89 | } | 89 | } |
90 | 90 | ||
91 | public bool CreateNewFolder(LLUUID folderID, ushort type, string folderName) | 91 | public bool CreateNewFolder(LLUUID folderID, ushort type, string folderName) |
92 | { | 92 | { |
93 | InventoryFolder Folder = new InventoryFolder(); | 93 | InventoryFolder Folder = new InventoryFolder(); |
94 | Folder.FolderID = folderID; | 94 | Folder.FolderID = folderID; |
95 | Folder.OwnerID = this.AgentID; | 95 | Folder.OwnerID = this.AgentID; |
96 | Folder.DefaultType = type; | 96 | Folder.DefaultType = type; |
97 | Folder.FolderName = folderName; | 97 | Folder.FolderName = folderName; |
98 | this.InventoryFolders.Add(Folder.FolderID, Folder); | 98 | this.InventoryFolders.Add(Folder.FolderID, Folder); |
99 | 99 | ||
100 | return (true); | 100 | return (true); |
101 | } | 101 | } |
102 | 102 | ||
103 | public bool CreateNewFolder(LLUUID folderID, ushort type, string folderName, LLUUID parent) | 103 | public bool CreateNewFolder(LLUUID folderID, ushort type, string folderName, LLUUID parent) |
104 | { | 104 | { |
105 | if (!this.InventoryFolders.ContainsKey(folderID)) | 105 | if (!this.InventoryFolders.ContainsKey(folderID)) |
106 | { | 106 | { |
107 | System.Console.WriteLine("creating new folder called " + folderName + " in agents inventory"); | 107 | System.Console.WriteLine("creating new folder called " + folderName + " in agents inventory"); |
108 | InventoryFolder Folder = new InventoryFolder(); | 108 | InventoryFolder Folder = new InventoryFolder(); |
109 | Folder.FolderID = folderID; | 109 | Folder.FolderID = folderID; |
110 | Folder.OwnerID = this.AgentID; | 110 | Folder.OwnerID = this.AgentID; |
111 | Folder.DefaultType = type; | 111 | Folder.DefaultType = type; |
112 | Folder.FolderName = folderName; | 112 | Folder.FolderName = folderName; |
113 | Folder.ParentID = parent; | 113 | Folder.ParentID = parent; |
114 | this.InventoryFolders.Add(Folder.FolderID, Folder); | 114 | this.InventoryFolders.Add(Folder.FolderID, Folder); |
115 | } | 115 | } |
116 | 116 | ||
117 | return (true); | 117 | return (true); |
118 | } | 118 | } |
119 | 119 | ||
120 | public bool HasFolder(LLUUID folderID) | 120 | public bool HasFolder(LLUUID folderID) |
121 | { | 121 | { |
122 | if (this.InventoryFolders.ContainsKey(folderID)) | 122 | if (this.InventoryFolders.ContainsKey(folderID)) |
123 | { | 123 | { |
124 | return true; | 124 | return true; |
125 | } | 125 | } |
126 | return false; | 126 | return false; |
127 | } | 127 | } |
128 | 128 | ||
129 | public LLUUID GetFolderID(string folderName) | 129 | public LLUUID GetFolderID(string folderName) |
130 | { | 130 | { |
131 | foreach (InventoryFolder inv in this.InventoryFolders.Values) | 131 | foreach (InventoryFolder inv in this.InventoryFolders.Values) |
132 | { | 132 | { |
133 | if (inv.FolderName == folderName) | 133 | if (inv.FolderName == folderName) |
134 | { | 134 | { |
135 | return inv.FolderID; | 135 | return inv.FolderID; |
136 | } | 136 | } |
137 | } | 137 | } |
138 | 138 | ||
139 | return LLUUID.Zero; | 139 | return LLUUID.Zero; |
140 | } | 140 | } |
141 | 141 | ||
142 | public bool UpdateItemAsset(LLUUID itemID, AssetBase asset) | 142 | public bool UpdateItemAsset(LLUUID itemID, AssetBase asset) |
143 | { | 143 | { |
144 | if(this.InventoryItems.ContainsKey(itemID)) | 144 | if(this.InventoryItems.ContainsKey(itemID)) |
145 | { | 145 | { |
146 | InventoryItem Item = this.InventoryItems[itemID]; | 146 | InventoryItem Item = this.InventoryItems[itemID]; |
147 | Item.AssetID = asset.FullID; | 147 | Item.AssetID = asset.FullID; |
148 | System.Console.WriteLine("updated inventory item " + itemID.ToStringHyphenated() + " so it now is set to asset " + asset.FullID.ToStringHyphenated()); | 148 | System.Console.WriteLine("updated inventory item " + itemID.ToStringHyphenated() + " so it now is set to asset " + asset.FullID.ToStringHyphenated()); |
149 | //TODO need to update the rest of the info | 149 | //TODO need to update the rest of the info |
150 | } | 150 | } |
151 | return true; | 151 | return true; |
152 | } | 152 | } |
153 | 153 | ||
154 | public bool UpdateItemDetails(LLUUID itemID, UpdateInventoryItemPacket.InventoryDataBlock packet) | 154 | public bool UpdateItemDetails(LLUUID itemID, UpdateInventoryItemPacket.InventoryDataBlock packet) |
155 | { | 155 | { |
156 | System.Console.WriteLine("updating inventory item details"); | 156 | System.Console.WriteLine("updating inventory item details"); |
157 | if (this.InventoryItems.ContainsKey(itemID)) | 157 | if (this.InventoryItems.ContainsKey(itemID)) |
158 | { | 158 | { |
159 | System.Console.WriteLine("changing name to "+ Util.FieldToString(packet.Name)); | 159 | System.Console.WriteLine("changing name to "+ Util.FieldToString(packet.Name)); |
160 | InventoryItem Item = this.InventoryItems[itemID]; | 160 | InventoryItem Item = this.InventoryItems[itemID]; |
161 | Item.Name = Util.FieldToString(packet.Name); | 161 | Item.Name = Util.FieldToString(packet.Name); |
162 | System.Console.WriteLine("updated inventory item " + itemID.ToStringHyphenated()); | 162 | System.Console.WriteLine("updated inventory item " + itemID.ToStringHyphenated()); |
163 | //TODO need to update the rest of the info | 163 | //TODO need to update the rest of the info |
164 | } | 164 | } |
165 | return true; | 165 | return true; |
166 | } | 166 | } |
167 | 167 | ||
168 | public LLUUID AddToInventory(LLUUID folderID, AssetBase asset) | 168 | public LLUUID AddToInventory(LLUUID folderID, AssetBase asset) |
169 | { | 169 | { |
170 | if (this.InventoryFolders.ContainsKey(folderID)) | 170 | if (this.InventoryFolders.ContainsKey(folderID)) |
171 | { | 171 | { |
172 | LLUUID NewItemID = LLUUID.Random(); | 172 | LLUUID NewItemID = LLUUID.Random(); |
173 | 173 | ||
174 | InventoryItem Item = new InventoryItem(); | 174 | InventoryItem Item = new InventoryItem(); |
175 | Item.FolderID = folderID; | 175 | Item.FolderID = folderID; |
176 | Item.OwnerID = AgentID; | 176 | Item.OwnerID = AgentID; |
177 | Item.AssetID = asset.FullID; | 177 | Item.AssetID = asset.FullID; |
178 | Item.ItemID = NewItemID; | 178 | Item.ItemID = NewItemID; |
179 | Item.Type = asset.Type; | 179 | Item.Type = asset.Type; |
180 | Item.Name = asset.Name; | 180 | Item.Name = asset.Name; |
181 | Item.Description = asset.Description; | 181 | Item.Description = asset.Description; |
182 | Item.InvType = asset.InvType; | 182 | Item.InvType = asset.InvType; |
183 | this.InventoryItems.Add(Item.ItemID, Item); | 183 | this.InventoryItems.Add(Item.ItemID, Item); |
184 | InventoryFolder Folder = InventoryFolders[Item.FolderID]; | 184 | InventoryFolder Folder = InventoryFolders[Item.FolderID]; |
185 | Folder.Items.Add(Item); | 185 | Folder.Items.Add(Item); |
186 | return (Item.ItemID); | 186 | return (Item.ItemID); |
187 | } | 187 | } |
188 | else | 188 | else |
189 | { | 189 | { |
190 | return (null); | 190 | return (null); |
191 | } | 191 | } |
192 | } | 192 | } |
193 | 193 | ||
194 | public bool DeleteFromInventory(LLUUID itemID) | 194 | public bool DeleteFromInventory(LLUUID itemID) |
195 | { | 195 | { |
196 | bool res = false; | 196 | bool res = false; |
197 | if (this.InventoryItems.ContainsKey(itemID)) | 197 | if (this.InventoryItems.ContainsKey(itemID)) |
198 | { | 198 | { |
199 | InventoryItem item = this.InventoryItems[itemID]; | 199 | InventoryItem item = this.InventoryItems[itemID]; |
200 | this.InventoryItems.Remove(itemID); | 200 | this.InventoryItems.Remove(itemID); |
201 | foreach (InventoryFolder fold in InventoryFolders.Values) | 201 | foreach (InventoryFolder fold in InventoryFolders.Values) |
202 | { | 202 | { |
203 | if (fold.Items.Contains(item)) | 203 | if (fold.Items.Contains(item)) |
204 | { | 204 | { |
205 | fold.Items.Remove(item); | 205 | fold.Items.Remove(item); |
206 | break; | 206 | break; |
207 | } | 207 | } |
208 | } | 208 | } |
209 | res = true; | 209 | res = true; |
210 | 210 | ||
211 | } | 211 | } |
212 | return res; | 212 | return res; |
213 | } | 213 | } |
214 | } | 214 | } |
215 | 215 | ||
216 | public class InventoryFolder | 216 | public class InventoryFolder |
217 | { | 217 | { |
218 | public List<InventoryItem> Items; | 218 | public List<InventoryItem> Items; |
219 | //public List<InventoryFolder> Subfolders; | 219 | //public List<InventoryFolder> Subfolders; |
220 | public LLUUID FolderID; | 220 | public LLUUID FolderID; |
221 | public LLUUID OwnerID; | 221 | public LLUUID OwnerID; |
222 | public LLUUID ParentID = LLUUID.Zero; | 222 | public LLUUID ParentID = LLUUID.Zero; |
223 | public string FolderName; | 223 | public string FolderName; |
224 | public ushort DefaultType; | 224 | public ushort DefaultType; |
225 | public ushort Version; | 225 | public ushort Version; |
226 | 226 | ||
227 | public InventoryFolder() | 227 | public InventoryFolder() |
228 | { | 228 | { |
229 | Items = new List<InventoryItem>(); | 229 | Items = new List<InventoryItem>(); |
230 | //Subfolders = new List<InventoryFolder>(); | 230 | //Subfolders = new List<InventoryFolder>(); |
231 | } | 231 | } |
232 | 232 | ||
233 | } | 233 | } |
234 | 234 | ||
235 | public class InventoryItem | 235 | public class InventoryItem |
236 | { | 236 | { |
237 | public LLUUID FolderID; | 237 | public LLUUID FolderID; |
238 | public LLUUID OwnerID; | 238 | public LLUUID OwnerID; |
239 | public LLUUID ItemID; | 239 | public LLUUID ItemID; |
240 | public LLUUID AssetID; | 240 | public LLUUID AssetID; |
241 | public LLUUID CreatorID; | 241 | public LLUUID CreatorID; |
242 | public sbyte InvType; | 242 | public sbyte InvType; |
243 | public sbyte Type; | 243 | public sbyte Type; |
244 | public string Name =""; | 244 | public string Name =""; |
245 | public string Description; | 245 | public string Description; |
246 | 246 | ||
247 | public InventoryItem() | 247 | public InventoryItem() |
248 | { | 248 | { |
249 | this.CreatorID = LLUUID.Zero; | 249 | this.CreatorID = LLUUID.Zero; |
250 | } | 250 | } |
251 | 251 | ||
252 | public string ExportString() | 252 | public string ExportString() |
253 | { | 253 | { |
254 | string typ = "notecard"; | 254 | string typ = "notecard"; |
255 | string result = ""; | 255 | string result = ""; |
256 | result += "\tinv_object\t0\n\t{\n"; | 256 | result += "\tinv_object\t0\n\t{\n"; |
257 | result += "\t\tobj_id\t%s\n"; | 257 | result += "\t\tobj_id\t%s\n"; |
258 | result += "\t\tparent_id\t"+ ItemID.ToString() +"\n"; | 258 | result += "\t\tparent_id\t"+ ItemID.ToString() +"\n"; |
259 | result += "\t\ttype\t"+ typ +"\n"; | 259 | result += "\t\ttype\t"+ typ +"\n"; |
260 | result += "\t\tname\t" + Name+"|\n"; | 260 | result += "\t\tname\t" + Name+"|\n"; |
261 | result += "\t}\n"; | 261 | result += "\t}\n"; |
262 | return result; | 262 | return result; |
263 | } | 263 | } |
264 | } | 264 | } |
265 | } | 265 | } |
diff --git a/OpenSim/Framework/General/AuthenticateSessionBase.cs b/OpenSim/Framework/General/AuthenticateSessionBase.cs index 71616e3..2d02286 100644 --- a/OpenSim/Framework/General/AuthenticateSessionBase.cs +++ b/OpenSim/Framework/General/AuthenticateSessionBase.cs | |||
@@ -1,130 +1,130 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using System.Collections.Generic; | 28 | using System.Collections.Generic; |
29 | using libsecondlife; | 29 | using libsecondlife; |
30 | using OpenSim.Framework.Interfaces; | 30 | using OpenSim.Framework.Interfaces; |
31 | using OpenSim.Framework.Types; | 31 | using OpenSim.Framework.Types; |
32 | 32 | ||
33 | namespace OpenSim.Framework | 33 | namespace OpenSim.Framework |
34 | { | 34 | { |
35 | public class AuthenticateSessionsBase | 35 | public class AuthenticateSessionsBase |
36 | { | 36 | { |
37 | public Dictionary<uint, AgentCircuitData> AgentCircuits = new Dictionary<uint, AgentCircuitData>(); | 37 | public Dictionary<uint, AgentCircuitData> AgentCircuits = new Dictionary<uint, AgentCircuitData>(); |
38 | 38 | ||
39 | public AuthenticateSessionsBase() | 39 | public AuthenticateSessionsBase() |
40 | { | 40 | { |
41 | 41 | ||
42 | } | 42 | } |
43 | 43 | ||
44 | public virtual AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitcode) | 44 | public virtual AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitcode) |
45 | { | 45 | { |
46 | AgentCircuitData validcircuit = null; | 46 | AgentCircuitData validcircuit = null; |
47 | if (this.AgentCircuits.ContainsKey(circuitcode)) | 47 | if (this.AgentCircuits.ContainsKey(circuitcode)) |
48 | { | 48 | { |
49 | validcircuit = this.AgentCircuits[circuitcode]; | 49 | validcircuit = this.AgentCircuits[circuitcode]; |
50 | } | 50 | } |
51 | AuthenticateResponse user = new AuthenticateResponse(); | 51 | AuthenticateResponse user = new AuthenticateResponse(); |
52 | if (validcircuit == null) | 52 | if (validcircuit == null) |
53 | { | 53 | { |
54 | //don't have this circuit code in our list | 54 | //don't have this circuit code in our list |
55 | user.Authorised = false; | 55 | user.Authorised = false; |
56 | return (user); | 56 | return (user); |
57 | } | 57 | } |
58 | 58 | ||
59 | if ((sessionID == validcircuit.SessionID) && (agentID == validcircuit.AgentID)) | 59 | if ((sessionID == validcircuit.SessionID) && (agentID == validcircuit.AgentID)) |
60 | { | 60 | { |
61 | user.Authorised = true; | 61 | user.Authorised = true; |
62 | user.LoginInfo = new Login(); | 62 | user.LoginInfo = new Login(); |
63 | user.LoginInfo.Agent = agentID; | 63 | user.LoginInfo.Agent = agentID; |
64 | user.LoginInfo.Session = sessionID; | 64 | user.LoginInfo.Session = sessionID; |
65 | user.LoginInfo.SecureSession = validcircuit.SecureSessionID; | 65 | user.LoginInfo.SecureSession = validcircuit.SecureSessionID; |
66 | user.LoginInfo.First = validcircuit.firstname; | 66 | user.LoginInfo.First = validcircuit.firstname; |
67 | user.LoginInfo.Last = validcircuit.lastname; | 67 | user.LoginInfo.Last = validcircuit.lastname; |
68 | user.LoginInfo.InventoryFolder = validcircuit.InventoryFolder; | 68 | user.LoginInfo.InventoryFolder = validcircuit.InventoryFolder; |
69 | user.LoginInfo.BaseFolder = validcircuit.BaseFolder; | 69 | user.LoginInfo.BaseFolder = validcircuit.BaseFolder; |
70 | } | 70 | } |
71 | else | 71 | else |
72 | { | 72 | { |
73 | // Invalid | 73 | // Invalid |
74 | user.Authorised = false; | 74 | user.Authorised = false; |
75 | } | 75 | } |
76 | 76 | ||
77 | return (user); | 77 | return (user); |
78 | } | 78 | } |
79 | 79 | ||
80 | public virtual void AddNewCircuit(uint circuitCode, AgentCircuitData agentData) | 80 | public virtual void AddNewCircuit(uint circuitCode, AgentCircuitData agentData) |
81 | { | 81 | { |
82 | if (this.AgentCircuits.ContainsKey(circuitCode)) | 82 | if (this.AgentCircuits.ContainsKey(circuitCode)) |
83 | { | 83 | { |
84 | this.AgentCircuits[circuitCode] = agentData; | 84 | this.AgentCircuits[circuitCode] = agentData; |
85 | } | 85 | } |
86 | else | 86 | else |
87 | { | 87 | { |
88 | this.AgentCircuits.Add(circuitCode, agentData); | 88 | this.AgentCircuits.Add(circuitCode, agentData); |
89 | } | 89 | } |
90 | } | 90 | } |
91 | 91 | ||
92 | public LLVector3 GetPosition(uint circuitCode) | 92 | public LLVector3 GetPosition(uint circuitCode) |
93 | { | 93 | { |
94 | LLVector3 vec = new LLVector3(); | 94 | LLVector3 vec = new LLVector3(); |
95 | if (this.AgentCircuits.ContainsKey(circuitCode)) | 95 | if (this.AgentCircuits.ContainsKey(circuitCode)) |
96 | { | 96 | { |
97 | vec = this.AgentCircuits[circuitCode].startpos; | 97 | vec = this.AgentCircuits[circuitCode].startpos; |
98 | } | 98 | } |
99 | return vec; | 99 | return vec; |
100 | } | 100 | } |
101 | 101 | ||
102 | public void UpdateAgentData(AgentCircuitData agentData) | 102 | public void UpdateAgentData(AgentCircuitData agentData) |
103 | { | 103 | { |
104 | if (this.AgentCircuits.ContainsKey((uint)agentData.circuitcode)) | 104 | if (this.AgentCircuits.ContainsKey((uint)agentData.circuitcode)) |
105 | { | 105 | { |
106 | this.AgentCircuits[(uint)agentData.circuitcode].firstname = agentData.firstname; | 106 | this.AgentCircuits[(uint)agentData.circuitcode].firstname = agentData.firstname; |
107 | this.AgentCircuits[(uint)agentData.circuitcode].lastname = agentData.lastname; | 107 | this.AgentCircuits[(uint)agentData.circuitcode].lastname = agentData.lastname; |
108 | this.AgentCircuits[(uint)agentData.circuitcode].startpos = agentData.startpos; | 108 | this.AgentCircuits[(uint)agentData.circuitcode].startpos = agentData.startpos; |
109 | // Console.WriteLine("update user start pos is " + agentData.startpos.X + " , " + agentData.startpos.Y + " , " + agentData.startpos.Z); | 109 | // Console.WriteLine("update user start pos is " + agentData.startpos.X + " , " + agentData.startpos.Y + " , " + agentData.startpos.Z); |
110 | } | 110 | } |
111 | } | 111 | } |
112 | 112 | ||
113 | public void UpdateAgentChildStatus(uint circuitcode, bool childstatus) | 113 | public void UpdateAgentChildStatus(uint circuitcode, bool childstatus) |
114 | { | 114 | { |
115 | if (this.AgentCircuits.ContainsKey(circuitcode)) | 115 | if (this.AgentCircuits.ContainsKey(circuitcode)) |
116 | { | 116 | { |
117 | this.AgentCircuits[circuitcode].child = childstatus; | 117 | this.AgentCircuits[circuitcode].child = childstatus; |
118 | } | 118 | } |
119 | } | 119 | } |
120 | 120 | ||
121 | public bool GetAgentChildStatus(uint circuitcode) | 121 | public bool GetAgentChildStatus(uint circuitcode) |
122 | { | 122 | { |
123 | if (this.AgentCircuits.ContainsKey(circuitcode)) | 123 | if (this.AgentCircuits.ContainsKey(circuitcode)) |
124 | { | 124 | { |
125 | return this.AgentCircuits[circuitcode].child; | 125 | return this.AgentCircuits[circuitcode].child; |
126 | } | 126 | } |
127 | return false; | 127 | return false; |
128 | } | 128 | } |
129 | } | 129 | } |
130 | } \ No newline at end of file | 130 | } \ No newline at end of file |
diff --git a/OpenSim/Framework/General/BlockingQueue.cs b/OpenSim/Framework/General/BlockingQueue.cs index 0cc8124..e263d71 100644 --- a/OpenSim/Framework/General/BlockingQueue.cs +++ b/OpenSim/Framework/General/BlockingQueue.cs | |||
@@ -1,58 +1,58 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using System.Collections.Generic; | 28 | using System.Collections.Generic; |
29 | using System.Threading; | 29 | using System.Threading; |
30 | 30 | ||
31 | namespace OpenSim.Framework.Utilities | 31 | namespace OpenSim.Framework.Utilities |
32 | { | 32 | { |
33 | public class BlockingQueue<T> | 33 | public class BlockingQueue<T> |
34 | { | 34 | { |
35 | private Queue<T> _queue = new Queue<T>(); | 35 | private Queue<T> _queue = new Queue<T>(); |
36 | private object _queueSync = new object(); | 36 | private object _queueSync = new object(); |
37 | 37 | ||
38 | public void Enqueue(T value) | 38 | public void Enqueue(T value) |
39 | { | 39 | { |
40 | lock (_queueSync) | 40 | lock (_queueSync) |
41 | { | 41 | { |
42 | _queue.Enqueue(value); | 42 | _queue.Enqueue(value); |
43 | Monitor.Pulse(_queueSync); | 43 | Monitor.Pulse(_queueSync); |
44 | } | 44 | } |
45 | } | 45 | } |
46 | 46 | ||
47 | public T Dequeue() | 47 | public T Dequeue() |
48 | { | 48 | { |
49 | lock (_queueSync) | 49 | lock (_queueSync) |
50 | { | 50 | { |
51 | if (_queue.Count < 1) | 51 | if (_queue.Count < 1) |
52 | Monitor.Wait(_queueSync); | 52 | Monitor.Wait(_queueSync); |
53 | 53 | ||
54 | return _queue.Dequeue(); | 54 | return _queue.Dequeue(); |
55 | } | 55 | } |
56 | } | 56 | } |
57 | } | 57 | } |
58 | } | 58 | } |
diff --git a/OpenSim/Framework/General/ClientManager.cs b/OpenSim/Framework/General/ClientManager.cs index b560ca8..0e45d03 100644 --- a/OpenSim/Framework/General/ClientManager.cs +++ b/OpenSim/Framework/General/ClientManager.cs | |||
@@ -1,36 +1,36 @@ | |||
1 | using System; | 1 | using System; |
2 | using System.Collections.Generic; | 2 | using System.Collections.Generic; |
3 | using System.Text; | 3 | using System.Text; |
4 | using OpenSim.Framework.Interfaces; | 4 | using OpenSim.Framework.Interfaces; |
5 | 5 | ||
6 | namespace OpenSim.Framework | 6 | namespace OpenSim.Framework |
7 | { | 7 | { |
8 | public delegate void ForEachClientDelegate( IClientAPI client ); | 8 | public delegate void ForEachClientDelegate( IClientAPI client ); |
9 | public class ClientManager | 9 | public class ClientManager |
10 | { | 10 | { |
11 | private Dictionary<uint, IClientAPI> m_clients; | 11 | private Dictionary<uint, IClientAPI> m_clients; |
12 | 12 | ||
13 | public void ForEachClient(ForEachClientDelegate whatToDo) | 13 | public void ForEachClient(ForEachClientDelegate whatToDo) |
14 | { | 14 | { |
15 | foreach (IClientAPI client in m_clients.Values) | 15 | foreach (IClientAPI client in m_clients.Values) |
16 | { | 16 | { |
17 | whatToDo(client); | 17 | whatToDo(client); |
18 | } | 18 | } |
19 | } | 19 | } |
20 | 20 | ||
21 | public ClientManager() | 21 | public ClientManager() |
22 | { | 22 | { |
23 | m_clients = new Dictionary<uint, IClientAPI>(); | 23 | m_clients = new Dictionary<uint, IClientAPI>(); |
24 | } | 24 | } |
25 | 25 | ||
26 | public void Remove(uint id) | 26 | public void Remove(uint id) |
27 | { | 27 | { |
28 | m_clients.Remove(id); | 28 | m_clients.Remove(id); |
29 | } | 29 | } |
30 | 30 | ||
31 | public void Add(uint id, IClientAPI client ) | 31 | public void Add(uint id, IClientAPI client ) |
32 | { | 32 | { |
33 | m_clients.Add( id, client ); | 33 | m_clients.Add( id, client ); |
34 | } | 34 | } |
35 | } | 35 | } |
36 | } | 36 | } |
diff --git a/OpenSim/Framework/General/IRegionCommsListener.cs b/OpenSim/Framework/General/IRegionCommsListener.cs index 32444f9..81da5d4 100644 --- a/OpenSim/Framework/General/IRegionCommsListener.cs +++ b/OpenSim/Framework/General/IRegionCommsListener.cs | |||
@@ -1,46 +1,46 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using System.Collections.Generic; | 28 | using System.Collections.Generic; |
29 | using libsecondlife; | 29 | using libsecondlife; |
30 | using OpenSim.Framework.Interfaces; | 30 | using OpenSim.Framework.Interfaces; |
31 | using OpenSim.Framework.Types; | 31 | using OpenSim.Framework.Types; |
32 | 32 | ||
33 | namespace OpenSim.Framework | 33 | namespace OpenSim.Framework |
34 | { | 34 | { |
35 | public delegate void ExpectUserDelegate(ulong regionHandle, AgentCircuitData agent); | 35 | public delegate void ExpectUserDelegate(ulong regionHandle, AgentCircuitData agent); |
36 | public delegate void UpdateNeighbours(List<RegionInfo> neighbours); | 36 | public delegate void UpdateNeighbours(List<RegionInfo> neighbours); |
37 | public delegate void AgentCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position); | 37 | public delegate void AgentCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position); |
38 | 38 | ||
39 | public interface IRegionCommsListener | 39 | public interface IRegionCommsListener |
40 | { | 40 | { |
41 | event ExpectUserDelegate OnExpectUser; | 41 | event ExpectUserDelegate OnExpectUser; |
42 | event GenericCall2 OnExpectChildAgent; | 42 | event GenericCall2 OnExpectChildAgent; |
43 | event AgentCrossing OnAvatarCrossingIntoRegion; | 43 | event AgentCrossing OnAvatarCrossingIntoRegion; |
44 | event UpdateNeighbours OnNeighboursUpdate; | 44 | event UpdateNeighbours OnNeighboursUpdate; |
45 | } | 45 | } |
46 | } | 46 | } |
diff --git a/OpenSim/Framework/General/Interfaces/AuthenticateResponse.cs b/OpenSim/Framework/General/Interfaces/AuthenticateResponse.cs index 508485b..7c49785 100644 --- a/OpenSim/Framework/General/Interfaces/AuthenticateResponse.cs +++ b/OpenSim/Framework/General/Interfaces/AuthenticateResponse.cs | |||
@@ -1,43 +1,43 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using OpenSim.Framework.Types; | 28 | using OpenSim.Framework.Types; |
29 | 29 | ||
30 | namespace OpenSim.Framework.Interfaces | 30 | namespace OpenSim.Framework.Interfaces |
31 | { | 31 | { |
32 | public class AuthenticateResponse | 32 | public class AuthenticateResponse |
33 | { | 33 | { |
34 | public bool Authorised; | 34 | public bool Authorised; |
35 | public Login LoginInfo; | 35 | public Login LoginInfo; |
36 | 36 | ||
37 | public AuthenticateResponse() | 37 | public AuthenticateResponse() |
38 | { | 38 | { |
39 | 39 | ||
40 | } | 40 | } |
41 | 41 | ||
42 | } | 42 | } |
43 | } | 43 | } |
diff --git a/OpenSim/Framework/General/Interfaces/Config/IGenericConfig.cs b/OpenSim/Framework/General/Interfaces/Config/IGenericConfig.cs index 2c379dd..57aa0c0 100644 --- a/OpenSim/Framework/General/Interfaces/Config/IGenericConfig.cs +++ b/OpenSim/Framework/General/Interfaces/Config/IGenericConfig.cs | |||
@@ -1,38 +1,38 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | namespace OpenSim.Framework.Interfaces | 28 | namespace OpenSim.Framework.Interfaces |
29 | { | 29 | { |
30 | public interface IGenericConfig | 30 | public interface IGenericConfig |
31 | { | 31 | { |
32 | void LoadData(); | 32 | void LoadData(); |
33 | string GetAttribute(string attributeName); | 33 | string GetAttribute(string attributeName); |
34 | bool SetAttribute(string attributeName, string attributeValue); | 34 | bool SetAttribute(string attributeName, string attributeValue); |
35 | void Commit(); | 35 | void Commit(); |
36 | void Close(); | 36 | void Close(); |
37 | } | 37 | } |
38 | } | 38 | } |
diff --git a/OpenSim/Framework/General/Interfaces/Config/IGridConfig.cs b/OpenSim/Framework/General/Interfaces/Config/IGridConfig.cs index 81dc293..20cc320 100644 --- a/OpenSim/Framework/General/Interfaces/Config/IGridConfig.cs +++ b/OpenSim/Framework/General/Interfaces/Config/IGridConfig.cs | |||
@@ -1,59 +1,59 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 OpenSim.world; | 29 | //using OpenSim.world; |
30 | 30 | ||
31 | namespace OpenSim.Framework.Interfaces | 31 | namespace OpenSim.Framework.Interfaces |
32 | { | 32 | { |
33 | /// <summary> | 33 | /// <summary> |
34 | /// </summary> | 34 | /// </summary> |
35 | 35 | ||
36 | 36 | ||
37 | public abstract class GridConfig | 37 | public abstract class GridConfig |
38 | { | 38 | { |
39 | public string GridOwner; | 39 | public string GridOwner; |
40 | public string DefaultStartupMsg; | 40 | public string DefaultStartupMsg; |
41 | public string DefaultAssetServer; | 41 | public string DefaultAssetServer; |
42 | public string AssetSendKey; | 42 | public string AssetSendKey; |
43 | public string AssetRecvKey; | 43 | public string AssetRecvKey; |
44 | public string DefaultUserServer; | 44 | public string DefaultUserServer; |
45 | public string UserSendKey; | 45 | public string UserSendKey; |
46 | public string UserRecvKey; | 46 | public string UserRecvKey; |
47 | public string SimSendKey; | 47 | public string SimSendKey; |
48 | public string SimRecvKey; | 48 | public string SimRecvKey; |
49 | 49 | ||
50 | 50 | ||
51 | public abstract void InitConfig(); | 51 | public abstract void InitConfig(); |
52 | 52 | ||
53 | } | 53 | } |
54 | 54 | ||
55 | public interface IGridConfig | 55 | public interface IGridConfig |
56 | { | 56 | { |
57 | GridConfig GetConfigObject(); | 57 | GridConfig GetConfigObject(); |
58 | } | 58 | } |
59 | } | 59 | } |
diff --git a/OpenSim/Framework/General/Interfaces/Config/IUserConfig.cs b/OpenSim/Framework/General/Interfaces/Config/IUserConfig.cs index ae6cedb..a17804a 100644 --- a/OpenSim/Framework/General/Interfaces/Config/IUserConfig.cs +++ b/OpenSim/Framework/General/Interfaces/Config/IUserConfig.cs | |||
@@ -1,53 +1,53 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 OpenSim.world; | 29 | //using OpenSim.world; |
30 | 30 | ||
31 | namespace OpenSim.Framework.Interfaces | 31 | namespace OpenSim.Framework.Interfaces |
32 | { | 32 | { |
33 | /// <summary> | 33 | /// <summary> |
34 | /// </summary> | 34 | /// </summary> |
35 | 35 | ||
36 | 36 | ||
37 | public abstract class UserConfig | 37 | public abstract class UserConfig |
38 | { | 38 | { |
39 | public string DefaultStartupMsg; | 39 | public string DefaultStartupMsg; |
40 | public string GridServerURL; | 40 | public string GridServerURL; |
41 | public string GridSendKey; | 41 | public string GridSendKey; |
42 | public string GridRecvKey; | 42 | public string GridRecvKey; |
43 | 43 | ||
44 | 44 | ||
45 | public abstract void InitConfig(); | 45 | public abstract void InitConfig(); |
46 | 46 | ||
47 | } | 47 | } |
48 | 48 | ||
49 | public interface IUserConfig | 49 | public interface IUserConfig |
50 | { | 50 | { |
51 | UserConfig GetConfigObject(); | 51 | UserConfig GetConfigObject(); |
52 | } | 52 | } |
53 | } | 53 | } |
diff --git a/OpenSim/Framework/General/Interfaces/IAssetServer.cs b/OpenSim/Framework/General/Interfaces/IAssetServer.cs index ab60dd7..cbb5c36 100644 --- a/OpenSim/Framework/General/Interfaces/IAssetServer.cs +++ b/OpenSim/Framework/General/Interfaces/IAssetServer.cs | |||
@@ -1,64 +1,64 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using libsecondlife; | 28 | using libsecondlife; |
29 | using OpenSim.Framework.Types; | 29 | using OpenSim.Framework.Types; |
30 | 30 | ||
31 | namespace OpenSim.Framework.Interfaces | 31 | namespace OpenSim.Framework.Interfaces |
32 | { | 32 | { |
33 | /// <summary> | 33 | /// <summary> |
34 | /// Description of IAssetServer. | 34 | /// Description of IAssetServer. |
35 | /// </summary> | 35 | /// </summary> |
36 | 36 | ||
37 | public interface IAssetServer | 37 | public interface IAssetServer |
38 | { | 38 | { |
39 | void SetReceiver(IAssetReceiver receiver); | 39 | void SetReceiver(IAssetReceiver receiver); |
40 | void RequestAsset(LLUUID assetID, bool isTexture); | 40 | void RequestAsset(LLUUID assetID, bool isTexture); |
41 | void UpdateAsset(AssetBase asset); | 41 | void UpdateAsset(AssetBase asset); |
42 | void UploadNewAsset(AssetBase asset); | 42 | void UploadNewAsset(AssetBase asset); |
43 | void SetServerInfo(string ServerUrl, string ServerKey); | 43 | void SetServerInfo(string ServerUrl, string ServerKey); |
44 | void Close(); | 44 | void Close(); |
45 | } | 45 | } |
46 | 46 | ||
47 | // could change to delegate? | 47 | // could change to delegate? |
48 | public interface IAssetReceiver | 48 | public interface IAssetReceiver |
49 | { | 49 | { |
50 | void AssetReceived(AssetBase asset, bool IsTexture); | 50 | void AssetReceived(AssetBase asset, bool IsTexture); |
51 | void AssetNotFound(AssetBase asset); | 51 | void AssetNotFound(AssetBase asset); |
52 | } | 52 | } |
53 | 53 | ||
54 | public interface IAssetPlugin | 54 | public interface IAssetPlugin |
55 | { | 55 | { |
56 | IAssetServer GetAssetServer(); | 56 | IAssetServer GetAssetServer(); |
57 | } | 57 | } |
58 | 58 | ||
59 | public struct ARequest | 59 | public struct ARequest |
60 | { | 60 | { |
61 | public LLUUID AssetID; | 61 | public LLUUID AssetID; |
62 | public bool IsTexture; | 62 | public bool IsTexture; |
63 | } | 63 | } |
64 | } | 64 | } |
diff --git a/OpenSim/Framework/General/Interfaces/IClientAPI.cs b/OpenSim/Framework/General/Interfaces/IClientAPI.cs index bd258a3..0606e43 100644 --- a/OpenSim/Framework/General/Interfaces/IClientAPI.cs +++ b/OpenSim/Framework/General/Interfaces/IClientAPI.cs | |||
@@ -1,195 +1,195 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using System.Collections.Generic; | 28 | using System.Collections.Generic; |
29 | using System.Net; | 29 | using System.Net; |
30 | using libsecondlife; | 30 | using libsecondlife; |
31 | using libsecondlife.Packets; | 31 | using libsecondlife.Packets; |
32 | using OpenSim.Framework.Types; | 32 | using OpenSim.Framework.Types; |
33 | using OpenSim.Framework.Data; | 33 | using OpenSim.Framework.Data; |
34 | 34 | ||
35 | namespace OpenSim.Framework.Interfaces | 35 | namespace OpenSim.Framework.Interfaces |
36 | { | 36 | { |
37 | public delegate void ChatFromViewer(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID); | 37 | public delegate void ChatFromViewer(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID); |
38 | public delegate void ImprovedInstantMessage(LLUUID fromAgentID, LLUUID toAgentID, uint timestamp, string fromAgentName, string message); // Cut down from full list | 38 | public delegate void ImprovedInstantMessage(LLUUID fromAgentID, LLUUID toAgentID, uint timestamp, string fromAgentName, string message); // Cut down from full list |
39 | public delegate void RezObject(AssetBase primAsset, LLVector3 pos); | 39 | public delegate void RezObject(AssetBase primAsset, LLVector3 pos); |
40 | public delegate void ModifyTerrain(float height, float seconds, byte size, byte action, float north, float west); | 40 | public delegate void ModifyTerrain(float height, float seconds, byte size, byte action, float north, float west); |
41 | public delegate void SetAppearance(byte[] texture, AgentSetAppearancePacket.VisualParamBlock[] visualParam); | 41 | public delegate void SetAppearance(byte[] texture, AgentSetAppearancePacket.VisualParamBlock[] visualParam); |
42 | public delegate void StartAnim(LLUUID animID, int seq); | 42 | public delegate void StartAnim(LLUUID animID, int seq); |
43 | public delegate void LinkObjects(uint parent, List<uint> children); | 43 | public delegate void LinkObjects(uint parent, List<uint> children); |
44 | public delegate void RequestMapBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY); | 44 | public delegate void RequestMapBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY); |
45 | public delegate void TeleportLocationRequest(IClientAPI remoteClient, ulong regionHandle, LLVector3 position, LLVector3 lookAt, uint flags); | 45 | public delegate void TeleportLocationRequest(IClientAPI remoteClient, ulong regionHandle, LLVector3 position, LLVector3 lookAt, uint flags); |
46 | 46 | ||
47 | public delegate void GenericCall(IClientAPI remoteClient); | 47 | public delegate void GenericCall(IClientAPI remoteClient); |
48 | public delegate void GenericCall2(); | 48 | public delegate void GenericCall2(); |
49 | public delegate void GenericCall3(Packet packet); // really don't want to be passing packets in these events, so this is very temporary. | 49 | public delegate void GenericCall3(Packet packet); // really don't want to be passing packets in these events, so this is very temporary. |
50 | public delegate void GenericCall4(Packet packet, IClientAPI remoteClient); | 50 | public delegate void GenericCall4(Packet packet, IClientAPI remoteClient); |
51 | public delegate void GenericCall5(IClientAPI remoteClient, bool status); | 51 | public delegate void GenericCall5(IClientAPI remoteClient, bool status); |
52 | public delegate void GenericCall6(LLUUID uid); | 52 | public delegate void GenericCall6(LLUUID uid); |
53 | public delegate void GenericCall7(uint localID, string message); | 53 | public delegate void GenericCall7(uint localID, string message); |
54 | 54 | ||
55 | public delegate void UpdateShape(uint localID, ObjectShapePacket.ObjectDataBlock shapeBlock); | 55 | public delegate void UpdateShape(uint localID, ObjectShapePacket.ObjectDataBlock shapeBlock); |
56 | public delegate void ObjectSelect(uint localID, IClientAPI remoteClient); | 56 | public delegate void ObjectSelect(uint localID, IClientAPI remoteClient); |
57 | public delegate void ObjectDeselect(uint localID, IClientAPI remoteClient); | 57 | public delegate void ObjectDeselect(uint localID, IClientAPI remoteClient); |
58 | public delegate void UpdatePrimFlags(uint localID, Packet packet, IClientAPI remoteClient); | 58 | public delegate void UpdatePrimFlags(uint localID, Packet packet, IClientAPI remoteClient); |
59 | public delegate void UpdatePrimTexture(uint localID, byte[] texture, IClientAPI remoteClient); | 59 | public delegate void UpdatePrimTexture(uint localID, byte[] texture, IClientAPI remoteClient); |
60 | public delegate void UpdateVector(uint localID, LLVector3 pos, IClientAPI remoteClient); | 60 | public delegate void UpdateVector(uint localID, LLVector3 pos, IClientAPI remoteClient); |
61 | public delegate void UpdatePrimRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient); | 61 | public delegate void UpdatePrimRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient); |
62 | public delegate void UpdatePrimSingleRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient); | 62 | public delegate void UpdatePrimSingleRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient); |
63 | public delegate void UpdatePrimGroupRotation(uint localID,LLVector3 pos, LLQuaternion rot, IClientAPI remoteClient); | 63 | public delegate void UpdatePrimGroupRotation(uint localID,LLVector3 pos, LLQuaternion rot, IClientAPI remoteClient); |
64 | public delegate void ObjectDuplicate(uint localID, LLVector3 offset, uint dupeFlags); | 64 | public delegate void ObjectDuplicate(uint localID, LLVector3 offset, uint dupeFlags); |
65 | public delegate void StatusChange(bool status); | 65 | public delegate void StatusChange(bool status); |
66 | public delegate void NewAvatar(IClientAPI remoteClient, LLUUID agentID, bool status); | 66 | public delegate void NewAvatar(IClientAPI remoteClient, LLUUID agentID, bool status); |
67 | public delegate void UpdateAgent(IClientAPI remoteClient, uint flags, LLQuaternion bodyRotation); | 67 | public delegate void UpdateAgent(IClientAPI remoteClient, uint flags, LLQuaternion bodyRotation); |
68 | public delegate void MoveObject(LLUUID objectID, LLVector3 offset, LLVector3 grapPos, IClientAPI remoteClient); | 68 | public delegate void MoveObject(LLUUID objectID, LLVector3 offset, LLVector3 grapPos, IClientAPI remoteClient); |
69 | 69 | ||
70 | public delegate void ParcelPropertiesRequest(int start_x, int start_y, int end_x, int end_y, int sequence_id, bool snap_selection, IClientAPI remote_client); | 70 | public delegate void ParcelPropertiesRequest(int start_x, int start_y, int end_x, int end_y, int sequence_id, bool snap_selection, IClientAPI remote_client); |
71 | public delegate void ParcelDivideRequest(int west, int south, int east, int north, IClientAPI remote_client); | 71 | public delegate void ParcelDivideRequest(int west, int south, int east, int north, IClientAPI remote_client); |
72 | public delegate void ParcelJoinRequest(int west, int south, int east, int north, IClientAPI remote_client); | 72 | public delegate void ParcelJoinRequest(int west, int south, int east, int north, IClientAPI remote_client); |
73 | public delegate void ParcelPropertiesUpdateRequest(ParcelPropertiesUpdatePacket packet, IClientAPI remote_client); | 73 | public delegate void ParcelPropertiesUpdateRequest(ParcelPropertiesUpdatePacket packet, IClientAPI remote_client); |
74 | public delegate void ParcelSelectObjects(int parcel_local_id, int request_type, IClientAPI remote_client); | 74 | public delegate void ParcelSelectObjects(int parcel_local_id, int request_type, IClientAPI remote_client); |
75 | public delegate void ParcelObjectOwnerRequest(int local_id, IClientAPI remote_client); | 75 | public delegate void ParcelObjectOwnerRequest(int local_id, IClientAPI remote_client); |
76 | public delegate void EstateOwnerMessageRequest(EstateOwnerMessagePacket packet, IClientAPI remote_client); | 76 | public delegate void EstateOwnerMessageRequest(EstateOwnerMessagePacket packet, IClientAPI remote_client); |
77 | 77 | ||
78 | public delegate void UUIDNameRequest(LLUUID id, IClientAPI remote_client); | 78 | public delegate void UUIDNameRequest(LLUUID id, IClientAPI remote_client); |
79 | 79 | ||
80 | public delegate void AddNewPrim(LLUUID ownerID, LLVector3 pos, PrimitiveBaseShape shape); | 80 | public delegate void AddNewPrim(LLUUID ownerID, LLVector3 pos, PrimitiveBaseShape shape); |
81 | 81 | ||
82 | 82 | ||
83 | 83 | ||
84 | public interface IClientAPI | 84 | public interface IClientAPI |
85 | { | 85 | { |
86 | event ImprovedInstantMessage OnInstantMessage; | 86 | event ImprovedInstantMessage OnInstantMessage; |
87 | event ChatFromViewer OnChatFromViewer; | 87 | event ChatFromViewer OnChatFromViewer; |
88 | event RezObject OnRezObject; | 88 | event RezObject OnRezObject; |
89 | event ModifyTerrain OnModifyTerrain; | 89 | event ModifyTerrain OnModifyTerrain; |
90 | event SetAppearance OnSetAppearance; | 90 | event SetAppearance OnSetAppearance; |
91 | event StartAnim OnStartAnim; | 91 | event StartAnim OnStartAnim; |
92 | event LinkObjects OnLinkObjects; | 92 | event LinkObjects OnLinkObjects; |
93 | event RequestMapBlocks OnRequestMapBlocks; | 93 | event RequestMapBlocks OnRequestMapBlocks; |
94 | event TeleportLocationRequest OnTeleportLocationRequest; | 94 | event TeleportLocationRequest OnTeleportLocationRequest; |
95 | 95 | ||
96 | event GenericCall4 OnDeRezObject; | 96 | event GenericCall4 OnDeRezObject; |
97 | event GenericCall OnRegionHandShakeReply; | 97 | event GenericCall OnRegionHandShakeReply; |
98 | event GenericCall OnRequestWearables; | 98 | event GenericCall OnRequestWearables; |
99 | event GenericCall2 OnCompleteMovementToRegion; | 99 | event GenericCall2 OnCompleteMovementToRegion; |
100 | event UpdateAgent OnAgentUpdate; | 100 | event UpdateAgent OnAgentUpdate; |
101 | event GenericCall OnRequestAvatarsData; | 101 | event GenericCall OnRequestAvatarsData; |
102 | event AddNewPrim OnAddPrim; | 102 | event AddNewPrim OnAddPrim; |
103 | event ObjectDuplicate OnObjectDuplicate; | 103 | event ObjectDuplicate OnObjectDuplicate; |
104 | event UpdateVector OnGrapObject; | 104 | event UpdateVector OnGrapObject; |
105 | event ObjectSelect OnDeGrapObject; | 105 | event ObjectSelect OnDeGrapObject; |
106 | event MoveObject OnGrapUpdate; | 106 | event MoveObject OnGrapUpdate; |
107 | 107 | ||
108 | event UpdateShape OnUpdatePrimShape; | 108 | event UpdateShape OnUpdatePrimShape; |
109 | event ObjectSelect OnObjectSelect; | 109 | event ObjectSelect OnObjectSelect; |
110 | event ObjectDeselect OnObjectDeselect; | 110 | event ObjectDeselect OnObjectDeselect; |
111 | event GenericCall7 OnObjectDescription; | 111 | event GenericCall7 OnObjectDescription; |
112 | event GenericCall7 OnObjectName; | 112 | event GenericCall7 OnObjectName; |
113 | event UpdatePrimFlags OnUpdatePrimFlags; | 113 | event UpdatePrimFlags OnUpdatePrimFlags; |
114 | event UpdatePrimTexture OnUpdatePrimTexture; | 114 | event UpdatePrimTexture OnUpdatePrimTexture; |
115 | event UpdateVector OnUpdatePrimGroupPosition; | 115 | event UpdateVector OnUpdatePrimGroupPosition; |
116 | event UpdateVector OnUpdatePrimSinglePosition; | 116 | event UpdateVector OnUpdatePrimSinglePosition; |
117 | event UpdatePrimRotation OnUpdatePrimGroupRotation; | 117 | event UpdatePrimRotation OnUpdatePrimGroupRotation; |
118 | event UpdatePrimSingleRotation OnUpdatePrimSingleRotation; | 118 | event UpdatePrimSingleRotation OnUpdatePrimSingleRotation; |
119 | event UpdatePrimGroupRotation OnUpdatePrimGroupMouseRotation; | 119 | event UpdatePrimGroupRotation OnUpdatePrimGroupMouseRotation; |
120 | event UpdateVector OnUpdatePrimScale; | 120 | event UpdateVector OnUpdatePrimScale; |
121 | event StatusChange OnChildAgentStatus; | 121 | event StatusChange OnChildAgentStatus; |
122 | event GenericCall2 OnStopMovement; | 122 | event GenericCall2 OnStopMovement; |
123 | event NewAvatar OnNewAvatar; | 123 | event NewAvatar OnNewAvatar; |
124 | event GenericCall6 OnRemoveAvatar; | 124 | event GenericCall6 OnRemoveAvatar; |
125 | 125 | ||
126 | event UUIDNameRequest OnNameFromUUIDRequest; | 126 | event UUIDNameRequest OnNameFromUUIDRequest; |
127 | 127 | ||
128 | event ParcelPropertiesRequest OnParcelPropertiesRequest; | 128 | event ParcelPropertiesRequest OnParcelPropertiesRequest; |
129 | event ParcelDivideRequest OnParcelDivideRequest; | 129 | event ParcelDivideRequest OnParcelDivideRequest; |
130 | event ParcelJoinRequest OnParcelJoinRequest; | 130 | event ParcelJoinRequest OnParcelJoinRequest; |
131 | event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest; | 131 | event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest; |
132 | event ParcelSelectObjects OnParcelSelectObjects; | 132 | event ParcelSelectObjects OnParcelSelectObjects; |
133 | event ParcelObjectOwnerRequest OnParcelObjectOwnerRequest; | 133 | event ParcelObjectOwnerRequest OnParcelObjectOwnerRequest; |
134 | event EstateOwnerMessageRequest OnEstateOwnerMessage; | 134 | event EstateOwnerMessageRequest OnEstateOwnerMessage; |
135 | 135 | ||
136 | LLVector3 StartPos | 136 | LLVector3 StartPos |
137 | { | 137 | { |
138 | get; | 138 | get; |
139 | set; | 139 | set; |
140 | } | 140 | } |
141 | 141 | ||
142 | LLUUID AgentId | 142 | LLUUID AgentId |
143 | { | 143 | { |
144 | get; | 144 | get; |
145 | } | 145 | } |
146 | 146 | ||
147 | string FirstName | 147 | string FirstName |
148 | { | 148 | { |
149 | get; | 149 | get; |
150 | } | 150 | } |
151 | 151 | ||
152 | string LastName | 152 | string LastName |
153 | { | 153 | { |
154 | get; | 154 | get; |
155 | } | 155 | } |
156 | 156 | ||
157 | void OutPacket(Packet newPack); | 157 | void OutPacket(Packet newPack); |
158 | void SendWearables(AvatarWearable[] wearables); | 158 | void SendWearables(AvatarWearable[] wearables); |
159 | void SendStartPingCheck(byte seq); | 159 | void SendStartPingCheck(byte seq); |
160 | void SendKillObject(ulong regionHandle, uint avatarLocalID); | 160 | void SendKillObject(ulong regionHandle, uint avatarLocalID); |
161 | void SendAnimation(LLUUID animID, int seq, LLUUID sourceAgentId); | 161 | void SendAnimation(LLUUID animID, int seq, LLUUID sourceAgentId); |
162 | void SendRegionHandshake(RegionInfo regionInfo); | 162 | void SendRegionHandshake(RegionInfo regionInfo); |
163 | void SendChatMessage(string message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID); | 163 | void SendChatMessage(string message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID); |
164 | void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID); | 164 | void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID); |
165 | void SendInstantMessage(string message, LLUUID target, string fromName); | 165 | void SendInstantMessage(string message, LLUUID target, string fromName); |
166 | void SendLayerData(float[] map); | 166 | void SendLayerData(float[] map); |
167 | void SendLayerData(int px, int py, float[] map); | 167 | void SendLayerData(int px, int py, float[] map); |
168 | void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look); | 168 | void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look); |
169 | void InformClientOfNeighbour(ulong neighbourHandle, IPEndPoint neighbourExternalEndPoint ); | 169 | void InformClientOfNeighbour(ulong neighbourHandle, IPEndPoint neighbourExternalEndPoint ); |
170 | AgentCircuitData RequestClientInfo(); | 170 | AgentCircuitData RequestClientInfo(); |
171 | void CrossRegion(ulong newRegionHandle, LLVector3 pos, LLVector3 lookAt, IPEndPoint newRegionExternalEndPoint ); | 171 | void CrossRegion(ulong newRegionHandle, LLVector3 pos, LLVector3 lookAt, IPEndPoint newRegionExternalEndPoint ); |
172 | void SendMapBlock(List<MapBlockData> mapBlocks); | 172 | void SendMapBlock(List<MapBlockData> mapBlocks); |
173 | void SendLocalTeleport(LLVector3 position, LLVector3 lookAt, uint flags); | 173 | void SendLocalTeleport(LLVector3 position, LLVector3 lookAt, uint flags); |
174 | void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, uint locationID, uint flags); | 174 | void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, uint locationID, uint flags); |
175 | void SendTeleportCancel(); | 175 | void SendTeleportCancel(); |
176 | void SendTeleportLocationStart(); | 176 | void SendTeleportLocationStart(); |
177 | void SendMoneyBalance(LLUUID transaction, bool success, byte[] description, int balance); | 177 | void SendMoneyBalance(LLUUID transaction, bool success, byte[] description, int balance); |
178 | 178 | ||
179 | void SendAvatarData(ulong regionHandle, string firstName, string lastName, LLUUID avatarID, uint avatarLocalID, LLVector3 Pos, byte[] textureEntry); | 179 | void SendAvatarData(ulong regionHandle, string firstName, string lastName, LLUUID avatarID, uint avatarLocalID, LLVector3 Pos, byte[] textureEntry); |
180 | void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLVector3 velocity); | 180 | void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLVector3 velocity); |
181 | 181 | ||
182 | void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint); | 182 | void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint); |
183 | void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLQuaternion rotation, LLUUID textureID , uint flags); | 183 | void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLQuaternion rotation, LLUUID textureID , uint flags); |
184 | void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLUUID textureID, uint flags); | 184 | void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLUUID textureID, uint flags); |
185 | void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, LLQuaternion rotation, uint flags, LLUUID objectID, LLUUID ownerID, string text, uint parentID); | 185 | void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, LLQuaternion rotation, uint flags, LLUUID objectID, LLUUID ownerID, string text, uint parentID); |
186 | void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, uint flags, LLUUID objectID, LLUUID ownerID, string text, uint parentID); | 186 | void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, uint flags, LLUUID objectID, LLUUID ownerID, string text, uint parentID); |
187 | void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLQuaternion rotation); | 187 | void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLQuaternion rotation); |
188 | 188 | ||
189 | void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, List<InventoryItemBase> items); | 189 | void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, List<InventoryItemBase> items); |
190 | void SendInventoryItemDetails(LLUUID ownerID, LLUUID folderID, InventoryItemBase item); | 190 | void SendInventoryItemDetails(LLUUID ownerID, LLUUID folderID, InventoryItemBase item); |
191 | void SendNameReply(LLUUID profileId, string firstname, string lastname); | 191 | void SendNameReply(LLUUID profileId, string firstname, string lastname); |
192 | 192 | ||
193 | 193 | ||
194 | } | 194 | } |
195 | } | 195 | } |
diff --git a/OpenSim/Framework/General/Interfaces/ILocalStorage.cs b/OpenSim/Framework/General/Interfaces/ILocalStorage.cs index 7093121..c7c0b5f 100644 --- a/OpenSim/Framework/General/Interfaces/ILocalStorage.cs +++ b/OpenSim/Framework/General/Interfaces/ILocalStorage.cs | |||
@@ -1,71 +1,71 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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.Types; | 30 | using OpenSim.Framework.Types; |
31 | 31 | ||
32 | namespace OpenSim.Framework.Interfaces | 32 | namespace OpenSim.Framework.Interfaces |
33 | { | 33 | { |
34 | /// <summary> | 34 | /// <summary> |
35 | /// ILocalStorage. Really hacked together right now needs cleaning up | 35 | /// ILocalStorage. Really hacked together right now needs cleaning up |
36 | /// </summary> | 36 | /// </summary> |
37 | [System.Obsolete("Redundant, use IRegionDataStore instead")] | 37 | [System.Obsolete("Redundant, use IRegionDataStore instead")] |
38 | public interface ILocalStorage | 38 | public interface ILocalStorage |
39 | { | 39 | { |
40 | void Initialise(string datastore); | 40 | void Initialise(string datastore); |
41 | 41 | ||
42 | void StorePrim(PrimData prim); | 42 | void StorePrim(PrimData prim); |
43 | void RemovePrim(LLUUID primID); | 43 | void RemovePrim(LLUUID primID); |
44 | void LoadPrimitives(ILocalStorageReceiver receiver); | 44 | void LoadPrimitives(ILocalStorageReceiver receiver); |
45 | 45 | ||
46 | [System.Obsolete("Use DataStorage instead")] | 46 | [System.Obsolete("Use DataStorage instead")] |
47 | float[] LoadWorld(); | 47 | float[] LoadWorld(); |
48 | [System.Obsolete("Use DataStorage instead")] | 48 | [System.Obsolete("Use DataStorage instead")] |
49 | void SaveMap(float[] heightmap); | 49 | void SaveMap(float[] heightmap); |
50 | 50 | ||
51 | void SaveParcels(ParcelData[] parcels); | 51 | void SaveParcels(ParcelData[] parcels); |
52 | void SaveParcel(ParcelData parcel); | 52 | void SaveParcel(ParcelData parcel); |
53 | void RemoveParcel(ParcelData parcel); | 53 | void RemoveParcel(ParcelData parcel); |
54 | void RemoveAllParcels(); | 54 | void RemoveAllParcels(); |
55 | void LoadParcels(ILocalStorageParcelReceiver recv); | 55 | void LoadParcels(ILocalStorageParcelReceiver recv); |
56 | 56 | ||
57 | void ShutDown(); | 57 | void ShutDown(); |
58 | } | 58 | } |
59 | 59 | ||
60 | public interface ILocalStorageReceiver | 60 | public interface ILocalStorageReceiver |
61 | { | 61 | { |
62 | void PrimFromStorage(PrimData prim); | 62 | void PrimFromStorage(PrimData prim); |
63 | } | 63 | } |
64 | 64 | ||
65 | public interface ILocalStorageParcelReceiver | 65 | public interface ILocalStorageParcelReceiver |
66 | { | 66 | { |
67 | void ParcelFromStorage(ParcelData data); | 67 | void ParcelFromStorage(ParcelData data); |
68 | void NoParcelDataFromStorage(); | 68 | void NoParcelDataFromStorage(); |
69 | } | 69 | } |
70 | } | 70 | } |
71 | 71 | ||
diff --git a/OpenSim/Framework/General/Interfaces/IUserServer.cs b/OpenSim/Framework/General/Interfaces/IUserServer.cs index b3700d2..ca5816d 100644 --- a/OpenSim/Framework/General/Interfaces/IUserServer.cs +++ b/OpenSim/Framework/General/Interfaces/IUserServer.cs | |||
@@ -1,39 +1,39 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using libsecondlife; | 28 | using libsecondlife; |
29 | using OpenSim.Framework.Inventory; | 29 | using OpenSim.Framework.Inventory; |
30 | 30 | ||
31 | namespace OpenSim.Framework.Interfaces | 31 | namespace OpenSim.Framework.Interfaces |
32 | { | 32 | { |
33 | public interface IUserServer | 33 | public interface IUserServer |
34 | { | 34 | { |
35 | AgentInventory RequestAgentsInventory(LLUUID agentID); | 35 | AgentInventory RequestAgentsInventory(LLUUID agentID); |
36 | void SetServerInfo(string ServerUrl, string SendKey, string RecvKey); | 36 | void SetServerInfo(string ServerUrl, string SendKey, string RecvKey); |
37 | bool UpdateAgentsInventory(LLUUID agentID, AgentInventory inventory); | 37 | bool UpdateAgentsInventory(LLUUID agentID, AgentInventory inventory); |
38 | } | 38 | } |
39 | } | 39 | } |
diff --git a/OpenSim/Framework/General/Interfaces/IWorld.cs b/OpenSim/Framework/General/Interfaces/IWorld.cs index 204c01b..a474636 100644 --- a/OpenSim/Framework/General/Interfaces/IWorld.cs +++ b/OpenSim/Framework/General/Interfaces/IWorld.cs | |||
@@ -1,42 +1,42 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using libsecondlife; | 28 | using libsecondlife; |
29 | using OpenSim.Framework.Types; | 29 | using OpenSim.Framework.Types; |
30 | 30 | ||
31 | namespace OpenSim.Framework.Interfaces | 31 | namespace OpenSim.Framework.Interfaces |
32 | { | 32 | { |
33 | public interface IWorld | 33 | public interface IWorld |
34 | { | 34 | { |
35 | void AddNewClient(IClientAPI client, bool child); | 35 | void AddNewClient(IClientAPI client, bool child); |
36 | void RemoveClient(LLUUID agentID); | 36 | void RemoveClient(LLUUID agentID); |
37 | 37 | ||
38 | RegionInfo RegionInfo { get; } | 38 | RegionInfo RegionInfo { get; } |
39 | object SyncRoot { get; } | 39 | object SyncRoot { get; } |
40 | uint NextLocalId { get; } | 40 | uint NextLocalId { get; } |
41 | } | 41 | } |
42 | } | 42 | } |
diff --git a/OpenSim/Framework/General/NpcClientBase.cs b/OpenSim/Framework/General/NpcClientBase.cs index 44d6d3c..044431b 100644 --- a/OpenSim/Framework/General/NpcClientBase.cs +++ b/OpenSim/Framework/General/NpcClientBase.cs | |||
@@ -1,127 +1,127 @@ | |||
1 | using System.Collections.Generic; | 1 | using System.Collections.Generic; |
2 | using System.Net; | 2 | using System.Net; |
3 | using OpenSim.Framework.Interfaces; | 3 | using OpenSim.Framework.Interfaces; |
4 | using OpenSim.Framework.Types; | 4 | using OpenSim.Framework.Types; |
5 | using OpenSim.Framework.Data; | 5 | using OpenSim.Framework.Data; |
6 | using libsecondlife; | 6 | using libsecondlife; |
7 | using libsecondlife.Packets; | 7 | using libsecondlife.Packets; |
8 | 8 | ||
9 | 9 | ||
10 | namespace OpenSim.Framework | 10 | namespace OpenSim.Framework |
11 | { | 11 | { |
12 | public class NpcClientBase :IClientAPI | 12 | public class NpcClientBase :IClientAPI |
13 | { | 13 | { |
14 | public event ImprovedInstantMessage OnInstantMessage; | 14 | public event ImprovedInstantMessage OnInstantMessage; |
15 | public event ChatFromViewer OnChatFromViewer; | 15 | public event ChatFromViewer OnChatFromViewer; |
16 | public event RezObject OnRezObject; | 16 | public event RezObject OnRezObject; |
17 | public event ModifyTerrain OnModifyTerrain; | 17 | public event ModifyTerrain OnModifyTerrain; |
18 | public event SetAppearance OnSetAppearance; | 18 | public event SetAppearance OnSetAppearance; |
19 | public event StartAnim OnStartAnim; | 19 | public event StartAnim OnStartAnim; |
20 | public event LinkObjects OnLinkObjects; | 20 | public event LinkObjects OnLinkObjects; |
21 | public event RequestMapBlocks OnRequestMapBlocks; | 21 | public event RequestMapBlocks OnRequestMapBlocks; |
22 | public event TeleportLocationRequest OnTeleportLocationRequest; | 22 | public event TeleportLocationRequest OnTeleportLocationRequest; |
23 | 23 | ||
24 | public event GenericCall4 OnDeRezObject; | 24 | public event GenericCall4 OnDeRezObject; |
25 | public event GenericCall OnRegionHandShakeReply; | 25 | public event GenericCall OnRegionHandShakeReply; |
26 | public event GenericCall OnRequestWearables; | 26 | public event GenericCall OnRequestWearables; |
27 | public event GenericCall2 OnCompleteMovementToRegion; | 27 | public event GenericCall2 OnCompleteMovementToRegion; |
28 | public event UpdateAgent OnAgentUpdate; | 28 | public event UpdateAgent OnAgentUpdate; |
29 | public event GenericCall OnRequestAvatarsData; | 29 | public event GenericCall OnRequestAvatarsData; |
30 | public event AddNewPrim OnAddPrim; | 30 | public event AddNewPrim OnAddPrim; |
31 | public event ObjectDuplicate OnObjectDuplicate; | 31 | public event ObjectDuplicate OnObjectDuplicate; |
32 | public event UpdateVector OnGrapObject; | 32 | public event UpdateVector OnGrapObject; |
33 | public event ObjectSelect OnDeGrapObject; | 33 | public event ObjectSelect OnDeGrapObject; |
34 | public event MoveObject OnGrapUpdate; | 34 | public event MoveObject OnGrapUpdate; |
35 | 35 | ||
36 | public event UpdateShape OnUpdatePrimShape; | 36 | public event UpdateShape OnUpdatePrimShape; |
37 | public event ObjectSelect OnObjectSelect; | 37 | public event ObjectSelect OnObjectSelect; |
38 | public event GenericCall7 OnObjectDescription; | 38 | public event GenericCall7 OnObjectDescription; |
39 | public event GenericCall7 OnObjectName; | 39 | public event GenericCall7 OnObjectName; |
40 | public event UpdatePrimFlags OnUpdatePrimFlags; | 40 | public event UpdatePrimFlags OnUpdatePrimFlags; |
41 | public event UpdatePrimTexture OnUpdatePrimTexture; | 41 | public event UpdatePrimTexture OnUpdatePrimTexture; |
42 | public event UpdateVector OnUpdatePrimGroupPosition; | 42 | public event UpdateVector OnUpdatePrimGroupPosition; |
43 | public event UpdateVector OnUpdatePrimSinglePosition; | 43 | public event UpdateVector OnUpdatePrimSinglePosition; |
44 | public event UpdatePrimRotation OnUpdatePrimGroupRotation; | 44 | public event UpdatePrimRotation OnUpdatePrimGroupRotation; |
45 | public event UpdatePrimSingleRotation OnUpdatePrimSingleRotation; | 45 | public event UpdatePrimSingleRotation OnUpdatePrimSingleRotation; |
46 | public event UpdatePrimGroupRotation OnUpdatePrimGroupMouseRotation; | 46 | public event UpdatePrimGroupRotation OnUpdatePrimGroupMouseRotation; |
47 | public event UpdateVector OnUpdatePrimScale; | 47 | public event UpdateVector OnUpdatePrimScale; |
48 | public event StatusChange OnChildAgentStatus; | 48 | public event StatusChange OnChildAgentStatus; |
49 | public event GenericCall2 OnStopMovement; | 49 | public event GenericCall2 OnStopMovement; |
50 | public event NewAvatar OnNewAvatar; | 50 | public event NewAvatar OnNewAvatar; |
51 | public event GenericCall6 OnRemoveAvatar; | 51 | public event GenericCall6 OnRemoveAvatar; |
52 | 52 | ||
53 | public event UUIDNameRequest OnNameFromUUIDRequest; | 53 | public event UUIDNameRequest OnNameFromUUIDRequest; |
54 | 54 | ||
55 | public event ParcelPropertiesRequest OnParcelPropertiesRequest; | 55 | public event ParcelPropertiesRequest OnParcelPropertiesRequest; |
56 | public event ParcelDivideRequest OnParcelDivideRequest; | 56 | public event ParcelDivideRequest OnParcelDivideRequest; |
57 | public event ParcelJoinRequest OnParcelJoinRequest; | 57 | public event ParcelJoinRequest OnParcelJoinRequest; |
58 | public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest; | 58 | public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest; |
59 | public event ParcelSelectObjects OnParcelSelectObjects; | 59 | public event ParcelSelectObjects OnParcelSelectObjects; |
60 | public event ParcelObjectOwnerRequest OnParcelObjectOwnerRequest; | 60 | public event ParcelObjectOwnerRequest OnParcelObjectOwnerRequest; |
61 | public event ObjectDeselect OnObjectDeselect; | 61 | public event ObjectDeselect OnObjectDeselect; |
62 | 62 | ||
63 | 63 | ||
64 | public event EstateOwnerMessageRequest OnEstateOwnerMessage; | 64 | public event EstateOwnerMessageRequest OnEstateOwnerMessage; |
65 | 65 | ||
66 | public virtual LLVector3 StartPos | 66 | public virtual LLVector3 StartPos |
67 | { | 67 | { |
68 | get { return new LLVector3(); } | 68 | get { return new LLVector3(); } |
69 | set { } | 69 | set { } |
70 | } | 70 | } |
71 | 71 | ||
72 | public virtual LLUUID AgentId | 72 | public virtual LLUUID AgentId |
73 | { | 73 | { |
74 | get { return LLUUID.Random(); } | 74 | get { return LLUUID.Random(); } |
75 | } | 75 | } |
76 | 76 | ||
77 | public virtual string FirstName | 77 | public virtual string FirstName |
78 | { | 78 | { |
79 | get { return ""; } | 79 | get { return ""; } |
80 | } | 80 | } |
81 | 81 | ||
82 | public virtual string LastName | 82 | public virtual string LastName |
83 | { | 83 | { |
84 | get { return ""; } | 84 | get { return ""; } |
85 | } | 85 | } |
86 | 86 | ||
87 | public NpcClientBase() | 87 | public NpcClientBase() |
88 | { | 88 | { |
89 | } | 89 | } |
90 | 90 | ||
91 | public virtual void OutPacket(Packet newPack){} | 91 | public virtual void OutPacket(Packet newPack){} |
92 | public virtual void SendWearables(AvatarWearable[] wearables){} | 92 | public virtual void SendWearables(AvatarWearable[] wearables){} |
93 | public virtual void SendStartPingCheck(byte seq){} | 93 | public virtual void SendStartPingCheck(byte seq){} |
94 | public virtual void SendKillObject(ulong regionHandle, uint avatarLocalID){} | 94 | public virtual void SendKillObject(ulong regionHandle, uint avatarLocalID){} |
95 | public virtual void SendAnimation(LLUUID animID, int seq, LLUUID sourceAgentId){} | 95 | public virtual void SendAnimation(LLUUID animID, int seq, LLUUID sourceAgentId){} |
96 | public virtual void SendRegionHandshake(RegionInfo regionInfo){} | 96 | public virtual void SendRegionHandshake(RegionInfo regionInfo){} |
97 | public virtual void SendChatMessage(string message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID){} | 97 | public virtual void SendChatMessage(string message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID){} |
98 | public virtual void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID){} | 98 | public virtual void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID){} |
99 | public virtual void SendInstantMessage(string message, LLUUID target, string fromName){} | 99 | public virtual void SendInstantMessage(string message, LLUUID target, string fromName){} |
100 | public virtual void SendLayerData(float[] map){} | 100 | public virtual void SendLayerData(float[] map){} |
101 | public virtual void SendLayerData(int px, int py, float[] map){} | 101 | public virtual void SendLayerData(int px, int py, float[] map){} |
102 | public virtual void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look){} | 102 | public virtual void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look){} |
103 | public virtual void InformClientOfNeighbour(ulong neighbourHandle, IPEndPoint neighbourExternalEndPoint){} | 103 | public virtual void InformClientOfNeighbour(ulong neighbourHandle, IPEndPoint neighbourExternalEndPoint){} |
104 | public virtual AgentCircuitData RequestClientInfo() { return new AgentCircuitData(); } | 104 | public virtual AgentCircuitData RequestClientInfo() { return new AgentCircuitData(); } |
105 | public virtual void CrossRegion(ulong newRegionHandle, LLVector3 pos, LLVector3 lookAt, IPEndPoint newRegionExternalEndPoint){} | 105 | public virtual void CrossRegion(ulong newRegionHandle, LLVector3 pos, LLVector3 lookAt, IPEndPoint newRegionExternalEndPoint){} |
106 | public virtual void SendMapBlock(List<MapBlockData> mapBlocks){} | 106 | public virtual void SendMapBlock(List<MapBlockData> mapBlocks){} |
107 | public virtual void SendLocalTeleport(LLVector3 position, LLVector3 lookAt, uint flags){} | 107 | public virtual void SendLocalTeleport(LLVector3 position, LLVector3 lookAt, uint flags){} |
108 | public virtual void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, uint locationID, uint flags){} | 108 | public virtual void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, uint locationID, uint flags){} |
109 | public virtual void SendTeleportCancel(){} | 109 | public virtual void SendTeleportCancel(){} |
110 | public virtual void SendTeleportLocationStart(){} | 110 | public virtual void SendTeleportLocationStart(){} |
111 | public virtual void SendMoneyBalance(LLUUID transaction, bool success, byte[] description, int balance){} | 111 | public virtual void SendMoneyBalance(LLUUID transaction, bool success, byte[] description, int balance){} |
112 | 112 | ||
113 | public virtual void SendAvatarData(ulong regionHandle, string firstName, string lastName, LLUUID avatarID, uint avatarLocalID, LLVector3 Pos, byte[] textureEntry){} | 113 | public virtual void SendAvatarData(ulong regionHandle, string firstName, string lastName, LLUUID avatarID, uint avatarLocalID, LLVector3 Pos, byte[] textureEntry){} |
114 | public virtual void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLVector3 velocity){} | 114 | public virtual void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLVector3 velocity){} |
115 | 115 | ||
116 | public virtual void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint){} | 116 | public virtual void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint){} |
117 | public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLQuaternion rotation, LLUUID textureID, uint flags){} | 117 | public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLQuaternion rotation, LLUUID textureID, uint flags){} |
118 | public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLUUID textureID, uint flags){} | 118 | public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLUUID textureID, uint flags){} |
119 | public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, LLQuaternion rotation, uint flags, LLUUID objectID, LLUUID ownerID, string text, uint parentID){} | 119 | public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, LLQuaternion rotation, uint flags, LLUUID objectID, LLUUID ownerID, string text, uint parentID){} |
120 | public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, uint flags, LLUUID objectID, LLUUID ownerID, string text, uint parentID){} | 120 | public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, uint flags, LLUUID objectID, LLUUID ownerID, string text, uint parentID){} |
121 | public virtual void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLQuaternion rotation){} | 121 | public virtual void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLQuaternion rotation){} |
122 | 122 | ||
123 | public virtual void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, List<InventoryItemBase> items){} | 123 | public virtual void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, List<InventoryItemBase> items){} |
124 | public virtual void SendInventoryItemDetails(LLUUID ownerID, LLUUID folderID, InventoryItemBase item){} | 124 | public virtual void SendInventoryItemDetails(LLUUID ownerID, LLUUID folderID, InventoryItemBase item){} |
125 | public virtual void SendNameReply(LLUUID profileId, string firstname, string lastname){} | 125 | public virtual void SendNameReply(LLUUID profileId, string firstname, string lastname){} |
126 | } | 126 | } |
127 | } | 127 | } |
diff --git a/OpenSim/Framework/General/Properties/AssemblyInfo.cs b/OpenSim/Framework/General/Properties/AssemblyInfo.cs index 004040b..655cffc 100644 --- a/OpenSim/Framework/General/Properties/AssemblyInfo.cs +++ b/OpenSim/Framework/General/Properties/AssemblyInfo.cs | |||
@@ -1,31 +1,31 @@ | |||
1 | using System.Reflection; | 1 | using System.Reflection; |
2 | using System.Runtime.InteropServices; | 2 | using System.Runtime.InteropServices; |
3 | // General Information about an assembly is controlled through the following | 3 | // General Information about an assembly is controlled through the following |
4 | // set of attributes. Change these attribute values to modify the information | 4 | // set of attributes. Change these attribute values to modify the information |
5 | // associated with an assembly. | 5 | // associated with an assembly. |
6 | [assembly: AssemblyTitle("OpenSim.FrameWork")] | 6 | [assembly: AssemblyTitle("OpenSim.FrameWork")] |
7 | [assembly: AssemblyDescription("")] | 7 | [assembly: AssemblyDescription("")] |
8 | [assembly: AssemblyConfiguration("")] | 8 | [assembly: AssemblyConfiguration("")] |
9 | [assembly: AssemblyCompany("")] | 9 | [assembly: AssemblyCompany("")] |
10 | [assembly: AssemblyProduct("OpenSim.FrameWork")] | 10 | [assembly: AssemblyProduct("OpenSim.FrameWork")] |
11 | [assembly: AssemblyCopyright("Copyright © 2007")] | 11 | [assembly: AssemblyCopyright("Copyright © 2007")] |
12 | [assembly: AssemblyTrademark("")] | 12 | [assembly: AssemblyTrademark("")] |
13 | [assembly: AssemblyCulture("")] | 13 | [assembly: AssemblyCulture("")] |
14 | 14 | ||
15 | // Setting ComVisible to false makes the types in this assembly not visible | 15 | // Setting ComVisible to false makes the types in this assembly not visible |
16 | // to COM components. If you need to access a type in this assembly from | 16 | // to COM components. If you need to access a type in this assembly from |
17 | // COM, set the ComVisible attribute to true on that type. | 17 | // COM, set the ComVisible attribute to true on that type. |
18 | [assembly: ComVisible(false)] | 18 | [assembly: ComVisible(false)] |
19 | 19 | ||
20 | // The following GUID is for the ID of the typelib if this project is exposed to COM | 20 | // The following GUID is for the ID of the typelib if this project is exposed to COM |
21 | [assembly: Guid("a08e20c7-f191-4137-b1f0-9291408fa521")] | 21 | [assembly: Guid("a08e20c7-f191-4137-b1f0-9291408fa521")] |
22 | 22 | ||
23 | // Version information for an assembly consists of the following four values: | 23 | // Version information for an assembly consists of the following four values: |
24 | // | 24 | // |
25 | // Major Version | 25 | // Major Version |
26 | // Minor Version | 26 | // Minor Version |
27 | // Build Number | 27 | // Build Number |
28 | // Revision | 28 | // Revision |
29 | // | 29 | // |
30 | [assembly: AssemblyVersion("1.0.0.0")] | 30 | [assembly: AssemblyVersion("1.0.0.0")] |
31 | [assembly: AssemblyFileVersion("1.0.0.0")] | 31 | [assembly: AssemblyFileVersion("1.0.0.0")] |
diff --git a/OpenSim/Framework/General/RegionCommsListener.cs b/OpenSim/Framework/General/RegionCommsListener.cs index 4d6b59c..f5b8272 100644 --- a/OpenSim/Framework/General/RegionCommsListener.cs +++ b/OpenSim/Framework/General/RegionCommsListener.cs | |||
@@ -1,103 +1,103 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using libsecondlife; | 28 | using libsecondlife; |
29 | using OpenSim.Framework.Interfaces; | 29 | using OpenSim.Framework.Interfaces; |
30 | using OpenSim.Framework.Types; | 30 | using OpenSim.Framework.Types; |
31 | 31 | ||
32 | using System.Collections.Generic; | 32 | using System.Collections.Generic; |
33 | 33 | ||
34 | namespace OpenSim.Framework | 34 | namespace OpenSim.Framework |
35 | { | 35 | { |
36 | public class RegionCommsListener :IRegionCommsListener | 36 | public class RegionCommsListener :IRegionCommsListener |
37 | { | 37 | { |
38 | public event ExpectUserDelegate OnExpectUser; | 38 | public event ExpectUserDelegate OnExpectUser; |
39 | public event GenericCall2 OnExpectChildAgent; | 39 | public event GenericCall2 OnExpectChildAgent; |
40 | public event AgentCrossing OnAvatarCrossingIntoRegion; | 40 | public event AgentCrossing OnAvatarCrossingIntoRegion; |
41 | public event UpdateNeighbours OnNeighboursUpdate; | 41 | public event UpdateNeighbours OnNeighboursUpdate; |
42 | 42 | ||
43 | /// <summary> | 43 | /// <summary> |
44 | /// | 44 | /// |
45 | /// </summary> | 45 | /// </summary> |
46 | /// <param name="agent"></param> | 46 | /// <param name="agent"></param> |
47 | /// <returns></returns> | 47 | /// <returns></returns> |
48 | public virtual bool TriggerExpectUser(ulong regionHandle, AgentCircuitData agent) | 48 | public virtual bool TriggerExpectUser(ulong regionHandle, AgentCircuitData agent) |
49 | { | 49 | { |
50 | if(OnExpectUser != null) | 50 | if(OnExpectUser != null) |
51 | { | 51 | { |
52 | 52 | ||
53 | OnExpectUser(regionHandle, agent); | 53 | OnExpectUser(regionHandle, agent); |
54 | return true; | 54 | return true; |
55 | } | 55 | } |
56 | 56 | ||
57 | return false; | 57 | return false; |
58 | } | 58 | } |
59 | 59 | ||
60 | public virtual bool TriggerExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position) | 60 | public virtual bool TriggerExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position) |
61 | { | 61 | { |
62 | if (OnAvatarCrossingIntoRegion != null) | 62 | if (OnAvatarCrossingIntoRegion != null) |
63 | { | 63 | { |
64 | OnAvatarCrossingIntoRegion(regionHandle, agentID, position); | 64 | OnAvatarCrossingIntoRegion(regionHandle, agentID, position); |
65 | return true; | 65 | return true; |
66 | } | 66 | } |
67 | return false; | 67 | return false; |
68 | } | 68 | } |
69 | 69 | ||
70 | /// <summary> | 70 | /// <summary> |
71 | /// | 71 | /// |
72 | /// </summary> | 72 | /// </summary> |
73 | /// <remarks>TODO: Doesnt take any args??</remarks> | 73 | /// <remarks>TODO: Doesnt take any args??</remarks> |
74 | /// <returns></returns> | 74 | /// <returns></returns> |
75 | public virtual bool TriggerExpectChildAgent() | 75 | public virtual bool TriggerExpectChildAgent() |
76 | { | 76 | { |
77 | if (OnExpectChildAgent != null) | 77 | if (OnExpectChildAgent != null) |
78 | { | 78 | { |
79 | OnExpectChildAgent(); | 79 | OnExpectChildAgent(); |
80 | return true; | 80 | return true; |
81 | } | 81 | } |
82 | 82 | ||
83 | return false; | 83 | return false; |
84 | } | 84 | } |
85 | 85 | ||
86 | /// <summary> | 86 | /// <summary> |
87 | /// | 87 | /// |
88 | /// </summary> | 88 | /// </summary> |
89 | /// <remarks>Added to avoid a unused compiler warning on OnNeighboursUpdate, TODO: Check me</remarks> | 89 | /// <remarks>Added to avoid a unused compiler warning on OnNeighboursUpdate, TODO: Check me</remarks> |
90 | /// <param name="neighbours"></param> | 90 | /// <param name="neighbours"></param> |
91 | /// <returns></returns> | 91 | /// <returns></returns> |
92 | public virtual bool TriggerOnNeighboursUpdate(List<RegionInfo> neighbours) | 92 | public virtual bool TriggerOnNeighboursUpdate(List<RegionInfo> neighbours) |
93 | { | 93 | { |
94 | if (OnNeighboursUpdate != null) | 94 | if (OnNeighboursUpdate != null) |
95 | { | 95 | { |
96 | OnNeighboursUpdate(neighbours); | 96 | OnNeighboursUpdate(neighbours); |
97 | return true; | 97 | return true; |
98 | } | 98 | } |
99 | 99 | ||
100 | return false; | 100 | return false; |
101 | } | 101 | } |
102 | } | 102 | } |
103 | } | 103 | } |
diff --git a/OpenSim/Framework/General/Remoting.cs b/OpenSim/Framework/General/Remoting.cs index df32db2..0e94b90 100644 --- a/OpenSim/Framework/General/Remoting.cs +++ b/OpenSim/Framework/General/Remoting.cs | |||
@@ -1,135 +1,135 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using System; | 28 | using System; |
29 | using System.Security.Cryptography; | 29 | using System.Security.Cryptography; |
30 | using System.Text; | 30 | using System.Text; |
31 | 31 | ||
32 | namespace OpenSim.Framework | 32 | namespace OpenSim.Framework |
33 | { | 33 | { |
34 | /// <summary> | 34 | /// <summary> |
35 | /// NEEDS AUDIT. | 35 | /// NEEDS AUDIT. |
36 | /// </summary> | 36 | /// </summary> |
37 | /// <remarks> | 37 | /// <remarks> |
38 | /// Suggested implementation | 38 | /// Suggested implementation |
39 | /// <para>Store two digests for each foreign host. A local copy of the local hash using the local challenge (when issued), and a local copy of the remote hash using the remote challenge.</para> | 39 | /// <para>Store two digests for each foreign host. A local copy of the local hash using the local challenge (when issued), and a local copy of the remote hash using the remote challenge.</para> |
40 | /// <para>When sending data to the foreign host - run 'Sign' on the data and affix the returned byte[] to the message.</para> | 40 | /// <para>When sending data to the foreign host - run 'Sign' on the data and affix the returned byte[] to the message.</para> |
41 | /// <para>When recieving data from the foreign host - run 'Authenticate' against the data and the attached byte[].</para> | 41 | /// <para>When recieving data from the foreign host - run 'Authenticate' against the data and the attached byte[].</para> |
42 | /// <para>Both hosts should be performing these operations for this to be effective.</para> | 42 | /// <para>Both hosts should be performing these operations for this to be effective.</para> |
43 | /// </remarks> | 43 | /// </remarks> |
44 | class RemoteDigest | 44 | class RemoteDigest |
45 | { | 45 | { |
46 | private byte[] currentHash; | 46 | private byte[] currentHash; |
47 | private byte[] secret; | 47 | private byte[] secret; |
48 | 48 | ||
49 | private SHA512Managed SHA512; | 49 | private SHA512Managed SHA512; |
50 | 50 | ||
51 | /// <summary> | 51 | /// <summary> |
52 | /// Initialises a new RemoteDigest authentication mechanism | 52 | /// Initialises a new RemoteDigest authentication mechanism |
53 | /// </summary> | 53 | /// </summary> |
54 | /// <remarks>Needs an audit by a cryptographic professional - was not "roll your own"'d by choice but rather a serious lack of decent authentication mechanisms in .NET remoting</remarks> | 54 | /// <remarks>Needs an audit by a cryptographic professional - was not "roll your own"'d by choice but rather a serious lack of decent authentication mechanisms in .NET remoting</remarks> |
55 | /// <param name="sharedSecret">The shared secret between systems (for inter-sim, this is provided in encrypted form during connection, for grid this is input manually in setup)</param> | 55 | /// <param name="sharedSecret">The shared secret between systems (for inter-sim, this is provided in encrypted form during connection, for grid this is input manually in setup)</param> |
56 | /// <param name="salt">Binary salt - some common value - to be decided what</param> | 56 | /// <param name="salt">Binary salt - some common value - to be decided what</param> |
57 | /// <param name="challenge">The challenge key provided by the third party</param> | 57 | /// <param name="challenge">The challenge key provided by the third party</param> |
58 | public RemoteDigest(string sharedSecret, byte[] salt, string challenge) | 58 | public RemoteDigest(string sharedSecret, byte[] salt, string challenge) |
59 | { | 59 | { |
60 | SHA512 = new SHA512Managed(); | 60 | SHA512 = new SHA512Managed(); |
61 | Rfc2898DeriveBytes RFC2898 = new Rfc2898DeriveBytes(sharedSecret,salt); | 61 | Rfc2898DeriveBytes RFC2898 = new Rfc2898DeriveBytes(sharedSecret,salt); |
62 | secret = RFC2898.GetBytes(512); | 62 | secret = RFC2898.GetBytes(512); |
63 | ASCIIEncoding ASCII = new ASCIIEncoding(); | 63 | ASCIIEncoding ASCII = new ASCIIEncoding(); |
64 | 64 | ||
65 | currentHash = SHA512.ComputeHash(AppendArrays(secret, ASCII.GetBytes(challenge))); | 65 | currentHash = SHA512.ComputeHash(AppendArrays(secret, ASCII.GetBytes(challenge))); |
66 | } | 66 | } |
67 | 67 | ||
68 | /// <summary> | 68 | /// <summary> |
69 | /// Authenticates a piece of incoming data against the local digest. Upon successful authentication, digest string is incremented. | 69 | /// Authenticates a piece of incoming data against the local digest. Upon successful authentication, digest string is incremented. |
70 | /// </summary> | 70 | /// </summary> |
71 | /// <param name="data">The incoming data</param> | 71 | /// <param name="data">The incoming data</param> |
72 | /// <param name="digest">The remote digest</param> | 72 | /// <param name="digest">The remote digest</param> |
73 | /// <returns></returns> | 73 | /// <returns></returns> |
74 | public bool Authenticate(byte[] data, byte[] digest) | 74 | public bool Authenticate(byte[] data, byte[] digest) |
75 | { | 75 | { |
76 | byte[] newHash = SHA512.ComputeHash(AppendArrays(AppendArrays(currentHash, secret), data)); | 76 | byte[] newHash = SHA512.ComputeHash(AppendArrays(AppendArrays(currentHash, secret), data)); |
77 | if (digest == newHash) | 77 | if (digest == newHash) |
78 | { | 78 | { |
79 | currentHash = newHash; | 79 | currentHash = newHash; |
80 | return true; | 80 | return true; |
81 | } | 81 | } |
82 | else | 82 | else |
83 | { | 83 | { |
84 | throw new Exception("Hash comparison failed. Key resync required."); | 84 | throw new Exception("Hash comparison failed. Key resync required."); |
85 | } | 85 | } |
86 | } | 86 | } |
87 | 87 | ||
88 | /// <summary> | 88 | /// <summary> |
89 | /// Signs a new bit of data with the current hash. Returns a byte array which should be affixed to the message. | 89 | /// Signs a new bit of data with the current hash. Returns a byte array which should be affixed to the message. |
90 | /// Signing a piece of data will automatically increment the hash - if you sign data and do not send it, the | 90 | /// Signing a piece of data will automatically increment the hash - if you sign data and do not send it, the |
91 | /// hashes will get out of sync and throw an exception when validation is attempted. | 91 | /// hashes will get out of sync and throw an exception when validation is attempted. |
92 | /// </summary> | 92 | /// </summary> |
93 | /// <param name="data">The outgoing data</param> | 93 | /// <param name="data">The outgoing data</param> |
94 | /// <returns>The local digest</returns> | 94 | /// <returns>The local digest</returns> |
95 | public byte[] Sign(byte[] data) | 95 | public byte[] Sign(byte[] data) |
96 | { | 96 | { |
97 | currentHash = SHA512.ComputeHash(AppendArrays(AppendArrays(currentHash, secret), data)); | 97 | currentHash = SHA512.ComputeHash(AppendArrays(AppendArrays(currentHash, secret), data)); |
98 | return currentHash; | 98 | return currentHash; |
99 | } | 99 | } |
100 | 100 | ||
101 | /// <summary> | 101 | /// <summary> |
102 | /// Generates a new challenge string to be issued to a foreign host. Challenges are 1024-bit (effective strength of less than 512-bits) messages generated using the Crytographic Random Number Generator. | 102 | /// Generates a new challenge string to be issued to a foreign host. Challenges are 1024-bit (effective strength of less than 512-bits) messages generated using the Crytographic Random Number Generator. |
103 | /// </summary> | 103 | /// </summary> |
104 | /// <returns>A 128-character hexadecimal string containing the challenge.</returns> | 104 | /// <returns>A 128-character hexadecimal string containing the challenge.</returns> |
105 | public static string GenerateChallenge() | 105 | public static string GenerateChallenge() |
106 | { | 106 | { |
107 | RNGCryptoServiceProvider RNG = new RNGCryptoServiceProvider(); | 107 | RNGCryptoServiceProvider RNG = new RNGCryptoServiceProvider(); |
108 | byte[] bytes = new byte[64]; | 108 | byte[] bytes = new byte[64]; |
109 | RNG.GetBytes(bytes); | 109 | RNG.GetBytes(bytes); |
110 | 110 | ||
111 | StringBuilder sb = new StringBuilder(bytes.Length * 2); | 111 | StringBuilder sb = new StringBuilder(bytes.Length * 2); |
112 | foreach (byte b in bytes) | 112 | foreach (byte b in bytes) |
113 | { | 113 | { |
114 | sb.AppendFormat("{0:x2}", b); | 114 | sb.AppendFormat("{0:x2}", b); |
115 | } | 115 | } |
116 | return sb.ToString(); | 116 | return sb.ToString(); |
117 | } | 117 | } |
118 | 118 | ||
119 | /// <summary> | 119 | /// <summary> |
120 | /// Helper function, merges two byte arrays | 120 | /// Helper function, merges two byte arrays |
121 | /// </summary> | 121 | /// </summary> |
122 | /// <remarks>Sourced from MSDN Forum</remarks> | 122 | /// <remarks>Sourced from MSDN Forum</remarks> |
123 | /// <param name="a">A</param> | 123 | /// <param name="a">A</param> |
124 | /// <param name="b">B</param> | 124 | /// <param name="b">B</param> |
125 | /// <returns>C</returns> | 125 | /// <returns>C</returns> |
126 | private byte[] AppendArrays(byte[] a, byte[] b) | 126 | private byte[] AppendArrays(byte[] a, byte[] b) |
127 | { | 127 | { |
128 | byte[] c = new byte[a.Length + b.Length]; | 128 | byte[] c = new byte[a.Length + b.Length]; |
129 | Buffer.BlockCopy(a, 0, c, 0, a.Length); | 129 | Buffer.BlockCopy(a, 0, c, 0, a.Length); |
130 | Buffer.BlockCopy(b, 0, c, a.Length, b.Length); | 130 | Buffer.BlockCopy(b, 0, c, a.Length, b.Length); |
131 | return c; | 131 | return c; |
132 | } | 132 | } |
133 | 133 | ||
134 | } | 134 | } |
135 | } | 135 | } |
diff --git a/OpenSim/Framework/General/Types/AgentCiruitData.cs b/OpenSim/Framework/General/Types/AgentCiruitData.cs index ed9ee3c..36bb26d 100644 --- a/OpenSim/Framework/General/Types/AgentCiruitData.cs +++ b/OpenSim/Framework/General/Types/AgentCiruitData.cs | |||
@@ -1,49 +1,49 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using libsecondlife; | 28 | using libsecondlife; |
29 | using System; | 29 | using System; |
30 | 30 | ||
31 | namespace OpenSim.Framework.Types | 31 | namespace OpenSim.Framework.Types |
32 | { | 32 | { |
33 | [Serializable] | 33 | [Serializable] |
34 | public class AgentCircuitData | 34 | public class AgentCircuitData |
35 | { | 35 | { |
36 | public AgentCircuitData() { } | 36 | public AgentCircuitData() { } |
37 | public LLUUID AgentID; | 37 | public LLUUID AgentID; |
38 | public LLUUID SessionID; | 38 | public LLUUID SessionID; |
39 | public LLUUID SecureSessionID; | 39 | public LLUUID SecureSessionID; |
40 | public LLVector3 startpos; | 40 | public LLVector3 startpos; |
41 | public string firstname; | 41 | public string firstname; |
42 | public string lastname; | 42 | public string lastname; |
43 | public uint circuitcode; | 43 | public uint circuitcode; |
44 | public bool child; | 44 | public bool child; |
45 | public LLUUID InventoryFolder; | 45 | public LLUUID InventoryFolder; |
46 | public LLUUID BaseFolder; | 46 | public LLUUID BaseFolder; |
47 | public string CapsPath = ""; | 47 | public string CapsPath = ""; |
48 | } | 48 | } |
49 | } | 49 | } |
diff --git a/OpenSim/Framework/General/Types/AgentWearable.cs b/OpenSim/Framework/General/Types/AgentWearable.cs index 6152b7d..404df0d 100644 --- a/OpenSim/Framework/General/Types/AgentWearable.cs +++ b/OpenSim/Framework/General/Types/AgentWearable.cs | |||
@@ -1,57 +1,57 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using libsecondlife; | 28 | using libsecondlife; |
29 | 29 | ||
30 | namespace OpenSim.Framework.Types | 30 | namespace OpenSim.Framework.Types |
31 | { | 31 | { |
32 | public class AvatarWearable | 32 | public class AvatarWearable |
33 | { | 33 | { |
34 | public LLUUID AssetID = new LLUUID("00000000-0000-0000-0000-000000000000"); | 34 | public LLUUID AssetID = new LLUUID("00000000-0000-0000-0000-000000000000"); |
35 | public LLUUID ItemID = new LLUUID("00000000-0000-0000-0000-000000000000"); | 35 | public LLUUID ItemID = new LLUUID("00000000-0000-0000-0000-000000000000"); |
36 | 36 | ||
37 | public AvatarWearable() | 37 | public AvatarWearable() |
38 | { | 38 | { |
39 | 39 | ||
40 | } | 40 | } |
41 | 41 | ||
42 | public static AvatarWearable[] DefaultWearables | 42 | public static AvatarWearable[] DefaultWearables |
43 | { | 43 | { |
44 | get | 44 | get |
45 | { | 45 | { |
46 | AvatarWearable[] defaultWearables = new AvatarWearable[13]; //should be 13 of these | 46 | AvatarWearable[] defaultWearables = new AvatarWearable[13]; //should be 13 of these |
47 | for (int i = 0; i < 13; i++) | 47 | for (int i = 0; i < 13; i++) |
48 | { | 48 | { |
49 | defaultWearables[i] = new AvatarWearable(); | 49 | defaultWearables[i] = new AvatarWearable(); |
50 | } | 50 | } |
51 | defaultWearables[0].AssetID = new LLUUID("66c41e39-38f9-f75a-024e-585989bfab73"); | 51 | defaultWearables[0].AssetID = new LLUUID("66c41e39-38f9-f75a-024e-585989bfab73"); |
52 | defaultWearables[0].ItemID = LLUUID.Random(); | 52 | defaultWearables[0].ItemID = LLUUID.Random(); |
53 | return defaultWearables; | 53 | return defaultWearables; |
54 | } | 54 | } |
55 | } | 55 | } |
56 | } | 56 | } |
57 | } | 57 | } |
diff --git a/OpenSim/Framework/General/Types/AssetBase.cs b/OpenSim/Framework/General/Types/AssetBase.cs index c203f51..181e1e3 100644 --- a/OpenSim/Framework/General/Types/AssetBase.cs +++ b/OpenSim/Framework/General/Types/AssetBase.cs | |||
@@ -1,46 +1,46 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using libsecondlife; | 28 | using libsecondlife; |
29 | 29 | ||
30 | namespace OpenSim.Framework.Types | 30 | namespace OpenSim.Framework.Types |
31 | { | 31 | { |
32 | public class AssetBase | 32 | public class AssetBase |
33 | { | 33 | { |
34 | public byte[] Data; | 34 | public byte[] Data; |
35 | public LLUUID FullID; | 35 | public LLUUID FullID; |
36 | public sbyte Type; | 36 | public sbyte Type; |
37 | public sbyte InvType; | 37 | public sbyte InvType; |
38 | public string Name; | 38 | public string Name; |
39 | public string Description; | 39 | public string Description; |
40 | 40 | ||
41 | public AssetBase() | 41 | public AssetBase() |
42 | { | 42 | { |
43 | 43 | ||
44 | } | 44 | } |
45 | } | 45 | } |
46 | } | 46 | } |
diff --git a/OpenSim/Framework/General/Types/AssetLandmark.cs b/OpenSim/Framework/General/Types/AssetLandmark.cs index 8aa872e..7cec6f6 100644 --- a/OpenSim/Framework/General/Types/AssetLandmark.cs +++ b/OpenSim/Framework/General/Types/AssetLandmark.cs | |||
@@ -1,59 +1,59 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using System.Text; | 28 | using System.Text; |
29 | using libsecondlife; | 29 | using libsecondlife; |
30 | 30 | ||
31 | namespace OpenSim.Framework.Types | 31 | namespace OpenSim.Framework.Types |
32 | { | 32 | { |
33 | public class AssetLandmark : AssetBase | 33 | public class AssetLandmark : AssetBase |
34 | { | 34 | { |
35 | public int Version; | 35 | public int Version; |
36 | public LLVector3 Position; | 36 | public LLVector3 Position; |
37 | public LLUUID RegionID; | 37 | public LLUUID RegionID; |
38 | 38 | ||
39 | public AssetLandmark(AssetBase a) | 39 | public AssetLandmark(AssetBase a) |
40 | { | 40 | { |
41 | this.Data = a.Data; | 41 | this.Data = a.Data; |
42 | this.FullID = a.FullID; | 42 | this.FullID = a.FullID; |
43 | this.Type = a.Type; | 43 | this.Type = a.Type; |
44 | this.InvType = a.InvType; | 44 | this.InvType = a.InvType; |
45 | this.Name = a.Name; | 45 | this.Name = a.Name; |
46 | this.Description = a.Description; | 46 | this.Description = a.Description; |
47 | InternData(); | 47 | InternData(); |
48 | } | 48 | } |
49 | 49 | ||
50 | private void InternData() | 50 | private void InternData() |
51 | { | 51 | { |
52 | string temp = Encoding.UTF8.GetString(Data).Trim(); | 52 | string temp = Encoding.UTF8.GetString(Data).Trim(); |
53 | string[] parts = temp.Split('\n'); | 53 | string[] parts = temp.Split('\n'); |
54 | int.TryParse(parts[0].Substring(17, 1), out Version); | 54 | int.TryParse(parts[0].Substring(17, 1), out Version); |
55 | LLUUID.TryParse(parts[1].Substring(10, 36), out RegionID); | 55 | LLUUID.TryParse(parts[1].Substring(10, 36), out RegionID); |
56 | LLVector3.TryParse(parts[2].Substring(11, parts[2].Length - 11), out Position); | 56 | LLVector3.TryParse(parts[2].Substring(11, parts[2].Length - 11), out Position); |
57 | } | 57 | } |
58 | } | 58 | } |
59 | } | 59 | } |
diff --git a/OpenSim/Framework/General/Types/AssetStorage.cs b/OpenSim/Framework/General/Types/AssetStorage.cs index 3681336..d49e9e8 100644 --- a/OpenSim/Framework/General/Types/AssetStorage.cs +++ b/OpenSim/Framework/General/Types/AssetStorage.cs | |||
@@ -1,47 +1,47 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using libsecondlife; | 28 | using libsecondlife; |
29 | 29 | ||
30 | namespace OpenSim.Framework.Types | 30 | namespace OpenSim.Framework.Types |
31 | { | 31 | { |
32 | public class AssetStorage | 32 | public class AssetStorage |
33 | { | 33 | { |
34 | 34 | ||
35 | public AssetStorage() { | 35 | public AssetStorage() { |
36 | } | 36 | } |
37 | 37 | ||
38 | public AssetStorage(LLUUID assetUUID) { | 38 | public AssetStorage(LLUUID assetUUID) { |
39 | UUID=assetUUID; | 39 | UUID=assetUUID; |
40 | } | 40 | } |
41 | 41 | ||
42 | public byte[] Data; | 42 | public byte[] Data; |
43 | public sbyte Type; | 43 | public sbyte Type; |
44 | public string Name; | 44 | public string Name; |
45 | public LLUUID UUID; | 45 | public LLUUID UUID; |
46 | } | 46 | } |
47 | } | 47 | } |
diff --git a/OpenSim/Framework/General/Types/EstateSettings.cs b/OpenSim/Framework/General/Types/EstateSettings.cs index 436b109..25b3b18 100644 --- a/OpenSim/Framework/General/Types/EstateSettings.cs +++ b/OpenSim/Framework/General/Types/EstateSettings.cs | |||
@@ -1,93 +1,93 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | 30 | ||
31 | namespace OpenSim.Framework.Types | 31 | namespace OpenSim.Framework.Types |
32 | { | 32 | { |
33 | public class EstateSettings | 33 | public class EstateSettings |
34 | { | 34 | { |
35 | //Settings to this island | 35 | //Settings to this island |
36 | public float billableFactor = (float)0.0; | 36 | public float billableFactor = (float)0.0; |
37 | public uint estateID = 0; | 37 | public uint estateID = 0; |
38 | public uint parentEstateID = 0; | 38 | public uint parentEstateID = 0; |
39 | 39 | ||
40 | public byte maxAgents = 40; | 40 | public byte maxAgents = 40; |
41 | public float objectBonusFactor = (float)1.0; | 41 | public float objectBonusFactor = (float)1.0; |
42 | 42 | ||
43 | public int redirectGridX = 0; //?? | 43 | public int redirectGridX = 0; //?? |
44 | public int redirectGridY = 0; //?? | 44 | public int redirectGridY = 0; //?? |
45 | public Simulator.RegionFlags regionFlags = Simulator.RegionFlags.None; //Booleam values of various region settings | 45 | public Simulator.RegionFlags regionFlags = Simulator.RegionFlags.None; //Booleam values of various region settings |
46 | public Simulator.SimAccess simAccess = Simulator.SimAccess.Mature; //Is sim PG, Mature, etc? Mature by default. | 46 | public Simulator.SimAccess simAccess = Simulator.SimAccess.Mature; //Is sim PG, Mature, etc? Mature by default. |
47 | public float sunHour = 0; | 47 | public float sunHour = 0; |
48 | 48 | ||
49 | public float terrainRaiseLimit = 0; | 49 | public float terrainRaiseLimit = 0; |
50 | public float terrainLowerLimit = 0; | 50 | public float terrainLowerLimit = 0; |
51 | 51 | ||
52 | public bool useFixedSun = false; | 52 | public bool useFixedSun = false; |
53 | public int pricePerMeter = 1; | 53 | public int pricePerMeter = 1; |
54 | 54 | ||
55 | public ushort regionWaterHeight = 20; | 55 | public ushort regionWaterHeight = 20; |
56 | public bool regionAllowTerraform = true; | 56 | public bool regionAllowTerraform = true; |
57 | 57 | ||
58 | // Region Information | 58 | // Region Information |
59 | // Low resolution 'base' textures. No longer used. | 59 | // Low resolution 'base' textures. No longer used. |
60 | public LLUUID terrainBase0 = new LLUUID("b8d3965a-ad78-bf43-699b-bff8eca6c975"); // Default | 60 | public LLUUID terrainBase0 = new LLUUID("b8d3965a-ad78-bf43-699b-bff8eca6c975"); // Default |
61 | public LLUUID terrainBase1 = new LLUUID("abb783e6-3e93-26c0-248a-247666855da3"); // Default | 61 | public LLUUID terrainBase1 = new LLUUID("abb783e6-3e93-26c0-248a-247666855da3"); // Default |
62 | public LLUUID terrainBase2 = new LLUUID("179cdabd-398a-9b6b-1391-4dc333ba321f"); // Default | 62 | public LLUUID terrainBase2 = new LLUUID("179cdabd-398a-9b6b-1391-4dc333ba321f"); // Default |
63 | public LLUUID terrainBase3 = new LLUUID("beb169c7-11ea-fff2-efe5-0f24dc881df2"); // Default | 63 | public LLUUID terrainBase3 = new LLUUID("beb169c7-11ea-fff2-efe5-0f24dc881df2"); // Default |
64 | 64 | ||
65 | // Higher resolution terrain textures | 65 | // Higher resolution terrain textures |
66 | public LLUUID terrainDetail0 = new LLUUID("00000000-0000-0000-0000-000000000000"); | 66 | public LLUUID terrainDetail0 = new LLUUID("00000000-0000-0000-0000-000000000000"); |
67 | public LLUUID terrainDetail1 = new LLUUID("00000000-0000-0000-0000-000000000000"); | 67 | public LLUUID terrainDetail1 = new LLUUID("00000000-0000-0000-0000-000000000000"); |
68 | public LLUUID terrainDetail2 = new LLUUID("00000000-0000-0000-0000-000000000000"); | 68 | public LLUUID terrainDetail2 = new LLUUID("00000000-0000-0000-0000-000000000000"); |
69 | public LLUUID terrainDetail3 = new LLUUID("00000000-0000-0000-0000-000000000000"); | 69 | public LLUUID terrainDetail3 = new LLUUID("00000000-0000-0000-0000-000000000000"); |
70 | 70 | ||
71 | // First quad - each point is bilinearly interpolated at each meter of terrain | 71 | // First quad - each point is bilinearly interpolated at each meter of terrain |
72 | public float terrainStartHeight0 = 10.0f; | 72 | public float terrainStartHeight0 = 10.0f; |
73 | public float terrainStartHeight1 = 10.0f; | 73 | public float terrainStartHeight1 = 10.0f; |
74 | public float terrainStartHeight2 = 10.0f; | 74 | public float terrainStartHeight2 = 10.0f; |
75 | public float terrainStartHeight3 = 10.0f; | 75 | public float terrainStartHeight3 = 10.0f; |
76 | 76 | ||
77 | // Second quad - also bilinearly interpolated. | 77 | // Second quad - also bilinearly interpolated. |
78 | // Terrain texturing is done that: | 78 | // Terrain texturing is done that: |
79 | // 0..3 (0 = base0, 3 = base3) = (terrain[x,y] - start[x,y]) / range[x,y] | 79 | // 0..3 (0 = base0, 3 = base3) = (terrain[x,y] - start[x,y]) / range[x,y] |
80 | public float terrainHeightRange0 = 60.0f; //00 | 80 | public float terrainHeightRange0 = 60.0f; //00 |
81 | public float terrainHeightRange1 = 60.0f; //01 | 81 | public float terrainHeightRange1 = 60.0f; //01 |
82 | public float terrainHeightRange2 = 60.0f; //10 | 82 | public float terrainHeightRange2 = 60.0f; //10 |
83 | public float terrainHeightRange3 = 60.0f; //11 | 83 | public float terrainHeightRange3 = 60.0f; //11 |
84 | 84 | ||
85 | // Terrain Default (Must be in F32 Format!) | 85 | // Terrain Default (Must be in F32 Format!) |
86 | public string terrainFile = "default.r32"; | 86 | public string terrainFile = "default.r32"; |
87 | public double terrainMultiplier = 60.0; | 87 | public double terrainMultiplier = 60.0; |
88 | public float waterHeight = (float)20.0; | 88 | public float waterHeight = (float)20.0; |
89 | 89 | ||
90 | public LLUUID terrainImageID = LLUUID.Zero; // the assetID that is the current Map image for this region | 90 | public LLUUID terrainImageID = LLUUID.Zero; // the assetID that is the current Map image for this region |
91 | 91 | ||
92 | } | 92 | } |
93 | } | 93 | } |
diff --git a/OpenSim/Framework/General/Types/Login.cs b/OpenSim/Framework/General/Types/Login.cs index d54c019..3aaf613 100644 --- a/OpenSim/Framework/General/Types/Login.cs +++ b/OpenSim/Framework/General/Types/Login.cs | |||
@@ -1,49 +1,49 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using libsecondlife; | 28 | using libsecondlife; |
29 | 29 | ||
30 | namespace OpenSim.Framework.Types | 30 | namespace OpenSim.Framework.Types |
31 | { | 31 | { |
32 | public class Login | 32 | public class Login |
33 | { | 33 | { |
34 | public string First = "Test"; | 34 | public string First = "Test"; |
35 | public string Last = "User"; | 35 | public string Last = "User"; |
36 | public LLUUID Agent; | 36 | public LLUUID Agent; |
37 | public LLUUID Session; | 37 | public LLUUID Session; |
38 | public LLUUID SecureSession = LLUUID.Zero; | 38 | public LLUUID SecureSession = LLUUID.Zero; |
39 | public LLUUID InventoryFolder; | 39 | public LLUUID InventoryFolder; |
40 | public LLUUID BaseFolder; | 40 | public LLUUID BaseFolder; |
41 | public uint CircuitCode; | 41 | public uint CircuitCode; |
42 | public string CapsPath =""; | 42 | public string CapsPath =""; |
43 | 43 | ||
44 | public Login() | 44 | public Login() |
45 | { | 45 | { |
46 | 46 | ||
47 | } | 47 | } |
48 | } | 48 | } |
49 | } | 49 | } |
diff --git a/OpenSim/Framework/General/Types/MapBlockData.cs b/OpenSim/Framework/General/Types/MapBlockData.cs index fbb3b73..212ce4b 100644 --- a/OpenSim/Framework/General/Types/MapBlockData.cs +++ b/OpenSim/Framework/General/Types/MapBlockData.cs | |||
@@ -1,23 +1,23 @@ | |||
1 | using System; | 1 | using System; |
2 | using libsecondlife; | 2 | using libsecondlife; |
3 | 3 | ||
4 | namespace OpenSim.Framework.Types | 4 | namespace OpenSim.Framework.Types |
5 | { | 5 | { |
6 | public class MapBlockData | 6 | public class MapBlockData |
7 | { | 7 | { |
8 | public uint Flags; | 8 | public uint Flags; |
9 | public ushort X; | 9 | public ushort X; |
10 | public ushort Y; | 10 | public ushort Y; |
11 | public byte Agents; | 11 | public byte Agents; |
12 | public byte Access; | 12 | public byte Access; |
13 | public byte WaterHeight; | 13 | public byte WaterHeight; |
14 | public LLUUID MapImageId; | 14 | public LLUUID MapImageId; |
15 | public String Name; | 15 | public String Name; |
16 | public uint RegionFlags; | 16 | public uint RegionFlags; |
17 | 17 | ||
18 | public MapBlockData() | 18 | public MapBlockData() |
19 | { | 19 | { |
20 | 20 | ||
21 | } | 21 | } |
22 | } | 22 | } |
23 | } | 23 | } |
diff --git a/OpenSim/Framework/General/Types/NeighbourInfo.cs b/OpenSim/Framework/General/Types/NeighbourInfo.cs index bb67981..7e83ffc 100644 --- a/OpenSim/Framework/General/Types/NeighbourInfo.cs +++ b/OpenSim/Framework/General/Types/NeighbourInfo.cs | |||
@@ -1,42 +1,42 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | namespace OpenSim.Framework.Types | 28 | namespace OpenSim.Framework.Types |
29 | { | 29 | { |
30 | public class NeighbourInfo | 30 | public class NeighbourInfo |
31 | { | 31 | { |
32 | public NeighbourInfo() | 32 | public NeighbourInfo() |
33 | { | 33 | { |
34 | } | 34 | } |
35 | 35 | ||
36 | public ulong regionhandle; | 36 | public ulong regionhandle; |
37 | public uint RegionLocX; | 37 | public uint RegionLocX; |
38 | public uint RegionLocY; | 38 | public uint RegionLocY; |
39 | public string sim_ip; | 39 | public string sim_ip; |
40 | public uint sim_port; | 40 | public uint sim_port; |
41 | } | 41 | } |
42 | } | 42 | } |
diff --git a/OpenSim/Framework/General/Types/NetworkServersInfo.cs b/OpenSim/Framework/General/Types/NetworkServersInfo.cs index 900354c..6259d7b 100644 --- a/OpenSim/Framework/General/Types/NetworkServersInfo.cs +++ b/OpenSim/Framework/General/Types/NetworkServersInfo.cs | |||
@@ -1,219 +1,219 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using System; | 28 | using System; |
29 | using OpenSim.Framework.Console; | 29 | using OpenSim.Framework.Console; |
30 | using OpenSim.Framework.Interfaces; | 30 | using OpenSim.Framework.Interfaces; |
31 | 31 | ||
32 | namespace OpenSim.Framework.Types | 32 | namespace OpenSim.Framework.Types |
33 | { | 33 | { |
34 | public class NetworkServersInfo | 34 | public class NetworkServersInfo |
35 | { | 35 | { |
36 | public string AssetURL = "http://127.0.0.1:8003/"; | 36 | public string AssetURL = "http://127.0.0.1:8003/"; |
37 | public string AssetSendKey = ""; | 37 | public string AssetSendKey = ""; |
38 | 38 | ||
39 | public string GridURL = ""; | 39 | public string GridURL = ""; |
40 | public string GridSendKey = ""; | 40 | public string GridSendKey = ""; |
41 | public string GridRecvKey = ""; | 41 | public string GridRecvKey = ""; |
42 | public string UserURL = ""; | 42 | public string UserURL = ""; |
43 | public string UserSendKey = ""; | 43 | public string UserSendKey = ""; |
44 | public string UserRecvKey = ""; | 44 | public string UserRecvKey = ""; |
45 | public bool isSandbox; | 45 | public bool isSandbox; |
46 | 46 | ||
47 | public uint DefaultHomeLocX = 1000; | 47 | public uint DefaultHomeLocX = 1000; |
48 | public uint DefaultHomeLocY = 1000; | 48 | public uint DefaultHomeLocY = 1000; |
49 | 49 | ||
50 | public int HttpListenerPort = 9000; | 50 | public int HttpListenerPort = 9000; |
51 | public int RemotingListenerPort = 8895; | 51 | public int RemotingListenerPort = 8895; |
52 | 52 | ||
53 | public void InitConfig(bool sandboxMode, IGenericConfig configData) | 53 | public void InitConfig(bool sandboxMode, IGenericConfig configData) |
54 | { | 54 | { |
55 | this.isSandbox = sandboxMode; | 55 | this.isSandbox = sandboxMode; |
56 | 56 | ||
57 | try | 57 | try |
58 | { | 58 | { |
59 | string attri = ""; | 59 | string attri = ""; |
60 | 60 | ||
61 | attri = ""; | 61 | attri = ""; |
62 | attri = configData.GetAttribute("HttpListenerPort"); | 62 | attri = configData.GetAttribute("HttpListenerPort"); |
63 | if (attri == "") | 63 | if (attri == "") |
64 | { | 64 | { |
65 | string location = MainLog.Instance.CmdPrompt("Http Listener Port", "9000"); | 65 | string location = MainLog.Instance.CmdPrompt("Http Listener Port", "9000"); |
66 | configData.SetAttribute("HttpListenerPort", location); | 66 | configData.SetAttribute("HttpListenerPort", location); |
67 | this.HttpListenerPort = Convert.ToInt32(location); | 67 | this.HttpListenerPort = Convert.ToInt32(location); |
68 | } | 68 | } |
69 | else | 69 | else |
70 | { | 70 | { |
71 | this.HttpListenerPort = Convert.ToInt32(attri); | 71 | this.HttpListenerPort = Convert.ToInt32(attri); |
72 | } | 72 | } |
73 | 73 | ||
74 | attri = ""; | 74 | attri = ""; |
75 | attri = configData.GetAttribute("RemotingListenerPort"); | 75 | attri = configData.GetAttribute("RemotingListenerPort"); |
76 | if (attri == "") | 76 | if (attri == "") |
77 | { | 77 | { |
78 | string location = MainLog.Instance.CmdPrompt("Remoting Listener Port", "8895"); | 78 | string location = MainLog.Instance.CmdPrompt("Remoting Listener Port", "8895"); |
79 | configData.SetAttribute("RemotingListenerPort", location); | 79 | configData.SetAttribute("RemotingListenerPort", location); |
80 | this.RemotingListenerPort = Convert.ToInt32(location); | 80 | this.RemotingListenerPort = Convert.ToInt32(location); |
81 | } | 81 | } |
82 | else | 82 | else |
83 | { | 83 | { |
84 | this.RemotingListenerPort = Convert.ToInt32(attri); | 84 | this.RemotingListenerPort = Convert.ToInt32(attri); |
85 | } | 85 | } |
86 | 86 | ||
87 | if (sandboxMode) | 87 | if (sandboxMode) |
88 | { | 88 | { |
89 | // default home location X | 89 | // default home location X |
90 | attri = ""; | 90 | attri = ""; |
91 | attri = configData.GetAttribute("DefaultLocationX"); | 91 | attri = configData.GetAttribute("DefaultLocationX"); |
92 | if (attri == "") | 92 | if (attri == "") |
93 | { | 93 | { |
94 | string location = MainLog.Instance.CmdPrompt("Default Home Location X", "1000"); | 94 | string location = MainLog.Instance.CmdPrompt("Default Home Location X", "1000"); |
95 | configData.SetAttribute("DefaultLocationX", location); | 95 | configData.SetAttribute("DefaultLocationX", location); |
96 | this.DefaultHomeLocX = (uint)Convert.ToUInt32(location); | 96 | this.DefaultHomeLocX = (uint)Convert.ToUInt32(location); |
97 | } | 97 | } |
98 | else | 98 | else |
99 | { | 99 | { |
100 | this.DefaultHomeLocX = (uint)Convert.ToUInt32(attri); | 100 | this.DefaultHomeLocX = (uint)Convert.ToUInt32(attri); |
101 | } | 101 | } |
102 | 102 | ||
103 | // default home location Y | 103 | // default home location Y |
104 | attri = ""; | 104 | attri = ""; |
105 | attri = configData.GetAttribute("DefaultLocationY"); | 105 | attri = configData.GetAttribute("DefaultLocationY"); |
106 | if (attri == "") | 106 | if (attri == "") |
107 | { | 107 | { |
108 | string location = MainLog.Instance.CmdPrompt("Default Home Location Y", "1000"); | 108 | string location = MainLog.Instance.CmdPrompt("Default Home Location Y", "1000"); |
109 | configData.SetAttribute("DefaultLocationY", location); | 109 | configData.SetAttribute("DefaultLocationY", location); |
110 | this.DefaultHomeLocY = (uint)Convert.ToUInt32(location); | 110 | this.DefaultHomeLocY = (uint)Convert.ToUInt32(location); |
111 | } | 111 | } |
112 | else | 112 | else |
113 | { | 113 | { |
114 | this.DefaultHomeLocY = (uint)Convert.ToUInt32(attri); | 114 | this.DefaultHomeLocY = (uint)Convert.ToUInt32(attri); |
115 | } | 115 | } |
116 | } | 116 | } |
117 | if (!isSandbox) | 117 | if (!isSandbox) |
118 | { | 118 | { |
119 | //Grid Server | 119 | //Grid Server |
120 | attri = ""; | 120 | attri = ""; |
121 | attri = configData.GetAttribute("GridServerURL"); | 121 | attri = configData.GetAttribute("GridServerURL"); |
122 | if (attri == "") | 122 | if (attri == "") |
123 | { | 123 | { |
124 | this.GridURL = MainLog.Instance.CmdPrompt("Grid server URL", "http://127.0.0.1:8001/"); | 124 | this.GridURL = MainLog.Instance.CmdPrompt("Grid server URL", "http://127.0.0.1:8001/"); |
125 | configData.SetAttribute("GridServerURL", this.GridURL); | 125 | configData.SetAttribute("GridServerURL", this.GridURL); |
126 | } | 126 | } |
127 | else | 127 | else |
128 | { | 128 | { |
129 | this.GridURL = attri; | 129 | this.GridURL = attri; |
130 | } | 130 | } |
131 | 131 | ||
132 | //Grid Send Key | 132 | //Grid Send Key |
133 | attri = ""; | 133 | attri = ""; |
134 | attri = configData.GetAttribute("GridSendKey"); | 134 | attri = configData.GetAttribute("GridSendKey"); |
135 | if (attri == "") | 135 | if (attri == "") |
136 | { | 136 | { |
137 | this.GridSendKey = MainLog.Instance.CmdPrompt("Key to send to grid server", "null"); | 137 | this.GridSendKey = MainLog.Instance.CmdPrompt("Key to send to grid server", "null"); |
138 | configData.SetAttribute("GridSendKey", this.GridSendKey); | 138 | configData.SetAttribute("GridSendKey", this.GridSendKey); |
139 | } | 139 | } |
140 | else | 140 | else |
141 | { | 141 | { |
142 | this.GridSendKey = attri; | 142 | this.GridSendKey = attri; |
143 | } | 143 | } |
144 | 144 | ||
145 | //Grid Receive Key | 145 | //Grid Receive Key |
146 | attri = ""; | 146 | attri = ""; |
147 | attri = configData.GetAttribute("GridRecvKey"); | 147 | attri = configData.GetAttribute("GridRecvKey"); |
148 | if (attri == "") | 148 | if (attri == "") |
149 | { | 149 | { |
150 | this.GridRecvKey = MainLog.Instance.CmdPrompt("Key to expect from grid server", "null"); | 150 | this.GridRecvKey = MainLog.Instance.CmdPrompt("Key to expect from grid server", "null"); |
151 | configData.SetAttribute("GridRecvKey", this.GridRecvKey); | 151 | configData.SetAttribute("GridRecvKey", this.GridRecvKey); |
152 | } | 152 | } |
153 | else | 153 | else |
154 | { | 154 | { |
155 | this.GridRecvKey = attri; | 155 | this.GridRecvKey = attri; |
156 | } | 156 | } |
157 | 157 | ||
158 | //Grid Server | 158 | //Grid Server |
159 | attri = ""; | 159 | attri = ""; |
160 | attri = configData.GetAttribute("UserServerURL"); | 160 | attri = configData.GetAttribute("UserServerURL"); |
161 | if (attri == "") | 161 | if (attri == "") |
162 | { | 162 | { |
163 | this.UserURL= MainLog.Instance.CmdPrompt("User server URL", "http://127.0.0.1:8002/"); | 163 | this.UserURL= MainLog.Instance.CmdPrompt("User server URL", "http://127.0.0.1:8002/"); |
164 | configData.SetAttribute("UserServerURL", this.UserURL); | 164 | configData.SetAttribute("UserServerURL", this.UserURL); |
165 | } | 165 | } |
166 | else | 166 | else |
167 | { | 167 | { |
168 | this.UserURL = attri; | 168 | this.UserURL = attri; |
169 | } | 169 | } |
170 | 170 | ||
171 | //Grid Send Key | 171 | //Grid Send Key |
172 | attri = ""; | 172 | attri = ""; |
173 | attri = configData.GetAttribute("UserSendKey"); | 173 | attri = configData.GetAttribute("UserSendKey"); |
174 | if (attri == "") | 174 | if (attri == "") |
175 | { | 175 | { |
176 | this.UserSendKey = MainLog.Instance.CmdPrompt("Key to send to user server", "null"); | 176 | this.UserSendKey = MainLog.Instance.CmdPrompt("Key to send to user server", "null"); |
177 | configData.SetAttribute("UserSendKey", this.UserSendKey); | 177 | configData.SetAttribute("UserSendKey", this.UserSendKey); |
178 | } | 178 | } |
179 | else | 179 | else |
180 | { | 180 | { |
181 | this.UserSendKey = attri; | 181 | this.UserSendKey = attri; |
182 | } | 182 | } |
183 | 183 | ||
184 | //Grid Receive Key | 184 | //Grid Receive Key |
185 | attri = ""; | 185 | attri = ""; |
186 | attri = configData.GetAttribute("UserRecvKey"); | 186 | attri = configData.GetAttribute("UserRecvKey"); |
187 | if (attri == "") | 187 | if (attri == "") |
188 | { | 188 | { |
189 | this.UserRecvKey = MainLog.Instance.CmdPrompt("Key to expect from user server", "null"); | 189 | this.UserRecvKey = MainLog.Instance.CmdPrompt("Key to expect from user server", "null"); |
190 | configData.SetAttribute("UserRecvKey", this.UserRecvKey); | 190 | configData.SetAttribute("UserRecvKey", this.UserRecvKey); |
191 | } | 191 | } |
192 | else | 192 | else |
193 | { | 193 | { |
194 | this.UserRecvKey = attri; | 194 | this.UserRecvKey = attri; |
195 | } | 195 | } |
196 | 196 | ||
197 | attri = ""; | 197 | attri = ""; |
198 | attri = configData.GetAttribute("AssetServerURL"); | 198 | attri = configData.GetAttribute("AssetServerURL"); |
199 | if (attri == "") | 199 | if (attri == "") |
200 | { | 200 | { |
201 | this.AssetURL = MainLog.Instance.CmdPrompt("Asset server URL", "http://127.0.0.1:8003/"); | 201 | this.AssetURL = MainLog.Instance.CmdPrompt("Asset server URL", "http://127.0.0.1:8003/"); |
202 | configData.SetAttribute("AssetServerURL", this.GridURL); | 202 | configData.SetAttribute("AssetServerURL", this.GridURL); |
203 | } | 203 | } |
204 | else | 204 | else |
205 | { | 205 | { |
206 | this.AssetURL = attri; | 206 | this.AssetURL = attri; |
207 | } | 207 | } |
208 | 208 | ||
209 | } | 209 | } |
210 | configData.Commit(); | 210 | configData.Commit(); |
211 | } | 211 | } |
212 | catch (Exception e) | 212 | catch (Exception e) |
213 | { | 213 | { |
214 | MainLog.Instance.Warn("Config.cs:InitConfig() - Exception occured"); | 214 | MainLog.Instance.Warn("Config.cs:InitConfig() - Exception occured"); |
215 | MainLog.Instance.Warn(e.ToString()); | 215 | MainLog.Instance.Warn(e.ToString()); |
216 | } | 216 | } |
217 | } | 217 | } |
218 | } | 218 | } |
219 | } | 219 | } |
diff --git a/OpenSim/Framework/General/Types/ParcelData.cs b/OpenSim/Framework/General/Types/ParcelData.cs index 17de655..5626299 100644 --- a/OpenSim/Framework/General/Types/ParcelData.cs +++ b/OpenSim/Framework/General/Types/ParcelData.cs | |||
@@ -1,120 +1,120 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using libsecondlife; | 28 | using libsecondlife; |
29 | 29 | ||
30 | namespace OpenSim.Framework.Types | 30 | namespace OpenSim.Framework.Types |
31 | { | 31 | { |
32 | 32 | ||
33 | public class ParcelData | 33 | public class ParcelData |
34 | { | 34 | { |
35 | public byte[] parcelBitmapByteArray = new byte[512]; | 35 | public byte[] parcelBitmapByteArray = new byte[512]; |
36 | public string parcelName = "Your Parcel"; | 36 | public string parcelName = "Your Parcel"; |
37 | public string parcelDesc = ""; | 37 | public string parcelDesc = ""; |
38 | public LLUUID ownerID = new LLUUID(); | 38 | public LLUUID ownerID = new LLUUID(); |
39 | public bool isGroupOwned = false; | 39 | public bool isGroupOwned = false; |
40 | public LLVector3 AABBMin = new LLVector3(); | 40 | public LLVector3 AABBMin = new LLVector3(); |
41 | public LLVector3 AABBMax = new LLVector3(); | 41 | public LLVector3 AABBMax = new LLVector3(); |
42 | public int area = 0; | 42 | public int area = 0; |
43 | public uint auctionID = 0; //Unemplemented. If set to 0, not being auctioned | 43 | public uint auctionID = 0; //Unemplemented. If set to 0, not being auctioned |
44 | public LLUUID authBuyerID = new LLUUID(); //Unemplemented. Authorized Buyer's UUID | 44 | public LLUUID authBuyerID = new LLUUID(); //Unemplemented. Authorized Buyer's UUID |
45 | public Parcel.ParcelCategory category = new Parcel.ParcelCategory(); //Unemplemented. Parcel's chosen category | 45 | public Parcel.ParcelCategory category = new Parcel.ParcelCategory(); //Unemplemented. Parcel's chosen category |
46 | public int claimDate = 0; //Unemplemented | 46 | public int claimDate = 0; //Unemplemented |
47 | public int claimPrice = 0; //Unemplemented | 47 | public int claimPrice = 0; //Unemplemented |
48 | public LLUUID groupID = new LLUUID(); //Unemplemented | 48 | public LLUUID groupID = new LLUUID(); //Unemplemented |
49 | public int groupPrims = 0; | 49 | public int groupPrims = 0; |
50 | public int otherPrims = 0; | 50 | public int otherPrims = 0; |
51 | public int ownerPrims = 0; | 51 | public int ownerPrims = 0; |
52 | public int selectedPrims = 0; | 52 | public int selectedPrims = 0; |
53 | public int simwidePrims = 0; | 53 | public int simwidePrims = 0; |
54 | public int simwideArea = 0; | 54 | public int simwideArea = 0; |
55 | public int salePrice = 0; //Unemeplemented. Parcels price. | 55 | public int salePrice = 0; //Unemeplemented. Parcels price. |
56 | public Parcel.ParcelStatus parcelStatus = Parcel.ParcelStatus.Leased; | 56 | public Parcel.ParcelStatus parcelStatus = Parcel.ParcelStatus.Leased; |
57 | public uint parcelFlags = (uint)Parcel.ParcelFlags.AllowFly | (uint)Parcel.ParcelFlags.AllowLandmark | (uint)Parcel.ParcelFlags.AllowAllObjectEntry | (uint)Parcel.ParcelFlags.AllowDeedToGroup | (uint)Parcel.ParcelFlags.AllowTerraform | (uint)Parcel.ParcelFlags.CreateObjects | (uint)Parcel.ParcelFlags.AllowOtherScripts; | 57 | public uint parcelFlags = (uint)Parcel.ParcelFlags.AllowFly | (uint)Parcel.ParcelFlags.AllowLandmark | (uint)Parcel.ParcelFlags.AllowAllObjectEntry | (uint)Parcel.ParcelFlags.AllowDeedToGroup | (uint)Parcel.ParcelFlags.AllowTerraform | (uint)Parcel.ParcelFlags.CreateObjects | (uint)Parcel.ParcelFlags.AllowOtherScripts; |
58 | public byte landingType = 0; | 58 | public byte landingType = 0; |
59 | public byte mediaAutoScale = 0; | 59 | public byte mediaAutoScale = 0; |
60 | public LLUUID mediaID = LLUUID.Zero; | 60 | public LLUUID mediaID = LLUUID.Zero; |
61 | public int localID = 0; | 61 | public int localID = 0; |
62 | public LLUUID globalID = new LLUUID(); | 62 | public LLUUID globalID = new LLUUID(); |
63 | 63 | ||
64 | public string mediaURL = ""; | 64 | public string mediaURL = ""; |
65 | public string musicURL = ""; | 65 | public string musicURL = ""; |
66 | public float passHours = 0; | 66 | public float passHours = 0; |
67 | public int passPrice = 0; | 67 | public int passPrice = 0; |
68 | public LLUUID snapshotID = LLUUID.Zero; | 68 | public LLUUID snapshotID = LLUUID.Zero; |
69 | public LLVector3 userLocation = new LLVector3(); | 69 | public LLVector3 userLocation = new LLVector3(); |
70 | public LLVector3 userLookAt = new LLVector3(); | 70 | public LLVector3 userLookAt = new LLVector3(); |
71 | 71 | ||
72 | public ParcelData() | 72 | public ParcelData() |
73 | { | 73 | { |
74 | globalID = LLUUID.Random(); | 74 | globalID = LLUUID.Random(); |
75 | } | 75 | } |
76 | 76 | ||
77 | public ParcelData Copy() | 77 | public ParcelData Copy() |
78 | { | 78 | { |
79 | ParcelData parcelData = new ParcelData(); | 79 | ParcelData parcelData = new ParcelData(); |
80 | 80 | ||
81 | parcelData.AABBMax = this.AABBMax; | 81 | parcelData.AABBMax = this.AABBMax; |
82 | parcelData.AABBMin = this.AABBMin; | 82 | parcelData.AABBMin = this.AABBMin; |
83 | parcelData.area = this.area; | 83 | parcelData.area = this.area; |
84 | parcelData.auctionID = this.auctionID; | 84 | parcelData.auctionID = this.auctionID; |
85 | parcelData.authBuyerID = this.authBuyerID; | 85 | parcelData.authBuyerID = this.authBuyerID; |
86 | parcelData.category = this.category; | 86 | parcelData.category = this.category; |
87 | parcelData.claimDate = this.claimDate; | 87 | parcelData.claimDate = this.claimDate; |
88 | parcelData.claimPrice = this.claimPrice; | 88 | parcelData.claimPrice = this.claimPrice; |
89 | parcelData.globalID = this.globalID; | 89 | parcelData.globalID = this.globalID; |
90 | parcelData.groupID = this.groupID; | 90 | parcelData.groupID = this.groupID; |
91 | parcelData.groupPrims = this.groupPrims; | 91 | parcelData.groupPrims = this.groupPrims; |
92 | parcelData.otherPrims = this.otherPrims; | 92 | parcelData.otherPrims = this.otherPrims; |
93 | parcelData.ownerPrims = this.ownerPrims; | 93 | parcelData.ownerPrims = this.ownerPrims; |
94 | parcelData.selectedPrims = this.selectedPrims; | 94 | parcelData.selectedPrims = this.selectedPrims; |
95 | parcelData.isGroupOwned = this.isGroupOwned; | 95 | parcelData.isGroupOwned = this.isGroupOwned; |
96 | parcelData.localID = this.localID; | 96 | parcelData.localID = this.localID; |
97 | parcelData.landingType = this.landingType; | 97 | parcelData.landingType = this.landingType; |
98 | parcelData.mediaAutoScale = this.mediaAutoScale; | 98 | parcelData.mediaAutoScale = this.mediaAutoScale; |
99 | parcelData.mediaID = this.mediaID; | 99 | parcelData.mediaID = this.mediaID; |
100 | parcelData.mediaURL = this.mediaURL; | 100 | parcelData.mediaURL = this.mediaURL; |
101 | parcelData.musicURL = this.musicURL; | 101 | parcelData.musicURL = this.musicURL; |
102 | parcelData.ownerID = this.ownerID; | 102 | parcelData.ownerID = this.ownerID; |
103 | parcelData.parcelBitmapByteArray = (byte[])this.parcelBitmapByteArray.Clone(); | 103 | parcelData.parcelBitmapByteArray = (byte[])this.parcelBitmapByteArray.Clone(); |
104 | parcelData.parcelDesc = this.parcelDesc; | 104 | parcelData.parcelDesc = this.parcelDesc; |
105 | parcelData.parcelFlags = this.parcelFlags; | 105 | parcelData.parcelFlags = this.parcelFlags; |
106 | parcelData.parcelName = this.parcelName; | 106 | parcelData.parcelName = this.parcelName; |
107 | parcelData.parcelStatus = this.parcelStatus; | 107 | parcelData.parcelStatus = this.parcelStatus; |
108 | parcelData.passHours = this.passHours; | 108 | parcelData.passHours = this.passHours; |
109 | parcelData.passPrice = this.passPrice; | 109 | parcelData.passPrice = this.passPrice; |
110 | parcelData.salePrice = this.salePrice; | 110 | parcelData.salePrice = this.salePrice; |
111 | parcelData.snapshotID = this.snapshotID; | 111 | parcelData.snapshotID = this.snapshotID; |
112 | parcelData.userLocation = this.userLocation; | 112 | parcelData.userLocation = this.userLocation; |
113 | parcelData.userLookAt = this.userLookAt; | 113 | parcelData.userLookAt = this.userLookAt; |
114 | 114 | ||
115 | return parcelData; | 115 | return parcelData; |
116 | 116 | ||
117 | } | 117 | } |
118 | } | 118 | } |
119 | 119 | ||
120 | } | 120 | } |
diff --git a/OpenSim/Framework/General/Types/PrimData.cs b/OpenSim/Framework/General/Types/PrimData.cs index ff81bcd..6b8fa3a 100644 --- a/OpenSim/Framework/General/Types/PrimData.cs +++ b/OpenSim/Framework/General/Types/PrimData.cs | |||
@@ -1,228 +1,228 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using System; | 28 | using System; |
29 | using libsecondlife; | 29 | using libsecondlife; |
30 | 30 | ||
31 | namespace OpenSim.Framework.Types | 31 | namespace OpenSim.Framework.Types |
32 | { | 32 | { |
33 | public class PrimData | 33 | public class PrimData |
34 | { | 34 | { |
35 | private const uint FULL_MASK_PERMISSIONS = 2147483647; | 35 | private const uint FULL_MASK_PERMISSIONS = 2147483647; |
36 | 36 | ||
37 | public LLUUID OwnerID; | 37 | public LLUUID OwnerID; |
38 | public byte PCode; | 38 | public byte PCode; |
39 | public ushort PathBegin; | 39 | public ushort PathBegin; |
40 | public ushort PathEnd; | 40 | public ushort PathEnd; |
41 | public byte PathScaleX; | 41 | public byte PathScaleX; |
42 | public byte PathScaleY; | 42 | public byte PathScaleY; |
43 | public byte PathShearX; | 43 | public byte PathShearX; |
44 | public byte PathShearY; | 44 | public byte PathShearY; |
45 | public sbyte PathSkew; | 45 | public sbyte PathSkew; |
46 | public ushort ProfileBegin; | 46 | public ushort ProfileBegin; |
47 | public ushort ProfileEnd; | 47 | public ushort ProfileEnd; |
48 | public LLVector3 Scale; | 48 | public LLVector3 Scale; |
49 | public byte PathCurve; | 49 | public byte PathCurve; |
50 | public byte ProfileCurve; | 50 | public byte ProfileCurve; |
51 | public uint ParentID = 0; | 51 | public uint ParentID = 0; |
52 | public ushort ProfileHollow; | 52 | public ushort ProfileHollow; |
53 | public sbyte PathRadiusOffset; | 53 | public sbyte PathRadiusOffset; |
54 | public byte PathRevolutions; | 54 | public byte PathRevolutions; |
55 | public sbyte PathTaperX; | 55 | public sbyte PathTaperX; |
56 | public sbyte PathTaperY; | 56 | public sbyte PathTaperY; |
57 | public sbyte PathTwist; | 57 | public sbyte PathTwist; |
58 | public sbyte PathTwistBegin; | 58 | public sbyte PathTwistBegin; |
59 | public byte[] TextureEntry; // a LL textureEntry in byte[] format | 59 | public byte[] TextureEntry; // a LL textureEntry in byte[] format |
60 | 60 | ||
61 | public Int32 CreationDate; | 61 | public Int32 CreationDate; |
62 | public uint OwnerMask = FULL_MASK_PERMISSIONS; | 62 | public uint OwnerMask = FULL_MASK_PERMISSIONS; |
63 | public uint NextOwnerMask = FULL_MASK_PERMISSIONS; | 63 | public uint NextOwnerMask = FULL_MASK_PERMISSIONS; |
64 | public uint GroupMask = FULL_MASK_PERMISSIONS; | 64 | public uint GroupMask = FULL_MASK_PERMISSIONS; |
65 | public uint EveryoneMask = FULL_MASK_PERMISSIONS; | 65 | public uint EveryoneMask = FULL_MASK_PERMISSIONS; |
66 | public uint BaseMask = FULL_MASK_PERMISSIONS; | 66 | public uint BaseMask = FULL_MASK_PERMISSIONS; |
67 | 67 | ||
68 | //following only used during prim storage | 68 | //following only used during prim storage |
69 | public LLVector3 Position; | 69 | public LLVector3 Position; |
70 | public LLQuaternion Rotation = new LLQuaternion(0, 1, 0, 0); | 70 | public LLQuaternion Rotation = new LLQuaternion(0, 1, 0, 0); |
71 | public uint LocalID; | 71 | public uint LocalID; |
72 | public LLUUID FullID; | 72 | public LLUUID FullID; |
73 | 73 | ||
74 | public PrimData() | 74 | public PrimData() |
75 | { | 75 | { |
76 | 76 | ||
77 | } | 77 | } |
78 | 78 | ||
79 | public PrimData(byte[] data) | 79 | public PrimData(byte[] data) |
80 | { | 80 | { |
81 | int i = 0; | 81 | int i = 0; |
82 | 82 | ||
83 | this.OwnerID = new LLUUID(data, i); i += 16; | 83 | this.OwnerID = new LLUUID(data, i); i += 16; |
84 | this.PCode = data[i++]; | 84 | this.PCode = data[i++]; |
85 | this.PathBegin = (ushort)(data[i++] + (data[i++] << 8)); | 85 | this.PathBegin = (ushort)(data[i++] + (data[i++] << 8)); |
86 | this.PathEnd = (ushort)(data[i++] + (data[i++] << 8)); | 86 | this.PathEnd = (ushort)(data[i++] + (data[i++] << 8)); |
87 | this.PathScaleX = data[i++]; | 87 | this.PathScaleX = data[i++]; |
88 | this.PathScaleY = data[i++]; | 88 | this.PathScaleY = data[i++]; |
89 | this.PathShearX = data[i++]; | 89 | this.PathShearX = data[i++]; |
90 | this.PathShearY = data[i++]; | 90 | this.PathShearY = data[i++]; |
91 | this.PathSkew = (sbyte)data[i++]; | 91 | this.PathSkew = (sbyte)data[i++]; |
92 | this.ProfileBegin = (ushort)(data[i++] + (data[i++] << 8)); | 92 | this.ProfileBegin = (ushort)(data[i++] + (data[i++] << 8)); |
93 | this.ProfileEnd = (ushort)(data[i++] + (data[i++] << 8)); | 93 | this.ProfileEnd = (ushort)(data[i++] + (data[i++] << 8)); |
94 | this.Scale = new LLVector3(data, i); i += 12; | 94 | this.Scale = new LLVector3(data, i); i += 12; |
95 | this.PathCurve = data[i++]; | 95 | this.PathCurve = data[i++]; |
96 | this.ProfileCurve = data[i++]; | 96 | this.ProfileCurve = data[i++]; |
97 | this.ParentID = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); | 97 | this.ParentID = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); |
98 | this.ProfileHollow = (ushort)(data[i++] + (data[i++] << 8)); | 98 | this.ProfileHollow = (ushort)(data[i++] + (data[i++] << 8)); |
99 | this.PathRadiusOffset = (sbyte)data[i++]; | 99 | this.PathRadiusOffset = (sbyte)data[i++]; |
100 | this.PathRevolutions = data[i++]; | 100 | this.PathRevolutions = data[i++]; |
101 | this.PathTaperX = (sbyte)data[i++]; | 101 | this.PathTaperX = (sbyte)data[i++]; |
102 | this.PathTaperY = (sbyte)data[i++]; | 102 | this.PathTaperY = (sbyte)data[i++]; |
103 | this.PathTwist = (sbyte)data[i++]; | 103 | this.PathTwist = (sbyte)data[i++]; |
104 | this.PathTwistBegin = (sbyte)data[i++]; | 104 | this.PathTwistBegin = (sbyte)data[i++]; |
105 | ushort length = (ushort)(data[i++] + (data[i++] << 8)); | 105 | ushort length = (ushort)(data[i++] + (data[i++] << 8)); |
106 | this.TextureEntry = new byte[length]; | 106 | this.TextureEntry = new byte[length]; |
107 | Array.Copy(data, i, TextureEntry, 0, length); i += length; | 107 | Array.Copy(data, i, TextureEntry, 0, length); i += length; |
108 | this.CreationDate = (Int32)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); | 108 | this.CreationDate = (Int32)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); |
109 | this.OwnerMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); | 109 | this.OwnerMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); |
110 | this.NextOwnerMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); | 110 | this.NextOwnerMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); |
111 | this.GroupMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); | 111 | this.GroupMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); |
112 | this.EveryoneMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); | 112 | this.EveryoneMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); |
113 | this.BaseMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); | 113 | this.BaseMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); |
114 | this.Position = new LLVector3(data, i); i += 12; | 114 | this.Position = new LLVector3(data, i); i += 12; |
115 | this.Rotation = new LLQuaternion(data, i, true); i += 12; | 115 | this.Rotation = new LLQuaternion(data, i, true); i += 12; |
116 | this.LocalID = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); | 116 | this.LocalID = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); |
117 | this.FullID = new LLUUID(data, i); i += 16; | 117 | this.FullID = new LLUUID(data, i); i += 16; |
118 | 118 | ||
119 | } | 119 | } |
120 | 120 | ||
121 | public byte[] ToBytes() | 121 | public byte[] ToBytes() |
122 | { | 122 | { |
123 | int i = 0; | 123 | int i = 0; |
124 | byte[] bytes = new byte[126 + TextureEntry.Length]; | 124 | byte[] bytes = new byte[126 + TextureEntry.Length]; |
125 | Array.Copy(OwnerID.GetBytes(), 0, bytes, i, 16); i += 16; | 125 | Array.Copy(OwnerID.GetBytes(), 0, bytes, i, 16); i += 16; |
126 | bytes[i++] = this.PCode; | 126 | bytes[i++] = this.PCode; |
127 | bytes[i++] = (byte)(this.PathBegin % 256); | 127 | bytes[i++] = (byte)(this.PathBegin % 256); |
128 | bytes[i++] = (byte)((this.PathBegin >> 8) % 256); | 128 | bytes[i++] = (byte)((this.PathBegin >> 8) % 256); |
129 | bytes[i++] = (byte)(this.PathEnd % 256); | 129 | bytes[i++] = (byte)(this.PathEnd % 256); |
130 | bytes[i++] = (byte)((this.PathEnd >> 8) % 256); | 130 | bytes[i++] = (byte)((this.PathEnd >> 8) % 256); |
131 | bytes[i++] = this.PathScaleX; | 131 | bytes[i++] = this.PathScaleX; |
132 | bytes[i++] = this.PathScaleY; | 132 | bytes[i++] = this.PathScaleY; |
133 | bytes[i++] = this.PathShearX; | 133 | bytes[i++] = this.PathShearX; |
134 | bytes[i++] = this.PathShearY; | 134 | bytes[i++] = this.PathShearY; |
135 | bytes[i++] = (byte)this.PathSkew; | 135 | bytes[i++] = (byte)this.PathSkew; |
136 | bytes[i++] = (byte)(this.ProfileBegin % 256); | 136 | bytes[i++] = (byte)(this.ProfileBegin % 256); |
137 | bytes[i++] = (byte)((this.ProfileBegin >> 8) % 256); | 137 | bytes[i++] = (byte)((this.ProfileBegin >> 8) % 256); |
138 | bytes[i++] = (byte)(this.ProfileEnd % 256); | 138 | bytes[i++] = (byte)(this.ProfileEnd % 256); |
139 | bytes[i++] = (byte)((this.ProfileEnd >> 8) % 256); | 139 | bytes[i++] = (byte)((this.ProfileEnd >> 8) % 256); |
140 | Array.Copy(Scale.GetBytes(), 0, bytes, i, 12); i += 12; | 140 | Array.Copy(Scale.GetBytes(), 0, bytes, i, 12); i += 12; |
141 | bytes[i++] = this.PathCurve; | 141 | bytes[i++] = this.PathCurve; |
142 | bytes[i++] = this.ProfileCurve; | 142 | bytes[i++] = this.ProfileCurve; |
143 | bytes[i++] = (byte)(ParentID % 256); | 143 | bytes[i++] = (byte)(ParentID % 256); |
144 | bytes[i++] = (byte)((ParentID >> 8) % 256); | 144 | bytes[i++] = (byte)((ParentID >> 8) % 256); |
145 | bytes[i++] = (byte)((ParentID >> 16) % 256); | 145 | bytes[i++] = (byte)((ParentID >> 16) % 256); |
146 | bytes[i++] = (byte)((ParentID >> 24) % 256); | 146 | bytes[i++] = (byte)((ParentID >> 24) % 256); |
147 | bytes[i++] = (byte)(this.ProfileHollow % 256); | 147 | bytes[i++] = (byte)(this.ProfileHollow % 256); |
148 | bytes[i++] = (byte)((this.ProfileHollow >> 8) % 256); | 148 | bytes[i++] = (byte)((this.ProfileHollow >> 8) % 256); |
149 | bytes[i++] = ((byte)this.PathRadiusOffset); | 149 | bytes[i++] = ((byte)this.PathRadiusOffset); |
150 | bytes[i++] = this.PathRevolutions; | 150 | bytes[i++] = this.PathRevolutions; |
151 | bytes[i++] = ((byte)this.PathTaperX); | 151 | bytes[i++] = ((byte)this.PathTaperX); |
152 | bytes[i++] = ((byte)this.PathTaperY); | 152 | bytes[i++] = ((byte)this.PathTaperY); |
153 | bytes[i++] = ((byte)this.PathTwist); | 153 | bytes[i++] = ((byte)this.PathTwist); |
154 | bytes[i++] = ((byte)this.PathTwistBegin); | 154 | bytes[i++] = ((byte)this.PathTwistBegin); |
155 | bytes[i++] = (byte)(TextureEntry.Length % 256); | 155 | bytes[i++] = (byte)(TextureEntry.Length % 256); |
156 | bytes[i++] = (byte)((TextureEntry.Length >> 8) % 256); | 156 | bytes[i++] = (byte)((TextureEntry.Length >> 8) % 256); |
157 | Array.Copy(TextureEntry, 0, bytes, i, TextureEntry.Length); i += TextureEntry.Length; | 157 | Array.Copy(TextureEntry, 0, bytes, i, TextureEntry.Length); i += TextureEntry.Length; |
158 | bytes[i++] = (byte)(this.CreationDate % 256); | 158 | bytes[i++] = (byte)(this.CreationDate % 256); |
159 | bytes[i++] = (byte)((this.CreationDate >> 8) % 256); | 159 | bytes[i++] = (byte)((this.CreationDate >> 8) % 256); |
160 | bytes[i++] = (byte)((this.CreationDate >> 16) % 256); | 160 | bytes[i++] = (byte)((this.CreationDate >> 16) % 256); |
161 | bytes[i++] = (byte)((this.CreationDate >> 24) % 256); | 161 | bytes[i++] = (byte)((this.CreationDate >> 24) % 256); |
162 | bytes[i++] = (byte)(this.OwnerMask % 256); | 162 | bytes[i++] = (byte)(this.OwnerMask % 256); |
163 | bytes[i++] = (byte)((this.OwnerMask >> 8) % 256); | 163 | bytes[i++] = (byte)((this.OwnerMask >> 8) % 256); |
164 | bytes[i++] = (byte)((this.OwnerMask >> 16) % 256); | 164 | bytes[i++] = (byte)((this.OwnerMask >> 16) % 256); |
165 | bytes[i++] = (byte)((this.OwnerMask >> 24) % 256); | 165 | bytes[i++] = (byte)((this.OwnerMask >> 24) % 256); |
166 | bytes[i++] = (byte)(this.NextOwnerMask % 256); | 166 | bytes[i++] = (byte)(this.NextOwnerMask % 256); |
167 | bytes[i++] = (byte)((this.NextOwnerMask >> 8) % 256); | 167 | bytes[i++] = (byte)((this.NextOwnerMask >> 8) % 256); |
168 | bytes[i++] = (byte)((this.NextOwnerMask >> 16) % 256); | 168 | bytes[i++] = (byte)((this.NextOwnerMask >> 16) % 256); |
169 | bytes[i++] = (byte)((this.NextOwnerMask >> 24) % 256); | 169 | bytes[i++] = (byte)((this.NextOwnerMask >> 24) % 256); |
170 | bytes[i++] = (byte)(this.GroupMask % 256); | 170 | bytes[i++] = (byte)(this.GroupMask % 256); |
171 | bytes[i++] = (byte)((this.GroupMask >> 8) % 256); | 171 | bytes[i++] = (byte)((this.GroupMask >> 8) % 256); |
172 | bytes[i++] = (byte)((this.GroupMask >> 16) % 256); | 172 | bytes[i++] = (byte)((this.GroupMask >> 16) % 256); |
173 | bytes[i++] = (byte)((this.GroupMask >> 24) % 256); | 173 | bytes[i++] = (byte)((this.GroupMask >> 24) % 256); |
174 | bytes[i++] = (byte)(this.EveryoneMask % 256); | 174 | bytes[i++] = (byte)(this.EveryoneMask % 256); |
175 | bytes[i++] = (byte)((this.EveryoneMask >> 8) % 256); | 175 | bytes[i++] = (byte)((this.EveryoneMask >> 8) % 256); |
176 | bytes[i++] = (byte)((this.EveryoneMask >> 16) % 256); | 176 | bytes[i++] = (byte)((this.EveryoneMask >> 16) % 256); |
177 | bytes[i++] = (byte)((this.EveryoneMask >> 24) % 256); | 177 | bytes[i++] = (byte)((this.EveryoneMask >> 24) % 256); |
178 | bytes[i++] = (byte)(this.BaseMask % 256); | 178 | bytes[i++] = (byte)(this.BaseMask % 256); |
179 | bytes[i++] = (byte)((this.BaseMask >> 8) % 256); | 179 | bytes[i++] = (byte)((this.BaseMask >> 8) % 256); |
180 | bytes[i++] = (byte)((this.BaseMask >> 16) % 256); | 180 | bytes[i++] = (byte)((this.BaseMask >> 16) % 256); |
181 | bytes[i++] = (byte)((this.BaseMask >> 24) % 256); | 181 | bytes[i++] = (byte)((this.BaseMask >> 24) % 256); |
182 | Array.Copy(this.Position.GetBytes(), 0, bytes, i, 12); i += 12; | 182 | Array.Copy(this.Position.GetBytes(), 0, bytes, i, 12); i += 12; |
183 | if (this.Rotation == new LLQuaternion(0, 0, 0, 0)) | 183 | if (this.Rotation == new LLQuaternion(0, 0, 0, 0)) |
184 | { | 184 | { |
185 | this.Rotation = new LLQuaternion(0, 1, 0, 0); | 185 | this.Rotation = new LLQuaternion(0, 1, 0, 0); |
186 | } | 186 | } |
187 | Array.Copy(this.Rotation.GetBytes(), 0, bytes, i, 12); i += 12; | 187 | Array.Copy(this.Rotation.GetBytes(), 0, bytes, i, 12); i += 12; |
188 | bytes[i++] = (byte)(this.LocalID % 256); | 188 | bytes[i++] = (byte)(this.LocalID % 256); |
189 | bytes[i++] = (byte)((this.LocalID >> 8) % 256); | 189 | bytes[i++] = (byte)((this.LocalID >> 8) % 256); |
190 | bytes[i++] = (byte)((this.LocalID >> 16) % 256); | 190 | bytes[i++] = (byte)((this.LocalID >> 16) % 256); |
191 | bytes[i++] = (byte)((this.LocalID >> 24) % 256); | 191 | bytes[i++] = (byte)((this.LocalID >> 24) % 256); |
192 | Array.Copy(FullID.GetBytes(), 0, bytes, i, 16); i += 16; | 192 | Array.Copy(FullID.GetBytes(), 0, bytes, i, 16); i += 16; |
193 | 193 | ||
194 | return bytes; | 194 | return bytes; |
195 | } | 195 | } |
196 | 196 | ||
197 | public static PrimData DefaultCube() | 197 | public static PrimData DefaultCube() |
198 | { | 198 | { |
199 | PrimData primData = new PrimData(); | 199 | PrimData primData = new PrimData(); |
200 | primData.CreationDate = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; | 200 | primData.CreationDate = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; |
201 | primData.FullID = LLUUID.Random(); | 201 | primData.FullID = LLUUID.Random(); |
202 | primData.Scale = new LLVector3(0.5f, 0.5f, 0.5f); | 202 | primData.Scale = new LLVector3(0.5f, 0.5f, 0.5f); |
203 | primData.Rotation = new LLQuaternion(0, 0, 0, 1); | 203 | primData.Rotation = new LLQuaternion(0, 0, 0, 1); |
204 | primData.PCode = 9; | 204 | primData.PCode = 9; |
205 | primData.ParentID = 0; | 205 | primData.ParentID = 0; |
206 | primData.PathBegin = 0; | 206 | primData.PathBegin = 0; |
207 | primData.PathEnd = 0; | 207 | primData.PathEnd = 0; |
208 | primData.PathScaleX = 0; | 208 | primData.PathScaleX = 0; |
209 | primData.PathScaleY = 0; | 209 | primData.PathScaleY = 0; |
210 | primData.PathShearX = 0; | 210 | primData.PathShearX = 0; |
211 | primData.PathShearY = 0; | 211 | primData.PathShearY = 0; |
212 | primData.PathSkew = 0; | 212 | primData.PathSkew = 0; |
213 | primData.ProfileBegin = 0; | 213 | primData.ProfileBegin = 0; |
214 | primData.ProfileEnd = 0; | 214 | primData.ProfileEnd = 0; |
215 | primData.PathCurve = 16; | 215 | primData.PathCurve = 16; |
216 | primData.ProfileCurve = 1; | 216 | primData.ProfileCurve = 1; |
217 | primData.ProfileHollow = 0; | 217 | primData.ProfileHollow = 0; |
218 | primData.PathRadiusOffset = 0; | 218 | primData.PathRadiusOffset = 0; |
219 | primData.PathRevolutions = 0; | 219 | primData.PathRevolutions = 0; |
220 | primData.PathTaperX = 0; | 220 | primData.PathTaperX = 0; |
221 | primData.PathTaperY = 0; | 221 | primData.PathTaperY = 0; |
222 | primData.PathTwist = 0; | 222 | primData.PathTwist = 0; |
223 | primData.PathTwistBegin = 0; | 223 | primData.PathTwistBegin = 0; |
224 | 224 | ||
225 | return primData; | 225 | return primData; |
226 | } | 226 | } |
227 | } | 227 | } |
228 | } | 228 | } |
diff --git a/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs b/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs index a085a44..e058c07 100644 --- a/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs +++ b/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs | |||
@@ -1,109 +1,109 @@ | |||
1 | using libsecondlife; | 1 | using libsecondlife; |
2 | using libsecondlife.Packets; | 2 | using libsecondlife.Packets; |
3 | 3 | ||
4 | namespace OpenSim.Framework.Types | 4 | namespace OpenSim.Framework.Types |
5 | { | 5 | { |
6 | public enum ShapeType | 6 | public enum ShapeType |
7 | { | 7 | { |
8 | Box, | 8 | Box, |
9 | Sphere, | 9 | Sphere, |
10 | Ring, | 10 | Ring, |
11 | Tube, | 11 | Tube, |
12 | Torus, | 12 | Torus, |
13 | Prism, | 13 | Prism, |
14 | Scuplted, | 14 | Scuplted, |
15 | Cylinder, | 15 | Cylinder, |
16 | Foliage, | 16 | Foliage, |
17 | Unknown | 17 | Unknown |
18 | } | 18 | } |
19 | 19 | ||
20 | public class PrimitiveBaseShape | 20 | public class PrimitiveBaseShape |
21 | { | 21 | { |
22 | private ShapeType type = ShapeType.Unknown; | 22 | private ShapeType type = ShapeType.Unknown; |
23 | 23 | ||
24 | public byte PCode; | 24 | public byte PCode; |
25 | public ushort PathBegin; | 25 | public ushort PathBegin; |
26 | public ushort PathEnd; | 26 | public ushort PathEnd; |
27 | public byte PathScaleX; | 27 | public byte PathScaleX; |
28 | public byte PathScaleY; | 28 | public byte PathScaleY; |
29 | public byte PathShearX; | 29 | public byte PathShearX; |
30 | public byte PathShearY; | 30 | public byte PathShearY; |
31 | public sbyte PathSkew; | 31 | public sbyte PathSkew; |
32 | public ushort ProfileBegin; | 32 | public ushort ProfileBegin; |
33 | public ushort ProfileEnd; | 33 | public ushort ProfileEnd; |
34 | public LLVector3 Scale; | 34 | public LLVector3 Scale; |
35 | public byte PathCurve; | 35 | public byte PathCurve; |
36 | public byte ProfileCurve; | 36 | public byte ProfileCurve; |
37 | public ushort ProfileHollow; | 37 | public ushort ProfileHollow; |
38 | public sbyte PathRadiusOffset; | 38 | public sbyte PathRadiusOffset; |
39 | public byte PathRevolutions; | 39 | public byte PathRevolutions; |
40 | public sbyte PathTaperX; | 40 | public sbyte PathTaperX; |
41 | public sbyte PathTaperY; | 41 | public sbyte PathTaperY; |
42 | public sbyte PathTwist; | 42 | public sbyte PathTwist; |
43 | public sbyte PathTwistBegin; | 43 | public sbyte PathTwistBegin; |
44 | public byte[] TextureEntry; // a LL textureEntry in byte[] format | 44 | public byte[] TextureEntry; // a LL textureEntry in byte[] format |
45 | 45 | ||
46 | public ShapeType PrimType | 46 | public ShapeType PrimType |
47 | { | 47 | { |
48 | get | 48 | get |
49 | { | 49 | { |
50 | return this.type; | 50 | return this.type; |
51 | } | 51 | } |
52 | } | 52 | } |
53 | 53 | ||
54 | public LLVector3 PrimScale | 54 | public LLVector3 PrimScale |
55 | { | 55 | { |
56 | get | 56 | get |
57 | { | 57 | { |
58 | return this.Scale; | 58 | return this.Scale; |
59 | } | 59 | } |
60 | } | 60 | } |
61 | 61 | ||
62 | public PrimitiveBaseShape() | 62 | public PrimitiveBaseShape() |
63 | { | 63 | { |
64 | 64 | ||
65 | } | 65 | } |
66 | 66 | ||
67 | //void returns need to change of course | 67 | //void returns need to change of course |
68 | public void GetMesh() | 68 | public void GetMesh() |
69 | { | 69 | { |
70 | 70 | ||
71 | } | 71 | } |
72 | 72 | ||
73 | public PrimitiveBaseShape Copy() | 73 | public PrimitiveBaseShape Copy() |
74 | { | 74 | { |
75 | return (PrimitiveBaseShape) this.MemberwiseClone(); | 75 | return (PrimitiveBaseShape) this.MemberwiseClone(); |
76 | } | 76 | } |
77 | 77 | ||
78 | public static PrimitiveBaseShape DefaultBox() | 78 | public static PrimitiveBaseShape DefaultBox() |
79 | { | 79 | { |
80 | PrimitiveBaseShape primShape = new PrimitiveBaseShape(); | 80 | PrimitiveBaseShape primShape = new PrimitiveBaseShape(); |
81 | 81 | ||
82 | primShape.type = ShapeType.Box; | 82 | primShape.type = ShapeType.Box; |
83 | primShape.Scale = new LLVector3(0.5f, 0.5f, 0.5f); | 83 | primShape.Scale = new LLVector3(0.5f, 0.5f, 0.5f); |
84 | primShape.PCode = 9; | 84 | primShape.PCode = 9; |
85 | primShape.PathBegin = 0; | 85 | primShape.PathBegin = 0; |
86 | primShape.PathEnd = 0; | 86 | primShape.PathEnd = 0; |
87 | primShape.PathScaleX = 0; | 87 | primShape.PathScaleX = 0; |
88 | primShape.PathScaleY = 0; | 88 | primShape.PathScaleY = 0; |
89 | primShape.PathShearX = 0; | 89 | primShape.PathShearX = 0; |
90 | primShape.PathShearY = 0; | 90 | primShape.PathShearY = 0; |
91 | primShape.PathSkew = 0; | 91 | primShape.PathSkew = 0; |
92 | primShape.ProfileBegin = 0; | 92 | primShape.ProfileBegin = 0; |
93 | primShape.ProfileEnd = 0; | 93 | primShape.ProfileEnd = 0; |
94 | primShape.PathCurve = 16; | 94 | primShape.PathCurve = 16; |
95 | primShape.ProfileCurve = 1; | 95 | primShape.ProfileCurve = 1; |
96 | primShape.ProfileHollow = 0; | 96 | primShape.ProfileHollow = 0; |
97 | primShape.PathRadiusOffset = 0; | 97 | primShape.PathRadiusOffset = 0; |
98 | primShape.PathRevolutions = 0; | 98 | primShape.PathRevolutions = 0; |
99 | primShape.PathTaperX = 0; | 99 | primShape.PathTaperX = 0; |
100 | primShape.PathTaperY = 0; | 100 | primShape.PathTaperY = 0; |
101 | primShape.PathTwist = 0; | 101 | primShape.PathTwist = 0; |
102 | primShape.PathTwistBegin = 0; | 102 | primShape.PathTwistBegin = 0; |
103 | LLObject.TextureEntry ntex = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-9999-000000000005")); | 103 | LLObject.TextureEntry ntex = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-9999-000000000005")); |
104 | primShape.TextureEntry = ntex.ToBytes(); | 104 | primShape.TextureEntry = ntex.ToBytes(); |
105 | 105 | ||
106 | return primShape; | 106 | return primShape; |
107 | } | 107 | } |
108 | } | 108 | } |
109 | } | 109 | } |
diff --git a/OpenSim/Framework/General/Types/RegionHandle.cs b/OpenSim/Framework/General/Types/RegionHandle.cs index 4a055ad..d90acc6 100644 --- a/OpenSim/Framework/General/Types/RegionHandle.cs +++ b/OpenSim/Framework/General/Types/RegionHandle.cs | |||
@@ -1,121 +1,121 @@ | |||
1 | using System; | 1 | using System; |
2 | using System.Net; | 2 | using System.Net; |
3 | 3 | ||
4 | namespace OpenSim.Framework.Types | 4 | namespace OpenSim.Framework.Types |
5 | { | 5 | { |
6 | /// <summary> | 6 | /// <summary> |
7 | /// A class for manipulating RegionHandle coordinates | 7 | /// A class for manipulating RegionHandle coordinates |
8 | /// </summary> | 8 | /// </summary> |
9 | class RegionHandle | 9 | class RegionHandle |
10 | { | 10 | { |
11 | private UInt64 handle; | 11 | private UInt64 handle; |
12 | 12 | ||
13 | /// <summary> | 13 | /// <summary> |
14 | /// Initialises a new grid-aware RegionHandle | 14 | /// Initialises a new grid-aware RegionHandle |
15 | /// </summary> | 15 | /// </summary> |
16 | /// <param name="ip">IP Address of the Grid Server for this region</param> | 16 | /// <param name="ip">IP Address of the Grid Server for this region</param> |
17 | /// <param name="x">Grid X Coordinate</param> | 17 | /// <param name="x">Grid X Coordinate</param> |
18 | /// <param name="y">Grid Y Coordinate</param> | 18 | /// <param name="y">Grid Y Coordinate</param> |
19 | public RegionHandle(string ip, short x, short y) | 19 | public RegionHandle(string ip, short x, short y) |
20 | { | 20 | { |
21 | IPAddress addr = IPAddress.Parse(ip); | 21 | IPAddress addr = IPAddress.Parse(ip); |
22 | 22 | ||
23 | if (addr.AddressFamily != System.Net.Sockets.AddressFamily.InterNetwork) | 23 | if (addr.AddressFamily != System.Net.Sockets.AddressFamily.InterNetwork) |
24 | throw new Exception("Bad RegionHandle Parameter - must be an IPv4 address"); | 24 | throw new Exception("Bad RegionHandle Parameter - must be an IPv4 address"); |
25 | 25 | ||
26 | uint baseHandle = BitConverter.ToUInt32(addr.GetAddressBytes(), 0); | 26 | uint baseHandle = BitConverter.ToUInt32(addr.GetAddressBytes(), 0); |
27 | 27 | ||
28 | // Split the IP address in half | 28 | // Split the IP address in half |
29 | short a = (short)((baseHandle << 16) & 0xFFFF); | 29 | short a = (short)((baseHandle << 16) & 0xFFFF); |
30 | short b = (short)((baseHandle << 0) & 0xFFFF); | 30 | short b = (short)((baseHandle << 0) & 0xFFFF); |
31 | 31 | ||
32 | // Raise the bounds a little | 32 | // Raise the bounds a little |
33 | uint nx = (uint)x; | 33 | uint nx = (uint)x; |
34 | uint ny = (uint)y; | 34 | uint ny = (uint)y; |
35 | 35 | ||
36 | // Multiply grid coords to get region coords | 36 | // Multiply grid coords to get region coords |
37 | nx *= 256; | 37 | nx *= 256; |
38 | ny *= 256; | 38 | ny *= 256; |
39 | 39 | ||
40 | // Stuff the IP address in too | 40 | // Stuff the IP address in too |
41 | nx = (uint)a << 16; | 41 | nx = (uint)a << 16; |
42 | ny = (uint)b << 16; | 42 | ny = (uint)b << 16; |
43 | 43 | ||
44 | handle = ((UInt64)nx << 32) | (uint)ny; | 44 | handle = ((UInt64)nx << 32) | (uint)ny; |
45 | } | 45 | } |
46 | 46 | ||
47 | /// <summary> | 47 | /// <summary> |
48 | /// Initialises a new RegionHandle that is not inter-grid aware | 48 | /// Initialises a new RegionHandle that is not inter-grid aware |
49 | /// </summary> | 49 | /// </summary> |
50 | /// <param name="x">Grid X Coordinate</param> | 50 | /// <param name="x">Grid X Coordinate</param> |
51 | /// <param name="y">Grid Y Coordinate</param> | 51 | /// <param name="y">Grid Y Coordinate</param> |
52 | public RegionHandle(uint x, uint y) | 52 | public RegionHandle(uint x, uint y) |
53 | { | 53 | { |
54 | handle = ((x * 256) << 32) | (y * 256); | 54 | handle = ((x * 256) << 32) | (y * 256); |
55 | } | 55 | } |
56 | 56 | ||
57 | /// <summary> | 57 | /// <summary> |
58 | /// Initialises a new RegionHandle from an existing value | 58 | /// Initialises a new RegionHandle from an existing value |
59 | /// </summary> | 59 | /// </summary> |
60 | /// <param name="Region">A U64 RegionHandle</param> | 60 | /// <param name="Region">A U64 RegionHandle</param> |
61 | public RegionHandle(UInt64 Region) | 61 | public RegionHandle(UInt64 Region) |
62 | { | 62 | { |
63 | handle = Region; | 63 | handle = Region; |
64 | } | 64 | } |
65 | 65 | ||
66 | /// <summary> | 66 | /// <summary> |
67 | /// Returns the Grid Masked RegionHandle - For use in Teleport packets and other packets where sending the grid IP address may be handy. | 67 | /// Returns the Grid Masked RegionHandle - For use in Teleport packets and other packets where sending the grid IP address may be handy. |
68 | /// </summary> | 68 | /// </summary> |
69 | /// <remarks>Do not use for SimulatorEnable packets. The client will choke.</remarks> | 69 | /// <remarks>Do not use for SimulatorEnable packets. The client will choke.</remarks> |
70 | /// <returns>Region Handle including IP Address encoding</returns> | 70 | /// <returns>Region Handle including IP Address encoding</returns> |
71 | public UInt64 getTeleportHandle() | 71 | public UInt64 getTeleportHandle() |
72 | { | 72 | { |
73 | return handle; | 73 | return handle; |
74 | } | 74 | } |
75 | 75 | ||
76 | /// <summary> | 76 | /// <summary> |
77 | /// Returns a RegionHandle which may be used for SimulatorEnable packets. Removes the IP address encoding and returns the lower bounds. | 77 | /// Returns a RegionHandle which may be used for SimulatorEnable packets. Removes the IP address encoding and returns the lower bounds. |
78 | /// </summary> | 78 | /// </summary> |
79 | /// <returns>A U64 RegionHandle for use in SimulatorEnable packets.</returns> | 79 | /// <returns>A U64 RegionHandle for use in SimulatorEnable packets.</returns> |
80 | public UInt64 getNeighbourHandle() | 80 | public UInt64 getNeighbourHandle() |
81 | { | 81 | { |
82 | UInt64 mask = 0x0000FFFF0000FFFF; | 82 | UInt64 mask = 0x0000FFFF0000FFFF; |
83 | 83 | ||
84 | return handle | mask; | 84 | return handle | mask; |
85 | } | 85 | } |
86 | 86 | ||
87 | /// <summary> | 87 | /// <summary> |
88 | /// Returns the IP Address of the GridServer from a Grid-Encoded RegionHandle | 88 | /// Returns the IP Address of the GridServer from a Grid-Encoded RegionHandle |
89 | /// </summary> | 89 | /// </summary> |
90 | /// <returns>Grid Server IP Address</returns> | 90 | /// <returns>Grid Server IP Address</returns> |
91 | public IPAddress getGridIP() | 91 | public IPAddress getGridIP() |
92 | { | 92 | { |
93 | uint a = (uint)((handle >> 16) & 0xFFFF); | 93 | uint a = (uint)((handle >> 16) & 0xFFFF); |
94 | uint b = (uint)((handle >> 48) & 0xFFFF); | 94 | uint b = (uint)((handle >> 48) & 0xFFFF); |
95 | 95 | ||
96 | return new IPAddress((long)(a << 16) | (long)b); | 96 | return new IPAddress((long)(a << 16) | (long)b); |
97 | } | 97 | } |
98 | 98 | ||
99 | /// <summary> | 99 | /// <summary> |
100 | /// Returns the X Coordinate from a Grid-Encoded RegionHandle | 100 | /// Returns the X Coordinate from a Grid-Encoded RegionHandle |
101 | /// </summary> | 101 | /// </summary> |
102 | /// <returns>X Coordinate</returns> | 102 | /// <returns>X Coordinate</returns> |
103 | public uint getGridX() | 103 | public uint getGridX() |
104 | { | 104 | { |
105 | uint x = (uint)((handle >> 32) & 0xFFFF); | 105 | uint x = (uint)((handle >> 32) & 0xFFFF); |
106 | 106 | ||
107 | return x; | 107 | return x; |
108 | } | 108 | } |
109 | 109 | ||
110 | /// <summary> | 110 | /// <summary> |
111 | /// Returns the Y Coordinate from a Grid-Encoded RegionHandle | 111 | /// Returns the Y Coordinate from a Grid-Encoded RegionHandle |
112 | /// </summary> | 112 | /// </summary> |
113 | /// <returns>Y Coordinate</returns> | 113 | /// <returns>Y Coordinate</returns> |
114 | public uint getGridY() | 114 | public uint getGridY() |
115 | { | 115 | { |
116 | uint y = (uint)((handle >> 0) & 0xFFFF); | 116 | uint y = (uint)((handle >> 0) & 0xFFFF); |
117 | 117 | ||
118 | return y; | 118 | return y; |
119 | } | 119 | } |
120 | } | 120 | } |
121 | } | 121 | } |
diff --git a/OpenSim/Framework/General/Types/RegionInfo.cs b/OpenSim/Framework/General/Types/RegionInfo.cs index cfc0925..a216b52 100644 --- a/OpenSim/Framework/General/Types/RegionInfo.cs +++ b/OpenSim/Framework/General/Types/RegionInfo.cs | |||
@@ -1,342 +1,342 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using System; | 28 | using System; |
29 | using System.Globalization; | 29 | using System.Globalization; |
30 | using System.Net; | 30 | using System.Net; |
31 | using System.Net.Sockets; | 31 | using System.Net.Sockets; |
32 | using libsecondlife; | 32 | using libsecondlife; |
33 | using OpenSim.Framework.Console; | 33 | using OpenSim.Framework.Console; |
34 | using OpenSim.Framework.Interfaces; | 34 | using OpenSim.Framework.Interfaces; |
35 | using OpenSim.Framework.Utilities; | 35 | using OpenSim.Framework.Utilities; |
36 | 36 | ||
37 | namespace OpenSim.Framework.Types | 37 | namespace OpenSim.Framework.Types |
38 | { | 38 | { |
39 | public class RegionInfo | 39 | public class RegionInfo |
40 | { | 40 | { |
41 | public LLUUID SimUUID = new LLUUID(); | 41 | public LLUUID SimUUID = new LLUUID(); |
42 | public string RegionName = ""; | 42 | public string RegionName = ""; |
43 | 43 | ||
44 | private IPEndPoint m_internalEndPoint; | 44 | private IPEndPoint m_internalEndPoint; |
45 | public IPEndPoint InternalEndPoint | 45 | public IPEndPoint InternalEndPoint |
46 | { | 46 | { |
47 | get | 47 | get |
48 | { | 48 | { |
49 | return m_internalEndPoint; | 49 | return m_internalEndPoint; |
50 | } | 50 | } |
51 | } | 51 | } |
52 | 52 | ||
53 | public IPEndPoint ExternalEndPoint | 53 | public IPEndPoint ExternalEndPoint |
54 | { | 54 | { |
55 | get | 55 | get |
56 | { | 56 | { |
57 | // Old one defaults to IPv6 | 57 | // Old one defaults to IPv6 |
58 | //return new IPEndPoint( Dns.GetHostAddresses( m_externalHostName )[0], m_internalEndPoint.Port ); | 58 | //return new IPEndPoint( Dns.GetHostAddresses( m_externalHostName )[0], m_internalEndPoint.Port ); |
59 | 59 | ||
60 | // New method favors IPv4 | 60 | // New method favors IPv4 |
61 | IPAddress ia = null; | 61 | IPAddress ia = null; |
62 | foreach (IPAddress Adr in Dns.GetHostAddresses(m_externalHostName)) | 62 | foreach (IPAddress Adr in Dns.GetHostAddresses(m_externalHostName)) |
63 | { | 63 | { |
64 | if (ia == null) | 64 | if (ia == null) |
65 | ia = Adr; | 65 | ia = Adr; |
66 | 66 | ||
67 | if (Adr.AddressFamily == AddressFamily.InterNetwork) | 67 | if (Adr.AddressFamily == AddressFamily.InterNetwork) |
68 | { | 68 | { |
69 | ia = Adr; | 69 | ia = Adr; |
70 | break; | 70 | break; |
71 | } | 71 | } |
72 | 72 | ||
73 | } | 73 | } |
74 | 74 | ||
75 | return new IPEndPoint(ia, m_internalEndPoint.Port); | 75 | return new IPEndPoint(ia, m_internalEndPoint.Port); |
76 | } | 76 | } |
77 | } | 77 | } |
78 | 78 | ||
79 | private string m_externalHostName; | 79 | private string m_externalHostName; |
80 | public string ExternalHostName | 80 | public string ExternalHostName |
81 | { | 81 | { |
82 | get | 82 | get |
83 | { | 83 | { |
84 | return m_externalHostName; | 84 | return m_externalHostName; |
85 | } | 85 | } |
86 | } | 86 | } |
87 | 87 | ||
88 | private uint? m_regionLocX; | 88 | private uint? m_regionLocX; |
89 | public uint RegionLocX | 89 | public uint RegionLocX |
90 | { | 90 | { |
91 | get | 91 | get |
92 | { | 92 | { |
93 | return m_regionLocX.Value; | 93 | return m_regionLocX.Value; |
94 | } | 94 | } |
95 | } | 95 | } |
96 | 96 | ||
97 | private uint? m_regionLocY; | 97 | private uint? m_regionLocY; |
98 | public uint RegionLocY | 98 | public uint RegionLocY |
99 | { | 99 | { |
100 | get | 100 | get |
101 | { | 101 | { |
102 | return m_regionLocY.Value; | 102 | return m_regionLocY.Value; |
103 | } | 103 | } |
104 | } | 104 | } |
105 | 105 | ||
106 | private ulong? m_regionHandle; | 106 | private ulong? m_regionHandle; |
107 | public ulong RegionHandle | 107 | public ulong RegionHandle |
108 | { | 108 | { |
109 | get | 109 | get |
110 | { | 110 | { |
111 | if (!m_regionHandle.HasValue) | 111 | if (!m_regionHandle.HasValue) |
112 | { | 112 | { |
113 | m_regionHandle = Util.UIntsToLong((RegionLocX * 256), (RegionLocY * 256)); | 113 | m_regionHandle = Util.UIntsToLong((RegionLocX * 256), (RegionLocY * 256)); |
114 | } | 114 | } |
115 | 115 | ||
116 | return m_regionHandle.Value; | 116 | return m_regionHandle.Value; |
117 | } | 117 | } |
118 | } | 118 | } |
119 | 119 | ||
120 | // Only used for remote regions , ie ones not in the current instance | 120 | // Only used for remote regions , ie ones not in the current instance |
121 | private uint m_remotingPort; | 121 | private uint m_remotingPort; |
122 | public uint RemotingPort | 122 | public uint RemotingPort |
123 | { | 123 | { |
124 | get | 124 | get |
125 | { | 125 | { |
126 | return m_remotingPort; | 126 | return m_remotingPort; |
127 | } | 127 | } |
128 | set | 128 | set |
129 | { | 129 | { |
130 | m_remotingPort = value; | 130 | m_remotingPort = value; |
131 | } | 131 | } |
132 | } | 132 | } |
133 | public string RemotingAddress; | 133 | public string RemotingAddress; |
134 | 134 | ||
135 | public string DataStore = ""; | 135 | public string DataStore = ""; |
136 | public bool isSandbox = false; | 136 | public bool isSandbox = false; |
137 | 137 | ||
138 | public LLUUID MasterAvatarAssignedUUID = new LLUUID(); | 138 | public LLUUID MasterAvatarAssignedUUID = new LLUUID(); |
139 | public string MasterAvatarFirstName = ""; | 139 | public string MasterAvatarFirstName = ""; |
140 | public string MasterAvatarLastName = ""; | 140 | public string MasterAvatarLastName = ""; |
141 | public string MasterAvatarSandboxPassword = ""; | 141 | public string MasterAvatarSandboxPassword = ""; |
142 | 142 | ||
143 | public EstateSettings estateSettings; | 143 | public EstateSettings estateSettings; |
144 | 144 | ||
145 | public RegionInfo() | 145 | public RegionInfo() |
146 | { | 146 | { |
147 | estateSettings = new EstateSettings(); | 147 | estateSettings = new EstateSettings(); |
148 | } | 148 | } |
149 | 149 | ||
150 | public RegionInfo(uint regionLocX, uint regionLocY, IPEndPoint internalEndPoint, string externalUri) | 150 | public RegionInfo(uint regionLocX, uint regionLocY, IPEndPoint internalEndPoint, string externalUri) |
151 | : this() | 151 | : this() |
152 | { | 152 | { |
153 | m_regionLocX = regionLocX; | 153 | m_regionLocX = regionLocX; |
154 | m_regionLocY = regionLocY; | 154 | m_regionLocY = regionLocY; |
155 | 155 | ||
156 | m_internalEndPoint = internalEndPoint; | 156 | m_internalEndPoint = internalEndPoint; |
157 | m_externalHostName = externalUri; | 157 | m_externalHostName = externalUri; |
158 | } | 158 | } |
159 | 159 | ||
160 | public void InitConfig(bool sandboxMode, IGenericConfig configData) | 160 | public void InitConfig(bool sandboxMode, IGenericConfig configData) |
161 | { | 161 | { |
162 | this.isSandbox = sandboxMode; | 162 | this.isSandbox = sandboxMode; |
163 | try | 163 | try |
164 | { | 164 | { |
165 | string attri = ""; | 165 | string attri = ""; |
166 | 166 | ||
167 | // Sim UUID | 167 | // Sim UUID |
168 | string simId = configData.GetAttribute("SimUUID"); | 168 | string simId = configData.GetAttribute("SimUUID"); |
169 | if (String.IsNullOrEmpty( simId )) | 169 | if (String.IsNullOrEmpty( simId )) |
170 | { | 170 | { |
171 | this.SimUUID = LLUUID.Random(); | 171 | this.SimUUID = LLUUID.Random(); |
172 | } | 172 | } |
173 | else | 173 | else |
174 | { | 174 | { |
175 | this.SimUUID = new LLUUID(simId); | 175 | this.SimUUID = new LLUUID(simId); |
176 | } | 176 | } |
177 | configData.SetAttribute("SimUUID", this.SimUUID.ToString()); | 177 | configData.SetAttribute("SimUUID", this.SimUUID.ToString()); |
178 | 178 | ||
179 | this.RegionName = GetString(configData, "SimName", "OpenSim test", "Region Name"); | 179 | this.RegionName = GetString(configData, "SimName", "OpenSim test", "Region Name"); |
180 | 180 | ||
181 | //m_regionLocX = (uint) GetInt(configData, "SimLocationX", 1000, "Grid Location X"); | 181 | //m_regionLocX = (uint) GetInt(configData, "SimLocationX", 1000, "Grid Location X"); |
182 | 182 | ||
183 | attri = ""; | 183 | attri = ""; |
184 | attri = configData.GetAttribute("SimLocationX"); | 184 | attri = configData.GetAttribute("SimLocationX"); |
185 | if (attri == "") | 185 | if (attri == "") |
186 | { | 186 | { |
187 | string location = MainLog.Instance.CmdPrompt("Grid Location X", "1000"); | 187 | string location = MainLog.Instance.CmdPrompt("Grid Location X", "1000"); |
188 | configData.SetAttribute("SimLocationX", location); | 188 | configData.SetAttribute("SimLocationX", location); |
189 | m_regionLocX = (uint)Convert.ToUInt32(location); | 189 | m_regionLocX = (uint)Convert.ToUInt32(location); |
190 | } | 190 | } |
191 | else | 191 | else |
192 | { | 192 | { |
193 | m_regionLocX = (uint)Convert.ToUInt32(attri); | 193 | m_regionLocX = (uint)Convert.ToUInt32(attri); |
194 | } | 194 | } |
195 | // Sim/Grid location Y | 195 | // Sim/Grid location Y |
196 | attri = ""; | 196 | attri = ""; |
197 | attri = configData.GetAttribute("SimLocationY"); | 197 | attri = configData.GetAttribute("SimLocationY"); |
198 | if (attri == "") | 198 | if (attri == "") |
199 | { | 199 | { |
200 | string location = MainLog.Instance.CmdPrompt("Grid Location Y", "1000"); | 200 | string location = MainLog.Instance.CmdPrompt("Grid Location Y", "1000"); |
201 | configData.SetAttribute("SimLocationY", location); | 201 | configData.SetAttribute("SimLocationY", location); |
202 | m_regionLocY = (uint)Convert.ToUInt32(location); | 202 | m_regionLocY = (uint)Convert.ToUInt32(location); |
203 | } | 203 | } |
204 | else | 204 | else |
205 | { | 205 | { |
206 | m_regionLocY = (uint)Convert.ToUInt32(attri); | 206 | m_regionLocY = (uint)Convert.ToUInt32(attri); |
207 | } | 207 | } |
208 | 208 | ||
209 | m_regionHandle = null; | 209 | m_regionHandle = null; |
210 | 210 | ||
211 | this.DataStore = GetString(configData, "Datastore", "localworld.yap", "Filename for local storage"); | 211 | this.DataStore = GetString(configData, "Datastore", "localworld.yap", "Filename for local storage"); |
212 | 212 | ||
213 | IPAddress internalAddress = GetIPAddress(configData, "InternalIPAddress", "0.0.0.0", "Internal IP Address for UDP client connections"); | 213 | IPAddress internalAddress = GetIPAddress(configData, "InternalIPAddress", "0.0.0.0", "Internal IP Address for UDP client connections"); |
214 | int internalPort = GetIPPort(configData, "InternalIPPort", "9000", "Internal IP Port for UDP client connections"); | 214 | int internalPort = GetIPPort(configData, "InternalIPPort", "9000", "Internal IP Port for UDP client connections"); |
215 | m_internalEndPoint = new IPEndPoint(internalAddress, internalPort); | 215 | m_internalEndPoint = new IPEndPoint(internalAddress, internalPort); |
216 | 216 | ||
217 | m_externalHostName = GetString(configData, "ExternalHostName", "127.0.0.1", "External Host Name"); | 217 | m_externalHostName = GetString(configData, "ExternalHostName", "127.0.0.1", "External Host Name"); |
218 | 218 | ||
219 | estateSettings.terrainFile = | 219 | estateSettings.terrainFile = |
220 | GetString(configData, "TerrainFile", "default.r32", "GENERAL SETTING: Default Terrain File"); | 220 | GetString(configData, "TerrainFile", "default.r32", "GENERAL SETTING: Default Terrain File"); |
221 | 221 | ||
222 | attri = ""; | 222 | attri = ""; |
223 | attri = configData.GetAttribute("TerrainMultiplier"); | 223 | attri = configData.GetAttribute("TerrainMultiplier"); |
224 | if (attri == "") | 224 | if (attri == "") |
225 | { | 225 | { |
226 | string re = MainLog.Instance.CmdPrompt("GENERAL SETTING: Terrain Height Multiplier", "60.0"); | 226 | string re = MainLog.Instance.CmdPrompt("GENERAL SETTING: Terrain Height Multiplier", "60.0"); |
227 | this.estateSettings.terrainMultiplier = Convert.ToDouble(re, CultureInfo.InvariantCulture); | 227 | this.estateSettings.terrainMultiplier = Convert.ToDouble(re, CultureInfo.InvariantCulture); |
228 | configData.SetAttribute("TerrainMultiplier", this.estateSettings.terrainMultiplier.ToString()); | 228 | configData.SetAttribute("TerrainMultiplier", this.estateSettings.terrainMultiplier.ToString()); |
229 | } | 229 | } |
230 | else | 230 | else |
231 | { | 231 | { |
232 | this.estateSettings.terrainMultiplier = Convert.ToDouble(attri); | 232 | this.estateSettings.terrainMultiplier = Convert.ToDouble(attri); |
233 | } | 233 | } |
234 | 234 | ||
235 | attri = ""; | 235 | attri = ""; |
236 | attri = configData.GetAttribute("MasterAvatarFirstName"); | 236 | attri = configData.GetAttribute("MasterAvatarFirstName"); |
237 | if (attri == "") | 237 | if (attri == "") |
238 | { | 238 | { |
239 | this.MasterAvatarFirstName = MainLog.Instance.CmdPrompt("First name of Master Avatar (Land and Region Owner)", "Test"); | 239 | this.MasterAvatarFirstName = MainLog.Instance.CmdPrompt("First name of Master Avatar (Land and Region Owner)", "Test"); |
240 | 240 | ||
241 | configData.SetAttribute("MasterAvatarFirstName", this.MasterAvatarFirstName); | 241 | configData.SetAttribute("MasterAvatarFirstName", this.MasterAvatarFirstName); |
242 | } | 242 | } |
243 | else | 243 | else |
244 | { | 244 | { |
245 | this.MasterAvatarFirstName = attri; | 245 | this.MasterAvatarFirstName = attri; |
246 | } | 246 | } |
247 | 247 | ||
248 | attri = ""; | 248 | attri = ""; |
249 | attri = configData.GetAttribute("MasterAvatarLastName"); | 249 | attri = configData.GetAttribute("MasterAvatarLastName"); |
250 | if (attri == "") | 250 | if (attri == "") |
251 | { | 251 | { |
252 | this.MasterAvatarLastName = MainLog.Instance.CmdPrompt("Last name of Master Avatar (Land and Region Owner)", "User"); | 252 | this.MasterAvatarLastName = MainLog.Instance.CmdPrompt("Last name of Master Avatar (Land and Region Owner)", "User"); |
253 | 253 | ||
254 | configData.SetAttribute("MasterAvatarLastName", this.MasterAvatarLastName); | 254 | configData.SetAttribute("MasterAvatarLastName", this.MasterAvatarLastName); |
255 | } | 255 | } |
256 | else | 256 | else |
257 | { | 257 | { |
258 | this.MasterAvatarLastName = attri; | 258 | this.MasterAvatarLastName = attri; |
259 | } | 259 | } |
260 | 260 | ||
261 | if (isSandbox) //Sandbox Mode Specific Settings | 261 | if (isSandbox) //Sandbox Mode Specific Settings |
262 | { | 262 | { |
263 | attri = ""; | 263 | attri = ""; |
264 | attri = configData.GetAttribute("MasterAvatarSandboxPassword"); | 264 | attri = configData.GetAttribute("MasterAvatarSandboxPassword"); |
265 | if (attri == "") | 265 | if (attri == "") |
266 | { | 266 | { |
267 | this.MasterAvatarSandboxPassword = MainLog.Instance.CmdPrompt("Password of Master Avatar (Needed for sandbox mode account creation only)", "test"); | 267 | this.MasterAvatarSandboxPassword = MainLog.Instance.CmdPrompt("Password of Master Avatar (Needed for sandbox mode account creation only)", "test"); |
268 | 268 | ||
269 | //Should I store this? | 269 | //Should I store this? |
270 | configData.SetAttribute("MasterAvatarSandboxPassword", this.MasterAvatarSandboxPassword); | 270 | configData.SetAttribute("MasterAvatarSandboxPassword", this.MasterAvatarSandboxPassword); |
271 | } | 271 | } |
272 | else | 272 | else |
273 | { | 273 | { |
274 | this.MasterAvatarSandboxPassword = attri; | 274 | this.MasterAvatarSandboxPassword = attri; |
275 | } | 275 | } |
276 | } | 276 | } |
277 | 277 | ||
278 | configData.Commit(); | 278 | configData.Commit(); |
279 | } | 279 | } |
280 | catch (Exception e) | 280 | catch (Exception e) |
281 | { | 281 | { |
282 | MainLog.Instance.Warn("Config.cs:InitConfig() - Exception occured"); | 282 | MainLog.Instance.Warn("Config.cs:InitConfig() - Exception occured"); |
283 | MainLog.Instance.Warn(e.ToString()); | 283 | MainLog.Instance.Warn(e.ToString()); |
284 | } | 284 | } |
285 | 285 | ||
286 | MainLog.Instance.Verbose("Sim settings loaded:"); | 286 | MainLog.Instance.Verbose("Sim settings loaded:"); |
287 | MainLog.Instance.Verbose("UUID: " + this.SimUUID.ToStringHyphenated()); | 287 | MainLog.Instance.Verbose("UUID: " + this.SimUUID.ToStringHyphenated()); |
288 | MainLog.Instance.Verbose("Name: " + this.RegionName); | 288 | MainLog.Instance.Verbose("Name: " + this.RegionName); |
289 | MainLog.Instance.Verbose("Region Location: [" + this.RegionLocX.ToString() + "," + this.RegionLocY + "]"); | 289 | MainLog.Instance.Verbose("Region Location: [" + this.RegionLocX.ToString() + "," + this.RegionLocY + "]"); |
290 | MainLog.Instance.Verbose("Region Handle: " + this.RegionHandle.ToString()); | 290 | MainLog.Instance.Verbose("Region Handle: " + this.RegionHandle.ToString()); |
291 | MainLog.Instance.Verbose("Listening on IP end point: " + m_internalEndPoint.ToString() ); | 291 | MainLog.Instance.Verbose("Listening on IP end point: " + m_internalEndPoint.ToString() ); |
292 | MainLog.Instance.Verbose("Sandbox Mode? " + isSandbox.ToString()); | 292 | MainLog.Instance.Verbose("Sandbox Mode? " + isSandbox.ToString()); |
293 | 293 | ||
294 | } | 294 | } |
295 | 295 | ||
296 | private uint GetInt(IGenericConfig configData, string p, int p_3, string p_4) | 296 | private uint GetInt(IGenericConfig configData, string p, int p_3, string p_4) |
297 | { | 297 | { |
298 | throw new Exception("The method or operation is not implemented."); | 298 | throw new Exception("The method or operation is not implemented."); |
299 | } | 299 | } |
300 | 300 | ||
301 | private string GetString(IGenericConfig configData, string attrName, string defaultvalue, string prompt) | 301 | private string GetString(IGenericConfig configData, string attrName, string defaultvalue, string prompt) |
302 | { | 302 | { |
303 | string s = configData.GetAttribute(attrName); | 303 | string s = configData.GetAttribute(attrName); |
304 | 304 | ||
305 | if (String.IsNullOrEmpty( s )) | 305 | if (String.IsNullOrEmpty( s )) |
306 | { | 306 | { |
307 | s = MainLog.Instance.CmdPrompt(prompt, defaultvalue); | 307 | s = MainLog.Instance.CmdPrompt(prompt, defaultvalue); |
308 | configData.SetAttribute(attrName, s ); | 308 | configData.SetAttribute(attrName, s ); |
309 | } | 309 | } |
310 | return s; | 310 | return s; |
311 | } | 311 | } |
312 | 312 | ||
313 | private IPAddress GetIPAddress(IGenericConfig configData, string attrName, string defaultvalue, string prompt) | 313 | private IPAddress GetIPAddress(IGenericConfig configData, string attrName, string defaultvalue, string prompt) |
314 | { | 314 | { |
315 | string addressStr = configData.GetAttribute(attrName); | 315 | string addressStr = configData.GetAttribute(attrName); |
316 | 316 | ||
317 | IPAddress address; | 317 | IPAddress address; |
318 | 318 | ||
319 | if (!IPAddress.TryParse(addressStr, out address)) | 319 | if (!IPAddress.TryParse(addressStr, out address)) |
320 | { | 320 | { |
321 | address = MainLog.Instance.CmdPromptIPAddress(prompt, defaultvalue); | 321 | address = MainLog.Instance.CmdPromptIPAddress(prompt, defaultvalue); |
322 | configData.SetAttribute(attrName, address.ToString()); | 322 | configData.SetAttribute(attrName, address.ToString()); |
323 | } | 323 | } |
324 | return address; | 324 | return address; |
325 | } | 325 | } |
326 | 326 | ||
327 | private int GetIPPort(IGenericConfig configData, string attrName, string defaultvalue, string prompt) | 327 | private int GetIPPort(IGenericConfig configData, string attrName, string defaultvalue, string prompt) |
328 | { | 328 | { |
329 | string portStr = configData.GetAttribute(attrName); | 329 | string portStr = configData.GetAttribute(attrName); |
330 | 330 | ||
331 | int port; | 331 | int port; |
332 | 332 | ||
333 | if (!int.TryParse(portStr, out port)) | 333 | if (!int.TryParse(portStr, out port)) |
334 | { | 334 | { |
335 | port = MainLog.Instance.CmdPromptIPPort(prompt, defaultvalue); | 335 | port = MainLog.Instance.CmdPromptIPPort(prompt, defaultvalue); |
336 | configData.SetAttribute(attrName, port.ToString()); | 336 | configData.SetAttribute(attrName, port.ToString()); |
337 | } | 337 | } |
338 | 338 | ||
339 | return port; | 339 | return port; |
340 | } | 340 | } |
341 | } | 341 | } |
342 | } | 342 | } |
diff --git a/OpenSim/Framework/General/Types/UUID.cs b/OpenSim/Framework/General/Types/UUID.cs index 9cde18e..9e9654d 100644 --- a/OpenSim/Framework/General/Types/UUID.cs +++ b/OpenSim/Framework/General/Types/UUID.cs | |||
@@ -1,127 +1,127 @@ | |||
1 | using System; | 1 | using System; |
2 | using libsecondlife; | 2 | using libsecondlife; |
3 | 3 | ||
4 | namespace OpenSim.Framework.Types | 4 | namespace OpenSim.Framework.Types |
5 | { | 5 | { |
6 | class UUID | 6 | class UUID |
7 | { | 7 | { |
8 | public LLUUID llUUID; | 8 | public LLUUID llUUID; |
9 | 9 | ||
10 | public UUID(string uuid) | 10 | public UUID(string uuid) |
11 | { | 11 | { |
12 | llUUID = new LLUUID(uuid); | 12 | llUUID = new LLUUID(uuid); |
13 | } | 13 | } |
14 | 14 | ||
15 | public UUID(byte[] uuid) | 15 | public UUID(byte[] uuid) |
16 | { | 16 | { |
17 | llUUID = new LLUUID(uuid, 0); | 17 | llUUID = new LLUUID(uuid, 0); |
18 | } | 18 | } |
19 | 19 | ||
20 | public UUID(byte[] uuid, int offset) | 20 | public UUID(byte[] uuid, int offset) |
21 | { | 21 | { |
22 | llUUID = new LLUUID(uuid, offset); | 22 | llUUID = new LLUUID(uuid, offset); |
23 | } | 23 | } |
24 | 24 | ||
25 | public UUID() | 25 | public UUID() |
26 | { | 26 | { |
27 | llUUID = LLUUID.Zero; | 27 | llUUID = LLUUID.Zero; |
28 | } | 28 | } |
29 | 29 | ||
30 | public UUID(ulong uuid) | 30 | public UUID(ulong uuid) |
31 | { | 31 | { |
32 | llUUID = new LLUUID(uuid); | 32 | llUUID = new LLUUID(uuid); |
33 | } | 33 | } |
34 | 34 | ||
35 | public UUID(UInt32 first, UInt32 second, UInt32 third, UInt32 fourth) | 35 | public UUID(UInt32 first, UInt32 second, UInt32 third, UInt32 fourth) |
36 | { | 36 | { |
37 | byte[] uuid = new byte[16]; | 37 | byte[] uuid = new byte[16]; |
38 | 38 | ||
39 | byte[] n = BitConverter.GetBytes(first); | 39 | byte[] n = BitConverter.GetBytes(first); |
40 | n.CopyTo(uuid, 0); | 40 | n.CopyTo(uuid, 0); |
41 | n = BitConverter.GetBytes(second); | 41 | n = BitConverter.GetBytes(second); |
42 | n.CopyTo(uuid, 4); | 42 | n.CopyTo(uuid, 4); |
43 | n = BitConverter.GetBytes(third); | 43 | n = BitConverter.GetBytes(third); |
44 | n.CopyTo(uuid, 8); | 44 | n.CopyTo(uuid, 8); |
45 | n = BitConverter.GetBytes(fourth); | 45 | n = BitConverter.GetBytes(fourth); |
46 | n.CopyTo(uuid, 12); | 46 | n.CopyTo(uuid, 12); |
47 | 47 | ||
48 | llUUID = new LLUUID(uuid,0); | 48 | llUUID = new LLUUID(uuid,0); |
49 | } | 49 | } |
50 | 50 | ||
51 | public override string ToString() | 51 | public override string ToString() |
52 | { | 52 | { |
53 | return llUUID.ToString(); | 53 | return llUUID.ToString(); |
54 | } | 54 | } |
55 | 55 | ||
56 | public string ToStringHyphenated() | 56 | public string ToStringHyphenated() |
57 | { | 57 | { |
58 | return llUUID.ToStringHyphenated(); | 58 | return llUUID.ToStringHyphenated(); |
59 | } | 59 | } |
60 | 60 | ||
61 | public byte[] GetBytes() | 61 | public byte[] GetBytes() |
62 | { | 62 | { |
63 | return llUUID.GetBytes(); | 63 | return llUUID.GetBytes(); |
64 | } | 64 | } |
65 | 65 | ||
66 | public UInt32[] GetInts() | 66 | public UInt32[] GetInts() |
67 | { | 67 | { |
68 | UInt32[] ints = new UInt32[4]; | 68 | UInt32[] ints = new UInt32[4]; |
69 | ints[0] = BitConverter.ToUInt32(llUUID.Data, 0); | 69 | ints[0] = BitConverter.ToUInt32(llUUID.Data, 0); |
70 | ints[1] = BitConverter.ToUInt32(llUUID.Data, 4); | 70 | ints[1] = BitConverter.ToUInt32(llUUID.Data, 4); |
71 | ints[2] = BitConverter.ToUInt32(llUUID.Data, 8); | 71 | ints[2] = BitConverter.ToUInt32(llUUID.Data, 8); |
72 | ints[3] = BitConverter.ToUInt32(llUUID.Data, 12); | 72 | ints[3] = BitConverter.ToUInt32(llUUID.Data, 12); |
73 | 73 | ||
74 | return ints; | 74 | return ints; |
75 | } | 75 | } |
76 | 76 | ||
77 | public LLUUID GetLLUUID() | 77 | public LLUUID GetLLUUID() |
78 | { | 78 | { |
79 | return llUUID; | 79 | return llUUID; |
80 | } | 80 | } |
81 | 81 | ||
82 | public uint CRC() | 82 | public uint CRC() |
83 | { | 83 | { |
84 | return llUUID.CRC(); | 84 | return llUUID.CRC(); |
85 | } | 85 | } |
86 | 86 | ||
87 | public override int GetHashCode() | 87 | public override int GetHashCode() |
88 | { | 88 | { |
89 | return llUUID.GetHashCode(); | 89 | return llUUID.GetHashCode(); |
90 | } | 90 | } |
91 | 91 | ||
92 | public void Combine(UUID other) | 92 | public void Combine(UUID other) |
93 | { | 93 | { |
94 | llUUID.Combine(other.GetLLUUID()); | 94 | llUUID.Combine(other.GetLLUUID()); |
95 | } | 95 | } |
96 | 96 | ||
97 | public void Combine(LLUUID other) | 97 | public void Combine(LLUUID other) |
98 | { | 98 | { |
99 | llUUID.Combine(other); | 99 | llUUID.Combine(other); |
100 | } | 100 | } |
101 | 101 | ||
102 | public override bool Equals(Object other) | 102 | public override bool Equals(Object other) |
103 | { | 103 | { |
104 | return llUUID.Equals(other); | 104 | return llUUID.Equals(other); |
105 | } | 105 | } |
106 | 106 | ||
107 | public static bool operator ==(UUID a, UUID b) | 107 | public static bool operator ==(UUID a, UUID b) |
108 | { | 108 | { |
109 | return a.llUUID.Equals(b.GetLLUUID()); | 109 | return a.llUUID.Equals(b.GetLLUUID()); |
110 | } | 110 | } |
111 | 111 | ||
112 | public static bool operator !=(UUID a, UUID b) | 112 | public static bool operator !=(UUID a, UUID b) |
113 | { | 113 | { |
114 | return !a.llUUID.Equals(b.GetLLUUID()); | 114 | return !a.llUUID.Equals(b.GetLLUUID()); |
115 | } | 115 | } |
116 | 116 | ||
117 | public static bool operator ==(UUID a, LLUUID b) | 117 | public static bool operator ==(UUID a, LLUUID b) |
118 | { | 118 | { |
119 | return a.Equals(b); | 119 | return a.Equals(b); |
120 | } | 120 | } |
121 | 121 | ||
122 | public static bool operator !=(UUID a, LLUUID b) | 122 | public static bool operator !=(UUID a, LLUUID b) |
123 | { | 123 | { |
124 | return !a.Equals(b); | 124 | return !a.Equals(b); |
125 | } | 125 | } |
126 | } | 126 | } |
127 | } | 127 | } |
diff --git a/OpenSim/Framework/General/UserProfile.cs b/OpenSim/Framework/General/UserProfile.cs index 243208a..ec5a485 100644 --- a/OpenSim/Framework/General/UserProfile.cs +++ b/OpenSim/Framework/General/UserProfile.cs | |||
@@ -1,87 +1,87 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using System.Collections.Generic; | 28 | using System.Collections.Generic; |
29 | using System.Security.Cryptography; | 29 | using System.Security.Cryptography; |
30 | using libsecondlife; | 30 | using libsecondlife; |
31 | using OpenSim.Framework.Inventory; | 31 | using OpenSim.Framework.Inventory; |
32 | 32 | ||
33 | namespace OpenSim.Framework.User | 33 | namespace OpenSim.Framework.User |
34 | { | 34 | { |
35 | public class UserProfile | 35 | public class UserProfile |
36 | { | 36 | { |
37 | 37 | ||
38 | public string firstname; | 38 | public string firstname; |
39 | public string lastname; | 39 | public string lastname; |
40 | public ulong homeregionhandle; | 40 | public ulong homeregionhandle; |
41 | public LLVector3 homepos; | 41 | public LLVector3 homepos; |
42 | public LLVector3 homelookat; | 42 | public LLVector3 homelookat; |
43 | 43 | ||
44 | public bool IsGridGod = false; | 44 | public bool IsGridGod = false; |
45 | public bool IsLocal = true; // will be used in future for visitors from foreign grids | 45 | public bool IsLocal = true; // will be used in future for visitors from foreign grids |
46 | public string AssetURL; | 46 | public string AssetURL; |
47 | public string MD5passwd; | 47 | public string MD5passwd; |
48 | 48 | ||
49 | public LLUUID CurrentSessionID; | 49 | public LLUUID CurrentSessionID; |
50 | public LLUUID CurrentSecureSessionID; | 50 | public LLUUID CurrentSecureSessionID; |
51 | public LLUUID UUID; | 51 | public LLUUID UUID; |
52 | public Dictionary<LLUUID, uint> Circuits = new Dictionary<LLUUID, uint>(); // tracks circuit codes | 52 | public Dictionary<LLUUID, uint> Circuits = new Dictionary<LLUUID, uint>(); // tracks circuit codes |
53 | 53 | ||
54 | public AgentInventory Inventory; | 54 | public AgentInventory Inventory; |
55 | 55 | ||
56 | public UserProfile() | 56 | public UserProfile() |
57 | { | 57 | { |
58 | Circuits = new Dictionary<LLUUID, uint>(); | 58 | Circuits = new Dictionary<LLUUID, uint>(); |
59 | Inventory = new AgentInventory(); | 59 | Inventory = new AgentInventory(); |
60 | homeregionhandle = Helpers.UIntsToLong((1000 * 256), (1000 * 256)); | 60 | homeregionhandle = Helpers.UIntsToLong((1000 * 256), (1000 * 256)); |
61 | homepos = new LLVector3(); | 61 | homepos = new LLVector3(); |
62 | homelookat = new LLVector3(); | 62 | homelookat = new LLVector3(); |
63 | } | 63 | } |
64 | 64 | ||
65 | public void InitSessionData() | 65 | public void InitSessionData() |
66 | { | 66 | { |
67 | RNGCryptoServiceProvider rand = new RNGCryptoServiceProvider(); | 67 | RNGCryptoServiceProvider rand = new RNGCryptoServiceProvider(); |
68 | 68 | ||
69 | byte[] randDataS = new byte[16]; | 69 | byte[] randDataS = new byte[16]; |
70 | byte[] randDataSS = new byte[16]; | 70 | byte[] randDataSS = new byte[16]; |
71 | 71 | ||
72 | rand.GetBytes(randDataS); | 72 | rand.GetBytes(randDataS); |
73 | rand.GetBytes(randDataSS); | 73 | rand.GetBytes(randDataSS); |
74 | 74 | ||
75 | CurrentSecureSessionID = new LLUUID(randDataSS,0); | 75 | CurrentSecureSessionID = new LLUUID(randDataSS,0); |
76 | CurrentSessionID = new LLUUID(randDataS,0); | 76 | CurrentSessionID = new LLUUID(randDataS,0); |
77 | 77 | ||
78 | } | 78 | } |
79 | 79 | ||
80 | public void AddSimCircuit(uint circuitCode, LLUUID regionUUID) | 80 | public void AddSimCircuit(uint circuitCode, LLUUID regionUUID) |
81 | { | 81 | { |
82 | if (this.Circuits.ContainsKey(regionUUID) == false) | 82 | if (this.Circuits.ContainsKey(regionUUID) == false) |
83 | this.Circuits.Add(regionUUID, circuitCode); | 83 | this.Circuits.Add(regionUUID, circuitCode); |
84 | } | 84 | } |
85 | 85 | ||
86 | } | 86 | } |
87 | } | 87 | } |
diff --git a/OpenSim/Framework/General/Util.cs b/OpenSim/Framework/General/Util.cs index 13e3af2..3333ced 100644 --- a/OpenSim/Framework/General/Util.cs +++ b/OpenSim/Framework/General/Util.cs | |||
@@ -1,184 +1,184 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using System; | 28 | using System; |
29 | using System.Security.Cryptography; | 29 | using System.Security.Cryptography; |
30 | using System.Text; | 30 | using System.Text; |
31 | using libsecondlife; | 31 | using libsecondlife; |
32 | 32 | ||
33 | namespace OpenSim.Framework.Utilities | 33 | namespace OpenSim.Framework.Utilities |
34 | { | 34 | { |
35 | public class Util | 35 | public class Util |
36 | { | 36 | { |
37 | private static Random randomClass = new Random(); | 37 | private static Random randomClass = new Random(); |
38 | private static uint nextXferID = 5000; | 38 | private static uint nextXferID = 5000; |
39 | private static object XferLock = new object(); | 39 | private static object XferLock = new object(); |
40 | 40 | ||
41 | public static ulong UIntsToLong(uint X, uint Y) | 41 | public static ulong UIntsToLong(uint X, uint Y) |
42 | { | 42 | { |
43 | return Helpers.UIntsToLong(X, Y); | 43 | return Helpers.UIntsToLong(X, Y); |
44 | } | 44 | } |
45 | 45 | ||
46 | public static Random RandomClass | 46 | public static Random RandomClass |
47 | { | 47 | { |
48 | get | 48 | get |
49 | { | 49 | { |
50 | return randomClass; | 50 | return randomClass; |
51 | } | 51 | } |
52 | } | 52 | } |
53 | 53 | ||
54 | public static uint GetNextXferID() | 54 | public static uint GetNextXferID() |
55 | { | 55 | { |
56 | uint id = 0; | 56 | uint id = 0; |
57 | lock(XferLock) | 57 | lock(XferLock) |
58 | { | 58 | { |
59 | id = nextXferID; | 59 | id = nextXferID; |
60 | nextXferID++; | 60 | nextXferID++; |
61 | } | 61 | } |
62 | return id; | 62 | return id; |
63 | } | 63 | } |
64 | 64 | ||
65 | public static int UnixTimeSinceEpoch() | 65 | public static int UnixTimeSinceEpoch() |
66 | { | 66 | { |
67 | TimeSpan t = (DateTime.UtcNow - new DateTime(1970, 1, 1)); | 67 | TimeSpan t = (DateTime.UtcNow - new DateTime(1970, 1, 1)); |
68 | int timestamp = (int)t.TotalSeconds; | 68 | int timestamp = (int)t.TotalSeconds; |
69 | return timestamp; | 69 | return timestamp; |
70 | } | 70 | } |
71 | 71 | ||
72 | public static string Md5Hash(string pass) | 72 | public static string Md5Hash(string pass) |
73 | { | 73 | { |
74 | MD5 md5 = MD5CryptoServiceProvider.Create(); | 74 | MD5 md5 = MD5CryptoServiceProvider.Create(); |
75 | byte[] dataMd5 = md5.ComputeHash(Encoding.Default.GetBytes(pass)); | 75 | byte[] dataMd5 = md5.ComputeHash(Encoding.Default.GetBytes(pass)); |
76 | StringBuilder sb = new StringBuilder(); | 76 | StringBuilder sb = new StringBuilder(); |
77 | for (int i = 0; i < dataMd5.Length; i++) | 77 | for (int i = 0; i < dataMd5.Length; i++) |
78 | sb.AppendFormat("{0:x2}", dataMd5[i]); | 78 | sb.AppendFormat("{0:x2}", dataMd5[i]); |
79 | return sb.ToString(); | 79 | return sb.ToString(); |
80 | } | 80 | } |
81 | 81 | ||
82 | public static string GetRandomCapsPath() | 82 | public static string GetRandomCapsPath() |
83 | { | 83 | { |
84 | LLUUID caps = LLUUID.Random(); | 84 | LLUUID caps = LLUUID.Random(); |
85 | string capsPath = caps.ToStringHyphenated(); | 85 | string capsPath = caps.ToStringHyphenated(); |
86 | capsPath = capsPath.Remove(capsPath.Length - 4, 4); | 86 | capsPath = capsPath.Remove(capsPath.Length - 4, 4); |
87 | return capsPath; | 87 | return capsPath; |
88 | } | 88 | } |
89 | 89 | ||
90 | //public static int fast_distance2d(int x, int y) | 90 | //public static int fast_distance2d(int x, int y) |
91 | //{ | 91 | //{ |
92 | // x = System.Math.Abs(x); | 92 | // x = System.Math.Abs(x); |
93 | // y = System.Math.Abs(y); | 93 | // y = System.Math.Abs(y); |
94 | 94 | ||
95 | // int min = System.Math.Min(x, y); | 95 | // int min = System.Math.Min(x, y); |
96 | 96 | ||
97 | // return (x + y - (min >> 1) - (min >> 2) + (min >> 4)); | 97 | // return (x + y - (min >> 1) - (min >> 2) + (min >> 4)); |
98 | //} | 98 | //} |
99 | 99 | ||
100 | public static string FieldToString(byte[] bytes) | 100 | public static string FieldToString(byte[] bytes) |
101 | { | 101 | { |
102 | return FieldToString(bytes, String.Empty); | 102 | return FieldToString(bytes, String.Empty); |
103 | } | 103 | } |
104 | 104 | ||
105 | /// <summary> | 105 | /// <summary> |
106 | /// Convert a variable length field (byte array) to a string, with a | 106 | /// Convert a variable length field (byte array) to a string, with a |
107 | /// field name prepended to each line of the output | 107 | /// field name prepended to each line of the output |
108 | /// </summary> | 108 | /// </summary> |
109 | /// <remarks>If the byte array has unprintable characters in it, a | 109 | /// <remarks>If the byte array has unprintable characters in it, a |
110 | /// hex dump will be put in the string instead</remarks> | 110 | /// hex dump will be put in the string instead</remarks> |
111 | /// <param name="bytes">The byte array to convert to a string</param> | 111 | /// <param name="bytes">The byte array to convert to a string</param> |
112 | /// <param name="fieldName">A field name to prepend to each line of output</param> | 112 | /// <param name="fieldName">A field name to prepend to each line of output</param> |
113 | /// <returns>An ASCII string or a string containing a hex dump, minus | 113 | /// <returns>An ASCII string or a string containing a hex dump, minus |
114 | /// the null terminator</returns> | 114 | /// the null terminator</returns> |
115 | public static string FieldToString(byte[] bytes, string fieldName) | 115 | public static string FieldToString(byte[] bytes, string fieldName) |
116 | { | 116 | { |
117 | // Check for a common case | 117 | // Check for a common case |
118 | if (bytes.Length == 0) return String.Empty; | 118 | if (bytes.Length == 0) return String.Empty; |
119 | 119 | ||
120 | StringBuilder output = new StringBuilder(); | 120 | StringBuilder output = new StringBuilder(); |
121 | bool printable = true; | 121 | bool printable = true; |
122 | 122 | ||
123 | for (int i = 0; i < bytes.Length; ++i) | 123 | for (int i = 0; i < bytes.Length; ++i) |
124 | { | 124 | { |
125 | // Check if there are any unprintable characters in the array | 125 | // Check if there are any unprintable characters in the array |
126 | if ((bytes[i] < 0x20 || bytes[i] > 0x7E) && bytes[i] != 0x09 | 126 | if ((bytes[i] < 0x20 || bytes[i] > 0x7E) && bytes[i] != 0x09 |
127 | && bytes[i] != 0x0D && bytes[i] != 0x0A && bytes[i] != 0x00) | 127 | && bytes[i] != 0x0D && bytes[i] != 0x0A && bytes[i] != 0x00) |
128 | { | 128 | { |
129 | printable = false; | 129 | printable = false; |
130 | break; | 130 | break; |
131 | } | 131 | } |
132 | } | 132 | } |
133 | 133 | ||
134 | if (printable) | 134 | if (printable) |
135 | { | 135 | { |
136 | if (fieldName.Length > 0) | 136 | if (fieldName.Length > 0) |
137 | { | 137 | { |
138 | output.Append(fieldName); | 138 | output.Append(fieldName); |
139 | output.Append(": "); | 139 | output.Append(": "); |
140 | } | 140 | } |
141 | 141 | ||
142 | if (bytes[bytes.Length - 1] == 0x00) | 142 | if (bytes[bytes.Length - 1] == 0x00) |
143 | output.Append(UTF8Encoding.UTF8.GetString(bytes, 0, bytes.Length - 1)); | 143 | output.Append(UTF8Encoding.UTF8.GetString(bytes, 0, bytes.Length - 1)); |
144 | else | 144 | else |
145 | output.Append(UTF8Encoding.UTF8.GetString(bytes)); | 145 | output.Append(UTF8Encoding.UTF8.GetString(bytes)); |
146 | } | 146 | } |
147 | else | 147 | else |
148 | { | 148 | { |
149 | for (int i = 0; i < bytes.Length; i += 16) | 149 | for (int i = 0; i < bytes.Length; i += 16) |
150 | { | 150 | { |
151 | if (i != 0) | 151 | if (i != 0) |
152 | output.Append(Environment.NewLine); | 152 | output.Append(Environment.NewLine); |
153 | if (fieldName.Length > 0) | 153 | if (fieldName.Length > 0) |
154 | { | 154 | { |
155 | output.Append(fieldName); | 155 | output.Append(fieldName); |
156 | output.Append(": "); | 156 | output.Append(": "); |
157 | } | 157 | } |
158 | 158 | ||
159 | for (int j = 0; j < 16; j++) | 159 | for (int j = 0; j < 16; j++) |
160 | { | 160 | { |
161 | if ((i + j) < bytes.Length) | 161 | if ((i + j) < bytes.Length) |
162 | output.Append(String.Format("{0:X2} ", bytes[i + j])); | 162 | output.Append(String.Format("{0:X2} ", bytes[i + j])); |
163 | else | 163 | else |
164 | output.Append(" "); | 164 | output.Append(" "); |
165 | } | 165 | } |
166 | 166 | ||
167 | for (int j = 0; j < 16 && (i + j) < bytes.Length; j++) | 167 | for (int j = 0; j < 16 && (i + j) < bytes.Length; j++) |
168 | { | 168 | { |
169 | if (bytes[i + j] >= 0x20 && bytes[i + j] < 0x7E) | 169 | if (bytes[i + j] >= 0x20 && bytes[i + j] < 0x7E) |
170 | output.Append((char)bytes[i + j]); | 170 | output.Append((char)bytes[i + j]); |
171 | else | 171 | else |
172 | output.Append("."); | 172 | output.Append("."); |
173 | } | 173 | } |
174 | } | 174 | } |
175 | } | 175 | } |
176 | 176 | ||
177 | return output.ToString(); | 177 | return output.ToString(); |
178 | } | 178 | } |
179 | public Util() | 179 | public Util() |
180 | { | 180 | { |
181 | 181 | ||
182 | } | 182 | } |
183 | } | 183 | } |
184 | } | 184 | } |
diff --git a/OpenSim/Framework/GenericConfig/Xml/Properties/AssemblyInfo.cs b/OpenSim/Framework/GenericConfig/Xml/Properties/AssemblyInfo.cs index fcffd67..28779ee 100644 --- a/OpenSim/Framework/GenericConfig/Xml/Properties/AssemblyInfo.cs +++ b/OpenSim/Framework/GenericConfig/Xml/Properties/AssemblyInfo.cs | |||
@@ -1,33 +1,33 @@ | |||
1 | using System.Reflection; | 1 | using System.Reflection; |
2 | using System.Runtime.InteropServices; | 2 | using System.Runtime.InteropServices; |
3 | // General Information about an assembly is controlled through the following | 3 | // General Information about an assembly is controlled through the following |
4 | // set of attributes. Change these attribute values to modify the information | 4 | // set of attributes. Change these attribute values to modify the information |
5 | // associated with an assembly. | 5 | // associated with an assembly. |
6 | [assembly: AssemblyTitle("OpenSim.GenericConfig")] | 6 | [assembly: AssemblyTitle("OpenSim.GenericConfig")] |
7 | [assembly: AssemblyDescription("")] | 7 | [assembly: AssemblyDescription("")] |
8 | [assembly: AssemblyConfiguration("")] | 8 | [assembly: AssemblyConfiguration("")] |
9 | [assembly: AssemblyCompany("")] | 9 | [assembly: AssemblyCompany("")] |
10 | [assembly: AssemblyProduct("OpenSim.GenericConfig")] | 10 | [assembly: AssemblyProduct("OpenSim.GenericConfig")] |
11 | [assembly: AssemblyCopyright("Copyright © 2007")] | 11 | [assembly: AssemblyCopyright("Copyright © 2007")] |
12 | [assembly: AssemblyTrademark("")] | 12 | [assembly: AssemblyTrademark("")] |
13 | [assembly: AssemblyCulture("")] | 13 | [assembly: AssemblyCulture("")] |
14 | 14 | ||
15 | // Setting ComVisible to false makes the types in this assembly not visible | 15 | // Setting ComVisible to false makes the types in this assembly not visible |
16 | // to COM components. If you need to access a type in this assembly from | 16 | // to COM components. If you need to access a type in this assembly from |
17 | // COM, set the ComVisible attribute to true on that type. | 17 | // COM, set the ComVisible attribute to true on that type. |
18 | [assembly: ComVisible(false)] | 18 | [assembly: ComVisible(false)] |
19 | 19 | ||
20 | // The following GUID is for the ID of the typelib if this project is exposed to COM | 20 | // The following GUID is for the ID of the typelib if this project is exposed to COM |
21 | [assembly: Guid("285a3047-f165-46c8-8767-b51428738a09")] | 21 | [assembly: Guid("285a3047-f165-46c8-8767-b51428738a09")] |
22 | 22 | ||
23 | // Version information for an assembly consists of the following four values: | 23 | // Version information for an assembly consists of the following four values: |
24 | // | 24 | // |
25 | // Major Version | 25 | // Major Version |
26 | // Minor Version | 26 | // Minor Version |
27 | // Build Number | 27 | // Build Number |
28 | // Revision | 28 | // Revision |
29 | // | 29 | // |
30 | // You can specify all the values or you can default the Revision and Build Numbers | 30 | // You can specify all the values or you can default the Revision and Build Numbers |
31 | // by using the '*' as shown below: | 31 | // by using the '*' as shown below: |
32 | [assembly: AssemblyVersion("1.0.0.0")] | 32 | [assembly: AssemblyVersion("1.0.0.0")] |
33 | [assembly: AssemblyFileVersion("1.0.0.0")] | 33 | [assembly: AssemblyFileVersion("1.0.0.0")] |
diff --git a/OpenSim/Framework/GenericConfig/Xml/XmlConfig.cs b/OpenSim/Framework/GenericConfig/Xml/XmlConfig.cs index 7fa085d..2ed8d28 100644 --- a/OpenSim/Framework/GenericConfig/Xml/XmlConfig.cs +++ b/OpenSim/Framework/GenericConfig/Xml/XmlConfig.cs | |||
@@ -1,122 +1,122 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using System; | 28 | using System; |
29 | using System.IO; | 29 | using System.IO; |
30 | using System.Xml; | 30 | using System.Xml; |
31 | using OpenSim.Framework.Interfaces; | 31 | using OpenSim.Framework.Interfaces; |
32 | 32 | ||
33 | namespace OpenSim.GenericConfig | 33 | namespace OpenSim.GenericConfig |
34 | { | 34 | { |
35 | public class XmlConfig : IGenericConfig | 35 | public class XmlConfig : IGenericConfig |
36 | { | 36 | { |
37 | private XmlDocument doc; | 37 | private XmlDocument doc; |
38 | private XmlNode rootNode; | 38 | private XmlNode rootNode; |
39 | private XmlNode configNode; | 39 | private XmlNode configNode; |
40 | private string fileName; | 40 | private string fileName; |
41 | private bool createdFile = false; | 41 | private bool createdFile = false; |
42 | 42 | ||
43 | public XmlConfig(string filename) | 43 | public XmlConfig(string filename) |
44 | { | 44 | { |
45 | fileName = filename; | 45 | fileName = filename; |
46 | } | 46 | } |
47 | 47 | ||
48 | public void LoadData() | 48 | public void LoadData() |
49 | { | 49 | { |
50 | doc = new XmlDocument(); | 50 | doc = new XmlDocument(); |
51 | 51 | ||
52 | if (File.Exists(fileName)) | 52 | if (File.Exists(fileName)) |
53 | { | 53 | { |
54 | XmlTextReader reader = new XmlTextReader(fileName); | 54 | XmlTextReader reader = new XmlTextReader(fileName); |
55 | reader.WhitespaceHandling = WhitespaceHandling.None; | 55 | reader.WhitespaceHandling = WhitespaceHandling.None; |
56 | doc.Load(reader); | 56 | doc.Load(reader); |
57 | reader.Close(); | 57 | reader.Close(); |
58 | } | 58 | } |
59 | else | 59 | else |
60 | { | 60 | { |
61 | createdFile = true; | 61 | createdFile = true; |
62 | rootNode = doc.CreateNode(XmlNodeType.Element, "Root", ""); | 62 | rootNode = doc.CreateNode(XmlNodeType.Element, "Root", ""); |
63 | doc.AppendChild(rootNode); | 63 | doc.AppendChild(rootNode); |
64 | configNode = doc.CreateNode(XmlNodeType.Element, "Config", ""); | 64 | configNode = doc.CreateNode(XmlNodeType.Element, "Config", ""); |
65 | rootNode.AppendChild(configNode); | 65 | rootNode.AppendChild(configNode); |
66 | } | 66 | } |
67 | 67 | ||
68 | 68 | ||
69 | rootNode = doc.FirstChild; | 69 | rootNode = doc.FirstChild; |
70 | if (rootNode.Name != "Root") | 70 | if (rootNode.Name != "Root") |
71 | throw new Exception("Error: Invalid .xml File. Missing <Root>"); | 71 | throw new Exception("Error: Invalid .xml File. Missing <Root>"); |
72 | 72 | ||
73 | configNode = rootNode.FirstChild; | 73 | configNode = rootNode.FirstChild; |
74 | if (configNode.Name != "Config") | 74 | if (configNode.Name != "Config") |
75 | throw new Exception("Error: Invalid .xml File. <Root> first child should be <Config>"); | 75 | throw new Exception("Error: Invalid .xml File. <Root> first child should be <Config>"); |
76 | 76 | ||
77 | if (createdFile) | 77 | if (createdFile) |
78 | { | 78 | { |
79 | this.Commit(); | 79 | this.Commit(); |
80 | } | 80 | } |
81 | } | 81 | } |
82 | 82 | ||
83 | public string GetAttribute(string attributeName) | 83 | public string GetAttribute(string attributeName) |
84 | { | 84 | { |
85 | string result = ""; | 85 | string result = ""; |
86 | if (configNode.Attributes[attributeName] != null) | 86 | if (configNode.Attributes[attributeName] != null) |
87 | { | 87 | { |
88 | result = ((XmlAttribute)configNode.Attributes.GetNamedItem(attributeName)).Value; | 88 | result = ((XmlAttribute)configNode.Attributes.GetNamedItem(attributeName)).Value; |
89 | } | 89 | } |
90 | return result; | 90 | return result; |
91 | } | 91 | } |
92 | 92 | ||
93 | public bool SetAttribute(string attributeName, string attributeValue) | 93 | public bool SetAttribute(string attributeName, string attributeValue) |
94 | { | 94 | { |
95 | if (configNode.Attributes[attributeName] != null) | 95 | if (configNode.Attributes[attributeName] != null) |
96 | { | 96 | { |
97 | ((XmlAttribute)configNode.Attributes.GetNamedItem(attributeName)).Value = attributeValue; | 97 | ((XmlAttribute)configNode.Attributes.GetNamedItem(attributeName)).Value = attributeValue; |
98 | } | 98 | } |
99 | else | 99 | else |
100 | { | 100 | { |
101 | XmlAttribute attri; | 101 | XmlAttribute attri; |
102 | attri = doc.CreateAttribute(attributeName); | 102 | attri = doc.CreateAttribute(attributeName); |
103 | attri.Value = attributeValue; | 103 | attri.Value = attributeValue; |
104 | configNode.Attributes.Append(attri); | 104 | configNode.Attributes.Append(attri); |
105 | } | 105 | } |
106 | return true; | 106 | return true; |
107 | } | 107 | } |
108 | 108 | ||
109 | public void Commit() | 109 | public void Commit() |
110 | { | 110 | { |
111 | doc.Save(fileName); | 111 | doc.Save(fileName); |
112 | } | 112 | } |
113 | 113 | ||
114 | public void Close() | 114 | public void Close() |
115 | { | 115 | { |
116 | configNode = null; | 116 | configNode = null; |
117 | rootNode = null; | 117 | rootNode = null; |
118 | doc = null; | 118 | doc = null; |
119 | } | 119 | } |
120 | 120 | ||
121 | } | 121 | } |
122 | } | 122 | } |
diff --git a/OpenSim/Framework/Servers/BaseHttpServer.cs b/OpenSim/Framework/Servers/BaseHttpServer.cs index f790477..4b3b3de 100644 --- a/OpenSim/Framework/Servers/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/BaseHttpServer.cs | |||
@@ -1,224 +1,224 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using System; | 28 | using System; |
29 | using System.Collections; | 29 | using System.Collections; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.IO; | 31 | using System.IO; |
32 | using System.Net; | 32 | using System.Net; |
33 | using System.Text; | 33 | using System.Text; |
34 | using System.Text.RegularExpressions; | 34 | using System.Text.RegularExpressions; |
35 | using System.Threading; | 35 | using System.Threading; |
36 | using Nwc.XmlRpc; | 36 | using Nwc.XmlRpc; |
37 | using OpenSim.Framework.Console; | 37 | using OpenSim.Framework.Console; |
38 | 38 | ||
39 | namespace OpenSim.Framework.Servers | 39 | namespace OpenSim.Framework.Servers |
40 | { | 40 | { |
41 | public class BaseHttpServer | 41 | public class BaseHttpServer |
42 | { | 42 | { |
43 | protected Thread m_workerThread; | 43 | protected Thread m_workerThread; |
44 | protected HttpListener m_httpListener; | 44 | protected HttpListener m_httpListener; |
45 | protected Dictionary<string, XmlRpcMethod> m_rpcHandlers = new Dictionary<string, XmlRpcMethod>(); | 45 | protected Dictionary<string, XmlRpcMethod> m_rpcHandlers = new Dictionary<string, XmlRpcMethod>(); |
46 | protected Dictionary<string, IStreamHandler> m_streamHandlers = new Dictionary<string, IStreamHandler>(); | 46 | protected Dictionary<string, IStreamHandler> m_streamHandlers = new Dictionary<string, IStreamHandler>(); |
47 | protected int m_port; | 47 | protected int m_port; |
48 | protected bool m_firstcaps = true; | 48 | protected bool m_firstcaps = true; |
49 | 49 | ||
50 | public BaseHttpServer(int port) | 50 | public BaseHttpServer(int port) |
51 | { | 51 | { |
52 | m_port = port; | 52 | m_port = port; |
53 | } | 53 | } |
54 | 54 | ||
55 | public void AddStreamHandler( IStreamHandler handler) | 55 | public void AddStreamHandler( IStreamHandler handler) |
56 | { | 56 | { |
57 | string httpMethod = handler.HttpMethod; | 57 | string httpMethod = handler.HttpMethod; |
58 | string path = handler.Path; | 58 | string path = handler.Path; |
59 | 59 | ||
60 | string handlerKey = GetHandlerKey(httpMethod, path); | 60 | string handlerKey = GetHandlerKey(httpMethod, path); |
61 | m_streamHandlers.Add(handlerKey, handler); | 61 | m_streamHandlers.Add(handlerKey, handler); |
62 | } | 62 | } |
63 | 63 | ||
64 | private static string GetHandlerKey(string httpMethod, string path) | 64 | private static string GetHandlerKey(string httpMethod, string path) |
65 | { | 65 | { |
66 | return httpMethod + ":" + path; | 66 | return httpMethod + ":" + path; |
67 | } | 67 | } |
68 | 68 | ||
69 | public bool AddXmlRPCHandler(string method, XmlRpcMethod handler) | 69 | public bool AddXmlRPCHandler(string method, XmlRpcMethod handler) |
70 | { | 70 | { |
71 | if (!this.m_rpcHandlers.ContainsKey(method)) | 71 | if (!this.m_rpcHandlers.ContainsKey(method)) |
72 | { | 72 | { |
73 | this.m_rpcHandlers.Add(method, handler); | 73 | this.m_rpcHandlers.Add(method, handler); |
74 | return true; | 74 | return true; |
75 | } | 75 | } |
76 | 76 | ||
77 | //must already have a handler for that path so return false | 77 | //must already have a handler for that path so return false |
78 | return false; | 78 | return false; |
79 | } | 79 | } |
80 | 80 | ||
81 | 81 | ||
82 | public virtual void HandleRequest(Object stateinfo) | 82 | public virtual void HandleRequest(Object stateinfo) |
83 | { | 83 | { |
84 | HttpListenerContext context = (HttpListenerContext)stateinfo; | 84 | HttpListenerContext context = (HttpListenerContext)stateinfo; |
85 | 85 | ||
86 | HttpListenerRequest request = context.Request; | 86 | HttpListenerRequest request = context.Request; |
87 | HttpListenerResponse response = context.Response; | 87 | HttpListenerResponse response = context.Response; |
88 | 88 | ||
89 | response.KeepAlive = false; | 89 | response.KeepAlive = false; |
90 | response.SendChunked = false; | 90 | response.SendChunked = false; |
91 | 91 | ||
92 | string path = request.RawUrl; | 92 | string path = request.RawUrl; |
93 | string handlerKey = GetHandlerKey( request.HttpMethod, path ); | 93 | string handlerKey = GetHandlerKey( request.HttpMethod, path ); |
94 | 94 | ||
95 | IStreamHandler streamHandler; | 95 | IStreamHandler streamHandler; |
96 | 96 | ||
97 | if (TryGetStreamHandler( handlerKey, out streamHandler)) | 97 | if (TryGetStreamHandler( handlerKey, out streamHandler)) |
98 | { | 98 | { |
99 | byte[] buffer = streamHandler.Handle(path, request.InputStream); | 99 | byte[] buffer = streamHandler.Handle(path, request.InputStream); |
100 | request.InputStream.Close(); | 100 | request.InputStream.Close(); |
101 | 101 | ||
102 | response.ContentType = streamHandler.ContentType; | 102 | response.ContentType = streamHandler.ContentType; |
103 | response.ContentLength64 = buffer.LongLength; | 103 | response.ContentLength64 = buffer.LongLength; |
104 | response.OutputStream.Write(buffer, 0, buffer.Length); | 104 | response.OutputStream.Write(buffer, 0, buffer.Length); |
105 | response.OutputStream.Close(); | 105 | response.OutputStream.Close(); |
106 | } | 106 | } |
107 | else | 107 | else |
108 | { | 108 | { |
109 | HandleXmlRpcRequests(request, response); | 109 | HandleXmlRpcRequests(request, response); |
110 | } | 110 | } |
111 | } | 111 | } |
112 | 112 | ||
113 | private bool TryGetStreamHandler(string handlerKey, out IStreamHandler streamHandler) | 113 | private bool TryGetStreamHandler(string handlerKey, out IStreamHandler streamHandler) |
114 | { | 114 | { |
115 | string bestMatch = null; | 115 | string bestMatch = null; |
116 | 116 | ||
117 | foreach (string pattern in m_streamHandlers.Keys) | 117 | foreach (string pattern in m_streamHandlers.Keys) |
118 | { | 118 | { |
119 | if (handlerKey.StartsWith(pattern)) | 119 | if (handlerKey.StartsWith(pattern)) |
120 | { | 120 | { |
121 | if (String.IsNullOrEmpty(bestMatch) || pattern.Length > bestMatch.Length) | 121 | if (String.IsNullOrEmpty(bestMatch) || pattern.Length > bestMatch.Length) |
122 | { | 122 | { |
123 | bestMatch = pattern; | 123 | bestMatch = pattern; |
124 | } | 124 | } |
125 | } | 125 | } |
126 | } | 126 | } |
127 | 127 | ||
128 | if (String.IsNullOrEmpty(bestMatch)) | 128 | if (String.IsNullOrEmpty(bestMatch)) |
129 | { | 129 | { |
130 | streamHandler = null; | 130 | streamHandler = null; |
131 | return false; | 131 | return false; |
132 | } | 132 | } |
133 | else | 133 | else |
134 | { | 134 | { |
135 | streamHandler = m_streamHandlers[bestMatch]; | 135 | streamHandler = m_streamHandlers[bestMatch]; |
136 | return true; | 136 | return true; |
137 | } | 137 | } |
138 | } | 138 | } |
139 | 139 | ||
140 | private void HandleXmlRpcRequests(HttpListenerRequest request, HttpListenerResponse response) | 140 | private void HandleXmlRpcRequests(HttpListenerRequest request, HttpListenerResponse response) |
141 | { | 141 | { |
142 | Stream requestStream = request.InputStream; | 142 | Stream requestStream = request.InputStream; |
143 | 143 | ||
144 | Encoding encoding = Encoding.UTF8; | 144 | Encoding encoding = Encoding.UTF8; |
145 | StreamReader reader = new StreamReader(requestStream, encoding); | 145 | StreamReader reader = new StreamReader(requestStream, encoding); |
146 | 146 | ||
147 | string requestBody = reader.ReadToEnd(); | 147 | string requestBody = reader.ReadToEnd(); |
148 | reader.Close(); | 148 | reader.Close(); |
149 | requestStream.Close(); | 149 | requestStream.Close(); |
150 | 150 | ||
151 | XmlRpcRequest xmlRprcRequest = (XmlRpcRequest)(new XmlRpcRequestDeserializer()).Deserialize(requestBody); | 151 | XmlRpcRequest xmlRprcRequest = (XmlRpcRequest)(new XmlRpcRequestDeserializer()).Deserialize(requestBody); |
152 | 152 | ||
153 | string methodName = xmlRprcRequest.MethodName; | 153 | string methodName = xmlRprcRequest.MethodName; |
154 | 154 | ||
155 | XmlRpcResponse xmlRpcResponse; | 155 | XmlRpcResponse xmlRpcResponse; |
156 | 156 | ||
157 | XmlRpcMethod method; | 157 | XmlRpcMethod method; |
158 | if (this.m_rpcHandlers.TryGetValue(methodName, out method)) | 158 | if (this.m_rpcHandlers.TryGetValue(methodName, out method)) |
159 | { | 159 | { |
160 | xmlRpcResponse = method(xmlRprcRequest); | 160 | xmlRpcResponse = method(xmlRprcRequest); |
161 | } | 161 | } |
162 | else | 162 | else |
163 | { | 163 | { |
164 | xmlRpcResponse = new XmlRpcResponse(); | 164 | xmlRpcResponse = new XmlRpcResponse(); |
165 | Hashtable unknownMethodError = new Hashtable(); | 165 | Hashtable unknownMethodError = new Hashtable(); |
166 | unknownMethodError["reason"] = "XmlRequest"; ; | 166 | unknownMethodError["reason"] = "XmlRequest"; ; |
167 | unknownMethodError["message"] = "Unknown Rpc Request ["+methodName+"]"; | 167 | unknownMethodError["message"] = "Unknown Rpc Request ["+methodName+"]"; |
168 | unknownMethodError["login"] = "false"; | 168 | unknownMethodError["login"] = "false"; |
169 | xmlRpcResponse.Value = unknownMethodError; | 169 | xmlRpcResponse.Value = unknownMethodError; |
170 | } | 170 | } |
171 | 171 | ||
172 | response.AddHeader("Content-type", "text/xml"); | 172 | response.AddHeader("Content-type", "text/xml"); |
173 | 173 | ||
174 | string responseString = XmlRpcResponseSerializer.Singleton.Serialize(xmlRpcResponse); | 174 | string responseString = XmlRpcResponseSerializer.Singleton.Serialize(xmlRpcResponse); |
175 | 175 | ||
176 | byte[] buffer = Encoding.UTF8.GetBytes(responseString); | 176 | byte[] buffer = Encoding.UTF8.GetBytes(responseString); |
177 | 177 | ||
178 | response.SendChunked = false; | 178 | response.SendChunked = false; |
179 | response.ContentLength64 = buffer.Length; | 179 | response.ContentLength64 = buffer.Length; |
180 | response.ContentEncoding = Encoding.UTF8; | 180 | response.ContentEncoding = Encoding.UTF8; |
181 | 181 | ||
182 | response.OutputStream.Write(buffer, 0, buffer.Length); | 182 | response.OutputStream.Write(buffer, 0, buffer.Length); |
183 | response.OutputStream.Close(); | 183 | response.OutputStream.Close(); |
184 | } | 184 | } |
185 | 185 | ||
186 | public void Start() | 186 | public void Start() |
187 | { | 187 | { |
188 | MainLog.Instance.WriteLine(LogPriority.LOW, "BaseHttpServer.cs: Starting up HTTP Server"); | 188 | MainLog.Instance.WriteLine(LogPriority.LOW, "BaseHttpServer.cs: Starting up HTTP Server"); |
189 | 189 | ||
190 | m_workerThread = new Thread(new ThreadStart(StartHTTP)); | 190 | m_workerThread = new Thread(new ThreadStart(StartHTTP)); |
191 | m_workerThread.IsBackground = true; | 191 | m_workerThread.IsBackground = true; |
192 | m_workerThread.Start(); | 192 | m_workerThread.Start(); |
193 | } | 193 | } |
194 | 194 | ||
195 | private void StartHTTP() | 195 | private void StartHTTP() |
196 | { | 196 | { |
197 | try | 197 | try |
198 | { | 198 | { |
199 | MainLog.Instance.WriteLine(LogPriority.LOW, "BaseHttpServer.cs: StartHTTP() - Spawned main thread OK"); | 199 | MainLog.Instance.WriteLine(LogPriority.LOW, "BaseHttpServer.cs: StartHTTP() - Spawned main thread OK"); |
200 | m_httpListener = new HttpListener(); | 200 | m_httpListener = new HttpListener(); |
201 | 201 | ||
202 | m_httpListener.Prefixes.Add("http://+:" + m_port + "/"); | 202 | m_httpListener.Prefixes.Add("http://+:" + m_port + "/"); |
203 | m_httpListener.Start(); | 203 | m_httpListener.Start(); |
204 | 204 | ||
205 | HttpListenerContext context; | 205 | HttpListenerContext context; |
206 | while (true) | 206 | while (true) |
207 | { | 207 | { |
208 | context = m_httpListener.GetContext(); | 208 | context = m_httpListener.GetContext(); |
209 | ThreadPool.QueueUserWorkItem(new WaitCallback(HandleRequest), context); | 209 | ThreadPool.QueueUserWorkItem(new WaitCallback(HandleRequest), context); |
210 | } | 210 | } |
211 | } | 211 | } |
212 | catch (Exception e) | 212 | catch (Exception e) |
213 | { | 213 | { |
214 | MainLog.Instance.WriteLine(LogPriority.MEDIUM, e.Message); | 214 | MainLog.Instance.WriteLine(LogPriority.MEDIUM, e.Message); |
215 | } | 215 | } |
216 | } | 216 | } |
217 | 217 | ||
218 | 218 | ||
219 | public void RemoveStreamHandler(string httpMethod, string path) | 219 | public void RemoveStreamHandler(string httpMethod, string path) |
220 | { | 220 | { |
221 | m_streamHandlers.Remove(GetHandlerKey(httpMethod, path)); | 221 | m_streamHandlers.Remove(GetHandlerKey(httpMethod, path)); |
222 | } | 222 | } |
223 | } | 223 | } |
224 | } | 224 | } |
diff --git a/OpenSim/Framework/Servers/BaseStreamHandler.cs b/OpenSim/Framework/Servers/BaseStreamHandler.cs index 0d9c674..0c714e6 100644 --- a/OpenSim/Framework/Servers/BaseStreamHandler.cs +++ b/OpenSim/Framework/Servers/BaseStreamHandler.cs | |||
@@ -1,40 +1,40 @@ | |||
1 | using System; | 1 | using System; |
2 | using System.Collections.Generic; | 2 | using System.Collections.Generic; |
3 | using System.Text; | 3 | using System.Text; |
4 | using System.IO; | 4 | using System.IO; |
5 | 5 | ||
6 | namespace OpenSim.Framework.Servers | 6 | namespace OpenSim.Framework.Servers |
7 | { | 7 | { |
8 | public abstract class BaseStreamHandler : IStreamHandler | 8 | public abstract class BaseStreamHandler : IStreamHandler |
9 | { | 9 | { |
10 | virtual public string ContentType | 10 | virtual public string ContentType |
11 | { | 11 | { |
12 | get { return "application/xml"; } | 12 | get { return "application/xml"; } |
13 | } | 13 | } |
14 | 14 | ||
15 | private string m_httpMethod; | 15 | private string m_httpMethod; |
16 | virtual public string HttpMethod | 16 | virtual public string HttpMethod |
17 | { | 17 | { |
18 | get { return m_httpMethod; } | 18 | get { return m_httpMethod; } |
19 | } | 19 | } |
20 | 20 | ||
21 | private string m_path; | 21 | private string m_path; |
22 | virtual public string Path | 22 | virtual public string Path |
23 | { | 23 | { |
24 | get { return m_path; } | 24 | get { return m_path; } |
25 | } | 25 | } |
26 | 26 | ||
27 | protected string GetParam( string path ) | 27 | protected string GetParam( string path ) |
28 | { | 28 | { |
29 | return path.Substring( m_path.Length ); | 29 | return path.Substring( m_path.Length ); |
30 | } | 30 | } |
31 | 31 | ||
32 | public abstract byte[] Handle(string path, Stream request); | 32 | public abstract byte[] Handle(string path, Stream request); |
33 | 33 | ||
34 | protected BaseStreamHandler(string httpMethod, string path) | 34 | protected BaseStreamHandler(string httpMethod, string path) |
35 | { | 35 | { |
36 | m_httpMethod = httpMethod; | 36 | m_httpMethod = httpMethod; |
37 | m_path = path; | 37 | m_path = path; |
38 | } | 38 | } |
39 | } | 39 | } |
40 | } | 40 | } |
diff --git a/OpenSim/Framework/Servers/BinaryStreamHandler.cs b/OpenSim/Framework/Servers/BinaryStreamHandler.cs index 7d4e4ce..6e512f6 100644 --- a/OpenSim/Framework/Servers/BinaryStreamHandler.cs +++ b/OpenSim/Framework/Servers/BinaryStreamHandler.cs | |||
@@ -1,49 +1,49 @@ | |||
1 | using System; | 1 | using System; |
2 | using System.Collections.Generic; | 2 | using System.Collections.Generic; |
3 | using System.Text; | 3 | using System.Text; |
4 | using System.IO; | 4 | using System.IO; |
5 | 5 | ||
6 | namespace OpenSim.Framework.Servers | 6 | namespace OpenSim.Framework.Servers |
7 | { | 7 | { |
8 | public delegate string BinaryMethod(byte[] data, string path, string param); | 8 | public delegate string BinaryMethod(byte[] data, string path, string param); |
9 | 9 | ||
10 | public class BinaryStreamHandler : BaseStreamHandler | 10 | public class BinaryStreamHandler : BaseStreamHandler |
11 | { | 11 | { |
12 | BinaryMethod m_method; | 12 | BinaryMethod m_method; |
13 | 13 | ||
14 | override public byte[] Handle(string path, Stream request) | 14 | override public byte[] Handle(string path, Stream request) |
15 | { | 15 | { |
16 | byte[] data = ReadFully(request); | 16 | byte[] data = ReadFully(request); |
17 | string param = GetParam(path); | 17 | string param = GetParam(path); |
18 | string responseString = m_method(data, path, param); | 18 | string responseString = m_method(data, path, param); |
19 | 19 | ||
20 | return Encoding.UTF8.GetBytes(responseString); | 20 | return Encoding.UTF8.GetBytes(responseString); |
21 | } | 21 | } |
22 | 22 | ||
23 | public BinaryStreamHandler(string httpMethod, string path, BinaryMethod binaryMethod) | 23 | public BinaryStreamHandler(string httpMethod, string path, BinaryMethod binaryMethod) |
24 | : base(httpMethod, path) | 24 | : base(httpMethod, path) |
25 | { | 25 | { |
26 | m_method = binaryMethod; | 26 | m_method = binaryMethod; |
27 | } | 27 | } |
28 | 28 | ||
29 | private byte[] ReadFully(Stream stream) | 29 | private byte[] ReadFully(Stream stream) |
30 | { | 30 | { |
31 | byte[] buffer = new byte[32768]; | 31 | byte[] buffer = new byte[32768]; |
32 | using (MemoryStream ms = new MemoryStream()) | 32 | using (MemoryStream ms = new MemoryStream()) |
33 | { | 33 | { |
34 | while (true) | 34 | while (true) |
35 | { | 35 | { |
36 | int read = stream.Read(buffer, 0, buffer.Length); | 36 | int read = stream.Read(buffer, 0, buffer.Length); |
37 | 37 | ||
38 | if (read <= 0) | 38 | if (read <= 0) |
39 | { | 39 | { |
40 | return ms.ToArray(); | 40 | return ms.ToArray(); |
41 | } | 41 | } |
42 | 42 | ||
43 | ms.Write(buffer, 0, read); | 43 | ms.Write(buffer, 0, read); |
44 | } | 44 | } |
45 | } | 45 | } |
46 | } | 46 | } |
47 | } | 47 | } |
48 | 48 | ||
49 | } | 49 | } |
diff --git a/OpenSim/Framework/Servers/CheckSumServer.cs b/OpenSim/Framework/Servers/CheckSumServer.cs index 89ec095..b1fa5cd 100644 --- a/OpenSim/Framework/Servers/CheckSumServer.cs +++ b/OpenSim/Framework/Servers/CheckSumServer.cs | |||
@@ -1,127 +1,127 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | namespace OpenSim.Framework.Servers | 28 | namespace OpenSim.Framework.Servers |
29 | {/* | 29 | {/* |
30 | public class CheckSumServer : UDPServerBase | 30 | public class CheckSumServer : UDPServerBase |
31 | { | 31 | { |
32 | //protected ConsoleBase m_log; | 32 | //protected ConsoleBase m_log; |
33 | 33 | ||
34 | public CheckSumServer(int port) | 34 | public CheckSumServer(int port) |
35 | : base(port) | 35 | : base(port) |
36 | { | 36 | { |
37 | } | 37 | } |
38 | 38 | ||
39 | protected override void OnReceivedData(IAsyncResult result) | 39 | protected override void OnReceivedData(IAsyncResult result) |
40 | { | 40 | { |
41 | ipeSender = new IPEndPoint(IPAddress.Any, 0); | 41 | ipeSender = new IPEndPoint(IPAddress.Any, 0); |
42 | epSender = (EndPoint)ipeSender; | 42 | epSender = (EndPoint)ipeSender; |
43 | Packet packet = null; | 43 | Packet packet = null; |
44 | int numBytes = Server.EndReceiveFrom(result, ref epSender); | 44 | int numBytes = Server.EndReceiveFrom(result, ref epSender); |
45 | int packetEnd = numBytes - 1; | 45 | int packetEnd = numBytes - 1; |
46 | 46 | ||
47 | packet = Packet.BuildPacket(RecvBuffer, ref packetEnd, ZeroBuffer); | 47 | packet = Packet.BuildPacket(RecvBuffer, ref packetEnd, ZeroBuffer); |
48 | 48 | ||
49 | if (packet.Type == PacketType.SecuredTemplateChecksumRequest) | 49 | if (packet.Type == PacketType.SecuredTemplateChecksumRequest) |
50 | { | 50 | { |
51 | SecuredTemplateChecksumRequestPacket checksum = (SecuredTemplateChecksumRequestPacket)packet; | 51 | SecuredTemplateChecksumRequestPacket checksum = (SecuredTemplateChecksumRequestPacket)packet; |
52 | TemplateChecksumReplyPacket checkreply = new TemplateChecksumReplyPacket(); | 52 | TemplateChecksumReplyPacket checkreply = new TemplateChecksumReplyPacket(); |
53 | checkreply.DataBlock.Checksum = 3220703154;//180572585; | 53 | checkreply.DataBlock.Checksum = 3220703154;//180572585; |
54 | checkreply.DataBlock.Flags = 0; | 54 | checkreply.DataBlock.Flags = 0; |
55 | checkreply.DataBlock.MajorVersion = 1; | 55 | checkreply.DataBlock.MajorVersion = 1; |
56 | checkreply.DataBlock.MinorVersion = 15; | 56 | checkreply.DataBlock.MinorVersion = 15; |
57 | checkreply.DataBlock.PatchVersion = 0; | 57 | checkreply.DataBlock.PatchVersion = 0; |
58 | checkreply.DataBlock.ServerVersion = 0; | 58 | checkreply.DataBlock.ServerVersion = 0; |
59 | checkreply.TokenBlock.Token = checksum.TokenBlock.Token; | 59 | checkreply.TokenBlock.Token = checksum.TokenBlock.Token; |
60 | this.SendPacket(checkreply, epSender); | 60 | this.SendPacket(checkreply, epSender); |
61 | 61 | ||
62 | /* | 62 | /* |
63 | //if we wanted to echo the the checksum/ version from the client (so that any client worked) | 63 | //if we wanted to echo the the checksum/ version from the client (so that any client worked) |
64 | SecuredTemplateChecksumRequestPacket checkrequest = new SecuredTemplateChecksumRequestPacket(); | 64 | SecuredTemplateChecksumRequestPacket checkrequest = new SecuredTemplateChecksumRequestPacket(); |
65 | checkrequest.TokenBlock.Token = checksum.TokenBlock.Token; | 65 | checkrequest.TokenBlock.Token = checksum.TokenBlock.Token; |
66 | this.SendPacket(checkrequest, epSender); | 66 | this.SendPacket(checkrequest, epSender); |
67 | 67 | ||
68 | } | 68 | } |
69 | else if (packet.Type == PacketType.TemplateChecksumReply) | 69 | else if (packet.Type == PacketType.TemplateChecksumReply) |
70 | { | 70 | { |
71 | //echo back the client checksum reply (Hegemon's method) | 71 | //echo back the client checksum reply (Hegemon's method) |
72 | TemplateChecksumReplyPacket checksum2 = (TemplateChecksumReplyPacket)packet; | 72 | TemplateChecksumReplyPacket checksum2 = (TemplateChecksumReplyPacket)packet; |
73 | TemplateChecksumReplyPacket checkreply2 = new TemplateChecksumReplyPacket(); | 73 | TemplateChecksumReplyPacket checkreply2 = new TemplateChecksumReplyPacket(); |
74 | checkreply2.DataBlock.Checksum = checksum2.DataBlock.Checksum; | 74 | checkreply2.DataBlock.Checksum = checksum2.DataBlock.Checksum; |
75 | checkreply2.DataBlock.Flags = checksum2.DataBlock.Flags; | 75 | checkreply2.DataBlock.Flags = checksum2.DataBlock.Flags; |
76 | checkreply2.DataBlock.MajorVersion = checksum2.DataBlock.MajorVersion; | 76 | checkreply2.DataBlock.MajorVersion = checksum2.DataBlock.MajorVersion; |
77 | checkreply2.DataBlock.MinorVersion = checksum2.DataBlock.MinorVersion; | 77 | checkreply2.DataBlock.MinorVersion = checksum2.DataBlock.MinorVersion; |
78 | checkreply2.DataBlock.PatchVersion = checksum2.DataBlock.PatchVersion; | 78 | checkreply2.DataBlock.PatchVersion = checksum2.DataBlock.PatchVersion; |
79 | checkreply2.DataBlock.ServerVersion = checksum2.DataBlock.ServerVersion; | 79 | checkreply2.DataBlock.ServerVersion = checksum2.DataBlock.ServerVersion; |
80 | checkreply2.TokenBlock.Token = checksum2.TokenBlock.Token; | 80 | checkreply2.TokenBlock.Token = checksum2.TokenBlock.Token; |
81 | this.SendPacket(checkreply2, epSender); | 81 | this.SendPacket(checkreply2, epSender); |
82 | } | 82 | } |
83 | else | 83 | else |
84 | { | 84 | { |
85 | } | 85 | } |
86 | 86 | ||
87 | Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null); | 87 | Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null); |
88 | } | 88 | } |
89 | 89 | ||
90 | private void SendPacket(Packet Pack, EndPoint endp) | 90 | private void SendPacket(Packet Pack, EndPoint endp) |
91 | { | 91 | { |
92 | if (!Pack.Header.Resent) | 92 | if (!Pack.Header.Resent) |
93 | { | 93 | { |
94 | Pack.Header.Sequence = 1; | 94 | Pack.Header.Sequence = 1; |
95 | } | 95 | } |
96 | 96 | ||
97 | byte[] ZeroOutBuffer = new byte[4096]; | 97 | byte[] ZeroOutBuffer = new byte[4096]; |
98 | byte[] sendbuffer; | 98 | byte[] sendbuffer; |
99 | sendbuffer = Pack.ToBytes(); | 99 | sendbuffer = Pack.ToBytes(); |
100 | 100 | ||
101 | try | 101 | try |
102 | { | 102 | { |
103 | if (Pack.Header.Zerocoded) | 103 | if (Pack.Header.Zerocoded) |
104 | { | 104 | { |
105 | int packetsize = Helpers.ZeroEncode(sendbuffer, sendbuffer.Length, ZeroOutBuffer); | 105 | int packetsize = Helpers.ZeroEncode(sendbuffer, sendbuffer.Length, ZeroOutBuffer); |
106 | this.SendPackTo(ZeroOutBuffer, packetsize, SocketFlags.None, endp); | 106 | this.SendPackTo(ZeroOutBuffer, packetsize, SocketFlags.None, endp); |
107 | } | 107 | } |
108 | else | 108 | else |
109 | { | 109 | { |
110 | this.SendPackTo(sendbuffer, sendbuffer.Length, SocketFlags.None, endp); | 110 | this.SendPackTo(sendbuffer, sendbuffer.Length, SocketFlags.None, endp); |
111 | } | 111 | } |
112 | } | 112 | } |
113 | catch (Exception) | 113 | catch (Exception) |
114 | { | 114 | { |
115 | OpenSim.Framework.Console.MainLog.Instance.Warn("OpenSimClient.cs:ProcessOutPacket() - WARNING: Socket exception occurred on connection "); | 115 | OpenSim.Framework.Console.MainLog.Instance.Warn("OpenSimClient.cs:ProcessOutPacket() - WARNING: Socket exception occurred on connection "); |
116 | 116 | ||
117 | } | 117 | } |
118 | } | 118 | } |
119 | 119 | ||
120 | private void SendPackTo(byte[] buffer, int size, SocketFlags flags, EndPoint endp) | 120 | private void SendPackTo(byte[] buffer, int size, SocketFlags flags, EndPoint endp) |
121 | { | 121 | { |
122 | this.Server.SendTo(buffer, size, flags, endp); | 122 | this.Server.SendTo(buffer, size, flags, endp); |
123 | } | 123 | } |
124 | * } | 124 | * } |
125 | */ | 125 | */ |
126 | 126 | ||
127 | } \ No newline at end of file | 127 | } \ No newline at end of file |
diff --git a/OpenSim/Framework/Servers/IStreamHandler.cs b/OpenSim/Framework/Servers/IStreamHandler.cs index 6cab40d..8858c99 100644 --- a/OpenSim/Framework/Servers/IStreamHandler.cs +++ b/OpenSim/Framework/Servers/IStreamHandler.cs | |||
@@ -1,22 +1,22 @@ | |||
1 | using System; | 1 | using System; |
2 | using System.Collections.Generic; | 2 | using System.Collections.Generic; |
3 | using System.Text; | 3 | using System.Text; |
4 | using System.IO; | 4 | using System.IO; |
5 | 5 | ||
6 | namespace OpenSim.Framework.Servers | 6 | namespace OpenSim.Framework.Servers |
7 | { | 7 | { |
8 | public interface IStreamHandler | 8 | public interface IStreamHandler |
9 | { | 9 | { |
10 | // Handle request stream, return byte array | 10 | // Handle request stream, return byte array |
11 | byte[] Handle(string path, Stream request ); | 11 | byte[] Handle(string path, Stream request ); |
12 | 12 | ||
13 | // Return response content type | 13 | // Return response content type |
14 | string ContentType { get; } | 14 | string ContentType { get; } |
15 | 15 | ||
16 | // Return required http method | 16 | // Return required http method |
17 | string HttpMethod { get;} | 17 | string HttpMethod { get;} |
18 | 18 | ||
19 | // Return path | 19 | // Return path |
20 | string Path { get; } | 20 | string Path { get; } |
21 | } | 21 | } |
22 | } | 22 | } |
diff --git a/OpenSim/Framework/Servers/RestMethod.cs b/OpenSim/Framework/Servers/RestMethod.cs index c6cb230..0c2624b 100644 --- a/OpenSim/Framework/Servers/RestMethod.cs +++ b/OpenSim/Framework/Servers/RestMethod.cs | |||
@@ -1,31 +1,31 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | namespace OpenSim.Framework.Servers | 28 | namespace OpenSim.Framework.Servers |
29 | { | 29 | { |
30 | public delegate string RestMethod( string request, string path, string param ); | 30 | public delegate string RestMethod( string request, string path, string param ); |
31 | } | 31 | } |
diff --git a/OpenSim/Framework/Servers/RestStreamHandler.cs b/OpenSim/Framework/Servers/RestStreamHandler.cs index 1b3b41c..6753a06 100644 --- a/OpenSim/Framework/Servers/RestStreamHandler.cs +++ b/OpenSim/Framework/Servers/RestStreamHandler.cs | |||
@@ -1,31 +1,31 @@ | |||
1 | using System; | 1 | using System; |
2 | using System.Collections.Generic; | 2 | using System.Collections.Generic; |
3 | using System.Text; | 3 | using System.Text; |
4 | using System.IO; | 4 | using System.IO; |
5 | 5 | ||
6 | namespace OpenSim.Framework.Servers | 6 | namespace OpenSim.Framework.Servers |
7 | { | 7 | { |
8 | public class RestStreamHandler : BaseStreamHandler | 8 | public class RestStreamHandler : BaseStreamHandler |
9 | { | 9 | { |
10 | RestMethod m_restMethod; | 10 | RestMethod m_restMethod; |
11 | 11 | ||
12 | override public byte[] Handle(string path, Stream request ) | 12 | override public byte[] Handle(string path, Stream request ) |
13 | { | 13 | { |
14 | Encoding encoding = Encoding.UTF8; | 14 | Encoding encoding = Encoding.UTF8; |
15 | StreamReader streamReader = new StreamReader(request, encoding); | 15 | StreamReader streamReader = new StreamReader(request, encoding); |
16 | 16 | ||
17 | string requestBody = streamReader.ReadToEnd(); | 17 | string requestBody = streamReader.ReadToEnd(); |
18 | streamReader.Close(); | 18 | streamReader.Close(); |
19 | 19 | ||
20 | string param = GetParam(path); | 20 | string param = GetParam(path); |
21 | string responseString = m_restMethod(requestBody, path, param ); | 21 | string responseString = m_restMethod(requestBody, path, param ); |
22 | 22 | ||
23 | return Encoding.UTF8.GetBytes(responseString); | 23 | return Encoding.UTF8.GetBytes(responseString); |
24 | } | 24 | } |
25 | 25 | ||
26 | public RestStreamHandler(string httpMethod, string path, RestMethod restMethod) : base( httpMethod, path ) | 26 | public RestStreamHandler(string httpMethod, string path, RestMethod restMethod) : base( httpMethod, path ) |
27 | { | 27 | { |
28 | m_restMethod = restMethod; | 28 | m_restMethod = restMethod; |
29 | } | 29 | } |
30 | } | 30 | } |
31 | } | 31 | } |
diff --git a/OpenSim/Framework/Servers/UDPServerBase.cs b/OpenSim/Framework/Servers/UDPServerBase.cs index 508eb9d..8113207 100644 --- a/OpenSim/Framework/Servers/UDPServerBase.cs +++ b/OpenSim/Framework/Servers/UDPServerBase.cs | |||
@@ -1,87 +1,87 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using System; | 28 | using System; |
29 | using System.Net; | 29 | using System.Net; |
30 | using System.Net.Sockets; | 30 | using System.Net.Sockets; |
31 | using libsecondlife.Packets; | 31 | using libsecondlife.Packets; |
32 | 32 | ||
33 | namespace OpenSim.Framework.Servers | 33 | namespace OpenSim.Framework.Servers |
34 | { | 34 | { |
35 | public class UDPServerBase | 35 | public class UDPServerBase |
36 | { | 36 | { |
37 | public Socket Server; | 37 | public Socket Server; |
38 | protected IPEndPoint ServerIncoming; | 38 | protected IPEndPoint ServerIncoming; |
39 | protected byte[] RecvBuffer = new byte[4096]; | 39 | protected byte[] RecvBuffer = new byte[4096]; |
40 | protected byte[] ZeroBuffer = new byte[8192]; | 40 | protected byte[] ZeroBuffer = new byte[8192]; |
41 | protected IPEndPoint ipeSender; | 41 | protected IPEndPoint ipeSender; |
42 | protected EndPoint epSender; | 42 | protected EndPoint epSender; |
43 | protected AsyncCallback ReceivedData; | 43 | protected AsyncCallback ReceivedData; |
44 | protected int listenPort; | 44 | protected int listenPort; |
45 | 45 | ||
46 | public UDPServerBase(int port) | 46 | public UDPServerBase(int port) |
47 | { | 47 | { |
48 | listenPort = port; | 48 | listenPort = port; |
49 | } | 49 | } |
50 | 50 | ||
51 | protected virtual void OnReceivedData(IAsyncResult result) | 51 | protected virtual void OnReceivedData(IAsyncResult result) |
52 | { | 52 | { |
53 | ipeSender = new IPEndPoint(IPAddress.Parse("0.0.0.0"), 0); | 53 | ipeSender = new IPEndPoint(IPAddress.Parse("0.0.0.0"), 0); |
54 | epSender = (EndPoint)ipeSender; | 54 | epSender = (EndPoint)ipeSender; |
55 | Packet packet = null; | 55 | Packet packet = null; |
56 | int numBytes = Server.EndReceiveFrom(result, ref epSender); | 56 | int numBytes = Server.EndReceiveFrom(result, ref epSender); |
57 | int packetEnd = numBytes - 1; | 57 | int packetEnd = numBytes - 1; |
58 | 58 | ||
59 | packet = Packet.BuildPacket(RecvBuffer, ref packetEnd, ZeroBuffer); | 59 | packet = Packet.BuildPacket(RecvBuffer, ref packetEnd, ZeroBuffer); |
60 | 60 | ||
61 | Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null); | 61 | Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null); |
62 | } | 62 | } |
63 | 63 | ||
64 | protected virtual void AddNewClient(Packet packet) | 64 | protected virtual void AddNewClient(Packet packet) |
65 | { | 65 | { |
66 | } | 66 | } |
67 | 67 | ||
68 | public virtual void ServerListener() | 68 | public virtual void ServerListener() |
69 | { | 69 | { |
70 | 70 | ||
71 | ServerIncoming = new IPEndPoint(IPAddress.Parse("0.0.0.0"), listenPort); | 71 | ServerIncoming = new IPEndPoint(IPAddress.Parse("0.0.0.0"), listenPort); |
72 | Server = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); | 72 | Server = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); |
73 | Server.Bind(ServerIncoming); | 73 | Server.Bind(ServerIncoming); |
74 | 74 | ||
75 | ipeSender = new IPEndPoint(IPAddress.Parse("0.0.0.0"), 0); | 75 | ipeSender = new IPEndPoint(IPAddress.Parse("0.0.0.0"), 0); |
76 | epSender = (EndPoint)ipeSender; | 76 | epSender = (EndPoint)ipeSender; |
77 | ReceivedData = new AsyncCallback(this.OnReceivedData); | 77 | ReceivedData = new AsyncCallback(this.OnReceivedData); |
78 | Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null); | 78 | Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null); |
79 | } | 79 | } |
80 | 80 | ||
81 | public virtual void SendPacketTo(byte[] buffer, int size, SocketFlags flags, uint circuitcode) | 81 | public virtual void SendPacketTo(byte[] buffer, int size, SocketFlags flags, uint circuitcode) |
82 | { | 82 | { |
83 | 83 | ||
84 | } | 84 | } |
85 | } | 85 | } |
86 | } | 86 | } |
87 | 87 | ||
diff --git a/OpenSim/Framework/Servers/XmlRpcMethod.cs b/OpenSim/Framework/Servers/XmlRpcMethod.cs index b76ac51..b8abecf 100644 --- a/OpenSim/Framework/Servers/XmlRpcMethod.cs +++ b/OpenSim/Framework/Servers/XmlRpcMethod.cs | |||
@@ -1,33 +1,33 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using Nwc.XmlRpc; | 28 | using Nwc.XmlRpc; |
29 | 29 | ||
30 | namespace OpenSim.Framework.Servers | 30 | namespace OpenSim.Framework.Servers |
31 | { | 31 | { |
32 | public delegate XmlRpcResponse XmlRpcMethod( XmlRpcRequest request ); | 32 | public delegate XmlRpcResponse XmlRpcMethod( XmlRpcRequest request ); |
33 | } | 33 | } |
diff --git a/OpenSim/Framework/UserManager/LoginResponse.cs b/OpenSim/Framework/UserManager/LoginResponse.cs index abcbd48..d3dfd5b 100644 --- a/OpenSim/Framework/UserManager/LoginResponse.cs +++ b/OpenSim/Framework/UserManager/LoginResponse.cs | |||
@@ -1,643 +1,643 @@ | |||
1 | using System; | 1 | using System; |
2 | using System.Collections; | 2 | using System.Collections; |
3 | using libsecondlife; | 3 | using libsecondlife; |
4 | using Nwc.XmlRpc; | 4 | using Nwc.XmlRpc; |
5 | using OpenSim.Framework.Console; | 5 | using OpenSim.Framework.Console; |
6 | 6 | ||
7 | namespace OpenSim.Framework.UserManagement | 7 | namespace OpenSim.Framework.UserManagement |
8 | { | 8 | { |
9 | 9 | ||
10 | /// <summary> | 10 | /// <summary> |
11 | /// A temp class to handle login response. | 11 | /// A temp class to handle login response. |
12 | /// Should make use of UserProfileManager where possible. | 12 | /// Should make use of UserProfileManager where possible. |
13 | /// </summary> | 13 | /// </summary> |
14 | 14 | ||
15 | public class LoginResponse | 15 | public class LoginResponse |
16 | { | 16 | { |
17 | private Hashtable loginFlagsHash; | 17 | private Hashtable loginFlagsHash; |
18 | private Hashtable globalTexturesHash; | 18 | private Hashtable globalTexturesHash; |
19 | private Hashtable loginError; | 19 | private Hashtable loginError; |
20 | private Hashtable eventCategoriesHash; | 20 | private Hashtable eventCategoriesHash; |
21 | private Hashtable uiConfigHash; | 21 | private Hashtable uiConfigHash; |
22 | private Hashtable classifiedCategoriesHash; | 22 | private Hashtable classifiedCategoriesHash; |
23 | 23 | ||
24 | private ArrayList loginFlags; | 24 | private ArrayList loginFlags; |
25 | private ArrayList globalTextures; | 25 | private ArrayList globalTextures; |
26 | private ArrayList eventCategories; | 26 | private ArrayList eventCategories; |
27 | private ArrayList uiConfig; | 27 | private ArrayList uiConfig; |
28 | private ArrayList classifiedCategories; | 28 | private ArrayList classifiedCategories; |
29 | private ArrayList inventoryRoot; | 29 | private ArrayList inventoryRoot; |
30 | private ArrayList initialOutfit; | 30 | private ArrayList initialOutfit; |
31 | private ArrayList agentInventory; | 31 | private ArrayList agentInventory; |
32 | 32 | ||
33 | private UserInfo userProfile; | 33 | private UserInfo userProfile; |
34 | 34 | ||
35 | private LLUUID agentID; | 35 | private LLUUID agentID; |
36 | private LLUUID sessionID; | 36 | private LLUUID sessionID; |
37 | private LLUUID secureSessionID; | 37 | private LLUUID secureSessionID; |
38 | 38 | ||
39 | // Login Flags | 39 | // Login Flags |
40 | private string dst; | 40 | private string dst; |
41 | private string stipendSinceLogin; | 41 | private string stipendSinceLogin; |
42 | private string gendered; | 42 | private string gendered; |
43 | private string everLoggedIn; | 43 | private string everLoggedIn; |
44 | private string login; | 44 | private string login; |
45 | private int simPort; | 45 | private int simPort; |
46 | private string simAddress; | 46 | private string simAddress; |
47 | private string agentAccess; | 47 | private string agentAccess; |
48 | private Int32 circuitCode; | 48 | private Int32 circuitCode; |
49 | private uint regionX; | 49 | private uint regionX; |
50 | private uint regionY; | 50 | private uint regionY; |
51 | 51 | ||
52 | // Login | 52 | // Login |
53 | private string firstname; | 53 | private string firstname; |
54 | private string lastname; | 54 | private string lastname; |
55 | 55 | ||
56 | // Global Textures | 56 | // Global Textures |
57 | private string sunTexture; | 57 | private string sunTexture; |
58 | private string cloudTexture; | 58 | private string cloudTexture; |
59 | private string moonTexture; | 59 | private string moonTexture; |
60 | 60 | ||
61 | // Error Flags | 61 | // Error Flags |
62 | private string errorReason; | 62 | private string errorReason; |
63 | private string errorMessage; | 63 | private string errorMessage; |
64 | 64 | ||
65 | // Response | 65 | // Response |
66 | private XmlRpcResponse xmlRpcResponse; | 66 | private XmlRpcResponse xmlRpcResponse; |
67 | private XmlRpcResponse defaultXmlRpcResponse; | 67 | private XmlRpcResponse defaultXmlRpcResponse; |
68 | 68 | ||
69 | private string welcomeMessage; | 69 | private string welcomeMessage; |
70 | private string startLocation; | 70 | private string startLocation; |
71 | private string allowFirstLife; | 71 | private string allowFirstLife; |
72 | private string home; | 72 | private string home; |
73 | private string seedCapability; | 73 | private string seedCapability; |
74 | private string lookAt; | 74 | private string lookAt; |
75 | 75 | ||
76 | public LoginResponse() | 76 | public LoginResponse() |
77 | { | 77 | { |
78 | this.loginFlags = new ArrayList(); | 78 | this.loginFlags = new ArrayList(); |
79 | this.globalTextures = new ArrayList(); | 79 | this.globalTextures = new ArrayList(); |
80 | this.eventCategories = new ArrayList(); | 80 | this.eventCategories = new ArrayList(); |
81 | this.uiConfig = new ArrayList(); | 81 | this.uiConfig = new ArrayList(); |
82 | this.classifiedCategories = new ArrayList(); | 82 | this.classifiedCategories = new ArrayList(); |
83 | 83 | ||
84 | this.loginError = new Hashtable(); | 84 | this.loginError = new Hashtable(); |
85 | this.eventCategoriesHash = new Hashtable(); | 85 | this.eventCategoriesHash = new Hashtable(); |
86 | this.classifiedCategoriesHash = new Hashtable(); | 86 | this.classifiedCategoriesHash = new Hashtable(); |
87 | this.uiConfigHash = new Hashtable(); | 87 | this.uiConfigHash = new Hashtable(); |
88 | 88 | ||
89 | this.defaultXmlRpcResponse = new XmlRpcResponse(); | 89 | this.defaultXmlRpcResponse = new XmlRpcResponse(); |
90 | this.userProfile = new UserInfo(); | 90 | this.userProfile = new UserInfo(); |
91 | this.inventoryRoot = new ArrayList(); | 91 | this.inventoryRoot = new ArrayList(); |
92 | this.initialOutfit = new ArrayList(); | 92 | this.initialOutfit = new ArrayList(); |
93 | this.agentInventory = new ArrayList(); | 93 | this.agentInventory = new ArrayList(); |
94 | 94 | ||
95 | this.xmlRpcResponse = new XmlRpcResponse(); | 95 | this.xmlRpcResponse = new XmlRpcResponse(); |
96 | this.defaultXmlRpcResponse = new XmlRpcResponse(); | 96 | this.defaultXmlRpcResponse = new XmlRpcResponse(); |
97 | 97 | ||
98 | this.SetDefaultValues(); | 98 | this.SetDefaultValues(); |
99 | } // LoginServer | 99 | } // LoginServer |
100 | 100 | ||
101 | public void SetDefaultValues() | 101 | public void SetDefaultValues() |
102 | { | 102 | { |
103 | this.DST = "N"; | 103 | this.DST = "N"; |
104 | this.StipendSinceLogin = "N"; | 104 | this.StipendSinceLogin = "N"; |
105 | this.Gendered = "Y"; | 105 | this.Gendered = "Y"; |
106 | this.EverLoggedIn = "Y"; | 106 | this.EverLoggedIn = "Y"; |
107 | this.login = "false"; | 107 | this.login = "false"; |
108 | this.firstname = "Test"; | 108 | this.firstname = "Test"; |
109 | this.lastname = "User"; | 109 | this.lastname = "User"; |
110 | this.agentAccess = "M"; | 110 | this.agentAccess = "M"; |
111 | this.startLocation = "last"; | 111 | this.startLocation = "last"; |
112 | this.allowFirstLife = "Y"; | 112 | this.allowFirstLife = "Y"; |
113 | 113 | ||
114 | this.SunTexture = "cce0f112-878f-4586-a2e2-a8f104bba271"; | 114 | this.SunTexture = "cce0f112-878f-4586-a2e2-a8f104bba271"; |
115 | this.CloudTexture = "fc4b9f0b-d008-45c6-96a4-01dd947ac621"; | 115 | this.CloudTexture = "fc4b9f0b-d008-45c6-96a4-01dd947ac621"; |
116 | this.MoonTexture = "fc4b9f0b-d008-45c6-96a4-01dd947ac621"; | 116 | this.MoonTexture = "fc4b9f0b-d008-45c6-96a4-01dd947ac621"; |
117 | 117 | ||
118 | this.ErrorMessage = "You have entered an invalid name/password combination. Check Caps/lock."; | 118 | this.ErrorMessage = "You have entered an invalid name/password combination. Check Caps/lock."; |
119 | this.ErrorReason = "key"; | 119 | this.ErrorReason = "key"; |
120 | this.welcomeMessage = "Welcome to OpenSim!"; | 120 | this.welcomeMessage = "Welcome to OpenSim!"; |
121 | this.seedCapability = ""; | 121 | this.seedCapability = ""; |
122 | this.home = "{'region_handle':[r" + (1000 * 256).ToString() + ",r" + (1000 * 256).ToString() + "], 'position':[r" + this.userProfile.homepos.X.ToString() + ",r" + this.userProfile.homepos.Y.ToString() + ",r" + this.userProfile.homepos.Z.ToString() + "], 'look_at':[r" + this.userProfile.homelookat.X.ToString() + ",r" + this.userProfile.homelookat.Y.ToString() + ",r" + this.userProfile.homelookat.Z.ToString() + "]}"; | 122 | this.home = "{'region_handle':[r" + (1000 * 256).ToString() + ",r" + (1000 * 256).ToString() + "], 'position':[r" + this.userProfile.homepos.X.ToString() + ",r" + this.userProfile.homepos.Y.ToString() + ",r" + this.userProfile.homepos.Z.ToString() + "], 'look_at':[r" + this.userProfile.homelookat.X.ToString() + ",r" + this.userProfile.homelookat.Y.ToString() + ",r" + this.userProfile.homelookat.Z.ToString() + "]}"; |
123 | this.lookAt = "[r0.99949799999999999756,r0.03166859999999999814,r0]"; | 123 | this.lookAt = "[r0.99949799999999999756,r0.03166859999999999814,r0]"; |
124 | this.RegionX = (uint)255232; | 124 | this.RegionX = (uint)255232; |
125 | this.RegionY = (uint)254976; | 125 | this.RegionY = (uint)254976; |
126 | 126 | ||
127 | // Classifieds; | 127 | // Classifieds; |
128 | this.AddClassifiedCategory((Int32)1, "Shopping"); | 128 | this.AddClassifiedCategory((Int32)1, "Shopping"); |
129 | this.AddClassifiedCategory((Int32)2, "Land Rental"); | 129 | this.AddClassifiedCategory((Int32)2, "Land Rental"); |
130 | this.AddClassifiedCategory((Int32)3, "Property Rental"); | 130 | this.AddClassifiedCategory((Int32)3, "Property Rental"); |
131 | this.AddClassifiedCategory((Int32)4, "Special Attraction"); | 131 | this.AddClassifiedCategory((Int32)4, "Special Attraction"); |
132 | this.AddClassifiedCategory((Int32)5, "New Products"); | 132 | this.AddClassifiedCategory((Int32)5, "New Products"); |
133 | this.AddClassifiedCategory((Int32)6, "Employment"); | 133 | this.AddClassifiedCategory((Int32)6, "Employment"); |
134 | this.AddClassifiedCategory((Int32)7, "Wanted"); | 134 | this.AddClassifiedCategory((Int32)7, "Wanted"); |
135 | this.AddClassifiedCategory((Int32)8, "Service"); | 135 | this.AddClassifiedCategory((Int32)8, "Service"); |
136 | this.AddClassifiedCategory((Int32)9, "Personal"); | 136 | this.AddClassifiedCategory((Int32)9, "Personal"); |
137 | 137 | ||
138 | 138 | ||
139 | this.SessionID = LLUUID.Random(); | 139 | this.SessionID = LLUUID.Random(); |
140 | this.SecureSessionID = LLUUID.Random(); | 140 | this.SecureSessionID = LLUUID.Random(); |
141 | this.AgentID = LLUUID.Random(); | 141 | this.AgentID = LLUUID.Random(); |
142 | 142 | ||
143 | Hashtable InitialOutfitHash = new Hashtable(); | 143 | Hashtable InitialOutfitHash = new Hashtable(); |
144 | InitialOutfitHash["folder_name"] = "Nightclub Female"; | 144 | InitialOutfitHash["folder_name"] = "Nightclub Female"; |
145 | InitialOutfitHash["gender"] = "female"; | 145 | InitialOutfitHash["gender"] = "female"; |
146 | this.initialOutfit.Add(InitialOutfitHash); | 146 | this.initialOutfit.Add(InitialOutfitHash); |
147 | 147 | ||
148 | 148 | ||
149 | } // SetDefaultValues | 149 | } // SetDefaultValues |
150 | 150 | ||
151 | #region Login Failure Methods | 151 | #region Login Failure Methods |
152 | public XmlRpcResponse GenerateFailureResponse(string reason, string message, string login) | 152 | public XmlRpcResponse GenerateFailureResponse(string reason, string message, string login) |
153 | { | 153 | { |
154 | // Overwrite any default values; | 154 | // Overwrite any default values; |
155 | this.xmlRpcResponse = new XmlRpcResponse(); | 155 | this.xmlRpcResponse = new XmlRpcResponse(); |
156 | 156 | ||
157 | // Ensure Login Failed message/reason; | 157 | // Ensure Login Failed message/reason; |
158 | this.ErrorMessage = message; | 158 | this.ErrorMessage = message; |
159 | this.ErrorReason = reason; | 159 | this.ErrorReason = reason; |
160 | 160 | ||
161 | this.loginError["reason"] = this.ErrorReason; | 161 | this.loginError["reason"] = this.ErrorReason; |
162 | this.loginError["message"] = this.ErrorMessage; | 162 | this.loginError["message"] = this.ErrorMessage; |
163 | this.loginError["login"] = login; | 163 | this.loginError["login"] = login; |
164 | this.xmlRpcResponse.Value = this.loginError; | 164 | this.xmlRpcResponse.Value = this.loginError; |
165 | return (this.xmlRpcResponse); | 165 | return (this.xmlRpcResponse); |
166 | } // GenerateResponse | 166 | } // GenerateResponse |
167 | 167 | ||
168 | public XmlRpcResponse CreateFailedResponse() | 168 | public XmlRpcResponse CreateFailedResponse() |
169 | { | 169 | { |
170 | return (this.CreateLoginFailedResponse()); | 170 | return (this.CreateLoginFailedResponse()); |
171 | } // CreateErrorConnectingToGridResponse() | 171 | } // CreateErrorConnectingToGridResponse() |
172 | 172 | ||
173 | public XmlRpcResponse CreateLoginFailedResponse() | 173 | public XmlRpcResponse CreateLoginFailedResponse() |
174 | { | 174 | { |
175 | return (this.GenerateFailureResponse("key", "Could not authenticate your avatar. Please check your username and password, and check the grid if problems persist.", "false")); | 175 | return (this.GenerateFailureResponse("key", "Could not authenticate your avatar. Please check your username and password, and check the grid if problems persist.", "false")); |
176 | } // LoginFailedResponse | 176 | } // LoginFailedResponse |
177 | 177 | ||
178 | public XmlRpcResponse CreateAlreadyLoggedInResponse() | 178 | public XmlRpcResponse CreateAlreadyLoggedInResponse() |
179 | { | 179 | { |
180 | return (this.GenerateFailureResponse("presence", "You appear to be already logged in, if this is not the case please wait for your session to timeout, if this takes longer than a few minutes please contact the grid owner", "false")); | 180 | return (this.GenerateFailureResponse("presence", "You appear to be already logged in, if this is not the case please wait for your session to timeout, if this takes longer than a few minutes please contact the grid owner", "false")); |
181 | } // CreateAlreadyLoggedInResponse() | 181 | } // CreateAlreadyLoggedInResponse() |
182 | 182 | ||
183 | public XmlRpcResponse CreateDeadRegionResponse() | 183 | public XmlRpcResponse CreateDeadRegionResponse() |
184 | { | 184 | { |
185 | return (this.GenerateFailureResponse("key", "The region you are attempting to log into is not responding. Please select another region and try again.", "false")); | 185 | return (this.GenerateFailureResponse("key", "The region you are attempting to log into is not responding. Please select another region and try again.", "false")); |
186 | } | 186 | } |
187 | 187 | ||
188 | public XmlRpcResponse CreateGridErrorResponse() | 188 | public XmlRpcResponse CreateGridErrorResponse() |
189 | { | 189 | { |
190 | return (this.GenerateFailureResponse("key", "Error connecting to grid. Could not percieve credentials from login XML.", "false")); | 190 | return (this.GenerateFailureResponse("key", "Error connecting to grid. Could not percieve credentials from login XML.", "false")); |
191 | } | 191 | } |
192 | 192 | ||
193 | #endregion | 193 | #endregion |
194 | 194 | ||
195 | public XmlRpcResponse ToXmlRpcResponse() | 195 | public XmlRpcResponse ToXmlRpcResponse() |
196 | { | 196 | { |
197 | try | 197 | try |
198 | { | 198 | { |
199 | 199 | ||
200 | Hashtable responseData = new Hashtable(); | 200 | Hashtable responseData = new Hashtable(); |
201 | 201 | ||
202 | this.loginFlagsHash = new Hashtable(); | 202 | this.loginFlagsHash = new Hashtable(); |
203 | this.loginFlagsHash["daylight_savings"] = this.DST; | 203 | this.loginFlagsHash["daylight_savings"] = this.DST; |
204 | this.loginFlagsHash["stipend_since_login"] = this.StipendSinceLogin; | 204 | this.loginFlagsHash["stipend_since_login"] = this.StipendSinceLogin; |
205 | this.loginFlagsHash["gendered"] = this.Gendered; | 205 | this.loginFlagsHash["gendered"] = this.Gendered; |
206 | this.loginFlagsHash["ever_logged_in"] = this.EverLoggedIn; | 206 | this.loginFlagsHash["ever_logged_in"] = this.EverLoggedIn; |
207 | this.loginFlags.Add(this.loginFlagsHash); | 207 | this.loginFlags.Add(this.loginFlagsHash); |
208 | 208 | ||
209 | responseData["first_name"] = this.Firstname; | 209 | responseData["first_name"] = this.Firstname; |
210 | responseData["last_name"] = this.Lastname; | 210 | responseData["last_name"] = this.Lastname; |
211 | responseData["agent_access"] = this.agentAccess; | 211 | responseData["agent_access"] = this.agentAccess; |
212 | 212 | ||
213 | this.globalTexturesHash = new Hashtable(); | 213 | this.globalTexturesHash = new Hashtable(); |
214 | this.globalTexturesHash["sun_texture_id"] = this.SunTexture; | 214 | this.globalTexturesHash["sun_texture_id"] = this.SunTexture; |
215 | this.globalTexturesHash["cloud_texture_id"] = this.CloudTexture; | 215 | this.globalTexturesHash["cloud_texture_id"] = this.CloudTexture; |
216 | this.globalTexturesHash["moon_texture_id"] = this.MoonTexture; | 216 | this.globalTexturesHash["moon_texture_id"] = this.MoonTexture; |
217 | this.globalTextures.Add(this.globalTexturesHash); | 217 | this.globalTextures.Add(this.globalTexturesHash); |
218 | this.eventCategories.Add(this.eventCategoriesHash); | 218 | this.eventCategories.Add(this.eventCategoriesHash); |
219 | 219 | ||
220 | this.AddToUIConfig("allow_first_life", this.allowFirstLife); | 220 | this.AddToUIConfig("allow_first_life", this.allowFirstLife); |
221 | this.uiConfig.Add(this.uiConfigHash); | 221 | this.uiConfig.Add(this.uiConfigHash); |
222 | 222 | ||
223 | responseData["sim_port"] =(Int32) this.SimPort; | 223 | responseData["sim_port"] =(Int32) this.SimPort; |
224 | responseData["sim_ip"] = this.SimAddress; | 224 | responseData["sim_ip"] = this.SimAddress; |
225 | 225 | ||
226 | MainLog.Instance.Warn("SIM IP: " + responseData["sim_ip"] + "; SIM PORT: " + responseData["sim_port"]); | 226 | MainLog.Instance.Warn("SIM IP: " + responseData["sim_ip"] + "; SIM PORT: " + responseData["sim_port"]); |
227 | 227 | ||
228 | responseData["agent_id"] = this.AgentID.ToStringHyphenated(); | 228 | responseData["agent_id"] = this.AgentID.ToStringHyphenated(); |
229 | responseData["session_id"] = this.SessionID.ToStringHyphenated(); | 229 | responseData["session_id"] = this.SessionID.ToStringHyphenated(); |
230 | responseData["secure_session_id"] = this.SecureSessionID.ToStringHyphenated(); | 230 | responseData["secure_session_id"] = this.SecureSessionID.ToStringHyphenated(); |
231 | responseData["circuit_code"] = this.CircuitCode; | 231 | responseData["circuit_code"] = this.CircuitCode; |
232 | responseData["seconds_since_epoch"] = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; | 232 | responseData["seconds_since_epoch"] = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; |
233 | responseData["login-flags"] = this.loginFlags; | 233 | responseData["login-flags"] = this.loginFlags; |
234 | responseData["global-textures"] = this.globalTextures; | 234 | responseData["global-textures"] = this.globalTextures; |
235 | responseData["seed_capability"] = this.seedCapability; | 235 | responseData["seed_capability"] = this.seedCapability; |
236 | 236 | ||
237 | responseData["event_categories"] = this.eventCategories; | 237 | responseData["event_categories"] = this.eventCategories; |
238 | responseData["event_notifications"] = new ArrayList(); // todo | 238 | responseData["event_notifications"] = new ArrayList(); // todo |
239 | responseData["classified_categories"] = this.classifiedCategories; | 239 | responseData["classified_categories"] = this.classifiedCategories; |
240 | responseData["ui-config"] = this.uiConfig; | 240 | responseData["ui-config"] = this.uiConfig; |
241 | 241 | ||
242 | responseData["inventory-skeleton"] = this.agentInventory; | 242 | responseData["inventory-skeleton"] = this.agentInventory; |
243 | responseData["inventory-skel-lib"] = new ArrayList(); // todo | 243 | responseData["inventory-skel-lib"] = new ArrayList(); // todo |
244 | responseData["inventory-root"] = this.inventoryRoot; | 244 | responseData["inventory-root"] = this.inventoryRoot; |
245 | responseData["gestures"] = new ArrayList(); // todo | 245 | responseData["gestures"] = new ArrayList(); // todo |
246 | responseData["inventory-lib-owner"] = new ArrayList(); // todo | 246 | responseData["inventory-lib-owner"] = new ArrayList(); // todo |
247 | responseData["initial-outfit"] = this.initialOutfit; | 247 | responseData["initial-outfit"] = this.initialOutfit; |
248 | responseData["start_location"] = this.startLocation; | 248 | responseData["start_location"] = this.startLocation; |
249 | responseData["seed_capability"] = this.seedCapability; | 249 | responseData["seed_capability"] = this.seedCapability; |
250 | responseData["home"] = this.home; | 250 | responseData["home"] = this.home; |
251 | responseData["look_at"] = this.lookAt; | 251 | responseData["look_at"] = this.lookAt; |
252 | responseData["message"] = this.welcomeMessage; | 252 | responseData["message"] = this.welcomeMessage; |
253 | responseData["region_x"] = (Int32)this.RegionX * 256; | 253 | responseData["region_x"] = (Int32)this.RegionX * 256; |
254 | responseData["region_y"] = (Int32)this.RegionY * 256; | 254 | responseData["region_y"] = (Int32)this.RegionY * 256; |
255 | 255 | ||
256 | //responseData["inventory-lib-root"] = new ArrayList(); // todo | 256 | //responseData["inventory-lib-root"] = new ArrayList(); // todo |
257 | //responseData["buddy-list"] = new ArrayList(); // todo | 257 | //responseData["buddy-list"] = new ArrayList(); // todo |
258 | 258 | ||
259 | responseData["login"] = "true"; | 259 | responseData["login"] = "true"; |
260 | this.xmlRpcResponse.Value = responseData; | 260 | this.xmlRpcResponse.Value = responseData; |
261 | 261 | ||
262 | return (this.xmlRpcResponse); | 262 | return (this.xmlRpcResponse); |
263 | } | 263 | } |
264 | catch (Exception e) | 264 | catch (Exception e) |
265 | { | 265 | { |
266 | MainLog.Instance.WriteLine( | 266 | MainLog.Instance.WriteLine( |
267 | LogPriority.LOW, | 267 | LogPriority.LOW, |
268 | "LoginResponse: Error creating XML-RPC Response: " + e.Message | 268 | "LoginResponse: Error creating XML-RPC Response: " + e.Message |
269 | ); | 269 | ); |
270 | return (this.GenerateFailureResponse("Internal Error", "Error generating Login Response", "false")); | 270 | return (this.GenerateFailureResponse("Internal Error", "Error generating Login Response", "false")); |
271 | 271 | ||
272 | } | 272 | } |
273 | 273 | ||
274 | } // ToXmlRpcResponse | 274 | } // ToXmlRpcResponse |
275 | 275 | ||
276 | public void SetEventCategories(string category, string value) | 276 | public void SetEventCategories(string category, string value) |
277 | { | 277 | { |
278 | this.eventCategoriesHash[category] = value; | 278 | this.eventCategoriesHash[category] = value; |
279 | } // SetEventCategories | 279 | } // SetEventCategories |
280 | 280 | ||
281 | public void AddToUIConfig(string itemName, string item) | 281 | public void AddToUIConfig(string itemName, string item) |
282 | { | 282 | { |
283 | this.uiConfigHash[itemName] = item; | 283 | this.uiConfigHash[itemName] = item; |
284 | } // SetUIConfig | 284 | } // SetUIConfig |
285 | 285 | ||
286 | public void AddClassifiedCategory(Int32 ID, string categoryName) | 286 | public void AddClassifiedCategory(Int32 ID, string categoryName) |
287 | { | 287 | { |
288 | this.classifiedCategoriesHash["category_name"] = categoryName; | 288 | this.classifiedCategoriesHash["category_name"] = categoryName; |
289 | this.classifiedCategoriesHash["category_id"] = ID; | 289 | this.classifiedCategoriesHash["category_id"] = ID; |
290 | this.classifiedCategories.Add(this.classifiedCategoriesHash); | 290 | this.classifiedCategories.Add(this.classifiedCategoriesHash); |
291 | // this.classifiedCategoriesHash.Clear(); | 291 | // this.classifiedCategoriesHash.Clear(); |
292 | } // SetClassifiedCategory | 292 | } // SetClassifiedCategory |
293 | 293 | ||
294 | #region Properties | 294 | #region Properties |
295 | public string Login | 295 | public string Login |
296 | { | 296 | { |
297 | get | 297 | get |
298 | { | 298 | { |
299 | return this.login; | 299 | return this.login; |
300 | } | 300 | } |
301 | set | 301 | set |
302 | { | 302 | { |
303 | this.login = value; | 303 | this.login = value; |
304 | } | 304 | } |
305 | } // Login | 305 | } // Login |
306 | 306 | ||
307 | public string DST | 307 | public string DST |
308 | { | 308 | { |
309 | get | 309 | get |
310 | { | 310 | { |
311 | return this.dst; | 311 | return this.dst; |
312 | } | 312 | } |
313 | set | 313 | set |
314 | { | 314 | { |
315 | this.dst = value; | 315 | this.dst = value; |
316 | } | 316 | } |
317 | } // DST | 317 | } // DST |
318 | 318 | ||
319 | public string StipendSinceLogin | 319 | public string StipendSinceLogin |
320 | { | 320 | { |
321 | get | 321 | get |
322 | { | 322 | { |
323 | return this.stipendSinceLogin; | 323 | return this.stipendSinceLogin; |
324 | } | 324 | } |
325 | set | 325 | set |
326 | { | 326 | { |
327 | this.stipendSinceLogin = value; | 327 | this.stipendSinceLogin = value; |
328 | } | 328 | } |
329 | } // StipendSinceLogin | 329 | } // StipendSinceLogin |
330 | 330 | ||
331 | public string Gendered | 331 | public string Gendered |
332 | { | 332 | { |
333 | get | 333 | get |
334 | { | 334 | { |
335 | return this.gendered; | 335 | return this.gendered; |
336 | } | 336 | } |
337 | set | 337 | set |
338 | { | 338 | { |
339 | this.gendered = value; | 339 | this.gendered = value; |
340 | } | 340 | } |
341 | } // Gendered | 341 | } // Gendered |
342 | 342 | ||
343 | public string EverLoggedIn | 343 | public string EverLoggedIn |
344 | { | 344 | { |
345 | get | 345 | get |
346 | { | 346 | { |
347 | return this.everLoggedIn; | 347 | return this.everLoggedIn; |
348 | } | 348 | } |
349 | set | 349 | set |
350 | { | 350 | { |
351 | this.everLoggedIn = value; | 351 | this.everLoggedIn = value; |
352 | } | 352 | } |
353 | } // EverLoggedIn | 353 | } // EverLoggedIn |
354 | 354 | ||
355 | public int SimPort | 355 | public int SimPort |
356 | { | 356 | { |
357 | get | 357 | get |
358 | { | 358 | { |
359 | return this.simPort; | 359 | return this.simPort; |
360 | } | 360 | } |
361 | set | 361 | set |
362 | { | 362 | { |
363 | this.simPort = value; | 363 | this.simPort = value; |
364 | } | 364 | } |
365 | } // SimPort | 365 | } // SimPort |
366 | 366 | ||
367 | public string SimAddress | 367 | public string SimAddress |
368 | { | 368 | { |
369 | get | 369 | get |
370 | { | 370 | { |
371 | return this.simAddress; | 371 | return this.simAddress; |
372 | } | 372 | } |
373 | set | 373 | set |
374 | { | 374 | { |
375 | this.simAddress = value; | 375 | this.simAddress = value; |
376 | } | 376 | } |
377 | } // SimAddress | 377 | } // SimAddress |
378 | 378 | ||
379 | public LLUUID AgentID | 379 | public LLUUID AgentID |
380 | { | 380 | { |
381 | get | 381 | get |
382 | { | 382 | { |
383 | return this.agentID; | 383 | return this.agentID; |
384 | } | 384 | } |
385 | set | 385 | set |
386 | { | 386 | { |
387 | this.agentID = value; | 387 | this.agentID = value; |
388 | } | 388 | } |
389 | } // AgentID | 389 | } // AgentID |
390 | 390 | ||
391 | public LLUUID SessionID | 391 | public LLUUID SessionID |
392 | { | 392 | { |
393 | get | 393 | get |
394 | { | 394 | { |
395 | return this.sessionID; | 395 | return this.sessionID; |
396 | } | 396 | } |
397 | set | 397 | set |
398 | { | 398 | { |
399 | this.sessionID = value; | 399 | this.sessionID = value; |
400 | } | 400 | } |
401 | } // SessionID | 401 | } // SessionID |
402 | 402 | ||
403 | public LLUUID SecureSessionID | 403 | public LLUUID SecureSessionID |
404 | { | 404 | { |
405 | get | 405 | get |
406 | { | 406 | { |
407 | return this.secureSessionID; | 407 | return this.secureSessionID; |
408 | } | 408 | } |
409 | set | 409 | set |
410 | { | 410 | { |
411 | this.secureSessionID = value; | 411 | this.secureSessionID = value; |
412 | } | 412 | } |
413 | } // SecureSessionID | 413 | } // SecureSessionID |
414 | 414 | ||
415 | public Int32 CircuitCode | 415 | public Int32 CircuitCode |
416 | { | 416 | { |
417 | get | 417 | get |
418 | { | 418 | { |
419 | return this.circuitCode; | 419 | return this.circuitCode; |
420 | } | 420 | } |
421 | set | 421 | set |
422 | { | 422 | { |
423 | this.circuitCode = value; | 423 | this.circuitCode = value; |
424 | } | 424 | } |
425 | } // CircuitCode | 425 | } // CircuitCode |
426 | 426 | ||
427 | public uint RegionX | 427 | public uint RegionX |
428 | { | 428 | { |
429 | get | 429 | get |
430 | { | 430 | { |
431 | return this.regionX; | 431 | return this.regionX; |
432 | } | 432 | } |
433 | set | 433 | set |
434 | { | 434 | { |
435 | this.regionX = value; | 435 | this.regionX = value; |
436 | } | 436 | } |
437 | } // RegionX | 437 | } // RegionX |
438 | 438 | ||
439 | public uint RegionY | 439 | public uint RegionY |
440 | { | 440 | { |
441 | get | 441 | get |
442 | { | 442 | { |
443 | return this.regionY; | 443 | return this.regionY; |
444 | } | 444 | } |
445 | set | 445 | set |
446 | { | 446 | { |
447 | this.regionY = value; | 447 | this.regionY = value; |
448 | } | 448 | } |
449 | } // RegionY | 449 | } // RegionY |
450 | 450 | ||
451 | public string SunTexture | 451 | public string SunTexture |
452 | { | 452 | { |
453 | get | 453 | get |
454 | { | 454 | { |
455 | return this.sunTexture; | 455 | return this.sunTexture; |
456 | } | 456 | } |
457 | set | 457 | set |
458 | { | 458 | { |
459 | this.sunTexture = value; | 459 | this.sunTexture = value; |
460 | } | 460 | } |
461 | } // SunTexture | 461 | } // SunTexture |
462 | 462 | ||
463 | public string CloudTexture | 463 | public string CloudTexture |
464 | { | 464 | { |
465 | get | 465 | get |
466 | { | 466 | { |
467 | return this.cloudTexture; | 467 | return this.cloudTexture; |
468 | } | 468 | } |
469 | set | 469 | set |
470 | { | 470 | { |
471 | this.cloudTexture = value; | 471 | this.cloudTexture = value; |
472 | } | 472 | } |
473 | } // CloudTexture | 473 | } // CloudTexture |
474 | 474 | ||
475 | public string MoonTexture | 475 | public string MoonTexture |
476 | { | 476 | { |
477 | get | 477 | get |
478 | { | 478 | { |
479 | return this.moonTexture; | 479 | return this.moonTexture; |
480 | } | 480 | } |
481 | set | 481 | set |
482 | { | 482 | { |
483 | this.moonTexture = value; | 483 | this.moonTexture = value; |
484 | } | 484 | } |
485 | } // MoonTexture | 485 | } // MoonTexture |
486 | 486 | ||
487 | public string Firstname | 487 | public string Firstname |
488 | { | 488 | { |
489 | get | 489 | get |
490 | { | 490 | { |
491 | return this.firstname; | 491 | return this.firstname; |
492 | } | 492 | } |
493 | set | 493 | set |
494 | { | 494 | { |
495 | this.firstname = value; | 495 | this.firstname = value; |
496 | } | 496 | } |
497 | } // Firstname | 497 | } // Firstname |
498 | 498 | ||
499 | public string Lastname | 499 | public string Lastname |
500 | { | 500 | { |
501 | get | 501 | get |
502 | { | 502 | { |
503 | return this.lastname; | 503 | return this.lastname; |
504 | } | 504 | } |
505 | set | 505 | set |
506 | { | 506 | { |
507 | this.lastname = value; | 507 | this.lastname = value; |
508 | } | 508 | } |
509 | } // Lastname | 509 | } // Lastname |
510 | 510 | ||
511 | public string AgentAccess | 511 | public string AgentAccess |
512 | { | 512 | { |
513 | get | 513 | get |
514 | { | 514 | { |
515 | return this.agentAccess; | 515 | return this.agentAccess; |
516 | } | 516 | } |
517 | set | 517 | set |
518 | { | 518 | { |
519 | this.agentAccess = value; | 519 | this.agentAccess = value; |
520 | } | 520 | } |
521 | } | 521 | } |
522 | 522 | ||
523 | public string StartLocation | 523 | public string StartLocation |
524 | { | 524 | { |
525 | get | 525 | get |
526 | { | 526 | { |
527 | return this.startLocation; | 527 | return this.startLocation; |
528 | } | 528 | } |
529 | set | 529 | set |
530 | { | 530 | { |
531 | this.startLocation = value; | 531 | this.startLocation = value; |
532 | } | 532 | } |
533 | } // StartLocation | 533 | } // StartLocation |
534 | 534 | ||
535 | public string LookAt | 535 | public string LookAt |
536 | { | 536 | { |
537 | get | 537 | get |
538 | { | 538 | { |
539 | return this.lookAt; | 539 | return this.lookAt; |
540 | } | 540 | } |
541 | set | 541 | set |
542 | { | 542 | { |
543 | this.lookAt = value; | 543 | this.lookAt = value; |
544 | } | 544 | } |
545 | } | 545 | } |
546 | 546 | ||
547 | public string SeedCapability | 547 | public string SeedCapability |
548 | { | 548 | { |
549 | get | 549 | get |
550 | { | 550 | { |
551 | return this.seedCapability; | 551 | return this.seedCapability; |
552 | } | 552 | } |
553 | set | 553 | set |
554 | { | 554 | { |
555 | this.seedCapability = value; | 555 | this.seedCapability = value; |
556 | } | 556 | } |
557 | } // SeedCapability | 557 | } // SeedCapability |
558 | 558 | ||
559 | public string ErrorReason | 559 | public string ErrorReason |
560 | { | 560 | { |
561 | get | 561 | get |
562 | { | 562 | { |
563 | return this.errorReason; | 563 | return this.errorReason; |
564 | } | 564 | } |
565 | set | 565 | set |
566 | { | 566 | { |
567 | this.errorReason = value; | 567 | this.errorReason = value; |
568 | } | 568 | } |
569 | } // ErrorReason | 569 | } // ErrorReason |
570 | 570 | ||
571 | public string ErrorMessage | 571 | public string ErrorMessage |
572 | { | 572 | { |
573 | get | 573 | get |
574 | { | 574 | { |
575 | return this.errorMessage; | 575 | return this.errorMessage; |
576 | } | 576 | } |
577 | set | 577 | set |
578 | { | 578 | { |
579 | this.errorMessage = value; | 579 | this.errorMessage = value; |
580 | } | 580 | } |
581 | } // ErrorMessage | 581 | } // ErrorMessage |
582 | 582 | ||
583 | public ArrayList InventoryRoot | 583 | public ArrayList InventoryRoot |
584 | { | 584 | { |
585 | get | 585 | get |
586 | { | 586 | { |
587 | return this.inventoryRoot; | 587 | return this.inventoryRoot; |
588 | } | 588 | } |
589 | set | 589 | set |
590 | { | 590 | { |
591 | this.inventoryRoot = value; | 591 | this.inventoryRoot = value; |
592 | } | 592 | } |
593 | } | 593 | } |
594 | 594 | ||
595 | public ArrayList InventorySkeleton | 595 | public ArrayList InventorySkeleton |
596 | { | 596 | { |
597 | get | 597 | get |
598 | { | 598 | { |
599 | return this.agentInventory; | 599 | return this.agentInventory; |
600 | } | 600 | } |
601 | set | 601 | set |
602 | { | 602 | { |
603 | this.agentInventory = value; | 603 | this.agentInventory = value; |
604 | } | 604 | } |
605 | } | 605 | } |
606 | 606 | ||
607 | public string Home | 607 | public string Home |
608 | { | 608 | { |
609 | get | 609 | get |
610 | { | 610 | { |
611 | return this.home; | 611 | return this.home; |
612 | } | 612 | } |
613 | set | 613 | set |
614 | { | 614 | { |
615 | this.home = value; | 615 | this.home = value; |
616 | } | 616 | } |
617 | } | 617 | } |
618 | 618 | ||
619 | public string Message | 619 | public string Message |
620 | { | 620 | { |
621 | get | 621 | get |
622 | { | 622 | { |
623 | return this.welcomeMessage; | 623 | return this.welcomeMessage; |
624 | } | 624 | } |
625 | set | 625 | set |
626 | { | 626 | { |
627 | this.welcomeMessage = value; | 627 | this.welcomeMessage = value; |
628 | } | 628 | } |
629 | } | 629 | } |
630 | #endregion | 630 | #endregion |
631 | 631 | ||
632 | 632 | ||
633 | public class UserInfo | 633 | public class UserInfo |
634 | { | 634 | { |
635 | public string firstname; | 635 | public string firstname; |
636 | public string lastname; | 636 | public string lastname; |
637 | public ulong homeregionhandle; | 637 | public ulong homeregionhandle; |
638 | public LLVector3 homepos; | 638 | public LLVector3 homepos; |
639 | public LLVector3 homelookat; | 639 | public LLVector3 homelookat; |
640 | } | 640 | } |
641 | } | 641 | } |
642 | } | 642 | } |
643 | 643 | ||
diff --git a/OpenSim/Framework/UserManager/UserManagerBase.cs b/OpenSim/Framework/UserManager/UserManagerBase.cs index 4e688f7..fe45d1b 100644 --- a/OpenSim/Framework/UserManager/UserManagerBase.cs +++ b/OpenSim/Framework/UserManager/UserManagerBase.cs | |||
@@ -1,631 +1,631 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using System; | 28 | using System; |
29 | using System.Collections; | 29 | using System.Collections; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Reflection; | 31 | using System.Reflection; |
32 | using System.Security.Cryptography; | 32 | using System.Security.Cryptography; |
33 | using libsecondlife; | 33 | using libsecondlife; |
34 | using Nwc.XmlRpc; | 34 | using Nwc.XmlRpc; |
35 | using OpenSim.Framework.Console; | 35 | using OpenSim.Framework.Console; |
36 | using OpenSim.Framework.Data; | 36 | using OpenSim.Framework.Data; |
37 | using OpenSim.Framework.Interfaces; | 37 | using OpenSim.Framework.Interfaces; |
38 | using OpenSim.Framework.Inventory; | 38 | using OpenSim.Framework.Inventory; |
39 | using OpenSim.Framework.Utilities; | 39 | using OpenSim.Framework.Utilities; |
40 | 40 | ||
41 | namespace OpenSim.Framework.UserManagement | 41 | namespace OpenSim.Framework.UserManagement |
42 | { | 42 | { |
43 | public abstract class UserManagerBase | 43 | public abstract class UserManagerBase |
44 | { | 44 | { |
45 | public UserConfig _config; | 45 | public UserConfig _config; |
46 | Dictionary<string, IUserData> _plugins = new Dictionary<string, IUserData>(); | 46 | Dictionary<string, IUserData> _plugins = new Dictionary<string, IUserData>(); |
47 | 47 | ||
48 | /// <summary> | 48 | /// <summary> |
49 | /// Adds a new user server plugin - user servers will be requested in the order they were loaded. | 49 | /// Adds a new user server plugin - user servers will be requested in the order they were loaded. |
50 | /// </summary> | 50 | /// </summary> |
51 | /// <param name="FileName">The filename to the user server plugin DLL</param> | 51 | /// <param name="FileName">The filename to the user server plugin DLL</param> |
52 | public void AddPlugin(string FileName) | 52 | public void AddPlugin(string FileName) |
53 | { | 53 | { |
54 | MainLog.Instance.Verbose( "Userstorage: Attempting to load " + FileName); | 54 | MainLog.Instance.Verbose( "Userstorage: Attempting to load " + FileName); |
55 | Assembly pluginAssembly = Assembly.LoadFrom(FileName); | 55 | Assembly pluginAssembly = Assembly.LoadFrom(FileName); |
56 | 56 | ||
57 | MainLog.Instance.Verbose( "Userstorage: Found " + pluginAssembly.GetTypes().Length + " interfaces."); | 57 | MainLog.Instance.Verbose( "Userstorage: Found " + pluginAssembly.GetTypes().Length + " interfaces."); |
58 | foreach (Type pluginType in pluginAssembly.GetTypes()) | 58 | foreach (Type pluginType in pluginAssembly.GetTypes()) |
59 | { | 59 | { |
60 | if (!pluginType.IsAbstract) | 60 | if (!pluginType.IsAbstract) |
61 | { | 61 | { |
62 | Type typeInterface = pluginType.GetInterface("IUserData", true); | 62 | Type typeInterface = pluginType.GetInterface("IUserData", true); |
63 | 63 | ||
64 | if (typeInterface != null) | 64 | if (typeInterface != null) |
65 | { | 65 | { |
66 | IUserData plug = (IUserData)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); | 66 | IUserData plug = (IUserData)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); |
67 | plug.Initialise(); | 67 | plug.Initialise(); |
68 | this._plugins.Add(plug.getName(), plug); | 68 | this._plugins.Add(plug.getName(), plug); |
69 | MainLog.Instance.Verbose( "Userstorage: Added IUserData Interface"); | 69 | MainLog.Instance.Verbose( "Userstorage: Added IUserData Interface"); |
70 | } | 70 | } |
71 | 71 | ||
72 | typeInterface = null; | 72 | typeInterface = null; |
73 | } | 73 | } |
74 | } | 74 | } |
75 | 75 | ||
76 | pluginAssembly = null; | 76 | pluginAssembly = null; |
77 | } | 77 | } |
78 | 78 | ||
79 | #region Get UserProfile | 79 | #region Get UserProfile |
80 | /// <summary> | 80 | /// <summary> |
81 | /// Loads a user profile from a database by UUID | 81 | /// Loads a user profile from a database by UUID |
82 | /// </summary> | 82 | /// </summary> |
83 | /// <param name="uuid">The target UUID</param> | 83 | /// <param name="uuid">The target UUID</param> |
84 | /// <returns>A user profile</returns> | 84 | /// <returns>A user profile</returns> |
85 | public UserProfileData getUserProfile(LLUUID uuid) | 85 | public UserProfileData getUserProfile(LLUUID uuid) |
86 | { | 86 | { |
87 | foreach (KeyValuePair<string, IUserData> plugin in _plugins) | 87 | foreach (KeyValuePair<string, IUserData> plugin in _plugins) |
88 | { | 88 | { |
89 | try | 89 | try |
90 | { | 90 | { |
91 | UserProfileData profile = plugin.Value.getUserByUUID(uuid); | 91 | UserProfileData profile = plugin.Value.getUserByUUID(uuid); |
92 | profile.currentAgent = getUserAgent(profile.UUID); | 92 | profile.currentAgent = getUserAgent(profile.UUID); |
93 | return profile; | 93 | return profile; |
94 | } | 94 | } |
95 | catch (Exception e) | 95 | catch (Exception e) |
96 | { | 96 | { |
97 | MainLog.Instance.Verbose( "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")"); | 97 | MainLog.Instance.Verbose( "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")"); |
98 | } | 98 | } |
99 | } | 99 | } |
100 | 100 | ||
101 | return null; | 101 | return null; |
102 | } | 102 | } |
103 | 103 | ||
104 | 104 | ||
105 | /// <summary> | 105 | /// <summary> |
106 | /// Loads a user profile by name | 106 | /// Loads a user profile by name |
107 | /// </summary> | 107 | /// </summary> |
108 | /// <param name="name">The target name</param> | 108 | /// <param name="name">The target name</param> |
109 | /// <returns>A user profile</returns> | 109 | /// <returns>A user profile</returns> |
110 | public UserProfileData getUserProfile(string name) | 110 | public UserProfileData getUserProfile(string name) |
111 | { | 111 | { |
112 | foreach (KeyValuePair<string, IUserData> plugin in _plugins) | 112 | foreach (KeyValuePair<string, IUserData> plugin in _plugins) |
113 | { | 113 | { |
114 | try | 114 | try |
115 | { | 115 | { |
116 | UserProfileData profile = plugin.Value.getUserByName(name); | 116 | UserProfileData profile = plugin.Value.getUserByName(name); |
117 | profile.currentAgent = getUserAgent(profile.UUID); | 117 | profile.currentAgent = getUserAgent(profile.UUID); |
118 | return profile; | 118 | return profile; |
119 | } | 119 | } |
120 | catch (Exception e) | 120 | catch (Exception e) |
121 | { | 121 | { |
122 | System.Console.WriteLine("EEK!"); | 122 | System.Console.WriteLine("EEK!"); |
123 | MainLog.Instance.Verbose( "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")"); | 123 | MainLog.Instance.Verbose( "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")"); |
124 | } | 124 | } |
125 | } | 125 | } |
126 | 126 | ||
127 | return null; | 127 | return null; |
128 | } | 128 | } |
129 | 129 | ||
130 | /// <summary> | 130 | /// <summary> |
131 | /// Loads a user profile by name | 131 | /// Loads a user profile by name |
132 | /// </summary> | 132 | /// </summary> |
133 | /// <param name="fname">First name</param> | 133 | /// <param name="fname">First name</param> |
134 | /// <param name="lname">Last name</param> | 134 | /// <param name="lname">Last name</param> |
135 | /// <returns>A user profile</returns> | 135 | /// <returns>A user profile</returns> |
136 | public UserProfileData getUserProfile(string fname, string lname) | 136 | public UserProfileData getUserProfile(string fname, string lname) |
137 | { | 137 | { |
138 | foreach (KeyValuePair<string, IUserData> plugin in _plugins) | 138 | foreach (KeyValuePair<string, IUserData> plugin in _plugins) |
139 | { | 139 | { |
140 | try | 140 | try |
141 | { | 141 | { |
142 | UserProfileData profile = plugin.Value.getUserByName(fname,lname); | 142 | UserProfileData profile = plugin.Value.getUserByName(fname,lname); |
143 | 143 | ||
144 | profile.currentAgent = getUserAgent(profile.UUID); | 144 | profile.currentAgent = getUserAgent(profile.UUID); |
145 | 145 | ||
146 | return profile; | 146 | return profile; |
147 | } | 147 | } |
148 | catch (Exception e) | 148 | catch (Exception e) |
149 | { | 149 | { |
150 | MainLog.Instance.Verbose( "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")"); | 150 | MainLog.Instance.Verbose( "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")"); |
151 | } | 151 | } |
152 | } | 152 | } |
153 | 153 | ||
154 | return null; | 154 | return null; |
155 | } | 155 | } |
156 | #endregion | 156 | #endregion |
157 | 157 | ||
158 | #region Get UserAgent | 158 | #region Get UserAgent |
159 | /// <summary> | 159 | /// <summary> |
160 | /// Loads a user agent by uuid (not called directly) | 160 | /// Loads a user agent by uuid (not called directly) |
161 | /// </summary> | 161 | /// </summary> |
162 | /// <param name="uuid">The agents UUID</param> | 162 | /// <param name="uuid">The agents UUID</param> |
163 | /// <returns>Agent profiles</returns> | 163 | /// <returns>Agent profiles</returns> |
164 | public UserAgentData getUserAgent(LLUUID uuid) | 164 | public UserAgentData getUserAgent(LLUUID uuid) |
165 | { | 165 | { |
166 | foreach (KeyValuePair<string, IUserData> plugin in _plugins) | 166 | foreach (KeyValuePair<string, IUserData> plugin in _plugins) |
167 | { | 167 | { |
168 | try | 168 | try |
169 | { | 169 | { |
170 | return plugin.Value.getAgentByUUID(uuid); | 170 | return plugin.Value.getAgentByUUID(uuid); |
171 | } | 171 | } |
172 | catch (Exception e) | 172 | catch (Exception e) |
173 | { | 173 | { |
174 | MainLog.Instance.Verbose( "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")"); | 174 | MainLog.Instance.Verbose( "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")"); |
175 | } | 175 | } |
176 | } | 176 | } |
177 | 177 | ||
178 | return null; | 178 | return null; |
179 | } | 179 | } |
180 | 180 | ||
181 | /// <summary> | 181 | /// <summary> |
182 | /// Loads a user agent by name (not called directly) | 182 | /// Loads a user agent by name (not called directly) |
183 | /// </summary> | 183 | /// </summary> |
184 | /// <param name="name">The agents name</param> | 184 | /// <param name="name">The agents name</param> |
185 | /// <returns>A user agent</returns> | 185 | /// <returns>A user agent</returns> |
186 | public UserAgentData getUserAgent(string name) | 186 | public UserAgentData getUserAgent(string name) |
187 | { | 187 | { |
188 | foreach (KeyValuePair<string, IUserData> plugin in _plugins) | 188 | foreach (KeyValuePair<string, IUserData> plugin in _plugins) |
189 | { | 189 | { |
190 | try | 190 | try |
191 | { | 191 | { |
192 | return plugin.Value.getAgentByName(name); | 192 | return plugin.Value.getAgentByName(name); |
193 | } | 193 | } |
194 | catch (Exception e) | 194 | catch (Exception e) |
195 | { | 195 | { |
196 | MainLog.Instance.Verbose( "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")"); | 196 | MainLog.Instance.Verbose( "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")"); |
197 | } | 197 | } |
198 | } | 198 | } |
199 | 199 | ||
200 | return null; | 200 | return null; |
201 | } | 201 | } |
202 | 202 | ||
203 | /// <summary> | 203 | /// <summary> |
204 | /// Loads a user agent by name (not called directly) | 204 | /// Loads a user agent by name (not called directly) |
205 | /// </summary> | 205 | /// </summary> |
206 | /// <param name="fname">The agents firstname</param> | 206 | /// <param name="fname">The agents firstname</param> |
207 | /// <param name="lname">The agents lastname</param> | 207 | /// <param name="lname">The agents lastname</param> |
208 | /// <returns>A user agent</returns> | 208 | /// <returns>A user agent</returns> |
209 | public UserAgentData getUserAgent(string fname, string lname) | 209 | public UserAgentData getUserAgent(string fname, string lname) |
210 | { | 210 | { |
211 | foreach (KeyValuePair<string, IUserData> plugin in _plugins) | 211 | foreach (KeyValuePair<string, IUserData> plugin in _plugins) |
212 | { | 212 | { |
213 | try | 213 | try |
214 | { | 214 | { |
215 | return plugin.Value.getAgentByName(fname,lname); | 215 | return plugin.Value.getAgentByName(fname,lname); |
216 | } | 216 | } |
217 | catch (Exception e) | 217 | catch (Exception e) |
218 | { | 218 | { |
219 | MainLog.Instance.Verbose( "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")"); | 219 | MainLog.Instance.Verbose( "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")"); |
220 | } | 220 | } |
221 | } | 221 | } |
222 | 222 | ||
223 | return null; | 223 | return null; |
224 | } | 224 | } |
225 | 225 | ||
226 | #endregion | 226 | #endregion |
227 | 227 | ||
228 | #region CreateAgent | 228 | #region CreateAgent |
229 | /// <summary> | 229 | /// <summary> |
230 | /// Creates and initialises a new user agent - make sure to use CommitAgent when done to submit to the DB | 230 | /// Creates and initialises a new user agent - make sure to use CommitAgent when done to submit to the DB |
231 | /// </summary> | 231 | /// </summary> |
232 | /// <param name="profile">The users profile</param> | 232 | /// <param name="profile">The users profile</param> |
233 | /// <param name="request">The users loginrequest</param> | 233 | /// <param name="request">The users loginrequest</param> |
234 | public void CreateAgent(UserProfileData profile, XmlRpcRequest request) | 234 | public void CreateAgent(UserProfileData profile, XmlRpcRequest request) |
235 | { | 235 | { |
236 | Hashtable requestData = (Hashtable)request.Params[0]; | 236 | Hashtable requestData = (Hashtable)request.Params[0]; |
237 | 237 | ||
238 | UserAgentData agent = new UserAgentData(); | 238 | UserAgentData agent = new UserAgentData(); |
239 | 239 | ||
240 | // User connection | 240 | // User connection |
241 | agent.agentOnline = true; | 241 | agent.agentOnline = true; |
242 | 242 | ||
243 | // Generate sessions | 243 | // Generate sessions |
244 | RNGCryptoServiceProvider rand = new RNGCryptoServiceProvider(); | 244 | RNGCryptoServiceProvider rand = new RNGCryptoServiceProvider(); |
245 | byte[] randDataS = new byte[16]; | 245 | byte[] randDataS = new byte[16]; |
246 | byte[] randDataSS = new byte[16]; | 246 | byte[] randDataSS = new byte[16]; |
247 | rand.GetBytes(randDataS); | 247 | rand.GetBytes(randDataS); |
248 | rand.GetBytes(randDataSS); | 248 | rand.GetBytes(randDataSS); |
249 | 249 | ||
250 | agent.secureSessionID = new LLUUID(randDataSS, 0); | 250 | agent.secureSessionID = new LLUUID(randDataSS, 0); |
251 | agent.sessionID = new LLUUID(randDataS, 0); | 251 | agent.sessionID = new LLUUID(randDataS, 0); |
252 | 252 | ||
253 | // Profile UUID | 253 | // Profile UUID |
254 | agent.UUID = profile.UUID; | 254 | agent.UUID = profile.UUID; |
255 | 255 | ||
256 | // Current position (from Home) | 256 | // Current position (from Home) |
257 | agent.currentHandle = profile.homeRegion; | 257 | agent.currentHandle = profile.homeRegion; |
258 | agent.currentPos = profile.homeLocation; | 258 | agent.currentPos = profile.homeLocation; |
259 | 259 | ||
260 | // If user specified additional start, use that | 260 | // If user specified additional start, use that |
261 | if (requestData.ContainsKey("start")) | 261 | if (requestData.ContainsKey("start")) |
262 | { | 262 | { |
263 | string startLoc = ((string)requestData["start"]).Trim(); | 263 | string startLoc = ((string)requestData["start"]).Trim(); |
264 | if (!(startLoc == "last" || startLoc == "home")) | 264 | if (!(startLoc == "last" || startLoc == "home")) |
265 | { | 265 | { |
266 | // Format: uri:Ahern&162&213&34 | 266 | // Format: uri:Ahern&162&213&34 |
267 | try | 267 | try |
268 | { | 268 | { |
269 | string[] parts = startLoc.Remove(0, 4).Split('&'); | 269 | string[] parts = startLoc.Remove(0, 4).Split('&'); |
270 | string region = parts[0]; | 270 | string region = parts[0]; |
271 | 271 | ||
272 | //////////////////////////////////////////////////// | 272 | //////////////////////////////////////////////////// |
273 | //SimProfile SimInfo = new SimProfile(); | 273 | //SimProfile SimInfo = new SimProfile(); |
274 | //SimInfo = SimInfo.LoadFromGrid(theUser.currentAgent.currentHandle, _config.GridServerURL, _config.GridSendKey, _config.GridRecvKey); | 274 | //SimInfo = SimInfo.LoadFromGrid(theUser.currentAgent.currentHandle, _config.GridServerURL, _config.GridSendKey, _config.GridRecvKey); |
275 | } | 275 | } |
276 | catch (Exception) | 276 | catch (Exception) |
277 | { | 277 | { |
278 | 278 | ||
279 | } | 279 | } |
280 | } | 280 | } |
281 | } | 281 | } |
282 | 282 | ||
283 | // What time did the user login? | 283 | // What time did the user login? |
284 | agent.loginTime = Util.UnixTimeSinceEpoch(); | 284 | agent.loginTime = Util.UnixTimeSinceEpoch(); |
285 | agent.logoutTime = 0; | 285 | agent.logoutTime = 0; |
286 | 286 | ||
287 | // Current location | 287 | // Current location |
288 | agent.regionID = new LLUUID(); // Fill in later | 288 | agent.regionID = new LLUUID(); // Fill in later |
289 | agent.currentRegion = new LLUUID(); // Fill in later | 289 | agent.currentRegion = new LLUUID(); // Fill in later |
290 | 290 | ||
291 | profile.currentAgent = agent; | 291 | profile.currentAgent = agent; |
292 | } | 292 | } |
293 | 293 | ||
294 | /// <summary> | 294 | /// <summary> |
295 | /// Saves a target agent to the database | 295 | /// Saves a target agent to the database |
296 | /// </summary> | 296 | /// </summary> |
297 | /// <param name="profile">The users profile</param> | 297 | /// <param name="profile">The users profile</param> |
298 | /// <returns>Successful?</returns> | 298 | /// <returns>Successful?</returns> |
299 | public bool CommitAgent(ref UserProfileData profile) | 299 | public bool CommitAgent(ref UserProfileData profile) |
300 | { | 300 | { |
301 | // Saves the agent to database | 301 | // Saves the agent to database |
302 | return true; | 302 | return true; |
303 | } | 303 | } |
304 | 304 | ||
305 | #endregion | 305 | #endregion |
306 | 306 | ||
307 | /// <summary> | 307 | /// <summary> |
308 | /// Checks a user against it's password hash | 308 | /// Checks a user against it's password hash |
309 | /// </summary> | 309 | /// </summary> |
310 | /// <param name="profile">The users profile</param> | 310 | /// <param name="profile">The users profile</param> |
311 | /// <param name="password">The supplied password</param> | 311 | /// <param name="password">The supplied password</param> |
312 | /// <returns>Authenticated?</returns> | 312 | /// <returns>Authenticated?</returns> |
313 | public virtual bool AuthenticateUser(UserProfileData profile, string password) | 313 | public virtual bool AuthenticateUser(UserProfileData profile, string password) |
314 | { | 314 | { |
315 | MainLog.Instance.Verbose( | 315 | MainLog.Instance.Verbose( |
316 | "Authenticating " + profile.username + " " + profile.surname); | 316 | "Authenticating " + profile.username + " " + profile.surname); |
317 | 317 | ||
318 | password = password.Remove(0, 3); //remove $1$ | 318 | password = password.Remove(0, 3); //remove $1$ |
319 | 319 | ||
320 | string s = Util.Md5Hash(password + ":" + profile.passwordSalt); | 320 | string s = Util.Md5Hash(password + ":" + profile.passwordSalt); |
321 | 321 | ||
322 | return profile.passwordHash.Equals(s.ToString(), StringComparison.InvariantCultureIgnoreCase); | 322 | return profile.passwordHash.Equals(s.ToString(), StringComparison.InvariantCultureIgnoreCase); |
323 | } | 323 | } |
324 | 324 | ||
325 | #region Xml Response | 325 | #region Xml Response |
326 | 326 | ||
327 | /// <summary> | 327 | /// <summary> |
328 | /// | 328 | /// |
329 | /// </summary> | 329 | /// </summary> |
330 | /// <param name="firstname"></param> | 330 | /// <param name="firstname"></param> |
331 | /// <param name="lastname"></param> | 331 | /// <param name="lastname"></param> |
332 | /// <returns></returns> | 332 | /// <returns></returns> |
333 | public virtual UserProfileData GetTheUser(string firstname, string lastname) | 333 | public virtual UserProfileData GetTheUser(string firstname, string lastname) |
334 | { | 334 | { |
335 | return getUserProfile(firstname, lastname); | 335 | return getUserProfile(firstname, lastname); |
336 | } | 336 | } |
337 | 337 | ||
338 | /// <summary> | 338 | /// <summary> |
339 | /// | 339 | /// |
340 | /// </summary> | 340 | /// </summary> |
341 | /// <returns></returns> | 341 | /// <returns></returns> |
342 | public virtual string GetMessage() | 342 | public virtual string GetMessage() |
343 | { | 343 | { |
344 | return _config.DefaultStartupMsg; | 344 | return _config.DefaultStartupMsg; |
345 | } | 345 | } |
346 | 346 | ||
347 | /// <summary> | 347 | /// <summary> |
348 | /// Customises the login response and fills in missing values. | 348 | /// Customises the login response and fills in missing values. |
349 | /// </summary> | 349 | /// </summary> |
350 | /// <param name="response">The existing response</param> | 350 | /// <param name="response">The existing response</param> |
351 | /// <param name="theUser">The user profile</param> | 351 | /// <param name="theUser">The user profile</param> |
352 | public abstract void CustomiseResponse( LoginResponse response, UserProfileData theUser); | 352 | public abstract void CustomiseResponse( LoginResponse response, UserProfileData theUser); |
353 | 353 | ||
354 | /// <summary> | 354 | /// <summary> |
355 | /// Main user login function | 355 | /// Main user login function |
356 | /// </summary> | 356 | /// </summary> |
357 | /// <param name="request">The XMLRPC request</param> | 357 | /// <param name="request">The XMLRPC request</param> |
358 | /// <returns>The response to send</returns> | 358 | /// <returns>The response to send</returns> |
359 | public XmlRpcResponse XmlRpcLoginMethod(XmlRpcRequest request) | 359 | public XmlRpcResponse XmlRpcLoginMethod(XmlRpcRequest request) |
360 | { | 360 | { |
361 | 361 | ||
362 | System.Console.WriteLine("Attempting login now..."); | 362 | System.Console.WriteLine("Attempting login now..."); |
363 | XmlRpcResponse response = new XmlRpcResponse(); | 363 | XmlRpcResponse response = new XmlRpcResponse(); |
364 | Hashtable requestData = (Hashtable)request.Params[0]; | 364 | Hashtable requestData = (Hashtable)request.Params[0]; |
365 | 365 | ||
366 | bool GoodXML = (requestData.Contains("first") && requestData.Contains("last") && requestData.Contains("passwd")); | 366 | bool GoodXML = (requestData.Contains("first") && requestData.Contains("last") && requestData.Contains("passwd")); |
367 | bool GoodLogin = false; | 367 | bool GoodLogin = false; |
368 | string firstname = ""; | 368 | string firstname = ""; |
369 | string lastname = ""; | 369 | string lastname = ""; |
370 | string passwd = ""; | 370 | string passwd = ""; |
371 | 371 | ||
372 | UserProfileData userProfile; | 372 | UserProfileData userProfile; |
373 | LoginResponse logResponse = new LoginResponse(); | 373 | LoginResponse logResponse = new LoginResponse(); |
374 | 374 | ||
375 | if (GoodXML) | 375 | if (GoodXML) |
376 | { | 376 | { |
377 | firstname = (string)requestData["first"]; | 377 | firstname = (string)requestData["first"]; |
378 | lastname = (string)requestData["last"]; | 378 | lastname = (string)requestData["last"]; |
379 | passwd = (string)requestData["passwd"]; | 379 | passwd = (string)requestData["passwd"]; |
380 | 380 | ||
381 | userProfile = GetTheUser(firstname, lastname); | 381 | userProfile = GetTheUser(firstname, lastname); |
382 | if (userProfile == null) | 382 | if (userProfile == null) |
383 | return logResponse.CreateLoginFailedResponse(); | 383 | return logResponse.CreateLoginFailedResponse(); |
384 | 384 | ||
385 | GoodLogin = AuthenticateUser(userProfile, passwd); | 385 | GoodLogin = AuthenticateUser(userProfile, passwd); |
386 | } | 386 | } |
387 | else | 387 | else |
388 | { | 388 | { |
389 | return logResponse.CreateGridErrorResponse(); | 389 | return logResponse.CreateGridErrorResponse(); |
390 | } | 390 | } |
391 | 391 | ||
392 | if (!GoodLogin) | 392 | if (!GoodLogin) |
393 | { | 393 | { |
394 | return logResponse.CreateLoginFailedResponse(); | 394 | return logResponse.CreateLoginFailedResponse(); |
395 | } | 395 | } |
396 | else | 396 | else |
397 | { | 397 | { |
398 | // If we already have a session... | 398 | // If we already have a session... |
399 | if (userProfile.currentAgent != null && userProfile.currentAgent.agentOnline) | 399 | if (userProfile.currentAgent != null && userProfile.currentAgent.agentOnline) |
400 | { | 400 | { |
401 | // Reject the login | 401 | // Reject the login |
402 | return logResponse.CreateAlreadyLoggedInResponse(); | 402 | return logResponse.CreateAlreadyLoggedInResponse(); |
403 | } | 403 | } |
404 | // Otherwise... | 404 | // Otherwise... |
405 | // Create a new agent session | 405 | // Create a new agent session |
406 | CreateAgent( userProfile, request); | 406 | CreateAgent( userProfile, request); |
407 | 407 | ||
408 | try | 408 | try |
409 | { | 409 | { |
410 | 410 | ||
411 | LLUUID AgentID = userProfile.UUID; | 411 | LLUUID AgentID = userProfile.UUID; |
412 | 412 | ||
413 | // Inventory Library Section | 413 | // Inventory Library Section |
414 | ArrayList AgentInventoryArray = new ArrayList(); | 414 | ArrayList AgentInventoryArray = new ArrayList(); |
415 | Hashtable TempHash; | 415 | Hashtable TempHash; |
416 | 416 | ||
417 | AgentInventory Library = new AgentInventory(); | 417 | AgentInventory Library = new AgentInventory(); |
418 | Library.CreateRootFolder(AgentID, true); | 418 | Library.CreateRootFolder(AgentID, true); |
419 | 419 | ||
420 | foreach (InventoryFolder InvFolder in Library.InventoryFolders.Values) | 420 | foreach (InventoryFolder InvFolder in Library.InventoryFolders.Values) |
421 | { | 421 | { |
422 | TempHash = new Hashtable(); | 422 | TempHash = new Hashtable(); |
423 | TempHash["name"] = InvFolder.FolderName; | 423 | TempHash["name"] = InvFolder.FolderName; |
424 | TempHash["parent_id"] = InvFolder.ParentID.ToStringHyphenated(); | 424 | TempHash["parent_id"] = InvFolder.ParentID.ToStringHyphenated(); |
425 | TempHash["version"] = (Int32)InvFolder.Version; | 425 | TempHash["version"] = (Int32)InvFolder.Version; |
426 | TempHash["type_default"] = (Int32)InvFolder.DefaultType; | 426 | TempHash["type_default"] = (Int32)InvFolder.DefaultType; |
427 | TempHash["folder_id"] = InvFolder.FolderID.ToStringHyphenated(); | 427 | TempHash["folder_id"] = InvFolder.FolderID.ToStringHyphenated(); |
428 | AgentInventoryArray.Add(TempHash); | 428 | AgentInventoryArray.Add(TempHash); |
429 | } | 429 | } |
430 | 430 | ||
431 | Hashtable InventoryRootHash = new Hashtable(); | 431 | Hashtable InventoryRootHash = new Hashtable(); |
432 | InventoryRootHash["folder_id"] = Library.InventoryRoot.FolderID.ToStringHyphenated(); | 432 | InventoryRootHash["folder_id"] = Library.InventoryRoot.FolderID.ToStringHyphenated(); |
433 | ArrayList InventoryRoot = new ArrayList(); | 433 | ArrayList InventoryRoot = new ArrayList(); |
434 | InventoryRoot.Add(InventoryRootHash); | 434 | InventoryRoot.Add(InventoryRootHash); |
435 | 435 | ||
436 | // Circuit Code | 436 | // Circuit Code |
437 | uint circode = (uint)(Util.RandomClass.Next()); | 437 | uint circode = (uint)(Util.RandomClass.Next()); |
438 | 438 | ||
439 | logResponse.Lastname = userProfile.surname; | 439 | logResponse.Lastname = userProfile.surname; |
440 | logResponse.Firstname = userProfile.username; | 440 | logResponse.Firstname = userProfile.username; |
441 | logResponse.AgentID = AgentID.ToStringHyphenated(); | 441 | logResponse.AgentID = AgentID.ToStringHyphenated(); |
442 | logResponse.SessionID = userProfile.currentAgent.sessionID.ToStringHyphenated(); | 442 | logResponse.SessionID = userProfile.currentAgent.sessionID.ToStringHyphenated(); |
443 | logResponse.SecureSessionID = userProfile.currentAgent.secureSessionID.ToStringHyphenated(); | 443 | logResponse.SecureSessionID = userProfile.currentAgent.secureSessionID.ToStringHyphenated(); |
444 | logResponse.InventoryRoot = InventoryRoot; | 444 | logResponse.InventoryRoot = InventoryRoot; |
445 | logResponse.InventorySkeleton = AgentInventoryArray; | 445 | logResponse.InventorySkeleton = AgentInventoryArray; |
446 | logResponse.CircuitCode = (Int32)circode; | 446 | logResponse.CircuitCode = (Int32)circode; |
447 | //logResponse.RegionX = 0; //overwritten | 447 | //logResponse.RegionX = 0; //overwritten |
448 | //logResponse.RegionY = 0; //overwritten | 448 | //logResponse.RegionY = 0; //overwritten |
449 | logResponse.Home = "!!null temporary value {home}!!"; // Overwritten | 449 | logResponse.Home = "!!null temporary value {home}!!"; // Overwritten |
450 | //logResponse.LookAt = "\n[r" + TheUser.homeLookAt.X.ToString() + ",r" + TheUser.homeLookAt.Y.ToString() + ",r" + TheUser.homeLookAt.Z.ToString() + "]\n"; | 450 | //logResponse.LookAt = "\n[r" + TheUser.homeLookAt.X.ToString() + ",r" + TheUser.homeLookAt.Y.ToString() + ",r" + TheUser.homeLookAt.Z.ToString() + "]\n"; |
451 | //logResponse.SimAddress = "127.0.0.1"; //overwritten | 451 | //logResponse.SimAddress = "127.0.0.1"; //overwritten |
452 | //logResponse.SimPort = 0; //overwritten | 452 | //logResponse.SimPort = 0; //overwritten |
453 | logResponse.Message = this.GetMessage(); | 453 | logResponse.Message = this.GetMessage(); |
454 | 454 | ||
455 | try | 455 | try |
456 | { | 456 | { |
457 | this.CustomiseResponse( logResponse, userProfile); | 457 | this.CustomiseResponse( logResponse, userProfile); |
458 | } | 458 | } |
459 | catch (Exception e) | 459 | catch (Exception e) |
460 | { | 460 | { |
461 | System.Console.WriteLine(e.ToString()); | 461 | System.Console.WriteLine(e.ToString()); |
462 | return logResponse.CreateDeadRegionResponse(); | 462 | return logResponse.CreateDeadRegionResponse(); |
463 | //return logResponse.ToXmlRpcResponse(); | 463 | //return logResponse.ToXmlRpcResponse(); |
464 | } | 464 | } |
465 | CommitAgent(ref userProfile); | 465 | CommitAgent(ref userProfile); |
466 | return logResponse.ToXmlRpcResponse(); | 466 | return logResponse.ToXmlRpcResponse(); |
467 | 467 | ||
468 | } | 468 | } |
469 | 469 | ||
470 | catch (Exception E) | 470 | catch (Exception E) |
471 | { | 471 | { |
472 | System.Console.WriteLine(E.ToString()); | 472 | System.Console.WriteLine(E.ToString()); |
473 | } | 473 | } |
474 | //} | 474 | //} |
475 | } | 475 | } |
476 | return response; | 476 | return response; |
477 | 477 | ||
478 | } | 478 | } |
479 | 479 | ||
480 | #endregion | 480 | #endregion |
481 | 481 | ||
482 | /// <summary> | 482 | /// <summary> |
483 | /// Deletes an active agent session | 483 | /// Deletes an active agent session |
484 | /// </summary> | 484 | /// </summary> |
485 | /// <param name="request">The request</param> | 485 | /// <param name="request">The request</param> |
486 | /// <param name="path">The path (eg /bork/narf/test)</param> | 486 | /// <param name="path">The path (eg /bork/narf/test)</param> |
487 | /// <param name="param">Parameters sent</param> | 487 | /// <param name="param">Parameters sent</param> |
488 | /// <returns>Success "OK" else error</returns> | 488 | /// <returns>Success "OK" else error</returns> |
489 | public string RestDeleteUserSessionMethod(string request, string path, string param) | 489 | public string RestDeleteUserSessionMethod(string request, string path, string param) |
490 | { | 490 | { |
491 | // TODO! Important! | 491 | // TODO! Important! |
492 | 492 | ||
493 | return "OK"; | 493 | return "OK"; |
494 | } | 494 | } |
495 | 495 | ||
496 | /// <summary> | 496 | /// <summary> |
497 | /// | 497 | /// |
498 | /// </summary> | 498 | /// </summary> |
499 | /// <param name="user"></param> | 499 | /// <param name="user"></param> |
500 | public void AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY) | 500 | public void AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY) |
501 | { | 501 | { |
502 | UserProfileData user = new UserProfileData(); | 502 | UserProfileData user = new UserProfileData(); |
503 | user.homeLocation = new LLVector3(128, 128, 100); | 503 | user.homeLocation = new LLVector3(128, 128, 100); |
504 | user.UUID = LLUUID.Random(); | 504 | user.UUID = LLUUID.Random(); |
505 | user.username = firstName; | 505 | user.username = firstName; |
506 | user.surname = lastName; | 506 | user.surname = lastName; |
507 | user.passwordHash = pass; | 507 | user.passwordHash = pass; |
508 | user.passwordSalt = ""; | 508 | user.passwordSalt = ""; |
509 | user.created = Util.UnixTimeSinceEpoch(); | 509 | user.created = Util.UnixTimeSinceEpoch(); |
510 | user.homeLookAt = new LLVector3(100, 100, 100); | 510 | user.homeLookAt = new LLVector3(100, 100, 100); |
511 | user.homeRegion = Util.UIntsToLong((regX * 256), (regY * 256)); | 511 | user.homeRegion = Util.UIntsToLong((regX * 256), (regY * 256)); |
512 | 512 | ||
513 | foreach (KeyValuePair<string, IUserData> plugin in _plugins) | 513 | foreach (KeyValuePair<string, IUserData> plugin in _plugins) |
514 | { | 514 | { |
515 | try | 515 | try |
516 | { | 516 | { |
517 | plugin.Value.addNewUserProfile(user); | 517 | plugin.Value.addNewUserProfile(user); |
518 | 518 | ||
519 | } | 519 | } |
520 | catch (Exception e) | 520 | catch (Exception e) |
521 | { | 521 | { |
522 | MainLog.Instance.Verbose("Unable to add user via " + plugin.Key + "(" + e.ToString() + ")"); | 522 | MainLog.Instance.Verbose("Unable to add user via " + plugin.Key + "(" + e.ToString() + ")"); |
523 | } | 523 | } |
524 | } | 524 | } |
525 | } | 525 | } |
526 | 526 | ||
527 | /// <summary> | 527 | /// <summary> |
528 | /// Returns an error message that the user could not be found in the database | 528 | /// Returns an error message that the user could not be found in the database |
529 | /// </summary> | 529 | /// </summary> |
530 | /// <returns>XML string consisting of a error element containing individual error(s)</returns> | 530 | /// <returns>XML string consisting of a error element containing individual error(s)</returns> |
531 | public XmlRpcResponse CreateUnknownUserErrorResponse() | 531 | public XmlRpcResponse CreateUnknownUserErrorResponse() |
532 | { | 532 | { |
533 | XmlRpcResponse response = new XmlRpcResponse(); | 533 | XmlRpcResponse response = new XmlRpcResponse(); |
534 | Hashtable responseData = new Hashtable(); | 534 | Hashtable responseData = new Hashtable(); |
535 | responseData["error_type"] = "unknown_user"; | 535 | responseData["error_type"] = "unknown_user"; |
536 | responseData["error_desc"] = "The user requested is not in the database"; | 536 | responseData["error_desc"] = "The user requested is not in the database"; |
537 | 537 | ||
538 | response.Value = responseData; | 538 | response.Value = responseData; |
539 | return response; | 539 | return response; |
540 | } | 540 | } |
541 | 541 | ||
542 | /// <summary> | 542 | /// <summary> |
543 | /// Converts a user profile to an XML element which can be returned | 543 | /// Converts a user profile to an XML element which can be returned |
544 | /// </summary> | 544 | /// </summary> |
545 | /// <param name="profile">The user profile</param> | 545 | /// <param name="profile">The user profile</param> |
546 | /// <returns>A string containing an XML Document of the user profile</returns> | 546 | /// <returns>A string containing an XML Document of the user profile</returns> |
547 | public XmlRpcResponse ProfileToXmlRPCResponse(UserProfileData profile) | 547 | public XmlRpcResponse ProfileToXmlRPCResponse(UserProfileData profile) |
548 | { | 548 | { |
549 | XmlRpcResponse response = new XmlRpcResponse(); | 549 | XmlRpcResponse response = new XmlRpcResponse(); |
550 | Hashtable responseData = new Hashtable(); | 550 | Hashtable responseData = new Hashtable(); |
551 | 551 | ||
552 | // Account information | 552 | // Account information |
553 | responseData["firstname"] = profile.username; | 553 | responseData["firstname"] = profile.username; |
554 | responseData["lastname"] = profile.surname; | 554 | responseData["lastname"] = profile.surname; |
555 | responseData["uuid"] = profile.UUID.ToStringHyphenated(); | 555 | responseData["uuid"] = profile.UUID.ToStringHyphenated(); |
556 | // Server Information | 556 | // Server Information |
557 | responseData["server_inventory"] = profile.userInventoryURI; | 557 | responseData["server_inventory"] = profile.userInventoryURI; |
558 | responseData["server_asset"] = profile.userAssetURI; | 558 | responseData["server_asset"] = profile.userAssetURI; |
559 | // Profile Information | 559 | // Profile Information |
560 | responseData["profile_about"] = profile.profileAboutText; | 560 | responseData["profile_about"] = profile.profileAboutText; |
561 | responseData["profile_firstlife_about"] = profile.profileFirstText; | 561 | responseData["profile_firstlife_about"] = profile.profileFirstText; |
562 | responseData["profile_firstlife_image"] = profile.profileFirstImage.ToStringHyphenated(); | 562 | responseData["profile_firstlife_image"] = profile.profileFirstImage.ToStringHyphenated(); |
563 | responseData["profile_can_do"] = profile.profileCanDoMask.ToString(); | 563 | responseData["profile_can_do"] = profile.profileCanDoMask.ToString(); |
564 | responseData["profile_want_do"] = profile.profileWantDoMask.ToString(); | 564 | responseData["profile_want_do"] = profile.profileWantDoMask.ToString(); |
565 | responseData["profile_image"] = profile.profileImage.ToStringHyphenated(); | 565 | responseData["profile_image"] = profile.profileImage.ToStringHyphenated(); |
566 | responseData["profile_created"] = profile.created.ToString(); | 566 | responseData["profile_created"] = profile.created.ToString(); |
567 | responseData["profile_lastlogin"] = profile.lastLogin.ToString(); | 567 | responseData["profile_lastlogin"] = profile.lastLogin.ToString(); |
568 | // Home region information | 568 | // Home region information |
569 | responseData["home_coordinates_x"] = profile.homeLocation.X.ToString(); | 569 | responseData["home_coordinates_x"] = profile.homeLocation.X.ToString(); |
570 | responseData["home_coordinates_y"] = profile.homeLocation.Y.ToString(); | 570 | responseData["home_coordinates_y"] = profile.homeLocation.Y.ToString(); |
571 | responseData["home_coordinates_z"] = profile.homeLocation.Z.ToString(); | 571 | responseData["home_coordinates_z"] = profile.homeLocation.Z.ToString(); |
572 | 572 | ||
573 | responseData["home_region"] = profile.homeRegion.ToString(); | 573 | responseData["home_region"] = profile.homeRegion.ToString(); |
574 | 574 | ||
575 | responseData["home_look_x"] = profile.homeLookAt.X.ToString(); | 575 | responseData["home_look_x"] = profile.homeLookAt.X.ToString(); |
576 | responseData["home_look_y"] = profile.homeLookAt.Y.ToString(); | 576 | responseData["home_look_y"] = profile.homeLookAt.Y.ToString(); |
577 | responseData["home_look_z"] = profile.homeLookAt.Z.ToString(); | 577 | responseData["home_look_z"] = profile.homeLookAt.Z.ToString(); |
578 | response.Value = responseData; | 578 | response.Value = responseData; |
579 | 579 | ||
580 | return response; | 580 | return response; |
581 | } | 581 | } |
582 | 582 | ||
583 | #region XMLRPC User Methods | 583 | #region XMLRPC User Methods |
584 | //should most likely move out of here and into the grid's userserver sub class | 584 | //should most likely move out of here and into the grid's userserver sub class |
585 | public XmlRpcResponse XmlRPCGetUserMethodName(XmlRpcRequest request) | 585 | public XmlRpcResponse XmlRPCGetUserMethodName(XmlRpcRequest request) |
586 | { | 586 | { |
587 | XmlRpcResponse response = new XmlRpcResponse(); | 587 | XmlRpcResponse response = new XmlRpcResponse(); |
588 | Hashtable requestData = (Hashtable)request.Params[0]; | 588 | Hashtable requestData = (Hashtable)request.Params[0]; |
589 | UserProfileData userProfile; | 589 | UserProfileData userProfile; |
590 | if (requestData.Contains("avatar_name")) | 590 | if (requestData.Contains("avatar_name")) |
591 | { | 591 | { |
592 | userProfile = getUserProfile((string)requestData["avatar_name"]); | 592 | userProfile = getUserProfile((string)requestData["avatar_name"]); |
593 | if (userProfile == null) | 593 | if (userProfile == null) |
594 | { | 594 | { |
595 | return CreateUnknownUserErrorResponse(); | 595 | return CreateUnknownUserErrorResponse(); |
596 | } | 596 | } |
597 | } | 597 | } |
598 | else | 598 | else |
599 | { | 599 | { |
600 | return CreateUnknownUserErrorResponse(); | 600 | return CreateUnknownUserErrorResponse(); |
601 | } | 601 | } |
602 | 602 | ||
603 | return ProfileToXmlRPCResponse(userProfile); | 603 | return ProfileToXmlRPCResponse(userProfile); |
604 | } | 604 | } |
605 | 605 | ||
606 | public XmlRpcResponse XmlRPCGetUserMethodUUID(XmlRpcRequest request) | 606 | public XmlRpcResponse XmlRPCGetUserMethodUUID(XmlRpcRequest request) |
607 | { | 607 | { |
608 | XmlRpcResponse response = new XmlRpcResponse(); | 608 | XmlRpcResponse response = new XmlRpcResponse(); |
609 | Hashtable requestData = (Hashtable)request.Params[0]; | 609 | Hashtable requestData = (Hashtable)request.Params[0]; |
610 | UserProfileData userProfile; | 610 | UserProfileData userProfile; |
611 | System.Console.WriteLine("METHOD BY UUID CALLED"); | 611 | System.Console.WriteLine("METHOD BY UUID CALLED"); |
612 | if (requestData.Contains("avatar_uuid")) | 612 | if (requestData.Contains("avatar_uuid")) |
613 | { | 613 | { |
614 | userProfile = getUserProfile((LLUUID)requestData["avatar_uuid"]); | 614 | userProfile = getUserProfile((LLUUID)requestData["avatar_uuid"]); |
615 | if (userProfile == null) | 615 | if (userProfile == null) |
616 | { | 616 | { |
617 | return CreateUnknownUserErrorResponse(); | 617 | return CreateUnknownUserErrorResponse(); |
618 | } | 618 | } |
619 | } | 619 | } |
620 | else | 620 | else |
621 | { | 621 | { |
622 | return CreateUnknownUserErrorResponse(); | 622 | return CreateUnknownUserErrorResponse(); |
623 | } | 623 | } |
624 | 624 | ||
625 | 625 | ||
626 | return ProfileToXmlRPCResponse(userProfile); | 626 | return ProfileToXmlRPCResponse(userProfile); |
627 | } | 627 | } |
628 | #endregion | 628 | #endregion |
629 | 629 | ||
630 | } | 630 | } |
631 | } | 631 | } |