aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorHomer Horwitz2008-10-12 16:29:29 +0000
committerHomer Horwitz2008-10-12 16:29:29 +0000
commitf52c5febd3b87af795b8eb2a909d332ba8cddbff (patch)
treea707769d7b10051a0f5d6d7ec7b6b155e4fdeba6 /OpenSim
parentremoved some more extraneous hidden faces (diff)
downloadopensim-SC-f52c5febd3b87af795b8eb2a909d332ba8cddbff.zip
opensim-SC-f52c5febd3b87af795b8eb2a909d332ba8cddbff.tar.gz
opensim-SC-f52c5febd3b87af795b8eb2a909d332ba8cddbff.tar.bz2
opensim-SC-f52c5febd3b87af795b8eb2a909d332ba8cddbff.tar.xz
Add EventInfoRequest and EventInfoReply packets.
Note: New file, run prebuild.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/EventData.cs54
-rw-r--r--OpenSim/Framework/IClientAPI.cs6
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs33
-rw-r--r--OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs6
-rw-r--r--OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs6
5 files changed, 102 insertions, 3 deletions
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 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSim Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using OpenMetaverse;
30
31namespace OpenSim.Framework
32{
33 public enum EventDataFlags
34 {
35 Mature = 1 << 0,
36 }
37
38 public class EventData
39 {
40 public uint eventID;
41 public string creator;
42 public string name;
43 public string category;
44 public string description;
45 public DateTime date;
46 public uint dateUTC;
47 public uint duration;
48 public uint cover;
49 public uint amount;
50 public string simName;
51 public Vector3 globalPos;
52 public uint eventFlags;
53 }
54}
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
318 public delegate void DirLandQuery(IClientAPI remoteClient, UUID queryID, uint queryFlags, uint searchType, int price, int area, int queryStart); 318 public delegate void DirLandQuery(IClientAPI remoteClient, UUID queryID, uint queryFlags, uint searchType, int price, int area, int queryStart);
319 public delegate void DirPopularQuery(IClientAPI remoteClient, UUID queryID, uint queryFlags); 319 public delegate void DirPopularQuery(IClientAPI remoteClient, UUID queryID, uint queryFlags);
320 public delegate void DirClassifiedQuery(IClientAPI remoteClient, UUID queryID, string queryText, uint queryFlags, uint category, int queryStart); 320 public delegate void DirClassifiedQuery(IClientAPI remoteClient, UUID queryID, string queryText, uint queryFlags, uint category, int queryStart);
321 public delegate void EventInfoRequest(IClientAPI remoteClient, uint eventID);
321 322
322 public delegate void MapItemRequest(IClientAPI remoteClient, uint flags, uint EstateID, bool godlike, uint itemtype, ulong regionhandle); 323 public delegate void MapItemRequest(IClientAPI remoteClient, uint flags, uint EstateID, bool godlike, uint itemtype, ulong regionhandle);
323 324
@@ -617,7 +618,8 @@ namespace OpenSim.Framework
617 event DirLandQuery OnDirLandQuery; 618 event DirLandQuery OnDirLandQuery;
618 event DirPopularQuery OnDirPopularQuery; 619 event DirPopularQuery OnDirPopularQuery;
619 event DirClassifiedQuery OnDirClassifiedQuery; 620 event DirClassifiedQuery OnDirClassifiedQuery;
620 621 event EventInfoRequest OnEventInfoRequest;
622
621 event MapItemRequest OnMapItemRequest; 623 event MapItemRequest OnMapItemRequest;
622 624
623 625
@@ -862,7 +864,7 @@ namespace OpenSim.Framework
862 void SendDirClassifiedReply(UUID queryID, DirClassifiedReplyData[] data); 864 void SendDirClassifiedReply(UUID queryID, DirClassifiedReplyData[] data);
863 void SendDirLandReply(UUID queryID, DirLandReplyData[] data); 865 void SendDirLandReply(UUID queryID, DirLandReplyData[] data);
864 void SendDirPopularReply(UUID queryID, DirPopularReplyData[] data); 866 void SendDirPopularReply(UUID queryID, DirPopularReplyData[] data);
865 867 void SendEventInfoReply(EventData info);
866 868
867 void SendMapItemReply(mapItemReply[] replies, uint mapitemtype, uint flags); 869 void SendMapItemReply(mapItemReply[] replies, uint mapitemtype, uint flags);
868 870
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
1001 public event DirLandQuery OnDirLandQuery; 1001 public event DirLandQuery OnDirLandQuery;
1002 public event DirPopularQuery OnDirPopularQuery; 1002 public event DirPopularQuery OnDirPopularQuery;
1003 public event DirClassifiedQuery OnDirClassifiedQuery; 1003 public event DirClassifiedQuery OnDirClassifiedQuery;
1004 public event EventInfoRequest OnEventInfoRequest;
1004 1005
1005 public event MapItemRequest OnMapItemRequest; 1006 public event MapItemRequest OnMapItemRequest;
1006 1007
@@ -6405,6 +6406,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6405 dirClassifiedQueryPacket.QueryData.QueryStart); 6406 dirClassifiedQueryPacket.QueryData.QueryStart);
6406 } 6407 }
6407 break; 6408 break;
6409 case PacketType.EventInfoRequest:
6410 EventInfoRequestPacket eventInfoRequestPacket = (EventInfoRequestPacket)Pack;
6411 if (OnEventInfoRequest != null)
6412 {
6413 OnEventInfoRequest(this, eventInfoRequestPacket.EventData.EventID);
6414 }
6415 break;
6408 6416
6409 default: 6417 default:
6410 m_log.Warn("[CLIENT]: unhandled packet " + Pack.ToString()); 6418 m_log.Warn("[CLIENT]: unhandled packet " + Pack.ToString());
@@ -7073,6 +7081,31 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7073 OutPacket(packet, ThrottleOutPacketType.Task); 7081 OutPacket(packet, ThrottleOutPacketType.Task);
7074 } 7082 }
7075 7083
7084 public void SendEventInfoReply(EventData data)
7085 {
7086 EventInfoReplyPacket packet = (EventInfoReplyPacket)PacketPool.Instance.GetPacket(PacketType.EventInfoReply);
7087
7088 packet.AgentData = new EventInfoReplyPacket.AgentDataBlock();
7089 packet.AgentData.AgentID = AgentId;
7090
7091 packet.EventData = new EventInfoReplyPacket.EventDataBlock();
7092 packet.EventData.EventID = data.eventID;
7093 packet.EventData.Creator = Utils.StringToBytes(data.creator);
7094 packet.EventData.Name = Utils.StringToBytes(data.name);
7095 packet.EventData.Category = Utils.StringToBytes(data.category);
7096 packet.EventData.Desc = Utils.StringToBytes(data.description);
7097 packet.EventData.Date = Utils.StringToBytes(data.date.ToString());
7098 packet.EventData.DateUTC = data.dateUTC;
7099 packet.EventData.Duration = data.duration;
7100 packet.EventData.Cover = data.cover;
7101 packet.EventData.Amount = data.amount;
7102 packet.EventData.SimName = Utils.StringToBytes(data.simName);
7103 packet.EventData.GlobalPos = new Vector3d(data.globalPos);
7104 packet.EventData.EventFlags = data.eventFlags;
7105
7106 OutPacket(packet, ThrottleOutPacketType.Task);
7107 }
7108
7076 public void SendMapItemReply(mapItemReply[] replies, uint mapitemtype, uint flags) 7109 public void SendMapItemReply(mapItemReply[] replies, uint mapitemtype, uint flags)
7077 { 7110 {
7078 MapItemReplyPacket mirplk = new MapItemReplyPacket(); 7111 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
329 public event DirLandQuery OnDirLandQuery; 329 public event DirLandQuery OnDirLandQuery;
330 public event DirPopularQuery OnDirPopularQuery; 330 public event DirPopularQuery OnDirPopularQuery;
331 public event DirClassifiedQuery OnDirClassifiedQuery; 331 public event DirClassifiedQuery OnDirClassifiedQuery;
332 public event EventInfoRequest OnEventInfoRequest;
332 333
333 public event MapItemRequest OnMapItemRequest; 334 public event MapItemRequest OnMapItemRequest;
334 335
336
335#pragma warning restore 67 337#pragma warning restore 67
336 338
337 #endregion 339 #endregion
@@ -934,5 +936,9 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
934 public void KillEndDone() 936 public void KillEndDone()
935 { 937 {
936 } 938 }
939
940 public void SendEventInfoReply (EventData info)
941 {
942 }
937 } 943 }
938} 944}
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
224 public event DirLandQuery OnDirLandQuery; 224 public event DirLandQuery OnDirLandQuery;
225 public event DirPopularQuery OnDirPopularQuery; 225 public event DirPopularQuery OnDirPopularQuery;
226 public event DirClassifiedQuery OnDirClassifiedQuery; 226 public event DirClassifiedQuery OnDirClassifiedQuery;
227 227 public event EventInfoRequest OnEventInfoRequest;
228 228
229 public event MapItemRequest OnMapItemRequest; 229 public event MapItemRequest OnMapItemRequest;
230 230
@@ -932,5 +932,9 @@ namespace OpenSim.Region.Examples.SimpleModule
932 public void KillEndDone() 932 public void KillEndDone()
933 { 933 {
934 } 934 }
935
936 public void SendEventInfoReply (EventData info)
937 {
938 }
935 } 939 }
936} 940}