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

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

            try
            {
                dec = GetData(data_systemmsg, "gA7ru8akusakenaf");

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

                Globals.systemmsg          = new SortedList();
                Globals.systemmsg.Capacity = Globals.COUNT_SYSTEMMSG;

                while ((loaded = temp_stream.ReadLine()) != null)
                {
                    SystemMsg sysmsg = new SystemMsg();

                    sysmsg.Parse(loaded);

                    Globals.systemmsg.Add(sysmsg.ID, sysmsg);
                }

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

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

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

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

            try
            {
                dec = GetData(data_systemmsg, "gA7ru8akusakenaf");

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

                Globals.systemmsg = new SortedList();
                Globals.systemmsg.Capacity = Globals.COUNT_SYSTEMMSG;

                while ((loaded = temp_stream.ReadLine()) != null)
                {
                    SystemMsg sysmsg = new SystemMsg();

                    sysmsg.Parse(loaded);

                    Globals.systemmsg.Add(sysmsg.ID, sysmsg);
                }

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

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

            dec = null;
        }