Add a careminster API to scripting again

This commit is contained in:
Melanie
2011-01-24 02:16:28 +01:00
parent 105deab601
commit dbbf43663e
4 changed files with 32 additions and 0 deletions

View File

@@ -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)

View File

@@ -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);
}
}
}
}