Merge branch 'master' into careminster

avinationmerge
Melanie 2010-01-09 12:02:48 +00:00
commit d22bdb5095
29 changed files with 2039 additions and 323 deletions

View File

@ -756,25 +756,25 @@ namespace OpenSim.Client.MXP.ClientStack
public event AvatarNotesUpdate OnAvatarNotesUpdate; public event AvatarNotesUpdate OnAvatarNotesUpdate;
public event MuteListRequest OnMuteListRequest; public event MuteListRequest OnMuteListRequest;
public event AvatarInterestUpdate OnAvatarInterestUpdate; public event AvatarInterestUpdate OnAvatarInterestUpdate;
public event FindAgentUpdate OnFindAgentEvent; public event FindAgentUpdate OnFindAgent;
public event TrackAgentUpdate OnTrackAgentEvent; public event TrackAgentUpdate OnTrackAgent;
public event NewUserReport OnUserReportEvent; public event NewUserReport OnUserReport;
public event SaveStateHandler OnSaveStateEvent; public event SaveStateHandler OnSaveState;
public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest;
public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest;
public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest;
public event FreezeUserUpdate OnParcelFreezeUserEvent; public event FreezeUserUpdate OnParcelFreezeUser;
public event EjectUserUpdate OnParcelEjectUserEvent; public event EjectUserUpdate OnParcelEjectUser;
public event ParcelBuyPass OnParcelBuyPass; public event ParcelBuyPass OnParcelBuyPass;
public event ParcelGodMark OnParcelGodMark; public event ParcelGodMark OnParcelGodMark;
public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest;
public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest;
public event SimWideDeletesDelegate OnSimWideDeletes; public event SimWideDeletesDelegate OnSimWideDeletes;
public event SendPostcard OnSendPostcard; public event SendPostcard OnSendPostcard;
public event MuteListEntryUpdate OnUpdateMuteListEntryEvent; public event MuteListEntryUpdate OnUpdateMuteListEntry;
public event MuteListEntryRemove OnRemoveMuteListEntryEvent; public event MuteListEntryRemove OnRemoveMuteListEntry;
public event GodlikeMessage onGodlikeMessageEvent; public event GodlikeMessage onGodlikeMessage;
public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent; public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate;
public event PlacesQuery OnPlacesQuery; public event PlacesQuery OnPlacesQuery;
@ -1690,5 +1690,13 @@ namespace OpenSim.Client.MXP.ClientStack
public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt)
{ {
} }
public void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes)
{
}
public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals)
{
}
} }
} }

View File

@ -401,25 +401,25 @@ namespace OpenSim.Client.Sirikata.ClientStack
public event GrantUserFriendRights OnGrantUserRights; public event GrantUserFriendRights OnGrantUserRights;
public event MuteListRequest OnMuteListRequest; public event MuteListRequest OnMuteListRequest;
public event PlacesQuery OnPlacesQuery; public event PlacesQuery OnPlacesQuery;
public event FindAgentUpdate OnFindAgentEvent; public event FindAgentUpdate OnFindAgent;
public event TrackAgentUpdate OnTrackAgentEvent; public event TrackAgentUpdate OnTrackAgent;
public event NewUserReport OnUserReportEvent; public event NewUserReport OnUserReport;
public event SaveStateHandler OnSaveStateEvent; public event SaveStateHandler OnSaveState;
public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest;
public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest;
public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest;
public event FreezeUserUpdate OnParcelFreezeUserEvent; public event FreezeUserUpdate OnParcelFreezeUser;
public event EjectUserUpdate OnParcelEjectUserEvent; public event EjectUserUpdate OnParcelEjectUser;
public event ParcelBuyPass OnParcelBuyPass; public event ParcelBuyPass OnParcelBuyPass;
public event ParcelGodMark OnParcelGodMark; public event ParcelGodMark OnParcelGodMark;
public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest;
public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest;
public event SimWideDeletesDelegate OnSimWideDeletes; public event SimWideDeletesDelegate OnSimWideDeletes;
public event SendPostcard OnSendPostcard; public event SendPostcard OnSendPostcard;
public event MuteListEntryUpdate OnUpdateMuteListEntryEvent; public event MuteListEntryUpdate OnUpdateMuteListEntry;
public event MuteListEntryRemove OnRemoveMuteListEntryEvent; public event MuteListEntryRemove OnRemoveMuteListEntry;
public event GodlikeMessage onGodlikeMessageEvent; public event GodlikeMessage onGodlikeMessage;
public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent; public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate;
public void SetDebugPacketLevel(int newDebug) public void SetDebugPacketLevel(int newDebug)
{ {
throw new System.NotImplementedException(); throw new System.NotImplementedException();
@ -1180,6 +1180,14 @@ namespace OpenSim.Client.Sirikata.ClientStack
{ {
} }
public void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes)
{
}
public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals)
{
}
#endregion #endregion
} }
} }

View File

@ -405,25 +405,25 @@ namespace OpenSim.Client.VWoHTTP.ClientStack
public event MuteListRequest OnMuteListRequest = delegate { }; public event MuteListRequest OnMuteListRequest = delegate { };
public event AvatarInterestUpdate OnAvatarInterestUpdate = delegate { }; public event AvatarInterestUpdate OnAvatarInterestUpdate = delegate { };
public event PlacesQuery OnPlacesQuery = delegate { }; public event PlacesQuery OnPlacesQuery = delegate { };
public event FindAgentUpdate OnFindAgentEvent = delegate { }; public event FindAgentUpdate OnFindAgent = delegate { };
public event TrackAgentUpdate OnTrackAgentEvent = delegate { }; public event TrackAgentUpdate OnTrackAgent = delegate { };
public event NewUserReport OnUserReportEvent = delegate { }; public event NewUserReport OnUserReport = delegate { };
public event SaveStateHandler OnSaveStateEvent = delegate { }; public event SaveStateHandler OnSaveState = delegate { };
public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest = delegate { }; public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest = delegate { };
public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest = delegate { }; public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest = delegate { };
public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest = delegate { }; public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest = delegate { };
public event FreezeUserUpdate OnParcelFreezeUserEvent = delegate { }; public event FreezeUserUpdate OnParcelFreezeUser = delegate { };
public event EjectUserUpdate OnParcelEjectUserEvent = delegate { }; public event EjectUserUpdate OnParcelEjectUser = delegate { };
public event ParcelBuyPass OnParcelBuyPass = delegate { }; public event ParcelBuyPass OnParcelBuyPass = delegate { };
public event ParcelGodMark OnParcelGodMark = delegate { }; public event ParcelGodMark OnParcelGodMark = delegate { };
public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest = delegate { }; public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest = delegate { };
public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest = delegate { }; public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest = delegate { };
public event SimWideDeletesDelegate OnSimWideDeletes = delegate { }; public event SimWideDeletesDelegate OnSimWideDeletes = delegate { };
public event SendPostcard OnSendPostcard = delegate { }; public event SendPostcard OnSendPostcard = delegate { };
public event MuteListEntryUpdate OnUpdateMuteListEntryEvent = delegate { }; public event MuteListEntryUpdate OnUpdateMuteListEntry = delegate { };
public event MuteListEntryRemove OnRemoveMuteListEntryEvent = delegate { }; public event MuteListEntryRemove OnRemoveMuteListEntry = delegate { };
public event GodlikeMessage onGodlikeMessageEvent = delegate { }; public event GodlikeMessage onGodlikeMessage = delegate { };
public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent = delegate { }; public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate = delegate { };
@ -1196,5 +1196,13 @@ namespace OpenSim.Client.VWoHTTP.ClientStack
public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt)
{ {
} }
public void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes)
{
}
public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals)
{
}
} }
} }

View File

@ -82,7 +82,13 @@ namespace OpenSim.ConsoleClient
private static void SendCommand(string module, string[] cmd) private static void SendCommand(string module, string[] cmd)
{ {
string sendCmd = String.Join(" ", cmd); string sendCmd = cmd[0];
if (cmd.Length > 1)
{
Array.Copy(cmd, 1, cmd, 0, cmd.Length-1);
Array.Resize(ref cmd, cmd.Length-1);
sendCmd += "\"" + String.Join("\" \"", cmd) + "\"";
}
Requester.MakeRequest("http://"+m_Host+":"+m_Port.ToString()+"/SessionCommand/", String.Format("ID={0}&COMMAND={1}", m_SessionID, sendCmd), CommandReply); Requester.MakeRequest("http://"+m_Host+":"+m_Port.ToString()+"/SessionCommand/", String.Format("ID={0}&COMMAND={1}", m_SessionID, sendCmd), CommandReply);
} }

View File

@ -0,0 +1,83 @@
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using OpenMetaverse;
using OpenSim.Framework;
using Mono.Data.SqliteClient;
namespace OpenSim.Data.SQLite
{
/// <summary>
/// A database interface class to a user profile storage system
/// </summary>
public class SQLiteFramework
{
protected SqliteConnection m_Connection;
protected SQLiteFramework(string connectionString)
{
m_Connection = new SqliteConnection(connectionString);
m_Connection.Open();
}
//////////////////////////////////////////////////////////////
//
// All non queries are funneled through one connection
// to increase performance a little
//
protected int ExecuteNonQuery(SqliteCommand cmd)
{
lock (m_Connection)
{
cmd.Connection = m_Connection;
return cmd.ExecuteNonQuery();
}
}
protected IDataReader ExecuteReader(SqliteCommand cmd)
{
SqliteConnection newConnection =
(SqliteConnection)((ICloneable)m_Connection).Clone();
newConnection.Open();
cmd.Connection = newConnection;
return cmd.ExecuteReader();
}
protected void CloseReaderCommand(SqliteCommand cmd)
{
cmd.Connection.Close();
cmd.Connection.Dispose();
cmd.Dispose();
}
}
}

View File

@ -0,0 +1,253 @@
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Collections.Generic;
using System.Data;
using System.Reflection;
using log4net;
using Mono.Data.SqliteClient;
using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Region.Framework.Interfaces;
namespace OpenSim.Data.SQLite
{
public class SQLiteGenericTableHandler<T> : SQLiteFramework where T: class, new()
{
private static readonly ILog m_log =
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected Dictionary<string, FieldInfo> m_Fields =
new Dictionary<string, FieldInfo>();
protected List<string> m_ColumnNames = null;
protected string m_Realm;
protected FieldInfo m_DataField = null;
public SQLiteGenericTableHandler(string connectionString,
string realm, string storeName) : base(connectionString)
{
m_Realm = realm;
if (storeName != String.Empty)
{
Assembly assem = GetType().Assembly;
Migration m = new Migration(m_Connection, assem, storeName);
m.Update();
}
Type t = typeof(T);
FieldInfo[] fields = t.GetFields(BindingFlags.Public |
BindingFlags.Instance |
BindingFlags.DeclaredOnly);
if (fields.Length == 0)
return;
foreach (FieldInfo f in fields)
{
if (f.Name != "Data")
m_Fields[f.Name] = f;
else
m_DataField = f;
}
}
private void CheckColumnNames(IDataReader reader)
{
if (m_ColumnNames != null)
return;
m_ColumnNames = new List<string>();
DataTable schemaTable = reader.GetSchemaTable();
foreach (DataRow row in schemaTable.Rows)
{
if (row["ColumnName"] != null &&
(!m_Fields.ContainsKey(row["ColumnName"].ToString())))
m_ColumnNames.Add(row["ColumnName"].ToString());
}
}
public T[] Get(string field, string key)
{
return Get(new string[] { field }, new string[] { key });
}
public T[] Get(string[] fields, string[] keys)
{
if (fields.Length != keys.Length)
return new T[0];
List<string> terms = new List<string>();
SqliteCommand cmd = new SqliteCommand();
for (int i = 0 ; i < fields.Length ; i++)
{
cmd.Parameters.Add(new SqliteParameter(":" + fields[i], keys[i]));
terms.Add("`" + fields[i] + "` = :" + fields[i]);
}
string where = String.Join(" and ", terms.ToArray());
string query = String.Format("select * from {0} where {1}",
m_Realm, where);
cmd.CommandText = query;
return DoQuery(cmd);
}
protected T[] DoQuery(SqliteCommand cmd)
{
IDataReader reader = ExecuteReader(cmd);
if (reader == null)
return new T[0];
CheckColumnNames(reader);
List<T> result = new List<T>();
while (reader.Read())
{
T row = new T();
foreach (string name in m_Fields.Keys)
{
if (m_Fields[name].GetValue(row) is bool)
{
int v = Convert.ToInt32(reader[name]);
m_Fields[name].SetValue(row, v != 0 ? true : false);
}
else if (m_Fields[name].GetValue(row) is UUID)
{
UUID uuid = UUID.Zero;
UUID.TryParse(reader[name].ToString(), out uuid);
m_Fields[name].SetValue(row, uuid);
}
else if (m_Fields[name].GetValue(row) is int)
{
int v = Convert.ToInt32(reader[name]);
m_Fields[name].SetValue(row, v);
}
else
{
m_Fields[name].SetValue(row, reader[name]);
}
}
if (m_DataField != null)
{
Dictionary<string, string> data =
new Dictionary<string, string>();
foreach (string col in m_ColumnNames)
{
data[col] = reader[col].ToString();
if (data[col] == null)
data[col] = String.Empty;
}
m_DataField.SetValue(row, data);
}
result.Add(row);
}
CloseReaderCommand(cmd);
return result.ToArray();
}
public T[] Get(string where)
{
SqliteCommand cmd = new SqliteCommand();
string query = String.Format("select * from {0} where {1}",
m_Realm, where);
cmd.CommandText = query;
return DoQuery(cmd);
}
public bool Store(T row)
{
SqliteCommand cmd = new SqliteCommand();
string query = "";
List<String> names = new List<String>();
List<String> values = new List<String>();
foreach (FieldInfo fi in m_Fields.Values)
{
names.Add(fi.Name);
values.Add(":" + fi.Name);
cmd.Parameters.Add(new SqliteParameter(":" + fi.Name, fi.GetValue(row).ToString()));
}
if (m_DataField != null)
{
Dictionary<string, string> data =
(Dictionary<string, string>)m_DataField.GetValue(row);
foreach (KeyValuePair<string, string> kvp in data)
{
names.Add(kvp.Key);
values.Add(":" + kvp.Key);
cmd.Parameters.Add(new SqliteParameter(":" + kvp.Key, kvp.Value));
}
}
query = String.Format("replace into {0} (`", m_Realm) + String.Join("`,`", names.ToArray()) + "`) values (" + String.Join(",", values.ToArray()) + ")";
cmd.CommandText = query;
if (ExecuteNonQuery(cmd) > 0)
return true;
return false;
}
public bool Delete(string field, string val)
{
SqliteCommand cmd = new SqliteCommand();
cmd.CommandText = String.Format("delete from {0} where `{1}` = :{1}", m_Realm, field);
cmd.Parameters.Add(new SqliteParameter(field, val));
if (ExecuteNonQuery(cmd) > 0)
return true;
return false;
}
}
}

