本文整理汇总了C#中MinecraftServer.GetClientsInWorld方法的典型用法代码示例。如果您正苦于以下问题:C# MinecraftServer.GetClientsInWorld方法的具体用法?C# MinecraftServer.GetClientsInWorld怎么用?C# MinecraftServer.GetClientsInWorld使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MinecraftServer
的用法示例。
在下文中一共展示了MinecraftServer.GetClientsInWorld方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandlePacket
public override void HandlePacket(MinecraftServer Server, ref MinecraftClient Client)
{
switch (Action)
{
case EntityAction.Crouch:
Client.IsCrouching = true;
break;
case EntityAction.Uncrouch:
Client.IsCrouching = false;
break;
case EntityAction.StartSprinting:
Client.IsSprinting = true;
break;
case EntityAction.StopSprinting:
Client.IsSprinting = false;
break;
}
if (Action != EntityAction.LeaveBed) // NOTE: Does this matter?
{
this.EntityId = Client.Entity.Id;
for (int i = 0; i <
Server.GetClientsInWorld(Server.GetClientWorld(Client)).Count(); i++)
{
if (Server.Clients [i] != Client)
Server.Clients [i].SendPacket(this);
}
Server.ProcessSendQueue();
}
}
示例2: HandlePacket
public override void HandlePacket(MinecraftServer server, MinecraftClient client)
{
EntityId = client.Entity.Id;
var clients = server.GetClientsInWorld(server.GetClientWorld(client)).Where(c => c.Entity.Id != EntityId);
foreach (var _client in clients)
_client.SendPacket(this);
server.ProcessSendQueue();
}