private void Settings_FormClosing(object sender, FormClosingEventArgs e) { string CurrentRegion = Settings.IniReadValue("Settings", "Region"); //check region if west enable login box if (CurrentRegion == "EN") { box_WestLogin.Visible = true; //if open settings with logged account play button stay enabled if (worker != null && worker.IsBusy) { Btn_play.Enabled = true; } else { btn_Login.Text = "Login"; btn_Login.Enabled = true;//if change to other region and change back to NA enable login btn Btn_play.Enabled = false; } } else { //if not west or change region logged kill ping thread disable west login and enable play button if (worker != null && worker.IsBusy) { LoginServer.Close(); worker.CancelAsync(); } box_WestLogin.Visible = false; Btn_play.Enabled = true; } }
private void Settings_FormClosing(object sender, FormClosingEventArgs e) { //check region if west enable login box if (sSettings.sRegion == "EN") { if (!LauncherInfo()) { Close(); } RegionCB.DataSource = regions; box_WestLogin.Visible = true; //if open settings with logged account play button stay enabled if (worker != null && worker.IsBusy) { Btn_play.Enabled = true; } else { btn_Login.Text = "Login"; btn_Login.Enabled = true;//if change to other region and change back to NA enable login btn Btn_play.Enabled = false; } } else { //if not west or change region logged kill ping thread disable west login and enable play button if (worker != null && worker.IsBusy) { LoginServer.Close(); worker.CancelAsync(); } box_WestLogin.Visible = false; Btn_play.Enabled = true; } }
private void Btn_play_Click(object sender, EventArgs e) { if (sSettings.sRegion == "JP") { if (sSettings.sInstallPath != null) { if (sSettings.sArchitecture == "0") { LaunchPath = Path.Combine(sSettings.sInstallPath, @"bin\Client.exe"); } else { LaunchPath = Path.Combine(sSettings.sInstallPath, @"bin64\Client.exe"); } } // registry path not found, check for side-by-side install else if (File.Exists(".\\Client.exe")) { LaunchPath = ".\\Client.exe"; } } else if (sSettings.sRegion == "TW") { if (sSettings.sInstallPath != null) { if (sSettings.sArchitecture == "0") { LaunchPath = Path.Combine(sSettings.sInstallPath, @"bin\Client.exe"); } else { LaunchPath = Path.Combine(sSettings.sInstallPath, @"bin64\Client.exe"); } } // registry path not found, check for side-by-side install else if (File.Exists(".\\Client.exe")) { LaunchPath = ".\\Client.exe"; } } else if (sSettings.sRegion == "KR") { if (sSettings.sServerType == "Live") { if (sSettings.sInstallPath != null) { if (sSettings.sArchitecture == "0") { LaunchPath = Path.Combine(sSettings.sInstallPath, @"bin\Client.exe"); } else { LaunchPath = Path.Combine(sSettings.sInstallPath, @"bin64\Client.exe"); } } // registry path not found, check for side-by-side install else if (File.Exists(".\\Client.exe")) { LaunchPath = ".\\Client.exe"; } } else if (sSettings.sServerType == "Test") { if (sSettings.sInstallPath != null) { if (sSettings.sArchitecture == "0") { LaunchPath = Path.Combine(sSettings.sInstallPath, @"bin\Client.exe"); } else { LaunchPath = Path.Combine(sSettings.sInstallPath, @"bin64\Client.exe"); } } // registry path not found, check for side-by-side install else if (File.Exists(".\\Client.exe")) { LaunchPath = ".\\Client.exe"; } } } else if (sSettings.sRegion == "EN") { if (sSettings.sInstallPath != null) { if (sSettings.sArchitecture == "0") { LaunchPath = Path.Combine(sSettings.sInstallPath, @"bin\Client.exe"); } else { LaunchPath = Path.Combine(sSettings.sInstallPath, @"bin64\Client.exe"); } } // registry path not found, check for side-by-side install else if (File.Exists(".\\Client.exe")) { LaunchPath = ".\\Client.exe"; } } UseAllCores = !(sSettings.sUseAllCores == "true") ? "" : " -USEALLAVAILABLECORES"; NoTextureStreaming = !(sSettings.sNoTextureStreaming == "true") ? "" : " -NOTEXTURESTREAMING"; Unattended = !(sSettings.sUnattended == "true") ? "" : " -UNATTENDED"; Process proc = new Process(); proc.StartInfo.FileName = LaunchPath; if (sSettings.sRegion == "JP") { // Generated by Nc Launcher /LaunchByLauncher /Sesskey /SessKey:"" /CompanyID:"14" /ChannelGroupIndex:"-1" proc.StartInfo.Arguments = "/launchbylauncher /sesskey /CompanyID:" + "14" + "/ChannelGroupIndex:" + " - 1" + " /LoginMode 2 " + "" + UseAllCores + "" + Unattended + "" + NoTextureStreaming; proc.StartInfo.UseShellExecute = false; proc.StartInfo.RedirectStandardError = true; } else if (sSettings.sRegion == "TW") { // generated by Nc Launcher /LaunchByLauncher /AuthnToken:"" /SessKey:"" /ServiceRegion:"15" /AuthProviderCode:"np" /NPServerAddr:"210.64.136.126:6600" /PresenceId:"TWBNS22" proc.StartInfo.Arguments = "/launchbylauncher /sesskey /ServiceRegion:" + "15" + "/ChannelGroupIndex:" + " - 1" + " /PresenceId:" + "TWBNS22" + " /LoginMode 2 " + "" + UseAllCores + "" + Unattended + "" + NoTextureStreaming; proc.StartInfo.UseShellExecute = false; proc.StartInfo.RedirectStandardError = true; } else if (sSettings.sRegion == "KR") { if (sSettings.sServerType == "Live") { // generated by Nc Launcher /LaunchByLauncher /AuthnToken:"" /SessKey:"" /ServiceRegion:"0" /AuthProviderCode:"np" /NPServerAddr:"112.175.209.97:6600" -lite:8 /PresenceId:"BNS_KOR" proc.StartInfo.Arguments = "/launchbylauncher /sesskey /ServiceRegion:" + "0" + " -lite:8" + " /PresenceId:" + "BNS_KOR" + " /LoginMode 2 " + "" + UseAllCores + "" + Unattended + "" + NoTextureStreaming; proc.StartInfo.UseShellExecute = false; proc.StartInfo.RedirectStandardError = true; } else if (sSettings.sServerType == "Test") { // generated by Nc Launcher /LaunchByLauncher /AuthnToken:"" /SessKey:"" /ServiceRegion:"0" /AuthProviderCode:"np" /NPServerAddr:"112.175.209.97:6600" -lite:8 /PresenceId:"BNS_KOR_TEST" proc.StartInfo.Arguments = "/launchbylauncher /sesskey /ServiceRegion:" + "0" + " -lite:8" + " /PresenceId:" + "BNS_KOR_TEST" + " /LoginMode 2 " + "" + UseAllCores + "" + Unattended + "" + NoTextureStreaming; proc.StartInfo.UseShellExecute = false; proc.StartInfo.RedirectStandardError = true; } } else if (sSettings.sRegion == "EN") { // generated by Nc Launcher /launchbylauncher /sesskey -lang:english /CompanyID:"12" /ChannelGroupIndex:"-1" /AuthnToken:"==" /AuthProviderCode:"np" -lang:English -lite:2 -region:0 proc.StartInfo.Arguments = "/launchbylauncher /sesskey -lang:english /CompanyID:\"12\" /ChannelGroupIndex:\"-1\" " + string.Format(args, token) + " /AuthProviderCode:\"np\"" + "-lang:" + sSettings.sLanguageID + " -lite:2 -region:" + currentValue + Unattended + "" + NoTextureStreaming + "" + UseAllCores + ""; proc.StartInfo.UseShellExecute = false; proc.StartInfo.RedirectStandardError = true; } try { proc.Start(); //kill ping thread enable login button and disable play button(west) if (worker != null && worker.IsBusy) { LoginServer.Close(); worker.CancelAsync(); Btn_play.Enabled = false; btn_Login.Enabled = true; btn_Login.Text = "Login"; } } catch { MessageBox.Show("Error: Could not start Client.exe!"); } }
private void Btn_play_Click(object sender, EventArgs e) { string mpNoTextureStreaming = Settings.IniReadValue("Settings", "NoTextureStreaming"); string mpUnattended = Settings.IniReadValue("Settings", "Unattended"); string mpRegionCurrent = Settings.IniReadValue("Settings", "Region"); string mpUseAllCoresCurrent = Settings.IniReadValue("Settings", "UseAllCores"); string mplanguageIDCurrent = Settings.IniReadValue("Settings", "language"); string mpArchitectureCurrent = Settings.IniReadValue("Settings", "Architecture"); if (mpRegionCurrent == "JP") { InstallPath = (string)Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\plaync\BNS_JPN", "BaseDir", null); if (InstallPath != null) { if (mpArchitectureCurrent == "0") { LaunchPath = InstallPath + "\\bin\\Client.exe"; } else { LaunchPath = InstallPath + "\\bin64\\Client.exe"; } } // registry path not found, check for side-by-side install else if (File.Exists(".\\Client.exe")) { LaunchPath = ".\\Client.exe"; } } else if (mpRegionCurrent == "TW") { InstallPath = (string)Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\NCTaiwan\TWBNS22", "BaseDir", null); if (InstallPath != null) { LaunchPath = InstallPath + "\\bin\\Client.exe"; } // registry path not found, check for side-by-side install else if (File.Exists(".\\Client.exe")) { LaunchPath = ".\\Client.exe"; } } else if (mpRegionCurrent == "KR") { InstallPath = (string)Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\plaync\BNS_KOR", "BaseDir", null); if (InstallPath != null) { if (mpArchitectureCurrent == "0") { LaunchPath = InstallPath + "\\bin\\Client.exe"; } else { LaunchPath = InstallPath + "\\bin64\\Client.exe"; } } // registry path not found, check for side-by-side install else if (File.Exists(".\\Client.exe")) { LaunchPath = ".\\Client.exe"; } } else if (mpRegionCurrent == "KR_TEST") { InstallPath = (string)Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\plaync\BNS_KOR_TEST", "BaseDir", null); if (InstallPath != null) { if (mpArchitectureCurrent == "0") { LaunchPath = InstallPath + "\\bin\\Client.exe"; } else { LaunchPath = InstallPath + "\\bin64\\Client.exe"; } } // registry path not found, check for side-by-side install else if (File.Exists(".\\Client.exe")) { LaunchPath = ".\\Client.exe"; } } else if (mpRegionCurrent == "EN") { InstallPath = (string)Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\NCWest\BnS", "BaseDir", null); if (InstallPath != null) { if (mpArchitectureCurrent == "0") { LaunchPath = InstallPath + "\\bin\\Client.exe"; } else { LaunchPath = InstallPath + "\\bin64\\Client.exe"; } } // registry path not found, check for side-by-side install else if (File.Exists(".\\Client.exe")) { LaunchPath = ".\\Client.exe"; } } UseAllCores = !(mpUseAllCoresCurrent == "true") ? "" : " -USEALLAVAILABLECORES"; NoTextureStreaming = !(mpNoTextureStreaming == "true") ? "" : " -NOTEXTURESTREAMING"; Unattended = !(mpUnattended == "true") ? "" : " -UNATTENDED"; Process proc = new Process(); proc.StartInfo.FileName = LaunchPath; if (mpRegionCurrent == "JP") { // Generated by Nc Launcher /LaunchByLauncher /Sesskey /SessKey:"" /CompanyID:"14" /ChannelGroupIndex:"-1" proc.StartInfo.Arguments = "/launchbylauncher /sesskey /CompanyID:" + "14" + "/ChannelGroupIndex:" + " - 1" + " /LoginMode 2 " + "" + UseAllCores + "" + Unattended + "" + NoTextureStreaming; proc.StartInfo.UseShellExecute = false; proc.StartInfo.RedirectStandardError = true; } else if (mpRegionCurrent == "TW") { // generated by Nc Launcher /LaunchByLauncher /AuthnToken:"" /SessKey:"" /ServiceRegion:"15" /AuthProviderCode:"np" /NPServerAddr:"210.64.136.126:6600" /PresenceId:"TWBNS22" proc.StartInfo.Arguments = "/launchbylauncher /sesskey /ServiceRegion:" + "15" + "/ChannelGroupIndex:" + " - 1" + " /PresenceId:" + "TWBNS22" + " /LoginMode 2 " + "" + UseAllCores + "" + Unattended + "" + NoTextureStreaming; proc.StartInfo.UseShellExecute = false; proc.StartInfo.RedirectStandardError = true; } else if (mpRegionCurrent == "KR") { // /LaunchByLauncher /SessKey:"" /CompanyID:"0" /ChannelGroupIndex:"-1" /youth:"false" -lite:8 proc.StartInfo.Arguments = "/launchbylauncher /sesskey" + "/ChannelGroupIndex:" + " - 1" + " /youth:" + "false" + "-lite:8" + " / LoginMode 2 " + "" + UseAllCores + "" + Unattended + "" + NoTextureStreaming; proc.StartInfo.UseShellExecute = false; proc.StartInfo.RedirectStandardError = true; } else if (mpRegionCurrent == "EN") { // generated by Nc Launcher /launchbylauncher /sesskey -lang:english /CompanyID:"12" /ChannelGroupIndex:"-1" /AuthnToken:"==" /AuthProviderCode:"np" -lang:English -lite:2 -region:0 proc.StartInfo.Arguments = "/launchbylauncher /sesskey -lang:english /CompanyID:\"12\" /ChannelGroupIndex:\"-1\" " + string.Format(args, token) + " /AuthProviderCode:\"np\"" + "-lang:" + mplanguageIDCurrent + " -lite:2 -region:" + currentValue + Unattended + "" + NoTextureStreaming + "" + UseAllCores + ""; proc.StartInfo.UseShellExecute = false; proc.StartInfo.RedirectStandardError = true; } try { proc.Start(); //kill ping thread enable login button and disable play button(west) if (worker != null && worker.IsBusy) { LoginServer.Close(); worker.CancelAsync(); Btn_play.Enabled = false; btn_Login.Enabled = true; btn_Login.Text = "Login"; } } catch { MessageBox.Show("Error: Could not start Client.exe!"); } }