diff options
author | Melanie | 2010-01-09 12:02:48 +0000 |
---|---|---|
committer | Melanie | 2010-01-09 12:02:48 +0000 |
commit | d22bdb5095a6f08271014a52f91aadaff5ae9083 (patch) | |
tree | 76a09afdbae760025e0fc2d9306823d343ead349 /OpenSim | |
parent | Maintain control() event stream (diff) | |
parent | Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim (diff) | |
download | opensim-SC_OLD-d22bdb5095a6f08271014a52f91aadaff5ae9083.zip opensim-SC_OLD-d22bdb5095a6f08271014a52f91aadaff5ae9083.tar.gz opensim-SC_OLD-d22bdb5095a6f08271014a52f91aadaff5ae9083.tar.bz2 opensim-SC_OLD-d22bdb5095a6f08271014a52f91aadaff5ae9083.tar.xz |
Merge branch 'master' into careminster
Diffstat (limited to 'OpenSim')
27 files changed, 2022 insertions, 321 deletions
diff --git a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs index 1ad1fce..358a839 100644 --- a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs +++ b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs | |||
@@ -756,25 +756,25 @@ namespace OpenSim.Client.MXP.ClientStack | |||
756 | public event AvatarNotesUpdate OnAvatarNotesUpdate; | 756 | public event AvatarNotesUpdate OnAvatarNotesUpdate; |
757 | public event MuteListRequest OnMuteListRequest; | 757 | public event MuteListRequest OnMuteListRequest; |
758 | public event AvatarInterestUpdate OnAvatarInterestUpdate; | 758 | public event AvatarInterestUpdate OnAvatarInterestUpdate; |
759 | public event FindAgentUpdate OnFindAgentEvent; | 759 | public event FindAgentUpdate OnFindAgent; |
760 | public event TrackAgentUpdate OnTrackAgentEvent; | 760 | public event TrackAgentUpdate OnTrackAgent; |
761 | public event NewUserReport OnUserReportEvent; | 761 | public event NewUserReport OnUserReport; |
762 | public event SaveStateHandler OnSaveStateEvent; | 762 | public event SaveStateHandler OnSaveState; |
763 | public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; | 763 | public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; |
764 | public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; | 764 | public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; |
765 | public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; | 765 | public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; |
766 | public event FreezeUserUpdate OnParcelFreezeUserEvent; | 766 | public event FreezeUserUpdate OnParcelFreezeUser; |
767 | public event EjectUserUpdate OnParcelEjectUserEvent; | 767 | public event EjectUserUpdate OnParcelEjectUser; |
768 | public event ParcelBuyPass OnParcelBuyPass; | 768 | public event ParcelBuyPass OnParcelBuyPass; |
769 | public event ParcelGodMark OnParcelGodMark; | 769 | public event ParcelGodMark OnParcelGodMark; |
770 | public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; | 770 | public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; |
771 | public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; | 771 | public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; |
772 | public event SimWideDeletesDelegate OnSimWideDeletes; | 772 | public event SimWideDeletesDelegate OnSimWideDeletes; |
773 | public event SendPostcard OnSendPostcard; | 773 | public event SendPostcard OnSendPostcard; |
774 | public event MuteListEntryUpdate OnUpdateMuteListEntryEvent; | 774 | public event MuteListEntryUpdate OnUpdateMuteListEntry; |
775 | public event MuteListEntryRemove OnRemoveMuteListEntryEvent; | 775 | public event MuteListEntryRemove OnRemoveMuteListEntry; |
776 | public event GodlikeMessage onGodlikeMessageEvent; | 776 | public event GodlikeMessage onGodlikeMessage; |
777 | public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent; | 777 | public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate; |
778 | 778 | ||
779 | public event PlacesQuery OnPlacesQuery; | 779 | public event PlacesQuery OnPlacesQuery; |
780 | 780 | ||
@@ -1688,7 +1688,15 @@ namespace OpenSim.Client.MXP.ClientStack | |||
1688 | } | 1688 | } |
1689 | 1689 | ||
1690 | public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) | 1690 | public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) |
1691 | { | 1691 | { |
1692 | } | ||
1693 | |||
1694 | public void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes) | ||
1695 | { | ||
1696 | } | ||
1697 | |||
1698 | public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals) | ||
1699 | { | ||
1692 | } | 1700 | } |
1693 | } | 1701 | } |
1694 | } | 1702 | } |
diff --git a/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs b/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs index 108eab1..87db85b 100644 --- a/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs +++ b/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs | |||
@@ -401,25 +401,25 @@ namespace OpenSim.Client.Sirikata.ClientStack | |||
401 | public event GrantUserFriendRights OnGrantUserRights; | 401 | public event GrantUserFriendRights OnGrantUserRights; |
402 | public event MuteListRequest OnMuteListRequest; | 402 | public event MuteListRequest OnMuteListRequest; |
403 | public event PlacesQuery OnPlacesQuery; | 403 | public event PlacesQuery OnPlacesQuery; |
404 | public event FindAgentUpdate OnFindAgentEvent; | 404 | public event FindAgentUpdate OnFindAgent; |
405 | public event TrackAgentUpdate OnTrackAgentEvent; | 405 | public event TrackAgentUpdate OnTrackAgent; |
406 | public event NewUserReport OnUserReportEvent; | 406 | public event NewUserReport OnUserReport; |
407 | public event SaveStateHandler OnSaveStateEvent; | 407 | public event SaveStateHandler OnSaveState; |
408 | public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; | 408 | public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; |
409 | public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; | 409 | public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; |
410 | public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; | 410 | public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; |
411 | public event FreezeUserUpdate OnParcelFreezeUserEvent; | 411 | public event FreezeUserUpdate OnParcelFreezeUser; |
412 | public event EjectUserUpdate OnParcelEjectUserEvent; | 412 | public event EjectUserUpdate OnParcelEjectUser; |
413 | public event ParcelBuyPass OnParcelBuyPass; | 413 | public event ParcelBuyPass OnParcelBuyPass; |
414 | public event ParcelGodMark OnParcelGodMark; | 414 | public event ParcelGodMark OnParcelGodMark; |
415 | public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; | 415 | public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; |
416 | public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; | 416 | public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; |
417 | public event SimWideDeletesDelegate OnSimWideDeletes; | 417 | public event SimWideDeletesDelegate OnSimWideDeletes; |
418 | public event SendPostcard OnSendPostcard; | 418 | public event SendPostcard OnSendPostcard; |
419 | public event MuteListEntryUpdate OnUpdateMuteListEntryEvent; | 419 | public event MuteListEntryUpdate OnUpdateMuteListEntry; |
420 | public event MuteListEntryRemove OnRemoveMuteListEntryEvent; | 420 | public event MuteListEntryRemove OnRemoveMuteListEntry; |
421 | public event GodlikeMessage onGodlikeMessageEvent; | 421 | public event GodlikeMessage onGodlikeMessage; |
422 | public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent; | 422 | public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate; |
423 | public void SetDebugPacketLevel(int newDebug) | 423 | public void SetDebugPacketLevel(int newDebug) |
424 | { | 424 | { |
425 | throw new System.NotImplementedException(); | 425 | throw new System.NotImplementedException(); |
@@ -1177,7 +1177,15 @@ namespace OpenSim.Client.Sirikata.ClientStack | |||
1177 | } | 1177 | } |
1178 | 1178 | ||
1179 | public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) | 1179 | public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) |
1180 | { | 1180 | { |
1181 | } | ||
1182 | |||
1183 | public void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes) | ||
1184 | { | ||
1185 | } | ||
1186 | |||
1187 | public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals) | ||
1188 | { | ||
1181 | } | 1189 | } |
1182 | 1190 | ||
1183 | #endregion | 1191 | #endregion |
diff --git a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs index e1418d8..5268e42 100644 --- a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs +++ b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs | |||
@@ -405,25 +405,25 @@ namespace OpenSim.Client.VWoHTTP.ClientStack | |||
405 | public event MuteListRequest OnMuteListRequest = delegate { }; | 405 | public event MuteListRequest OnMuteListRequest = delegate { }; |
406 | public event AvatarInterestUpdate OnAvatarInterestUpdate = delegate { }; | 406 | public event AvatarInterestUpdate OnAvatarInterestUpdate = delegate { }; |
407 | public event PlacesQuery OnPlacesQuery = delegate { }; | 407 | public event PlacesQuery OnPlacesQuery = delegate { }; |
408 | public event FindAgentUpdate OnFindAgentEvent = delegate { }; | 408 | public event FindAgentUpdate OnFindAgent = delegate { }; |
409 | public event TrackAgentUpdate OnTrackAgentEvent = delegate { }; | 409 | public event TrackAgentUpdate OnTrackAgent = delegate { }; |
410 | public event NewUserReport OnUserReportEvent = delegate { }; | 410 | public event NewUserReport OnUserReport = delegate { }; |
411 | public event SaveStateHandler OnSaveStateEvent = delegate { }; | 411 | public event SaveStateHandler OnSaveState = delegate { }; |
412 | public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest = delegate { }; | 412 | public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest = delegate { }; |
413 | public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest = delegate { }; | 413 | public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest = delegate { }; |
414 | public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest = delegate { }; | 414 | public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest = delegate { }; |
415 | public event FreezeUserUpdate OnParcelFreezeUserEvent = delegate { }; | 415 | public event FreezeUserUpdate OnParcelFreezeUser = delegate { }; |
416 | public event EjectUserUpdate OnParcelEjectUserEvent = delegate { }; | 416 | public event EjectUserUpdate OnParcelEjectUser = delegate { }; |
417 | public event ParcelBuyPass OnParcelBuyPass = delegate { }; | 417 | public event ParcelBuyPass OnParcelBuyPass = delegate { }; |
418 | public event ParcelGodMark OnParcelGodMark = delegate { }; | 418 | public event ParcelGodMark OnParcelGodMark = delegate { }; |
419 | public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest = delegate { }; | 419 | public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest = delegate { }; |
420 | public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest = delegate { }; | 420 | public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest = delegate { }; |
421 | public event SimWideDeletesDelegate OnSimWideDeletes = delegate { }; | 421 | public event SimWideDeletesDelegate OnSimWideDeletes = delegate { }; |
422 | public event SendPostcard OnSendPostcard = delegate { }; | 422 | public event SendPostcard OnSendPostcard = delegate { }; |
423 | public event MuteListEntryUpdate OnUpdateMuteListEntryEvent = delegate { }; | 423 | public event MuteListEntryUpdate OnUpdateMuteListEntry = delegate { }; |
424 | public event MuteListEntryRemove OnRemoveMuteListEntryEvent = delegate { }; | 424 | public event MuteListEntryRemove OnRemoveMuteListEntry = delegate { }; |
425 | public event GodlikeMessage onGodlikeMessageEvent = delegate { }; | 425 | public event GodlikeMessage onGodlikeMessage = delegate { }; |
426 | public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent = delegate { }; | 426 | public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate = delegate { }; |
427 | 427 | ||
428 | 428 | ||
429 | 429 | ||
@@ -1194,7 +1194,15 @@ namespace OpenSim.Client.VWoHTTP.ClientStack | |||
1194 | } | 1194 | } |
1195 | 1195 | ||
1196 | public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) | 1196 | public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) |
1197 | { | 1197 | { |
1198 | } | ||
1199 | |||
1200 | public void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes) | ||
1201 | { | ||
1202 | } | ||
1203 | |||
1204 | public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals) | ||
1205 | { | ||
1198 | } | 1206 | } |
1199 | } | 1207 | } |
1200 | } | 1208 | } |
diff --git a/OpenSim/ConsoleClient/ConsoleClient.cs b/OpenSim/ConsoleClient/ConsoleClient.cs index 783adef..d195d25 100644 --- a/OpenSim/ConsoleClient/ConsoleClient.cs +++ b/OpenSim/ConsoleClient/ConsoleClient.cs | |||
@@ -82,7 +82,13 @@ namespace OpenSim.ConsoleClient | |||
82 | 82 | ||
83 | private static void SendCommand(string module, string[] cmd) | 83 | private static void SendCommand(string module, string[] cmd) |
84 | { | 84 | { |
85 | string sendCmd = String.Join(" ", cmd); | 85 | string sendCmd = cmd[0]; |
86 | if (cmd.Length > 1) | ||
87 | { | ||
88 | Array.Copy(cmd, 1, cmd, 0, cmd.Length-1); | ||
89 | Array.Resize(ref cmd, cmd.Length-1); | ||
90 | sendCmd += "\"" + String.Join("\" \"", cmd) + "\""; | ||
91 | } | ||
86 | 92 | ||
87 | Requester.MakeRequest("http://"+m_Host+":"+m_Port.ToString()+"/SessionCommand/", String.Format("ID={0}&COMMAND={1}", m_SessionID, sendCmd), CommandReply); | 93 | Requester.MakeRequest("http://"+m_Host+":"+m_Port.ToString()+"/SessionCommand/", String.Format("ID={0}&COMMAND={1}", m_SessionID, sendCmd), CommandReply); |
88 | } | 94 | } |
diff --git a/OpenSim/Data/SQLite/SQLiteFramework.cs b/OpenSim/Data/SQLite/SQLiteFramework.cs new file mode 100644 index 0000000..12b2750 --- /dev/null +++ b/OpenSim/Data/SQLite/SQLiteFramework.cs | |||
@@ -0,0 +1,83 @@ | |||
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 OpenSimulator 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 | |||
28 | using System; | ||
29 | using System.Collections; | ||
30 | using System.Collections.Generic; | ||
31 | using System.Data; | ||
32 | using OpenMetaverse; | ||
33 | using OpenSim.Framework; | ||
34 | using Mono.Data.SqliteClient; | ||
35 | |||
36 | namespace OpenSim.Data.SQLite | ||
37 | { | ||
38 | /// <summary> | ||
39 | /// A database interface class to a user profile storage system | ||
40 | /// </summary> | ||
41 | public class SQLiteFramework | ||
42 | { | ||
43 | protected SqliteConnection m_Connection; | ||
44 | |||
45 | protected SQLiteFramework(string connectionString) | ||
46 | { | ||
47 | m_Connection = new SqliteConnection(connectionString); | ||
48 | m_Connection.Open(); | ||
49 | } | ||
50 | |||
51 | ////////////////////////////////////////////////////////////// | ||
52 | // | ||
53 | // All non queries are funneled through one connection | ||
54 | // to increase performance a little | ||
55 | // | ||
56 | protected int ExecuteNonQuery(SqliteCommand cmd) | ||
57 | { | ||
58 | lock (m_Connection) | ||
59 | { | ||
60 | cmd.Connection = m_Connection; | ||
61 | |||
62 | return cmd.ExecuteNonQuery(); | ||
63 | } | ||
64 | } | ||
65 | |||
66 | protected IDataReader ExecuteReader(SqliteCommand cmd) | ||
67 | { | ||
68 | SqliteConnection newConnection = | ||
69 | (SqliteConnection)((ICloneable)m_Connection).Clone(); | ||
70 | newConnection.Open(); | ||
71 | |||
72 | cmd.Connection = newConnection; | ||
73 | return cmd.ExecuteReader(); | ||
74 | } | ||
75 | |||
76 | protected void CloseReaderCommand(SqliteCommand cmd) | ||
77 | { | ||
78 | cmd.Connection.Close(); | ||
79 | cmd.Connection.Dispose(); | ||
80 | cmd.Dispose(); | ||
81 | } | ||
82 | } | ||
83 | } | ||
diff --git a/OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs b/OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs new file mode 100644 index 0000000..6b67ec6 --- /dev/null +++ b/OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs | |||
@@ -0,0 +1,253 @@ | |||
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 OpenSimulator 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 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Data; | ||
31 | using System.Reflection; | ||
32 | using log4net; | ||
33 | using Mono.Data.SqliteClient; | ||
34 | using OpenMetaverse; | ||
35 | using OpenSim.Framework; | ||
36 | using OpenSim.Region.Framework.Interfaces; | ||
37 | |||
38 | namespace OpenSim.Data.SQLite | ||
39 | { | ||
40 | public class SQLiteGenericTableHandler<T> : SQLiteFramework where T: class, new() | ||
41 | { | ||
42 | private static readonly ILog m_log = | ||
43 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
44 | |||
45 | |||
46 | protected Dictionary<string, FieldInfo> m_Fields = | ||
47 | new Dictionary<string, FieldInfo>(); | ||
48 | |||
49 | protected List<string> m_ColumnNames = null; | ||
50 | protected string m_Realm; | ||
51 | protected FieldInfo m_DataField = null; | ||
52 | |||
53 | public SQLiteGenericTableHandler(string connectionString, | ||
54 | string realm, string storeName) : base(connectionString) | ||
55 | { | ||
56 | m_Realm = realm; | ||
57 | if (storeName != String.Empty) | ||
58 | { | ||
59 | Assembly assem = GetType().Assembly; | ||
60 | |||
61 | Migration m = new Migration(m_Connection, assem, storeName); | ||
62 | m.Update(); | ||
63 | } | ||
64 | |||
65 | Type t = typeof(T); | ||
66 | FieldInfo[] fields = t.GetFields(BindingFlags.Public | | ||
67 | BindingFlags.Instance | | ||
68 | BindingFlags.DeclaredOnly); | ||
69 | |||
70 | if (fields.Length == 0) | ||
71 | return; | ||
72 | |||
73 | foreach (FieldInfo f in fields) | ||
74 | { | ||
75 | if (f.Name != "Data") | ||
76 | m_Fields[f.Name] = f; | ||
77 | else | ||
78 | m_DataField = f; | ||
79 | } | ||
80 | } | ||
81 | |||
82 | private void CheckColumnNames(IDataReader reader) | ||
83 | { | ||
84 | if (m_ColumnNames != null) | ||
85 | return; | ||
86 | |||
87 | m_ColumnNames = new List<string>(); | ||
88 | |||
89 | DataTable schemaTable = reader.GetSchemaTable(); | ||
90 | foreach (DataRow row in schemaTable.Rows) | ||
91 | { | ||
92 | if (row["ColumnName"] != null && | ||
93 | (!m_Fields.ContainsKey(row["ColumnName"].ToString()))) | ||
94 | m_ColumnNames.Add(row["ColumnName"].ToString()); | ||
95 | } | ||
96 | } | ||
97 | |||
98 | public T[] Get(string field, string key) | ||
99 | { | ||
100 | return Get(new string[] { field }, new string[] { key }); | ||
101 | } | ||
102 | |||
103 | public T[] Get(string[] fields, string[] keys) | ||
104 | { | ||
105 | if (fields.Length != keys.Length) | ||
106 | return new T[0]; | ||
107 | |||
108 | List<string> terms = new List<string>(); | ||
109 | |||
110 | SqliteCommand cmd = new SqliteCommand(); | ||
111 | |||
112 | for (int i = 0 ; i < fields.Length ; i++) | ||
113 | { | ||
114 | cmd.Parameters.Add(new SqliteParameter(":" + fields[i], keys[i])); | ||
115 | terms.Add("`" + fields[i] + "` = :" + fields[i]); | ||
116 | } | ||
117 | |||
118 | string where = String.Join(" and ", terms.ToArray()); | ||
119 | |||
120 | string query = String.Format("select * from {0} where {1}", | ||
121 | m_Realm, where); | ||
122 | |||
123 | cmd.CommandText = query; | ||
124 | |||
125 | return DoQuery(cmd); | ||
126 | } | ||
127 | |||
128 | protected T[] DoQuery(SqliteCommand cmd) | ||
129 | { | ||
130 | IDataReader reader = ExecuteReader(cmd); | ||
131 | if (reader == null) | ||
132 | return new T[0]; | ||
133 | |||
134 | CheckColumnNames(reader); | ||
135 | |||
136 | List<T> result = new List<T>(); | ||
137 | |||
138 | while (reader.Read()) | ||
139 | { | ||
140 | T row = new T(); | ||
141 | |||
142 | foreach (string name in m_Fields.Keys) | ||
143 | { | ||
144 | if (m_Fields[name].GetValue(row) is bool) | ||
145 | { | ||
146 | int v = Convert.ToInt32(reader[name]); | ||
147 | m_Fields[name].SetValue(row, v != 0 ? true : false); | ||
148 | } | ||
149 | else if (m_Fields[name].GetValue(row) is UUID) | ||
150 | { | ||
151 | UUID uuid = UUID.Zero; | ||
152 | |||
153 | UUID.TryParse(reader[name].ToString(), out uuid); | ||
154 | m_Fields[name].SetValue(row, uuid); | ||
155 | } | ||
156 | else if (m_Fields[name].GetValue(row) is int) | ||
157 | { | ||
158 | int v = Convert.ToInt32(reader[name]); | ||
159 | m_Fields[name].SetValue(row, v); | ||
160 | } | ||
161 | else | ||
162 | { | ||
163 | m_Fields[name].SetValue(row, reader[name]); | ||
164 | } | ||
165 | } | ||
166 | |||
167 | if (m_DataField != null) | ||
168 | { | ||
169 | Dictionary<string, string> data = | ||
170 | new Dictionary<string, string>(); | ||
171 | |||
172 | foreach (string col in m_ColumnNames) | ||
173 | { | ||
174 | data[col] = reader[col].ToString(); | ||
175 | if (data[col] == null) | ||
176 | data[col] = String.Empty; | ||
177 | } | ||
178 | |||
179 | m_DataField.SetValue(row, data); | ||
180 | } | ||
181 | |||
182 | result.Add(row); | ||
183 | } | ||
184 | |||
185 | CloseReaderCommand(cmd); | ||
186 | |||
187 | return result.ToArray(); | ||
188 | } | ||
189 | |||
190 | public T[] Get(string where) | ||
191 | { | ||
192 | SqliteCommand cmd = new SqliteCommand(); | ||
193 | |||
194 | string query = String.Format("select * from {0} where {1}", | ||
195 | m_Realm, where); | ||
196 | |||
197 | cmd.CommandText = query; | ||
198 | |||
199 | return DoQuery(cmd); | ||
200 | } | ||
201 | |||
202 | public bool Store(T row) | ||
203 | { | ||
204 | SqliteCommand cmd = new SqliteCommand(); | ||
205 | |||
206 | string query = ""; | ||
207 | List<String> names = new List<String>(); | ||
208 | List<String> values = new List<String>(); | ||
209 | |||
210 | foreach (FieldInfo fi in m_Fields.Values) | ||
211 | { | ||
212 | names.Add(fi.Name); | ||
213 | values.Add(":" + fi.Name); | ||
214 | cmd.Parameters.Add(new SqliteParameter(":" + fi.Name, fi.GetValue(row).ToString())); | ||
215 | } | ||
216 | |||
217 | if (m_DataField != null) | ||
218 | { | ||
219 | Dictionary<string, string> data = | ||
220 | (Dictionary<string, string>)m_DataField.GetValue(row); | ||
221 | |||
222 | foreach (KeyValuePair<string, string> kvp in data) | ||
223 | { | ||
224 | names.Add(kvp.Key); | ||
225 | values.Add(":" + kvp.Key); | ||
226 | cmd.Parameters.Add(new SqliteParameter(":" + kvp.Key, kvp.Value)); | ||
227 | } | ||
228 | } | ||
229 | |||
230 | query = String.Format("replace into {0} (`", m_Realm) + String.Join("`,`", names.ToArray()) + "`) values (" + String.Join(",", values.ToArray()) + ")"; | ||
231 | |||
232 | cmd.CommandText = query; | ||
233 | |||
234 | if (ExecuteNonQuery(cmd) > 0) | ||
235 | return true; | ||
236 | |||
237 | return false; | ||
238 | } | ||
239 | |||
240 | public bool Delete(string field, string val) | ||
241 | { | ||
242 | SqliteCommand cmd = new SqliteCommand(); | ||
243 | |||
244 | cmd.CommandText = String.Format("delete from {0} where `{1}` = :{1}", m_Realm, field); | ||
245 | cmd.Parameters.Add(new SqliteParameter(field, val)); | ||
246 | |||
247 | if (ExecuteNonQuery(cmd) > 0) | ||
248 | return true; | ||
249 | |||
250 | return false; | ||
251 | } | ||
252 | } | ||
253 | } | ||
diff --git a/OpenSim/Data/SQLite/SQLiteXInventoryData.cs b/OpenSim/Data/SQLite/SQLiteXInventoryData.cs new file mode 100644 index 0000000..97625a7 --- /dev/null +++ b/OpenSim/Data/SQLite/SQLiteXInventoryData.cs | |||
@@ -0,0 +1,156 @@ | |||
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 OpenSimulator 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 | |||
28 | using System; | ||
29 | using System.Data; | ||
30 | using System.Reflection; | ||
31 | using System.Collections.Generic; | ||
32 | using Mono.Data.SqliteClient; | ||
33 | using log4net; | ||
34 | using OpenMetaverse; | ||
35 | using OpenSim.Framework; | ||
36 | |||
37 | namespace OpenSim.Data.SQLite | ||
38 | { | ||
39 | /// <summary> | ||
40 | /// A MySQL Interface for the Asset Server | ||
41 | /// </summary> | ||
42 | public class SQLiteXInventoryData : IXInventoryData | ||
43 | { | ||
44 | private static readonly ILog m_log = LogManager.GetLogger( | ||
45 | MethodBase.GetCurrentMethod().DeclaringType); | ||
46 | |||
47 | private SQLiteGenericTableHandler<XInventoryFolder> m_Folders; | ||
48 | private SqliteItemHandler m_Items; | ||
49 | |||
50 | public SQLiteXInventoryData(string conn, string realm) | ||
51 | { | ||
52 | m_Folders = new SQLiteGenericTableHandler<XInventoryFolder>( | ||
53 | conn, "inventoryfolders", "InventoryStore"); | ||
54 | m_Items = new SqliteItemHandler( | ||
55 | conn, "inventoryitems", String.Empty); | ||
56 | } | ||
57 | |||
58 | public XInventoryFolder[] GetFolders(string[] fields, string[] vals) | ||
59 | { | ||
60 | return m_Folders.Get(fields, vals); | ||
61 | } | ||
62 | |||
63 | public XInventoryItem[] GetItems(string[] fields, string[] vals) | ||
64 | { | ||
65 | return m_Items.Get(fields, vals); | ||
66 | } | ||
67 | |||
68 | public bool StoreFolder(XInventoryFolder folder) | ||
69 | { | ||
70 | return m_Folders.Store(folder); | ||
71 | } | ||
72 | |||
73 | public bool StoreItem(XInventoryItem item) | ||
74 | { | ||
75 | return m_Items.Store(item); | ||
76 | } | ||
77 | |||
78 | public bool DeleteFolders(string field, string val) | ||
79 | { | ||
80 | return m_Folders.Delete(field, val); | ||
81 | } | ||
82 | |||
83 | public bool DeleteItems(string field, string val) | ||
84 | { | ||
85 | return m_Items.Delete(field, val); | ||
86 | } | ||
87 | |||
88 | public bool MoveItem(string id, string newParent) | ||
89 | { | ||
90 | return m_Items.MoveItem(id, newParent); | ||
91 | } | ||
92 | |||
93 | public XInventoryItem[] GetActiveGestures(UUID principalID) | ||
94 | { | ||
95 | return m_Items.GetActiveGestures(principalID); | ||
96 | } | ||
97 | |||
98 | public int GetAssetPermissions(UUID principalID, UUID assetID) | ||
99 | { | ||
100 | return m_Items.GetAssetPermissions(principalID, assetID); | ||
101 | } | ||
102 | } | ||
103 | |||
104 | public class SqliteItemHandler : SQLiteGenericTableHandler<XInventoryItem> | ||
105 | { | ||
106 | public SqliteItemHandler(string c, string t, string m) : | ||
107 | base(c, t, m) | ||
108 | { | ||
109 | } | ||
110 | |||
111 | public bool MoveItem(string id, string newParent) | ||
112 | { | ||
113 | SqliteCommand cmd = new SqliteCommand(); | ||
114 | |||
115 | cmd.CommandText = String.Format("update {0} set parentFolderID = :ParentFolderID where inventoryID = :InventoryID", m_Realm); | ||
116 | cmd.Parameters.Add(new SqliteParameter(":ParentFolderID", newParent)); | ||
117 | cmd.Parameters.Add(new SqliteParameter(":InventoryID", id)); | ||
118 | |||
119 | return ExecuteNonQuery(cmd) == 0 ? false : true; | ||
120 | } | ||
121 | |||
122 | public XInventoryItem[] GetActiveGestures(UUID principalID) | ||
123 | { | ||
124 | SqliteCommand cmd = new SqliteCommand(); | ||
125 | cmd.CommandText = String.Format("select * from inventoryitems where avatarId = :uuid and assetType = :type and flags = 1", m_Realm); | ||
126 | |||
127 | cmd.Parameters.Add(new SqliteParameter(":uuid", principalID.ToString())); | ||
128 | cmd.Parameters.Add(new SqliteParameter(":type", (int)AssetType.Gesture)); | ||
129 | |||
130 | return DoQuery(cmd); | ||
131 | } | ||
132 | |||
133 | public int GetAssetPermissions(UUID principalID, UUID assetID) | ||
134 | { | ||
135 | SqliteCommand cmd = new SqliteCommand(); | ||
136 | |||
137 | cmd.CommandText = String.Format("select inventoryCurrentPermissions from inventoryitems where avatarID = :PrincipalID and assetID = :AssetID", m_Realm); | ||
138 | cmd.Parameters.Add(new SqliteParameter(":PrincipalID", principalID.ToString())); | ||
139 | cmd.Parameters.Add(new SqliteParameter(":AssetID", assetID.ToString())); | ||
140 | |||
141 | IDataReader reader = ExecuteReader(cmd); | ||
142 | |||
143 | int perms = 0; | ||
144 | |||
145 | while (reader.Read()) | ||
146 | { | ||
147 | perms |= Convert.ToInt32(reader["inventoryCurrentPermissions"]); | ||
148 | } | ||
149 | |||
150 | reader.Close(); | ||
151 | CloseReaderCommand(cmd); | ||
152 | |||
153 | return perms; | ||
154 | } | ||
155 | } | ||
156 | } | ||
diff --git a/OpenSim/Framework/Console/CommandConsole.cs b/OpenSim/Framework/Console/CommandConsole.cs index 9671bc2..66f483c 100644 --- a/OpenSim/Framework/Console/CommandConsole.cs +++ b/OpenSim/Framework/Console/CommandConsole.cs | |||
@@ -552,8 +552,9 @@ namespace OpenSim.Framework.Console | |||
552 | } | 552 | } |
553 | } | 553 | } |
554 | 554 | ||
555 | // A console that processes commands internally | 555 | /// <summary> |
556 | // | 556 | /// A console that processes commands internally |
557 | /// </summary> | ||
557 | public class CommandConsole : ConsoleBase | 558 | public class CommandConsole : ConsoleBase |
558 | { | 559 | { |
559 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 560 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
@@ -574,6 +575,9 @@ namespace OpenSim.Framework.Console | |||
574 | Output(s); | 575 | Output(s); |
575 | } | 576 | } |
576 | 577 | ||
578 | /// <summary> | ||
579 | /// Display a command prompt on the console and wait for user input | ||
580 | /// </summary> | ||
577 | public void Prompt() | 581 | public void Prompt() |
578 | { | 582 | { |
579 | string line = ReadLine(m_defaultPrompt + "# ", true, true); | 583 | string line = ReadLine(m_defaultPrompt + "# ", true, true); |
diff --git a/OpenSim/Framework/Console/LocalConsole.cs b/OpenSim/Framework/Console/LocalConsole.cs index 39edd2a..b7e191b 100644 --- a/OpenSim/Framework/Console/LocalConsole.cs +++ b/OpenSim/Framework/Console/LocalConsole.cs | |||
@@ -36,8 +36,9 @@ using log4net; | |||
36 | 36 | ||
37 | namespace OpenSim.Framework.Console | 37 | namespace OpenSim.Framework.Console |
38 | { | 38 | { |
39 | // A console that uses cursor control and color | 39 | /// <summary> |
40 | // | 40 | /// A console that uses cursor control and color |
41 | /// </summary> | ||
41 | public class LocalConsole : CommandConsole | 42 | public class LocalConsole : CommandConsole |
42 | { | 43 | { |
43 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 44 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
@@ -85,30 +86,70 @@ namespace OpenSim.Framework.Console | |||
85 | history.Add(text); | 86 | history.Add(text); |
86 | } | 87 | } |
87 | 88 | ||
89 | /// <summary> | ||
90 | /// Set the cursor row. | ||
91 | /// </summary> | ||
92 | /// | ||
93 | /// <param name="top"> | ||
94 | /// Row to set. If this is below 0, then the row is set to 0. If it is equal to the buffer height or greater | ||
95 | /// then it is set to one less than the height. | ||
96 | /// </param> | ||
97 | /// <returns> | ||
98 | /// The new cursor row. | ||
99 | /// </returns> | ||
88 | private int SetCursorTop(int top) | 100 | private int SetCursorTop(int top) |
89 | { | 101 | { |
90 | if (top >= 0 && top < System.Console.BufferHeight) | 102 | // From at least mono 2.4.2.3, window resizing can give mono an invalid row and column values. If we try |
91 | { | 103 | // to set a cursor row position with a currently invalid column, mono will throw an exception. |
92 | System.Console.CursorTop = top; | 104 | // Therefore, we need to make sure that the column position is valid first. |
93 | return top; | 105 | int left = System.Console.CursorLeft; |
94 | } | 106 | |
95 | else | 107 | if (left < 0) |
96 | { | 108 | System.Console.CursorLeft = 0; |
97 | return System.Console.CursorTop; | 109 | else if (left >= System.Console.BufferWidth) |
98 | } | 110 | System.Console.CursorLeft = System.Console.BufferWidth - 1; |
111 | |||
112 | if (top < 0) | ||
113 | top = 0; | ||
114 | if (top >= System.Console.BufferHeight) | ||
115 | top = System.Console.BufferHeight - 1; | ||
116 | |||
117 | System.Console.CursorTop = top; | ||
118 | |||
119 | return top; | ||
99 | } | 120 | } |
100 | 121 | ||
122 | /// <summary> | ||
123 | /// Set the cursor column. | ||
124 | /// </summary> | ||
125 | /// | ||
126 | /// <param name="left"> | ||
127 | /// Column to set. If this is below 0, then the column is set to 0. If it is equal to the buffer width or greater | ||
128 | /// then it is set to one less than the width. | ||
129 | /// </param> | ||
130 | /// <returns> | ||
131 | /// The new cursor column. | ||
132 | /// </returns> | ||
101 | private int SetCursorLeft(int left) | 133 | private int SetCursorLeft(int left) |
102 | { | 134 | { |
103 | if (left >= 0 && left < System.Console.BufferWidth) | 135 | // From at least mono 2.4.2.3, window resizing can give mono an invalid row and column values. If we try |
104 | { | 136 | // to set a cursor column position with a currently invalid row, mono will throw an exception. |
105 | System.Console.CursorLeft = left; | 137 | // Therefore, we need to make sure that the row position is valid first. |
106 | return left; | 138 | int top = System.Console.CursorTop; |
107 | } | 139 | |
108 | else | 140 | if (top < 0) |
109 | { | 141 | System.Console.CursorTop = 0; |
110 | return System.Console.CursorLeft; | 142 | else if (top >= System.Console.BufferHeight) |
111 | } | 143 | System.Console.CursorTop = System.Console.BufferHeight - 1; |
144 | |||
145 | if (left < 0) | ||
146 | left = 0; | ||
147 | if (left >= System.Console.BufferWidth) | ||
148 | left = System.Console.BufferWidth - 1; | ||
149 | |||
150 | System.Console.CursorLeft = left; | ||
151 | |||
152 | return left; | ||
112 | } | 153 | } |
113 | 154 | ||
114 | private void Show() | 155 | private void Show() |
@@ -128,21 +169,21 @@ namespace OpenSim.Framework.Console | |||
128 | { | 169 | { |
129 | y--; | 170 | y--; |
130 | new_y--; | 171 | new_y--; |
131 | System.Console.CursorLeft = 0; | 172 | SetCursorLeft(0); |
132 | System.Console.CursorTop = System.Console.BufferHeight-1; | 173 | SetCursorTop(System.Console.BufferHeight - 1); |
133 | System.Console.WriteLine(" "); | 174 | System.Console.WriteLine(" "); |
134 | } | 175 | } |
135 | 176 | ||
136 | y=SetCursorTop(y); | 177 | y = SetCursorTop(y); |
137 | System.Console.CursorLeft = 0; | 178 | SetCursorLeft(0); |
138 | 179 | ||
139 | if (echo) | 180 | if (echo) |
140 | System.Console.Write("{0}{1}", prompt, cmdline); | 181 | System.Console.Write("{0}{1}", prompt, cmdline); |
141 | else | 182 | else |
142 | System.Console.Write("{0}", prompt); | 183 | System.Console.Write("{0}", prompt); |
143 | 184 | ||
144 | SetCursorLeft(new_x); | ||
145 | SetCursorTop(new_y); | 185 | SetCursorTop(new_y); |
186 | SetCursorLeft(new_x); | ||
146 | } | 187 | } |
147 | } | 188 | } |
148 | 189 | ||
@@ -162,8 +203,7 @@ namespace OpenSim.Framework.Console | |||
162 | System.Console.Write(" "); | 203 | System.Console.Write(" "); |
163 | 204 | ||
164 | y = SetCursorTop(y); | 205 | y = SetCursorTop(y); |
165 | System.Console.CursorLeft = 0; | 206 | SetCursorLeft(0); |
166 | |||
167 | } | 207 | } |
168 | } | 208 | } |
169 | catch (Exception) | 209 | catch (Exception) |
@@ -252,7 +292,7 @@ namespace OpenSim.Framework.Console | |||
252 | } | 292 | } |
253 | 293 | ||
254 | y = SetCursorTop(y); | 294 | y = SetCursorTop(y); |
255 | System.Console.CursorLeft = 0; | 295 | SetCursorLeft(0); |
256 | 296 | ||
257 | int count = cmdline.Length + prompt.Length; | 297 | int count = cmdline.Length + prompt.Length; |
258 | 298 | ||
@@ -260,7 +300,7 @@ namespace OpenSim.Framework.Console | |||
260 | System.Console.Write(" "); | 300 | System.Console.Write(" "); |
261 | 301 | ||
262 | y = SetCursorTop(y); | 302 | y = SetCursorTop(y); |
263 | System.Console.CursorLeft = 0; | 303 | SetCursorLeft(0); |
264 | 304 | ||
265 | WriteLocalText(text, level); | 305 | WriteLocalText(text, level); |
266 | 306 | ||
@@ -299,7 +339,7 @@ namespace OpenSim.Framework.Console | |||
299 | echo = e; | 339 | echo = e; |
300 | int historyLine = history.Count; | 340 | int historyLine = history.Count; |
301 | 341 | ||
302 | System.Console.CursorLeft = 0; // Needed for mono | 342 | SetCursorLeft(0); // Needed for mono |
303 | System.Console.Write(" "); // Needed for mono | 343 | System.Console.Write(" "); // Needed for mono |
304 | 344 | ||
305 | lock (cmdline) | 345 | lock (cmdline) |
@@ -339,7 +379,7 @@ namespace OpenSim.Framework.Console | |||
339 | cmdline.Remove(cp-1, 1); | 379 | cmdline.Remove(cp-1, 1); |
340 | cp--; | 380 | cp--; |
341 | 381 | ||
342 | System.Console.CursorLeft = 0; | 382 | SetCursorLeft(0); |
343 | y = SetCursorTop(y); | 383 | y = SetCursorTop(y); |
344 | 384 | ||
345 | System.Console.Write("{0}{1} ", prompt, cmdline); | 385 | System.Console.Write("{0}{1} ", prompt, cmdline); |
@@ -387,7 +427,7 @@ namespace OpenSim.Framework.Console | |||
387 | cp++; | 427 | cp++; |
388 | break; | 428 | break; |
389 | case ConsoleKey.Enter: | 429 | case ConsoleKey.Enter: |
390 | System.Console.CursorLeft = 0; | 430 | SetCursorLeft(0); |
391 | y = SetCursorTop(y); | 431 | y = SetCursorTop(y); |
392 | 432 | ||
393 | System.Console.WriteLine("{0}{1}", prompt, cmdline); | 433 | System.Console.WriteLine("{0}{1}", prompt, cmdline); |
@@ -424,4 +464,4 @@ namespace OpenSim.Framework.Console | |||
424 | } | 464 | } |
425 | } | 465 | } |
426 | } | 466 | } |
427 | } | 467 | } \ No newline at end of file |
diff --git a/OpenSim/Framework/GroupData.cs b/OpenSim/Framework/GroupData.cs index 247420e..e3b8626 100644 --- a/OpenSim/Framework/GroupData.cs +++ b/OpenSim/Framework/GroupData.cs | |||
@@ -135,4 +135,30 @@ namespace OpenSim.Framework | |||
135 | public bool HasAttachment; | 135 | public bool HasAttachment; |
136 | public byte AssetType; | 136 | public byte AssetType; |
137 | } | 137 | } |
138 | |||
139 | public struct GroupVoteHistory | ||
140 | { | ||
141 | public string VoteID; | ||
142 | public string VoteInitiator; | ||
143 | public string Majority; | ||
144 | public string Quorum; | ||
145 | public string TerseDateID; | ||
146 | public string StartDateTime; | ||
147 | public string EndDateTime; | ||
148 | public string VoteType; | ||
149 | public string VoteResult; | ||
150 | public string ProposalText; | ||
151 | } | ||
152 | |||
153 | public struct GroupActiveProposals | ||
154 | { | ||
155 | public string VoteID; | ||
156 | public string VoteInitiator; | ||
157 | public string Majority; | ||
158 | public string Quorum; | ||
159 | public string TerseDateID; | ||
160 | public string StartDateTime; | ||
161 | public string EndDateTime; | ||
162 | public string ProposalText; | ||
163 | } | ||
138 | } | 164 | } |
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index defbbb9..861d05e 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs | |||
@@ -467,7 +467,7 @@ namespace OpenSim.Framework | |||
467 | 467 | ||
468 | public delegate void EjectUserUpdate(IClientAPI client, UUID parcelowner,uint flags, UUID target); | 468 | public delegate void EjectUserUpdate(IClientAPI client, UUID parcelowner,uint flags, UUID target); |
469 | 469 | ||
470 | public delegate void NewUserReport(IClientAPI client, string regionName,UUID abuserID, byte catagory, byte checkflags, string details, UUID objectID, Vector3 postion, byte reportType ,UUID screenshotID, string summery, UUID reporter); | 470 | public delegate void NewUserReport(IClientAPI client, string regionName,UUID abuserID, byte catagory, byte checkflags, string details, UUID objectID, Vector3 postion, byte reportType ,UUID screenshotID, string Summary, UUID reporter); |
471 | 471 | ||
472 | public delegate void GodUpdateRegionInfoUpdate(IClientAPI client, float BillableFactor, ulong EstateID, ulong RegionFlags, byte[] SimName,int RedirectX, int RedirectY); | 472 | public delegate void GodUpdateRegionInfoUpdate(IClientAPI client, float BillableFactor, ulong EstateID, ulong RegionFlags, byte[] SimName,int RedirectX, int RedirectY); |
473 | 473 | ||
@@ -1069,25 +1069,25 @@ namespace OpenSim.Framework | |||
1069 | 1069 | ||
1070 | event PlacesQuery OnPlacesQuery; | 1070 | event PlacesQuery OnPlacesQuery; |
1071 | 1071 | ||
1072 | event FindAgentUpdate OnFindAgentEvent; | 1072 | event FindAgentUpdate OnFindAgent; |
1073 | event TrackAgentUpdate OnTrackAgentEvent; | 1073 | event TrackAgentUpdate OnTrackAgent; |
1074 | event NewUserReport OnUserReportEvent; | 1074 | event NewUserReport OnUserReport; |
1075 | event SaveStateHandler OnSaveStateEvent; | 1075 | event SaveStateHandler OnSaveState; |
1076 | event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; | 1076 | event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; |
1077 | event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; | 1077 | event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; |
1078 | event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; | 1078 | event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; |
1079 | event FreezeUserUpdate OnParcelFreezeUserEvent; | 1079 | event FreezeUserUpdate OnParcelFreezeUser; |
1080 | event EjectUserUpdate OnParcelEjectUserEvent; | 1080 | event EjectUserUpdate OnParcelEjectUser; |
1081 | event ParcelBuyPass OnParcelBuyPass; | 1081 | event ParcelBuyPass OnParcelBuyPass; |
1082 | event ParcelGodMark OnParcelGodMark; | 1082 | event ParcelGodMark OnParcelGodMark; |
1083 | event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; | 1083 | event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; |
1084 | event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; | 1084 | event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; |
1085 | event SimWideDeletesDelegate OnSimWideDeletes; | 1085 | event SimWideDeletesDelegate OnSimWideDeletes; |
1086 | event SendPostcard OnSendPostcard; | 1086 | event SendPostcard OnSendPostcard; |
1087 | event MuteListEntryUpdate OnUpdateMuteListEntryEvent; | 1087 | event MuteListEntryUpdate OnUpdateMuteListEntry; |
1088 | event MuteListEntryRemove OnRemoveMuteListEntryEvent; | 1088 | event MuteListEntryRemove OnRemoveMuteListEntry; |
1089 | event GodlikeMessage onGodlikeMessageEvent; | 1089 | event GodlikeMessage onGodlikeMessage; |
1090 | event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent; | 1090 | event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate; |
1091 | 1091 | ||
1092 | /// <summary> | 1092 | /// <summary> |
1093 | /// Set the debug level at which packet output should be printed to console. | 1093 | /// Set the debug level at which packet output should be printed to console. |
@@ -1446,7 +1446,12 @@ namespace OpenSim.Framework | |||
1446 | void SendUserInfoReply(bool imViaEmail, bool visible, string email); | 1446 | void SendUserInfoReply(bool imViaEmail, bool visible, string email); |
1447 | 1447 | ||
1448 | void SendUseCachedMuteList(); | 1448 | void SendUseCachedMuteList(); |
1449 | void SendMuteListUpdate(string filename); | 1449 | |
1450 | void SendMuteListUpdate(string filename); | ||
1451 | |||
1452 | void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals); | ||
1453 | |||
1454 | void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes); | ||
1450 | 1455 | ||
1451 | void KillEndDone(); | 1456 | void KillEndDone(); |
1452 | 1457 | ||
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 0eed284..f3fd249 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -298,25 +298,25 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
298 | public event AvatarInterestUpdate OnAvatarInterestUpdate; | 298 | public event AvatarInterestUpdate OnAvatarInterestUpdate; |
299 | public event PlacesQuery OnPlacesQuery; | 299 | public event PlacesQuery OnPlacesQuery; |
300 | public event AgentFOV OnAgentFOV; | 300 | public event AgentFOV OnAgentFOV; |
301 | public event FindAgentUpdate OnFindAgentEvent; | 301 | public event FindAgentUpdate OnFindAgent; |
302 | public event TrackAgentUpdate OnTrackAgentEvent; | 302 | public event TrackAgentUpdate OnTrackAgent; |
303 | public event NewUserReport OnUserReportEvent; | 303 | public event NewUserReport OnUserReport; |
304 | public event SaveStateHandler OnSaveStateEvent; | 304 | public event SaveStateHandler OnSaveState; |
305 | public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; | 305 | public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; |
306 | public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; | 306 | public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; |
307 | public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; | 307 | public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; |
308 | public event FreezeUserUpdate OnParcelFreezeUserEvent; | 308 | public event FreezeUserUpdate OnParcelFreezeUser; |
309 | public event EjectUserUpdate OnParcelEjectUserEvent; | 309 | public event EjectUserUpdate OnParcelEjectUser; |
310 | public event ParcelBuyPass OnParcelBuyPass; | 310 | public event ParcelBuyPass OnParcelBuyPass; |
311 | public event ParcelGodMark OnParcelGodMark; | 311 | public event ParcelGodMark OnParcelGodMark; |
312 | public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; | 312 | public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; |
313 | public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; | 313 | public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; |
314 | public event SimWideDeletesDelegate OnSimWideDeletes; | 314 | public event SimWideDeletesDelegate OnSimWideDeletes; |
315 | public event SendPostcard OnSendPostcard; | 315 | public event SendPostcard OnSendPostcard; |
316 | public event MuteListEntryUpdate OnUpdateMuteListEntryEvent; | 316 | public event MuteListEntryUpdate OnUpdateMuteListEntry; |
317 | public event MuteListEntryRemove OnRemoveMuteListEntryEvent; | 317 | public event MuteListEntryRemove OnRemoveMuteListEntry; |
318 | public event GodlikeMessage onGodlikeMessageEvent; | 318 | public event GodlikeMessage onGodlikeMessage; |
319 | public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent; | 319 | public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate; |
320 | 320 | ||
321 | 321 | ||
322 | #endregion Events | 322 | #endregion Events |
@@ -825,37 +825,39 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
825 | } | 825 | } |
826 | OutPacket(gmp, ThrottleOutPacketType.Task); | 826 | OutPacket(gmp, ThrottleOutPacketType.Task); |
827 | } | 827 | } |
828 | 828 | ||
829 | public void SendGroupActiveProposals(IClientAPI sender,UUID agentID, UUID sessionID, UUID groupID, UUID transactionID, Dictionary<int, string> VoteID, Dictionary<int, string> VoteInitiator, Dictionary<int, string> Majority, Dictionary<int, string> Quorum, Dictionary<int, string> TerseDateID, Dictionary<int, string> StartDateTime, Dictionary<int, string> EndDateTime, Dictionary<int, string> ProposalText) | 829 | public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals) |
830 | { | 830 | { |
831 | foreach (KeyValuePair<int, string> Blank in VoteID) | 831 | int i = 0; |
832 | foreach (GroupActiveProposals Proposal in Proposals) | ||
832 | { | 833 | { |
833 | GroupActiveProposalItemReplyPacket GAPIRP = new GroupActiveProposalItemReplyPacket(); | 834 | GroupActiveProposalItemReplyPacket GAPIRP = new GroupActiveProposalItemReplyPacket(); |
834 | 835 | ||
835 | GAPIRP.AgentData.AgentID = agentID; | 836 | GAPIRP.AgentData.AgentID = AgentId; |
836 | GAPIRP.AgentData.GroupID = groupID; | 837 | GAPIRP.AgentData.GroupID = groupID; |
837 | GAPIRP.TransactionData.TransactionID = transactionID; | 838 | GAPIRP.TransactionData.TransactionID = transactionID; |
838 | GAPIRP.TransactionData.TotalNumItems = 1; | 839 | GAPIRP.TransactionData.TotalNumItems = ((uint)i+1); |
839 | GroupActiveProposalItemReplyPacket.ProposalDataBlock ProposalData = new GroupActiveProposalItemReplyPacket.ProposalDataBlock(); | 840 | GroupActiveProposalItemReplyPacket.ProposalDataBlock ProposalData = new GroupActiveProposalItemReplyPacket.ProposalDataBlock(); |
840 | GAPIRP.ProposalData = new GroupActiveProposalItemReplyPacket.ProposalDataBlock[1]; | 841 | GAPIRP.ProposalData = new GroupActiveProposalItemReplyPacket.ProposalDataBlock[1]; |
841 | ProposalData.VoteCast = Utils.StringToBytes("false"); | 842 | ProposalData.VoteCast = Utils.StringToBytes("false"); |
842 | ProposalData.VoteID = new UUID(VoteID[Blank.Key]); | 843 | ProposalData.VoteID = new UUID(Proposal.VoteID); |
843 | ProposalData.VoteInitiator = new UUID(VoteInitiator[Blank.Key]); | 844 | ProposalData.VoteInitiator = new UUID(Proposal.VoteInitiator); |
844 | ProposalData.Majority = (float)Convert.ToInt32(Majority[Blank.Key]); | 845 | ProposalData.Majority = (float)Convert.ToInt32(Proposal.Majority); |
845 | ProposalData.Quorum = Convert.ToInt32(Quorum[Blank.Key]); | 846 | ProposalData.Quorum = Convert.ToInt32(Proposal.Quorum); |
846 | ProposalData.TerseDateID = Utils.StringToBytes(TerseDateID[Blank.Key]); | 847 | ProposalData.TerseDateID = Utils.StringToBytes(Proposal.TerseDateID); |
847 | ProposalData.StartDateTime = Utils.StringToBytes(StartDateTime[Blank.Key]); | 848 | ProposalData.StartDateTime = Utils.StringToBytes(Proposal.StartDateTime); |
848 | ProposalData.EndDateTime = Utils.StringToBytes(EndDateTime[Blank.Key]); | 849 | ProposalData.EndDateTime = Utils.StringToBytes(Proposal.EndDateTime); |
849 | ProposalData.ProposalText = Utils.StringToBytes(ProposalText[Blank.Key]); | 850 | ProposalData.ProposalText = Utils.StringToBytes(Proposal.ProposalText); |
850 | ProposalData.AlreadyVoted = false; | 851 | ProposalData.AlreadyVoted = false; |
851 | GAPIRP.ProposalData[0] = ProposalData; | 852 | GAPIRP.ProposalData[i] = ProposalData; |
852 | OutPacket(GAPIRP, ThrottleOutPacketType.Task); | 853 | OutPacket(GAPIRP, ThrottleOutPacketType.Task); |
854 | i++; | ||
853 | } | 855 | } |
854 | if (VoteID.Count == 0) | 856 | if (Proposals.Length == 0) |
855 | { | 857 | { |
856 | GroupActiveProposalItemReplyPacket GAPIRP = new GroupActiveProposalItemReplyPacket(); | 858 | GroupActiveProposalItemReplyPacket GAPIRP = new GroupActiveProposalItemReplyPacket(); |
857 | 859 | ||
858 | GAPIRP.AgentData.AgentID = agentID; | 860 | GAPIRP.AgentData.AgentID = AgentId; |
859 | GAPIRP.AgentData.GroupID = groupID; | 861 | GAPIRP.AgentData.GroupID = groupID; |
860 | GAPIRP.TransactionData.TransactionID = transactionID; | 862 | GAPIRP.TransactionData.TransactionID = transactionID; |
861 | GAPIRP.TransactionData.TotalNumItems = 1; | 863 | GAPIRP.TransactionData.TotalNumItems = 1; |
@@ -875,40 +877,42 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
875 | OutPacket(GAPIRP, ThrottleOutPacketType.Task); | 877 | OutPacket(GAPIRP, ThrottleOutPacketType.Task); |
876 | } | 878 | } |
877 | } | 879 | } |
878 | 880 | ||
879 | public void SendGroupVoteHistory(IClientAPI sender,UUID agentID, UUID sessionID, UUID groupID, UUID transactionID, Dictionary<int, string> VoteID, Dictionary<int, string> VoteInitiator, Dictionary<int, string> Majority, Dictionary<int, string> Quorum, Dictionary<int, string> TerseDateID, Dictionary<int, string> StartDateTime, Dictionary<int, string> EndDateTime, Dictionary<int, string> VoteType, Dictionary<int, string> VoteResult, Dictionary<int, string> ProposalText) | 881 | public void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes) |
880 | { | 882 | { |
881 | foreach (KeyValuePair<int, string> Blank in VoteID) | 883 | int i = 0; |
884 | foreach (GroupVoteHistory Vote in Votes) | ||
882 | { | 885 | { |
883 | GroupVoteHistoryItemReplyPacket GVHIRP = new GroupVoteHistoryItemReplyPacket(); | 886 | GroupVoteHistoryItemReplyPacket GVHIRP = new GroupVoteHistoryItemReplyPacket(); |
884 | 887 | ||
885 | GVHIRP.AgentData.AgentID = agentID; | 888 | GVHIRP.AgentData.AgentID = AgentId; |
886 | GVHIRP.AgentData.GroupID = groupID; | 889 | GVHIRP.AgentData.GroupID = groupID; |
887 | GVHIRP.TransactionData.TransactionID = transactionID; | 890 | GVHIRP.TransactionData.TransactionID = transactionID; |
888 | GVHIRP.TransactionData.TotalNumItems = 1; | 891 | GVHIRP.TransactionData.TotalNumItems = ((uint)i+1); |
889 | GVHIRP.HistoryItemData.VoteID = new UUID(VoteID[Blank.Key]); | 892 | GVHIRP.HistoryItemData.VoteID = new UUID(Vote.VoteID); |
890 | GVHIRP.HistoryItemData.VoteInitiator = new UUID(VoteInitiator[Blank.Key]); | 893 | GVHIRP.HistoryItemData.VoteInitiator = new UUID(Vote.VoteInitiator); |
891 | GVHIRP.HistoryItemData.Majority = (float)Convert.ToInt32(Majority[Blank.Key]); | 894 | GVHIRP.HistoryItemData.Majority = (float)Convert.ToInt32(Vote.Majority); |
892 | GVHIRP.HistoryItemData.Quorum = Convert.ToInt32(Quorum[Blank.Key]); | 895 | GVHIRP.HistoryItemData.Quorum = Convert.ToInt32(Vote.Quorum); |
893 | GVHIRP.HistoryItemData.TerseDateID = Utils.StringToBytes(TerseDateID[Blank.Key]); | 896 | GVHIRP.HistoryItemData.TerseDateID = Utils.StringToBytes(Vote.TerseDateID); |
894 | GVHIRP.HistoryItemData.StartDateTime = Utils.StringToBytes(StartDateTime[Blank.Key]); | 897 | GVHIRP.HistoryItemData.StartDateTime = Utils.StringToBytes(Vote.StartDateTime); |
895 | GVHIRP.HistoryItemData.EndDateTime = Utils.StringToBytes(EndDateTime[Blank.Key]); | 898 | GVHIRP.HistoryItemData.EndDateTime = Utils.StringToBytes(Vote.EndDateTime); |
896 | GVHIRP.HistoryItemData.VoteType = Utils.StringToBytes(VoteType[Blank.Key]); | 899 | GVHIRP.HistoryItemData.VoteType = Utils.StringToBytes(Vote.VoteType); |
897 | GVHIRP.HistoryItemData.VoteResult = Utils.StringToBytes(VoteResult[Blank.Key]); | 900 | GVHIRP.HistoryItemData.VoteResult = Utils.StringToBytes(Vote.VoteResult); |
898 | GVHIRP.HistoryItemData.ProposalText = Utils.StringToBytes(ProposalText[Blank.Key]); | 901 | GVHIRP.HistoryItemData.ProposalText = Utils.StringToBytes(Vote.ProposalText); |
899 | GroupVoteHistoryItemReplyPacket.VoteItemBlock VoteItem = new GroupVoteHistoryItemReplyPacket.VoteItemBlock(); | 902 | GroupVoteHistoryItemReplyPacket.VoteItemBlock VoteItem = new GroupVoteHistoryItemReplyPacket.VoteItemBlock(); |
900 | GVHIRP.VoteItem = new GroupVoteHistoryItemReplyPacket.VoteItemBlock[1]; | 903 | GVHIRP.VoteItem = new GroupVoteHistoryItemReplyPacket.VoteItemBlock[1]; |
901 | VoteItem.CandidateID = UUID.Zero; | 904 | VoteItem.CandidateID = UUID.Zero; |
902 | VoteItem.NumVotes = 0; //TODO: FIX THIS!!! | 905 | VoteItem.NumVotes = 0; //TODO: FIX THIS!!! |
903 | VoteItem.VoteCast = Utils.StringToBytes("Yes"); | 906 | VoteItem.VoteCast = Utils.StringToBytes("Yes"); |
904 | GVHIRP.VoteItem[0] = VoteItem; | 907 | GVHIRP.VoteItem[i] = VoteItem; |
905 | OutPacket(GVHIRP, ThrottleOutPacketType.Task); | 908 | OutPacket(GVHIRP, ThrottleOutPacketType.Task); |
906 | } | 909 | i++; |
907 | if (VoteID.Count == 0) | 910 | } |
911 | if (Votes.Length == 0) | ||
908 | { | 912 | { |
909 | GroupVoteHistoryItemReplyPacket GVHIRP = new GroupVoteHistoryItemReplyPacket(); | 913 | GroupVoteHistoryItemReplyPacket GVHIRP = new GroupVoteHistoryItemReplyPacket(); |
910 | 914 | ||
911 | GVHIRP.AgentData.AgentID = agentID; | 915 | GVHIRP.AgentData.AgentID = AgentId; |
912 | GVHIRP.AgentData.GroupID = groupID; | 916 | GVHIRP.AgentData.GroupID = groupID; |
913 | GVHIRP.TransactionData.TransactionID = transactionID; | 917 | GVHIRP.TransactionData.TransactionID = transactionID; |
914 | GVHIRP.TransactionData.TotalNumItems = 0; | 918 | GVHIRP.TransactionData.TotalNumItems = 0; |
@@ -4876,7 +4880,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4876 | { | 4880 | { |
4877 | FreezeUserPacket FreezeUser = (FreezeUserPacket)Packet; | 4881 | FreezeUserPacket FreezeUser = (FreezeUserPacket)Packet; |
4878 | 4882 | ||
4879 | FreezeUserUpdate FreezeUserHandler = OnParcelFreezeUserEvent; | 4883 | FreezeUserUpdate FreezeUserHandler = OnParcelFreezeUser; |
4880 | if (FreezeUserHandler != null) | 4884 | if (FreezeUserHandler != null) |
4881 | { | 4885 | { |
4882 | FreezeUserHandler(this, | 4886 | FreezeUserHandler(this, |
@@ -4893,7 +4897,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4893 | EjectUserPacket EjectUser = | 4897 | EjectUserPacket EjectUser = |
4894 | (EjectUserPacket)Packet; | 4898 | (EjectUserPacket)Packet; |
4895 | 4899 | ||
4896 | EjectUserUpdate EjectUserHandler = OnParcelEjectUserEvent; | 4900 | EjectUserUpdate EjectUserHandler = OnParcelEjectUser; |
4897 | if (EjectUserHandler != null) | 4901 | if (EjectUserHandler != null) |
4898 | { | 4902 | { |
4899 | EjectUserHandler(this, | 4903 | EjectUserHandler(this, |
@@ -5292,7 +5296,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
5292 | FindAgentPacket FindAgent = | 5296 | FindAgentPacket FindAgent = |
5293 | (FindAgentPacket)Packet; | 5297 | (FindAgentPacket)Packet; |
5294 | 5298 | ||
5295 | FindAgentUpdate FindAgentHandler = OnFindAgentEvent; | 5299 | FindAgentUpdate FindAgentHandler = OnFindAgent; |
5296 | if (FindAgentHandler != null) | 5300 | if (FindAgentHandler != null) |
5297 | { | 5301 | { |
5298 | FindAgentHandler(this,FindAgent.AgentBlock.Hunter,FindAgent.AgentBlock.Prey); | 5302 | FindAgentHandler(this,FindAgent.AgentBlock.Hunter,FindAgent.AgentBlock.Prey); |
@@ -5306,7 +5310,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
5306 | TrackAgentPacket TrackAgent = | 5310 | TrackAgentPacket TrackAgent = |
5307 | (TrackAgentPacket)Packet; | 5311 | (TrackAgentPacket)Packet; |
5308 | 5312 | ||
5309 | TrackAgentUpdate TrackAgentHandler = OnTrackAgentEvent; | 5313 | TrackAgentUpdate TrackAgentHandler = OnTrackAgent; |
5310 | if (TrackAgentHandler != null) | 5314 | if (TrackAgentHandler != null) |
5311 | { | 5315 | { |
5312 | TrackAgentHandler(this, | 5316 | TrackAgentHandler(this, |
@@ -8592,7 +8596,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
8592 | GodUpdateRegionInfoPacket GodUpdateRegionInfo = | 8596 | GodUpdateRegionInfoPacket GodUpdateRegionInfo = |
8593 | (GodUpdateRegionInfoPacket)Packet; | 8597 | (GodUpdateRegionInfoPacket)Packet; |
8594 | 8598 | ||
8595 | GodUpdateRegionInfoUpdate handlerGodUpdateRegionInfo = OnGodUpdateRegionInfoUpdateEvent; | 8599 | GodUpdateRegionInfoUpdate handlerGodUpdateRegionInfo = OnGodUpdateRegionInfoUpdate; |
8596 | if (handlerGodUpdateRegionInfo != null) | 8600 | if (handlerGodUpdateRegionInfo != null) |
8597 | { | 8601 | { |
8598 | handlerGodUpdateRegionInfo(this, | 8602 | handlerGodUpdateRegionInfo(this, |
@@ -8625,7 +8629,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
8625 | GodlikeMessagePacket GodlikeMessage = | 8629 | GodlikeMessagePacket GodlikeMessage = |
8626 | (GodlikeMessagePacket)Packet; | 8630 | (GodlikeMessagePacket)Packet; |
8627 | 8631 | ||
8628 | GodlikeMessage handlerGodlikeMessage = onGodlikeMessageEvent; | 8632 | GodlikeMessage handlerGodlikeMessage = onGodlikeMessage; |
8629 | if (handlerGodlikeMessage != null) | 8633 | if (handlerGodlikeMessage != null) |
8630 | { | 8634 | { |
8631 | handlerGodlikeMessage(this, | 8635 | handlerGodlikeMessage(this, |
@@ -8641,7 +8645,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
8641 | { | 8645 | { |
8642 | StateSavePacket SaveStateMessage = | 8646 | StateSavePacket SaveStateMessage = |
8643 | (StateSavePacket)Packet; | 8647 | (StateSavePacket)Packet; |
8644 | SaveStateHandler handlerSaveStatePacket = OnSaveStateEvent; | 8648 | SaveStateHandler handlerSaveStatePacket = OnSaveState; |
8645 | if (handlerSaveStatePacket != null) | 8649 | if (handlerSaveStatePacket != null) |
8646 | { | 8650 | { |
8647 | handlerSaveStatePacket(this,SaveStateMessage.AgentData.AgentID); | 8651 | handlerSaveStatePacket(this,SaveStateMessage.AgentData.AgentID); |
@@ -9005,7 +9009,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
9005 | { | 9009 | { |
9006 | UpdateMuteListEntryPacket UpdateMuteListEntry = | 9010 | UpdateMuteListEntryPacket UpdateMuteListEntry = |
9007 | (UpdateMuteListEntryPacket)Packet; | 9011 | (UpdateMuteListEntryPacket)Packet; |
9008 | MuteListEntryUpdate handlerUpdateMuteListEntry = OnUpdateMuteListEntryEvent; | 9012 | MuteListEntryUpdate handlerUpdateMuteListEntry = OnUpdateMuteListEntry; |
9009 | if (handlerUpdateMuteListEntry != null) | 9013 | if (handlerUpdateMuteListEntry != null) |
9010 | { | 9014 | { |
9011 | handlerUpdateMuteListEntry(this, UpdateMuteListEntry.MuteData.MuteID, | 9015 | handlerUpdateMuteListEntry(this, UpdateMuteListEntry.MuteData.MuteID, |
@@ -9021,7 +9025,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
9021 | { | 9025 | { |
9022 | RemoveMuteListEntryPacket RemoveMuteListEntry = | 9026 | RemoveMuteListEntryPacket RemoveMuteListEntry = |
9023 | (RemoveMuteListEntryPacket)Packet; | 9027 | (RemoveMuteListEntryPacket)Packet; |
9024 | MuteListEntryRemove handlerRemoveMuteListEntry = OnRemoveMuteListEntryEvent; | 9028 | MuteListEntryRemove handlerRemoveMuteListEntry = OnRemoveMuteListEntry; |
9025 | if (handlerRemoveMuteListEntry != null) | 9029 | if (handlerRemoveMuteListEntry != null) |
9026 | { | 9030 | { |
9027 | handlerRemoveMuteListEntry(this, | 9031 | handlerRemoveMuteListEntry(this, |
@@ -9038,7 +9042,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
9038 | UserReportPacket UserReport = | 9042 | UserReportPacket UserReport = |
9039 | (UserReportPacket)Packet; | 9043 | (UserReportPacket)Packet; |
9040 | 9044 | ||
9041 | NewUserReport handlerUserReport = OnUserReportEvent; | 9045 | NewUserReport handlerUserReport = OnUserReport; |
9042 | if (handlerUserReport != null) | 9046 | if (handlerUserReport != null) |
9043 | { | 9047 | { |
9044 | handlerUserReport(this, | 9048 | handlerUserReport(this, |
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index a4a649c..086d4fe 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | |||
@@ -397,8 +397,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
397 | client.OnLogout += OnLogout; | 397 | client.OnLogout += OnLogout; |
398 | 398 | ||
399 | client.OnGrantUserRights += GrantUserFriendRights; | 399 | client.OnGrantUserRights += GrantUserFriendRights; |
400 | client.OnTrackAgentEvent += FindAgent; | 400 | client.OnTrackAgent += FindAgent; |
401 | client.OnFindAgentEvent += FindAgent; | 401 | client.OnFindAgent += FindAgent; |
402 | 402 | ||
403 | } | 403 | } |
404 | 404 | ||
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs index 7f9e5af..257c221 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs | |||
@@ -47,6 +47,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
47 | private bool enabled = true; | 47 | private bool enabled = true; |
48 | private List<Scene> m_SceneList = new List<Scene>(); | 48 | private List<Scene> m_SceneList = new List<Scene>(); |
49 | private string m_RestURL = String.Empty; | 49 | private string m_RestURL = String.Empty; |
50 | private bool m_ForwardOfflineGroupMessages = true; | ||
50 | 51 | ||
51 | public void Initialise(Scene scene, IConfigSource config) | 52 | public void Initialise(Scene scene, IConfigSource config) |
52 | { | 53 | { |
@@ -67,6 +68,9 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
67 | return; | 68 | return; |
68 | } | 69 | } |
69 | 70 | ||
71 | if (cnf != null) | ||
72 | m_ForwardOfflineGroupMessages = cnf.GetBoolean("ForwardOfflineGroupMessages", m_ForwardOfflineGroupMessages); | ||
73 | |||
70 | lock (m_SceneList) | 74 | lock (m_SceneList) |
71 | { | 75 | { |
72 | if (m_SceneList.Count == 0) | 76 | if (m_SceneList.Count == 0) |
@@ -185,7 +189,8 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
185 | 189 | ||
186 | private void UndeliveredMessage(GridInstantMessage im) | 190 | private void UndeliveredMessage(GridInstantMessage im) |
187 | { | 191 | { |
188 | if (im.offline != 0) | 192 | if ((im.offline != 0) |
193 | && (!im.fromGroup || (im.fromGroup && m_ForwardOfflineGroupMessages))) | ||
189 | { | 194 | { |
190 | bool success = SynchronousRestObjectPoster.BeginPostObject<GridInstantMessage, bool>( | 195 | bool success = SynchronousRestObjectPoster.BeginPostObject<GridInstantMessage, bool>( |
191 | "POST", m_RestURL+"/SaveMessage/", im); | 196 | "POST", m_RestURL+"/SaveMessage/", im); |
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs index 4cdc33d..3659711 100644 --- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs | |||
@@ -274,25 +274,25 @@ namespace OpenSim.Region.Examples.SimpleModule | |||
274 | 274 | ||
275 | public event PlacesQuery OnPlacesQuery; | 275 | public event PlacesQuery OnPlacesQuery; |
276 | 276 | ||
277 | public event FindAgentUpdate OnFindAgentEvent; | 277 | public event FindAgentUpdate OnFindAgent; |
278 | public event TrackAgentUpdate OnTrackAgentEvent; | 278 | public event TrackAgentUpdate OnTrackAgent; |
279 | public event NewUserReport OnUserReportEvent; | 279 | public event NewUserReport OnUserReport; |
280 | public event SaveStateHandler OnSaveStateEvent; | 280 | public event SaveStateHandler OnSaveState; |
281 | public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; | 281 | public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; |
282 | public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; | 282 | public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; |
283 | public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; | 283 | public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; |
284 | public event FreezeUserUpdate OnParcelFreezeUserEvent; | 284 | public event FreezeUserUpdate OnParcelFreezeUser; |
285 | public event EjectUserUpdate OnParcelEjectUserEvent; | 285 | public event EjectUserUpdate OnParcelEjectUser; |
286 | public event ParcelBuyPass OnParcelBuyPass; | 286 | public event ParcelBuyPass OnParcelBuyPass; |
287 | public event ParcelGodMark OnParcelGodMark; | 287 | public event ParcelGodMark OnParcelGodMark; |
288 | public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; | 288 | public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; |
289 | public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; | 289 | public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; |
290 | public event SimWideDeletesDelegate OnSimWideDeletes; | 290 | public event SimWideDeletesDelegate OnSimWideDeletes; |
291 | public event SendPostcard OnSendPostcard; | 291 | public event SendPostcard OnSendPostcard; |
292 | public event MuteListEntryUpdate OnUpdateMuteListEntryEvent; | 292 | public event MuteListEntryUpdate OnUpdateMuteListEntry; |
293 | public event MuteListEntryRemove OnRemoveMuteListEntryEvent; | 293 | public event MuteListEntryRemove OnRemoveMuteListEntry; |
294 | public event GodlikeMessage onGodlikeMessageEvent; | 294 | public event GodlikeMessage onGodlikeMessage; |
295 | public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent; | 295 | public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate; |
296 | 296 | ||
297 | #pragma warning restore 67 | 297 | #pragma warning restore 67 |
298 | 298 | ||
@@ -1133,7 +1133,15 @@ namespace OpenSim.Region.Examples.SimpleModule | |||
1133 | } | 1133 | } |
1134 | 1134 | ||
1135 | public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) | 1135 | public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) |
1136 | { | 1136 | { |
1137 | } | ||
1138 | |||
1139 | public void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes) | ||
1140 | { | ||
1141 | } | ||
1142 | |||
1143 | public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals) | ||
1144 | { | ||
1137 | } | 1145 | } |
1138 | } | 1146 | } |
1139 | } | 1147 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index a14e3ad..e5fc027 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -139,7 +139,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
139 | public uint TimeStampTerse; | 139 | public uint TimeStampTerse; |
140 | 140 | ||
141 | [XmlIgnore] | 141 | [XmlIgnore] |
142 | public UUID FromItemID; | 142 | public UUID FromItemID; |
143 | |||
144 | [XmlIgnore] | ||
145 | public int STATUS_ROTATE_X; | ||
146 | |||
147 | [XmlIgnore] | ||
148 | public int STATUS_ROTATE_Y; | ||
149 | |||
150 | [XmlIgnore] | ||
151 | public int STATUS_ROTATE_Z; | ||
143 | 152 | ||
144 | [XmlIgnore] | 153 | [XmlIgnore] |
145 | private Dictionary<int, string> m_CollisionFilter = new Dictionary<int, string>(); | 154 | private Dictionary<int, string> m_CollisionFilter = new Dictionary<int, string>(); |
@@ -1675,6 +1684,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
1675 | return false; | 1684 | return false; |
1676 | 1685 | ||
1677 | return m_parentGroup.RootPart.DIE_AT_EDGE; | 1686 | return m_parentGroup.RootPart.DIE_AT_EDGE; |
1687 | } | ||
1688 | |||
1689 | public int GetAxisRotation(int axis) | ||
1690 | { | ||
1691 | //Cannot use ScriptBaseClass constants as no referance to it currently. | ||
1692 | if (axis == 2)//STATUS_ROTATE_X | ||
1693 | return STATUS_ROTATE_X; | ||
1694 | if (axis == 4)//STATUS_ROTATE_Y | ||
1695 | return STATUS_ROTATE_Y; | ||
1696 | if (axis == 8)//STATUS_ROTATE_Z | ||
1697 | return STATUS_ROTATE_Z; | ||
1698 | |||
1699 | return 0; | ||
1678 | } | 1700 | } |
1679 | 1701 | ||
1680 | public double GetDistanceTo(Vector3 a, Vector3 b) | 1702 | public double GetDistanceTo(Vector3 a, Vector3 b) |
@@ -1923,24 +1945,24 @@ namespace OpenSim.Region.Framework.Scenes | |||
1923 | else | 1945 | else |
1924 | { | 1946 | { |
1925 | } | 1947 | } |
1926 | } | 1948 | } |
1927 | else | 1949 | else |
1928 | { | 1950 | { |
1929 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 1951 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); |
1930 | //If it is 1, it is to accept ONLY collisions from this object, so this other object will not work | 1952 | //If it is 1, it is to accept ONLY collisions from this object, so this other object will not work |
1931 | if (found) | 1953 | if (found) |
1932 | { | 1954 | { |
1933 | DetectedObject detobj = new DetectedObject(); | 1955 | DetectedObject detobj = new DetectedObject(); |
1934 | detobj.keyUUID = obj.UUID; | 1956 | detobj.keyUUID = obj.UUID; |
1935 | detobj.nameStr = obj.Name; | 1957 | detobj.nameStr = obj.Name; |
1936 | detobj.ownerUUID = obj._ownerID; | 1958 | detobj.ownerUUID = obj._ownerID; |
1937 | detobj.posVector = obj.AbsolutePosition; | 1959 | detobj.posVector = obj.AbsolutePosition; |
1938 | detobj.rotQuat = obj.GetWorldRotation(); | 1960 | detobj.rotQuat = obj.GetWorldRotation(); |
1939 | detobj.velVector = obj.Velocity; | 1961 | detobj.velVector = obj.Velocity; |
1940 | detobj.colliderType = 0; | 1962 | detobj.colliderType = 0; |
1941 | detobj.groupUUID = obj._groupID; | 1963 | detobj.groupUUID = obj._groupID; |
1942 | colliding.Add(detobj); | 1964 | colliding.Add(detobj); |
1943 | } | 1965 | } |
1944 | } | 1966 | } |
1945 | } | 1967 | } |
1946 | else | 1968 | else |
@@ -1952,8 +1974,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1952 | ScenePresence av = avlist[i]; | 1974 | ScenePresence av = avlist[i]; |
1953 | 1975 | ||
1954 | if (av.LocalId == localId) | 1976 | if (av.LocalId == localId) |
1955 | { | 1977 | { |
1956 | if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) | 1978 | if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.Name)) |
1957 | { | 1979 | { |
1958 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 1980 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); |
1959 | //If it is 1, it is to accept ONLY collisions from this avatar | 1981 | //If it is 1, it is to accept ONLY collisions from this avatar |
@@ -1974,24 +1996,24 @@ namespace OpenSim.Region.Framework.Scenes | |||
1974 | else | 1996 | else |
1975 | { | 1997 | { |
1976 | } | 1998 | } |
1977 | } | 1999 | } |
1978 | else | 2000 | else |
1979 | { | 2001 | { |
1980 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 2002 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); |
1981 | //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work | 2003 | //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work |
1982 | if (found) | 2004 | if (!found) |
1983 | { | 2005 | { |
1984 | DetectedObject detobj = new DetectedObject(); | 2006 | DetectedObject detobj = new DetectedObject(); |
1985 | detobj.keyUUID = av.UUID; | 2007 | detobj.keyUUID = av.UUID; |
1986 | detobj.nameStr = av.ControllingClient.Name; | 2008 | detobj.nameStr = av.ControllingClient.Name; |
1987 | detobj.ownerUUID = av.UUID; | 2009 | detobj.ownerUUID = av.UUID; |
1988 | detobj.posVector = av.AbsolutePosition; | 2010 | detobj.posVector = av.AbsolutePosition; |
1989 | detobj.rotQuat = av.Rotation; | 2011 | detobj.rotQuat = av.Rotation; |
1990 | detobj.velVector = av.Velocity; | 2012 | detobj.velVector = av.Velocity; |
1991 | detobj.colliderType = 0; | 2013 | detobj.colliderType = 0; |
1992 | detobj.groupUUID = av.ControllingClient.ActiveGroupId; | 2014 | detobj.groupUUID = av.ControllingClient.ActiveGroupId; |
1993 | colliding.Add(detobj); | 2015 | colliding.Add(detobj); |
1994 | } | 2016 | } |
1995 | } | 2017 | } |
1996 | 2018 | ||
1997 | } | 2019 | } |
@@ -2088,8 +2110,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2088 | ScenePresence av = avlist[i]; | 2110 | ScenePresence av = avlist[i]; |
2089 | 2111 | ||
2090 | if (av.LocalId == localId) | 2112 | if (av.LocalId == localId) |
2091 | { | 2113 | { |
2092 | if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) | 2114 | if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.Name)) |
2093 | { | 2115 | { |
2094 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 2116 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); |
2095 | //If it is 1, it is to accept ONLY collisions from this avatar | 2117 | //If it is 1, it is to accept ONLY collisions from this avatar |
@@ -2115,7 +2137,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2115 | { | 2137 | { |
2116 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 2138 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); |
2117 | //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work | 2139 | //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work |
2118 | if (found) | 2140 | if (!found) |
2119 | { | 2141 | { |
2120 | DetectedObject detobj = new DetectedObject(); | 2142 | DetectedObject detobj = new DetectedObject(); |
2121 | detobj.keyUUID = av.UUID; | 2143 | detobj.keyUUID = av.UUID; |
@@ -2219,8 +2241,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2219 | ScenePresence av = avlist[i]; | 2241 | ScenePresence av = avlist[i]; |
2220 | 2242 | ||
2221 | if (av.LocalId == localId) | 2243 | if (av.LocalId == localId) |
2222 | { | 2244 | { |
2223 | if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) | 2245 | if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.Name)) |
2224 | { | 2246 | { |
2225 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 2247 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); |
2226 | //If it is 1, it is to accept ONLY collisions from this avatar | 2248 | //If it is 1, it is to accept ONLY collisions from this avatar |
@@ -2246,7 +2268,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2246 | { | 2268 | { |
2247 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 2269 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); |
2248 | //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work | 2270 | //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work |
2249 | if (found) | 2271 | if (!found) |
2250 | { | 2272 | { |
2251 | DetectedObject detobj = new DetectedObject(); | 2273 | DetectedObject detobj = new DetectedObject(); |
2252 | detobj.keyUUID = av.UUID; | 2274 | detobj.keyUUID = av.UUID; |
@@ -2279,7 +2301,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2279 | m_parentGroup.Scene.EventManager.TriggerScriptCollidingEnd(LocalId, EndCollidingMessage); | 2301 | m_parentGroup.Scene.EventManager.TriggerScriptCollidingEnd(LocalId, EndCollidingMessage); |
2280 | } | 2302 | } |
2281 | } | 2303 | } |
2282 | } | 2304 | } |
2283 | } | 2305 | } |
2284 | 2306 | ||
2285 | public void PhysicsOutOfBounds(Vector3 pos) | 2307 | public void PhysicsOutOfBounds(Vector3 pos) |
@@ -2747,7 +2769,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
2747 | if (m_parentGroup != null) | 2769 | if (m_parentGroup != null) |
2748 | { | 2770 | { |
2749 | m_parentGroup.SetAxisRotation(axis, rotate); | 2771 | m_parentGroup.SetAxisRotation(axis, rotate); |
2750 | } | 2772 | } |
2773 | //Cannot use ScriptBaseClass constants as no referance to it currently. | ||
2774 | if (axis == 2)//STATUS_ROTATE_X | ||
2775 | STATUS_ROTATE_X = rotate; | ||
2776 | if (axis == 4)//STATUS_ROTATE_Y | ||
2777 | STATUS_ROTATE_Y = rotate; | ||
2778 | if (axis == 8)//STATUS_ROTATE_Z | ||
2779 | STATUS_ROTATE_Z = rotate; | ||
2751 | } | 2780 | } |
2752 | 2781 | ||
2753 | public void SetBuoyancy(float fvalue) | 2782 | public void SetBuoyancy(float fvalue) |
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs index 7907570..671cfef 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs | |||
@@ -836,25 +836,25 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
836 | public event MuteListRequest OnMuteListRequest; | 836 | public event MuteListRequest OnMuteListRequest; |
837 | public event AvatarInterestUpdate OnAvatarInterestUpdate; | 837 | public event AvatarInterestUpdate OnAvatarInterestUpdate; |
838 | public event PlacesQuery OnPlacesQuery; | 838 | public event PlacesQuery OnPlacesQuery; |
839 | public event FindAgentUpdate OnFindAgentEvent; | 839 | public event FindAgentUpdate OnFindAgent; |
840 | public event TrackAgentUpdate OnTrackAgentEvent; | 840 | public event TrackAgentUpdate OnTrackAgent; |
841 | public event NewUserReport OnUserReportEvent; | 841 | public event NewUserReport OnUserReport; |
842 | public event SaveStateHandler OnSaveStateEvent; | 842 | public event SaveStateHandler OnSaveState; |
843 | public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; | 843 | public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; |
844 | public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; | 844 | public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; |
845 | public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; | 845 | public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; |
846 | public event FreezeUserUpdate OnParcelFreezeUserEvent; | 846 | public event FreezeUserUpdate OnParcelFreezeUser; |
847 | public event EjectUserUpdate OnParcelEjectUserEvent; | 847 | public event EjectUserUpdate OnParcelEjectUser; |
848 | public event ParcelBuyPass OnParcelBuyPass; | 848 | public event ParcelBuyPass OnParcelBuyPass; |
849 | public event ParcelGodMark OnParcelGodMark; | 849 | public event ParcelGodMark OnParcelGodMark; |
850 | public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; | 850 | public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; |
851 | public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; | 851 | public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; |
852 | public event SimWideDeletesDelegate OnSimWideDeletes; | 852 | public event SimWideDeletesDelegate OnSimWideDeletes; |
853 | public event SendPostcard OnSendPostcard; | 853 | public event SendPostcard OnSendPostcard; |
854 | public event MuteListEntryUpdate OnUpdateMuteListEntryEvent; | 854 | public event MuteListEntryUpdate OnUpdateMuteListEntry; |
855 | public event MuteListEntryRemove OnRemoveMuteListEntryEvent; | 855 | public event MuteListEntryRemove OnRemoveMuteListEntry; |
856 | public event GodlikeMessage onGodlikeMessageEvent; | 856 | public event GodlikeMessage onGodlikeMessage; |
857 | public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent; | 857 | public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate; |
858 | 858 | ||
859 | #pragma warning restore 67 | 859 | #pragma warning restore 67 |
860 | 860 | ||
@@ -1657,7 +1657,15 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
1657 | } | 1657 | } |
1658 | 1658 | ||
1659 | public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) | 1659 | public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) |
1660 | { | 1660 | { |
1661 | } | ||
1662 | |||
1663 | public void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes) | ||
1664 | { | ||
1665 | } | ||
1666 | |||
1667 | public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals) | ||
1668 | { | ||
1661 | } | 1669 | } |
1662 | } | 1670 | } |
1663 | } | 1671 | } |
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index c862821..1639b7e 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs | |||
@@ -380,25 +380,25 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
380 | 380 | ||
381 | public event PlacesQuery OnPlacesQuery; | 381 | public event PlacesQuery OnPlacesQuery; |
382 | 382 | ||
383 | public event FindAgentUpdate OnFindAgentEvent; | 383 | public event FindAgentUpdate OnFindAgent; |
384 | public event TrackAgentUpdate OnTrackAgentEvent; | 384 | public event TrackAgentUpdate OnTrackAgent; |
385 | public event NewUserReport OnUserReportEvent; | 385 | public event NewUserReport OnUserReport; |
386 | public event SaveStateHandler OnSaveStateEvent; | 386 | public event SaveStateHandler OnSaveState; |
387 | public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; | 387 | public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; |
388 | public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; | 388 | public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; |
389 | public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; | 389 | public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; |
390 | public event FreezeUserUpdate OnParcelFreezeUserEvent; | 390 | public event FreezeUserUpdate OnParcelFreezeUser; |
391 | public event EjectUserUpdate OnParcelEjectUserEvent; | 391 | public event EjectUserUpdate OnParcelEjectUser; |
392 | public event ParcelBuyPass OnParcelBuyPass; | 392 | public event ParcelBuyPass OnParcelBuyPass; |
393 | public event ParcelGodMark OnParcelGodMark; | 393 | public event ParcelGodMark OnParcelGodMark; |
394 | public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; | 394 | public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; |
395 | public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; | 395 | public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; |
396 | public event SimWideDeletesDelegate OnSimWideDeletes; | 396 | public event SimWideDeletesDelegate OnSimWideDeletes; |
397 | public event SendPostcard OnSendPostcard; | 397 | public event SendPostcard OnSendPostcard; |
398 | public event MuteListEntryUpdate OnUpdateMuteListEntryEvent; | 398 | public event MuteListEntryUpdate OnUpdateMuteListEntry; |
399 | public event MuteListEntryRemove OnRemoveMuteListEntryEvent; | 399 | public event MuteListEntryRemove OnRemoveMuteListEntry; |
400 | public event GodlikeMessage onGodlikeMessageEvent; | 400 | public event GodlikeMessage onGodlikeMessage; |
401 | public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent; | 401 | public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate; |
402 | 402 | ||
403 | #pragma warning restore 67 | 403 | #pragma warning restore 67 |
404 | 404 | ||
@@ -1138,7 +1138,15 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
1138 | } | 1138 | } |
1139 | 1139 | ||
1140 | public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) | 1140 | public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) |
1141 | { | 1141 | { |
1142 | } | ||
1143 | |||
1144 | public void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes) | ||
1145 | { | ||
1146 | } | ||
1147 | |||
1148 | public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals) | ||
1149 | { | ||
1142 | } | 1150 | } |
1143 | } | 1151 | } |
1144 | } | 1152 | } |
diff --git a/OpenSim/Server/Base/ServerUtils.cs b/OpenSim/Server/Base/ServerUtils.cs index 0964caa..a5d28a4 100644 --- a/OpenSim/Server/Base/ServerUtils.cs +++ b/OpenSim/Server/Base/ServerUtils.cs | |||
@@ -160,9 +160,9 @@ namespace OpenSim.Server.Base | |||
160 | } | 160 | } |
161 | } | 161 | } |
162 | 162 | ||
163 | public static Dictionary<string, string> ParseQueryString(string query) | 163 | public static Dictionary<string, object> ParseQueryString(string query) |
164 | { | 164 | { |
165 | Dictionary<string, string> result = new Dictionary<string, string>(); | 165 | Dictionary<string, object> result = new Dictionary<string, object>(); |
166 | string[] terms = query.Split(new char[] {'&'}); | 166 | string[] terms = query.Split(new char[] {'&'}); |
167 | 167 | ||
168 | if (terms.Length == 0) | 168 | if (terms.Length == 0) |
@@ -180,33 +180,76 @@ namespace OpenSim.Server.Base | |||
180 | if (elems.Length > 1) | 180 | if (elems.Length > 1) |
181 | value = System.Web.HttpUtility.UrlDecode(elems[1]); | 181 | value = System.Web.HttpUtility.UrlDecode(elems[1]); |
182 | 182 | ||
183 | result[name] = value; | 183 | if (name.EndsWith("[]")) |
184 | { | ||
185 | if (result.ContainsKey(name)) | ||
186 | { | ||
187 | if (!(result[name] is List<string>)) | ||
188 | continue; | ||
189 | |||
190 | List<string> l = (List<string>)result[name]; | ||
191 | |||
192 | l.Add(value); | ||
193 | } | ||
194 | else | ||
195 | { | ||
196 | List<string> newList = new List<string>(); | ||
197 | |||
198 | newList.Add(value); | ||
199 | |||
200 | result[name] = newList; | ||
201 | } | ||
202 | } | ||
203 | else | ||
204 | { | ||
205 | if (!result.ContainsKey(name)) | ||
206 | result[name] = value; | ||
207 | } | ||
184 | } | 208 | } |
185 | 209 | ||
186 | return result; | 210 | return result; |
187 | } | 211 | } |
188 | 212 | ||
189 | public static string BuildQueryString(Dictionary<string, string> data) | 213 | public static string BuildQueryString(Dictionary<string, object> data) |
190 | { | 214 | { |
191 | string qstring = String.Empty; | 215 | string qstring = String.Empty; |
192 | 216 | ||
193 | foreach (KeyValuePair<string, string> kvp in data) | 217 | string part; |
218 | |||
219 | foreach (KeyValuePair<string, object> kvp in data) | ||
194 | { | 220 | { |
195 | string part; | 221 | if (kvp.Value is List<string>) |
196 | if (kvp.Value != String.Empty) | ||
197 | { | 222 | { |
198 | part = System.Web.HttpUtility.UrlEncode(kvp.Key) + | 223 | List<string> l = (List<String>)kvp.Value; |
199 | "=" + System.Web.HttpUtility.UrlEncode(kvp.Value); | 224 | |
225 | foreach (string s in l) | ||
226 | { | ||
227 | part = System.Web.HttpUtility.UrlEncode(kvp.Key) + | ||
228 | "[]=" + System.Web.HttpUtility.UrlEncode(s); | ||
229 | |||
230 | if (qstring != String.Empty) | ||
231 | qstring += "&"; | ||
232 | |||
233 | qstring += part; | ||
234 | } | ||
200 | } | 235 | } |
201 | else | 236 | else |
202 | { | 237 | { |
203 | part = System.Web.HttpUtility.UrlEncode(kvp.Key); | 238 | if (kvp.Value.ToString() != String.Empty) |
204 | } | 239 | { |
240 | part = System.Web.HttpUtility.UrlEncode(kvp.Key) + | ||
241 | "=" + System.Web.HttpUtility.UrlEncode(kvp.Value.ToString()); | ||
242 | } | ||
243 | else | ||
244 | { | ||
245 | part = System.Web.HttpUtility.UrlEncode(kvp.Key); | ||
246 | } | ||
205 | 247 | ||
206 | if (qstring != String.Empty) | 248 | if (qstring != String.Empty) |
207 | qstring += "&"; | 249 | qstring += "&"; |
208 | 250 | ||
209 | qstring += part; | 251 | qstring += part; |
252 | } | ||
210 | } | 253 | } |
211 | 254 | ||
212 | return qstring; | 255 | return qstring; |
diff --git a/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs b/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs index 490a13a..47bc860 100644 --- a/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs | |||
@@ -86,14 +86,14 @@ namespace OpenSim.Server.Handlers.Authentication | |||
86 | 86 | ||
87 | private byte[] DoPlainMethods(string body) | 87 | private byte[] DoPlainMethods(string body) |
88 | { | 88 | { |
89 | Dictionary<string, string> request = | 89 | Dictionary<string, object> request = |
90 | ServerUtils.ParseQueryString(body); | 90 | ServerUtils.ParseQueryString(body); |
91 | 91 | ||
92 | int lifetime = 30; | 92 | int lifetime = 30; |
93 | 93 | ||
94 | if (request.ContainsKey("LIFETIME")) | 94 | if (request.ContainsKey("LIFETIME")) |
95 | { | 95 | { |
96 | lifetime = Convert.ToInt32(request["LIFETIME"]); | 96 | lifetime = Convert.ToInt32(request["LIFETIME"].ToString()); |
97 | if (lifetime > 30) | 97 | if (lifetime > 30) |
98 | lifetime = 30; | 98 | lifetime = 30; |
99 | } | 99 | } |
@@ -103,12 +103,12 @@ namespace OpenSim.Server.Handlers.Authentication | |||
103 | if (!request.ContainsKey("PRINCIPAL")) | 103 | if (!request.ContainsKey("PRINCIPAL")) |
104 | return FailureResult(); | 104 | return FailureResult(); |
105 | 105 | ||
106 | string method = request["METHOD"]; | 106 | string method = request["METHOD"].ToString(); |
107 | 107 | ||
108 | UUID principalID; | 108 | UUID principalID; |
109 | string token; | 109 | string token; |
110 | 110 | ||
111 | if (!UUID.TryParse(request["PRINCIPAL"], out principalID)) | 111 | if (!UUID.TryParse(request["PRINCIPAL"].ToString(), out principalID)) |
112 | return FailureResult(); | 112 | return FailureResult(); |
113 | 113 | ||
114 | switch (method) | 114 | switch (method) |
@@ -117,7 +117,7 @@ namespace OpenSim.Server.Handlers.Authentication | |||
117 | if (!request.ContainsKey("PASSWORD")) | 117 | if (!request.ContainsKey("PASSWORD")) |
118 | return FailureResult(); | 118 | return FailureResult(); |
119 | 119 | ||
120 | token = m_AuthenticationService.Authenticate(principalID, request["PASSWORD"], lifetime); | 120 | token = m_AuthenticationService.Authenticate(principalID, request["PASSWORD"].ToString(), lifetime); |
121 | 121 | ||
122 | if (token != String.Empty) | 122 | if (token != String.Empty) |
123 | return SuccessResult(token); | 123 | return SuccessResult(token); |
@@ -126,7 +126,7 @@ namespace OpenSim.Server.Handlers.Authentication | |||
126 | if (!request.ContainsKey("TOKEN")) | 126 | if (!request.ContainsKey("TOKEN")) |
127 | return FailureResult(); | 127 | return FailureResult(); |
128 | 128 | ||
129 | if (m_AuthenticationService.Verify(principalID, request["TOKEN"], lifetime)) | 129 | if (m_AuthenticationService.Verify(principalID, request["TOKEN"].ToString(), lifetime)) |
130 | return SuccessResult(); | 130 | return SuccessResult(); |
131 | 131 | ||
132 | return FailureResult(); | 132 | return FailureResult(); |
@@ -134,7 +134,7 @@ namespace OpenSim.Server.Handlers.Authentication | |||
134 | if (!request.ContainsKey("TOKEN")) | 134 | if (!request.ContainsKey("TOKEN")) |
135 | return FailureResult(); | 135 | return FailureResult(); |
136 | 136 | ||
137 | if (m_AuthenticationService.Release(principalID, request["TOKEN"])) | 137 | if (m_AuthenticationService.Release(principalID, request["TOKEN"].ToString())) |
138 | return SuccessResult(); | 138 | return SuccessResult(); |
139 | 139 | ||
140 | return FailureResult(); | 140 | return FailureResult(); |
diff --git a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs index 433ed0b..d99b791 100644 --- a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs | |||
@@ -69,13 +69,13 @@ namespace OpenSim.Server.Handlers.Grid | |||
69 | 69 | ||
70 | try | 70 | try |
71 | { | 71 | { |
72 | Dictionary<string, string> request = | 72 | Dictionary<string, object> request = |
73 | ServerUtils.ParseQueryString(body); | 73 | ServerUtils.ParseQueryString(body); |
74 | 74 | ||
75 | if (!request.ContainsKey("METHOD")) | 75 | if (!request.ContainsKey("METHOD")) |
76 | return FailureResult(); | 76 | return FailureResult(); |
77 | 77 | ||
78 | string method = request["METHOD"]; | 78 | string method = request["METHOD"].ToString(); |
79 | 79 | ||
80 | switch (method) | 80 | switch (method) |
81 | { | 81 | { |
@@ -117,22 +117,22 @@ namespace OpenSim.Server.Handlers.Grid | |||
117 | 117 | ||
118 | #region Method-specific handlers | 118 | #region Method-specific handlers |
119 | 119 | ||
120 | byte[] Register(Dictionary<string, string> request) | 120 | byte[] Register(Dictionary<string, object> request) |
121 | { | 121 | { |
122 | UUID scopeID = UUID.Zero; | 122 | UUID scopeID = UUID.Zero; |
123 | if (request.ContainsKey("SCOPEID")) | 123 | if (request.ContainsKey("SCOPEID")) |
124 | UUID.TryParse(request["SCOPEID"], out scopeID); | 124 | UUID.TryParse(request["SCOPEID"].ToString(), out scopeID); |
125 | else | 125 | else |
126 | m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to register region"); | 126 | m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to register region"); |
127 | 127 | ||
128 | int versionNumberMin = 0, versionNumberMax = 0; | 128 | int versionNumberMin = 0, versionNumberMax = 0; |
129 | if (request.ContainsKey("VERSIONMIN")) | 129 | if (request.ContainsKey("VERSIONMIN")) |
130 | Int32.TryParse(request["VERSIONMIN"], out versionNumberMin); | 130 | Int32.TryParse(request["VERSIONMIN"].ToString(), out versionNumberMin); |
131 | else | 131 | else |
132 | m_log.WarnFormat("[GRID HANDLER]: no minimum protocol version in request to register region"); | 132 | m_log.WarnFormat("[GRID HANDLER]: no minimum protocol version in request to register region"); |
133 | 133 | ||
134 | if (request.ContainsKey("VERSIONMAX")) | 134 | if (request.ContainsKey("VERSIONMAX")) |
135 | Int32.TryParse(request["VERSIONMAX"], out versionNumberMax); | 135 | Int32.TryParse(request["VERSIONMAX"].ToString(), out versionNumberMax); |
136 | else | 136 | else |
137 | m_log.WarnFormat("[GRID HANDLER]: no maximum protocol version in request to register region"); | 137 | m_log.WarnFormat("[GRID HANDLER]: no maximum protocol version in request to register region"); |
138 | 138 | ||
@@ -147,8 +147,8 @@ namespace OpenSim.Server.Handlers.Grid | |||
147 | GridRegion rinfo = null; | 147 | GridRegion rinfo = null; |
148 | try | 148 | try |
149 | { | 149 | { |
150 | foreach (KeyValuePair<string, string> kvp in request) | 150 | foreach (KeyValuePair<string, object> kvp in request) |
151 | rinfoData[kvp.Key] = kvp.Value; | 151 | rinfoData[kvp.Key] = kvp.Value.ToString(); |
152 | rinfo = new GridRegion(rinfoData); | 152 | rinfo = new GridRegion(rinfoData); |
153 | } | 153 | } |
154 | catch (Exception e) | 154 | catch (Exception e) |
@@ -166,11 +166,11 @@ namespace OpenSim.Server.Handlers.Grid | |||
166 | return FailureResult(); | 166 | return FailureResult(); |
167 | } | 167 | } |
168 | 168 | ||
169 | byte[] Deregister(Dictionary<string, string> request) | 169 | byte[] Deregister(Dictionary<string, object> request) |
170 | { | 170 | { |
171 | UUID regionID = UUID.Zero; | 171 | UUID regionID = UUID.Zero; |
172 | if (request["REGIONID"] != null) | 172 | if (request.ContainsKey("REGIONID")) |
173 | UUID.TryParse(request["REGIONID"], out regionID); | 173 | UUID.TryParse(request["REGIONID"].ToString(), out regionID); |
174 | else | 174 | else |
175 | m_log.WarnFormat("[GRID HANDLER]: no regionID in request to deregister region"); | 175 | m_log.WarnFormat("[GRID HANDLER]: no regionID in request to deregister region"); |
176 | 176 | ||
@@ -183,17 +183,17 @@ namespace OpenSim.Server.Handlers.Grid | |||
183 | 183 | ||
184 | } | 184 | } |
185 | 185 | ||
186 | byte[] GetNeighbours(Dictionary<string, string> request) | 186 | byte[] GetNeighbours(Dictionary<string, object> request) |
187 | { | 187 | { |
188 | UUID scopeID = UUID.Zero; | 188 | UUID scopeID = UUID.Zero; |
189 | if (request["SCOPEID"] != null) | 189 | if (request.ContainsKey("SCOPEID")) |
190 | UUID.TryParse(request["SCOPEID"], out scopeID); | 190 | UUID.TryParse(request["SCOPEID"].ToString(), out scopeID); |
191 | else | 191 | else |
192 | m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get neighbours"); | 192 | m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get neighbours"); |
193 | 193 | ||
194 | UUID regionID = UUID.Zero; | 194 | UUID regionID = UUID.Zero; |
195 | if (request["REGIONID"] != null) | 195 | if (request.ContainsKey("REGIONID")) |
196 | UUID.TryParse(request["REGIONID"], out regionID); | 196 | UUID.TryParse(request["REGIONID"].ToString(), out regionID); |
197 | else | 197 | else |
198 | m_log.WarnFormat("[GRID HANDLER]: no regionID in request to get neighbours"); | 198 | m_log.WarnFormat("[GRID HANDLER]: no regionID in request to get neighbours"); |
199 | 199 | ||
@@ -221,17 +221,17 @@ namespace OpenSim.Server.Handlers.Grid | |||
221 | 221 | ||
222 | } | 222 | } |
223 | 223 | ||
224 | byte[] GetRegionByUUID(Dictionary<string, string> request) | 224 | byte[] GetRegionByUUID(Dictionary<string, object> request) |
225 | { | 225 | { |
226 | UUID scopeID = UUID.Zero; | 226 | UUID scopeID = UUID.Zero; |
227 | if (request["SCOPEID"] != null) | 227 | if (request.ContainsKey("SCOPEID")) |
228 | UUID.TryParse(request["SCOPEID"], out scopeID); | 228 | UUID.TryParse(request["SCOPEID"].ToString(), out scopeID); |
229 | else | 229 | else |
230 | m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get neighbours"); | 230 | m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get neighbours"); |
231 | 231 | ||
232 | UUID regionID = UUID.Zero; | 232 | UUID regionID = UUID.Zero; |
233 | if (request["REGIONID"] != null) | 233 | if (request.ContainsKey("REGIONID")) |
234 | UUID.TryParse(request["REGIONID"], out regionID); | 234 | UUID.TryParse(request["REGIONID"].ToString(), out regionID); |
235 | else | 235 | else |
236 | m_log.WarnFormat("[GRID HANDLER]: no regionID in request to get neighbours"); | 236 | m_log.WarnFormat("[GRID HANDLER]: no regionID in request to get neighbours"); |
237 | 237 | ||
@@ -250,21 +250,21 @@ namespace OpenSim.Server.Handlers.Grid | |||
250 | return encoding.GetBytes(xmlString); | 250 | return encoding.GetBytes(xmlString); |
251 | } | 251 | } |
252 | 252 | ||
253 | byte[] GetRegionByPosition(Dictionary<string, string> request) | 253 | byte[] GetRegionByPosition(Dictionary<string, object> request) |
254 | { | 254 | { |
255 | UUID scopeID = UUID.Zero; | 255 | UUID scopeID = UUID.Zero; |
256 | if (request["SCOPEID"] != null) | 256 | if (request.ContainsKey("SCOPEID")) |
257 | UUID.TryParse(request["SCOPEID"], out scopeID); | 257 | UUID.TryParse(request["SCOPEID"].ToString(), out scopeID); |
258 | else | 258 | else |
259 | m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get region by position"); | 259 | m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get region by position"); |
260 | 260 | ||
261 | int x = 0, y = 0; | 261 | int x = 0, y = 0; |
262 | if (request["X"] != null) | 262 | if (request.ContainsKey("X")) |
263 | Int32.TryParse(request["X"], out x); | 263 | Int32.TryParse(request["X"].ToString(), out x); |
264 | else | 264 | else |
265 | m_log.WarnFormat("[GRID HANDLER]: no X in request to get region by position"); | 265 | m_log.WarnFormat("[GRID HANDLER]: no X in request to get region by position"); |
266 | if (request["Y"] != null) | 266 | if (request.ContainsKey("Y")) |
267 | Int32.TryParse(request["Y"], out y); | 267 | Int32.TryParse(request["Y"].ToString(), out y); |
268 | else | 268 | else |
269 | m_log.WarnFormat("[GRID HANDLER]: no Y in request to get region by position"); | 269 | m_log.WarnFormat("[GRID HANDLER]: no Y in request to get region by position"); |
270 | 270 | ||
@@ -283,17 +283,17 @@ namespace OpenSim.Server.Handlers.Grid | |||
283 | return encoding.GetBytes(xmlString); | 283 | return encoding.GetBytes(xmlString); |
284 | } | 284 | } |
285 | 285 | ||
286 | byte[] GetRegionByName(Dictionary<string, string> request) | 286 | byte[] GetRegionByName(Dictionary<string, object> request) |
287 | { | 287 | { |
288 | UUID scopeID = UUID.Zero; | 288 | UUID scopeID = UUID.Zero; |
289 | if (request["SCOPEID"] != null) | 289 | if (request.ContainsKey("SCOPEID")) |
290 | UUID.TryParse(request["SCOPEID"], out scopeID); | 290 | UUID.TryParse(request["SCOPEID"].ToString(), out scopeID); |
291 | else | 291 | else |
292 | m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get region by name"); | 292 | m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get region by name"); |
293 | 293 | ||
294 | string regionName = string.Empty; | 294 | string regionName = string.Empty; |
295 | if (request["NAME"] != null) | 295 | if (request.ContainsKey("NAME")) |
296 | regionName = request["NAME"]; | 296 | regionName = request["NAME"].ToString(); |
297 | else | 297 | else |
298 | m_log.WarnFormat("[GRID HANDLER]: no name in request to get region by name"); | 298 | m_log.WarnFormat("[GRID HANDLER]: no name in request to get region by name"); |
299 | 299 | ||
@@ -312,23 +312,23 @@ namespace OpenSim.Server.Handlers.Grid | |||
312 | return encoding.GetBytes(xmlString); | 312 | return encoding.GetBytes(xmlString); |
313 | } | 313 | } |
314 | 314 | ||
315 | byte[] GetRegionsByName(Dictionary<string, string> request) | 315 | byte[] GetRegionsByName(Dictionary<string, object> request) |
316 | { | 316 | { |
317 | UUID scopeID = UUID.Zero; | 317 | UUID scopeID = UUID.Zero; |
318 | if (request["SCOPEID"] != null) | 318 | if (request.ContainsKey("SCOPEID")) |
319 | UUID.TryParse(request["SCOPEID"], out scopeID); | 319 | UUID.TryParse(request["SCOPEID"].ToString(), out scopeID); |
320 | else | 320 | else |
321 | m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get regions by name"); | 321 | m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get regions by name"); |
322 | 322 | ||
323 | string regionName = string.Empty; | 323 | string regionName = string.Empty; |
324 | if (request["NAME"] != null) | 324 | if (request.ContainsKey("NAME")) |
325 | regionName = request["NAME"]; | 325 | regionName = request["NAME"].ToString(); |
326 | else | 326 | else |
327 | m_log.WarnFormat("[GRID HANDLER]: no NAME in request to get regions by name"); | 327 | m_log.WarnFormat("[GRID HANDLER]: no NAME in request to get regions by name"); |
328 | 328 | ||
329 | int max = 0; | 329 | int max = 0; |
330 | if (request["MAX"] != null) | 330 | if (request.ContainsKey("MAX")) |
331 | Int32.TryParse(request["MAX"], out max); | 331 | Int32.TryParse(request["MAX"].ToString(), out max); |
332 | else | 332 | else |
333 | m_log.WarnFormat("[GRID HANDLER]: no MAX in request to get regions by name"); | 333 | m_log.WarnFormat("[GRID HANDLER]: no MAX in request to get regions by name"); |
334 | 334 | ||
@@ -355,30 +355,30 @@ namespace OpenSim.Server.Handlers.Grid | |||
355 | return encoding.GetBytes(xmlString); | 355 | return encoding.GetBytes(xmlString); |
356 | } | 356 | } |
357 | 357 | ||
358 | byte[] GetRegionRange(Dictionary<string, string> request) | 358 | byte[] GetRegionRange(Dictionary<string, object> request) |
359 | { | 359 | { |
360 | //m_log.DebugFormat("[GRID HANDLER]: GetRegionRange"); | 360 | //m_log.DebugFormat("[GRID HANDLER]: GetRegionRange"); |
361 | UUID scopeID = UUID.Zero; | 361 | UUID scopeID = UUID.Zero; |
362 | if (request.ContainsKey("SCOPEID")) | 362 | if (request.ContainsKey("SCOPEID")) |
363 | UUID.TryParse(request["SCOPEID"], out scopeID); | 363 | UUID.TryParse(request["SCOPEID"].ToString(), out scopeID); |
364 | else | 364 | else |
365 | m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get region range"); | 365 | m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get region range"); |
366 | 366 | ||
367 | int xmin = 0, xmax = 0, ymin = 0, ymax = 0; | 367 | int xmin = 0, xmax = 0, ymin = 0, ymax = 0; |
368 | if (request.ContainsKey("XMIN")) | 368 | if (request.ContainsKey("XMIN")) |
369 | Int32.TryParse(request["XMIN"], out xmin); | 369 | Int32.TryParse(request["XMIN"].ToString(), out xmin); |
370 | else | 370 | else |
371 | m_log.WarnFormat("[GRID HANDLER]: no XMIN in request to get region range"); | 371 | m_log.WarnFormat("[GRID HANDLER]: no XMIN in request to get region range"); |
372 | if (request.ContainsKey("XMAX")) | 372 | if (request.ContainsKey("XMAX")) |
373 | Int32.TryParse(request["XMAX"], out xmax); | 373 | Int32.TryParse(request["XMAX"].ToString(), out xmax); |
374 | else | 374 | else |
375 | m_log.WarnFormat("[GRID HANDLER]: no XMAX in request to get region range"); | 375 | m_log.WarnFormat("[GRID HANDLER]: no XMAX in request to get region range"); |
376 | if (request.ContainsKey("YMIN")) | 376 | if (request.ContainsKey("YMIN")) |
377 | Int32.TryParse(request["YMIN"], out ymin); | 377 | Int32.TryParse(request["YMIN"].ToString(), out ymin); |
378 | else | 378 | else |
379 | m_log.WarnFormat("[GRID HANDLER]: no YMIN in request to get region range"); | 379 | m_log.WarnFormat("[GRID HANDLER]: no YMIN in request to get region range"); |
380 | if (request.ContainsKey("YMAX")) | 380 | if (request.ContainsKey("YMAX")) |
381 | Int32.TryParse(request["YMAX"], out ymax); | 381 | Int32.TryParse(request["YMAX"].ToString(), out ymax); |
382 | else | 382 | else |
383 | m_log.WarnFormat("[GRID HANDLER]: no YMAX in request to get region range"); | 383 | m_log.WarnFormat("[GRID HANDLER]: no YMAX in request to get region range"); |
384 | 384 | ||
diff --git a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs new file mode 100644 index 0000000..c7d5ff1 --- /dev/null +++ b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs | |||
@@ -0,0 +1,456 @@ | |||
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 OpenSimulator 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 | |||
28 | using System; | ||
29 | using System.Reflection; | ||
30 | using System.Text; | ||
31 | using System.Xml; | ||
32 | using System.Collections.Generic; | ||
33 | using System.IO; | ||
34 | using Nini.Config; | ||
35 | using OpenSim.Framework; | ||
36 | using OpenSim.Server.Base; | ||
37 | using OpenSim.Services.Interfaces; | ||
38 | using OpenSim.Framework.Servers.HttpServer; | ||
39 | using OpenSim.Server.Handlers.Base; | ||
40 | using log4net; | ||
41 | using OpenMetaverse; | ||
42 | |||
43 | namespace OpenSim.Server.Handlers.Asset | ||
44 | { | ||
45 | public class XInventoryInConnector : ServiceConnector | ||
46 | { | ||
47 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
48 | |||
49 | private IInventoryService m_InventoryService; | ||
50 | private string m_ConfigName = "InventoryService"; | ||
51 | |||
52 | public XInventoryInConnector(IConfigSource config, IHttpServer server, string configName) : | ||
53 | base(config, server, configName) | ||
54 | { | ||
55 | if (configName != String.Empty) | ||
56 | m_ConfigName = configName; | ||
57 | |||
58 | IConfig serverConfig = config.Configs[m_ConfigName]; | ||
59 | if (serverConfig == null) | ||
60 | throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName)); | ||
61 | |||
62 | string inventoryService = serverConfig.GetString("LocalServiceModule", | ||
63 | String.Empty); | ||
64 | |||
65 | if (inventoryService == String.Empty) | ||
66 | throw new Exception("No InventoryService in config file"); | ||
67 | |||
68 | Object[] args = new Object[] { config }; | ||
69 | m_InventoryService = | ||
70 | ServerUtils.LoadPlugin<IInventoryService>(inventoryService, args); | ||
71 | |||
72 | server.AddStreamHandler(new XInventoryConnectorPostHandler(m_InventoryService)); | ||
73 | } | ||
74 | } | ||
75 | |||
76 | public class XInventoryConnectorPostHandler : BaseStreamHandler | ||
77 | { | ||
78 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
79 | |||
80 | private IInventoryService m_InventoryService; | ||
81 | |||
82 | public XInventoryConnectorPostHandler(IInventoryService service) : | ||
83 | base("POST", "/xinventory") | ||
84 | { | ||
85 | m_InventoryService = service; | ||
86 | } | ||
87 | |||
88 | public override byte[] Handle(string path, Stream requestData, | ||
89 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | ||
90 | { | ||
91 | StreamReader sr = new StreamReader(requestData); | ||
92 | string body = sr.ReadToEnd(); | ||
93 | sr.Close(); | ||
94 | body = body.Trim(); | ||
95 | |||
96 | m_log.DebugFormat("[XXX]: query String: {0}", body); | ||
97 | |||
98 | try | ||
99 | { | ||
100 | Dictionary<string, object> request = | ||
101 | ServerUtils.ParseQueryString(body); | ||
102 | |||
103 | if (!request.ContainsKey("METHOD")) | ||
104 | return FailureResult(); | ||
105 | |||
106 | string method = request["METHOD"].ToString(); | ||
107 | request.Remove("METHOD"); | ||
108 | |||
109 | switch (method) | ||
110 | { | ||
111 | case "CREATEUSERINVENTORY": | ||
112 | return HandleCreateUserInventory(request); | ||
113 | case "GETINVENTORYSKELETON": | ||
114 | return HandleGetInventorySkeleton(request); | ||
115 | case "GETROOTFOLDER": | ||
116 | return HandleGetRootFolder(request); | ||
117 | case "GETFOLDERFORTYPE": | ||
118 | return HandleGetFolderForType(request); | ||
119 | case "GETFOLDERCONTENT": | ||
120 | return HandleGetFolderContent(request); | ||
121 | case "GETFOLDERITEMS": | ||
122 | return HandleGetFolderItems(request); | ||
123 | case "ADDFOLDER": | ||
124 | return HandleAddFolder(request); | ||
125 | case "UPDATEFOLDER": | ||
126 | return HandleUpdateFolder(request); | ||
127 | case "MOVEFOLDER": | ||
128 | return HandleMoveFolder(request); | ||
129 | case "DELETEFOLDERS": | ||
130 | return HandleDeleteFolders(request); | ||
131 | case "PURGEFOLDER": | ||
132 | return HandlePurgeFolder(request); | ||
133 | case "ADDITEM": | ||
134 | return HandleAddItem(request); | ||
135 | case "UPDATEITEM": | ||
136 | return HandleUpdateItem(request); | ||
137 | case "MOVEITEMS": | ||
138 | return HandleMoveItems(request); | ||
139 | case "DELETEITEMS": | ||
140 | return HandleDeleteItems(request); | ||
141 | case "GETITEM": | ||
142 | return HandleGetItem(request); | ||
143 | case "GETFOLDER": | ||
144 | return HandleGetFolder(request); | ||
145 | case "GETACTIVEGESTURES": | ||
146 | return HandleGetActiveGestures(request); | ||
147 | case "GETASSETPERMISSIONS": | ||
148 | return HandleGetAssetPermissions(request); | ||
149 | } | ||
150 | m_log.DebugFormat("[XINVENTORY HANDLER]: unknown method request: {0}", method); | ||
151 | } | ||
152 | catch (Exception e) | ||
153 | { | ||
154 | m_log.Debug("[XINVENTORY HANDLER]: Exception {0}" + e); | ||
155 | } | ||
156 | |||
157 | return FailureResult(); | ||
158 | } | ||
159 | |||
160 | private byte[] FailureResult() | ||
161 | { | ||
162 | XmlDocument doc = new XmlDocument(); | ||
163 | |||
164 | XmlNode xmlnode = doc.CreateNode(XmlNodeType.XmlDeclaration, | ||
165 | "", ""); | ||
166 | |||
167 | doc.AppendChild(xmlnode); | ||
168 | |||
169 | XmlElement rootElement = doc.CreateElement("", "ServerResponse", | ||
170 | ""); | ||
171 | |||
172 | doc.AppendChild(rootElement); | ||
173 | |||
174 | XmlElement result = doc.CreateElement("", "RESULT", ""); | ||
175 | result.AppendChild(doc.CreateTextNode("False")); | ||
176 | |||
177 | rootElement.AppendChild(result); | ||
178 | |||
179 | return DocToBytes(doc); | ||
180 | } | ||
181 | |||
182 | private byte[] DocToBytes(XmlDocument doc) | ||
183 | { | ||
184 | MemoryStream ms = new MemoryStream(); | ||
185 | XmlTextWriter xw = new XmlTextWriter(ms, null); | ||
186 | xw.Formatting = Formatting.Indented; | ||
187 | doc.WriteTo(xw); | ||
188 | xw.Flush(); | ||
189 | |||
190 | return ms.ToArray(); | ||
191 | } | ||
192 | |||
193 | byte[] HandleCreateUserInventory(Dictionary<string,object> request) | ||
194 | { | ||
195 | Dictionary<string,object> result = new Dictionary<string,object>(); | ||
196 | |||
197 | if (!request.ContainsKey("PRINCIPAL")) | ||
198 | return FailureResult(); | ||
199 | |||
200 | if(m_InventoryService.CreateUserInventory(new UUID(request["PRINCIPAL"].ToString()))) | ||
201 | result["RESULT"] = "True"; | ||
202 | else | ||
203 | result["RESULT"] = "False"; | ||
204 | |||
205 | string xmlString = ServerUtils.BuildXmlResponse(result); | ||
206 | m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | ||
207 | UTF8Encoding encoding = new UTF8Encoding(); | ||
208 | return encoding.GetBytes(xmlString); | ||
209 | } | ||
210 | |||
211 | byte[] HandleGetInventorySkeleton(Dictionary<string,object> request) | ||
212 | { | ||
213 | Dictionary<string,object> result = new Dictionary<string,object>(); | ||
214 | |||
215 | if (!request.ContainsKey("PRINCIPAL")) | ||
216 | return FailureResult(); | ||
217 | |||
218 | |||
219 | List<InventoryFolderBase> folders = m_InventoryService.GetInventorySkeleton(new UUID(request["PRINCIPAL"].ToString())); | ||
220 | |||
221 | foreach (InventoryFolderBase f in folders) | ||
222 | result[f.ID.ToString()] = EncodeFolder(f); | ||
223 | |||
224 | string xmlString = ServerUtils.BuildXmlResponse(result); | ||
225 | m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | ||
226 | UTF8Encoding encoding = new UTF8Encoding(); | ||
227 | return encoding.GetBytes(xmlString); | ||
228 | } | ||
229 | |||
230 | byte[] HandleGetRootFolder(Dictionary<string,object> request) | ||
231 | { | ||
232 | Dictionary<string,object> result = new Dictionary<string,object>(); | ||
233 | |||
234 | string xmlString = ServerUtils.BuildXmlResponse(result); | ||
235 | m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | ||
236 | UTF8Encoding encoding = new UTF8Encoding(); | ||
237 | return encoding.GetBytes(xmlString); | ||
238 | } | ||
239 | |||
240 | byte[] HandleGetFolderForType(Dictionary<string,object> request) | ||
241 | { | ||
242 | Dictionary<string,object> result = new Dictionary<string,object>(); | ||
243 | |||
244 | string xmlString = ServerUtils.BuildXmlResponse(result); | ||
245 | m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | ||
246 | UTF8Encoding encoding = new UTF8Encoding(); | ||
247 | return encoding.GetBytes(xmlString); | ||
248 | } | ||
249 | |||
250 | byte[] HandleGetFolderContent(Dictionary<string,object> request) | ||
251 | { | ||
252 | Dictionary<string,object> result = new Dictionary<string,object>(); | ||
253 | |||
254 | string xmlString = ServerUtils.BuildXmlResponse(result); | ||
255 | m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | ||
256 | UTF8Encoding encoding = new UTF8Encoding(); | ||
257 | return encoding.GetBytes(xmlString); | ||
258 | } | ||
259 | |||
260 | byte[] HandleGetFolderItems(Dictionary<string,object> request) | ||
261 | { | ||
262 | Dictionary<string,object> result = new Dictionary<string,object>(); | ||
263 | |||
264 | string xmlString = ServerUtils.BuildXmlResponse(result); | ||
265 | m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | ||
266 | UTF8Encoding encoding = new UTF8Encoding(); | ||
267 | return encoding.GetBytes(xmlString); | ||
268 | } | ||
269 | |||
270 | byte[] HandleAddFolder(Dictionary<string,object> request) | ||
271 | { | ||
272 | Dictionary<string,object> result = new Dictionary<string,object>(); | ||
273 | |||
274 | string xmlString = ServerUtils.BuildXmlResponse(result); | ||
275 | m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | ||
276 | UTF8Encoding encoding = new UTF8Encoding(); | ||
277 | return encoding.GetBytes(xmlString); | ||
278 | } | ||
279 | |||
280 | byte[] HandleUpdateFolder(Dictionary<string,object> request) | ||
281 | { | ||
282 | Dictionary<string,object> result = new Dictionary<string,object>(); | ||
283 | |||
284 | string xmlString = ServerUtils.BuildXmlResponse(result); | ||
285 | m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | ||
286 | UTF8Encoding encoding = new UTF8Encoding(); | ||
287 | return encoding.GetBytes(xmlString); | ||
288 | } | ||
289 | |||
290 | byte[] HandleMoveFolder(Dictionary<string,object> request) | ||
291 | { | ||
292 | Dictionary<string,object> result = new Dictionary<string,object>(); | ||
293 | |||
294 | string xmlString = ServerUtils.BuildXmlResponse(result); | ||
295 | m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | ||
296 | UTF8Encoding encoding = new UTF8Encoding(); | ||
297 | return encoding.GetBytes(xmlString); | ||
298 | } | ||
299 | |||
300 | byte[] HandleDeleteFolders(Dictionary<string,object> request) | ||
301 | { | ||
302 | Dictionary<string,object> result = new Dictionary<string,object>(); | ||
303 | |||
304 | string xmlString = ServerUtils.BuildXmlResponse(result); | ||
305 | m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | ||
306 | UTF8Encoding encoding = new UTF8Encoding(); | ||
307 | return encoding.GetBytes(xmlString); | ||
308 | } | ||
309 | |||
310 | byte[] HandlePurgeFolder(Dictionary<string,object> request) | ||
311 | { | ||
312 | Dictionary<string,object> result = new Dictionary<string,object>(); | ||
313 | |||
314 | string xmlString = ServerUtils.BuildXmlResponse(result); | ||
315 | m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | ||
316 | UTF8Encoding encoding = new UTF8Encoding(); | ||
317 | return encoding.GetBytes(xmlString); | ||
318 | } | ||
319 | |||
320 | byte[] HandleAddItem(Dictionary<string,object> request) | ||
321 | { | ||
322 | Dictionary<string,object> result = new Dictionary<string,object>(); | ||
323 | |||
324 | string xmlString = ServerUtils.BuildXmlResponse(result); | ||
325 | m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | ||
326 | UTF8Encoding encoding = new UTF8Encoding(); | ||
327 | return encoding.GetBytes(xmlString); | ||
328 | } | ||
329 | |||
330 | byte[] HandleUpdateItem(Dictionary<string,object> request) | ||
331 | { | ||
332 | Dictionary<string,object> result = new Dictionary<string,object>(); | ||
333 | |||
334 | string xmlString = ServerUtils.BuildXmlResponse(result); | ||
335 | m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | ||
336 | UTF8Encoding encoding = new UTF8Encoding(); | ||
337 | return encoding.GetBytes(xmlString); | ||
338 | } | ||
339 | |||
340 | byte[] HandleMoveItems(Dictionary<string,object> request) | ||
341 | { | ||
342 | Dictionary<string,object> result = new Dictionary<string,object>(); | ||
343 | |||
344 | string xmlString = ServerUtils.BuildXmlResponse(result); | ||
345 | m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | ||
346 | UTF8Encoding encoding = new UTF8Encoding(); | ||
347 | return encoding.GetBytes(xmlString); | ||
348 | } | ||
349 | |||
350 | byte[] HandleDeleteItems(Dictionary<string,object> request) | ||
351 | { | ||
352 | Dictionary<string,object> result = new Dictionary<string,object>(); | ||
353 | |||
354 | string xmlString = ServerUtils.BuildXmlResponse(result); | ||
355 | m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | ||
356 | UTF8Encoding encoding = new UTF8Encoding(); | ||
357 | return encoding.GetBytes(xmlString); | ||
358 | } | ||
359 | |||
360 | byte[] HandleGetItem(Dictionary<string,object> request) | ||
361 | { | ||
362 | Dictionary<string,object> result = new Dictionary<string,object>(); | ||
363 | |||
364 | string xmlString = ServerUtils.BuildXmlResponse(result); | ||
365 | m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | ||
366 | UTF8Encoding encoding = new UTF8Encoding(); | ||
367 | return encoding.GetBytes(xmlString); | ||
368 | } | ||
369 | |||
370 | byte[] HandleGetFolder(Dictionary<string,object> request) | ||
371 | { | ||
372 | Dictionary<string,object> result = new Dictionary<string,object>(); | ||
373 | |||
374 | string xmlString = ServerUtils.BuildXmlResponse(result); | ||
375 | m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | ||
376 | UTF8Encoding encoding = new UTF8Encoding(); | ||
377 | return encoding.GetBytes(xmlString); | ||
378 | } | ||
379 | |||
380 | byte[] HandleGetActiveGestures(Dictionary<string,object> request) | ||
381 | { | ||
382 | Dictionary<string,object> result = new Dictionary<string,object>(); | ||
383 | |||
384 | string xmlString = ServerUtils.BuildXmlResponse(result); | ||
385 | m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | ||
386 | UTF8Encoding encoding = new UTF8Encoding(); | ||
387 | return encoding.GetBytes(xmlString); | ||
388 | } | ||
389 | |||
390 | byte[] HandleGetAssetPermissions(Dictionary<string,object> request) | ||
391 | { | ||
392 | Dictionary<string,object> result = new Dictionary<string,object>(); | ||
393 | |||
394 | string xmlString = ServerUtils.BuildXmlResponse(result); | ||
395 | m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | ||
396 | UTF8Encoding encoding = new UTF8Encoding(); | ||
397 | return encoding.GetBytes(xmlString); | ||
398 | } | ||
399 | |||
400 | private Dictionary<string, object> EncodeFolder(InventoryFolderBase f) | ||
401 | { | ||
402 | Dictionary<string, object> ret = new Dictionary<string, object>(); | ||
403 | |||
404 | ret["ParentID"] = f.ParentID.ToString(); | ||
405 | ret["Type"] = f.Type.ToString(); | ||
406 | ret["Version"] = f.Version.ToString(); | ||
407 | ret["Name"] = f.Name; | ||
408 | ret["Owner"] = f.Owner.ToString(); | ||
409 | ret["ID"] = f.ID.ToString(); | ||
410 | |||
411 | return ret; | ||
412 | } | ||
413 | |||
414 | private InventoryFolderBase BuildFolder(Dictionary<string,object> data) | ||
415 | { | ||
416 | InventoryFolderBase folder = new InventoryFolderBase(); | ||
417 | |||
418 | folder.ParentID = new UUID(data["ParentID"].ToString()); | ||
419 | folder.Type = short.Parse(data["Type"].ToString()); | ||
420 | folder.Version = ushort.Parse(data["Version"].ToString()); | ||
421 | folder.Name = data["Name"].ToString(); | ||
422 | folder.Owner = new UUID(data["Owner"].ToString()); | ||
423 | folder.ID = new UUID(data["ID"].ToString()); | ||
424 | |||
425 | return folder; | ||
426 | } | ||
427 | |||
428 | private InventoryItemBase BuildItem(Dictionary<string,object> data) | ||
429 | { | ||
430 | InventoryItemBase item = new InventoryItemBase(); | ||
431 | |||
432 | item.AssetID = new UUID(data["AssetID"].ToString()); | ||
433 | item.AssetType = int.Parse(data["AssetType"].ToString()); | ||
434 | item.Name = data["Name"].ToString(); | ||
435 | item.Owner = new UUID(data["Owner"].ToString()); | ||
436 | item.ID = new UUID(data["ID"].ToString()); | ||
437 | item.InvType = int.Parse(data["InvType"].ToString()); | ||
438 | item.Folder = new UUID(data["Folder"].ToString()); | ||
439 | item.CreatorId = data["CreatorId"].ToString(); | ||
440 | item.Description = data["Description"].ToString(); | ||
441 | item.NextPermissions = uint.Parse(data["NextPermissions"].ToString()); | ||
442 | item.CurrentPermissions = uint.Parse(data["CurrentPermissions"].ToString()); | ||
443 | item.BasePermissions = uint.Parse(data["BasePermissions"].ToString()); | ||
444 | item.EveryOnePermissions = uint.Parse(data["EveryOnePermissions"].ToString()); | ||
445 | item.GroupPermissions = uint.Parse(data["GroupPermissions"].ToString()); | ||
446 | item.GroupID = new UUID(data["GroupID"].ToString()); | ||
447 | item.GroupOwned = bool.Parse(data["GroupOwned"].ToString()); | ||
448 | item.SalePrice = int.Parse(data["SalePrice"].ToString()); | ||
449 | item.SaleType = byte.Parse(data["SaleType"].ToString()); | ||
450 | item.Flags = uint.Parse(data["Flags"].ToString()); | ||
451 | item.CreationDate = int.Parse(data["CreationDate"].ToString()); | ||
452 | |||
453 | return item; | ||
454 | } | ||
455 | } | ||
456 | } | ||
diff --git a/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs b/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs index 2558fa0..b5ae54a 100644 --- a/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs | |||
@@ -68,13 +68,13 @@ namespace OpenSim.Server.Handlers.Presence | |||
68 | 68 | ||
69 | try | 69 | try |
70 | { | 70 | { |
71 | Dictionary<string, string> request = | 71 | Dictionary<string, object> request = |
72 | ServerUtils.ParseQueryString(body); | 72 | ServerUtils.ParseQueryString(body); |
73 | 73 | ||
74 | if (!request.ContainsKey("METHOD")) | 74 | if (!request.ContainsKey("METHOD")) |
75 | return FailureResult(); | 75 | return FailureResult(); |
76 | 76 | ||
77 | string method = request["METHOD"]; | 77 | string method = request["METHOD"].ToString(); |
78 | 78 | ||
79 | switch (method) | 79 | switch (method) |
80 | { | 80 | { |
@@ -92,12 +92,12 @@ namespace OpenSim.Server.Handlers.Presence | |||
92 | 92 | ||
93 | } | 93 | } |
94 | 94 | ||
95 | byte[] Report(Dictionary<string, string> request) | 95 | byte[] Report(Dictionary<string, object> request) |
96 | { | 96 | { |
97 | PresenceInfo info = new PresenceInfo(); | 97 | PresenceInfo info = new PresenceInfo(); |
98 | info.Data = new Dictionary<string, string>(); | 98 | info.Data = new Dictionary<string, string>(); |
99 | 99 | ||
100 | if (request["PrincipalID"] == null || request["RegionID"] == null) | 100 | if (!request.ContainsKey("PrincipalID") || !request.ContainsKey("RegionID")) |
101 | return FailureResult(); | 101 | return FailureResult(); |
102 | 102 | ||
103 | if (!UUID.TryParse(request["PrincipalID"].ToString(), | 103 | if (!UUID.TryParse(request["PrincipalID"].ToString(), |
@@ -108,14 +108,14 @@ namespace OpenSim.Server.Handlers.Presence | |||
108 | out info.RegionID)) | 108 | out info.RegionID)) |
109 | return FailureResult(); | 109 | return FailureResult(); |
110 | 110 | ||
111 | foreach (KeyValuePair<string, string> kvp in request) | 111 | foreach (KeyValuePair<string, object> kvp in request) |
112 | { | 112 | { |
113 | if (kvp.Key == "METHOD" || | 113 | if (kvp.Key == "METHOD" || |
114 | kvp.Key == "PrincipalID" || | 114 | kvp.Key == "PrincipalID" || |
115 | kvp.Key == "RegionID") | 115 | kvp.Key == "RegionID") |
116 | continue; | 116 | continue; |
117 | 117 | ||
118 | info.Data[kvp.Key] = kvp.Value; | 118 | info.Data[kvp.Key] = kvp.Value.ToString(); |
119 | } | 119 | } |
120 | 120 | ||
121 | if (m_PresenceService.Report(info)) | 121 | if (m_PresenceService.Report(info)) |
diff --git a/OpenSim/Services/Connectors/Authentication/AuthenticationServiceConnector.cs b/OpenSim/Services/Connectors/Authentication/AuthenticationServiceConnector.cs index 50e817e..19bb3e2 100644 --- a/OpenSim/Services/Connectors/Authentication/AuthenticationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Authentication/AuthenticationServiceConnector.cs | |||
@@ -84,7 +84,7 @@ namespace OpenSim.Services.Connectors | |||
84 | 84 | ||
85 | public string Authenticate(UUID principalID, string password, int lifetime) | 85 | public string Authenticate(UUID principalID, string password, int lifetime) |
86 | { | 86 | { |
87 | Dictionary<string, string> sendData = new Dictionary<string, string>(); | 87 | Dictionary<string, object> sendData = new Dictionary<string, object>(); |
88 | sendData["LIFETIME"] = lifetime.ToString(); | 88 | sendData["LIFETIME"] = lifetime.ToString(); |
89 | sendData["PRINCIPAL"] = principalID.ToString(); | 89 | sendData["PRINCIPAL"] = principalID.ToString(); |
90 | sendData["PASSWORD"] = password; | 90 | sendData["PASSWORD"] = password; |
@@ -106,7 +106,7 @@ namespace OpenSim.Services.Connectors | |||
106 | 106 | ||
107 | public bool Verify(UUID principalID, string token, int lifetime) | 107 | public bool Verify(UUID principalID, string token, int lifetime) |
108 | { | 108 | { |
109 | Dictionary<string, string> sendData = new Dictionary<string, string>(); | 109 | Dictionary<string, object> sendData = new Dictionary<string, object>(); |
110 | sendData["LIFETIME"] = lifetime.ToString(); | 110 | sendData["LIFETIME"] = lifetime.ToString(); |
111 | sendData["PRINCIPAL"] = principalID.ToString(); | 111 | sendData["PRINCIPAL"] = principalID.ToString(); |
112 | sendData["TOKEN"] = token; | 112 | sendData["TOKEN"] = token; |
@@ -128,7 +128,7 @@ namespace OpenSim.Services.Connectors | |||
128 | 128 | ||
129 | public bool Release(UUID principalID, string token) | 129 | public bool Release(UUID principalID, string token) |
130 | { | 130 | { |
131 | Dictionary<string, string> sendData = new Dictionary<string, string>(); | 131 | Dictionary<string, object> sendData = new Dictionary<string, object>(); |
132 | sendData["PRINCIPAL"] = principalID.ToString(); | 132 | sendData["PRINCIPAL"] = principalID.ToString(); |
133 | sendData["TOKEN"] = token; | 133 | sendData["TOKEN"] = token; |
134 | 134 | ||
diff --git a/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs b/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs index 02f2b79..99aa3fb 100644 --- a/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs +++ b/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs | |||
@@ -89,7 +89,7 @@ namespace OpenSim.Services.Connectors | |||
89 | public virtual bool RegisterRegion(UUID scopeID, GridRegion regionInfo) | 89 | public virtual bool RegisterRegion(UUID scopeID, GridRegion regionInfo) |
90 | { | 90 | { |
91 | Dictionary<string, object> rinfo = regionInfo.ToKeyValuePairs(); | 91 | Dictionary<string, object> rinfo = regionInfo.ToKeyValuePairs(); |
92 | Dictionary<string, string> sendData = new Dictionary<string,string>(); | 92 | Dictionary<string, object> sendData = new Dictionary<string,object>(); |
93 | foreach (KeyValuePair<string, object> kvp in rinfo) | 93 | foreach (KeyValuePair<string, object> kvp in rinfo) |
94 | sendData[kvp.Key] = (string)kvp.Value; | 94 | sendData[kvp.Key] = (string)kvp.Value; |
95 | 95 | ||
@@ -130,7 +130,7 @@ namespace OpenSim.Services.Connectors | |||
130 | 130 | ||
131 | public virtual bool DeregisterRegion(UUID regionID) | 131 | public virtual bool DeregisterRegion(UUID regionID) |
132 | { | 132 | { |
133 | Dictionary<string, string> sendData = new Dictionary<string, string>(); | 133 | Dictionary<string, object> sendData = new Dictionary<string, object>(); |
134 | 134 | ||
135 | sendData["REGIONID"] = regionID.ToString(); | 135 | sendData["REGIONID"] = regionID.ToString(); |
136 | 136 | ||
@@ -162,7 +162,7 @@ namespace OpenSim.Services.Connectors | |||
162 | 162 | ||
163 | public virtual List<GridRegion> GetNeighbours(UUID scopeID, UUID regionID) | 163 | public virtual List<GridRegion> GetNeighbours(UUID scopeID, UUID regionID) |
164 | { | 164 | { |
165 | Dictionary<string, string> sendData = new Dictionary<string, string>(); | 165 | Dictionary<string, object> sendData = new Dictionary<string, object>(); |
166 | 166 | ||
167 | sendData["SCOPEID"] = scopeID.ToString(); | 167 | sendData["SCOPEID"] = scopeID.ToString(); |
168 | sendData["REGIONID"] = regionID.ToString(); | 168 | sendData["REGIONID"] = regionID.ToString(); |
@@ -212,7 +212,7 @@ namespace OpenSim.Services.Connectors | |||
212 | 212 | ||
213 | public virtual GridRegion GetRegionByUUID(UUID scopeID, UUID regionID) | 213 | public virtual GridRegion GetRegionByUUID(UUID scopeID, UUID regionID) |
214 | { | 214 | { |
215 | Dictionary<string, string> sendData = new Dictionary<string, string>(); | 215 | Dictionary<string, object> sendData = new Dictionary<string, object>(); |
216 | 216 | ||
217 | sendData["SCOPEID"] = scopeID.ToString(); | 217 | sendData["SCOPEID"] = scopeID.ToString(); |
218 | sendData["REGIONID"] = regionID.ToString(); | 218 | sendData["REGIONID"] = regionID.ToString(); |
@@ -258,7 +258,7 @@ namespace OpenSim.Services.Connectors | |||
258 | 258 | ||
259 | public virtual GridRegion GetRegionByPosition(UUID scopeID, int x, int y) | 259 | public virtual GridRegion GetRegionByPosition(UUID scopeID, int x, int y) |
260 | { | 260 | { |
261 | Dictionary<string, string> sendData = new Dictionary<string, string>(); | 261 | Dictionary<string, object> sendData = new Dictionary<string, object>(); |
262 | 262 | ||
263 | sendData["SCOPEID"] = scopeID.ToString(); | 263 | sendData["SCOPEID"] = scopeID.ToString(); |
264 | sendData["X"] = x.ToString(); | 264 | sendData["X"] = x.ToString(); |
@@ -303,7 +303,7 @@ namespace OpenSim.Services.Connectors | |||
303 | 303 | ||
304 | public virtual GridRegion GetRegionByName(UUID scopeID, string regionName) | 304 | public virtual GridRegion GetRegionByName(UUID scopeID, string regionName) |
305 | { | 305 | { |
306 | Dictionary<string, string> sendData = new Dictionary<string, string>(); | 306 | Dictionary<string, object> sendData = new Dictionary<string, object>(); |
307 | 307 | ||
308 | sendData["SCOPEID"] = scopeID.ToString(); | 308 | sendData["SCOPEID"] = scopeID.ToString(); |
309 | sendData["NAME"] = regionName; | 309 | sendData["NAME"] = regionName; |
@@ -344,7 +344,7 @@ namespace OpenSim.Services.Connectors | |||
344 | 344 | ||
345 | public virtual List<GridRegion> GetRegionsByName(UUID scopeID, string name, int maxNumber) | 345 | public virtual List<GridRegion> GetRegionsByName(UUID scopeID, string name, int maxNumber) |
346 | { | 346 | { |
347 | Dictionary<string, string> sendData = new Dictionary<string, string>(); | 347 | Dictionary<string, object> sendData = new Dictionary<string, object>(); |
348 | 348 | ||
349 | sendData["SCOPEID"] = scopeID.ToString(); | 349 | sendData["SCOPEID"] = scopeID.ToString(); |
350 | sendData["NAME"] = name; | 350 | sendData["NAME"] = name; |
@@ -396,7 +396,7 @@ namespace OpenSim.Services.Connectors | |||
396 | 396 | ||
397 | public virtual List<GridRegion> GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax) | 397 | public virtual List<GridRegion> GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax) |
398 | { | 398 | { |
399 | Dictionary<string, string> sendData = new Dictionary<string, string>(); | 399 | Dictionary<string, object> sendData = new Dictionary<string, object>(); |
400 | 400 | ||
401 | sendData["SCOPEID"] = scopeID.ToString(); | 401 | sendData["SCOPEID"] = scopeID.ToString(); |
402 | sendData["XMIN"] = xmin.ToString(); | 402 | sendData["XMIN"] = xmin.ToString(); |
diff --git a/OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs b/OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs new file mode 100644 index 0000000..b9ccd7e --- /dev/null +++ b/OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs | |||
@@ -0,0 +1,535 @@ | |||
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 OpenSimulator 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 | |||
28 | using log4net; | ||
29 | using System; | ||
30 | using System.Collections.Generic; | ||
31 | using System.IO; | ||
32 | using System.Reflection; | ||
33 | using Nini.Config; | ||
34 | using OpenSim.Framework; | ||
35 | using OpenSim.Framework.Console; | ||
36 | using OpenSim.Framework.Communications; | ||
37 | using OpenSim.Framework.Servers.HttpServer; | ||
38 | using OpenSim.Services.Interfaces; | ||
39 | using OpenSim.Server.Base; | ||
40 | using OpenMetaverse; | ||
41 | |||
42 | namespace OpenSim.Services.Connectors | ||
43 | { | ||
44 | public class XInventoryServicesConnector : IInventoryService | ||
45 | { | ||
46 | private static readonly ILog m_log = | ||
47 | LogManager.GetLogger( | ||
48 | MethodBase.GetCurrentMethod().DeclaringType); | ||
49 | |||
50 | private string m_ServerURI = String.Empty; | ||
51 | |||
52 | public XInventoryServicesConnector() | ||
53 | { | ||
54 | } | ||
55 | |||
56 | public XInventoryServicesConnector(string serverURI) | ||
57 | { | ||
58 | m_ServerURI = serverURI.TrimEnd('/'); | ||
59 | } | ||
60 | |||
61 | public XInventoryServicesConnector(IConfigSource source) | ||
62 | { | ||
63 | Initialise(source); | ||
64 | } | ||
65 | |||
66 | public virtual void Initialise(IConfigSource source) | ||
67 | { | ||
68 | IConfig assetConfig = source.Configs["InventoryService"]; | ||
69 | if (assetConfig == null) | ||
70 | { | ||
71 | m_log.Error("[INVENTORY CONNECTOR]: InventoryService missing from OpanSim.ini"); | ||
72 | throw new Exception("Inventory connector init error"); | ||
73 | } | ||
74 | |||
75 | string serviceURI = assetConfig.GetString("InventoryServerURI", | ||
76 | String.Empty); | ||
77 | |||
78 | if (serviceURI == String.Empty) | ||
79 | { | ||
80 | m_log.Error("[INVENTORY CONNECTOR]: No Server URI named in section InventoryService"); | ||
81 | throw new Exception("Inventory connector init error"); | ||
82 | } | ||
83 | m_ServerURI = serviceURI; | ||
84 | } | ||
85 | |||
86 | public bool CreateUserInventory(UUID principalID) | ||
87 | { | ||
88 | Dictionary<string,object> ret = MakeRequest("CREATEUSERINVENTORY", | ||
89 | new Dictionary<string,object> { | ||
90 | { "PRINCIPAL", principalID.ToString() } | ||
91 | }); | ||
92 | |||
93 | if (ret == null) | ||
94 | return false; | ||
95 | |||
96 | return bool.Parse(ret["RESULT"].ToString()); | ||
97 | } | ||
98 | |||
99 | public List<InventoryFolderBase> GetInventorySkeleton(UUID principalID) | ||
100 | { | ||
101 | Dictionary<string,object> ret = MakeRequest("GETINVENTORYSKELETON", | ||
102 | new Dictionary<string,object> { | ||
103 | { "PRINCIPAL", principalID.ToString() } | ||
104 | }); | ||
105 | |||
106 | if (ret == null) | ||
107 | return null; | ||
108 | |||
109 | List<InventoryFolderBase> folders = new List<InventoryFolderBase>(); | ||
110 | |||
111 | foreach (Object o in ret.Values) | ||
112 | folders.Add(BuildFolder((Dictionary<string,object>)o)); | ||
113 | |||
114 | return folders; | ||
115 | } | ||
116 | |||
117 | public InventoryFolderBase GetRootFolder(UUID principalID) | ||
118 | { | ||
119 | Dictionary<string,object> ret = MakeRequest("GETROOTFOLDER", | ||
120 | new Dictionary<string,object> { | ||
121 | { "PRINCIPAL", principalID.ToString() } | ||
122 | }); | ||
123 | |||
124 | if (ret == null) | ||
125 | return null; | ||
126 | |||
127 | if (ret.Count == 0) | ||
128 | return null; | ||
129 | |||
130 | return BuildFolder(ret); | ||
131 | } | ||
132 | |||
133 | public InventoryFolderBase GetFolderForType(UUID principalID, AssetType type) | ||
134 | { | ||
135 | Dictionary<string,object> ret = MakeRequest("GETFOLDERFORTYPE", | ||
136 | new Dictionary<string,object> { | ||
137 | { "PRINCIPAL", principalID.ToString() }, | ||
138 | { "TYPE", ((int)type).ToString() } | ||
139 | }); | ||
140 | |||
141 | if (ret == null) | ||
142 | return null; | ||
143 | |||
144 | if (ret.Count == 0) | ||
145 | return null; | ||
146 | |||
147 | return BuildFolder(ret); | ||
148 | } | ||
149 | |||
150 | public InventoryCollection GetFolderContent(UUID principalID, UUID folderID) | ||
151 | { | ||
152 | Dictionary<string,object> ret = MakeRequest("GETFOLDERCONTENT", | ||
153 | new Dictionary<string,object> { | ||
154 | { "PRINCIPAL", principalID.ToString() }, | ||
155 | { "FOLDER", folderID.ToString() } | ||
156 | }); | ||
157 | |||
158 | if (ret == null) | ||
159 | return null; | ||
160 | |||
161 | if (ret.Count == 0) | ||
162 | return null; | ||
163 | |||
164 | |||
165 | InventoryCollection inventory = new InventoryCollection(); | ||
166 | inventory.Folders = new List<InventoryFolderBase>(); | ||
167 | inventory.Items = new List<InventoryItemBase>(); | ||
168 | inventory.UserID = principalID; | ||
169 | |||
170 | Dictionary<string,object> folders = | ||
171 | (Dictionary<string,object>)ret["FOLDERS"]; | ||
172 | Dictionary<string,object> items = | ||
173 | (Dictionary<string,object>)ret["ITEMS"]; | ||
174 | |||
175 | foreach (Object o in folders.Values) | ||
176 | inventory.Folders.Add(BuildFolder((Dictionary<string,object>)o)); | ||
177 | foreach (Object o in items.Values) | ||
178 | inventory.Items.Add(BuildItem((Dictionary<string,object>)o)); | ||
179 | |||
180 | return inventory; | ||
181 | } | ||
182 | |||
183 | public List<InventoryItemBase> GetFolderItems(UUID principalID, UUID folderID) | ||
184 | { | ||
185 | Dictionary<string,object> ret = MakeRequest("GETFOLDERCONTENT", | ||
186 | new Dictionary<string,object> { | ||
187 | { "PRINCIPAL", principalID.ToString() }, | ||
188 | { "FOLDER", folderID.ToString() } | ||
189 | }); | ||
190 | |||
191 | if (ret == null) | ||
192 | return null; | ||
193 | |||
194 | if (ret.Count == 0) | ||
195 | return null; | ||
196 | |||
197 | |||
198 | List<InventoryItemBase> items = new List<InventoryItemBase>(); | ||
199 | |||
200 | foreach (Object o in ret.Values) | ||
201 | items.Add(BuildItem((Dictionary<string,object>)o)); | ||
202 | |||
203 | return items; | ||
204 | } | ||
205 | |||
206 | public bool AddFolder(InventoryFolderBase folder) | ||
207 | { | ||
208 | Dictionary<string,object> ret = MakeRequest("ADDFOLDER", | ||
209 | new Dictionary<string,object> { | ||
210 | { "ParentID", folder.ParentID.ToString() }, | ||
211 | { "Type", folder.Type.ToString() }, | ||
212 | { "Version", folder.Version.ToString() }, | ||
213 | { "Name", folder.Name.ToString() }, | ||
214 | { "Owner", folder.Owner.ToString() }, | ||
215 | { "ID", folder.ID.ToString() } | ||
216 | }); | ||
217 | |||
218 | if (ret == null) | ||
219 | return false; | ||
220 | |||
221 | return bool.Parse(ret["RESULT"].ToString()); | ||
222 | } | ||
223 | |||
224 | public bool UpdateFolder(InventoryFolderBase folder) | ||
225 | { | ||
226 | Dictionary<string,object> ret = MakeRequest("UPDATEFOLDER", | ||
227 | new Dictionary<string,object> { | ||
228 | { "ParentID", folder.ParentID.ToString() }, | ||
229 | { "Type", folder.Type.ToString() }, | ||
230 | { "Version", folder.Version.ToString() }, | ||
231 | { "Name", folder.Name.ToString() }, | ||
232 | { "Owner", folder.Owner.ToString() }, | ||
233 | { "ID", folder.ID.ToString() } | ||
234 | }); | ||
235 | |||
236 | if (ret == null) | ||
237 | return false; | ||
238 | |||
239 | return bool.Parse(ret["RESULT"].ToString()); | ||
240 | } | ||
241 | |||
242 | public bool MoveFolder(InventoryFolderBase folder) | ||
243 | { | ||
244 | Dictionary<string,object> ret = MakeRequest("MOVEFOLDER", | ||
245 | new Dictionary<string,object> { | ||
246 | { "ParentID", folder.ParentID.ToString() }, | ||
247 | { "ID", folder.ID.ToString() } | ||
248 | }); | ||
249 | |||
250 | if (ret == null) | ||
251 | return false; | ||
252 | |||
253 | return bool.Parse(ret["RESULT"].ToString()); | ||
254 | } | ||
255 | |||
256 | public bool DeleteFolders(UUID principalID, List<UUID> folderIDs) | ||
257 | { | ||
258 | List<string> slist = new List<string>(); | ||
259 | |||
260 | foreach (UUID f in folderIDs) | ||
261 | slist.Add(f.ToString()); | ||
262 | |||
263 | Dictionary<string,object> ret = MakeRequest("DELETEFOLDERS", | ||
264 | new Dictionary<string,object> { | ||
265 | { "PRINCIPAL", principalID.ToString() }, | ||
266 | { "FOLDERS", slist } | ||
267 | }); | ||
268 | |||
269 | if (ret == null) | ||
270 | return false; | ||
271 | |||
272 | return bool.Parse(ret["RESULT"].ToString()); | ||
273 | } | ||
274 | |||
275 | public bool PurgeFolder(InventoryFolderBase folder) | ||
276 | { | ||
277 | Dictionary<string,object> ret = MakeRequest("PURGEFOLDER", | ||
278 | new Dictionary<string,object> { | ||
279 | { "ID", folder.ID.ToString() } | ||
280 | }); | ||
281 | |||
282 | if (ret == null) | ||
283 | return false; | ||
284 | |||
285 | return bool.Parse(ret["RESULT"].ToString()); | ||
286 | } | ||
287 | |||
288 | public bool AddItem(InventoryItemBase item) | ||
289 | { | ||
290 | Dictionary<string,object> ret = MakeRequest("ADDITEM", | ||
291 | new Dictionary<string,object> { | ||
292 | { "AssetID", item.AssetID.ToString() }, | ||
293 | { "AssetType", item.AssetType.ToString() }, | ||
294 | { "Name", item.Name.ToString() }, | ||
295 | { "Owner", item.Owner.ToString() }, | ||
296 | { "ID", item.ID.ToString() }, | ||
297 | { "InvType", item.InvType.ToString() }, | ||
298 | { "Folder", item.Folder.ToString() }, | ||
299 | { "CreatorId", item.CreatorId.ToString() }, | ||
300 | { "Description", item.Description.ToString() }, | ||
301 | { "NextPermissions", item.NextPermissions.ToString() }, | ||
302 | { "CurrentPermissions", item.CurrentPermissions.ToString() }, | ||
303 | { "BasePermissions", item.BasePermissions.ToString() }, | ||
304 | { "EveryOnePermissions", item.EveryOnePermissions.ToString() }, | ||
305 | { "GroupPermissions", item.GroupPermissions.ToString() }, | ||
306 | { "GroupID", item.GroupID.ToString() }, | ||
307 | { "GroupOwned", item.GroupOwned.ToString() }, | ||
308 | { "SalePrice", item.SalePrice.ToString() }, | ||
309 | { "SaleType", item.SaleType.ToString() }, | ||
310 | { "Flags", item.Flags.ToString() }, | ||
311 | { "CreationDate", item.CreationDate.ToString() } | ||
312 | }); | ||
313 | |||
314 | if (ret == null) | ||
315 | return false; | ||
316 | |||
317 | return bool.Parse(ret["RESULT"].ToString()); | ||
318 | } | ||
319 | |||
320 | public bool UpdateItem(InventoryItemBase item) | ||
321 | { | ||
322 | Dictionary<string,object> ret = MakeRequest("UPDATEITEM", | ||
323 | new Dictionary<string,object> { | ||
324 | { "AssetID", item.AssetID.ToString() }, | ||
325 | { "AssetType", item.AssetType.ToString() }, | ||
326 | { "Name", item.Name.ToString() }, | ||
327 | { "Owner", item.Owner.ToString() }, | ||
328 | { "ID", item.ID.ToString() }, | ||
329 | { "InvType", item.InvType.ToString() }, | ||
330 | { "Folder", item.Folder.ToString() }, | ||
331 | { "CreatorId", item.CreatorId.ToString() }, | ||
332 | { "Description", item.Description.ToString() }, | ||
333 | { "NextPermissions", item.NextPermissions.ToString() }, | ||
334 | { "CurrentPermissions", item.CurrentPermissions.ToString() }, | ||
335 | { "BasePermissions", item.BasePermissions.ToString() }, | ||
336 | { "EveryOnePermissions", item.EveryOnePermissions.ToString() }, | ||
337 | { "GroupPermissions", item.GroupPermissions.ToString() }, | ||
338 | { "GroupID", item.GroupID.ToString() }, | ||
339 | { "GroupOwned", item.GroupOwned.ToString() }, | ||
340 | { "SalePrice", item.SalePrice.ToString() }, | ||
341 | { "SaleType", item.SaleType.ToString() }, | ||
342 | { "Flags", item.Flags.ToString() }, | ||
343 | { "CreationDate", item.CreationDate.ToString() } | ||
344 | }); | ||
345 | |||
346 | if (ret == null) | ||
347 | return false; | ||
348 | |||
349 | return bool.Parse(ret["RESULT"].ToString()); | ||
350 | } | ||
351 | |||
352 | public bool MoveItems(UUID principalID, List<InventoryItemBase> items) | ||
353 | { | ||
354 | List<string> idlist = new List<string>(); | ||
355 | List<string> destlist = new List<string>(); | ||
356 | |||
357 | foreach (InventoryItemBase item in items) | ||
358 | { | ||
359 | idlist.Add(item.ID.ToString()); | ||
360 | destlist.Add(item.Folder.ToString()); | ||
361 | } | ||
362 | |||
363 | Dictionary<string,object> ret = MakeRequest("MOVEITEMS", | ||
364 | new Dictionary<string,object> { | ||
365 | { "PrincipalID", principalID.ToString() }, | ||
366 | { "IDLIST", idlist }, | ||
367 | { "DESTLIST", destlist } | ||
368 | }); | ||
369 | |||
370 | if (ret == null) | ||
371 | return false; | ||
372 | |||
373 | return bool.Parse(ret["RESULT"].ToString()); | ||
374 | } | ||
375 | |||
376 | public bool DeleteItems(UUID principalID, List<UUID> itemIDs) | ||
377 | { | ||
378 | List<string> slist = new List<string>(); | ||
379 | |||
380 | foreach (UUID f in itemIDs) | ||
381 | slist.Add(f.ToString()); | ||
382 | |||
383 | Dictionary<string,object> ret = MakeRequest("DELETEITEMS", | ||
384 | new Dictionary<string,object> { | ||
385 | { "PRINCIPAL", principalID.ToString() }, | ||
386 | { "ITEMS", slist } | ||
387 | }); | ||
388 | |||
389 | if (ret == null) | ||
390 | return false; | ||
391 | |||
392 | return bool.Parse(ret["RESULT"].ToString()); | ||
393 | } | ||
394 | |||
395 | public InventoryItemBase GetItem(InventoryItemBase item) | ||
396 | { | ||
397 | Dictionary<string,object> ret = MakeRequest("GETITEM", | ||
398 | new Dictionary<string,object> { | ||
399 | { "ID", item.ID.ToString() } | ||
400 | }); | ||
401 | |||
402 | if (ret == null) | ||
403 | return null; | ||
404 | |||
405 | if (ret.Count == 0) | ||
406 | return null; | ||
407 | |||
408 | return BuildItem(ret); | ||
409 | } | ||
410 | |||
411 | public InventoryFolderBase GetFolder(InventoryFolderBase folder) | ||
412 | { | ||
413 | Dictionary<string,object> ret = MakeRequest("GETFOLDER", | ||
414 | new Dictionary<string,object> { | ||
415 | { "ID", folder.ID.ToString() } | ||
416 | }); | ||
417 | |||
418 | if (ret == null) | ||
419 | return null; | ||
420 | |||
421 | if (ret.Count == 0) | ||
422 | return null; | ||
423 | |||
424 | return BuildFolder(ret); | ||
425 | } | ||
426 | |||
427 | public List<InventoryItemBase> GetActiveGestures(UUID principalID) | ||
428 | { | ||
429 | Dictionary<string,object> ret = MakeRequest("GETACTIVEGESTURES", | ||
430 | new Dictionary<string,object> { | ||
431 | { "PRINCIPAL", principalID.ToString() } | ||
432 | }); | ||
433 | |||
434 | if (ret == null) | ||
435 | return null; | ||
436 | |||
437 | List<InventoryItemBase> items = new List<InventoryItemBase>(); | ||
438 | |||
439 | foreach (Object o in ret.Values) | ||
440 | items.Add(BuildItem((Dictionary<string,object>)o)); | ||
441 | |||
442 | return items; | ||
443 | } | ||
444 | |||
445 | public int GetAssetPermissions(UUID principalID, UUID assetID) | ||
446 | { | ||
447 | Dictionary<string,object> ret = MakeRequest("GETASSETPERMISSIONS", | ||
448 | new Dictionary<string,object> { | ||
449 | { "PRINCIPAL", principalID.ToString() }, | ||
450 | { "ASSET", assetID.ToString() } | ||
451 | }); | ||
452 | |||
453 | if (ret == null) | ||
454 | return 0; | ||
455 | |||
456 | return int.Parse(ret["RESULT"].ToString()); | ||
457 | } | ||
458 | |||
459 | |||
460 | // These are either obsolete or unused | ||
461 | // | ||
462 | public InventoryCollection GetUserInventory(UUID principalID) | ||
463 | { | ||
464 | return null; | ||
465 | } | ||
466 | |||
467 | public void GetUserInventory(UUID principalID, InventoryReceiptCallback callback) | ||
468 | { | ||
469 | } | ||
470 | |||
471 | public bool HasInventoryForUser(UUID principalID) | ||
472 | { | ||
473 | return false; | ||
474 | } | ||
475 | |||
476 | // Helpers | ||
477 | // | ||
478 | private Dictionary<string,object> MakeRequest(string method, | ||
479 | Dictionary<string,object> sendData) | ||
480 | { | ||
481 | sendData["METHOD"] = method; | ||
482 | |||
483 | string reply = SynchronousRestFormsRequester.MakeRequest("POST", | ||
484 | m_ServerURI + "/xinventory", | ||
485 | ServerUtils.BuildQueryString(sendData)); | ||
486 | |||
487 | Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse( | ||
488 | reply); | ||
489 | |||
490 | return replyData; | ||
491 | } | ||
492 | |||
493 | private InventoryFolderBase BuildFolder(Dictionary<string,object> data) | ||
494 | { | ||
495 | InventoryFolderBase folder = new InventoryFolderBase(); | ||
496 | |||
497 | folder.ParentID = new UUID(data["ParentID"].ToString()); | ||
498 | folder.Type = short.Parse(data["Type"].ToString()); | ||
499 | folder.Version = ushort.Parse(data["Version"].ToString()); | ||
500 | folder.Name = data["Name"].ToString(); | ||
501 | folder.Owner = new UUID(data["Owner"].ToString()); | ||
502 | folder.ID = new UUID(data["ID"].ToString()); | ||
503 | |||
504 | return folder; | ||
505 | } | ||
506 | |||
507 | private InventoryItemBase BuildItem(Dictionary<string,object> data) | ||
508 | { | ||
509 | InventoryItemBase item = new InventoryItemBase(); | ||
510 | |||
511 | item.AssetID = new UUID(data["AssetID"].ToString()); | ||
512 | item.AssetType = int.Parse(data["AssetType"].ToString()); | ||
513 | item.Name = data["Name"].ToString(); | ||
514 | item.Owner = new UUID(data["Owner"].ToString()); | ||
515 | item.ID = new UUID(data["ID"].ToString()); | ||
516 | item.InvType = int.Parse(data["InvType"].ToString()); | ||
517 | item.Folder = new UUID(data["Folder"].ToString()); | ||
518 | item.CreatorId = data["CreatorId"].ToString(); | ||
519 | item.Description = data["Description"].ToString(); | ||
520 | item.NextPermissions = uint.Parse(data["NextPermissions"].ToString()); | ||
521 | item.CurrentPermissions = uint.Parse(data["CurrentPermissions"].ToString()); | ||
522 | item.BasePermissions = uint.Parse(data["BasePermissions"].ToString()); | ||
523 | item.EveryOnePermissions = uint.Parse(data["EveryOnePermissions"].ToString()); | ||
524 | item.GroupPermissions = uint.Parse(data["GroupPermissions"].ToString()); | ||
525 | item.GroupID = new UUID(data["GroupID"].ToString()); | ||
526 | item.GroupOwned = bool.Parse(data["GroupOwned"].ToString()); | ||
527 | item.SalePrice = int.Parse(data["SalePrice"].ToString()); | ||
528 | item.SaleType = byte.Parse(data["SaleType"].ToString()); | ||
529 | item.Flags = uint.Parse(data["Flags"].ToString()); | ||
530 | item.CreationDate = int.Parse(data["CreationDate"].ToString()); | ||
531 | |||
532 | return item; | ||
533 | } | ||
534 | } | ||
535 | } | ||
diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 2134200..8c4eb3f 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs | |||
@@ -288,25 +288,25 @@ namespace OpenSim.Tests.Common.Mock | |||
288 | 288 | ||
289 | public event PlacesQuery OnPlacesQuery; | 289 | public event PlacesQuery OnPlacesQuery; |
290 | 290 | ||
291 | public event FindAgentUpdate OnFindAgentEvent; | 291 | public event FindAgentUpdate OnFindAgent; |
292 | public event TrackAgentUpdate OnTrackAgentEvent; | 292 | public event TrackAgentUpdate OnTrackAgent; |
293 | public event NewUserReport OnUserReportEvent; | 293 | public event NewUserReport OnUserReport; |
294 | public event SaveStateHandler OnSaveStateEvent; | 294 | public event SaveStateHandler OnSaveState; |
295 | public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; | 295 | public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; |
296 | public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; | 296 | public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; |
297 | public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; | 297 | public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; |
298 | public event FreezeUserUpdate OnParcelFreezeUserEvent; | 298 | public event FreezeUserUpdate OnParcelFreezeUser; |
299 | public event EjectUserUpdate OnParcelEjectUserEvent; | 299 | public event EjectUserUpdate OnParcelEjectUser; |
300 | public event ParcelBuyPass OnParcelBuyPass; | 300 | public event ParcelBuyPass OnParcelBuyPass; |
301 | public event ParcelGodMark OnParcelGodMark; | 301 | public event ParcelGodMark OnParcelGodMark; |
302 | public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; | 302 | public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; |
303 | public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; | 303 | public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; |
304 | public event SimWideDeletesDelegate OnSimWideDeletes; | 304 | public event SimWideDeletesDelegate OnSimWideDeletes; |
305 | public event SendPostcard OnSendPostcard; | 305 | public event SendPostcard OnSendPostcard; |
306 | public event MuteListEntryUpdate OnUpdateMuteListEntryEvent; | 306 | public event MuteListEntryUpdate OnUpdateMuteListEntry; |
307 | public event MuteListEntryRemove OnRemoveMuteListEntryEvent; | 307 | public event MuteListEntryRemove OnRemoveMuteListEntry; |
308 | public event GodlikeMessage onGodlikeMessageEvent; | 308 | public event GodlikeMessage onGodlikeMessage; |
309 | public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent; | 309 | public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate; |
310 | 310 | ||
311 | #pragma warning restore 67 | 311 | #pragma warning restore 67 |
312 | 312 | ||
@@ -1194,6 +1194,14 @@ namespace OpenSim.Tests.Common.Mock | |||
1194 | 1194 | ||
1195 | public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) | 1195 | public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) |
1196 | { | 1196 | { |
1197 | } | ||
1198 | |||
1199 | public void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes) | ||
1200 | { | ||
1201 | } | ||
1202 | |||
1203 | public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals) | ||
1204 | { | ||
1197 | } | 1205 | } |
1198 | } | 1206 | } |
1199 | } | 1207 | } |