Exemple #1
0
        private void TextChange()
        {
            string MapServerInfo = textBox1.Text + @"\Data\MapServerInfo.dat";
            string SCF_ServerList = textBox1.Text + @"\TitanCS\Data\SCF_ServerList.cfg";
            string SCF_Config_CS = textBox1.Text + @"\TitanCS\Data\SCF_Config.ini";
            string CommonLocStr = textBox1.Text + @"\Data\lang\kor\CommonLoc.cfg";
            string CommonServerStr = textBox1.Text + @"\Data\CommonServer.cfg";
            string iplist = textBox1.Text + @"\Data\IpList.dat";
            string TitanLSConfig = textBox1.Text + @"\TitanLinkServer\Config.ini";
            string AllowableIPList = textBox1.Text + @"\TitanLinkServer\Data\TT_AllowedList.dat";

            string ServerInfoDat1 = textBox1.Text + @"\GameServer\Data\ServerInfo.dat";
            string ServerInfoDat2 = textBox1.Text + @"\GameServerCS\Data\ServerInfo.dat";

            string connectstr1 = textBox1.Text + @"\GameServer\SCF_Connect.ini";
            string connectstr2 = textBox1.Text + @"\GameServerCS\SCF_Connect.ini";

            string titanEditorstr = textBox1.Text + @"\Docs & Tools\TitanEditor\Config.ini";
            string titanUpdaterstr = textBox1.Text + @"\Docs & Tools\TitanDBUpdater\TitanDBUpdater.ini";


            //--MapsServerInfo
            File.WriteLine(MapServerInfo, "0", false);
            File.WriteLine(MapServerInfo, "\t1\t0\t1\tS" + comboBox3.Text + "\t55901", true);
            File.WriteLine(MapServerInfo, "\t19\t0\t0\tS" + comboBox3.Text + "\t55909", true);
            File.WriteLine(MapServerInfo, "end", true);
            File.WriteLine(MapServerInfo, "", true);
            File.WriteLine(MapServerInfo, "1", true);
            File.WriteLine(MapServerInfo, "\t1\t0\t30\t19", true);
            File.WriteLine(MapServerInfo, "\t1\t0\t31\t19", true);
            File.WriteLine(MapServerInfo, "\t1\t0\t34\t19", true);
            File.WriteLine(MapServerInfo, "\t1\t0\t41\t19", true);
            File.WriteLine(MapServerInfo, "\t1\t0\t42\t19", true);
            File.WriteLine(MapServerInfo, "\t1\t0\t56\t19", true);
            File.WriteLine(MapServerInfo, "", true);
            File.WriteLine(MapServerInfo, "\t19\t1\t30\t-1", true);
            File.WriteLine(MapServerInfo, "\t19\t1\t31\t-1", true);
            File.WriteLine(MapServerInfo, "\t19\t1\t34\t-1", true);
            File.WriteLine(MapServerInfo, "\t19\t1\t41\t-1", true);
            File.WriteLine(MapServerInfo, "\t19\t1\t42\t-1", true);
            File.WriteLine(MapServerInfo, "\t19\t1\t56\t-1", true);
            File.WriteLine(MapServerInfo, "end", true);
            //--MapsServerInfo

            //--ConnectServer
            File.WriteLine(SCF_ServerList, "0\t1\t\"" + comboBox3.Text + "\"\t55901\t\"SHOW\"", false);
            File.WriteLine(SCF_ServerList, "0\t19\t\"" + comboBox3.Text + "\"\t55909\t\"HIDE\"", true);

            ini cs = new ini(SCF_Config_CS);
            cs.Section = "FtpServerInfo";
            cs.WriteValue("SCFAddress", comboBox3.Text);
            cs.Section = "HttpServerInfo";
            cs.WriteValue("SCFHTTPAddress", comboBox3.Text);
            //--ConnectServer

            //--CommonLoc
            ini commonloc = new ini(CommonLocStr);
            commonloc.Section = "ConnectServerInfo";
            commonloc.WriteValue("IP", comboBox2.Text);
            //--CommonLoc

            //--TitanLS
            ini tls = new ini(TitanLSConfig);
            tls.Section = "DataServer1";
            tls.WriteValue("Port", "55962");
            tls.WriteValue("Login", User);
            tls.WriteValue("Password", Password);

            tls.Section = "DataServer2";
            tls.WriteValue("Port", "55960");
            tls.WriteValue("Login", User);
            tls.WriteValue("Password", Password);

            //--ExtraServer
            tls.Section = "ExtraServer";
            tls.WriteValue("Name", "MuOnline");
            tls.WriteValue("NameMe", "Me_MuOnline");
            tls.WriteValue("Login", User);
            tls.WriteValue("Password", Password);
            //--SCFExDB

            //--TitanWzExDB
            tls.Section = "WzExDB";
            tls.WriteValue("Login", User);
            tls.WriteValue("Password", Password);
            //--TitanWzExDB

            //--SCFJS
            tls.Section = "JoinServer";
            tls.WriteValue("ServerODBC", "MuOnlineJoinDB");
            tls.WriteValue("Name", "Me_MuOnline");
            tls.WriteValue("Login", User);
            tls.WriteValue("Password", Password);
            tls.WriteValue("UseMD5", Convert.ToInt32(MD5).ToString());
            //--SCFJS

            //--CommonServer
            ini cmnsvr = new ini(CommonServerStr);
            cmnsvr.Section = "GameServerInfo";
            cmnsvr.WriteValue("HackLogServer", comboBox2.Text);
            cmnsvr.WriteValue("ChaosEventServer", comboBox2.Text);
            cmnsvr.WriteValue("EventChipServerIp", comboBox2.Text);
            cmnsvr.WriteValue("DevilSquareEventServer", comboBox2.Text);
            //--CommonServer

            //--IpList.dat
            File.WriteLine(iplist, "\"" + comboBox2.Text + "\"", false);
            //--IpList.dat

            //--AllowableIPList.txt
            string strSpaceIP = comboBox2.Text;

            File.WriteLine(AllowableIPList, "\"" + strSpaceIP + "\"", false);
            //--AllowableIPList.txt

            //--TitanEditor
            ini tteditor = new ini(titanEditorstr);
            tteditor.Section = "Connection";
            tteditor.WriteValue("User", User);
            tteditor.WriteValue("Password", Password);
            tteditor.WriteValue("ODBC", "MuOnline");
            tteditor.WriteValue("ODBC_Me", "Me_MuOnline");
            tteditor.WriteValue("SQLServer", comboBox1.Text);
            tteditor.Section = "Common";
            tteditor.WriteValue("UseMD5", Convert.ToInt32(MD5).ToString());
            tteditor.Section = "EditorAdds";
            tteditor.WriteValue("ItemNewPath", textBox1.Text + @"\Data\Lang\Item(New).txt");
            //--TitanEditor

            //--TitanDBUpdater
            ini titanUpdater = new ini(titanUpdaterstr);
            titanUpdater.Section = "SQLConfig";
            titanUpdater.WriteValue("IpAdress", comboBox1.Text);
            titanUpdater.WriteValue("User", User);
            titanUpdater.WriteValue("Password", Password);

            titanUpdater.Section = "DataBase";
            titanUpdater.WriteValue("MuOnline", "MuOnline");
            titanUpdater.WriteValue("MeMuOnline", "Me_MuOnline");
            //--TitanEditor

            //--ServerInfoDat
            ini serverinfo1 = new ini(ServerInfoDat1);
            serverinfo1.Section = "GameServerInfo";
            serverinfo1.WriteValue("ServerCode", "1");

            ini serverinfo2 = new ini(ServerInfoDat2);
            serverinfo2.Section = "GameServerInfo";
            serverinfo2.WriteValue("ServerCode", "19");
            //--ServerInfoDat

            //--SCF_Connect.ini
            ini connect1 = new ini(connectstr1);
            connect1.Section = "Connect";
            connect1.WriteValue("SCF_ServerPort", "55901");
            connect1.WriteValue("SCF_DataServerPort", "55960");
            connect1.WriteValue("SCF_DataServerPort2", "55962");

            ini connect2 = new ini(connectstr2);
            connect2.Section = "Connect";
            connect2.WriteValue("SCF_ServerPort", "55909");
            connect1.WriteValue("SCF_DataServerPort", "55962");
            connect1.WriteValue("SCF_DataServerPort2", "55960");
            //--SCF_Connect.ini

            //--CommonLoc
            //string sup = File.Read(suploaderstr).Replace(@"D:\MuOnline",textBox1.Text);
            //File.Write(suploaderstr, sup, false);
            //ini suploader = new ini(suploaderstr);
            //suploader.Section = "Program 4";
            //suploader.WriteValue("Arguments", comboBox3.Text);
            //suploader.Section = "Program 5";
            //suploader.WriteValue("Arguments", comboBox3.Text);
            //suploader.Section = "Program 9";
            //suploader.WriteValue("Arguments", comboBox2.Text + " 55970 " + comboBox2.Text + " 55962 55901");
            //suploader.Section = "Program 10";
            //suploader.WriteValue("Arguments", comboBox2.Text + " 55970 " + comboBox2.Text + " 55960 55919");
            //--CommonLoc
        }
Exemple #2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            ini cfg = new ini(Application.StartupPath + @"\Config.ini");
            cfg.Section = "Connection";
            User = cfg.ReadString("User", "sa");
            Password = cfg.ReadString("Password", "654321");
            MD5 = Convert.ToBoolean(cfg.ReadInt("UseMD5", "1"));

            if (MD5)
                button3.Enabled = true;

            string [] instance = instanciasInstaladas();
            string pcName = nombrePC();
            foreach(string s in instance)
            {
                if(s == "MSSQLSERVER")
                {
                    comboBox1.Items.Add("(local)");
                }
                else
                {
                    if (pcName != null)
                        comboBox1.Items.Add(pcName + @"\" + s);
                    comboBox1.Items.Add(@"(local)\" + s);
                }
            }
            if (comboBox1.Items.Count >= 1)
                comboBox1.SelectedIndex = 0;
            GetIP();
            //TextChange();
            //
            //string ssa = MuOnline.Replace("\r\n", "\0\0");
            //    Application.Exit();
            
        }