Acquire() public static method

public static Acquire ( Packet p ) : Packet
p Packet
return Packet
Example #1
0
        private static void Mobile_Dead(Mobile m, DeadEventArgs args)
        {
            var c = args.Corpse;

            var map = m.Map;

            if (map != null)
            {
                Packet animPacket = null;
                Packet remPacket  = null;

                foreach (var state in map.GetClientsInRange(m.Location))
                {
                    if (state != m.NetState)
                    {
                        if (animPacket == null)
                        {
                            animPacket = Packet.Acquire(new DeathAnimation(m, c));
                        }

                        state.Send(animPacket);

                        if (!state.Mobile.CanSee(m))
                        {
                            if (remPacket == null)
                            {
                                remPacket = m.RemovePacket;
                            }

                            state.Send(remPacket);
                        }
                    }
                }

                Packet.Release(animPacket);
            }
        }
        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();
            }
        }
Example #3
0
 public static Packet Acquire( Packet p )
 {
     p.Acquire();
     return p;
 }
Example #4
0
		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();
		}
Example #5
0
        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();
            }
        }
Example #6
0
 public static Packet Acquire(Packet p)
 {
     p.Acquire();
     return(p);
 }