Add a careminster API to scripting again
parent
105deab601
commit
dbbf43663e
|
@ -33,6 +33,7 @@ using OpenSim.Region.Framework.Interfaces;
|
|||
using OpenSim.Region.Framework.Scenes;
|
||||
using OpenSim.Services.Interfaces;
|
||||
using OpenSim.Services.Connectors;
|
||||
using OpenSim.Framework;
|
||||
|
||||
using OpenMetaverse;
|
||||
|
||||
|
@ -101,6 +102,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
|
|||
return;
|
||||
|
||||
scene.RegisterModuleInterface<IUserAccountService>(this);
|
||||
|
||||
scene.EventManager.OnNewClient += OnNewClient;
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
|
@ -115,6 +118,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
|
|||
return;
|
||||
}
|
||||
|
||||
// When a user actually enters the sim, clear them from
|
||||
// cache so the sim will have the current values for
|
||||
// flags, title, etc. And country, don't forget country!
|
||||
private void OnNewClient(IClientAPI client)
|
||||
{
|
||||
m_Cache.Remove(client.Name);
|
||||
}
|
||||
|
||||
#region Overwritten methods from IUserAccountService
|
||||
|
||||
public override UserAccount GetUserAccount(UUID scopeID, UUID userID)
|
||||
|
|
|
@ -91,5 +91,18 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
|
|||
|
||||
return null;
|
||||
}
|
||||
|
||||
public void Remove(string name)
|
||||
{
|
||||
if (!m_NameCache.Contains(name))
|
||||
return;
|
||||
|
||||
UUID uuid = UUID.Zero;
|
||||
if (m_NameCache.TryGetValue(name, out uuid))
|
||||
{
|
||||
m_NameCache.Remove(name);
|
||||
m_UUIDCache.Remove(uuid);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -63,6 +63,7 @@ namespace OpenSim.Services.Interfaces
|
|||
public int UserLevel;
|
||||
public int UserFlags;
|
||||
public string UserTitle;
|
||||
public string UserCountry;
|
||||
|
||||
public Dictionary<string, object> ServiceURLs;
|
||||
|
||||
|
@ -91,6 +92,8 @@ namespace OpenSim.Services.Interfaces
|
|||
UserFlags = Convert.ToInt32(kvp["UserFlags"].ToString());
|
||||
if (kvp.ContainsKey("UserTitle"))
|
||||
UserTitle = kvp["UserTitle"].ToString();
|
||||
if (kvp.ContainsKey("UserCountry"))
|
||||
UserCountry = kvp["UserCountry"].ToString();
|
||||
|
||||
if (kvp.ContainsKey("Created"))
|
||||
Created = Convert.ToInt32(kvp["Created"].ToString());
|
||||
|
@ -124,6 +127,7 @@ namespace OpenSim.Services.Interfaces
|
|||
result["UserLevel"] = UserLevel.ToString();
|
||||
result["UserFlags"] = UserFlags.ToString();
|
||||
result["UserTitle"] = UserTitle;
|
||||
result["UserCountry"] = UserCountry;
|
||||
|
||||
string str = string.Empty;
|
||||
foreach (KeyValuePair<string, object> kvp in ServiceURLs)
|
||||
|
|
|
@ -148,6 +148,10 @@ namespace OpenSim.Services.UserAccountService
|
|||
Int32.TryParse(d.Data["UserLevel"], out u.UserLevel);
|
||||
if (d.Data.ContainsKey("UserFlags") && d.Data["UserFlags"] != null)
|
||||
Int32.TryParse(d.Data["UserFlags"], out u.UserFlags);
|
||||
if (d.Data.ContainsKey("UserCountry") && d.Data["UserCountry"] != null)
|
||||
u.UserCountry = d.Data["UserCountry"].ToString();
|
||||
else
|
||||
u.UserTitle = string.Empty;
|
||||
|
||||
if (d.Data.ContainsKey("ServiceURLs") && d.Data["ServiceURLs"] != null)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue