Beispiel #1
0
        private static void LoadServerName()
        {
            string loaded;

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

            try
            {
                dec = GetData(data_servername, "-8:2eF_08$6-o)IJ");

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

                Globals.servername          = new SortedList();
                Globals.servername.Capacity = Globals.COUNT_SERVERNAME;

                while ((loaded = temp_stream.ReadLine()) != null)
                {
                    ServerName sername = new ServerName();

                    sername.Parse(loaded);

                    Globals.servername.Add(sername.ID, sername);
                }

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

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

            dec = null;
        }
Beispiel #2
0
        private static void LoadServerName()
        {
            string loaded;

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

            try
            {
                dec = GetData(data_servername, "-8:2eF_08$6-o)IJ");

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

                Globals.servername = new SortedList();
                Globals.servername.Capacity = Globals.COUNT_SERVERNAME;

                while ((loaded = temp_stream.ReadLine()) != null)
                {
                    ServerName sername = new ServerName();

                    sername.Parse(loaded);

                    Globals.servername.Add(sername.ID, sername);
                }

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

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

            dec = null;
        }