View File

@ -0,0 +1,156 @@
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Data;
using System.Reflection;
using System.Collections.Generic;
using Mono.Data.SqliteClient;
using log4net;
using OpenMetaverse;
using OpenSim.Framework;
namespace OpenSim.Data.SQLite
{
/// <summary>
/// A MySQL Interface for the Asset Server
/// </summary>
public class SQLiteXInventoryData : IXInventoryData
{
private static readonly ILog m_log = LogManager.GetLogger(
MethodBase.GetCurrentMethod().DeclaringType);
private SQLiteGenericTableHandler<XInventoryFolder> m_Folders;
private SqliteItemHandler m_Items;
public SQLiteXInventoryData(string conn, string realm)
{
m_Folders = new SQLiteGenericTableHandler<XInventoryFolder>(
conn, "inventoryfolders", "InventoryStore");
m_Items = new SqliteItemHandler(
conn, "inventoryitems", String.Empty);
}
public XInventoryFolder[] GetFolders(string[] fields, string[] vals)
{
return m_Folders.Get(fields, vals);
}
public XInventoryItem[] GetItems(string[] fields, string[] vals)
{
return m_Items.Get(fields, vals);
}
public bool StoreFolder(XInventoryFolder folder)
{
return m_Folders.Store(folder);
}
public bool StoreItem(XInventoryItem item)
{
return m_Items.Store(item);
}
public bool DeleteFolders(string field, string val)
{
return m_Folders.Delete(field, val);
}
public bool DeleteItems(string field, string val)
{
return m_Items.Delete(field, val);
}
public bool MoveItem(string id, string newParent)
{
return m_Items.MoveItem(id, newParent);
}
public XInventoryItem[] GetActiveGestures(UUID principalID)
{
return m_Items.GetActiveGestures(principalID);
}
public int GetAssetPermissions(UUID principalID, UUID assetID)
{
return m_Items.GetAssetPermissions(principalID, assetID);
}
}
public class SqliteItemHandler : SQLiteGenericTableHandler<XInventoryItem>
{
public SqliteItemHandler(string c, string t, string m) :
base(c, t, m)
{
}
public bool MoveItem(string id, string newParent)
{
SqliteCommand cmd = new SqliteCommand();
cmd.CommandText = String.Format("update {0} set parentFolderID = :ParentFolderID where inventoryID = :InventoryID", m_Realm);
cmd.Parameters.Add(new SqliteParameter(":ParentFolderID", newParent));
cmd.Parameters.Add(new SqliteParameter(":InventoryID", id));
return ExecuteNonQuery(cmd) == 0 ? false : true;
}
public XInventoryItem[] GetActiveGestures(UUID principalID)
{
SqliteCommand cmd = new SqliteCommand();
cmd.CommandText = String.Format("select * from inventoryitems where avatarId = :uuid and assetType = :type and flags = 1", m_Realm);
cmd.Parameters.Add(new SqliteParameter(":uuid", principalID.ToString()));
cmd.Parameters.Add(new SqliteParameter(":type", (int)AssetType.Gesture));
return DoQuery(cmd);
}
public int GetAssetPermissions(UUID principalID, UUID assetID)
{
SqliteCommand cmd = new SqliteCommand();
cmd.CommandText = String.Format("select inventoryCurrentPermissions from inventoryitems where avatarID = :PrincipalID and assetID = :AssetID", m_Realm);
cmd.Parameters.Add(new SqliteParameter(":PrincipalID", principalID.ToString()));
cmd.Parameters.Add(new SqliteParameter(":AssetID", assetID.ToString()));
IDataReader reader = ExecuteReader(cmd);
int perms = 0;
while (reader.Read())
{
perms |= Convert.ToInt32(reader["inventoryCurrentPermissions"]);
}
reader.Close();
CloseReaderCommand(cmd);
return perms;
}
}
}

View File

@ -552,8 +552,9 @@ namespace OpenSim.Framework.Console
} }
} }
// A console that processes commands internally /// <summary>
// /// A console that processes commands internally
/// </summary>
public class CommandConsole : ConsoleBase public class CommandConsole : ConsoleBase
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@ -574,6 +575,9 @@ namespace OpenSim.Framework.Console
Output(s); Output(s);
} }
/// <summary>
/// Display a command prompt on the console and wait for user input
/// </summary>
public void Prompt() public void Prompt()
{ {
string line = ReadLine(m_defaultPrompt + "# ", true, true); string line = ReadLine(m_defaultPrompt + "# ", true, true);

View File

@ -36,8 +36,9 @@ using log4net;
namespace OpenSim.Framework.Console namespace OpenSim.Framework.Console
{ {
// A console that uses cursor control and color /// <summary>
// /// A console that uses cursor control and color
/// </summary>
public class LocalConsole : CommandConsole public class LocalConsole : CommandConsole
{ {
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@ -85,31 +86,71 @@ namespace OpenSim.Framework.Console
history.Add(text); history.Add(text);
} }
/// <summary>
/// Set the cursor row.
/// </summary>
///
/// <param name="top">
/// 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
/// then it is set to one less than the height.
/// </param>
/// <returns>
/// The new cursor row.
/// </returns>
private int SetCursorTop(int top) private int SetCursorTop(int top)
{ {
if (top >= 0 && top < System.Console.BufferHeight) // From at least mono 2.4.2.3, window resizing can give mono an invalid row and column values. If we try
{ // to set a cursor row position with a currently invalid column, mono will throw an exception.
// Therefore, we need to make sure that the column position is valid first.
int left = System.Console.CursorLeft;
if (left < 0)
System.Console.CursorLeft = 0;
else if (left >= System.Console.BufferWidth)
System.Console.CursorLeft = System.Console.BufferWidth - 1;
if (top < 0)
top = 0;
if (top >= System.Console.BufferHeight)
top = System.Console.BufferHeight - 1;
System.Console.CursorTop = top; System.Console.CursorTop = top;
return top; return top;
} }
else
{
return System.Console.CursorTop;
}
}
/// <summary>
/// Set the cursor column.
/// </summary>
///
/// <param name="left">
/// 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
/// then it is set to one less than the width.
/// </param>
/// <returns>
/// The new cursor column.
/// </returns>
private int SetCursorLeft(int left) private int SetCursorLeft(int left)
{ {
if (left >= 0 && left < System.Console.BufferWidth) // From at least mono 2.4.2.3, window resizing can give mono an invalid row and column values. If we try
{ // to set a cursor column position with a currently invalid row, mono will throw an exception.
// Therefore, we need to make sure that the row position is valid first.
int top = System.Console.CursorTop;
if (top < 0)
System.Console.CursorTop = 0;
else if (top >= System.Console.BufferHeight)
System.Console.CursorTop = System.Console.BufferHeight - 1;
if (left < 0)
left = 0;
if (left >= System.Console.BufferWidth)
left = System.Console.BufferWidth - 1;
System.Console.CursorLeft = left; System.Console.CursorLeft = left;
return left; return left;
} }
else
{
return System.Console.CursorLeft;
}
}
private void Show() private void Show()
{ {
@ -128,21 +169,21 @@ namespace OpenSim.Framework.Console
{ {
y--; y--;
new_y--; new_y--;
System.Console.CursorLeft = 0; SetCursorLeft(0);
System.Console.CursorTop = System.Console.BufferHeight-1; SetCursorTop(System.Console.BufferHeight - 1);
System.Console.WriteLine(" "); System.Console.WriteLine(" ");
} }
y = SetCursorTop(y); y = SetCursorTop(y);
System.Console.CursorLeft = 0; SetCursorLeft(0);
if (echo) if (echo)
System.Console.Write("{0}{1}", prompt, cmdline); System.Console.Write("{0}{1}", prompt, cmdline);
else else
System.Console.Write("{0}", prompt); System.Console.Write("{0}", prompt);
SetCursorLeft(new_x);
SetCursorTop(new_y); SetCursorTop(new_y);
SetCursorLeft(new_x);
} }
} }
@ -162,8 +203,7 @@ namespace OpenSim.Framework.Console
System.Console.Write(" "); System.Console.Write(" ");
y = SetCursorTop(y); y = SetCursorTop(y);
System.Console.CursorLeft = 0; SetCursorLeft(0);
} }
} }
catch (Exception) catch (Exception)
@ -252,7 +292,7 @@ namespace OpenSim.Framework.Console
} }
y = SetCursorTop(y); y = SetCursorTop(y);
System.Console.CursorLeft = 0; SetCursorLeft(0);
int count = cmdline.Length + prompt.Length; int count = cmdline.Length + prompt.Length;
@ -260,7 +300,7 @@ namespace OpenSim.Framework.Console
System.Console.Write(" "); System.Console.Write(" ");
y = SetCursorTop(y); y = SetCursorTop(y);
System.Console.CursorLeft = 0; SetCursorLeft(0);
WriteLocalText(text, level); WriteLocalText(text, level);
@ -299,7 +339,7 @@ namespace OpenSim.Framework.Console
echo = e; echo = e;
int historyLine = history.Count; int historyLine = history.Count;
System.Console.CursorLeft = 0; // Needed for mono SetCursorLeft(0); // Needed for mono
System.Console.Write(" "); // Needed for mono System.Console.Write(" "); // Needed for mono
lock (cmdline) lock (cmdline)
@ -339,7 +379,7 @@ namespace OpenSim.Framework.Console
cmdline.Remove(cp-1, 1); cmdline.Remove(cp-1, 1);
cp--; cp--;
System.Console.CursorLeft = 0; SetCursorLeft(0);
y = SetCursorTop(y); y = SetCursorTop(y);
System.Console.Write("{0}{1} ", prompt, cmdline); System.Console.Write("{0}{1} ", prompt, cmdline);
@ -387,7 +427,7 @@ namespace OpenSim.Framework.Console
cp++; cp++;
break; break;
case ConsoleKey.Enter: case ConsoleKey.Enter:
System.Console.CursorLeft = 0; SetCursorLeft(0);
y = SetCursorTop(y); y = SetCursorTop(y);
System.Console.WriteLine("{0}{1}", prompt, cmdline); System.Console.WriteLine("{0}{1}", prompt, cmdline);

View File

@ -135,4 +135,30 @@ namespace OpenSim.Framework
public bool HasAttachment; public bool HasAttachment;
public byte AssetType; public byte AssetType;
} }
public struct GroupVoteHistory
{
public string VoteID;
public string VoteInitiator;
public string Majority;
public string Quorum;
public string TerseDateID;
public string StartDateTime;
public string EndDateTime;
public string VoteType;
public string VoteResult;
public string ProposalText;
}
public struct GroupActiveProposals
{
public string VoteID;
public string VoteInitiator;
public string Majority;
public string Quorum;
public string TerseDateID;
public string StartDateTime;
public string EndDateTime;
public string ProposalText;
}
} }

View File

@ -467,7 +467,7 @@ namespace OpenSim.Framework
public delegate void EjectUserUpdate(IClientAPI client, UUID parcelowner,uint flags, UUID target); public delegate void EjectUserUpdate(IClientAPI client, UUID parcelowner,uint flags, UUID target);
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); 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);
public delegate void GodUpdateRegionInfoUpdate(IClientAPI client, float BillableFactor, ulong EstateID, ulong RegionFlags, byte[] SimName,int RedirectX, int RedirectY); public delegate void GodUpdateRegionInfoUpdate(IClientAPI client, float BillableFactor, ulong EstateID, ulong RegionFlags, byte[] SimName,int RedirectX, int RedirectY);
@ -1069,25 +1069,25 @@ namespace OpenSim.Framework
event PlacesQuery OnPlacesQuery; event PlacesQuery OnPlacesQuery;
event FindAgentUpdate OnFindAgentEvent; event FindAgentUpdate OnFindAgent;
event TrackAgentUpdate OnTrackAgentEvent; event TrackAgentUpdate OnTrackAgent;
event NewUserReport OnUserReportEvent; event NewUserReport OnUserReport;
event SaveStateHandler OnSaveStateEvent; event SaveStateHandler OnSaveState;
event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; event GroupAccountSummaryRequest OnGroupAccountSummaryRequest;
event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; event GroupAccountDetailsRequest OnGroupAccountDetailsRequest;
event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest;
event FreezeUserUpdate OnParcelFreezeUserEvent; event FreezeUserUpdate OnParcelFreezeUser;
event EjectUserUpdate OnParcelEjectUserEvent; event EjectUserUpdate OnParcelEjectUser;
event ParcelBuyPass OnParcelBuyPass; event ParcelBuyPass OnParcelBuyPass;
event ParcelGodMark OnParcelGodMark; event ParcelGodMark OnParcelGodMark;
event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; event GroupActiveProposalsRequest OnGroupActiveProposalsRequest;
event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; event GroupVoteHistoryRequest OnGroupVoteHistoryRequest;
event SimWideDeletesDelegate OnSimWideDeletes; event SimWideDeletesDelegate OnSimWideDeletes;
event SendPostcard OnSendPostcard; event SendPostcard OnSendPostcard;
event MuteListEntryUpdate OnUpdateMuteListEntryEvent; event MuteListEntryUpdate OnUpdateMuteListEntry;
event MuteListEntryRemove OnRemoveMuteListEntryEvent; event MuteListEntryRemove OnRemoveMuteListEntry;
event GodlikeMessage onGodlikeMessageEvent; event GodlikeMessage onGodlikeMessage;
event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent; event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate;
/// <summary> /// <summary>
/// Set the debug level at which packet output should be printed to console. /// Set the debug level at which packet output should be printed to console.
@ -1446,8 +1446,13 @@ namespace OpenSim.Framework
void SendUserInfoReply(bool imViaEmail, bool visible, string email); void SendUserInfoReply(bool imViaEmail, bool visible, string email);
void SendUseCachedMuteList(); void SendUseCachedMuteList();
void SendMuteListUpdate(string filename); void SendMuteListUpdate(string filename);
void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals);
void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes);
void KillEndDone(); void KillEndDone();
bool AddGenericPacketHandler(string MethodName, GenericMessage handler); bool AddGenericPacketHandler(string MethodName, GenericMessage handler);

View File

