diff options
author | Melanie | 2013-04-28 19:03:39 +0200 |
---|---|---|
committer | Melanie | 2013-04-28 19:03:39 +0200 |
commit | 4275d7a839d7380ee50aeadc38a31dd467bd891e (patch) | |
tree | 1e589fc3b448b580d1cc25b52215ef5ce2d7ae78 /OpenSim/Services/Interfaces | |
parent | Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork (diff) | |
parent | Controller module for dynamic floaters (WIP) (diff) | |
download | opensim-SC-4275d7a839d7380ee50aeadc38a31dd467bd891e.zip opensim-SC-4275d7a839d7380ee50aeadc38a31dd467bd891e.tar.gz opensim-SC-4275d7a839d7380ee50aeadc38a31dd467bd891e.tar.bz2 opensim-SC-4275d7a839d7380ee50aeadc38a31dd467bd891e.tar.xz |
Merge branch 'avination-current' of ssh://3dhosting.de/var/git/careminster into avination-current
Conflicts:
bin/Regions/Regions.ini.example
Diffstat (limited to 'OpenSim/Services/Interfaces')
-rw-r--r-- | OpenSim/Services/Interfaces/IAvatarService.cs | 21 | ||||
-rw-r--r-- | OpenSim/Services/Interfaces/IOfflineIMService.cs | 115 | ||||
-rw-r--r-- | OpenSim/Services/Interfaces/Properties/AssemblyInfo.cs | 4 |
3 files changed, 134 insertions, 6 deletions
diff --git a/OpenSim/Services/Interfaces/IAvatarService.cs b/OpenSim/Services/Interfaces/IAvatarService.cs index c0130f1..3663a7a 100644 --- a/OpenSim/Services/Interfaces/IAvatarService.cs +++ b/OpenSim/Services/Interfaces/IAvatarService.cs | |||
@@ -180,11 +180,18 @@ namespace OpenSim.Services.Interfaces | |||
180 | 180 | ||
181 | // Attachments | 181 | // Attachments |
182 | List<AvatarAttachment> attachments = appearance.GetAttachments(); | 182 | List<AvatarAttachment> attachments = appearance.GetAttachments(); |
183 | Dictionary<int, List<string>> atts = new Dictionary<int, List<string>>(); | ||
183 | foreach (AvatarAttachment attach in attachments) | 184 | foreach (AvatarAttachment attach in attachments) |
184 | { | 185 | { |
185 | if (attach.ItemID != UUID.Zero) | 186 | if (attach.ItemID != UUID.Zero) |
186 | Data["_ap_" + attach.AttachPoint] = attach.ItemID.ToString(); | 187 | { |
188 | if (!atts.ContainsKey(attach.AttachPoint)) | ||
189 | atts[attach.AttachPoint] = new List<string>(); | ||
190 | atts[attach.AttachPoint].Add(attach.ItemID.ToString()); | ||
191 | } | ||
187 | } | 192 | } |
193 | foreach (KeyValuePair<int, List<string>> kvp in atts) | ||
194 | Data["_ap_" + kvp.Key] = string.Join(",", kvp.Value.ToArray()); | ||
188 | } | 195 | } |
189 | 196 | ||
190 | public AvatarAppearance ToAvatarAppearance() | 197 | public AvatarAppearance ToAvatarAppearance() |
@@ -320,10 +327,16 @@ namespace OpenSim.Services.Interfaces | |||
320 | if (!Int32.TryParse(pointStr, out point)) | 327 | if (!Int32.TryParse(pointStr, out point)) |
321 | continue; | 328 | continue; |
322 | 329 | ||
323 | UUID uuid = UUID.Zero; | 330 | List<string> idList = new List<string>(_kvp.Value.Split(new char[] {','})); |
324 | UUID.TryParse(_kvp.Value, out uuid); | ||
325 | 331 | ||
326 | appearance.SetAttachment(point, uuid, UUID.Zero); | 332 | appearance.SetAttachment(point, UUID.Zero, UUID.Zero); |
333 | foreach (string id in idList) | ||
334 | { | ||
335 | UUID uuid = UUID.Zero; | ||
336 | UUID.TryParse(id, out uuid); | ||
337 | |||
338 | appearance.SetAttachment(point | 0x80, uuid, UUID.Zero); | ||
339 | } | ||
327 | } | 340 | } |
328 | 341 | ||
329 | if (appearance.Wearables[AvatarWearable.BODY].Count == 0) | 342 | if (appearance.Wearables[AvatarWearable.BODY].Count == 0) |
diff --git a/OpenSim/Services/Interfaces/IOfflineIMService.cs b/OpenSim/Services/Interfaces/IOfflineIMService.cs new file mode 100644 index 0000000..2848967 --- /dev/null +++ b/OpenSim/Services/Interfaces/IOfflineIMService.cs | |||
@@ -0,0 +1,115 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | using System; | ||
28 | using System.Collections.Generic; | ||
29 | |||
30 | using OpenSim.Framework; | ||
31 | using OpenMetaverse; | ||
32 | |||
33 | namespace OpenSim.Services.Interfaces | ||
34 | { | ||
35 | public interface IOfflineIMService | ||
36 | { | ||
37 | List<GridInstantMessage> GetMessages(UUID principalID); | ||
38 | bool StoreMessage(GridInstantMessage im, out string reason); | ||
39 | } | ||
40 | |||
41 | public class OfflineIMDataUtils | ||
42 | { | ||
43 | public static GridInstantMessage GridInstantMessage(Dictionary<string, object> dict) | ||
44 | { | ||
45 | GridInstantMessage im = new GridInstantMessage(); | ||
46 | |||
47 | if (dict.ContainsKey("BinaryBucket") && dict["BinaryBucket"] != null) | ||
48 | im.binaryBucket = OpenMetaverse.Utils.HexStringToBytes(dict["BinaryBucket"].ToString(), true); | ||
49 | |||
50 | if (dict.ContainsKey("Dialog") && dict["Dialog"] != null) | ||
51 | im.dialog = byte.Parse(dict["Dialog"].ToString()); | ||
52 | |||
53 | if (dict.ContainsKey("FromAgentID") && dict["FromAgentID"] != null) | ||
54 | im.fromAgentID = new Guid(dict["FromAgentID"].ToString()); | ||
55 | |||
56 | if (dict.ContainsKey("FromAgentName") && dict["FromAgentName"] != null) | ||
57 | im.fromAgentName = dict["FromAgentName"].ToString(); | ||
58 | else | ||
59 | im.fromAgentName = string.Empty; | ||
60 | |||
61 | if (dict.ContainsKey("FromGroup") && dict["FromGroup"] != null) | ||
62 | im.fromGroup = bool.Parse(dict["FromGroup"].ToString()); | ||
63 | |||
64 | if (dict.ContainsKey("SessionID") && dict["SessionID"] != null) | ||
65 | im.imSessionID = new Guid(dict["SessionID"].ToString()); | ||
66 | |||
67 | if (dict.ContainsKey("Message") && dict["Message"] != null) | ||
68 | im.message = dict["Message"].ToString(); | ||
69 | else | ||
70 | im.message = string.Empty; | ||
71 | |||
72 | if (dict.ContainsKey("Offline") && dict["Offline"] != null) | ||
73 | im.offline = byte.Parse(dict["Offline"].ToString()); | ||
74 | |||
75 | if (dict.ContainsKey("EstateID") && dict["EstateID"] != null) | ||
76 | im.ParentEstateID = UInt32.Parse(dict["EstateID"].ToString()); | ||
77 | |||
78 | if (dict.ContainsKey("Position") && dict["Position"] != null) | ||
79 | im.Position = Vector3.Parse(dict["Position"].ToString()); | ||
80 | |||
81 | if (dict.ContainsKey("RegionID") && dict["RegionID"] != null) | ||
82 | im.RegionID = new Guid(dict["RegionID"].ToString()); | ||
83 | |||
84 | if (dict.ContainsKey("Timestamp") && dict["Timestamp"] != null) | ||
85 | im.timestamp = UInt32.Parse(dict["Timestamp"].ToString()); | ||
86 | |||
87 | if (dict.ContainsKey("ToAgentID") && dict["ToAgentID"] != null) | ||
88 | im.toAgentID = new Guid(dict["ToAgentID"].ToString()); | ||
89 | |||
90 | return im; | ||
91 | } | ||
92 | |||
93 | public static Dictionary<string, object> GridInstantMessage(GridInstantMessage im) | ||
94 | { | ||
95 | Dictionary<string, object> dict = new Dictionary<string, object>(); | ||
96 | |||
97 | dict["BinaryBucket"] = OpenMetaverse.Utils.BytesToHexString(im.binaryBucket, im.binaryBucket.Length, null); | ||
98 | dict["Dialog"] = im.dialog.ToString(); | ||
99 | dict["FromAgentID"] = im.fromAgentID.ToString(); | ||
100 | dict["FromAgentName"] = im.fromAgentName == null ? string.Empty : im.fromAgentName; | ||
101 | dict["FromGroup"] = im.fromGroup.ToString(); | ||
102 | dict["SessionID"] = im.imSessionID.ToString(); | ||
103 | dict["Message"] = im.message == null ? string.Empty : im.message; | ||
104 | dict["Offline"] = im.offline.ToString(); | ||
105 | dict["EstateID"] = im.ParentEstateID.ToString(); | ||
106 | dict["Position"] = im.Position.ToString(); | ||
107 | dict["RegionID"] = im.RegionID.ToString(); | ||
108 | dict["Timestamp"] = im.timestamp.ToString(); | ||
109 | dict["ToAgentID"] = im.toAgentID.ToString(); | ||
110 | |||
111 | return dict; | ||
112 | } | ||
113 | |||
114 | } | ||
115 | } | ||
diff --git a/OpenSim/Services/Interfaces/Properties/AssemblyInfo.cs b/OpenSim/Services/Interfaces/Properties/AssemblyInfo.cs index 4723553..47ece75 100644 --- a/OpenSim/Services/Interfaces/Properties/AssemblyInfo.cs +++ b/OpenSim/Services/Interfaces/Properties/AssemblyInfo.cs | |||
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices; | |||
29 | // Build Number | 29 | // Build Number |
30 | // Revision | 30 | // Revision |
31 | // | 31 | // |
32 | [assembly: AssemblyVersion("0.7.5.*")] | 32 | [assembly: AssemblyVersion("0.7.6.*")] |
33 | [assembly: AssemblyFileVersion("1.0.0.0")] | 33 | |