本文整理汇总了C#中Hypercube.Client.NetworkClient.ChangeMap方法的典型用法代码示例。如果您正苦于以下问题:C# NetworkClient.ChangeMap方法的具体用法?C# NetworkClient.ChangeMap怎么用?C# NetworkClient.ChangeMap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Hypercube.Client.NetworkClient
的用法示例。
在下文中一共展示了NetworkClient.ChangeMap方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TPHandler
private static void TPHandler(NetworkClient client, string[] args, string text1, string text2)
{
if (args.Length == 0 || args.Length > 1) {
Chat.SendClientChat(client, "§EIncorrect number of arguments. See /cmdhelp tp");
return;
}
NetworkClient tpClient;
if (!ServerCore.Nh.LoggedClients.TryGetValue(args[0], out tpClient)) {
Chat.SendClientChat(client, "§ECould not find a player called '" + args[0] + "'.");
return;
}
if (tpClient.CS.CurrentMap != client.CS.CurrentMap)
client.ChangeMap(tpClient.CS.CurrentMap);
if (client.CS.CurrentMap != tpClient.CS.CurrentMap)
return;
client.CS.MyEntity.Location = tpClient.CS.MyEntity.Location;
client.CS.MyEntity.Rot = tpClient.CS.MyEntity.Rot;
client.CS.MyEntity.Look = tpClient.CS.MyEntity.Look;
client.CS.MyEntity.SendOwn = true;
Chat.SendClientChat(client, "§STeleported.");
}
示例2: MapHandler
static void MapHandler(NetworkClient client, string[] args, string text1, string text2)
{
if (args.Length == 0) {
Chat.SendClientChat(client, "§EInvalid number of arguments. See /cmdhelp map");
return;
}
HypercubeMap m;
ServerCore.Maps.TryGetValue(args[0], out m);
if (m != null)
client.ChangeMap(m);
else
Chat.SendClientChat(client, "§EMap '" + args[0] + "' not found.");
}