Add EventInfoRequest and EventInfoReply packets.

Note: New file, run prebuild.
0.6.0-stable
Homer Horwitz 2008-10-12 16:29:29 +00:00
parent f2700590d7
commit f52c5febd3
5 changed files with 102 additions and 3 deletions

View File

@ -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;
}
}

View File

@ -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 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 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 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); 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 DirLandQuery OnDirLandQuery;
event DirPopularQuery OnDirPopularQuery; event DirPopularQuery OnDirPopularQuery;
event DirClassifiedQuery OnDirClassifiedQuery; event DirClassifiedQuery OnDirClassifiedQuery;
event EventInfoRequest OnEventInfoRequest;
event MapItemRequest OnMapItemRequest; event MapItemRequest OnMapItemRequest;
@ -862,7 +864,7 @@ namespace OpenSim.Framework
void SendDirClassifiedReply(UUID queryID, DirClassifiedReplyData[] data); void SendDirClassifiedReply(UUID queryID, DirClassifiedReplyData[] data);
void SendDirLandReply(UUID queryID, DirLandReplyData[] data); void SendDirLandReply(UUID queryID, DirLandReplyData[] data);
void SendDirPopularReply(UUID queryID, DirPopularReplyData[] data); void SendDirPopularReply(UUID queryID, DirPopularReplyData[] data);
void SendEventInfoReply(EventData info);
void SendMapItemReply(mapItemReply[] replies, uint mapitemtype, uint flags); void SendMapItemReply(mapItemReply[] replies, uint mapitemtype, uint flags);

View File

@ -1001,6 +1001,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public event DirLandQuery OnDirLandQuery; public event DirLandQuery OnDirLandQuery;
public event DirPopularQuery OnDirPopularQuery; public event DirPopularQuery OnDirPopularQuery;
public event DirClassifiedQuery OnDirClassifiedQuery; public event DirClassifiedQuery OnDirClassifiedQuery;
public event EventInfoRequest OnEventInfoRequest;
public event MapItemRequest OnMapItemRequest; public event MapItemRequest OnMapItemRequest;
@ -6405,6 +6406,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
dirClassifiedQueryPacket.QueryData.QueryStart); dirClassifiedQueryPacket.QueryData.QueryStart);
} }
break; break;
case PacketType.EventInfoRequest:
EventInfoRequestPacket eventInfoRequestPacket = (EventInfoRequestPacket)Pack;
if (OnEventInfoRequest != null)
{
OnEventInfoRequest(this, eventInfoRequestPacket.EventData.EventID);
}
break;
default: default:
m_log.Warn("[CLIENT]: unhandled packet " + Pack.ToString()); m_log.Warn("[CLIENT]: unhandled packet " + Pack.ToString());
@ -7073,6 +7081,31 @@ namespace OpenSim.Region.ClientStack.LindenUDP
OutPacket(packet, ThrottleOutPacketType.Task); 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) public void SendMapItemReply(mapItemReply[] replies, uint mapitemtype, uint flags)
{ {
MapItemReplyPacket mirplk = new MapItemReplyPacket(); MapItemReplyPacket mirplk = new MapItemReplyPacket();

View File

@ -329,9 +329,11 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
public event DirLandQuery OnDirLandQuery; public event DirLandQuery OnDirLandQuery;
public event DirPopularQuery OnDirPopularQuery; public event DirPopularQuery OnDirPopularQuery;
public event DirClassifiedQuery OnDirClassifiedQuery; public event DirClassifiedQuery OnDirClassifiedQuery;
public event EventInfoRequest OnEventInfoRequest;
public event MapItemRequest OnMapItemRequest; public event MapItemRequest OnMapItemRequest;
#pragma warning restore 67 #pragma warning restore 67
#endregion #endregion
@ -934,5 +936,9 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
public void KillEndDone() public void KillEndDone()
{ {
} }
public void SendEventInfoReply (EventData info)
{
}
} }
} }

View File

@ -224,7 +224,7 @@ namespace OpenSim.Region.Examples.SimpleModule
public event DirLandQuery OnDirLandQuery; public event DirLandQuery OnDirLandQuery;
public event DirPopularQuery OnDirPopularQuery; public event DirPopularQuery OnDirPopularQuery;
public event DirClassifiedQuery OnDirClassifiedQuery; public event DirClassifiedQuery OnDirClassifiedQuery;
public event EventInfoRequest OnEventInfoRequest;
public event MapItemRequest OnMapItemRequest; public event MapItemRequest OnMapItemRequest;
@ -932,5 +932,9 @@ namespace OpenSim.Region.Examples.SimpleModule
public void KillEndDone() public void KillEndDone()
{ {
} }
public void SendEventInfoReply (EventData info)
{
}
} }
} }