diff options
author | Adam Frisby | 2008-09-09 05:25:29 +0000 |
---|---|---|
committer | Adam Frisby | 2008-09-09 05:25:29 +0000 |
commit | c95bdb83c0d91ecb4c5a73e3ae4deadbcc54955f (patch) | |
tree | 4c2269de2c672ac0d28c2d5f97fbffccec525294 /OpenSim/Region | |
parent | Fix llResetScript() and the reset button to actually restore global (diff) | |
download | opensim-SC-c95bdb83c0d91ecb4c5a73e3ae4deadbcc54955f.zip opensim-SC-c95bdb83c0d91ecb4c5a73e3ae4deadbcc54955f.tar.gz opensim-SC-c95bdb83c0d91ecb4c5a73e3ae4deadbcc54955f.tar.bz2 opensim-SC-c95bdb83c0d91ecb4c5a73e3ae4deadbcc54955f.tar.xz |
* Adds OnGenericMessage and SendGenericMessage functionality to IClientAPI.
* Please don't break the build. *fingers crossed*
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 38 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs | 8 | ||||
-rw-r--r-- | OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs | 8 |
3 files changed, 52 insertions, 2 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 | ||
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 | ||