aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/AgentCircuitData.cs
diff options
context:
space:
mode:
authorDiva Canto2010-01-12 09:22:58 -0800
committerDiva Canto2010-01-12 09:22:58 -0800
commit66920a9047b54db947d02f252e17409b7fc32ef0 (patch)
tree8e5b34a510885183e400796616f224faceb4a142 /OpenSim/Framework/AgentCircuitData.cs
parentFixed a couple of bugs with Appearance. Appearance is all good now. (diff)
downloadopensim-SC_OLD-66920a9047b54db947d02f252e17409b7fc32ef0.zip
opensim-SC_OLD-66920a9047b54db947d02f252e17409b7fc32ef0.tar.gz
opensim-SC_OLD-66920a9047b54db947d02f252e17409b7fc32ef0.tar.bz2
opensim-SC_OLD-66920a9047b54db947d02f252e17409b7fc32ef0.tar.xz
Fixed more appearance woes that showed up using remote connectors. Appearance is now being passed with AgentCircuitData, as it should be.
Diffstat (limited to 'OpenSim/Framework/AgentCircuitData.cs')
-rw-r--r--OpenSim/Framework/AgentCircuitData.cs54
1 files changed, 53 insertions, 1 deletions
diff --git a/OpenSim/Framework/AgentCircuitData.cs b/OpenSim/Framework/AgentCircuitData.cs
index c0168e2..ad29950 100644
--- a/OpenSim/Framework/AgentCircuitData.cs
+++ b/OpenSim/Framework/AgentCircuitData.cs
@@ -155,6 +155,31 @@ 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 // We might not pass this in all cases...
161 if ((Appearance.Wearables != null) && (Appearance.Wearables.Length > 0))
162 {
163 OSDArray wears = new OSDArray(Appearance.Wearables.Length);
164 foreach (AvatarWearable awear in Appearance.Wearables)
165 {
166 wears.Add(OSD.FromUUID(awear.ItemID));
167 wears.Add(OSD.FromUUID(awear.AssetID));
168 }
169 args["wearables"] = wears;
170 }
171
172 Dictionary<int, UUID[]> attachments = Appearance.GetAttachmentDictionary();
173 if ((attachments != null) && (attachments.Count > 0))
174 {
175 OSDArray attachs = new OSDArray(attachments.Count);
176 foreach (KeyValuePair<int, UUID[]> kvp in attachments)
177 {
178 AttachmentData adata = new AttachmentData(kvp.Key, kvp.Value[0], kvp.Value[1]);
179 attachs.Add(adata.PackUpdateMessage());
180 }
181 args["attachments"] = attachs;
182 }
158 183
159 return args; 184 return args;
160 } 185 }
@@ -209,8 +234,35 @@ namespace OpenSim.Framework
209 if (args["session_id"] != null) 234 if (args["session_id"] != null)
210 SessionID = args["session_id"].AsUUID(); 235 SessionID = args["session_id"].AsUUID();
211 if (args["start_pos"] != null) 236 if (args["start_pos"] != null)
212 Vector3.TryParse(args["start_pos"].AsString(), out startpos); 237 Vector3.TryParse(args["start_pos"].AsString(), out startpos);
213 238
239 Appearance = new AvatarAppearance(AgentID);
240 if (args["appearance_serial"] != null)
241 Appearance.Serial = args["appearance_serial"].AsInteger();
242 if ((args["wearables"] != null) && (args["wearables"]).Type == OSDType.Array)
243 {
244 OSDArray wears = (OSDArray)(args["wearables"]);
245 for (int i = 0; i < wears.Count / 2; i++)
246 {
247 Appearance.Wearables[i].ItemID = wears[i*2].AsUUID();
248 Appearance.Wearables[i].AssetID = wears[(i*2)+1].AsUUID();
249 }
250 }
251
252 if ((args["attachments"] != null) && (args["attachments"]).Type == OSDType.Array)
253 {
254 OSDArray attachs = (OSDArray)(args["attachments"]);
255 AttachmentData[] attachments = new AttachmentData[attachs.Count];
256 int i = 0;
257 foreach (OSD o in attachs)
258 {
259 if (o.Type == OSDType.Map)
260 {
261 attachments[i++] = new AttachmentData((OSDMap)o);
262 }
263 }
264 Appearance.SetAttachments(attachments);
265 }
214 266
215 } 267 }
216 } 268 }