private void ModListPacketHandler(Packet pa)
        {
            ModListPacket p = pa as ModListPacket;

            CurrentStep = ProgressStep.DownloadingModInformation;
            mods        = new List <Mod>(p.Mods.Length);
            Thread.Sleep(250);
            foreach (string s in p.Mods)
            {
                Packet.Send(new RequestModPacket {
                    Type = RequestModPacket.RequestType.Info, Identifier = s
                }, PacketHandler.Stream);
            }
        }
Ejemplo n.º 2
0
        void ph_ModList(Packet pa)
        {
            ModListPacket p = pa as ModListPacket;

            identifiers.AddRange(p.Mods);
            if (p.Mods.Length == 0)
            {
                Program.RunOnUIThread(delegate
                {
                    SplashScreen.CloseSplashScreen();
                    Show();
                });
                return;
            }
            Program.RunOnUIThread(delegate
            {
                if (Visible)
                {
                    Hide();
                }
            });
            foreach (string s in p.Mods)
            {
                Packet.Send(new RequestModPacket {
                    Identifier = s, Type = RequestModPacket.RequestType.Info
                }, ph.Stream);
            }
            bool exists = Directory.Exists(Properties.Settings.Default.MinecraftPath + @"\mods");

            if (!exists)
            {
                Directory.CreateDirectory(Properties.Settings.Default.MinecraftPath + @"\mods");
            }

            SplashScreen.AdvanceProgressBar();
        }