aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/IClientAPI.cs7
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs38
-rw-r--r--OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs8
-rw-r--r--OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs8
4 files changed, 59 insertions, 2 deletions
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index e1c6f4b..ac97375 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -39,6 +39,8 @@ namespace OpenSim.Framework
39 39
40 public delegate void ChatMessage(Object sender, OSChatMessage e); 40 public delegate void ChatMessage(Object sender, OSChatMessage e);
41 41
42 public delegate void GenericMessage(Object sender, string method, List<String> args);
43
42 public delegate void TextureRequest(Object sender, TextureRequestArgs e); 44 public delegate void TextureRequest(Object sender, TextureRequestArgs e);
43 45
44 public delegate void AvatarNowWearing(Object sender, AvatarWearingArgs e); 46 public delegate void AvatarNowWearing(Object sender, AvatarWearingArgs e);
@@ -356,6 +358,9 @@ namespace OpenSim.Framework
356 358
357 // [Obsolete("LLClientView Specific - Circuits are unique to LLClientView")] 359 // [Obsolete("LLClientView Specific - Circuits are unique to LLClientView")]
358 uint CircuitCode { get; } 360 uint CircuitCode { get; }
361
362 event GenericMessage OnGenericMessage;
363
359 // [Obsolete("LLClientView Specific - Replace with more bare-bones arguments.")] 364 // [Obsolete("LLClientView Specific - Replace with more bare-bones arguments.")]
360 event ImprovedInstantMessage OnInstantMessage; 365 event ImprovedInstantMessage OnInstantMessage;
361 // [Obsolete("LLClientView Specific - Replace with more bare-bones arguments. Rename OnChat.")] 366 // [Obsolete("LLClientView Specific - Replace with more bare-bones arguments. Rename OnChat.")]
@@ -547,6 +552,8 @@ namespace OpenSim.Framework
547 UUID imSessionID, string fromName, byte dialog, uint timeStamp, 552 UUID imSessionID, string fromName, byte dialog, uint timeStamp,
548 byte[] binaryBucket); 553 byte[] binaryBucket);
549 554
555 void SendGenericMessage(string method, List<string> message);
556
550 void SendLayerData(float[] map); 557 void SendLayerData(float[] map);
551 void SendLayerData(int px, int py, float[] map); 558 void SendLayerData(int px, int py, float[] map);
552 559
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
diff --git a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs
index 8bf0d96..20b203a 100644
--- a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs
@@ -159,7 +159,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
159 public event MoneyTransferRequest OnMoneyTransferRequest; 159 public event MoneyTransferRequest OnMoneyTransferRequest;
160 public event ParcelBuy OnParcelBuy; 160 public event ParcelBuy OnParcelBuy;
161 public event Action<IClientAPI> OnConnectionClosed; 161 public event Action<IClientAPI> OnConnectionClosed;
162 162 public event GenericMessage OnGenericMessage;
163 public event ImprovedInstantMessage OnInstantMessage; 163 public event ImprovedInstantMessage OnInstantMessage;
164 public event ChatMessage OnChatFromViewer; 164 public event ChatMessage OnChatFromViewer;
165 public event TextureRequest OnRequestTexture; 165 public event TextureRequest OnRequestTexture;
@@ -465,6 +465,11 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
465 { 465 {
466 } 466 }
467 467
468 public void SendGenericMessage(string method, List<string> message)
469 {
470
471 }
472
468 public virtual void SendLayerData(float[] map) 473 public virtual void SendLayerData(float[] map)
469 { 474 {
470 } 475 }
@@ -762,6 +767,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
762 get { return m_circuitCode; } 767 get { return m_circuitCode; }
763 set { m_circuitCode = value; } 768 set { m_circuitCode = value; }
764 } 769 }
770
765 public void SendBlueBoxMessage(UUID FromAvatarID, UUID fromSessionID, String FromAvatarName, String Message) 771 public void SendBlueBoxMessage(UUID FromAvatarID, UUID fromSessionID, String FromAvatarName, String Message)
766 { 772 {
767 773
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
index 149126c..c42eaeb 100644
--- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
@@ -141,7 +141,7 @@ namespace OpenSim.Region.Examples.SimpleModule
141 public event MoveTaskInventory OnMoveTaskItem; 141 public event MoveTaskInventory OnMoveTaskItem;
142 public event RemoveTaskInventory OnRemoveTaskItem; 142 public event RemoveTaskInventory OnRemoveTaskItem;
143 public event RequestAsset OnRequestAsset; 143 public event RequestAsset OnRequestAsset;
144 144 public event GenericMessage OnGenericMessage;
145 public event UUIDNameRequest OnNameFromUUIDRequest; 145 public event UUIDNameRequest OnNameFromUUIDRequest;
146 public event UUIDNameRequest OnUUIDGroupNameRequest; 146 public event UUIDNameRequest OnUUIDGroupNameRequest;
147 147
@@ -379,6 +379,11 @@ namespace OpenSim.Region.Examples.SimpleModule
379 { 379 {
380 } 380 }
381 381
382 public void SendGenericMessage(string method, List<string> message)
383 {
384
385 }
386
382 public virtual void SendLayerData(float[] map) 387 public virtual void SendLayerData(float[] map)
383 { 388 {
384 } 389 }
@@ -751,6 +756,7 @@ namespace OpenSim.Region.Examples.SimpleModule
751 get { return m_circuitCode; } 756 get { return m_circuitCode; }
752 set { m_circuitCode = value; } 757 set { m_circuitCode = value; }
753 } 758 }
759
754 public void SendBlueBoxMessage(UUID FromAvatarID, UUID fromSessionID, String FromAvatarName, String Message) 760 public void SendBlueBoxMessage(UUID FromAvatarID, UUID fromSessionID, String FromAvatarName, String Message)
755 { 761 {
756 762