Exemple #1
0
        public static Packet Compress(Packet p)
        {
            int length;
            byte[] source = p.Compile(false, out length);

            if (length > 100 && length < 60000)
            {
                byte[] dest = new byte[(int)(length * 1.001) + 10];
                int destSize = dest.Length;

                ZLibError error = Compression.Pack(dest, ref destSize, source, length, ZLibQuality.Default);

                if (error != ZLibError.Okay)
                {
                    Console.WriteLine("WARNING: Unable to compress admin packet, zlib error: {0}", error);
                    return p;
                }
                else
                {
                    return new AdminCompressedPacket(dest, destSize, length);
                }
            }
            else
            {
                return p;
            }
        }
Exemple #2
0
        public static void Initialize()
        {
            m_OldEFHandler = PacketHandlers.GetHandler(0xEF);
            PacketHandlers.Register(0xEF, 21, false, new Server.Network.OnPacketReceive(LoginServerSeed));
            PacketHandlers.Register(Config.EncapsulationHeader, 0, false, new Server.Network.OnPacketReceive(UOExtPacket));

            uint ip = (uint)(BitConverter.ToInt32(IPAddress.Parse(Config.IP).GetAddressBytes(), 0));

            m_UOExtSupport = new UOExtSupport();
            m_UOExtSupport.SetStatic();

            m_handler = UOExt.PacketHandler.Instatinate();

            Console.WriteLine("UOExt: Adapter started.");
        }
Exemple #3
0
        public static void Initialize()
        {
            m_OldEFHandler = PacketHandlers.GetHandler(0xEF);
            PacketHandlers.Register(0xEF, 21, false, new Server.Network.OnPacketReceive(LoginServerSeed));
            PacketHandlers.Register(Config.EncapsulationHeader, 0, false, new Server.Network.OnPacketReceive(UOExtPacket));

            uint ip = (uint)(BitConverter.ToInt32(IPAddress.Parse(Config.IP).GetAddressBytes(), 0));

            m_UOExtSupport = new UOExtSupport();
            m_UOExtSupport.SetStatic();

            m_handler = UOExt.PacketHandler.Instatinate();

            Console.WriteLine("UOExt: Adapter started.");
        }
		public void OnRevised()
		{
			lock( this )
			{
				m_Revision = ++m_Foundation.LastRevision;

				if( m_PacketCache != null )
					m_PacketCache.Release();

				m_PacketCache = null;
			}
		}
Exemple #5
0
 public static Packet SetStatic( Packet p )
 {
     p.SetStatic();
     return p;
 }
Exemple #6
0
 public static void Release( Packet p )
 {
     if ( p != null )
         p.Release();
 }
Exemple #7
0
        public static void Release( ref Packet p )
        {
            if ( p != null )
                p.Release();

            p = null;
        }
Exemple #8
0
 public static Packet Acquire( Packet p )
 {
     p.Acquire();
     return p;
 }
Exemple #9
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();
		}
Exemple #10
0
        public override void SendSingleClickTo( Mobile from )
        {
            if ( !IsMagic || !( m_Identified.Contains( from ) || from.AccessLevel > AccessLevel.Counselor ) )
            {
                base.SendSingleClickTo( from );
            }
            else
            {
                if ( m_MagicSingleClick == null )
                {
                    m_MagicSingleClick = new AsciiMessage( Serial, ItemID, MessageType.Label, 0x3B2, 3, "", BuildMagicSingleClick() );
                    m_MagicSingleClick.SetStatic();
                }

                from.NetState.Send( m_MagicSingleClick );
            }
        }
 public void SendDetailedInfoTo(NetState state)
 {
     if (state != null)
     {
         lock (this)
         {
             if (m_InfoPacket == null)
                 m_InfoPacket = new DesignStateDetailed(Serial, 0, Components.Min.X, Components.Min.Y, Components.Max.X, Components.Max.Y, Components.List);
             Packet p = m_InfoPacket;
             p.SetStatic();
             state.Send(p);
         }
     }
 }
			public PacketInfo(NetState state, Packet packet)
			{
				State = state;
				Packet = packet;
			}