public static void CloseAndSendGump(NetState ns, Gump g, params Type[] types)
{
if (ns == null)
return;
for (int i = 0; i < types.Length; ++i)
ns.Send(new CloseGump(Gump.GetTypeID(types[i]), 0));
g.SendTo(ns);
/*ns.AddGump( g );
Packet[] packets = new Packet[types.Length + 1];
for ( int i = 0; i < types.Length; ++i )
packets[i] = new CloseGump( Gump.GetTypeID( types[i] ), 0 );
packets[types.Length] = (Packet) typeof( Gump ).InvokeMember( "Compile", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.InvokeMethod, null, g, null, null );
bool compress = ns.CompressionEnabled;
ns.CompressionEnabled = false;
ns.Send( BindPackets( compress, packets ) );
ns.CompressionEnabled = compress;*/
}