本文整理匯總了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();
}
}