Пример #1
0
        private static void LoadXP()
        {
            string loaded;

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

#if !DEBUG
            try
            {
#endif
            dec = GetData(data_lvlexp, "<M4H90ag7{_j6~3[");

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

            Globals.levelexp = new SortedList();

            while ((loaded = temp_stream.ReadLine()) != null)
            {
                int pipe;
                //lvl
                pipe = loaded.IndexOf('|');
                uint lvl = Util.GetUInt32(loaded.Substring(0, pipe));
                //xp
                ulong xp = Util.GetUInt64(loaded.Substring(pipe + 1, loaded.Length - pipe - 1));

                Globals.levelexp.Add(lvl, xp);
            }

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

            //Add_Text("loaded lvlexp", Globals.Red);
#if !DEBUG
        }

        catch
        {
            Globals.l2net_home.Add_PopUpError("failed to load data\\lvlexp.txt");
        }
#endif

            dec = null;
        }