aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/AgentCircuitData.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/AgentCircuitData.cs')
-rw-r--r--OpenSim/Framework/AgentCircuitData.cs60
1 files changed, 59 insertions, 1 deletions
diff --git a/OpenSim/Framework/AgentCircuitData.cs b/OpenSim/Framework/AgentCircuitData.cs
index c0168e2..e655aa4 100644
--- a/OpenSim/Framework/AgentCircuitData.cs
+++ b/OpenSim/Framework/AgentCircuitData.cs
@@ -155,6 +155,37 @@ namespace OpenSim.Framework
155 args["secure_session_id"] = OSD.FromUUID(SecureSessionID); 155 args["secure_session_id"] = OSD.FromUUID(SecureSessionID);
156 args["session_id"] = OSD.FromUUID(SessionID); 156 args["session_id"] = OSD.FromUUID(SessionID);
157 args["start_pos"] = OSD.FromString(startpos.ToString()); 157 args["start_pos"] = OSD.FromString(startpos.ToString());
158 args["appearance_serial"] = OSD.FromInteger(Appearance.Serial);
159
160 if (Appearance != null)
161 {
162 //System.Console.WriteLine("XXX Before packing Wearables");
163 if ((Appearance.Wearables != null) && (Appearance.Wearables.Length > 0))
164 {
165 OSDArray wears = new OSDArray(Appearance.Wearables.Length * 2);
166 foreach (AvatarWearable awear in Appearance.Wearables)
167 {
168 wears.Add(OSD.FromUUID(awear.ItemID));
169 wears.Add(OSD.FromUUID(awear.AssetID));
170 //System.Console.WriteLine("XXX ItemID=" + awear.ItemID + " assetID=" + awear.AssetID);
171 }
172 args["wearables"] = wears;
173 }
174
175 //System.Console.WriteLine("XXX Before packing Attachments");
176 Dictionary<int, UUID[]> attachments = Appearance.GetAttachmentDictionary();
177 if ((attachments != null) && (attachments.Count > 0))
178 {
179 OSDArray attachs = new OSDArray(attachments.Count);
180 foreach (KeyValuePair<int, UUID[]> kvp in attachments)
181 {
182 AttachmentData adata = new AttachmentData(kvp.Key, kvp.Value[0], kvp.Value[1]);
183 attachs.Add(adata.PackUpdateMessage());
184 //System.Console.WriteLine("XXX att.pt=" + kvp.Key + "; itemID=" + kvp.Value[0] + "; assetID=" + kvp.Value[1]);
185 }
186 args["attachments"] = attachs;
187 }
188 }
158 189
159 return args; 190 return args;
160 } 191 }
@@ -209,8 +240,35 @@ namespace OpenSim.Framework
209 if (args["session_id"] != null) 240 if (args["session_id"] != null)
210 SessionID = args["session_id"].AsUUID(); 241 SessionID = args["session_id"].AsUUID();
211 if (args["start_pos"] != null) 242 if (args["start_pos"] != null)
212 Vector3.TryParse(args["start_pos"].AsString(), out startpos); 243 Vector3.TryParse(args["start_pos"].AsString(), out startpos);
213 244
245 Appearance = new AvatarAppearance(AgentID);
246 if (args["appearance_serial"] != null)
247 Appearance.Serial = args["appearance_serial"].AsInteger();
248 if ((args["wearables"] != null) && (args["wearables"]).Type == OSDType.Array)
249 {
250 OSDArray wears = (OSDArray)(args["wearables"]);
251 for (int i = 0; i < wears.Count / 2; i++)
252 {
253 Appearance.Wearables[i].ItemID = wears[i*2].AsUUID();
254 Appearance.Wearables[i].AssetID = wears[(i*2)+1].AsUUID();
255 }
256 }
257
258 if ((args["attachments"] != null) && (args["attachments"]).Type == OSDType.Array)
259 {
260 OSDArray attachs = (OSDArray)(args["attachments"]);
261 AttachmentData[] attachments = new AttachmentData[attachs.Count];
262 int i = 0;
263 foreach (OSD o in attachs)
264 {
265 if (o.Type == OSDType.Map)
266 {
267 attachments[i++] = new AttachmentData((OSDMap)o);
268 }
269 }
270 Appearance.SetAttachments(attachments);
271 }
214 272
215 } 273 }
216 } 274 }