From f52c5febd3b87af795b8eb2a909d332ba8cddbff Mon Sep 17 00:00:00 2001 From: Homer Horwitz Date: Sun, 12 Oct 2008 16:29:29 +0000 Subject: Add EventInfoRequest and EventInfoReply packets. Note: New file, run prebuild. --- OpenSim/Framework/EventData.cs | 54 ++++++++++++++++++++++ OpenSim/Framework/IClientAPI.cs | 6 ++- .../Region/ClientStack/LindenUDP/LLClientView.cs | 33 +++++++++++++ .../Environment/Modules/World/NPC/NPCAvatar.cs | 6 +++ .../Region/Examples/SimpleModule/MyNpcCharacter.cs | 6 ++- 5 files changed, 102 insertions(+), 3 deletions(-) create mode 100644 OpenSim/Framework/EventData.cs diff --git a/OpenSim/Framework/EventData.cs b/OpenSim/Framework/EventData.cs new file mode 100644 index 0000000..bbca240 --- /dev/null +++ b/OpenSim/Framework/EventData.cs @@ -0,0 +1,54 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSim Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using OpenMetaverse; + +namespace OpenSim.Framework +{ + public enum EventDataFlags + { + Mature = 1 << 0, + } + + public class EventData + { + public uint eventID; + public string creator; + public string name; + public string category; + public string description; + public DateTime date; + public uint dateUTC; + public uint duration; + public uint cover; + public uint amount; + public string simName; + public Vector3 globalPos; + public uint eventFlags; + } +} diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index a5ce06c..5322dda 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -318,6 +318,7 @@ namespace OpenSim.Framework public delegate void DirLandQuery(IClientAPI remoteClient, UUID queryID, uint queryFlags, uint searchType, int price, int area, int queryStart); public delegate void DirPopularQuery(IClientAPI remoteClient, UUID queryID, uint queryFlags); public delegate void DirClassifiedQuery(IClientAPI remoteClient, UUID queryID, string queryText, uint queryFlags, uint category, int queryStart); + public delegate void EventInfoRequest(IClientAPI remoteClient, uint eventID); public delegate void MapItemRequest(IClientAPI remoteClient, uint flags, uint EstateID, bool godlike, uint itemtype, ulong regionhandle); @@ -617,7 +618,8 @@ namespace OpenSim.Framework event DirLandQuery OnDirLandQuery; event DirPopularQuery OnDirPopularQuery; event DirClassifiedQuery OnDirClassifiedQuery; - + event EventInfoRequest OnEventInfoRequest; + event MapItemRequest OnMapItemRequest; @@ -862,7 +864,7 @@ namespace OpenSim.Framework void SendDirClassifiedReply(UUID queryID, DirClassifiedReplyData[] data); void SendDirLandReply(UUID queryID, DirLandReplyData[] data); void SendDirPopularReply(UUID queryID, DirPopularReplyData[] data); - + void SendEventInfoReply(EventData info); void SendMapItemReply(mapItemReply[] replies, uint mapitemtype, uint flags); diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 4714bb3..ed4ac60 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -1001,6 +1001,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP public event DirLandQuery OnDirLandQuery; public event DirPopularQuery OnDirPopularQuery; public event DirClassifiedQuery OnDirClassifiedQuery; + public event EventInfoRequest OnEventInfoRequest; public event MapItemRequest OnMapItemRequest; @@ -6405,6 +6406,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP dirClassifiedQueryPacket.QueryData.QueryStart); } break; + case PacketType.EventInfoRequest: + EventInfoRequestPacket eventInfoRequestPacket = (EventInfoRequestPacket)Pack; + if (OnEventInfoRequest != null) + { + OnEventInfoRequest(this, eventInfoRequestPacket.EventData.EventID); + } + break; default: m_log.Warn("[CLIENT]: unhandled packet " + Pack.ToString()); @@ -7073,6 +7081,31 @@ namespace OpenSim.Region.ClientStack.LindenUDP OutPacket(packet, ThrottleOutPacketType.Task); } + public void SendEventInfoReply(EventData data) + { + EventInfoReplyPacket packet = (EventInfoReplyPacket)PacketPool.Instance.GetPacket(PacketType.EventInfoReply); + + packet.AgentData = new EventInfoReplyPacket.AgentDataBlock(); + packet.AgentData.AgentID = AgentId; + + packet.EventData = new EventInfoReplyPacket.EventDataBlock(); + packet.EventData.EventID = data.eventID; + packet.EventData.Creator = Utils.StringToBytes(data.creator); + packet.EventData.Name = Utils.StringToBytes(data.name); + packet.EventData.Category = Utils.StringToBytes(data.category); + packet.EventData.Desc = Utils.StringToBytes(data.description); + packet.EventData.Date = Utils.StringToBytes(data.date.ToString()); + packet.EventData.DateUTC = data.dateUTC; + packet.EventData.Duration = data.duration; + packet.EventData.Cover = data.cover; + packet.EventData.Amount = data.amount; + packet.EventData.SimName = Utils.StringToBytes(data.simName); + packet.EventData.GlobalPos = new Vector3d(data.globalPos); + packet.EventData.EventFlags = data.eventFlags; + + OutPacket(packet, ThrottleOutPacketType.Task); + } + public void SendMapItemReply(mapItemReply[] replies, uint mapitemtype, uint flags) { MapItemReplyPacket mirplk = new MapItemReplyPacket(); diff --git a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs index acad64a..a2d626e 100644 --- a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs @@ -329,9 +329,11 @@ namespace OpenSim.Region.Environment.Modules.World.NPC public event DirLandQuery OnDirLandQuery; public event DirPopularQuery OnDirPopularQuery; public event DirClassifiedQuery OnDirClassifiedQuery; + public event EventInfoRequest OnEventInfoRequest; public event MapItemRequest OnMapItemRequest; + #pragma warning restore 67 #endregion @@ -934,5 +936,9 @@ namespace OpenSim.Region.Environment.Modules.World.NPC public void KillEndDone() { } + + public void SendEventInfoReply (EventData info) + { + } } } diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs index ef78cb5..61791fb 100644 --- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs @@ -224,7 +224,7 @@ namespace OpenSim.Region.Examples.SimpleModule public event DirLandQuery OnDirLandQuery; public event DirPopularQuery OnDirPopularQuery; public event DirClassifiedQuery OnDirClassifiedQuery; - + public event EventInfoRequest OnEventInfoRequest; public event MapItemRequest OnMapItemRequest; @@ -932,5 +932,9 @@ namespace OpenSim.Region.Examples.SimpleModule public void KillEndDone() { } + + public void SendEventInfoReply (EventData info) + { + } } } -- cgit v1.1