Ejemplo n.º 1
0
        private static void LoadHennaGrp()
        {
            string loaded;

            byte[] dec;
            System.IO.StreamReader temp_stream;
            System.IO.MemoryStream mem_stream;

            try
            {
                dec = GetData(data_hennagrp, "8Er5FREjaCen7Thu");

                mem_stream  = new System.IO.MemoryStream(dec);
                temp_stream = new System.IO.StreamReader((System.IO.Stream)mem_stream);

                int version = Util.GetInt32(temp_stream.ReadLine());
                if (version < Globals.MinDataPack)
                {
                    System.Windows.Forms.MessageBox.Show("hennagrp.txt is too old for this version of L2.Net!");
                    System.Windows.Forms.Application.Exit();
                }

                Globals.hennagrp          = new SortedList();
                Globals.hennagrp.Capacity = Globals.COUNT_HENNAGROUP;

                while ((loaded = temp_stream.ReadLine()) != null)
                {
                    HennaGroup hengrp = new HennaGroup();

                    hengrp.Parse(loaded);

                    Globals.hennagrp.Add(hengrp.ID, hengrp);
                }

                mem_stream.Close();
                temp_stream.Close();

                HennaGroup null_dye = new HennaGroup();
                null_dye.ID   = 0;
                null_dye.Name = "no dye";
                Globals.hennagrp.Add((uint)0, null_dye);

                //Add_Text("loaded hennagrp", Globals.Red);
            }
            catch
            {
                Globals.l2net_home.Add_PopUpError("failed to load data\\hennagrp.txt");
            }

            dec = null;
        }
Ejemplo n.º 2
0
        private static void LoadHennaGrp()
        {
            string loaded;

            byte[] dec;
            System.IO.StreamReader temp_stream;
            System.IO.MemoryStream mem_stream;

            try
            {
                dec = GetData(data_hennagrp, "8Er5FREjaCen7Thu");

                mem_stream = new System.IO.MemoryStream(dec);
                temp_stream = new System.IO.StreamReader((System.IO.Stream)mem_stream);

                int version = Util.GetInt32(temp_stream.ReadLine());
                if (version < Globals.MinDataPack)
                {
                    System.Windows.Forms.MessageBox.Show("hennagrp.txt is too old for this version of L2.Net!");
                    System.Windows.Forms.Application.Exit();
                }

                Globals.hennagrp = new SortedList();
                Globals.hennagrp.Capacity = Globals.COUNT_HENNAGROUP;

                while ((loaded = temp_stream.ReadLine()) != null)
                {
                    HennaGroup hengrp = new HennaGroup();

                    hengrp.Parse(loaded);

                    Globals.hennagrp.Add(hengrp.ID, hengrp);
                }

                mem_stream.Close();
                temp_stream.Close();

                HennaGroup null_dye = new HennaGroup();
                null_dye.ID = 0;
                null_dye.Name = "no dye";
                Globals.hennagrp.Add((uint)0, null_dye);

                //Add_Text("loaded hennagrp", Globals.Red);
            }
            catch
            {
                Globals.l2net_home.Add_PopUpError("failed to load data\\hennagrp.txt");
            }

            dec = null;
        }