@ -298,25 +298,25 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public event AvatarInterestUpdate OnAvatarInterestUpdate; public event AvatarInterestUpdate OnAvatarInterestUpdate;
public event PlacesQuery OnPlacesQuery; public event PlacesQuery OnPlacesQuery;
public event AgentFOV OnAgentFOV; public event AgentFOV OnAgentFOV;
public event FindAgentUpdate OnFindAgentEvent; public event FindAgentUpdate OnFindAgent;
public event TrackAgentUpdate OnTrackAgentEvent; public event TrackAgentUpdate OnTrackAgent;
public event NewUserReport OnUserReportEvent; public event NewUserReport OnUserReport;
public event SaveStateHandler OnSaveStateEvent; public event SaveStateHandler OnSaveState;
public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest;
public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest;
public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest;
public event FreezeUserUpdate OnParcelFreezeUserEvent; public event FreezeUserUpdate OnParcelFreezeUser;
public event EjectUserUpdate OnParcelEjectUserEvent; public event EjectUserUpdate OnParcelEjectUser;
public event ParcelBuyPass OnParcelBuyPass; public event ParcelBuyPass OnParcelBuyPass;
public event ParcelGodMark OnParcelGodMark; public event ParcelGodMark OnParcelGodMark;
public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest;
public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest;
public event SimWideDeletesDelegate OnSimWideDeletes; public event SimWideDeletesDelegate OnSimWideDeletes;
public event SendPostcard OnSendPostcard; public event SendPostcard OnSendPostcard;
public event MuteListEntryUpdate OnUpdateMuteListEntryEvent; public event MuteListEntryUpdate OnUpdateMuteListEntry;
public event MuteListEntryRemove OnRemoveMuteListEntryEvent; public event MuteListEntryRemove OnRemoveMuteListEntry;
public event GodlikeMessage onGodlikeMessageEvent; public event GodlikeMessage onGodlikeMessage;
public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent; public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate;
#endregion Events #endregion Events
@ -826,36 +826,38 @@ namespace OpenSim.Region.ClientStack.LindenUDP
OutPacket(gmp, ThrottleOutPacketType.Task); OutPacket(gmp, ThrottleOutPacketType.Task);
} }
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) public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals)
{ {
foreach (KeyValuePair<int, string> Blank in VoteID) int i = 0;
foreach (GroupActiveProposals Proposal in Proposals)
{ {
GroupActiveProposalItemReplyPacket GAPIRP = new GroupActiveProposalItemReplyPacket(); GroupActiveProposalItemReplyPacket GAPIRP = new GroupActiveProposalItemReplyPacket();
GAPIRP.AgentData.AgentID = agentID; GAPIRP.AgentData.AgentID = AgentId;
GAPIRP.AgentData.GroupID = groupID; GAPIRP.AgentData.GroupID = groupID;
GAPIRP.TransactionData.TransactionID = transactionID; GAPIRP.TransactionData.TransactionID = transactionID;
GAPIRP.TransactionData.TotalNumItems = 1; GAPIRP.TransactionData.TotalNumItems = ((uint)i+1);
GroupActiveProposalItemReplyPacket.ProposalDataBlock ProposalData = new GroupActiveProposalItemReplyPacket.ProposalDataBlock(); GroupActiveProposalItemReplyPacket.ProposalDataBlock ProposalData = new GroupActiveProposalItemReplyPacket.ProposalDataBlock();
GAPIRP.ProposalData = new GroupActiveProposalItemReplyPacket.ProposalDataBlock[1]; GAPIRP.ProposalData = new GroupActiveProposalItemReplyPacket.ProposalDataBlock[1];
ProposalData.VoteCast = Utils.StringToBytes("false"); ProposalData.VoteCast = Utils.StringToBytes("false");
ProposalData.VoteID = new UUID(VoteID[Blank.Key]); ProposalData.VoteID = new UUID(Proposal.VoteID);
ProposalData.VoteInitiator = new UUID(VoteInitiator[Blank.Key]); ProposalData.VoteInitiator = new UUID(Proposal.VoteInitiator);
ProposalData.Majority = (float)Convert.ToInt32(Majority[Blank.Key]); ProposalData.Majority = (float)Convert.ToInt32(Proposal.Majority);
ProposalData.Quorum = Convert.ToInt32(Quorum[Blank.Key]); ProposalData.Quorum = Convert.ToInt32(Proposal.Quorum);
ProposalData.TerseDateID = Utils.StringToBytes(TerseDateID[Blank.Key]); ProposalData.TerseDateID = Utils.StringToBytes(Proposal.TerseDateID);
ProposalData.StartDateTime = Utils.StringToBytes(StartDateTime[Blank.Key]); ProposalData.StartDateTime = Utils.StringToBytes(Proposal.StartDateTime);
ProposalData.EndDateTime = Utils.StringToBytes(EndDateTime[Blank.Key]); ProposalData.EndDateTime = Utils.StringToBytes(Proposal.EndDateTime);
ProposalData.ProposalText = Utils.StringToBytes(ProposalText[Blank.Key]); ProposalData.ProposalText = Utils.StringToBytes(Proposal.ProposalText);
ProposalData.AlreadyVoted = false; ProposalData.AlreadyVoted = false;
GAPIRP.ProposalData[0] = ProposalData; GAPIRP.ProposalData[i] = ProposalData;
OutPacket(GAPIRP, ThrottleOutPacketType.Task); OutPacket(GAPIRP, ThrottleOutPacketType.Task);
i++;
} }
if (VoteID.Count == 0) if (Proposals.Length == 0)
{ {
GroupActiveProposalItemReplyPacket GAPIRP = new GroupActiveProposalItemReplyPacket(); GroupActiveProposalItemReplyPacket GAPIRP = new GroupActiveProposalItemReplyPacket();
GAPIRP.AgentData.AgentID = agentID; GAPIRP.AgentData.AgentID = AgentId;
GAPIRP.AgentData.GroupID = groupID; GAPIRP.AgentData.GroupID = groupID;
GAPIRP.TransactionData.TransactionID = transactionID; GAPIRP.TransactionData.TransactionID = transactionID;
GAPIRP.TransactionData.TotalNumItems = 1; GAPIRP.TransactionData.TotalNumItems = 1;
@ -876,39 +878,41 @@ namespace OpenSim.Region.ClientStack.LindenUDP
} }
} }
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) public void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes)
{ {
foreach (KeyValuePair<int, string> Blank in VoteID) int i = 0;
foreach (GroupVoteHistory Vote in Votes)
{ {
GroupVoteHistoryItemReplyPacket GVHIRP = new GroupVoteHistoryItemReplyPacket(); GroupVoteHistoryItemReplyPacket GVHIRP = new GroupVoteHistoryItemReplyPacket();
GVHIRP.AgentData.AgentID = agentID; GVHIRP.AgentData.AgentID = AgentId;
GVHIRP.AgentData.GroupID = groupID; GVHIRP.AgentData.GroupID = groupID;
GVHIRP.TransactionData.TransactionID = transactionID; GVHIRP.TransactionData.TransactionID = transactionID;
GVHIRP.TransactionData.TotalNumItems = 1; GVHIRP.TransactionData.TotalNumItems = ((uint)i+1);
GVHIRP.HistoryItemData.VoteID = new UUID(VoteID[Blank.Key]); GVHIRP.HistoryItemData.VoteID = new UUID(Vote.VoteID);
GVHIRP.HistoryItemData.VoteInitiator = new UUID(VoteInitiator[Blank.Key]); GVHIRP.HistoryItemData.VoteInitiator = new UUID(Vote.VoteInitiator);
GVHIRP.HistoryItemData.Majority = (float)Convert.ToInt32(Majority[Blank.Key]); GVHIRP.HistoryItemData.Majority = (float)Convert.ToInt32(Vote.Majority);
GVHIRP.HistoryItemData.Quorum = Convert.ToInt32(Quorum[Blank.Key]); GVHIRP.HistoryItemData.Quorum = Convert.ToInt32(Vote.Quorum);
GVHIRP.HistoryItemData.TerseDateID = Utils.StringToBytes(TerseDateID[Blank.Key]); GVHIRP.HistoryItemData.TerseDateID = Utils.StringToBytes(Vote.TerseDateID);
GVHIRP.HistoryItemData.StartDateTime = Utils.StringToBytes(StartDateTime[Blank.Key]); GVHIRP.HistoryItemData.StartDateTime = Utils.StringToBytes(Vote.StartDateTime);
GVHIRP.HistoryItemData.EndDateTime = Utils.StringToBytes(EndDateTime[Blank.Key]); GVHIRP.HistoryItemData.EndDateTime = Utils.StringToBytes(Vote.EndDateTime);
GVHIRP.HistoryItemData.VoteType = Utils.StringToBytes(VoteType[Blank.Key]); GVHIRP.HistoryItemData.VoteType = Utils.StringToBytes(Vote.VoteType);
GVHIRP.HistoryItemData.VoteResult = Utils.StringToBytes(VoteResult[Blank.Key]); GVHIRP.HistoryItemData.VoteResult = Utils.StringToBytes(Vote.VoteResult);
GVHIRP.HistoryItemData.ProposalText = Utils.StringToBytes(ProposalText[Blank.Key]); GVHIRP.HistoryItemData.ProposalText = Utils.StringToBytes(Vote.ProposalText);
GroupVoteHistoryItemReplyPacket.VoteItemBlock VoteItem = new GroupVoteHistoryItemReplyPacket.VoteItemBlock(); GroupVoteHistoryItemReplyPacket.VoteItemBlock VoteItem = new GroupVoteHistoryItemReplyPacket.VoteItemBlock();
GVHIRP.VoteItem = new GroupVoteHistoryItemReplyPacket.VoteItemBlock[1]; GVHIRP.VoteItem = new GroupVoteHistoryItemReplyPacket.VoteItemBlock[1];
VoteItem.CandidateID = UUID.Zero; VoteItem.CandidateID = UUID.Zero;
VoteItem.NumVotes = 0; //TODO: FIX THIS!!! VoteItem.NumVotes = 0; //TODO: FIX THIS!!!
VoteItem.VoteCast = Utils.StringToBytes("Yes"); VoteItem.VoteCast = Utils.StringToBytes("Yes");
GVHIRP.VoteItem[0] = VoteItem; GVHIRP.VoteItem[i] = VoteItem;
OutPacket(GVHIRP, ThrottleOutPacketType.Task); OutPacket(GVHIRP, ThrottleOutPacketType.Task);
i++;
} }
if (VoteID.Count == 0) if (Votes.Length == 0)
{ {
GroupVoteHistoryItemReplyPacket GVHIRP = new GroupVoteHistoryItemReplyPacket(); GroupVoteHistoryItemReplyPacket GVHIRP = new GroupVoteHistoryItemReplyPacket();
GVHIRP.AgentData.AgentID = agentID; GVHIRP.AgentData.AgentID = AgentId;
GVHIRP.AgentData.GroupID = groupID; GVHIRP.AgentData.GroupID = groupID;
GVHIRP.TransactionData.TransactionID = transactionID; GVHIRP.TransactionData.TransactionID = transactionID;
GVHIRP.TransactionData.TotalNumItems = 0; GVHIRP.TransactionData.TotalNumItems = 0;
@ -4876,7 +4880,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{ {
FreezeUserPacket FreezeUser = (FreezeUserPacket)Packet; FreezeUserPacket FreezeUser = (FreezeUserPacket)Packet;
FreezeUserUpdate FreezeUserHandler = OnParcelFreezeUserEvent; FreezeUserUpdate FreezeUserHandler = OnParcelFreezeUser;
if (FreezeUserHandler != null) if (FreezeUserHandler != null)
{ {
FreezeUserHandler(this, FreezeUserHandler(this,
@ -4893,7 +4897,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
EjectUserPacket EjectUser = EjectUserPacket EjectUser =
(EjectUserPacket)Packet; (EjectUserPacket)Packet;
EjectUserUpdate EjectUserHandler = OnParcelEjectUserEvent; EjectUserUpdate EjectUserHandler = OnParcelEjectUser;
if (EjectUserHandler != null) if (EjectUserHandler != null)
{ {
EjectUserHandler(this, EjectUserHandler(this,
@ -5292,7 +5296,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
FindAgentPacket FindAgent = FindAgentPacket FindAgent =
(FindAgentPacket)Packet; (FindAgentPacket)Packet;
FindAgentUpdate FindAgentHandler = OnFindAgentEvent; FindAgentUpdate FindAgentHandler = OnFindAgent;
if (FindAgentHandler != null) if (FindAgentHandler != null)
{ {
FindAgentHandler(this,FindAgent.AgentBlock.Hunter,FindAgent.AgentBlock.Prey); FindAgentHandler(this,FindAgent.AgentBlock.Hunter,FindAgent.AgentBlock.Prey);
@ -5306,7 +5310,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
TrackAgentPacket TrackAgent = TrackAgentPacket TrackAgent =
(TrackAgentPacket)Packet; (TrackAgentPacket)Packet;
TrackAgentUpdate TrackAgentHandler = OnTrackAgentEvent; TrackAgentUpdate TrackAgentHandler = OnTrackAgent;
if (TrackAgentHandler != null) if (TrackAgentHandler != null)
{ {
TrackAgentHandler(this, TrackAgentHandler(this,
@ -8592,7 +8596,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
GodUpdateRegionInfoPacket GodUpdateRegionInfo = GodUpdateRegionInfoPacket GodUpdateRegionInfo =
(GodUpdateRegionInfoPacket)Packet; (GodUpdateRegionInfoPacket)Packet;
GodUpdateRegionInfoUpdate handlerGodUpdateRegionInfo = OnGodUpdateRegionInfoUpdateEvent; GodUpdateRegionInfoUpdate handlerGodUpdateRegionInfo = OnGodUpdateRegionInfoUpdate;
if (handlerGodUpdateRegionInfo != null) if (handlerGodUpdateRegionInfo != null)
{ {
handlerGodUpdateRegionInfo(this, handlerGodUpdateRegionInfo(this,
@ -8625,7 +8629,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
GodlikeMessagePacket GodlikeMessage = GodlikeMessagePacket GodlikeMessage =
(GodlikeMessagePacket)Packet; (GodlikeMessagePacket)Packet;
GodlikeMessage handlerGodlikeMessage = onGodlikeMessageEvent; GodlikeMessage handlerGodlikeMessage = onGodlikeMessage;
if (handlerGodlikeMessage != null) if (handlerGodlikeMessage != null)
{ {
handlerGodlikeMessage(this, handlerGodlikeMessage(this,
@ -8641,7 +8645,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{ {
StateSavePacket SaveStateMessage = StateSavePacket SaveStateMessage =
(StateSavePacket)Packet; (StateSavePacket)Packet;
SaveStateHandler handlerSaveStatePacket = OnSaveStateEvent; SaveStateHandler handlerSaveStatePacket = OnSaveState;
if (handlerSaveStatePacket != null) if (handlerSaveStatePacket != null)
{ {
handlerSaveStatePacket(this,SaveStateMessage.AgentData.AgentID); handlerSaveStatePacket(this,SaveStateMessage.AgentData.AgentID);
@ -9005,7 +9009,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{ {
UpdateMuteListEntryPacket UpdateMuteListEntry = UpdateMuteListEntryPacket UpdateMuteListEntry =
(UpdateMuteListEntryPacket)Packet; (UpdateMuteListEntryPacket)Packet;
MuteListEntryUpdate handlerUpdateMuteListEntry = OnUpdateMuteListEntryEvent; MuteListEntryUpdate handlerUpdateMuteListEntry = OnUpdateMuteListEntry;
if (handlerUpdateMuteListEntry != null) if (handlerUpdateMuteListEntry != null)
{ {
handlerUpdateMuteListEntry(this, UpdateMuteListEntry.MuteData.MuteID, handlerUpdateMuteListEntry(this, UpdateMuteListEntry.MuteData.MuteID,
@ -9021,7 +9025,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{ {
RemoveMuteListEntryPacket RemoveMuteListEntry = RemoveMuteListEntryPacket RemoveMuteListEntry =
(RemoveMuteListEntryPacket)Packet; (RemoveMuteListEntryPacket)Packet;
MuteListEntryRemove handlerRemoveMuteListEntry = OnRemoveMuteListEntryEvent; MuteListEntryRemove handlerRemoveMuteListEntry = OnRemoveMuteListEntry;
if (handlerRemoveMuteListEntry != null) if (handlerRemoveMuteListEntry != null)
{ {
handlerRemoveMuteListEntry(this, handlerRemoveMuteListEntry(this,
@ -9038,7 +9042,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
UserReportPacket UserReport = UserReportPacket UserReport =
(UserReportPacket)Packet; (UserReportPacket)Packet;
NewUserReport handlerUserReport = OnUserReportEvent; NewUserReport handlerUserReport = OnUserReport;
if (handlerUserReport != null) if (handlerUserReport != null)
{ {
handlerUserReport(this, handlerUserReport(this,

View File

@ -397,8 +397,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
client.OnLogout += OnLogout; client.OnLogout += OnLogout;
client.OnGrantUserRights += GrantUserFriendRights; client.OnGrantUserRights += GrantUserFriendRights;
client.OnTrackAgentEvent += FindAgent; client.OnTrackAgent += FindAgent;
client.OnFindAgentEvent += FindAgent; client.OnFindAgent += FindAgent;
} }

View File

@ -47,6 +47,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
private bool enabled = true; private bool enabled = true;
private List<Scene> m_SceneList = new List<Scene>(); private List<Scene> m_SceneList = new List<Scene>();
private string m_RestURL = String.Empty; private string m_RestURL = String.Empty;
private bool m_ForwardOfflineGroupMessages = true;
public void Initialise(Scene scene, IConfigSource config) public void Initialise(Scene scene, IConfigSource config)
{ {
@ -67,6 +68,9 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
return; return;
} }
if (cnf != null)
m_ForwardOfflineGroupMessages = cnf.GetBoolean("ForwardOfflineGroupMessages", m_ForwardOfflineGroupMessages);
lock (m_SceneList) lock (m_SceneList)
{ {
if (m_SceneList.Count == 0) if (m_SceneList.Count == 0)
@ -185,7 +189,8 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
private void UndeliveredMessage(GridInstantMessage im) private void UndeliveredMessage(GridInstantMessage im)
{ {
if (im.offline != 0) if ((im.offline != 0)
&& (!im.fromGroup || (im.fromGroup && m_ForwardOfflineGroupMessages)))
{ {
bool success = SynchronousRestObjectPoster.BeginPostObject<GridInstantMessage, bool>( bool success = SynchronousRestObjectPoster.BeginPostObject<GridInstantMessage, bool>(
"POST", m_RestURL+"/SaveMessage/", im); "POST", m_RestURL+"/SaveMessage/", im);

View File

@ -274,25 +274,25 @@ namespace OpenSim.Region.Examples.SimpleModule
public event PlacesQuery OnPlacesQuery; public event PlacesQuery OnPlacesQuery;
public event FindAgentUpdate OnFindAgentEvent; public event FindAgentUpdate OnFindAgent;
public event TrackAgentUpdate OnTrackAgentEvent; public event TrackAgentUpdate OnTrackAgent;
public event NewUserReport OnUserReportEvent; public event NewUserReport OnUserReport;
public event SaveStateHandler OnSaveStateEvent; public event SaveStateHandler OnSaveState;
public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest;
public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest;
public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest;
public event FreezeUserUpdate OnParcelFreezeUserEvent; public event FreezeUserUpdate OnParcelFreezeUser;
public event EjectUserUpdate OnParcelEjectUserEvent; public event EjectUserUpdate OnParcelEjectUser;
public event ParcelBuyPass OnParcelBuyPass; public event ParcelBuyPass OnParcelBuyPass;
public event ParcelGodMark OnParcelGodMark; public event ParcelGodMark OnParcelGodMark;
public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest;
public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest;
public event SimWideDeletesDelegate OnSimWideDeletes; public event SimWideDeletesDelegate OnSimWideDeletes;
public event SendPostcard OnSendPostcard; public event SendPostcard OnSendPostcard;
public event MuteListEntryUpdate OnUpdateMuteListEntryEvent; public event MuteListEntryUpdate OnUpdateMuteListEntry;
public event MuteListEntryRemove OnRemoveMuteListEntryEvent; public event MuteListEntryRemove OnRemoveMuteListEntry;
public event GodlikeMessage onGodlikeMessageEvent; public event GodlikeMessage onGodlikeMessage;
public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent; public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate;
#pragma warning restore 67 #pragma warning restore 67
@ -1135,5 +1135,13 @@ namespace OpenSim.Region.Examples.SimpleModule
public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt)
{ {
} }
public void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes)
{
}
public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals)
{
}
} }
} }

View File

@ -141,6 +141,15 @@ namespace OpenSim.Region.Framework.Scenes
[XmlIgnore] [XmlIgnore]
public UUID FromItemID; public UUID FromItemID;
[XmlIgnore]
public int STATUS_ROTATE_X;
[XmlIgnore]
public int STATUS_ROTATE_Y;
[XmlIgnore]
public int STATUS_ROTATE_Z;
[XmlIgnore] [XmlIgnore]
private Dictionary<int, string> m_CollisionFilter = new Dictionary<int, string>(); private Dictionary<int, string> m_CollisionFilter = new Dictionary<int, string>();
@ -1677,6 +1686,19 @@ namespace OpenSim.Region.Framework.Scenes
return m_parentGroup.RootPart.DIE_AT_EDGE; return m_parentGroup.RootPart.DIE_AT_EDGE;
} }
public int GetAxisRotation(int axis)
{
//Cannot use ScriptBaseClass constants as no referance to it currently.
if (axis == 2)//STATUS_ROTATE_X
return STATUS_ROTATE_X;
if (axis == 4)//STATUS_ROTATE_Y
return STATUS_ROTATE_Y;
if (axis == 8)//STATUS_ROTATE_Z
return STATUS_ROTATE_Z;
return 0;
}
public double GetDistanceTo(Vector3 a, Vector3 b) public double GetDistanceTo(Vector3 a, Vector3 b)
{ {
float dx = a.X - b.X; float dx = a.X - b.X;
@ -1953,7 +1975,7 @@ namespace OpenSim.Region.Framework.Scenes
if (av.LocalId == localId) if (av.LocalId == localId)
{ {
if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.Name))
{ {
bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
//If it is 1, it is to accept ONLY collisions from this avatar //If it is 1, it is to accept ONLY collisions from this avatar
@ -1979,7 +2001,7 @@ namespace OpenSim.Region.Framework.Scenes
{ {
bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
//If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work
if (found) if (!found)
{ {
DetectedObject detobj = new DetectedObject(); DetectedObject detobj = new DetectedObject();
detobj.keyUUID = av.UUID; detobj.keyUUID = av.UUID;
@ -2089,7 +2111,7 @@ namespace OpenSim.Region.Framework.Scenes
if (av.LocalId == localId) if (av.LocalId == localId)
{ {
if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.Name))
{ {
bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
//If it is 1, it is to accept ONLY collisions from this avatar //If it is 1, it is to accept ONLY collisions from this avatar
@ -2115,7 +2137,7 @@ namespace OpenSim.Region.Framework.Scenes
{ {
bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
//If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work
if (found) if (!found)
{ {
DetectedObject detobj = new DetectedObject(); DetectedObject detobj = new DetectedObject();
detobj.keyUUID = av.UUID; detobj.keyUUID = av.UUID;
@ -2220,7 +2242,7 @@ namespace OpenSim.Region.Framework.Scenes
if (av.LocalId == localId) if (av.LocalId == localId)
{ {
if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.Name))
{ {
bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
//If it is 1, it is to accept ONLY collisions from this avatar //If it is 1, it is to accept ONLY collisions from this avatar
@ -2246,7 +2268,7 @@ namespace OpenSim.Region.Framework.Scenes
{ {
bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
//If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work
if (found) if (!found)
{ {
DetectedObject detobj = new DetectedObject(); DetectedObject detobj = new DetectedObject();
detobj.keyUUID = av.UUID; detobj.keyUUID = av.UUID;
@ -2748,6 +2770,13 @@ namespace OpenSim.Region.Framework.Scenes
{ {
m_parentGroup.SetAxisRotation(axis, rotate); m_parentGroup.SetAxisRotation(axis, rotate);
} }
//Cannot use ScriptBaseClass constants as no referance to it currently.
if (axis == 2)//STATUS_ROTATE_X
STATUS_ROTATE_X = rotate;
if (axis == 4)//STATUS_ROTATE_Y
STATUS_ROTATE_Y = rotate;
if (axis == 8)//STATUS_ROTATE_Z
STATUS_ROTATE_Z = rotate;
} }
public void SetBuoyancy(float fvalue) public void SetBuoyancy(float fvalue)

View File

@ -836,25 +836,25 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
public event MuteListRequest OnMuteListRequest; public event MuteListRequest OnMuteListRequest;
public event AvatarInterestUpdate OnAvatarInterestUpdate; public event AvatarInterestUpdate OnAvatarInterestUpdate;
public event PlacesQuery OnPlacesQuery; public event PlacesQuery OnPlacesQuery;
public event FindAgentUpdate OnFindAgentEvent; public event FindAgentUpdate OnFindAgent;
public event TrackAgentUpdate OnTrackAgentEvent; public event TrackAgentUpdate OnTrackAgent;
public event NewUserReport OnUserReportEvent; public event NewUserReport OnUserReport;
public event SaveStateHandler OnSaveStateEvent; public event SaveStateHandler OnSaveState;
public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest;
public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest;
public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest;
public event FreezeUserUpdate OnParcelFreezeUserEvent; public event FreezeUserUpdate OnParcelFreezeUser;
public event EjectUserUpdate OnParcelEjectUserEvent; public event EjectUserUpdate OnParcelEjectUser;
public event ParcelBuyPass OnParcelBuyPass; public event ParcelBuyPass OnParcelBuyPass;
public event ParcelGodMark OnParcelGodMark; public event ParcelGodMark OnParcelGodMark;
public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest;
public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest;
public event SimWideDeletesDelegate OnSimWideDeletes; public event SimWideDeletesDelegate OnSimWideDeletes;
public event SendPostcard OnSendPostcard; public event SendPostcard OnSendPostcard;
public event MuteListEntryUpdate OnUpdateMuteListEntryEvent; public event MuteListEntryUpdate OnUpdateMuteListEntry;
public event MuteListEntryRemove OnRemoveMuteListEntryEvent; public event MuteListEntryRemove OnRemoveMuteListEntry;
public event GodlikeMessage onGodlikeMessageEvent; public event GodlikeMessage onGodlikeMessage;
public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent; public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate;
#pragma warning restore 67 #pragma warning restore 67
@ -1659,5 +1659,13 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt)
{ {
} }
public void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes)
{
}
public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals)
{
}
} }
} }

View File

@ -380,25 +380,25 @@ namespace OpenSim.Region.OptionalModules.World.NPC
public event PlacesQuery OnPlacesQuery; public event PlacesQuery OnPlacesQuery;
public event FindAgentUpdate OnFindAgentEvent; public event FindAgentUpdate OnFindAgent;
public event TrackAgentUpdate OnTrackAgentEvent; public event TrackAgentUpdate OnTrackAgent;
public event NewUserReport OnUserReportEvent; public event NewUserReport OnUserReport;
public event SaveStateHandler OnSaveStateEvent; public event SaveStateHandler OnSaveState;
public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest;
public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest;
public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest;
public event FreezeUserUpdate OnParcelFreezeUserEvent; public event FreezeUserUpdate OnParcelFreezeUser;
public event EjectUserUpdate OnParcelEjectUserEvent; public event EjectUserUpdate OnParcelEjectUser;
public event ParcelBuyPass OnParcelBuyPass; public event ParcelBuyPass OnParcelBuyPass;
public event ParcelGodMark OnParcelGodMark; public event ParcelGodMark OnParcelGodMark;
public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest;
public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest;
public event SimWideDeletesDelegate OnSimWideDeletes; public event SimWideDeletesDelegate OnSimWideDeletes;
public event SendPostcard OnSendPostcard; public event SendPostcard OnSendPostcard;
public event MuteListEntryUpdate OnUpdateMuteListEntryEvent; public event MuteListEntryUpdate OnUpdateMuteListEntry;
public event MuteListEntryRemove OnRemoveMuteListEntryEvent; public event MuteListEntryRemove OnRemoveMuteListEntry;
public event GodlikeMessage onGodlikeMessageEvent; public event GodlikeMessage onGodlikeMessage;
public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent; public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate;
#pragma warning restore 67 #pragma warning restore 67
@ -1140,5 +1140,13 @@ namespace OpenSim.Region.OptionalModules.World.NPC
public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt)
{ {
} }
public void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes)
{
}
public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals)
{
}
} }
} }

View File

@ -160,9 +160,9 @@ namespace OpenSim.Server.Base
} }
} }
public static Dictionary<string, string> ParseQueryString(string query) public static Dictionary<string, object> ParseQueryString(string query)
{ {
Dictionary<string, string> result = new Dictionary<string, string>(); Dictionary<string, object> result = new Dictionary<string, object>();
string[] terms = query.Split(new char[] {'&'}); string[] terms = query.Split(new char[] {'&'});
if (terms.Length == 0) if (terms.Length == 0)
@ -180,23 +180,65 @@ namespace OpenSim.Server.Base
if (elems.Length > 1) if (elems.Length > 1)
value = System.Web.HttpUtility.UrlDecode(elems[1]); value = System.Web.HttpUtility.UrlDecode(elems[1]);
if (name.EndsWith("[]"))
{
if (result.ContainsKey(name))
{
if (!(result[name] is List<string>))
continue;
List<string> l = (List<string>)result[name];
l.Add(value);
}
else
{
List<string> newList = new List<string>();
newList.Add(value);
result[name] = newList;
}
}
else
{
if (!result.ContainsKey(name))
result[name] = value; result[name] = value;
} }
}
return result; return result;
} }
public static string BuildQueryString(Dictionary<string, string> data) public static string BuildQueryString(Dictionary<string, object> data)
{ {
string qstring = String.Empty; string qstring = String.Empty;
foreach (KeyValuePair<string, string> kvp in data)
{
string part; string part;
if (kvp.Value != String.Empty)
foreach (KeyValuePair<string, object> kvp in data)
{
if (kvp.Value is List<string>)
{
List<string> l = (List<String>)kvp.Value;
foreach (string s in l)
{ {
part = System.Web.HttpUtility.UrlEncode(kvp.Key) + part = System.Web.HttpUtility.UrlEncode(kvp.Key) +
"=" + System.Web.HttpUtility.UrlEncode(kvp.Value); "[]=" + System.Web.HttpUtility.UrlEncode(s);
if (qstring != String.Empty)
qstring += "&";
qstring += part;
}
}
else
{
if (kvp.Value.ToString() != String.Empty)
{
part = System.Web.HttpUtility.UrlEncode(kvp.Key) +
"=" + System.Web.HttpUtility.UrlEncode(kvp.Value.ToString());
} }
else else
{ {
@ -208,6 +250,7 @@ namespace OpenSim.Server.Base
qstring += part; qstring += part;
} }
}
return qstring; return qstring;
} }

View File

@ -86,14 +86,14 @@ namespace OpenSim.Server.Handlers.Authentication
private byte[] DoPlainMethods(string body) private byte[] DoPlainMethods(string body)
{ {
Dictionary<string, string> request = Dictionary<string, object> request =
ServerUtils.ParseQueryString(body); ServerUtils.ParseQueryString(body);
int lifetime = 30; int lifetime = 30;
if (request.ContainsKey("LIFETIME")) if (request.ContainsKey("LIFETIME"))
{ {
lifetime = Convert.ToInt32(request["LIFETIME"]); lifetime = Convert.ToInt32(request["LIFETIME"].ToString());
if (lifetime > 30) if (lifetime > 30)
lifetime = 30; lifetime = 30;
} }
@ -103,12 +103,12 @@ namespace OpenSim.Server.Handlers.Authentication
if (!request.ContainsKey("PRINCIPAL")) if (!request.ContainsKey("PRINCIPAL"))
return FailureResult(); return FailureResult();
string method = request["METHOD"]; string method = request["METHOD"].ToString();
UUID principalID; UUID principalID;
string token; string token;
if (!UUID.TryParse(request["PRINCIPAL"], out principalID)) if (!UUID.TryParse(request["PRINCIPAL"].ToString(), out principalID))
return FailureResult(); return FailureResult();
switch (method) switch (method)
@ -117,7 +117,7 @@ namespace OpenSim.Server.Handlers.Authentication
if (!request.ContainsKey("PASSWORD")) if (!request.ContainsKey("PASSWORD"))
return FailureResult(); return FailureResult();
token = m_AuthenticationService.Authenticate(principalID, request["PASSWORD"], lifetime); token = m_AuthenticationService.Authenticate(principalID, request["PASSWORD"].ToString(), lifetime);
if (token != String.Empty) if (token != String.Empty)
return SuccessResult(token); return SuccessResult(token);
@ -126,7 +126,7 @@ namespace OpenSim.Server.Handlers.Authentication
if (!request.ContainsKey("TOKEN")) if (!request.ContainsKey("TOKEN"))
return FailureResult(); return FailureResult();
if (m_AuthenticationService.Verify(principalID, request["TOKEN"], lifetime)) if (m_AuthenticationService.Verify(principalID, request["TOKEN"].ToString(), lifetime))
return SuccessResult(); return SuccessResult();
return FailureResult(); return FailureResult();
@ -134,7 +134,7 @@ namespace OpenSim.Server.Handlers.Authentication
if (!request.ContainsKey("TOKEN")) if (!request.ContainsKey("TOKEN"))
return FailureResult(); return FailureResult();
if (m_AuthenticationService.Release(principalID, request["TOKEN"])) if (m_AuthenticationService.Release(principalID, request["TOKEN"].ToString()))
return SuccessResult(); return SuccessResult();
return FailureResult(); return FailureResult();

View File

@ -69,13 +69,13 @@ namespace OpenSim.Server.Handlers.Grid
try try
{ {
Dictionary<string, string> request = Dictionary<string, object> request =
ServerUtils.ParseQueryString(body); ServerUtils.ParseQueryString(body);
if (!request.ContainsKey("METHOD")) if (!request.ContainsKey("METHOD"))
return FailureResult(); return FailureResult();
string method = request["METHOD"]; string method = request["METHOD"].ToString();
switch (method) switch (method)
{ {
@ -117,22 +117,22 @@ namespace OpenSim.Server.Handlers.Grid
#region Method-specific handlers #region Method-specific handlers
byte[] Register(Dictionary<string, string> request) byte[] Register(Dictionary<string, object> request)
{ {
UUID scopeID = UUID.Zero; UUID scopeID = UUID.Zero;
if (request.ContainsKey("SCOPEID")) if (request.ContainsKey("SCOPEID"))
UUID.TryParse(request["SCOPEID"], out scopeID); UUID.TryParse(request["SCOPEID"].ToString(), out scopeID);
else else
m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to register region"); m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to register region");
int versionNumberMin = 0, versionNumberMax = 0; int versionNumberMin = 0, versionNumberMax = 0;
if (request.ContainsKey("VERSIONMIN")) if (request.ContainsKey("VERSIONMIN"))
Int32.TryParse(request["VERSIONMIN"], out versionNumberMin); Int32.TryParse(request["VERSIONMIN"].ToString(), out versionNumberMin);
else else
m_log.WarnFormat("[GRID HANDLER]: no minimum protocol version in request to register region"); m_log.WarnFormat("[GRID HANDLER]: no minimum protocol version in request to register region");
if (request.ContainsKey("VERSIONMAX")) if (request.ContainsKey("VERSIONMAX"))
Int32.TryParse(request["VERSIONMAX"], out versionNumberMax); Int32.TryParse(request["VERSIONMAX"].ToString(), out versionNumberMax);
else else
m_log.WarnFormat("[GRID HANDLER]: no maximum protocol version in request to register region"); m_log.WarnFormat("[GRID HANDLER]: no maximum protocol version in request to register region");
@ -147,8 +147,8 @@ namespace OpenSim.Server.Handlers.Grid
GridRegion rinfo = null; GridRegion rinfo = null;
try try
{ {
foreach (KeyValuePair<string, string> kvp in request) foreach (KeyValuePair<string, object> kvp in request)
rinfoData[kvp.Key] = kvp.Value; rinfoData[kvp.Key] = kvp.Value.ToString();
rinfo = new GridRegion(rinfoData); rinfo = new GridRegion(rinfoData);
} }
catch (Exception e) catch (Exception e)
@ -166,11 +166,11 @@ namespace OpenSim.Server.Handlers.Grid
return FailureResult(); return FailureResult();
} }
byte[] Deregister(Dictionary<string, string> request) byte[] Deregister(Dictionary<string, object> request)
{ {
UUID regionID = UUID.Zero; UUID regionID = UUID.Zero;
if (request["REGIONID"] != null) if (request.ContainsKey("REGIONID"))
UUID.TryParse(request["REGIONID"], out regionID); UUID.TryParse(request["REGIONID"].ToString(), out regionID);
else else
m_log.WarnFormat("[GRID HANDLER]: no regionID in request to deregister region"); m_log.WarnFormat("[GRID HANDLER]: no regionID in request to deregister region");
@ -183,17 +183,17 @@ namespace OpenSim.Server.Handlers.Grid
} }
byte[] GetNeighbours(Dictionary<string, string> request) byte[] GetNeighbours(Dictionary<string, object> request)
{ {
UUID scopeID = UUID.Zero; UUID scopeID = UUID.Zero;
if (request["SCOPEID"] != null) if (request.ContainsKey("SCOPEID"))
UUID.TryParse(request["SCOPEID"], out scopeID); UUID.TryParse(request["SCOPEID"].ToString(), out scopeID);
else else
m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get neighbours"); m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get neighbours");
UUID regionID = UUID.Zero; UUID regionID = UUID.Zero;
if (request["REGIONID"] != null) if (request.ContainsKey("REGIONID"))
UUID.TryParse(request["REGIONID"], out regionID); UUID.TryParse(request["REGIONID"].ToString(), out regionID);
else else
m_log.WarnFormat("[GRID HANDLER]: no regionID in request to get neighbours"); m_log.WarnFormat("[GRID HANDLER]: no regionID in request to get neighbours");
@ -221,17 +221,17 @@ namespace OpenSim.Server.Handlers.Grid
} }
byte[] GetRegionByUUID(Dictionary<string, string> request) byte[] GetRegionByUUID(Dictionary<string, object> request)
{ {
UUID scopeID = UUID.Zero; UUID scopeID = UUID.Zero;
if (request["SCOPEID"] != null) if (request.ContainsKey("SCOPEID"))
UUID.TryParse(request["SCOPEID"], out scopeID); UUID.TryParse(request["SCOPEID"].ToString(), out scopeID);
else else
m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get neighbours"); m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get neighbours");
UUID regionID = UUID.Zero; UUID regionID = UUID.Zero;
if (request["REGIONID"] != null) if (request.ContainsKey("REGIONID"))
UUID.TryParse(request["REGIONID"], out regionID); UUID.TryParse(request["REGIONID"].ToString(), out regionID);
else else
m_log.WarnFormat("[GRID HANDLER]: no regionID in request to get neighbours"); m_log.WarnFormat("[GRID HANDLER]: no regionID in request to get neighbours");
@ -250,21 +250,21 @@ namespace OpenSim.Server.Handlers.Grid
return encoding.GetBytes(xmlString); return encoding.GetBytes(xmlString);
} }
byte[] GetRegionByPosition(Dictionary<string, string> request) byte[] GetRegionByPosition(Dictionary<string, object> request)
{ {
UUID scopeID = UUID.Zero; UUID scopeID = UUID.Zero;
if (request["SCOPEID"] != null) if (request.ContainsKey("SCOPEID"))
UUID.TryParse(request["SCOPEID"], out scopeID); UUID.TryParse(request["SCOPEID"].ToString(), out scopeID);
else else
m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get region by position"); m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get region by position");
int x = 0, y = 0; int x = 0, y = 0;
if (request["X"] != null) if (request.ContainsKey("X"))
Int32.TryParse(request["X"], out x); Int32.TryParse(request["X"].ToString(), out x);
else else
m_log.WarnFormat("[GRID HANDLER]: no X in request to get region by position"); m_log.WarnFormat("[GRID HANDLER]: no X in request to get region by position");
if (request["Y"] != null) if (request.ContainsKey("Y"))
Int32.TryParse(request["Y"], out y); Int32.TryParse(request["Y"].ToString(), out y);
else else
m_log.WarnFormat("[GRID HANDLER]: no Y in request to get region by position"); m_log.WarnFormat("[GRID HANDLER]: no Y in request to get region by position");
@ -283,17 +283,17 @@ namespace OpenSim.Server.Handlers.Grid
return encoding.GetBytes(xmlString); return encoding.GetBytes(xmlString);
} }
byte[] GetRegionByName(Dictionary<string, string> request) byte[] GetRegionByName(Dictionary<string, object> request)
{ {
UUID scopeID = UUID.Zero; UUID scopeID = UUID.Zero;
if (request["SCOPEID"] != null) if (request.ContainsKey("SCOPEID"))
UUID.TryParse(request["SCOPEID"], out scopeID); UUID.TryParse(request["SCOPEID"].ToString(), out scopeID);
else else
m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get region by name"); m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get region by name");
string regionName = string.Empty; string regionName = string.Empty;
if (request["NAME"] != null) if (request.ContainsKey("NAME"))
regionName = request["NAME"]; regionName = request["NAME"].ToString();
else else
m_log.WarnFormat("[GRID HANDLER]: no name in request to get region by name"); m_log.WarnFormat("[GRID HANDLER]: no name in request to get region by name");
@ -312,23 +312,23 @@ namespace OpenSim.Server.Handlers.Grid
return encoding.GetBytes(xmlString); return encoding.GetBytes(xmlString);
} }
byte[] GetRegionsByName(Dictionary<string, string> request) byte[] GetRegionsByName(Dictionary<string, object> request)
{ {
UUID scopeID = UUID.Zero; UUID scopeID = UUID.Zero;
if (request["SCOPEID"] != null) if (request.ContainsKey("SCOPEID"))
UUID.TryParse(request["SCOPEID"], out scopeID); UUID.TryParse(request["SCOPEID"].ToString(), out scopeID);
else else
m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get regions by name"); m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get regions by name");
string regionName = string.Empty; string regionName = string.Empty;
if (request["NAME"] != null) if (request.ContainsKey("NAME"))
regionName = request["NAME"]; regionName = request["NAME"].ToString();
else else
m_log.WarnFormat("[GRID HANDLER]: no NAME in request to get regions by name"); m_log.WarnFormat("[GRID HANDLER]: no NAME in request to get regions by name");
int max = 0; int max = 0;
if (request["MAX"] != null) if (request.ContainsKey("MAX"))
Int32.TryParse(request["MAX"], out max); Int32.TryParse(request["MAX"].ToString(), out max);
else else
m_log.WarnFormat("[GRID HANDLER]: no MAX in request to get regions by name"); m_log.WarnFormat("[GRID HANDLER]: no MAX in request to get regions by name");
@ -355,30 +355,30 @@ namespace OpenSim.Server.Handlers.Grid
return encoding.GetBytes(xmlString); return encoding.GetBytes(xmlString);
} }
byte[] GetRegionRange(Dictionary<string, string> request) byte[] GetRegionRange(Dictionary<string, object> request)
{ {
//m_log.DebugFormat("[GRID HANDLER]: GetRegionRange"); //m_log.DebugFormat("[GRID HANDLER]: GetRegionRange");
UUID scopeID = UUID.Zero; UUID scopeID = UUID.Zero;
if (request.ContainsKey("SCOPEID")) if (request.ContainsKey("SCOPEID"))
UUID.TryParse(request["SCOPEID"], out scopeID); UUID.TryParse(request["SCOPEID"].ToString(), out scopeID);
else else
m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get region range"); m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get region range");
int xmin = 0, xmax = 0, ymin = 0, ymax = 0; int xmin = 0, xmax = 0, ymin = 0, ymax = 0;
if (request.ContainsKey("XMIN")) if (request.ContainsKey("XMIN"))
Int32.TryParse(request["XMIN"], out xmin); Int32.TryParse(request["XMIN"].ToString(), out xmin);
else else
m_log.WarnFormat("[GRID HANDLER]: no XMIN in request to get region range"); m_log.WarnFormat("[GRID HANDLER]: no XMIN in request to get region range");
if (request.ContainsKey("XMAX")) if (request.ContainsKey("XMAX"))
Int32.TryParse(request["XMAX"], out xmax); Int32.TryParse(request["XMAX"].ToString(), out xmax);
else else
m_log.WarnFormat("[GRID HANDLER]: no XMAX in request to get region range"); m_log.WarnFormat("[GRID HANDLER]: no XMAX in request to get region range");
if (request.ContainsKey("YMIN")) if (request.ContainsKey("YMIN"))
Int32.TryParse(request["YMIN"], out ymin); Int32.TryParse(request["YMIN"].ToString(), out ymin);
else else
m_log.WarnFormat("[GRID HANDLER]: no YMIN in request to get region range"); m_log.WarnFormat("[GRID HANDLER]: no YMIN in request to get region range");
if (request.ContainsKey("YMAX")) if (request.ContainsKey("YMAX"))
Int32.TryParse(request["YMAX"], out ymax); Int32.TryParse(request["YMAX"].ToString(), out ymax);
else else
m_log.WarnFormat("[GRID HANDLER]: no YMAX in request to get region range"); m_log.WarnFormat("[GRID HANDLER]: no YMAX in request to get region range");

View File

@ -0,0 +1,456 @@
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Reflection;
using System.Text;
using System.Xml;
using System.Collections.Generic;
using System.IO;
using Nini.Config;
using OpenSim.Framework;
using OpenSim.Server.Base;
using OpenSim.Services.Interfaces;
using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Server.Handlers.Base;
using log4net;
using OpenMetaverse;
namespace OpenSim.Server.Handlers.Asset
{
public class XInventoryInConnector : ServiceConnector
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private IInventoryService m_InventoryService;
private string m_ConfigName = "InventoryService";
public XInventoryInConnector(IConfigSource config, IHttpServer server, string configName) :
base(config, server, configName)
{
if (configName != String.Empty)
m_ConfigName = configName;
IConfig serverConfig = config.Configs[m_ConfigName];
if (serverConfig == null)
throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName));
string inventoryService = serverConfig.GetString("LocalServiceModule",
String.Empty);
if (inventoryService == String.Empty)
throw new Exception("No InventoryService in config file");
Object[] args = new Object[] { config };
m_InventoryService =
ServerUtils.LoadPlugin<IInventoryService>(inventoryService, args);
server.AddStreamHandler(new XInventoryConnectorPostHandler(m_InventoryService));
}
}
public class XInventoryConnectorPostHandler : BaseStreamHandler
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private IInventoryService m_InventoryService;
public XInventoryConnectorPostHandler(IInventoryService service) :
base("POST", "/xinventory")
{
m_InventoryService = service;
}
public override byte[] Handle(string path, Stream requestData,
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
{
StreamReader sr = new StreamReader(requestData);
string body = sr.ReadToEnd();
sr.Close();
body = body.Trim();
m_log.DebugFormat("[XXX]: query String: {0}", body);
try
{
Dictionary<string, object> request =
ServerUtils.ParseQueryString(body);
if (!request.ContainsKey("METHOD"))
return FailureResult();
string method = request["METHOD"].ToString();
request.Remove("METHOD");
switch (method)
{
case "CREATEUSERINVENTORY":
return HandleCreateUserInventory(request);
case "GETINVENTORYSKELETON":
return HandleGetInventorySkeleton(request);
case "GETROOTFOLDER":
return HandleGetRootFolder(request);
case "GETFOLDERFORTYPE":
return HandleGetFolderForType(request);
case "GETFOLDERCONTENT":
return HandleGetFolderContent(request);
case "GETFOLDERITEMS":
return HandleGetFolderItems(request);
case "ADDFOLDER":
return HandleAddFolder(request);
case "UPDATEFOLDER":
return HandleUpdateFolder(request);
case "MOVEFOLDER":
return HandleMoveFolder(request);
case "DELETEFOLDERS":
return HandleDeleteFolders(request);
case "PURGEFOLDER":
return HandlePurgeFolder(request);
case "ADDITEM":
return HandleAddItem(request);
case "UPDATEITEM":
return HandleUpdateItem(request);
case "MOVEITEMS":
return HandleMoveItems(request);
case "DELETEITEMS":
return HandleDeleteItems(request);
case "GETITEM":
return HandleGetItem(request);
case "GETFOLDER":
return HandleGetFolder(request);
case "GETACTIVEGESTURES":
return HandleGetActiveGestures(request);
case "GETASSETPERMISSIONS":
return HandleGetAssetPermissions(request);
}
m_log.DebugFormat("[XINVENTORY HANDLER]: unknown method request: {0}", method);
}
catch (Exception e)
{
m_log.Debug("[XINVENTORY HANDLER]: Exception {0}" + e);
}
return FailureResult();
}
private byte[] FailureResult()
{
XmlDocument doc = new XmlDocument();
XmlNode xmlnode = doc.CreateNode(XmlNodeType.XmlDeclaration,
"", "");
doc.AppendChild(xmlnode);
XmlElement rootElement = doc.CreateElement("", "ServerResponse",
"");
doc.AppendChild(rootElement);
XmlElement result = doc.CreateElement("", "RESULT", "");
result.AppendChild(doc.CreateTextNode("False"));
rootElement.AppendChild(result);
return DocToBytes(doc);
}
private byte[] DocToBytes(XmlDocument doc)
{
MemoryStream ms = new MemoryStream();
XmlTextWriter xw = new XmlTextWriter(ms, null);
xw.Formatting = Formatting.Indented;
doc.WriteTo(xw);
xw.Flush();
return ms.ToArray();
}
byte[] HandleCreateUserInventory(Dictionary<string,object> request)
{
Dictionary<string,object> result = new Dictionary<string,object>();
if (!request.ContainsKey("PRINCIPAL"))
return FailureResult();
if(m_InventoryService.CreateUserInventory(new UUID(request["PRINCIPAL"].ToString())))
result["RESULT"] = "True";
else
result["RESULT"] = "False";
string xmlString = ServerUtils.BuildXmlResponse(result);
m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
UTF8Encoding encoding = new UTF8Encoding();
return encoding.GetBytes(xmlString);
}
byte[] HandleGetInventorySkeleton(Dictionary<string,object> request)
{
Dictionary<string,object> result = new Dictionary<string,object>();
if (!request.ContainsKey("PRINCIPAL"))
return FailureResult();
List<InventoryFolderBase> folders = m_InventoryService.GetInventorySkeleton(new UUID(request["PRINCIPAL"].ToString()));
foreach (InventoryFolderBase f in folders)
result[f.ID.ToString()] = EncodeFolder(f);
string xmlString = ServerUtils.BuildXmlResponse(result);
m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
UTF8Encoding encoding = new UTF8Encoding();
return encoding.GetBytes(xmlString);
}
byte[] HandleGetRootFolder(Dictionary<string,object> request)
{
Dictionary<string,object> result = new Dictionary<string,object>();
string xmlString = ServerUtils.BuildXmlResponse(result);
m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
UTF8Encoding encoding = new UTF8Encoding();
return encoding.GetBytes(xmlString);
}
byte[] HandleGetFolderForType(Dictionary<string,object> request)
{
Dictionary<string,object> result = new Dictionary<string,object>();
string xmlString = ServerUtils.BuildXmlResponse(result);
m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
UTF8Encoding encoding = new UTF8Encoding();
return encoding.GetBytes(xmlString);
}
byte[] HandleGetFolderContent(Dictionary<string,object> request)
{
Dictionary<string,object> result = new Dictionary<string,object>();
string xmlString = ServerUtils.BuildXmlResponse(result);
m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
UTF8Encoding encoding = new UTF8Encoding();
return encoding.GetBytes(xmlString);
}
byte[] HandleGetFolderItems(Dictionary<string,object> request)
{
Dictionary<string,object> result = new Dictionary<string,object>();
string xmlString = ServerUtils.BuildXmlResponse(result);
m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
UTF8Encoding encoding = new UTF8Encoding();
return encoding.GetBytes(xmlString);
}
byte[] HandleAddFolder(Dictionary<string,object> request)
{
Dictionary<string,object> result = new Dictionary<string,object>();
string xmlString = ServerUtils.BuildXmlResponse(result);
m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
UTF8Encoding encoding = new UTF8Encoding();
return encoding.GetBytes(xmlString);
}
byte[] HandleUpdateFolder(Dictionary<string,object> request)
{
Dictionary<string,object> result = new Dictionary<string,object>();
string xmlString = ServerUtils.BuildXmlResponse(result);
m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
UTF8Encoding encoding = new UTF8Encoding();
return encoding.GetBytes(xmlString);
}
byte[] HandleMoveFolder(Dictionary<string,object> request)
{
Dictionary<string,object> result = new Dictionary<string,object>();
string xmlString = ServerUtils.BuildXmlResponse(result);
m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
UTF8Encoding encoding = new UTF8Encoding();
return encoding.GetBytes(xmlString);
}
byte[] HandleDeleteFolders(Dictionary<string,object> request)
{
Dictionary<string,object> result = new Dictionary<string,object>();
string xmlString = ServerUtils.BuildXmlResponse(result);
m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
UTF8Encoding encoding = new UTF8Encoding();
return encoding.GetBytes(xmlString);
}
byte[] HandlePurgeFolder(Dictionary<string,object> request)
{
Dictionary<string,object> result = new Dictionary<string,object>();
string xmlString = ServerUtils.BuildXmlResponse(result);
m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
UTF8Encoding encoding = new UTF8Encoding();
return encoding.GetBytes(xmlString);
}
byte[] HandleAddItem(Dictionary<string,object> request)
{
Dictionary<string,object> result = new Dictionary<string,object>();
string xmlString = ServerUtils.BuildXmlResponse(result);
m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
UTF8Encoding encoding = new UTF8Encoding();
return encoding.GetBytes(xmlString);
}
byte[] HandleUpdateItem(Dictionary<string,object> request)
{
Dictionary<string,object> result = new Dictionary<string,object>();
string xmlString = ServerUtils.BuildXmlResponse(result);
m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
UTF8Encoding encoding = new UTF8Encoding();
return encoding.GetBytes(xmlString);
}
byte[] HandleMoveItems(Dictionary<string,object> request)
{
Dictionary<string,object> result = new Dictionary<string,object>();
string xmlString = ServerUtils.BuildXmlResponse(result);
m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
UTF8Encoding encoding = new UTF8Encoding();
return encoding.GetBytes(xmlString);
}
byte[] HandleDeleteItems(Dictionary<string,object> request)
{
Dictionary<string,object> result = new Dictionary<string,object>();
string xmlString = ServerUtils.BuildXmlResponse(result);
m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
UTF8Encoding encoding = new UTF8Encoding();
return encoding.GetBytes(xmlString);
}
byte[] HandleGetItem(Dictionary<string,object> request)
{
Dictionary<string,object> result = new Dictionary<string,object>();
string xmlString = ServerUtils.BuildXmlResponse(result);
m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
UTF8Encoding encoding = new UTF8Encoding();
return encoding.GetBytes(xmlString);
}
byte[] HandleGetFolder(Dictionary<string,object> request)
{
Dictionary<string,object> result = new Dictionary<string,object>();
string xmlString = ServerUtils.BuildXmlResponse(result);
m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
UTF8Encoding encoding = new UTF8Encoding();
return encoding.GetBytes(xmlString);
}
byte[] HandleGetActiveGestures(Dictionary<string,object> request)
{
Dictionary<string,object> result = new Dictionary<string,object>();
string xmlString = ServerUtils.BuildXmlResponse(result);
m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
UTF8Encoding encoding = new UTF8Encoding();
return encoding.GetBytes(xmlString);
}
byte[] HandleGetAssetPermissions(Dictionary<string,object> request)
{
Dictionary<string,object> result = new Dictionary<string,object>();
string xmlString = ServerUtils.BuildXmlResponse(result);
m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
UTF8Encoding encoding = new UTF8Encoding();
return encoding.GetBytes(xmlString);
}
private Dictionary<string, object> EncodeFolder(InventoryFolderBase f)
{
Dictionary<string, object> ret = new Dictionary<string, object>();
ret["ParentID"] = f.ParentID.ToString();
ret["Type"] = f.Type.ToString();
ret["Version"] = f.Version.ToString();
ret["Name"] = f.Name;
ret["Owner"] = f.Owner.ToString();
ret["ID"] = f.ID.ToString();
return ret;
}
private InventoryFolderBase BuildFolder(Dictionary<string,object> data)
{
InventoryFolderBase folder = new InventoryFolderBase();
folder.ParentID = new UUID(data["ParentID"].ToString());
folder.Type = short.Parse(data["Type"].ToString());
folder.Version = ushort.Parse(data["Version"].ToString());
folder.Name = data["Name"].ToString();
folder.Owner = new UUID(data["Owner"].ToString());
folder.ID = new UUID(data["ID"].ToString());
return folder;
}
private InventoryItemBase BuildItem(Dictionary<string,object> data)
{
InventoryItemBase item = new InventoryItemBase();
item.AssetID = new UUID(data["AssetID"].ToString());
item.AssetType = int.Parse(data["AssetType"].ToString());
item.Name = data["Name"].ToString();
item.Owner = new UUID(data["Owner"].ToString());
item.ID = new UUID(data["ID"].ToString());
item.InvType = int.Parse(data["InvType"].ToString());
item.Folder = new UUID(data["Folder"].ToString());
item.CreatorId = data["CreatorId"].ToString();
item.Description = data["Description"].ToString();
item.NextPermissions = uint.Parse(data["NextPermissions"].ToString());
item.CurrentPermissions = uint.Parse(data["CurrentPermissions"].ToString());
item.BasePermissions = uint.Parse(data["BasePermissions"].ToString());
item.EveryOnePermissions = uint.Parse(data["EveryOnePermissions"].ToString());
item.GroupPermissions = uint.Parse(data["GroupPermissions"].ToString());
item.GroupID = new UUID(data["GroupID"].ToString());
item.GroupOwned = bool.Parse(data["GroupOwned"].ToString());
item.SalePrice = int.Parse(data["SalePrice"].ToString());
item.SaleType = byte.Parse(data["SaleType"].ToString());
item.Flags = uint.Parse(data["Flags"].ToString());
item.CreationDate = int.Parse(data["CreationDate"].ToString());
return item;
}
}
}

View File

@ -68,13 +68,13 @@ namespace OpenSim.Server.Handlers.Presence
try try
{ {
Dictionary<string, string> request = Dictionary<string, object> request =
ServerUtils.ParseQueryString(body); ServerUtils.ParseQueryString(body);
if (!request.ContainsKey("METHOD")) if (!request.ContainsKey("METHOD"))
return FailureResult(); return FailureResult();
string method = request["METHOD"]; string method = request["METHOD"].ToString();
switch (method) switch (method)
{ {
@ -92,12 +92,12 @@ namespace OpenSim.Server.Handlers.Presence
} }
byte[] Report(Dictionary<string, string> request) byte[] Report(Dictionary<string, object> request)
{ {
PresenceInfo info = new PresenceInfo(); PresenceInfo info = new PresenceInfo();
info.Data = new Dictionary<string, string>(); info.Data = new Dictionary<string, string>();
if (request["PrincipalID"] == null || request["RegionID"] == null) if (!request.ContainsKey("PrincipalID") || !request.ContainsKey("RegionID"))
return FailureResult(); return FailureResult();
if (!UUID.TryParse(request["PrincipalID"].ToString(), if (!UUID.TryParse(request["PrincipalID"].ToString(),
@ -108,14 +108,14 @@ namespace OpenSim.Server.Handlers.Presence
out info.RegionID)) out info.RegionID))
return FailureResult(); return FailureResult();
foreach (KeyValuePair<string, string> kvp in request) foreach (KeyValuePair<string, object> kvp in request)
{ {
if (kvp.Key == "METHOD" || if (kvp.Key == "METHOD" ||
kvp.Key == "PrincipalID" || kvp.Key == "PrincipalID" ||
kvp.Key == "RegionID") kvp.Key == "RegionID")
continue; continue;
info.Data[kvp.Key] = kvp.Value; info.Data[kvp.Key] = kvp.Value.ToString();
} }
if (m_PresenceService.Report(info)) if (m_PresenceService.Report(info))

View File

@ -84,7 +84,7 @@ namespace OpenSim.Services.Connectors
public string Authenticate(UUID principalID, string password, int lifetime) public string Authenticate(UUID principalID, string password, int lifetime)
{ {
Dictionary<string, string> sendData = new Dictionary<string, string>(); Dictionary<string, object> sendData = new Dictionary<string, object>();
sendData["LIFETIME"] = lifetime.ToString(); sendData["LIFETIME"] = lifetime.ToString();
sendData["PRINCIPAL"] = principalID.ToString(); sendData["PRINCIPAL"] = principalID.ToString();
sendData["PASSWORD"] = password; sendData["PASSWORD"] = password;
@ -106,7 +106,7 @@ namespace OpenSim.Services.Connectors
public bool Verify(UUID principalID, string token, int lifetime) public bool Verify(UUID principalID, string token, int lifetime)
{ {
Dictionary<string, string> sendData = new Dictionary<string, string>(); Dictionary<string, object> sendData = new Dictionary<string, object>();
sendData["LIFETIME"] = lifetime.ToString(); sendData["LIFETIME"] = lifetime.ToString();
sendData["PRINCIPAL"] = principalID.ToString(); sendData["PRINCIPAL"] = principalID.ToString();
sendData["TOKEN"] = token; sendData["TOKEN"] = token;
@ -128,7 +128,7 @@ namespace OpenSim.Services.Connectors
public bool Release(UUID principalID, string token) public bool Release(UUID principalID, string token)
{ {
Dictionary<string, string> sendData = new Dictionary<string, string>(); Dictionary<string, object> sendData = new Dictionary<string, object>();
sendData["PRINCIPAL"] = principalID.ToString(); sendData["PRINCIPAL"] = principalID.ToString();
sendData["TOKEN"] = token; sendData["TOKEN"] = token;

View File

@ -89,7 +89,7 @@ namespace OpenSim.Services.Connectors
public virtual bool RegisterRegion(UUID scopeID, GridRegion regionInfo) public virtual bool RegisterRegion(UUID scopeID, GridRegion regionInfo)
{ {
Dictionary<string, object> rinfo = regionInfo.ToKeyValuePairs(); Dictionary<string, object> rinfo = regionInfo.ToKeyValuePairs();
Dictionary<string, string> sendData = new Dictionary<string,string>(); Dictionary<string, object> sendData = new Dictionary<string,object>();
foreach (KeyValuePair<string, object> kvp in rinfo) foreach (KeyValuePair<string, object> kvp in rinfo)
sendData[kvp.Key] = (string)kvp.Value; sendData[kvp.Key] = (string)kvp.Value;
@ -130,7 +130,7 @@ namespace OpenSim.Services.Connectors
public virtual bool DeregisterRegion(UUID regionID) public virtual bool DeregisterRegion(UUID regionID)
{ {
Dictionary<string, string> sendData = new Dictionary<string, string>(); Dictionary<string, object> sendData = new Dictionary<string, object>();
sendData["REGIONID"] = regionID.ToString(); sendData["REGIONID"] = regionID.ToString();
@ -162,7 +162,7 @@ namespace OpenSim.Services.Connectors
public virtual List<GridRegion> GetNeighbours(UUID scopeID, UUID regionID) public virtual List<GridRegion> GetNeighbours(UUID scopeID, UUID regionID)
{ {
Dictionary<string, string> sendData = new Dictionary<string, string>(); Dictionary<string, object> sendData = new Dictionary<string, object>();
sendData["SCOPEID"] = scopeID.ToString(); sendData["SCOPEID"] = scopeID.ToString();
sendData["REGIONID"] = regionID.ToString(); sendData["REGIONID"] = regionID.ToString();
@ -212,7 +212,7 @@ namespace OpenSim.Services.Connectors
public virtual GridRegion GetRegionByUUID(UUID scopeID, UUID regionID) public virtual GridRegion GetRegionByUUID(UUID scopeID, UUID regionID)
{ {
Dictionary<string, string> sendData = new Dictionary<string, string>(); Dictionary<string, object> sendData = new Dictionary<string, object>();
sendData["SCOPEID"] = scopeID.ToString(); sendData["SCOPEID"] = scopeID.ToString();
sendData["REGIONID"] = regionID.ToString(); sendData["REGIONID"] = regionID.ToString();
@ -258,7 +258,7 @@ namespace OpenSim.Services.Connectors
public virtual GridRegion GetRegionByPosition(UUID scopeID, int x, int y) public virtual GridRegion GetRegionByPosition(UUID scopeID, int x, int y)
{ {
Dictionary<string, string> sendData = new Dictionary<string, string>(); Dictionary<string, object> sendData = new Dictionary<string, object>();
sendData["SCOPEID"] = scopeID.ToString(); sendData["SCOPEID"] = scopeID.ToString();
sendData["X"] = x.ToString(); sendData["X"] = x.ToString();
@ -303,7 +303,7 @@ namespace OpenSim.Services.Connectors
public virtual GridRegion GetRegionByName(UUID scopeID, string regionName) public virtual GridRegion GetRegionByName(UUID scopeID, string regionName)
{ {
Dictionary<string, string> sendData = new Dictionary<string, string>(); Dictionary<string, object> sendData = new Dictionary<string, object>();
sendData["SCOPEID"] = scopeID.ToString(); sendData["SCOPEID"] = scopeID.ToString();
sendData["NAME"] = regionName; sendData["NAME"] = regionName;
@ -344,7 +344,7 @@ namespace OpenSim.Services.Connectors
public virtual List<GridRegion> GetRegionsByName(UUID scopeID, string name, int maxNumber) public virtual List<GridRegion> GetRegionsByName(UUID scopeID, string name, int maxNumber)
{ {
Dictionary<string, string> sendData = new Dictionary<string, string>(); Dictionary<string, object> sendData = new Dictionary<string, object>();
sendData["SCOPEID"] = scopeID.ToString(); sendData["SCOPEID"] = scopeID.ToString();
sendData["NAME"] = name; sendData["NAME"] = name;
@ -396,7 +396,7 @@ namespace OpenSim.Services.Connectors
public virtual List<GridRegion> GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax) public virtual List<GridRegion> GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax)
{ {
Dictionary<string, string> sendData = new Dictionary<string, string>(); Dictionary<string, object> sendData = new Dictionary<string, object>();
sendData["SCOPEID"] = scopeID.ToString(); sendData["SCOPEID"] = scopeID.ToString();
sendData["XMIN"] = xmin.ToString(); sendData["XMIN"] = xmin.ToString();

View File

@ -0,0 +1,535 @@
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using log4net;
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using Nini.Config;
using OpenSim.Framework;
using OpenSim.Framework.Console;
using OpenSim.Framework.Communications;
using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Services.Interfaces;
using OpenSim.Server.Base;
using OpenMetaverse;
namespace OpenSim.Services.Connectors
{
public class XInventoryServicesConnector : IInventoryService
{
private static readonly ILog m_log =
LogManager.GetLogger(
MethodBase.GetCurrentMethod().DeclaringType);
private string m_ServerURI = String.Empty;
public XInventoryServicesConnector()
{
}
public XInventoryServicesConnector(string serverURI)
{
m_ServerURI = serverURI.TrimEnd('/');
}
public XInventoryServicesConnector(IConfigSource source)
{
Initialise(source);
}
public virtual void Initialise(IConfigSource source)
{
IConfig assetConfig = source.Configs["InventoryService"];
if (assetConfig == null)
{
m_log.Error("[INVENTORY CONNECTOR]: InventoryService missing from OpanSim.ini");
throw new Exception("Inventory connector init error");
}
string serviceURI = assetConfig.GetString("InventoryServerURI",
String.Empty);
if (serviceURI == String.Empty)
{
m_log.Error("[INVENTORY CONNECTOR]: No Server URI named in section InventoryService");
throw new Exception("Inventory connector init error");
}
m_ServerURI = serviceURI;
}
public bool CreateUserInventory(UUID principalID)
{
Dictionary<string,object> ret = MakeRequest("CREATEUSERINVENTORY",
new Dictionary<string,object> {
{ "PRINCIPAL", principalID.ToString() }
});
if (ret == null)
return false;
return bool.Parse(ret["RESULT"].ToString());
}
public List<InventoryFolderBase> GetInventorySkeleton(UUID principalID)
{
Dictionary<string,object> ret = MakeRequest("GETINVENTORYSKELETON",
new Dictionary<string,object> {
{ "PRINCIPAL", principalID.ToString() }
});
if (ret == null)
return null;
List<InventoryFolderBase> folders = new List<InventoryFolderBase>();
foreach (Object o in ret.Values)
folders.Add(BuildFolder((Dictionary<string,object>)o));
return folders;
}
public InventoryFolderBase GetRootFolder(UUID principalID)
{
Dictionary<string,object> ret = MakeRequest("GETROOTFOLDER",
new Dictionary<string,object> {
{ "PRINCIPAL", principalID.ToString() }
});
if (ret == null)
return null;
if (ret.Count == 0)
return null;
return BuildFolder(ret);
}
public InventoryFolderBase GetFolderForType(UUID principalID, AssetType type)
{
Dictionary<string,object> ret = MakeRequest("GETFOLDERFORTYPE",
new Dictionary<string,object> {
{ "PRINCIPAL", principalID.ToString() },
{ "TYPE", ((int)type).ToString() }
});
if (ret == null)
return null;
if (ret.Count == 0)
return null;
return BuildFolder(ret);
}
public InventoryCollection GetFolderContent(UUID principalID, UUID folderID)
{
Dictionary<string,object> ret = MakeRequest("GETFOLDERCONTENT",
new Dictionary<string,object> {
{ "PRINCIPAL", principalID.ToString() },
{ "FOLDER", folderID.ToString() }
});
if (ret == null)
return null;
if (ret.Count == 0)
return null;
InventoryCollection inventory = new InventoryCollection();
inventory.Folders = new List<InventoryFolderBase>();
inventory.Items = new List<InventoryItemBase>();
inventory.UserID = principalID;
Dictionary<string,object> folders =
(Dictionary<string,object>)ret["FOLDERS"];
Dictionary<string,object> items =
(Dictionary<string,object>)ret["ITEMS"];
foreach (Object o in folders.Values)
inventory.Folders.Add(BuildFolder((Dictionary<string,object>)o));
foreach (Object o in items.Values)
inventory.Items.Add(BuildItem((Dictionary<string,object>)o));
return inventory;
}
public List<InventoryItemBase> GetFolderItems(UUID principalID, UUID folderID)
{
Dictionary<string,object> ret = MakeRequest("GETFOLDERCONTENT",
new Dictionary<string,object> {
{ "PRINCIPAL", principalID.ToString() },
{ "FOLDER", folderID.ToString() }
});
if (ret == null)
return null;
if (ret.Count == 0)
return null;
List<InventoryItemBase> items = new List<InventoryItemBase>();
foreach (Object o in ret.Values)
items.Add(BuildItem((Dictionary<string,object>)o));
return items;
}
public bool AddFolder(InventoryFolderBase folder)
{
Dictionary<string,object> ret = MakeRequest("ADDFOLDER",
new Dictionary<string,object> {
{ "ParentID", folder.ParentID.ToString() },
{ "Type", folder.Type.ToString() },
{ "Version", folder.Version.ToString() },
{ "Name", folder.Name.ToString() },
{ "Owner", folder.Owner.ToString() },
{ "ID", folder.ID.ToString() }
});
if (ret == null)
return false;
return bool.Parse(ret["RESULT"].ToString());
}
public bool UpdateFolder(InventoryFolderBase folder)
{
Dictionary<string,object> ret = MakeRequest("UPDATEFOLDER",
new Dictionary<string,object> {
{ "ParentID", folder.ParentID.ToString() },
{ "Type", folder.Type.ToString() },
{ "Version", folder.Version.ToString() },
{ "Name", folder.Name.ToString() },
{ "Owner", folder.Owner.ToString() },
{ "ID", folder.ID.ToString() }
});
if (ret == null)
return false;
return bool.Parse(ret["RESULT"].ToString());
}
public bool MoveFolder(InventoryFolderBase folder)
{
Dictionary<string,object> ret = MakeRequest("MOVEFOLDER",
new Dictionary<string,object> {
{ "ParentID", folder.ParentID.ToString() },
{ "ID", folder.ID.ToString() }
});
if (ret == null)
return false;
return bool.Parse(ret["RESULT"].ToString());
}
public bool DeleteFolders(UUID principalID, List<UUID> folderIDs)
{
List<string> slist = new List<string>();
foreach (UUID f in folderIDs)
slist.Add(f.ToString());
Dictionary<string,object> ret = MakeRequest("DELETEFOLDERS",
new Dictionary<string,object> {
{ "PRINCIPAL", principalID.ToString() },
{ "FOLDERS", slist }
});
if (ret == null)
return false;
return bool.Parse(ret["RESULT"].ToString());
}
public bool PurgeFolder(InventoryFolderBase folder)
{
Dictionary<string,object> ret = MakeRequest("PURGEFOLDER",
new Dictionary<string,object> {
{ "ID", folder.ID.ToString() }
});
if (ret == null)
return false;
return bool.Parse(ret["RESULT"].ToString());
}
public bool AddItem(InventoryItemBase item)
{
Dictionary<string,object> ret = MakeRequest("ADDITEM",
new Dictionary<string,object> {
{ "AssetID", item.AssetID.ToString() },
{ "AssetType", item.AssetType.ToString() },
{ "Name", item.Name.ToString() },
{ "Owner", item.Owner.ToString() },
{ "ID", item.ID.ToString() },
{ "InvType", item.InvType.ToString() },
{ "Folder", item.Folder.ToString() },
{ "CreatorId", item.CreatorId.ToString() },
{ "Description", item.Description.ToString() },
{ "NextPermissions", item.NextPermissions.ToString() },
{ "CurrentPermissions", item.CurrentPermissions.ToString() },
{ "BasePermissions", item.BasePermissions.ToString() },
{ "EveryOnePermissions", item.EveryOnePermissions.ToString() },
{ "GroupPermissions", item.GroupPermissions.ToString() },
{ "GroupID", item.GroupID.ToString() },
{ "GroupOwned", item.GroupOwned.ToString() },
{ "SalePrice", item.SalePrice.ToString() },
{ "SaleType", item.SaleType.ToString() },
{ "Flags", item.Flags.ToString() },
{ "CreationDate", item.CreationDate.ToString() }
});
if (ret == null)
return false;
return bool.Parse(ret["RESULT"].ToString());
}
public bool UpdateItem(InventoryItemBase item)
{
Dictionary<string,object> ret = MakeRequest("UPDATEITEM",
new Dictionary<string,object> {
{ "AssetID", item.AssetID.ToString() },
{ "AssetType", item.AssetType.ToString() },
{ "Name", item.Name.ToString() },
{ "Owner", item.Owner.ToString() },
{ "ID", item.ID.ToString() },
{ "InvType", item.InvType.ToString() },
{ "Folder", item.Folder.ToString() },
{ "CreatorId", item.CreatorId.ToString() },
{ "Description", item.Description.ToString() },
{ "NextPermissions", item.NextPermissions.ToString() },
{ "CurrentPermissions", item.CurrentPermissions.ToString() },
{ "BasePermissions", item.BasePermissions.ToString() },
{ "EveryOnePermissions", item.EveryOnePermissions.ToString() },
{ "GroupPermissions", item.GroupPermissions.ToString() },
{ "GroupID", item.GroupID.ToString() },
{ "GroupOwned", item.GroupOwned.ToString() },
{ "SalePrice", item.SalePrice.ToString() },
{ "SaleType", item.SaleType.ToString() },
{ "Flags", item.Flags.ToString() },
{ "CreationDate", item.CreationDate.ToString() }
});
if (ret == null)
return false;
return bool.Parse(ret["RESULT"].ToString());
}
public bool MoveItems(UUID principalID, List<InventoryItemBase> items)
{
List<string> idlist = new List<string>();
List<string> destlist = new List<string>();
foreach (InventoryItemBase item in items)
{
idlist.Add(item.ID.ToString());
destlist.Add(item.Folder.ToString());
}
Dictionary<string,object> ret = MakeRequest("MOVEITEMS",
new Dictionary<string,object> {
{ "PrincipalID", principalID.ToString() },
{ "IDLIST", idlist },
{ "DESTLIST", destlist }
});
if (ret == null)
return false;
return bool.Parse(ret["RESULT"].ToString());
}
public bool DeleteItems(UUID principalID, List<UUID> itemIDs)
{
List<string> slist = new List<string>();
foreach (UUID f in itemIDs)
slist.Add(f.ToString());
Dictionary<string,object> ret = MakeRequest("DELETEITEMS",
new Dictionary<string,object> {
{ "PRINCIPAL", principalID.ToString() },
{ "ITEMS", slist }
});
if (ret == null)
return false;
return bool.Parse(ret["RESULT"].ToString());
}
public InventoryItemBase GetItem(InventoryItemBase item)
{
Dictionary<string,object> ret = MakeRequest("GETITEM",
new Dictionary<string,object> {
{ "ID", item.ID.ToString() }
});
if (ret == null)
return null;
if (ret.Count == 0)
return null;
return BuildItem(ret);
}
public InventoryFolderBase GetFolder(InventoryFolderBase folder)
{
Dictionary<string,object> ret = MakeRequest("GETFOLDER",
new Dictionary<string,object> {
{ "ID", folder.ID.ToString() }
});
if (ret == null)
return null;
if (ret.Count == 0)
return null;
return BuildFolder(ret);
}
public List<InventoryItemBase> GetActiveGestures(UUID principalID)
{
Dictionary<string,object> ret = MakeRequest("GETACTIVEGESTURES",
new Dictionary<string,object> {
{ "PRINCIPAL", principalID.ToString() }
});
if (ret == null)
return null;
List<InventoryItemBase> items = new List<InventoryItemBase>();
foreach (Object o in ret.Values)
items.Add(BuildItem((Dictionary<string,object>)o));
return items;
}
public int GetAssetPermissions(UUID principalID, UUID assetID)
{
Dictionary<string,object> ret = MakeRequest("GETASSETPERMISSIONS",
new Dictionary<string,object> {
{ "PRINCIPAL", principalID.ToString() },
{ "ASSET", assetID.ToString() }
});
if (ret == null)
return 0;
return int.Parse(ret["RESULT"].ToString());
}
// These are either obsolete or unused
//
public InventoryCollection GetUserInventory(UUID principalID)
{
return null;
}
public void GetUserInventory(UUID principalID, InventoryReceiptCallback callback)
{
}
public bool HasInventoryForUser(UUID principalID)
{
return false;
}
// Helpers
//
private Dictionary<string,object> MakeRequest(string method,
Dictionary<string,object> sendData)
{
sendData["METHOD"] = method;
string reply = SynchronousRestFormsRequester.MakeRequest("POST",
m_ServerURI + "/xinventory",
ServerUtils.BuildQueryString(sendData));
Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(
reply);
return replyData;
}
private InventoryFolderBase BuildFolder(Dictionary<string,object> data)
{
InventoryFolderBase folder = new InventoryFolderBase();
folder.ParentID = new UUID(data["ParentID"].ToString());
folder.Type = short.Parse(data["Type"].ToString());
folder.Version = ushort.Parse(data["Version"].ToString());
folder.Name = data["Name"].ToString();
folder.Owner = new UUID(data["Owner"].ToString());
folder.ID = new UUID(data["ID"].ToString());
return folder;
}
private InventoryItemBase BuildItem(Dictionary<string,object> data)
{
InventoryItemBase item = new InventoryItemBase();
item.AssetID = new UUID(data["AssetID"].ToString());
item.AssetType = int.Parse(data["AssetType"].ToString());
item.Name = data["Name"].ToString();
item.Owner = new UUID(data["Owner"].ToString());
item.ID = new UUID(data["ID"].ToString());
item.InvType = int.Parse(data["InvType"].ToString());
item.Folder = new UUID(data["Folder"].ToString());
item.CreatorId = data["CreatorId"].ToString();
item.Description = data["Description"].ToString();
item.NextPermissions = uint.Parse(data["NextPermissions"].ToString());
item.CurrentPermissions = uint.Parse(data["CurrentPermissions"].ToString());
item.BasePermissions = uint.Parse(data["BasePermissions"].ToString());
item.EveryOnePermissions = uint.Parse(data["EveryOnePermissions"].ToString());
item.GroupPermissions = uint.Parse(data["GroupPermissions"].ToString());
item.GroupID = new UUID(data["GroupID"].ToString());
item.GroupOwned = bool.Parse(data["GroupOwned"].ToString());
item.SalePrice = int.Parse(data["SalePrice"].ToString());
item.SaleType = byte.Parse(data["SaleType"].ToString());
item.Flags = uint.Parse(data["Flags"].ToString());
item.CreationDate = int.Parse(data["CreationDate"].ToString());
return item;
}
}
}

View File

@ -288,25 +288,25 @@ namespace OpenSim.Tests.Common.Mock
public event PlacesQuery OnPlacesQuery; public event PlacesQuery OnPlacesQuery;
public event FindAgentUpdate OnFindAgentEvent; public event FindAgentUpdate OnFindAgent;
public event TrackAgentUpdate OnTrackAgentEvent; public event TrackAgentUpdate OnTrackAgent;
public event NewUserReport OnUserReportEvent; public event NewUserReport OnUserReport;
public event SaveStateHandler OnSaveStateEvent; public event SaveStateHandler OnSaveState;
public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest;
public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest;
public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest;
public event FreezeUserUpdate OnParcelFreezeUserEvent; public event FreezeUserUpdate OnParcelFreezeUser;
public event EjectUserUpdate OnParcelEjectUserEvent; public event EjectUserUpdate OnParcelEjectUser;
public event ParcelBuyPass OnParcelBuyPass; public event ParcelBuyPass OnParcelBuyPass;
public event ParcelGodMark OnParcelGodMark; public event ParcelGodMark OnParcelGodMark;
public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest;
public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest;
public event SimWideDeletesDelegate OnSimWideDeletes; public event SimWideDeletesDelegate OnSimWideDeletes;
public event SendPostcard OnSendPostcard; public event SendPostcard OnSendPostcard;
public event MuteListEntryUpdate OnUpdateMuteListEntryEvent; public event MuteListEntryUpdate OnUpdateMuteListEntry;
public event MuteListEntryRemove OnRemoveMuteListEntryEvent; public event MuteListEntryRemove OnRemoveMuteListEntry;
public event GodlikeMessage onGodlikeMessageEvent; public event GodlikeMessage onGodlikeMessage;
public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent; public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate;
#pragma warning restore 67 #pragma warning restore 67
@ -1195,5 +1195,13 @@ namespace OpenSim.Tests.Common.Mock
public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt)
{ {
} }
public void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes)
{
}
public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals)
{
}
} }
} }

View File

@ -13,11 +13,15 @@ If it breaks, you get to keep *both* pieces.
== Installation on Windows == == Installation on Windows ==
Prereqs: Prereqs:
* runprebuild.bat
* Load OpenSim.sln into Visual Studio .NET and build the solution. * Load OpenSim.sln into Visual Studio .NET and build the solution.
* chdir bin * chdir bin
* edit OpenSim.ini and appropriate files in bin/config-include
* OpenSim.exe * OpenSim.exe
Helpful resources:
* http://opensimulator.org/wiki/Build_Instructions
See configuring OpenSim See configuring OpenSim
== Installation on Linux == == Installation on Linux ==
@ -31,11 +35,16 @@ From the distribution type:
* ./runprebuild.sh * ./runprebuild.sh
* nant * nant
* cd bin * cd bin
* edit OpenSim.ini and appropriate files in bin/config-include
* mono ./OpenSim.exe * mono ./OpenSim.exe
See configuring OpenSim See configuring OpenSim
== Configuring OpenSim == == Configuring OpenSim ==
Helpful resources:
* http://opensimulator.org/wiki/Configuration
* http://opensimulator.org/wiki/Configuring_Regions
* http://opensimulator.org/wiki/Mysql-config
When OpenSim starts for the first time, you will be prompted with a When OpenSim starts for the first time, you will be prompted with a
series of questions that look something like: series of questions that look something like:

View File

@ -126,11 +126,16 @@
;storage_plugin = "OpenSim.Data.Null.dll" ;storage_plugin = "OpenSim.Data.Null.dll"
; --- To use sqlite as region storage: ; --- To use sqlite as region storage:
; NOTE: SQLite and OpenSim are not functioning properly with Mono 2.4.3 or greater.
; If you are using Mono you probably should be using MySQL
storage_plugin = "OpenSim.Data.SQLite.dll" storage_plugin = "OpenSim.Data.SQLite.dll"
storage_connection_string="URI=file:OpenSim.db,version=3"; storage_connection_string="URI=file:OpenSim.db,version=3";
; --- To use MySQL storage, supply your own connection string (this is only an example): ; --- To use MySQL storage, supply your own connection string (this is only an example):
; note that the supplied account needs create privilegies if you want it to auto-create needed tables. ; note that the supplied account needs create privilegies if you want it to auto-create needed tables.
;
; -->>> There are multiple connection strings defined in several places in this file. Check it carefully!
;
; storage_plugin="OpenSim.Data.MySQL.dll" ; storage_plugin="OpenSim.Data.MySQL.dll"
; storage_connection_string="Data Source=localhost;Database=opensim;User ID=opensim;Password=*****;"; ; storage_connection_string="Data Source=localhost;Database=opensim;User ID=opensim;Password=*****;";
; If you want to use a different database/server for estate data, then ; If you want to use a different database/server for estate data, then
@ -476,6 +481,7 @@
; OfflineMessageURL = http://yourserver/Offline.php ; OfflineMessageURL = http://yourserver/Offline.php
; MuteListModule = MuteListModule ; MuteListModule = MuteListModule
; MuteListURL = http://yourserver/Mute.php ; MuteListURL = http://yourserver/Mute.php
; ForwardOfflineGroupMessages = true
[ODEPhysicsSettings] [ODEPhysicsSettings]