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.cs50
1 files changed, 40 insertions, 10 deletions
diff --git a/OpenSim/Services/Interfaces/IAvatarService.cs b/OpenSim/Services/Interfaces/IAvatarService.cs
index 863fd93..3663a7a 100644
--- a/OpenSim/Services/Interfaces/IAvatarService.cs
+++ b/OpenSim/Services/Interfaces/IAvatarService.cs
@@ -162,10 +162,16 @@ 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
170
166 byte[] binary = appearance.VisualParams; 171 byte[] binary = appearance.VisualParams;
172 string[] vps = new string[binary.Length];
167 173
168 for (int i = 0 ; i < AvatarAppearance.VISUALPARAM_COUNT ; i++) 174 for (int i = 0; i < binary.Length; i++)
169 { 175 {
170 vps[i] = binary[i].ToString(); 176 vps[i] = binary[i].ToString();
171 } 177 }
@@ -174,11 +180,18 @@ namespace OpenSim.Services.Interfaces
174 180
175 // Attachments 181 // Attachments
176 List<AvatarAttachment> attachments = appearance.GetAttachments(); 182 List<AvatarAttachment> attachments = appearance.GetAttachments();
183 Dictionary<int, List<string>> atts = new Dictionary<int, List<string>>();
177 foreach (AvatarAttachment attach in attachments) 184 foreach (AvatarAttachment attach in attachments)
178 { 185 {
179 if (attach.ItemID != UUID.Zero) 186 if (attach.ItemID != UUID.Zero)
180 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 }
181 } 192 }
193 foreach (KeyValuePair<int, List<string>> kvp in atts)
194 Data["_ap_" + kvp.Key] = string.Join(",", kvp.Value.ToArray());
182 } 195 }
183 196
184 public AvatarAppearance ToAvatarAppearance() 197 public AvatarAppearance ToAvatarAppearance()
@@ -195,7 +208,13 @@ namespace OpenSim.Services.Interfaces
195 appearance.Serial = Int32.Parse(Data["Serial"]); 208 appearance.Serial = Int32.Parse(Data["Serial"]);
196 209
197 if (Data.ContainsKey("AvatarHeight")) 210 if (Data.ContainsKey("AvatarHeight"))
198 appearance.AvatarHeight = float.Parse(Data["AvatarHeight"]); 211 {
212 float h = float.Parse(Data["AvatarHeight"]);
213 if( h == 0f)
214 h = 1.9f;
215 appearance.SetSize(new Vector3(0.45f, 0.6f, h ));
216// appearance.AvatarHeight = float.Parse(Data["AvatarHeight"]);
217 }
199 218
200 // Legacy Wearables 219 // Legacy Wearables
201 if (Data.ContainsKey("BodyItem")) 220 if (Data.ContainsKey("BodyItem"))
@@ -266,10 +285,14 @@ namespace OpenSim.Services.Interfaces
266 if (Data.ContainsKey("VisualParams")) 285 if (Data.ContainsKey("VisualParams"))
267 { 286 {
268 string[] vps = Data["VisualParams"].Split(new char[] {','}); 287 string[] vps = Data["VisualParams"].Split(new char[] {','});
269 byte[] binary = new byte[AvatarAppearance.VISUALPARAM_COUNT]; 288 // byte[] binary = new byte[AvatarAppearance.VISUALPARAM_COUNT];
270 289
271 for (int i = 0 ; i < vps.Length && i < binary.Length ; i++) 290 // for (int i = 0 ; i < vps.Length && i < binary.Length ; i++)
272 binary[i] = (byte)Convert.ToInt32(vps[i]); 291 byte[] binary = new byte[vps.Length];
292
293 for (int i = 0; i < vps.Length; i++)
294
295 binary[i] = (byte)Convert.ToInt32(vps[i]);
273 296
274 appearance.VisualParams = binary; 297 appearance.VisualParams = binary;
275 } 298 }
@@ -304,10 +327,16 @@ namespace OpenSim.Services.Interfaces
304 if (!Int32.TryParse(pointStr, out point)) 327 if (!Int32.TryParse(pointStr, out point))
305 continue; 328 continue;
306 329
307 UUID uuid = UUID.Zero; 330 List<string> idList = new List<string>(_kvp.Value.Split(new char[] {','}));
308 UUID.TryParse(_kvp.Value, out uuid); 331
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);
309 337
310 appearance.SetAttachment(point, uuid, UUID.Zero); 338 appearance.SetAttachment(point | 0x80, uuid, UUID.Zero);
339 }
311 } 340 }
312 341
313 if (appearance.Wearables[AvatarWearable.BODY].Count == 0) 342 if (appearance.Wearables[AvatarWearable.BODY].Count == 0)
@@ -329,6 +358,7 @@ namespace OpenSim.Services.Interfaces
329 appearance.Wearables[AvatarWearable.EYES].Wear( 358 appearance.Wearables[AvatarWearable.EYES].Wear(
330 AvatarWearable.DefaultWearables[ 359 AvatarWearable.DefaultWearables[
331 AvatarWearable.EYES][0]); 360 AvatarWearable.EYES][0]);
361
332 } 362 }
333 catch 363 catch
334 { 364 {