2007-05-07 03:57:39 +00:00
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Text;
|
|
|
|
using OpenGrid.Framework.Data;
|
|
|
|
using libsecondlife;
|
|
|
|
|
|
|
|
namespace OpenGrid.Framework.Data.DB4o
|
|
|
|
{
|
|
|
|
public class DB4oUserData : IUserData
|
|
|
|
{
|
2007-05-07 04:26:22 +00:00
|
|
|
DB4oUserManager manager = new DB4oUserManager("userprofiles.yap");
|
|
|
|
|
2007-05-07 03:57:39 +00:00
|
|
|
public UserProfileData getUserByUUID(LLUUID uuid)
|
|
|
|
{
|
2007-05-07 04:26:22 +00:00
|
|
|
if(manager.userProfiles.ContainsKey(uuid))
|
|
|
|
return manager.userProfiles[uuid];
|
|
|
|
return null;
|
2007-05-07 03:57:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public UserProfileData getUserByName(string name)
|
|
|
|
{
|
2007-05-07 04:26:22 +00:00
|
|
|
return getUserByName(name.Split(' ')[0], name.Split(' ')[1]);
|
2007-05-07 03:57:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public UserProfileData getUserByName(string fname, string lname)
|
|
|
|
{
|
2007-05-07 04:26:22 +00:00
|
|
|
foreach (UserProfileData profile in manager.userProfiles.Values)
|
|
|
|
{
|
|
|
|
if (profile.username == fname && profile.surname == lname)
|
|
|
|
return profile;
|
|
|
|
}
|
|
|
|
return null;
|
2007-05-07 03:57:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public UserAgentData getAgentByUUID(LLUUID uuid)
|
|
|
|
{
|
2007-05-07 04:26:22 +00:00
|
|
|
try
|
|
|
|
{
|
|
|
|
return getUserByUUID(uuid).currentAgent;
|
|
|
|
}
|
|
|
|
catch (Exception e)
|
|
|
|
{
|
|
|
|
return null;
|
|
|
|
}
|
2007-05-07 03:57:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public UserAgentData getAgentByName(string name)
|
|
|
|
{
|
2007-05-07 04:26:22 +00:00
|
|
|
return getAgentByName(name.Split(' ')[0], name.Split(' ')[1]);
|
2007-05-07 03:57:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public UserAgentData getAgentByName(string fname, string lname)
|
|
|
|
{
|
2007-05-07 04:26:22 +00:00
|
|
|
try
|
|
|
|
{
|
|
|
|
return getUserByName(fname,lname).currentAgent;
|
|
|
|
}
|
|
|
|
catch (Exception e)
|
|
|
|
{
|
|
|
|
return null;
|
|
|
|
}
|
2007-05-07 03:57:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public bool moneyTransferRequest(LLUUID from, LLUUID to, uint amount)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
public bool inventoryTransferRequest(LLUUID from, LLUUID to, LLUUID item)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|