aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Interfaces/IAvatarService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Services/Interfaces/IAvatarService.cs')
-rw-r--r--OpenSim/Services/Interfaces/IAvatarService.cs46
1 files changed, 37 insertions, 9 deletions
diff --git a/OpenSim/Services/Interfaces/IAvatarService.cs b/OpenSim/Services/Interfaces/IAvatarService.cs
index 863fd93..892e0b4 100644
--- a/OpenSim/Services/Interfaces/IAvatarService.cs
+++ b/OpenSim/Services/Interfaces/IAvatarService.cs
@@ -162,10 +162,15 @@ namespace OpenSim.Services.Interfaces
162 } 162 }
163 163
164 // Visual Params 164 // Visual Params
165 string[] vps = new string[AvatarAppearance.VISUALPARAM_COUNT]; 165 //string[] vps = new string[AvatarAppearance.VISUALPARAM_COUNT];
166 //byte[] binary = appearance.VisualParams;
167
168 // for (int i = 0 ; i < AvatarAppearance.VISUALPARAM_COUNT ; i++)
169
166 byte[] binary = appearance.VisualParams; 170 byte[] binary = appearance.VisualParams;
171 string[] vps = new string[binary.Length];
167 172
168 for (int i = 0 ; i < AvatarAppearance.VISUALPARAM_COUNT ; i++) 173 for (int i = 0; i < binary.Length; i++)
169 { 174 {
170 vps[i] = binary[i].ToString(); 175 vps[i] = binary[i].ToString();
171 } 176 }
@@ -174,11 +179,18 @@ namespace OpenSim.Services.Interfaces
174 179
175 // Attachments 180 // Attachments
176 List<AvatarAttachment> attachments = appearance.GetAttachments(); 181 List<AvatarAttachment> attachments = appearance.GetAttachments();
182 Dictionary<int, List<string>> atts = new Dictionary<int, List<string>>();
177 foreach (AvatarAttachment attach in attachments) 183 foreach (AvatarAttachment attach in attachments)
178 { 184 {
179 if (attach.ItemID != UUID.Zero) 185 if (attach.ItemID != UUID.Zero)
180 Data["_ap_" + attach.AttachPoint] = attach.ItemID.ToString(); 186 {
187 if (!atts.ContainsKey(attach.AttachPoint))
188 atts[attach.AttachPoint] = new List<string>();
189 atts[attach.AttachPoint].Add(attach.ItemID.ToString());
190 }
181 } 191 }
192 foreach (KeyValuePair<int, List<string>> kvp in atts)
193 Data["_ap_" + kvp.Key] = string.Join(",", kvp.Value.ToArray());
182 } 194 }
183 195
184 public AvatarAppearance ToAvatarAppearance() 196 public AvatarAppearance ToAvatarAppearance()
@@ -195,7 +207,13 @@ namespace OpenSim.Services.Interfaces
195 appearance.Serial = Int32.Parse(Data["Serial"]); 207 appearance.Serial = Int32.Parse(Data["Serial"]);
196 208
197 if (Data.ContainsKey("AvatarHeight")) 209 if (Data.ContainsKey("AvatarHeight"))
198 appearance.AvatarHeight = float.Parse(Data["AvatarHeight"]); 210 {
211 float h = float.Parse(Data["AvatarHeight"]);
212 if( h == 0f)
213 h = 1.9f;
214
215 appearance.AvatarHeight = h;
216 }
199 217
200 // Legacy Wearables 218 // Legacy Wearables
201 if (Data.ContainsKey("BodyItem")) 219 if (Data.ContainsKey("BodyItem"))
@@ -266,9 +284,13 @@ namespace OpenSim.Services.Interfaces
266 if (Data.ContainsKey("VisualParams")) 284 if (Data.ContainsKey("VisualParams"))
267 { 285 {
268 string[] vps = Data["VisualParams"].Split(new char[] {','}); 286 string[] vps = Data["VisualParams"].Split(new char[] {','});
269 byte[] binary = new byte[AvatarAppearance.VISUALPARAM_COUNT]; 287 //byte[] binary = new byte[AvatarAppearance.VISUALPARAM_COUNT];
270 288
271 for (int i = 0 ; i < vps.Length && i < binary.Length ; i++) 289 //for (int i = 0 ; i < vps.Length && i < binary.Length ; i++)
290
291 byte[] binary = new byte[vps.Length];
292
293 for (int i = 0; i < vps.Length; i++)
272 binary[i] = (byte)Convert.ToInt32(vps[i]); 294 binary[i] = (byte)Convert.ToInt32(vps[i]);
273 295
274 appearance.VisualParams = binary; 296 appearance.VisualParams = binary;
@@ -304,10 +326,16 @@ namespace OpenSim.Services.Interfaces
304 if (!Int32.TryParse(pointStr, out point)) 326 if (!Int32.TryParse(pointStr, out point))
305 continue; 327 continue;
306 328
307 UUID uuid = UUID.Zero; 329 List<string> idList = new List<string>(_kvp.Value.Split(new char[] {','}));
308 UUID.TryParse(_kvp.Value, out uuid);
309 330
310 appearance.SetAttachment(point, uuid, UUID.Zero); 331 appearance.SetAttachment(point, UUID.Zero, UUID.Zero);
332 foreach (string id in idList)
333 {
334 UUID uuid = UUID.Zero;
335 UUID.TryParse(id, out uuid);
336
337 appearance.SetAttachment(point | 0x80, uuid, UUID.Zero);
338 }
311 } 339 }
312 340
313 if (appearance.Wearables[AvatarWearable.BODY].Count == 0) 341 if (appearance.Wearables[AvatarWearable.BODY].Count == 0)