diff options
Diffstat (limited to 'OpenSim/Framework/AgentCircuitData.cs')
-rw-r--r-- | OpenSim/Framework/AgentCircuitData.cs | 123 |
1 files changed, 113 insertions, 10 deletions
diff --git a/OpenSim/Framework/AgentCircuitData.cs b/OpenSim/Framework/AgentCircuitData.cs index c0168e2..353e5bf 100644 --- a/OpenSim/Framework/AgentCircuitData.cs +++ b/OpenSim/Framework/AgentCircuitData.cs | |||
@@ -75,6 +75,11 @@ namespace OpenSim.Framework | |||
75 | public uint circuitcode; | 75 | public uint circuitcode; |
76 | 76 | ||
77 | /// <summary> | 77 | /// <summary> |
78 | /// How this agent got here | ||
79 | /// </summary> | ||
80 | public uint teleportFlags; | ||
81 | |||
82 | /// <summary> | ||
78 | /// Agent's account first name | 83 | /// Agent's account first name |
79 | /// </summary> | 84 | /// </summary> |
80 | public string firstname; | 85 | public string firstname; |
@@ -97,10 +102,18 @@ namespace OpenSim.Framework | |||
97 | public UUID SessionID; | 102 | public UUID SessionID; |
98 | 103 | ||
99 | /// <summary> | 104 | /// <summary> |
105 | /// Hypergrid service token; generated by the user domain, consumed by the receiving grid. | ||
106 | /// There is one such unique token for each grid visited. | ||
107 | /// </summary> | ||
108 | public string ServiceSessionID = string.Empty; | ||
109 | |||
110 | /// <summary> | ||
100 | /// Position the Agent's Avatar starts in the region | 111 | /// Position the Agent's Avatar starts in the region |
101 | /// </summary> | 112 | /// </summary> |
102 | public Vector3 startpos; | 113 | public Vector3 startpos; |
103 | 114 | ||
115 | public Dictionary<string, object> ServiceURLs; | ||
116 | |||
104 | public AgentCircuitData() | 117 | public AgentCircuitData() |
105 | { | 118 | { |
106 | } | 119 | } |
@@ -136,17 +149,19 @@ namespace OpenSim.Framework | |||
136 | args["base_folder"] = OSD.FromUUID(BaseFolder); | 149 | args["base_folder"] = OSD.FromUUID(BaseFolder); |
137 | args["caps_path"] = OSD.FromString(CapsPath); | 150 | args["caps_path"] = OSD.FromString(CapsPath); |
138 | 151 | ||
139 | OSDArray childrenSeeds = new OSDArray(ChildrenCapSeeds.Count); | 152 | if (ChildrenCapSeeds != null) |
140 | foreach (KeyValuePair<ulong, string> kvp in ChildrenCapSeeds) | ||
141 | { | 153 | { |
142 | OSDMap pair = new OSDMap(); | 154 | OSDArray childrenSeeds = new OSDArray(ChildrenCapSeeds.Count); |
143 | pair["handle"] = OSD.FromString(kvp.Key.ToString()); | 155 | foreach (KeyValuePair<ulong, string> kvp in ChildrenCapSeeds) |
144 | pair["seed"] = OSD.FromString(kvp.Value); | 156 | { |
145 | childrenSeeds.Add(pair); | 157 | OSDMap pair = new OSDMap(); |
158 | pair["handle"] = OSD.FromString(kvp.Key.ToString()); | ||
159 | pair["seed"] = OSD.FromString(kvp.Value); | ||
160 | childrenSeeds.Add(pair); | ||
161 | } | ||
162 | if (ChildrenCapSeeds.Count > 0) | ||
163 | args["children_seeds"] = childrenSeeds; | ||
146 | } | 164 | } |
147 | if (ChildrenCapSeeds.Count > 0) | ||
148 | args["children_seeds"] = childrenSeeds; | ||
149 | |||
150 | args["child"] = OSD.FromBoolean(child); | 165 | args["child"] = OSD.FromBoolean(child); |
151 | args["circuit_code"] = OSD.FromString(circuitcode.ToString()); | 166 | args["circuit_code"] = OSD.FromString(circuitcode.ToString()); |
152 | args["first_name"] = OSD.FromString(firstname); | 167 | args["first_name"] = OSD.FromString(firstname); |
@@ -154,7 +169,52 @@ namespace OpenSim.Framework | |||
154 | args["inventory_folder"] = OSD.FromUUID(InventoryFolder); | 169 | args["inventory_folder"] = OSD.FromUUID(InventoryFolder); |
155 | args["secure_session_id"] = OSD.FromUUID(SecureSessionID); | 170 | args["secure_session_id"] = OSD.FromUUID(SecureSessionID); |
156 | args["session_id"] = OSD.FromUUID(SessionID); | 171 | args["session_id"] = OSD.FromUUID(SessionID); |
172 | |||
173 | args["service_session_id"] = OSD.FromString(ServiceSessionID); | ||
157 | args["start_pos"] = OSD.FromString(startpos.ToString()); | 174 | args["start_pos"] = OSD.FromString(startpos.ToString()); |
175 | args["appearance_serial"] = OSD.FromInteger(Appearance.Serial); | ||
176 | |||
177 | if (Appearance != null) | ||
178 | { | ||
179 | //System.Console.WriteLine("XXX Before packing Wearables"); | ||
180 | if ((Appearance.Wearables != null) && (Appearance.Wearables.Length > 0)) | ||
181 | { | ||
182 | OSDArray wears = new OSDArray(Appearance.Wearables.Length * 2); | ||
183 | foreach (AvatarWearable awear in Appearance.Wearables) | ||
184 | { | ||
185 | wears.Add(OSD.FromUUID(awear.ItemID)); | ||
186 | wears.Add(OSD.FromUUID(awear.AssetID)); | ||
187 | //System.Console.WriteLine("XXX ItemID=" + awear.ItemID + " assetID=" + awear.AssetID); | ||
188 | } | ||
189 | args["wearables"] = wears; | ||
190 | } | ||
191 | |||
192 | //System.Console.WriteLine("XXX Before packing Attachments"); | ||
193 | Dictionary<int, UUID[]> attachments = Appearance.GetAttachmentDictionary(); | ||
194 | if ((attachments != null) && (attachments.Count > 0)) | ||
195 | { | ||
196 | OSDArray attachs = new OSDArray(attachments.Count); | ||
197 | foreach (KeyValuePair<int, UUID[]> kvp in attachments) | ||
198 | { | ||
199 | AttachmentData adata = new AttachmentData(kvp.Key, kvp.Value[0], kvp.Value[1]); | ||
200 | attachs.Add(adata.PackUpdateMessage()); | ||
201 | //System.Console.WriteLine("XXX att.pt=" + kvp.Key + "; itemID=" + kvp.Value[0] + "; assetID=" + kvp.Value[1]); | ||
202 | } | ||
203 | args["attachments"] = attachs; | ||
204 | } | ||
205 | } | ||
206 | |||
207 | if (ServiceURLs != null && ServiceURLs.Count > 0) | ||
208 | { | ||
209 | OSDArray urls = new OSDArray(ServiceURLs.Count * 2); | ||
210 | foreach (KeyValuePair<string, object> kvp in ServiceURLs) | ||
211 | { | ||
212 | //System.Console.WriteLine("XXX " + kvp.Key + "=" + kvp.Value); | ||
213 | urls.Add(OSD.FromString(kvp.Key)); | ||
214 | urls.Add(OSD.FromString((kvp.Value == null) ? string.Empty : kvp.Value.ToString())); | ||
215 | } | ||
216 | args["service_urls"] = urls; | ||
217 | } | ||
158 | 218 | ||
159 | return args; | 219 | return args; |
160 | } | 220 | } |
@@ -193,6 +253,8 @@ namespace OpenSim.Framework | |||
193 | } | 253 | } |
194 | } | 254 | } |
195 | } | 255 | } |
256 | else | ||
257 | ChildrenCapSeeds = new Dictionary<ulong, string>(); | ||
196 | 258 | ||
197 | if (args["child"] != null) | 259 | if (args["child"] != null) |
198 | child = args["child"].AsBoolean(); | 260 | child = args["child"].AsBoolean(); |
@@ -208,10 +270,51 @@ namespace OpenSim.Framework | |||
208 | SecureSessionID = args["secure_session_id"].AsUUID(); | 270 | SecureSessionID = args["secure_session_id"].AsUUID(); |
209 | if (args["session_id"] != null) | 271 | if (args["session_id"] != null) |
210 | SessionID = args["session_id"].AsUUID(); | 272 | SessionID = args["session_id"].AsUUID(); |
273 | if (args["service_session_id"] != null) | ||
274 | ServiceSessionID = args["service_session_id"].AsString(); | ||
275 | |||
211 | if (args["start_pos"] != null) | 276 | if (args["start_pos"] != null) |
212 | Vector3.TryParse(args["start_pos"].AsString(), out startpos); | 277 | Vector3.TryParse(args["start_pos"].AsString(), out startpos); |
278 | |||
279 | Appearance = new AvatarAppearance(AgentID); | ||
280 | if (args["appearance_serial"] != null) | ||
281 | Appearance.Serial = args["appearance_serial"].AsInteger(); | ||
282 | if ((args["wearables"] != null) && (args["wearables"]).Type == OSDType.Array) | ||
283 | { | ||
284 | OSDArray wears = (OSDArray)(args["wearables"]); | ||
285 | for (int i = 0; i < wears.Count / 2; i++) | ||
286 | { | ||
287 | Appearance.Wearables[i].ItemID = wears[i*2].AsUUID(); | ||
288 | Appearance.Wearables[i].AssetID = wears[(i*2)+1].AsUUID(); | ||
289 | } | ||
290 | } | ||
291 | |||
292 | if ((args["attachments"] != null) && (args["attachments"]).Type == OSDType.Array) | ||
293 | { | ||
294 | OSDArray attachs = (OSDArray)(args["attachments"]); | ||
295 | AttachmentData[] attachments = new AttachmentData[attachs.Count]; | ||
296 | int i = 0; | ||
297 | foreach (OSD o in attachs) | ||
298 | { | ||
299 | if (o.Type == OSDType.Map) | ||
300 | { | ||
301 | attachments[i++] = new AttachmentData((OSDMap)o); | ||
302 | } | ||
303 | } | ||
304 | Appearance.SetAttachments(attachments); | ||
305 | } | ||
213 | 306 | ||
307 | ServiceURLs = new Dictionary<string, object>(); | ||
308 | if (args.ContainsKey("service_urls") && args["service_urls"] != null && (args["service_urls"]).Type == OSDType.Array) | ||
309 | { | ||
310 | OSDArray urls = (OSDArray)(args["service_urls"]); | ||
311 | for (int i = 0; i < urls.Count / 2; i++) | ||
312 | { | ||
313 | ServiceURLs[urls[i * 2].AsString()] = urls[(i * 2) + 1].AsString(); | ||
314 | //System.Console.WriteLine("XXX " + urls[i * 2].AsString() + "=" + urls[(i * 2) + 1].AsString()); | ||
214 | 315 | ||
316 | } | ||
317 | } | ||
215 | } | 318 | } |
216 | } | 319 | } |
217 | 320 | ||