Exemple #1
0
        private static void LoadNPCString()
        {
            string loaded;

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

            try
            {
                ///#)"(#&JH(S&ZKS=
                //dec = GetData(Globals.PATH + "\\data\\npcstring.txt");
                dec = GetData(data_npcstring, ")#&!%J)(/S)J/&%¤");

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

                Globals.npcstring          = new SortedList();
                Globals.npcstring.Capacity = Globals.COUNT_NPCSTRING;

                while ((loaded = temp_stream.ReadLine()) != null)
                {
                    NPCString npcstr = new NPCString();

                    npcstr.Parse(loaded);

                    Globals.npcstring.Add(npcstr.ID, npcstr);
                }

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

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

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

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

            try
            {
                ///#)"(#&JH(S&ZKS=
                //dec = GetData(Globals.PATH + "\\data\\npcstring.txt");
                dec = GetData(data_npcstring, ")#&!%J)(/S)J/&%¤");

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

                Globals.npcstring = new SortedList();
                Globals.npcstring.Capacity = Globals.COUNT_NPCSTRING;

                while ((loaded = temp_stream.ReadLine()) != null)
                {
                    NPCString npcstr = new NPCString();

                    npcstr.Parse(loaded);

                    Globals.npcstring.Add(npcstr.ID, npcstr);
                }

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

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

            dec = null;
        }