Updated CacheUserName to work without circuit data on non-client manager actors. I need to fix this long term by creating a circuit data on non-cm actors and synchronizing properties across using sync layer.
parent
974292996a
commit
b71b7b2f7c
|
@ -3177,7 +3177,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
//public void AddNewClient2(IClientAPI client, bool managed)
|
//public void AddNewClient2(IClientAPI client, bool managed)
|
||||||
public void AddNewClient2(IClientAPI client, bool isSyncedAvatar, bool rezAttachment)
|
public void AddNewClient2(IClientAPI client, bool isSyncedAvatar, bool rezAttachment)
|
||||||
{
|
{
|
||||||
|
|
||||||
AgentCircuitData aCircuit = m_authenticateHandler.GetAgentCircuitData(client.CircuitCode);
|
AgentCircuitData aCircuit = m_authenticateHandler.GetAgentCircuitData(client.CircuitCode);
|
||||||
bool vialogin = false;
|
bool vialogin = false;
|
||||||
|
|
||||||
|
@ -3190,17 +3189,15 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
vialogin = (aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0 ||
|
vialogin = (aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0 ||
|
||||||
(aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0;
|
(aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
CheckHeartbeat();
|
CheckHeartbeat();
|
||||||
|
ScenePresence sp = GetScenePresence(client.AgentId);
|
||||||
if (GetScenePresence(client.AgentId) == null) // ensure there is no SP here
|
if ( sp == null) // ensure there is no SP here
|
||||||
{
|
{
|
||||||
m_log.DebugFormat("[SCENE ({0})]: Restoring agent {1} ({2})", m_regionName, client.Name, client.AgentId);
|
m_log.DebugFormat("[SCENE ({0})]: Restoring agent {1} ({2})", m_regionName, client.Name, client.AgentId);
|
||||||
|
|
||||||
m_clientManager.Add(client);
|
m_clientManager.Add(client);
|
||||||
SubscribeToClientEvents(client);
|
SubscribeToClientEvents(client);
|
||||||
|
sp = m_sceneGraph.CreateAndAddChildScenePresence(client, aCircuit == null ? null : aCircuit.Appearance);
|
||||||
ScenePresence sp = m_sceneGraph.CreateAndAddChildScenePresence(client, aCircuit == null ? null : aCircuit.Appearance);
|
|
||||||
sp.IsSyncedAvatar = isSyncedAvatar;
|
sp.IsSyncedAvatar = isSyncedAvatar;
|
||||||
m_eventManager.TriggerOnNewPresence(sp);
|
m_eventManager.TriggerOnNewPresence(sp);
|
||||||
|
|
||||||
|
@ -3219,14 +3216,17 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
Util.FireAndForget(delegate(object o) { sp.RezAttachments(); });
|
Util.FireAndForget(delegate(object o) { sp.RezAttachments(); });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
sp = GetScenePresence(client.AgentId);
|
||||||
if (GetScenePresence(client.AgentId) != null)
|
if (sp!= null)
|
||||||
{
|
{
|
||||||
m_LastLogin = Util.EnvironmentTickCount();
|
m_LastLogin = Util.EnvironmentTickCount();
|
||||||
|
|
||||||
// Cache the user's name
|
// Cache the user's name
|
||||||
CacheUserName(aCircuit);
|
|
||||||
|
|
||||||
|
if (aCircuit == null)
|
||||||
|
CacheUserName(sp.Firstname, sp.Lastname, sp.UUID, string.Empty);
|
||||||
|
else
|
||||||
|
CacheUserName(aCircuit);
|
||||||
EventManager.TriggerOnNewClient(client);
|
EventManager.TriggerOnNewClient(client);
|
||||||
if (vialogin)
|
if (vialogin)
|
||||||
EventManager.TriggerOnClientLogin(client);
|
EventManager.TriggerOnClientLogin(client);
|
||||||
|
@ -3234,24 +3234,31 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CacheUserName(AgentCircuitData aCircuit)
|
private void CacheUserName(AgentCircuitData aCircuit)
|
||||||
|
{
|
||||||
|
string homeURL = string.Empty;
|
||||||
|
string first = aCircuit.firstname, last = aCircuit.lastname;
|
||||||
|
UUID agentID = aCircuit.AgentID;
|
||||||
|
|
||||||
|
if (aCircuit.ServiceURLs.ContainsKey("HomeURI"))
|
||||||
|
homeURL = aCircuit.ServiceURLs["HomeURI"].ToString();
|
||||||
|
CacheUserName(first, last, agentID, homeURL);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CacheUserName(string first, string last, UUID agentID, string homeURL)
|
||||||
{
|
{
|
||||||
IUserManagement uMan = RequestModuleInterface<IUserManagement>();
|
IUserManagement uMan = RequestModuleInterface<IUserManagement>();
|
||||||
if (uMan != null)
|
if (uMan != null)
|
||||||
{
|
{
|
||||||
string homeURL = string.Empty;
|
if (last.StartsWith("@"))
|
||||||
string first = aCircuit.firstname, last = aCircuit.lastname;
|
|
||||||
if (aCircuit.ServiceURLs.ContainsKey("HomeURI"))
|
|
||||||
homeURL = aCircuit.ServiceURLs["HomeURI"].ToString();
|
|
||||||
if (aCircuit.lastname.StartsWith("@"))
|
|
||||||
{
|
{
|
||||||
string[] parts = aCircuit.firstname.Split('.');
|
string[] parts = first.Split('.');
|
||||||
if (parts.Length >= 2)
|
if (parts.Length >= 2)
|
||||||
{
|
{
|
||||||
first = parts[0];
|
first = parts[0];
|
||||||
last = parts[1];
|
last = parts[1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
uMan.AddUser(aCircuit.AgentID, first, last, homeURL);
|
uMan.AddUser(agentID, first, last, homeURL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue