Add TeleportFlags.ViaRegionID to the flags sent on login when the region

was entered by hand to determine whether or not to honor the landing
point
avinationmerge
Melanie 2011-01-27 03:49:32 +01:00
parent 0e1d28a862
commit 3b8b606eeb
1 changed files with 13 additions and 8 deletions

View File

@ -327,7 +327,8 @@ namespace OpenSim.Services.LLLoginService
Vector3 position = Vector3.Zero; Vector3 position = Vector3.Zero;
Vector3 lookAt = Vector3.Zero; Vector3 lookAt = Vector3.Zero;
GridRegion gatekeeper = null; GridRegion gatekeeper = null;
GridRegion destination = FindDestination(account, scopeID, guinfo, session, startLocation, home, out gatekeeper, out where, out position, out lookAt); TeleportFlags flags;
GridRegion destination = FindDestination(account, scopeID, guinfo, session, startLocation, home, out gatekeeper, out where, out position, out lookAt, out flags);
if (destination == null) if (destination == null)
{ {
m_PresenceService.LogoutAgent(session); m_PresenceService.LogoutAgent(session);
@ -350,7 +351,7 @@ namespace OpenSim.Services.LLLoginService
string reason = string.Empty; string reason = string.Empty;
GridRegion dest; GridRegion dest;
AgentCircuitData aCircuit = LaunchAgentAtGrid(gatekeeper, destination, account, avatar, session, secureSession, position, where, AgentCircuitData aCircuit = LaunchAgentAtGrid(gatekeeper, destination, account, avatar, session, secureSession, position, where,
clientVersion, channel, mac, id0, clientIP, out where, out reason, out dest); clientVersion, channel, mac, id0, clientIP, flags, out where, out reason, out dest);
destination = dest; destination = dest;
if (aCircuit == null) if (aCircuit == null)
{ {
@ -385,8 +386,10 @@ namespace OpenSim.Services.LLLoginService
} }
} }
protected GridRegion FindDestination(UserAccount account, UUID scopeID, GridUserInfo pinfo, UUID sessionID, string startLocation, GridRegion home, out GridRegion gatekeeper, out string where, out Vector3 position, out Vector3 lookAt) protected GridRegion FindDestination(UserAccount account, UUID scopeID, GridUserInfo pinfo, UUID sessionID, string startLocation, GridRegion home, out GridRegion gatekeeper, out string where, out Vector3 position, out Vector3 lookAt, out TeleportFlags flags)
{ {
flags = TeleportFlags.ViaLogin;
m_log.DebugFormat("[LLOGIN SERVICE]: FindDestination for start location {0}", startLocation); m_log.DebugFormat("[LLOGIN SERVICE]: FindDestination for start location {0}", startLocation);
gatekeeper = null; gatekeeper = null;
@ -480,6 +483,8 @@ namespace OpenSim.Services.LLLoginService
} }
else else
{ {
flags |= TeleportFlags.ViaRegionID;
// free uri form // free uri form
// e.g. New Moon&135&46 New Moon@osgrid.org:8002&153&34 // e.g. New Moon&135&46 New Moon@osgrid.org:8002&153&34
where = "url"; where = "url";
@ -631,7 +636,7 @@ namespace OpenSim.Services.LLLoginService
protected AgentCircuitData LaunchAgentAtGrid(GridRegion gatekeeper, GridRegion destination, UserAccount account, AvatarAppearance avatar, protected AgentCircuitData LaunchAgentAtGrid(GridRegion gatekeeper, GridRegion destination, UserAccount account, AvatarAppearance avatar,
UUID session, UUID secureSession, Vector3 position, string currentWhere, string viewer, string channel, string mac, string id0, UUID session, UUID secureSession, Vector3 position, string currentWhere, string viewer, string channel, string mac, string id0,
IPEndPoint clientIP, out string where, out string reason, out GridRegion dest) IPEndPoint clientIP, TeleportFlags flags, out string where, out string reason, out GridRegion dest)
{ {
where = currentWhere; where = currentWhere;
ISimulationService simConnector = null; ISimulationService simConnector = null;
@ -670,7 +675,7 @@ namespace OpenSim.Services.LLLoginService
{ {
circuitCode = (uint)Util.RandomClass.Next(); ; circuitCode = (uint)Util.RandomClass.Next(); ;
aCircuit = MakeAgent(destination, account, avatar, session, secureSession, circuitCode, position, clientIP.Address.ToString(), viewer, channel, mac, id0); aCircuit = MakeAgent(destination, account, avatar, session, secureSession, circuitCode, position, clientIP.Address.ToString(), viewer, channel, mac, id0);
success = LaunchAgentDirectly(simConnector, destination, aCircuit, out reason); success = LaunchAgentDirectly(simConnector, destination, aCircuit, flags, out reason);
if (!success && m_GridService != null) if (!success && m_GridService != null)
{ {
// Try the fallback regions // Try the fallback regions
@ -679,7 +684,7 @@ namespace OpenSim.Services.LLLoginService
{ {
foreach (GridRegion r in fallbacks) foreach (GridRegion r in fallbacks)
{ {
success = LaunchAgentDirectly(simConnector, r, aCircuit, out reason); success = LaunchAgentDirectly(simConnector, r, aCircuit, flags | TeleportFlags.ViaRegionID, out reason);
if (success) if (success)
{ {
where = "safe"; where = "safe";
@ -802,9 +807,9 @@ namespace OpenSim.Services.LLLoginService
} }
private bool LaunchAgentDirectly(ISimulationService simConnector, GridRegion region, AgentCircuitData aCircuit, out string reason) private bool LaunchAgentDirectly(ISimulationService simConnector, GridRegion region, AgentCircuitData aCircuit, TeleportFlags flags, out string reason)
{ {
return simConnector.CreateAgent(region, aCircuit, (int)Constants.TeleportFlags.ViaLogin, out reason); return simConnector.CreateAgent(region, aCircuit, (uint)flags, out reason);
} }
private bool LaunchAgentIndirectly(GridRegion gatekeeper, GridRegion destination, AgentCircuitData aCircuit, IPEndPoint clientIP, out string reason) private bool LaunchAgentIndirectly(GridRegion gatekeeper, GridRegion destination, AgentCircuitData aCircuit, IPEndPoint clientIP, out string reason)