mirror of
https://github.com/opensim/opensim.git
synced 2026-07-31 05:45:37 +08:00
* Added AvatarPicker in Standalone mode. Works for finding avatar to ban, manually trying to add a friend (with the add button) or useful to those who are curious which usernames have visited your standalone sim. Important for future development :D.
* Grid mode always returns 0 results until the Grid Communications portion is done.
This commit is contained in:
@@ -26,16 +26,22 @@
|
||||
*
|
||||
*/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using libsecondlife;
|
||||
using Mono.Data.SqliteClient;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Console;
|
||||
|
||||
|
||||
namespace OpenSim.Framework.Data.SQLite
|
||||
{
|
||||
/// <summary>
|
||||
/// A User storage interface for the DB4o database system
|
||||
/// </summary>
|
||||
///
|
||||
|
||||
|
||||
public class SQLiteUserData : SQLiteBase, IUserData
|
||||
{
|
||||
/// <summary>
|
||||
@@ -135,6 +141,53 @@ namespace OpenSim.Framework.Data.SQLite
|
||||
}
|
||||
}
|
||||
|
||||
public List<OpenSim.Framework.AvatarPickerAvatar> GeneratePickerResults(LLUUID queryID, string query)
|
||||
{
|
||||
List<OpenSim.Framework.AvatarPickerAvatar> returnlist = new List<OpenSim.Framework.AvatarPickerAvatar>();
|
||||
string[] querysplit;
|
||||
querysplit = query.Split(' ');
|
||||
if (querysplit.Length == 2)
|
||||
{
|
||||
string select = "username like '" + querysplit[0] + "%' and surname like '" + querysplit[1] + "%'";
|
||||
lock(ds)
|
||||
{
|
||||
DataRow[] rows = ds.Tables["users"].Select(select);
|
||||
if (rows.Length > 0)
|
||||
{
|
||||
for (int i = 0; i < rows.Length; i++)
|
||||
{
|
||||
OpenSim.Framework.AvatarPickerAvatar user = new OpenSim.Framework.AvatarPickerAvatar();
|
||||
DataRow row = rows[i];
|
||||
user.AvatarID = new LLUUID((string)row["UUID"]);
|
||||
user.firstName = (string)row["username"];
|
||||
user.lastName = (string)row["surname"];
|
||||
returnlist.Add(user);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (querysplit.Length == 1)
|
||||
{
|
||||
|
||||
string select = "username like '" + querysplit[0] + "%' OR surname like '" + querysplit[0] + "%'";
|
||||
lock(ds)
|
||||
{
|
||||
DataRow[] rows = ds.Tables["users"].Select(select);
|
||||
if (rows.Length > 0)
|
||||
{
|
||||
for (int i = 0;i<rows.Length;i++) {
|
||||
OpenSim.Framework.AvatarPickerAvatar user = new OpenSim.Framework.AvatarPickerAvatar();
|
||||
DataRow row = rows[i];
|
||||
user.AvatarID = new LLUUID((string)row[0]);
|
||||
user.firstName = (string)row[1];
|
||||
user.lastName = (string)row[2];
|
||||
returnlist.Add(user);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return returnlist;
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns a user by UUID direct
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user