diff options
author | onefang | 2019-09-11 16:36:50 +1000 |
---|---|---|
committer | onefang | 2019-09-11 16:36:50 +1000 |
commit | 50cd1ffd32f69228e566f2b0b89f86ea0d9fe489 (patch) | |
tree | 52f2ab0c04f1a5d7d6ac5dc872981b4b156447e7 /OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs | |
parent | Renamed branch to SledjChisl. (diff) | |
parent | Bump to release flavour, build 0. (diff) | |
download | opensim-SC_OLD-50cd1ffd32f69228e566f2b0b89f86ea0d9fe489.zip opensim-SC_OLD-50cd1ffd32f69228e566f2b0b89f86ea0d9fe489.tar.gz opensim-SC_OLD-50cd1ffd32f69228e566f2b0b89f86ea0d9fe489.tar.bz2 opensim-SC_OLD-50cd1ffd32f69228e566f2b0b89f86ea0d9fe489.tar.xz |
Merge branch 'SledjChisl'
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs | 110 |
1 files changed, 71 insertions, 39 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs index 384af74..461f776 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs | |||
@@ -32,6 +32,8 @@ using OpenMetaverse.Packets; | |||
32 | using OpenMetaverse.StructuredData; | 32 | using OpenMetaverse.StructuredData; |
33 | using OpenMetaverse.Messages.Linden; | 33 | using OpenMetaverse.Messages.Linden; |
34 | 34 | ||
35 | using OpenSim.Framework; | ||
36 | |||
35 | namespace OpenSim.Region.ClientStack.Linden | 37 | namespace OpenSim.Region.ClientStack.Linden |
36 | { | 38 | { |
37 | public class EventQueueHelper | 39 | public class EventQueueHelper |
@@ -76,9 +78,9 @@ namespace OpenSim.Region.ClientStack.Linden | |||
76 | 78 | ||
77 | llsdSimInfo.Add("Handle", new OSDBinary(ulongToByteArray(handle))); | 79 | llsdSimInfo.Add("Handle", new OSDBinary(ulongToByteArray(handle))); |
78 | llsdSimInfo.Add("IP", new OSDBinary(endPoint.Address.GetAddressBytes())); | 80 | llsdSimInfo.Add("IP", new OSDBinary(endPoint.Address.GetAddressBytes())); |
79 | llsdSimInfo.Add("Port", new OSDInteger(endPoint.Port)); | 81 | llsdSimInfo.Add("Port", OSD.FromInteger(endPoint.Port)); |
80 | llsdSimInfo.Add("RegionSizeX", OSD.FromUInteger((uint) regionSizeX)); | 82 | llsdSimInfo.Add("RegionSizeX", OSD.FromUInteger((uint)regionSizeX)); |
81 | llsdSimInfo.Add("RegionSizeY", OSD.FromUInteger((uint) regionSizeY)); | 83 | llsdSimInfo.Add("RegionSizeY", OSD.FromUInteger((uint)regionSizeY)); |
82 | 84 | ||
83 | OSDArray arr = new OSDArray(1); | 85 | OSDArray arr = new OSDArray(1); |
84 | arr.Add(llsdSimInfo); | 86 | arr.Add(llsdSimInfo); |
@@ -88,7 +90,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
88 | 90 | ||
89 | return BuildEvent("EnableSimulator", llsdBody); | 91 | return BuildEvent("EnableSimulator", llsdBody); |
90 | } | 92 | } |
91 | 93 | /* | |
92 | public static OSD DisableSimulator(ulong handle) | 94 | public static OSD DisableSimulator(ulong handle) |
93 | { | 95 | { |
94 | //OSDMap llsdSimInfo = new OSDMap(1); | 96 | //OSDMap llsdSimInfo = new OSDMap(1); |
@@ -103,7 +105,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
103 | 105 | ||
104 | return BuildEvent("DisableSimulator", llsdBody); | 106 | return BuildEvent("DisableSimulator", llsdBody); |
105 | } | 107 | } |
106 | 108 | */ | |
107 | public static OSD CrossRegion(ulong handle, Vector3 pos, Vector3 lookAt, | 109 | public static OSD CrossRegion(ulong handle, Vector3 pos, Vector3 lookAt, |
108 | IPEndPoint newRegionExternalEndPoint, | 110 | IPEndPoint newRegionExternalEndPoint, |
109 | string capsURL, UUID agentID, UUID sessionID, | 111 | string capsURL, UUID agentID, UUID sessionID, |
@@ -157,6 +159,12 @@ namespace OpenSim.Region.ClientStack.Linden | |||
157 | uint locationID, uint flags, string capsURL, UUID agentID, | 159 | uint locationID, uint flags, string capsURL, UUID agentID, |
158 | int regionSizeX, int regionSizeY) | 160 | int regionSizeX, int regionSizeY) |
159 | { | 161 | { |
162 | // not sure why flags get overwritten here | ||
163 | if ((flags & (uint)TeleportFlags.IsFlying) != 0) | ||
164 | flags = (uint)TeleportFlags.ViaLocation | (uint)TeleportFlags.IsFlying; | ||
165 | else | ||
166 | flags = (uint)TeleportFlags.ViaLocation; | ||
167 | |||
160 | OSDMap info = new OSDMap(); | 168 | OSDMap info = new OSDMap(); |
161 | info.Add("AgentID", OSD.FromUUID(agentID)); | 169 | info.Add("AgentID", OSD.FromUUID(agentID)); |
162 | info.Add("LocationID", OSD.FromInteger(4)); // TODO what is this? | 170 | info.Add("LocationID", OSD.FromInteger(4)); // TODO what is this? |
@@ -165,7 +173,8 @@ namespace OpenSim.Region.ClientStack.Linden | |||
165 | info.Add("SimAccess", OSD.FromInteger(simAccess)); | 173 | info.Add("SimAccess", OSD.FromInteger(simAccess)); |
166 | info.Add("SimIP", OSD.FromBinary(regionExternalEndPoint.Address.GetAddressBytes())); | 174 | info.Add("SimIP", OSD.FromBinary(regionExternalEndPoint.Address.GetAddressBytes())); |
167 | info.Add("SimPort", OSD.FromInteger(regionExternalEndPoint.Port)); | 175 | info.Add("SimPort", OSD.FromInteger(regionExternalEndPoint.Port)); |
168 | info.Add("TeleportFlags", OSD.FromULong(1L << 4)); // AgentManager.TeleportFlags.ViaLocation | 176 | // info.Add("TeleportFlags", OSD.FromULong(1L << 4)); // AgentManager.TeleportFlags.ViaLocation |
177 | info.Add("TeleportFlags", OSD.FromUInteger(flags)); | ||
169 | info.Add("RegionSizeX", OSD.FromUInteger((uint)regionSizeX)); | 178 | info.Add("RegionSizeX", OSD.FromUInteger((uint)regionSizeX)); |
170 | info.Add("RegionSizeY", OSD.FromUInteger((uint)regionSizeY)); | 179 | info.Add("RegionSizeY", OSD.FromUInteger((uint)regionSizeY)); |
171 | 180 | ||
@@ -185,13 +194,13 @@ namespace OpenSim.Region.ClientStack.Linden | |||
185 | script.Add("ItemID", OSD.FromUUID(itemID)); | 194 | script.Add("ItemID", OSD.FromUUID(itemID)); |
186 | script.Add("Running", OSD.FromBoolean(running)); | 195 | script.Add("Running", OSD.FromBoolean(running)); |
187 | script.Add("Mono", OSD.FromBoolean(mono)); | 196 | script.Add("Mono", OSD.FromBoolean(mono)); |
188 | 197 | ||
189 | OSDArray scriptArr = new OSDArray(); | 198 | OSDArray scriptArr = new OSDArray(); |
190 | scriptArr.Add(script); | 199 | scriptArr.Add(script); |
191 | 200 | ||
192 | OSDMap body = new OSDMap(); | 201 | OSDMap body = new OSDMap(); |
193 | body.Add("Script", scriptArr); | 202 | body.Add("Script", scriptArr); |
194 | 203 | ||
195 | return BuildEvent("ScriptRunningReply", body); | 204 | return BuildEvent("ScriptRunningReply", body); |
196 | } | 205 | } |
197 | 206 | ||
@@ -204,8 +213,8 @@ namespace OpenSim.Region.ClientStack.Linden | |||
204 | {"sim-ip-and-port", new OSDString(simIpAndPort)}, | 213 | {"sim-ip-and-port", new OSDString(simIpAndPort)}, |
205 | {"seed-capability", new OSDString(seedcap)}, | 214 | {"seed-capability", new OSDString(seedcap)}, |
206 | {"region-handle", OSD.FromULong(regionHandle)}, | 215 | {"region-handle", OSD.FromULong(regionHandle)}, |
207 | {"region-size-x", OSD.FromInteger(regionSizeX)}, | 216 | {"region-size-x", OSD.FromUInteger((uint)regionSizeX)}, |
208 | {"region-size-y", OSD.FromInteger(regionSizeY)} | 217 | {"region-size-y", OSD.FromUInteger((uint)regionSizeY)} |
209 | }; | 218 | }; |
210 | 219 | ||
211 | return BuildEvent("EstablishAgentCommunication", body); | 220 | return BuildEvent("EstablishAgentCommunication", body); |
@@ -234,7 +243,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
234 | { | 243 | { |
235 | OSDMap messageParams = new OSDMap(15); | 244 | OSDMap messageParams = new OSDMap(15); |
236 | messageParams.Add("type", new OSDInteger((int)dialog)); | 245 | messageParams.Add("type", new OSDInteger((int)dialog)); |
237 | 246 | ||
238 | OSDArray positionArray = new OSDArray(3); | 247 | OSDArray positionArray = new OSDArray(3); |
239 | positionArray.Add(OSD.FromReal(position.X)); | 248 | positionArray.Add(OSD.FromReal(position.X)); |
240 | positionArray.Add(OSD.FromReal(position.Y)); | 249 | positionArray.Add(OSD.FromReal(position.Y)); |
@@ -299,20 +308,29 @@ namespace OpenSim.Region.ClientStack.Linden | |||
299 | } | 308 | } |
300 | 309 | ||
301 | public static OSD ChatterBoxSessionAgentListUpdates(UUID sessionID, | 310 | public static OSD ChatterBoxSessionAgentListUpdates(UUID sessionID, |
302 | UUID agentID, bool canVoiceChat, bool isModerator, bool textMute) | 311 | UUID agentID, bool canVoiceChat, bool isModerator, bool textMute, bool isEnterorLeave) |
303 | { | 312 | { |
304 | OSDMap body = new OSDMap(); | 313 | OSDMap body = new OSDMap(); |
305 | OSDMap agentUpdates = new OSDMap(); | 314 | OSDMap agentUpdates = new OSDMap(); |
306 | OSDMap infoDetail = new OSDMap(); | 315 | OSDMap infoDetail = new OSDMap(); |
307 | OSDMap mutes = new OSDMap(); | 316 | OSDMap mutes = new OSDMap(); |
308 | 317 | ||
318 | // this should be a list of agents and parameters | ||
319 | // foreach agent | ||
309 | mutes.Add("text", OSD.FromBoolean(textMute)); | 320 | mutes.Add("text", OSD.FromBoolean(textMute)); |
310 | infoDetail.Add("can_voice_chat", OSD.FromBoolean(canVoiceChat)); | 321 | infoDetail.Add("can_voice_chat", OSD.FromBoolean(canVoiceChat)); |
311 | infoDetail.Add("is_moderator", OSD.FromBoolean(isModerator)); | 322 | infoDetail.Add("is_moderator", OSD.FromBoolean(isModerator)); |
312 | infoDetail.Add("mutes", mutes); | 323 | infoDetail.Add("mutes", mutes); |
313 | OSDMap info = new OSDMap(); | 324 | OSDMap info = new OSDMap(); |
314 | info.Add("info", infoDetail); | 325 | info.Add("info", infoDetail); |
326 | if(isEnterorLeave) | ||
327 | info.Add("transition",OSD.FromString("ENTER")); | ||
328 | else | ||
329 | info.Add("transition",OSD.FromString("LEAVE")); | ||
315 | agentUpdates.Add(agentID.ToString(), info); | 330 | agentUpdates.Add(agentID.ToString(), info); |
331 | |||
332 | // foreach end | ||
333 | |||
316 | body.Add("agent_updates", agentUpdates); | 334 | body.Add("agent_updates", agentUpdates); |
317 | body.Add("session_id", OSD.FromUUID(sessionID)); | 335 | body.Add("session_id", OSD.FromUUID(sessionID)); |
318 | body.Add("updates", new OSD()); | 336 | body.Add("updates", new OSD()); |
@@ -324,40 +342,54 @@ namespace OpenSim.Region.ClientStack.Linden | |||
324 | return chatterBoxSessionAgentListUpdates; | 342 | return chatterBoxSessionAgentListUpdates; |
325 | } | 343 | } |
326 | 344 | ||
327 | public static OSD GroupMembership(AgentGroupDataUpdatePacket groupUpdatePacket) | 345 | public static OSD ChatterBoxForceClose(UUID sessionID, string reason) |
328 | { | 346 | { |
329 | OSDMap groupUpdate = new OSDMap(); | 347 | OSDMap body = new OSDMap(2); |
330 | groupUpdate.Add("message", OSD.FromString("AgentGroupDataUpdate")); | 348 | body.Add("session_id", new OSDUUID(sessionID)); |
349 | body.Add("reason", new OSDString(reason)); | ||
331 | 350 | ||
332 | OSDMap body = new OSDMap(); | 351 | OSDMap chatterBoxForceClose = new OSDMap(2); |
333 | OSDArray agentData = new OSDArray(); | 352 | chatterBoxForceClose.Add("message", new OSDString("ForceCloseChatterBoxSession")); |
334 | OSDMap agentDataMap = new OSDMap(); | 353 | chatterBoxForceClose.Add("body", body); |
335 | agentDataMap.Add("AgentID", OSD.FromUUID(groupUpdatePacket.AgentData.AgentID)); | 354 | return chatterBoxForceClose; |
336 | agentData.Add(agentDataMap); | 355 | } |
337 | body.Add("AgentData", agentData); | ||
338 | 356 | ||
339 | OSDArray groupData = new OSDArray(); | 357 | public static OSD GroupMembershipData(UUID receiverAgent, GroupMembershipData[] data) |
358 | { | ||
359 | OSDArray AgentData = new OSDArray(1); | ||
360 | OSDMap AgentDataMap = new OSDMap(1); | ||
361 | AgentDataMap.Add("AgentID", OSD.FromUUID(receiverAgent)); | ||
362 | AgentData.Add(AgentDataMap); | ||
340 | 363 | ||
341 | foreach (AgentGroupDataUpdatePacket.GroupDataBlock groupDataBlock in groupUpdatePacket.GroupData) | 364 | OSDArray GroupData = new OSDArray(data.Length); |
365 | OSDArray NewGroupData = new OSDArray(data.Length); | ||
366 | |||
367 | foreach (GroupMembershipData membership in data) | ||
342 | { | 368 | { |
343 | OSDMap groupDataMap = new OSDMap(); | 369 | OSDMap GroupDataMap = new OSDMap(6); |
344 | groupDataMap.Add("ListInProfile", OSD.FromBoolean(false)); | 370 | OSDMap NewGroupDataMap = new OSDMap(1); |
345 | groupDataMap.Add("GroupID", OSD.FromUUID(groupDataBlock.GroupID)); | 371 | |
346 | groupDataMap.Add("GroupInsigniaID", OSD.FromUUID(groupDataBlock.GroupInsigniaID)); | 372 | GroupDataMap.Add("GroupID", OSD.FromUUID(membership.GroupID)); |
347 | groupDataMap.Add("Contribution", OSD.FromInteger(groupDataBlock.Contribution)); | 373 | GroupDataMap.Add("GroupPowers", OSD.FromULong(membership.GroupPowers)); |
348 | groupDataMap.Add("GroupPowers", OSD.FromBinary(ulongToByteArray(groupDataBlock.GroupPowers))); | 374 | GroupDataMap.Add("AcceptNotices", OSD.FromBoolean(membership.AcceptNotices)); |
349 | groupDataMap.Add("GroupName", OSD.FromString(Utils.BytesToString(groupDataBlock.GroupName))); | 375 | GroupDataMap.Add("GroupInsigniaID", OSD.FromUUID(membership.GroupPicture)); |
350 | groupDataMap.Add("AcceptNotices", OSD.FromBoolean(groupDataBlock.AcceptNotices)); | 376 | GroupDataMap.Add("Contribution", OSD.FromInteger(membership.Contribution)); |
377 | GroupDataMap.Add("GroupName", OSD.FromString(membership.GroupName)); | ||
378 | NewGroupDataMap.Add("ListInProfile", OSD.FromBoolean(membership.ListInProfile)); | ||
379 | |||
380 | GroupData.Add(GroupDataMap); | ||
381 | NewGroupData.Add(NewGroupDataMap); | ||
382 | } | ||
351 | 383 | ||
352 | groupData.Add(groupDataMap); | 384 | OSDMap llDataStruct = new OSDMap(3); |
385 | llDataStruct.Add("AgentData", AgentData); | ||
386 | llDataStruct.Add("GroupData", GroupData); | ||
387 | llDataStruct.Add("NewGroupData", NewGroupData); | ||
353 | 388 | ||
354 | } | 389 | return BuildEvent("AgentGroupDataUpdate", llDataStruct); |
355 | body.Add("GroupData", groupData); | ||
356 | groupUpdate.Add("body", body); | ||
357 | 390 | ||
358 | return groupUpdate; | ||
359 | } | 391 | } |
360 | 392 | ||
361 | public static OSD PlacesQuery(PlacesReplyPacket PlacesReply) | 393 | public static OSD PlacesQuery(PlacesReplyPacket PlacesReply) |
362 | { | 394 | { |
363 | OSDMap placesReply = new OSDMap(); | 395 | OSDMap placesReply = new OSDMap(); |
@@ -391,7 +423,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
391 | QueryDataMap.Add("SnapShotID", OSD.FromUUID(groupDataBlock.SnapshotID)); | 423 | QueryDataMap.Add("SnapShotID", OSD.FromUUID(groupDataBlock.SnapshotID)); |
392 | QueryDataMap.Add("ProductSku", OSD.FromInteger(0)); | 424 | QueryDataMap.Add("ProductSku", OSD.FromInteger(0)); |
393 | QueryDataMap.Add("Price", OSD.FromInteger(groupDataBlock.Price)); | 425 | QueryDataMap.Add("Price", OSD.FromInteger(groupDataBlock.Price)); |
394 | 426 | ||
395 | QueryData.Add(QueryDataMap); | 427 | QueryData.Add(QueryDataMap); |
396 | } | 428 | } |
397 | body.Add("QueryData", QueryData); | 429 | body.Add("QueryData", QueryData); |