本文整理汇总了C#中Interfaces.SendSpawn方法的典型用法代码示例。如果您正苦于以下问题:C# Interfaces.SendSpawn方法的具体用法?C# Interfaces.SendSpawn怎么用?C# Interfaces.SendSpawn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Interfaces
的用法示例。
在下文中一共展示了Interfaces.SendSpawn方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SendScreenSpawn
public void SendScreenSpawn(Interfaces.IMapObject obj, bool self)
{
foreach (Interfaces.IMapObject _obj in Screen.Objects)
{
if (_obj == null)
continue;
if (_obj.UID != Entity.UID)
{
if (_obj.MapObjType == Game.MapObjectType.Player)
{
GameState client = _obj.Owner as GameState;
obj.SendSpawn(client, false);
}
}
}
if (self)
obj.SendSpawn(this);
}
示例2: SendScreenSpawn
public void SendScreenSpawn(Interfaces.IMapObject obj, bool self)
{
for (int c = 0; c < Objects.Count; c++)
{
//For a multi threaded application, while we go through the collection
//the collection might change. We will make sure that we wont go off
//the limits with a check.
if (c >= Objects.Count)
break;
Interfaces.IMapObject _obj = Objects[c];
if (_obj == null)
continue;
if (_obj.UID != Owner.Entity.UID)
{
if (_obj.MapObjType == Game.MapObjectType.Player)
{
GameState client = _obj.Owner as GameState;
obj.SendSpawn(client, false);
}
}
}
if (self)
obj.SendSpawn(Owner, false);
}
示例3: SendScreenSpawn
public void SendScreenSpawn(Interfaces.IMapObject _object)
{
foreach (Client.GameState client in Program.Values)
{
if (client != null)
{
if (client.Entity.UID != ExcludeFromSend)
{
if (client.Map.ID == Owner.MapID)
{
if (ServerBase.Kernel.GetDistance(client.Entity.X, client.Entity.Y, Owner.X, Owner.Y) > 25)
{
continue;
}
_object.SendSpawn(client, false);
}
}
}
}
}
示例4: SendScreenSpawn
public void SendScreenSpawn(Interfaces.IMapObject obj, bool self)
{
try
{
foreach (Interfaces.IMapObject _obj in Screen.Objects)
{
if (_obj == null)
continue;
if (_obj.UID != Entity.UID)
{
if (_obj.MapObjType == Game.MapObjectType.Player)
{
byte spawnType = 0;
GameState client = _obj.Owner as GameState;
obj.SendSpawn(client, false);
byte[] array = new byte[Entity.SpawnPacket.Length];
Entity.SpawnPacket.CopyTo(array, 0);
// array[0x6d] = spawnType;
_obj.Owner.Send(array);
}
}
}
if (self)
obj.SendSpawn(this);
}
catch (Exception e)
{
Program.SaveException(e);
}
}