Beispiel #1
0
        public CompressedGump(uint serial, uint tid, int bid, int[] switches, GumpTextEntry[] entries) : base(0xDD)
        {
            EnsureCapacity(3 + 4 + 4 + 4 + 4 + switches.Length * 4 + 4 + entries.Length * 4);

            Write((uint)serial);
            Write((uint)tid);

            Write((int)bid);

            Write((int)switches.Length);
            for (int i = 0; i < switches.Length; i++)
            {
                Write((int)switches[i]);
            }
            Write((int)entries.Length);
            for (int i = 0; i < entries.Length; i++)
            {
                GumpTextEntry gte = (GumpTextEntry)entries[i];
                Write((ushort)gte.EntryID);
                Write((ushort)(gte.Text.Length * 2));
                WriteBigUniFixed(gte.Text, gte.Text.Length);
            }
        }
Beispiel #2
0
        private static void ClientGumpResponse( PacketReader p, PacketHandlerEventArgs args )
        {
            if ( World.Player == null )
                return;

            Serial ser = p.ReadUInt32();
            uint tid = p.ReadUInt32();
            int bid = p.ReadInt32();

            World.Player.HasGump = false;

            int sc = p.ReadInt32();
            if ( sc < 0 || sc > 2000 )
                return;
            int[] switches = new int[sc];
            for(int i=0;i<sc;i++)
                switches[i] = p.ReadInt32();

            int ec = p.ReadInt32();
            if ( ec < 0 || ec > 2000 )
                return;
            GumpTextEntry[] entries = new GumpTextEntry[ec];
            for(int i=0;i<ec;i++)
            {
                ushort id = p.ReadUInt16();
                ushort len = p.ReadUInt16();
                if ( len >= 240 )
                    return;
                string text = p.ReadUnicodeStringSafe( len );
                entries[i] = new GumpTextEntry( id, text );
            }

            if ( Macros.MacroManager.AcceptActions )
                MacroManager.Action( new GumpResponseAction( bid, switches, entries ) );
        }
Beispiel #3
0
        public GumpResponse( uint serial, uint tid, int bid, int[] switches, GumpTextEntry[] entries )
            : base(0xB1)
        {
            EnsureCapacity( 3 + 4 + 4 + 4 + 4 + switches.Length*4 + 4 + entries.Length*4 );

            Write( (uint)serial );
            Write( (uint)tid );

            Write( (int)bid );

            Write( (int)switches.Length );
            for (int i=0;i<switches.Length;i++)
                Write( (int)switches[i] );
            Write( (int)entries.Length );
            for(int i=0;i<entries.Length;i++)
            {
                GumpTextEntry gte = (GumpTextEntry)entries[i];
                Write( (ushort)gte.EntryID );
                Write( (ushort)(gte.Text.Length*2) );
                WriteBigUniFixed( gte.Text, gte.Text.Length );
            }
        }