Esempio n. 1
0
        private static void LoadZones()
        {
            string loaded;

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

            try
            {
                dec = GetData(data_zonename, "pUB6epUC7uwraxaw");

                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("zonename.txt is too old for this version of L2.Net!");
                    System.Windows.Forms.Application.Exit();
                }

                Globals.zonelist          = new SortedList();
                Globals.zonelist.Capacity = Globals.COUNT_ZONES;

                while ((loaded = temp_stream.ReadLine()) != null)
                {
                    ZoneName zn_inf = new ZoneName();

                    zn_inf.Parse(loaded);

                    Globals.zonelist.Add(zn_inf.ID, zn_inf);
                }

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

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

            dec = null;
        }
Esempio n. 2
0
        private static void LoadZones()
        {
            string loaded;

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

            try
            {
                dec = GetData(data_zonename, "pUB6epUC7uwraxaw");

                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("zonename.txt is too old for this version of L2.Net!");
                    System.Windows.Forms.Application.Exit();
                }
                
                Globals.zonelist = new SortedList();
                Globals.zonelist.Capacity = Globals.COUNT_ZONES;

                while ((loaded = temp_stream.ReadLine()) != null)
                {
                    ZoneName zn_inf = new ZoneName();

                    zn_inf.Parse(loaded);

                    Globals.zonelist.Add(zn_inf.ID, zn_inf);
                }

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

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

            dec = null;
        }