本文整理汇总了C#中IClientAPI.SendTeleportFailed方法的典型用法代码示例。如果您正苦于以下问题:C# IClientAPI.SendTeleportFailed方法的具体用法?C# IClientAPI.SendTeleportFailed怎么用?C# IClientAPI.SendTeleportFailed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IClientAPI
的用法示例。
在下文中一共展示了IClientAPI.SendTeleportFailed方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TeleportClientHome
/// <summary>
/// Teleport an avatar to their home region
/// </summary>
/// <param name="agentId"></param>
/// <param name="client"></param>
public override void TeleportClientHome(UUID agentId, IClientAPI client)
{
m_log.Debug("[HGScene]: TeleportClientHome " + client.FirstName + " " + client.LastName);
CachedUserInfo uinfo = CommsManager.UserProfileCacheService.GetUserDetails(agentId);
if (uinfo != null)
{
UserProfileData UserProfile = uinfo.UserProfile;
if (UserProfile != null)
{
RegionInfo regionInfo = CommsManager.GridService.RequestNeighbourInfo(UserProfile.HomeRegion);
//if (regionInfo != null)
//{
// UserProfile.HomeRegionID = regionInfo.RegionID;
// //CommsManager.UserService.UpdateUserProfile(UserProfile);
//}
if (regionInfo == null)
{
// can't find the Home region: Tell viewer and abort
client.SendTeleportFailed("Your home-region could not be found.");
return;
}
RequestTeleportLocation(
client, regionInfo.RegionHandle, UserProfile.HomeLocation, UserProfile.HomeLookAt,
(uint)(TPFlags.SetLastToTarget | TPFlags.ViaHome));
}
}
else
client.SendTeleportFailed("Sorry! I lost your home-region information.");
}
示例2: RequestTeleportLocation
/// <summary>
/// Tries to teleport agent to another region.
/// </summary>
/// <remarks>
/// The region name must exactly match that given.
/// </remarks>
/// <param name="remoteClient"></param>
/// <param name="regionName"></param>
/// <param name="position"></param>
/// <param name="lookAt"></param>
/// <param name="teleportFlags"></param>
public void RequestTeleportLocation(IClientAPI remoteClient, string regionName, Vector3 position,
Vector3 lookat, uint teleportFlags)
{
GridRegion region = GridService.GetRegionByName(RegionInfo.ScopeID, regionName);
if (region == null)
{
// can't find the region: Tell viewer and abort
remoteClient.SendTeleportFailed("The region '" + regionName + "' could not be found.");
return;
}
RequestTeleportLocation(remoteClient, region.RegionHandle, position, lookat, teleportFlags);
}
示例3: TeleportClientHome
/// <summary>
/// Teleport an avatar to their home region
/// </summary>
/// <param name="agentId">The avatar's Unique ID</param>
/// <param name="client">The IClientAPI for the client</param>
public virtual void TeleportClientHome(UUID agentId, IClientAPI client)
{
if (EntityTransferModule != null)
{
EntityTransferModule.TeleportHome(agentId, client);
}
else
{
m_log.DebugFormat("[SCENE]: Unable to teleport user home: no AgentTransferModule is active");
client.SendTeleportFailed("Unable to perform teleports on this simulator.");
}
}
示例4: TeleportHome
public override void TeleportHome(UUID id, IClientAPI client)
{
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.FirstName, client.LastName);
// Let's find out if this is a foreign user or a local user
UserAccount account = m_aScene.UserAccountService.GetUserAccount(m_aScene.RegionInfo.ScopeID, id);
if (account != null)
{
// local grid user
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: User is local");
base.TeleportHome(id, client);
return;
}
// Foreign user wants to go home
//
AgentCircuitData aCircuit = ((Scene)(client.Scene)).AuthenticateHandler.GetAgentCircuitData(client.CircuitCode);
if (aCircuit == null || (aCircuit != null && !aCircuit.ServiceURLs.ContainsKey("HomeURI")))
{
client.SendTeleportFailed("Your information has been lost");
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Unable to locate agent's gateway information");
return;
}
IUserAgentService userAgentService = new UserAgentServiceConnector(aCircuit.ServiceURLs["HomeURI"].ToString());
Vector3 position = Vector3.UnitY, lookAt = Vector3.UnitY;
GridRegion finalDestination = userAgentService.GetHomeRegion(aCircuit.AgentID, out position, out lookAt);
if (finalDestination == null)
{
client.SendTeleportFailed("Your home region could not be found");
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Agent's home region not found");
return;
}
ScenePresence sp = ((Scene)(client.Scene)).GetScenePresence(client.AgentId);
if (sp == null)
{
client.SendTeleportFailed("Internal error");
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Agent not found in the scene where it is supposed to be");
return;
}
IEventQueue eq = sp.Scene.RequestModuleInterface<IEventQueue>();
GridRegion homeGatekeeper = MakeRegion(aCircuit);
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: teleporting user {0} {1} home to {2} via {3}:{4}:{5}",
aCircuit.firstname, aCircuit.lastname, finalDestination.RegionName, homeGatekeeper.ExternalHostName, homeGatekeeper.HttpPort, homeGatekeeper.RegionName);
DoTeleport(sp, homeGatekeeper, finalDestination, position, lookAt, (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaHome), eq);
}
示例5: TeleportHome
public virtual bool TeleportHome(UUID id, IClientAPI client)
{
//MainConsole.Instance.DebugFormat("[ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.FirstName, client.LastName);
UserInfo uinfo =
client.Scene.RequestModuleInterface<IAgentInfoService>().GetUserInfo(client.AgentId.ToString());
if (uinfo != null)
{
GridRegion regionInfo = client.Scene.GridService.GetRegionByUUID(client.AllScopeIDs, uinfo.HomeRegionID);
if (regionInfo == null)
{
//can't find the Home region: Tell viewer and abort
client.SendTeleportFailed("Your home region could not be found.");
return false;
}
MainConsole.Instance.DebugFormat("[ENTITY TRANSFER MODULE]: User's home region is {0} {1} ({2}-{3})",
regionInfo.RegionName, regionInfo.RegionID,
regionInfo.RegionLocX/Constants.RegionSize,
regionInfo.RegionLocY/Constants.RegionSize);
RequestTeleportLocation(
client, regionInfo, uinfo.HomePosition, uinfo.HomeLookAt,
(uint) (TeleportFlags.SetLastToTarget | TeleportFlags.ViaHome));
}
else
{
//Default region time...
List<GridRegion> Regions = client.Scene.GridService.GetDefaultRegions(client.AllScopeIDs);
if (Regions.Count != 0)
{
MainConsole.Instance.DebugFormat(
"[ENTITY TRANSFER MODULE]: User's home region was not found, using {0} {1} ({2}-{3})",
Regions[0].RegionName, Regions[0].RegionID, Regions[0].RegionLocX/Constants.RegionSize,
Regions[0].RegionLocY/Constants.RegionSize);
RequestTeleportLocation(
client, Regions[0], new Vector3(128, 128, 25), new Vector3(128, 128, 128),
(uint) (TeleportFlags.SetLastToTarget | TeleportFlags.ViaHome));
}
else
return false;
}
return true;
}
示例6: RequestTeleportLocation
/// <summary>
/// Tries to teleport agent to other region.
/// </summary>
/// <param name="remoteClient"></param>
/// <param name="regionName"></param>
/// <param name="position"></param>
/// <param name="lookat"></param>
/// <param name="teleportFlags"></param>
public void RequestTeleportLocation(IClientAPI remoteClient, string regionName, Vector3 position,
Vector3 lookat, uint teleportFlags)
{
GridRegion regionInfo =
remoteClient.Scene.RequestModuleInterface<IGridService>()
.GetRegionByName(remoteClient.AllScopeIDs, regionName);
if (regionInfo == null)
{
// can't find the region: Tell viewer and abort
remoteClient.SendTeleportFailed("The region '" + regionName + "' could not be found.");
return;
}
RequestTeleportLocation(remoteClient, regionInfo, position, lookat, teleportFlags);
}
示例7: TeleportHome
public virtual bool TeleportHome(UUID id, IClientAPI client)
{
m_log.DebugFormat(
"[ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.Name, client.AgentId);
//OpenSim.Services.Interfaces.PresenceInfo pinfo = Scene.PresenceService.GetAgent(client.SessionId);
GridUserInfo uinfo = Scene.GridUserService.GetGridUserInfo(client.AgentId.ToString());
if (uinfo != null)
{
if (uinfo.HomeRegionID == UUID.Zero)
{
// can't find the Home region: Tell viewer and abort
m_log.ErrorFormat("{0} No grid user info found for {1} {2}. Cannot send home.",
LogHeader, client.Name, client.AgentId);
client.SendTeleportFailed("You don't have a home position set.");
return false;
}
GridRegion regionInfo = Scene.GridService.GetRegionByUUID(UUID.Zero, uinfo.HomeRegionID);
if (regionInfo == null)
{
// can't find the Home region: Tell viewer and abort
client.SendTeleportFailed("Your home region could not be found.");
return false;
}
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Home region of {0} is {1} ({2}-{3})",
client.Name, regionInfo.RegionName, regionInfo.RegionCoordX, regionInfo.RegionCoordY);
// a little eekie that this goes back to Scene and with a forced cast, will fix that at some point...
((Scene)(client.Scene)).RequestTeleportLocation(
client, regionInfo.RegionHandle, uinfo.HomePosition, uinfo.HomeLookAt,
(uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaHome));
return true;
}
else
{
// can't find the Home region: Tell viewer and abort
client.SendTeleportFailed("Your home region could not be found.");
}
return false;
}
示例8: RequestTeleportLandmark
/// <summary>
/// Tries to teleport agent to landmark.
/// </summary>
/// <param name="remoteClient"></param>
/// <param name="regionHandle"></param>
/// <param name="position"></param>
public virtual void RequestTeleportLandmark(IClientAPI remoteClient, AssetLandmark lm)
{
GridRegion info = m_aScene.GridService.GetRegionByUUID(UUID.Zero, lm.RegionID);
if (info == null)
{
// can't find the region: Tell viewer and abort
remoteClient.SendTeleportFailed("The teleport destination could not be found.");
return;
}
((Scene)(remoteClient.Scene)).RequestTeleportLocation(remoteClient, info.RegionHandle, lm.Position,
Vector3.Zero, (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaLandmark));
}
示例9: TeleportClientHome
/// <summary>
/// Teleport an avatar to their home region
/// </summary>
/// <param name="agentId"></param>
/// <param name="client"></param>
public virtual void TeleportClientHome(UUID agentId, IClientAPI client)
{
UserProfileData UserProfile = CommsManager.UserService.GetUserProfile(agentId);
if (UserProfile != null)
{
RegionInfo regionInfo = CommsManager.GridService.RequestNeighbourInfo(UserProfile.HomeRegionID);
if (regionInfo == null)
{
regionInfo = CommsManager.GridService.RequestNeighbourInfo(UserProfile.HomeRegion);
if (regionInfo != null) // home region can be away temporarily, too
{
UserProfile.HomeRegionID = regionInfo.RegionID;
CommsManager.UserService.UpdateUserProfile(UserProfile);
}
}
if (regionInfo == null)
{
// can't find the Home region: Tell viewer and abort
client.SendTeleportFailed("Your home-region could not be found.");
return;
}
RequestTeleportLocation(
client, regionInfo.RegionHandle, UserProfile.HomeLocation, UserProfile.HomeLookAt,
(uint)(TPFlags.SetLastToTarget | TPFlags.ViaHome));
}
}
示例10: RequestTeleportLandmark
/// <summary>
/// Tries to teleport agent to landmark.
/// </summary>
/// <param name="remoteClient"></param>
/// <param name="regionHandle"></param>
/// <param name="position"></param>
public void RequestTeleportLandmark(IClientAPI remoteClient, UUID regionID, Vector3 position)
{
RegionInfo info = CommsManager.GridService.RequestNeighbourInfo(regionID);
if (info == null)
{
// can't find the region: Tell viewer and abort
remoteClient.SendTeleportFailed("The teleport destination could not be found.");
return;
}
RequestTeleportLocation(remoteClient, info.RegionHandle, position, Vector3.Zero, (uint)(TPFlags.SetLastToTarget | TPFlags.ViaLandmark));
}
示例11: RequestTeleportLandmark
/// <summary>
/// Tries to teleport agent to landmark.
/// </summary>
/// <param name="remoteClient"></param>
/// <param name="regionHandle"></param>
/// <param name="position"></param>
public override void RequestTeleportLandmark(IClientAPI remoteClient, AssetLandmark lm)
{
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Teleporting agent via landmark to {0} region {1} position {2}",
(lm.Gatekeeper == string.Empty) ? "local" : lm.Gatekeeper, lm.RegionID, lm.Position);
if (lm.Gatekeeper == string.Empty)
{
base.RequestTeleportLandmark(remoteClient, lm);
return;
}
GridRegion info = Scene.GridService.GetRegionByUUID(UUID.Zero, lm.RegionID);
// Local region?
if (info != null)
{
Scene.RequestTeleportLocation(
remoteClient, info.RegionHandle, lm.Position,
Vector3.Zero, (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaLandmark));
}
else
{
// Foreign region
GatekeeperServiceConnector gConn = new GatekeeperServiceConnector();
GridRegion gatekeeper = new GridRegion();
gatekeeper.ServerURI = lm.Gatekeeper;
string homeURI = Scene.GetAgentHomeURI(remoteClient.AgentId);
string message;
GridRegion finalDestination = gConn.GetHyperlinkRegion(gatekeeper, new UUID(lm.RegionID), remoteClient.AgentId, homeURI, out message);
if (finalDestination != null)
{
ScenePresence sp = Scene.GetScenePresence(remoteClient.AgentId);
if (sp != null)
{
if (message != null)
sp.ControllingClient.SendAgentAlertMessage(message, true);
// Validate assorted conditions
string reason = string.Empty;
if (!ValidateGenericConditions(sp, gatekeeper, finalDestination, 0, out reason))
{
sp.ControllingClient.SendTeleportFailed(reason);
return;
}
DoTeleport(
sp, gatekeeper, finalDestination, lm.Position, Vector3.UnitX,
(uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaLandmark));
}
}
else
{
remoteClient.SendTeleportFailed(message);
}
}
}
示例12: TeleportHome
public virtual bool TeleportHome(UUID id, IClientAPI client)
{
//m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.FirstName, client.LastName);
//OpenSim.Services.Interfaces.PresenceInfo pinfo = m_aScene.PresenceService.GetAgent(client.SessionId);
UserInfo uinfo = client.Scene.RequestModuleInterface<IAgentInfoService>().GetUserInfo(client.AgentId.ToString());
IUserAgentService uas = client.Scene.RequestModuleInterface<IUserAgentService> ();
if (uinfo != null)
{
GridRegion regionInfo = client.Scene.GridService.GetRegionByUUID(UUID.Zero, uinfo.HomeRegionID);
if (regionInfo == null)
{
Vector3 position = Vector3.Zero, lookAt = Vector3.Zero;
if (uas != null)
regionInfo = uas.GetHomeRegion (client.Scene.AuthenticateHandler.AgentCircuitsByUUID[client.AgentId], out position, out lookAt);
if (regionInfo == null)
{
//can't find the Home region: Tell viewer and abort
client.SendTeleportFailed ("Your home region could not be found.");
return false;
}
}
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: User's home region is {0} {1} ({2}-{3})",
regionInfo.RegionName, regionInfo.RegionID, regionInfo.RegionLocX / Constants.RegionSize, regionInfo.RegionLocY / Constants.RegionSize);
RequestTeleportLocation(
client, regionInfo, uinfo.HomePosition, uinfo.HomeLookAt,
(uint)(TeleportFlags.SetLastToTarget | TeleportFlags.ViaHome));
}
else
{
//Default region time...
List<GridRegion> Regions = client.Scene.GridService.GetDefaultRegions(UUID.Zero);
if(Regions.Count != 0)
{
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: User's home region was not found, using {0} {1} ({2}-{3})",
Regions[0].RegionName, Regions[0].RegionID, Regions[0].RegionLocX / Constants.RegionSize, Regions[0].RegionLocY / Constants.RegionSize);
RequestTeleportLocation(
client, Regions[0], new Vector3(128, 128, 25), new Vector3(128, 128, 128),
(uint)(TeleportFlags.SetLastToTarget | TeleportFlags.ViaHome));
}
else
return false;
}
return true;
}
示例13: TeleportClientHome
/// <summary>
/// Teleport an avatar to their home region
/// </summary>
/// <param name="agentId">The avatar's Unique ID</param>
/// <param name="client">The IClientAPI for the client</param>
public virtual void TeleportClientHome(UUID agentId, IClientAPI client)
{
UserProfileData UserProfile = CommsManager.UserService.GetUserProfile(agentId);
if (UserProfile != null)
{
GridRegion regionInfo = GridService.GetRegionByUUID(UUID.Zero, UserProfile.HomeRegionID);
if (regionInfo == null)
{
uint x = 0, y = 0;
Utils.LongToUInts(UserProfile.HomeRegion, out x, out y);
regionInfo = GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y);
if (regionInfo != null) // home region can be away temporarily, too
{
UserProfile.HomeRegionID = regionInfo.RegionID;
CommsManager.UserService.UpdateUserProfile(UserProfile);
}
}
if (regionInfo == null)
{
// can't find the Home region: Tell viewer and abort
client.SendTeleportFailed("Your home-region could not be found.");
return;
}
RequestTeleportLocation(
client, regionInfo.RegionHandle, UserProfile.HomeLocation, UserProfile.HomeLookAt,
(uint)(TPFlags.SetLastToTarget | TPFlags.ViaHome));
}
}
示例14: TeleportHome
public override bool TeleportHome(UUID id, IClientAPI client)
{
m_log.DebugFormat(
"[ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.Name, client.AgentId);
// Let's find out if this is a foreign user or a local user
IUserManagement uMan = Scene.RequestModuleInterface<IUserManagement>();
if (uMan != null && uMan.IsLocalGridUser(id))
{
// local grid user
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: User is local");
return base.TeleportHome(id, client);
}
// Foreign user wants to go home
//
AgentCircuitData aCircuit = ((Scene)(client.Scene)).AuthenticateHandler.GetAgentCircuitData(client.CircuitCode);
if (aCircuit == null || (aCircuit != null && !aCircuit.ServiceURLs.ContainsKey("HomeURI")))
{
client.SendTeleportFailed("Your information has been lost");
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Unable to locate agent's gateway information");
return false;
}
IUserAgentService userAgentService = new UserAgentServiceConnector(aCircuit.ServiceURLs["HomeURI"].ToString());
Vector3 position = Vector3.UnitY, lookAt = Vector3.UnitY;
GridRegion finalDestination = null;
try
{
finalDestination = userAgentService.GetHomeRegion(aCircuit.AgentID, out position, out lookAt);
}
catch (Exception e)
{
m_log.Debug("[HG ENTITY TRANSFER MODULE]: GetHomeRegion call failed ", e);
}
if (finalDestination == null)
{
client.SendTeleportFailed("Your home region could not be found");
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Agent's home region not found");
return false;
}
ScenePresence sp = ((Scene)(client.Scene)).GetScenePresence(client.AgentId);
if (sp == null)
{
client.SendTeleportFailed("Internal error");
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Agent not found in the scene where it is supposed to be");
return false;
}
GridRegion homeGatekeeper = MakeRegion(aCircuit);
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: teleporting user {0} {1} home to {2} via {3}:{4}",
aCircuit.firstname, aCircuit.lastname, finalDestination.RegionName, homeGatekeeper.ServerURI, homeGatekeeper.RegionName);
DoTeleport(
sp, homeGatekeeper, finalDestination,
position, lookAt, (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaHome));
return true;
}
示例15: RequestTeleportLandmark
/// <summary>
/// Tries to teleport agent to landmark.
/// </summary>
/// <param name="remoteClient"></param>
/// <param name="gatekeeperURL"></param>
/// <param name="position"></param>
/// <param name="regionID"></param>
public void RequestTeleportLandmark (IClientAPI remoteClient, UUID regionID, string gatekeeperURL, Vector3 position)
{
GridRegion info = null;
try
{
info = remoteClient.Scene.RequestModuleInterface<IGridService>().GetRegionByUUID(remoteClient.AllScopeIDs, regionID);
}
catch( Exception ex)
{
MainConsole.Instance.Warn("[EntityTransferModule]: Error finding landmark's region for user " + remoteClient.Name + ", " + ex);
}
if (info == null)
{
if (!string.IsNullOrEmpty(gatekeeperURL))
{
info = new GridRegion
{
ServerURI = gatekeeperURL,
RegionID = regionID,
Flags =
(int)
(Aurora.Framework.RegionFlags.Foreign | Aurora.Framework.RegionFlags.Hyperlink)
};
}
else
{
// can't find the region: Tell viewer and abort
remoteClient.SendTeleportFailed ("The teleport destination could not be found.");
return;
}
}
RequestTeleportLocation(remoteClient, info, position, Vector3.Zero, (uint)(TeleportFlags.SetLastToTarget | TeleportFlags.ViaLandmark));
}