本文整理汇总了C#中Entities.LeaveDynamicMap方法的典型用法代码示例。如果您正苦于以下问题:C# Entities.LeaveDynamicMap方法的具体用法?C# Entities.LeaveDynamicMap怎么用?C# Entities.LeaveDynamicMap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Entities
的用法示例。
在下文中一共展示了Entities.LeaveDynamicMap方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Handle
public static void Handle(Entities.GameClient client, GeneralDataPacket General)
{
client.AttackPacket = null;
if (client.Booth != null)
{
client.Booth.CancelBooth();
}
if (client.DynamicMap != null)
{
if (!client.LeaveDynamicMap())
{
client.NetworkClient.Disconnect("FAILED_TO_PORTAL_DYNAMIC_MAP");
}
return;
}
if (client.Map.InheritanceMap == client.Map.MapID)
{
Core.PortalPoint StartLocation = new Core.PortalPoint(client.Map.MapID, General.Data1Low, General.Data1High);
if (Core.Screen.ValidDistance(client.X, client.Y, StartLocation.X, StartLocation.Y))
{
if (Core.Kernel.Portals.ContainsKey(StartLocation))
{
Core.PortalPoint Destination;
if (Core.Kernel.Portals.TryGetValue(StartLocation, out Destination))
{
client.Teleport(Destination.MapID, Destination.X, Destination.Y);
return;
}
}
}
}
client.Teleport(client.Map.MapID, client.LastX, client.LastY);
}
示例2: LeaveWatcher
public void LeaveWatcher(Entities.GameClient Watcher)
{
Watcher.CanAttack = true;
if (!Watcher.LeaveDynamicMap())
Watcher.NetworkClient.Disconnect("Could not leave dynamic map...");
else
{
Watchers.Remove(Watcher);
Watcher.Arena.Status = Enums.ArenaStatus.NotSignedUp;
using (var wait = Watcher.Arena.Build())
Watcher.Send(wait);
}
}