本文整理汇总了C#中Server.Network.Packet.Acquire方法的典型用法代码示例。如果您正苦于以下问题:C# Packet.Acquire方法的具体用法?C# Packet.Acquire怎么用?C# Packet.Acquire使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Network.Packet
的用法示例。
在下文中一共展示了Packet.Acquire方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SendPacket
public static void SendPacket( IPoint3D origin, Map map, Packet p )
{
if ( map != null )
{
IPooledEnumerable eable = map.GetClientsInRange( new Point3D( origin ) );
p.Acquire();
foreach ( NetState state in eable )
{
state.Mobile.ProcessDelta();
state.Send( p );
}
p.Release();
eable.Free();
}
}
示例2: SendToAll
public void SendToAll( Packet p )
{
p.Acquire();
for ( int i = 0; i < m_Members.Count; ++i )
m_Members[i].Mobile.Send( p );
if ( p is MessageLocalized || p is MessageLocalizedAffix || p is UnicodeMessage || p is AsciiMessage )
{
for ( int i = 0; i < m_Listeners.Count; ++i )
{
Mobile mob = m_Listeners[i];
if ( mob.Party != this )
mob.Send( p );
}
}
p.Release();
}
示例3: Acquire
public static Packet Acquire( Packet p )
{
p.Acquire();
return p;
}
示例4: SendPacket
public static void SendPacket( IPoint3D origin, IMap map, Packet p )
{
if ( map != null )
{
p.Acquire();
foreach ( GameClient state in map.GetClientsInRange( origin ) )
{
state.Mobile.ProcessDelta();
state.Send( p );
}
if ( p != null )
p.Release();
}
}