aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ClientStack')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs38
1 files changed, 38 insertions, 0 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 3c860a9..f778557 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -120,6 +120,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
120 /* Instantiated Designated Event Delegates */ 120 /* Instantiated Designated Event Delegates */
121 //- used so we don't create new objects for each incoming packet and then toss it out later */ 121 //- used so we don't create new objects for each incoming packet and then toss it out later */
122 122
123 private GenericMessage handlerGenericMessage = null;
123 private RequestAvatarProperties handlerRequestAvatarProperties = null; //OnRequestAvatarProperties; 124 private RequestAvatarProperties handlerRequestAvatarProperties = null; //OnRequestAvatarProperties;
124 private UpdateAvatarProperties handlerUpdateAvatarProperties = null; // OnUpdateAvatarProperties; 125 private UpdateAvatarProperties handlerUpdateAvatarProperties = null; // OnUpdateAvatarProperties;
125 private ChatMessage handlerChatFromViewer = null; //OnChatFromViewer; 126 private ChatMessage handlerChatFromViewer = null; //OnChatFromViewer;
@@ -820,6 +821,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
820 # endregion 821 # endregion
821 822
822 // Previously ClientView.API partial class 823 // Previously ClientView.API partial class
824 public event GenericMessage OnGenericMessage;
823 public event Action<IClientAPI> OnLogout; 825 public event Action<IClientAPI> OnLogout;
824 public event ObjectPermissions OnObjectPermissions; 826 public event ObjectPermissions OnObjectPermissions;
825 public event Action<IClientAPI> OnConnectionClosed; 827 public event Action<IClientAPI> OnConnectionClosed;
@@ -1119,6 +1121,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1119 } 1121 }
1120 } 1122 }
1121 1123
1124 public void SendGenericMessage(string method, List<string> message)
1125 {
1126
1127 GenericMessagePacket gmp = new GenericMessagePacket();
1128 gmp.MethodData.Method = Utils.StringToBytes(method);
1129 gmp.ParamList = new GenericMessagePacket.ParamListBlock[message.Count];
1130 int i = 0;
1131 foreach (string val in message)
1132 {
1133 gmp.ParamList[i] = new GenericMessagePacket.ParamListBlock();
1134 gmp.ParamList[i++].Parameter = Utils.StringToBytes(val);
1135 }
1136 OutPacket(gmp, ThrottleOutPacketType.Task);
1137 }
1138
1122 /// <summary> 1139 /// <summary>
1123 /// Send the region heightmap to the client 1140 /// Send the region heightmap to the client
1124 /// </summary> 1141 /// </summary>
@@ -3320,6 +3337,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3320 AddLocalPacketHandler(PacketType.ParcelBuy, HandleParcelBuyRequest); 3337 AddLocalPacketHandler(PacketType.ParcelBuy, HandleParcelBuyRequest);
3321 AddLocalPacketHandler(PacketType.UUIDGroupNameRequest, HandleUUIDGroupNameRequest); 3338 AddLocalPacketHandler(PacketType.UUIDGroupNameRequest, HandleUUIDGroupNameRequest);
3322 AddLocalPacketHandler(PacketType.ObjectGroup, HandleObjectGroupRequest); 3339 AddLocalPacketHandler(PacketType.ObjectGroup, HandleObjectGroupRequest);
3340 AddLocalPacketHandler(PacketType.GenericMessage, HandleGenericMessage);
3323 } 3341 }
3324 3342
3325 private bool HandleMoneyTransferRequest(IClientAPI sender, Packet Pack) 3343 private bool HandleMoneyTransferRequest(IClientAPI sender, Packet Pack)
@@ -3380,6 +3398,26 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3380 return true; 3398 return true;
3381 } 3399 }
3382 3400
3401 public bool HandleGenericMessage(IClientAPI sender, Packet pack)
3402 {
3403 GenericMessagePacket gmpack = (GenericMessagePacket) pack;
3404 handlerGenericMessage = OnGenericMessage;
3405
3406 List<string> msg = new List<string>();
3407
3408 if(handlerGenericMessage != null)
3409 {
3410 string method = Util.FieldToString(gmpack.MethodData.Method);
3411 foreach (GenericMessagePacket.ParamListBlock block in gmpack.ParamList)
3412 {
3413 msg.Add(Util.FieldToString(block.Parameter));
3414 }
3415
3416 handlerGenericMessage(this, method, msg);
3417 }
3418 return true;
3419 }
3420
3383 public bool HandleObjectGroupRequest(IClientAPI sender, Packet Pack) 3421 public bool HandleObjectGroupRequest(IClientAPI sender, Packet Pack)
3384 { 3422 {
3385 3423