cachaFloja 14 Report post Posted October 15, 2021 Hi, I made a kind of guide to configure Patrick13's launcher, I don't know if there are new people but I'm going to post it :p IMPORTANT I don't know how this works so this is just one way to make it work but it is not the best way. API: Download Launcher: 1-Configure API Spoiler I- Download API, go to the web folder of your server, create a folder called API and paste the files, like this: II- Edit config.php with your info <?php $db = [ 'host' => 'HOSTDB', 'username' => 'USERDB', 'password' => 'PASSDB', 'accountserver' => 'AccountServer', 'gamedb' => 'GameDB', 'portGate' => '1971' ]; ?> III- Edit update.xml <ListUpdate> <Update> <FileURL></FileURL> <FileMirror></FileMirror> <Version>1.0.0.0</Version> </Update> </ListUpdate> The first version of the client is 1.0.0.0 then to start downloading you must start from 1.0.0.1 onwards, just add a download like this: Spoiler <ListUpdate> <Update> <FileURL></FileURL> <FileMirror></FileMirror> <Version>1.0.0.0</Version> </Update> <Update> <FileURL>http://urltomyfile.com/downloads/patch1001.zip</FileURL> <FileMirror>http://mirror.urltomyfile.com/downloads/patch1001.zip</FileMirror> <Version>1.0.0.1</Version> </Update> </ListUpdate> 2.-Create TABLE for version Spoiler I.- Open SQL Server Management and connect to your databases Go to Databases>GameDB>Right click>New Query copy and paste CREATE TABLE Launcher (idPatch INT NOT NULL PRIMARY KEY IDENTITY, versionPatch VARCHAR(10) NOT NULL) Press F5, refresh Databases o re-connect to load your new table. Go to Databases>GameDB>Tables>Launcher>Right click>Edit and add a new patch. Press Enter and F5 Now you can go to your URL and test, example: http://mySuperSVR.com/api/statistics.php Should load something like this: 3.-Configure PKO-Launcher Spoiler I.- Download PKO-Launcher, open Visual Studio (i use 2019 community) Open Properties>Resource.resx You must add StatusUrl II.-Find GetIPByServer in Globals.cs Change NAMEISLAND and IPHERE public static string GetIpByServer ( string server ) { string ip; var morganRegions = new List<string> { "" }; switch ( server ) { case string external when external.ToLowerInvariant ( ).Contains ( "NAMEISLAND" ): ip = Task.Run(async () => await GetBestServer(morganRegions, "")).Result; break; default: ip = "IPHERE"; break; } return ip; } III.-Find PopulateRegion in Utils.cs Put the same region public static bool PopulateRegion ( Guna2ComboBox control ) { try { if ( control == null ) return false; control.Items.Add ( "NAMEISLAND" ); control.SelectedItem = "Select Region"; return true; } catch { return false; } } IV.-Find UpdateServerStatistics in kopMainF.cs Replace with this: Spoiler private async Task UpdateServerStatistics() { bool online = false; try { await Task.Run ( () => { ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; ServicePointManager.DefaultConnectionLimit = 20; using (var wc = new WebClient ( )) { wc.Proxy = null; var json = wc.DownloadString(Resources.StatisticsURL.ToString()); ; var jsonS = wc.DownloadString (Resources.StatusUrl.ToString()); JArray data = JArray.Parse (json); online = bool.Parse(jsonS); foreach (JObject item in data) { SetControlThreadSafe(label7, arg => { label7.Text = item.GetValue("accounts").ToString(); }, null); //total account SetControlThreadSafe(label9, arg => { label9.Text = item.GetValue("characters").ToString(); }, null); //total character SetControlThreadSafe(label6, arg => { label6.Text = item.GetValue("online").ToString(); }, null); //current online SetControlThreadSafe(label15, arg => { label15.Text = item.GetValue("max_online").ToString(); }, null); // <.< idk _gameVersion = item.GetValue("version").ToString(); } string hashes = "9BkAxPDlBSDhb13b73HFKFOl915sD"; var contents = hashes.Split ( new[] {Resources.StatHashSumDelimiter}, StringSplitOptions.None ); foreach (var hash in contents) if ( !string.IsNullOrEmpty ( hash ) ) Globals.GenuineResourceHashes.Add ( hash ); if (online != false) SetControlThreadSafe ( label11, arg => { label11.Text = "Online"; }, null ); //server status else SetControlThreadSafe ( label11, arg => { label11.ForeColor = Color.DarkRed; label11.Text = "Offline"; }, null ); } } ); } catch { // ignored } } Done!! *Use ZIP for patchs NOTE: Spoiler In Statistics.php we have this query: $sql = $dbConn->prepare('SELECT (SELECT COUNT(*) FROM character WHERE delflag=0) as characters, (SELECT COUNT(*) FROM character WHERE mem_addr>0) AS online, (SELECT COUNT(*) FROM account) AS accounts, (SELECT COUNT(DISTINCT last_ip) FROM account) as users, (SELECT MAX(login_num) FROM stat_log) as max_online, (SELECT MAX(versionPatch) FROM Launcher) as version'); the only change is this in the end (SELECT MAX(versionPatch) FROM Launcher) as version') In ServerStatus.php we have this to check connection $fp = @fsockopen('tcp://' . $db['host'], $db['portGate'], $errno, $errstr, 3); Credits patrick13 LauncherIcruz API Google Translate PD: StatHashSumDelimeter must finish this, you can add a new column in the table of Launcher with this parameter. 3 Quote Share this post Link to post Share on other sites
Rinor 59 Report post Posted November 16, 2021 @cachaFloja Any idea why im having issue when trying to start the game through launcher? It wont open the game it keeps showing a window “trying to get updates” or something, everytime i click start game button Quote Share this post Link to post Share on other sites
V3ct0r 2,145 Report post Posted November 16, 2021 2 hours ago, Rinor said: @cachaFloja Any idea why im having issue when trying to start the game through launcher? It wont open the game it keeps showing a window “trying to get updates” or something, everytime i click start game button @patrick13 any ideas? Quote Some useful links / Полезные ссылки Tips for making a topic in 'Questions & Help' / Рекомендации по созданию тем в разделе "Помощь" Server Advertising Section Rules / Правила раздела "Реклама серверов" Available e-mail domains for registration / Допустимые e-mail домены для регистрации User groups / Группы пользователей User ranks / Звания пользователей "Broken" pictures on the forum / "Битые" изображения на форуме Beware of scammers! / Осторожно, мошенники! My developments / Мои разработки Mods for client and server / Моды для клиента и сервера PKOdev.NET website for Tales of Pirates Server / PKOdev.NET веб-обвязка для сервера Пиратии I do not provide any help in private messages and outside the forum. Use 'Questions & Help' section please. Thank you for understanding! Я не оказываю какую-либо помощь в личных сообщениях и вне форума. Пожалуйста, используйте раздел "Пиратия: Помощь". Благодарю за понимание! Share this post Link to post Share on other sites
champ 169 Report post Posted November 16, 2021 11 minutes ago, V3ct0r said: @patrick13 any ideas? I can’t remember sorry, I’ve not worked on this project in a while, I can quickly read through the source code later to see what could be causing the issue. 1 Quote Share this post Link to post Share on other sites
champ 169 Report post Posted November 17, 2021 23 hours ago, Rinor said: @cachaFloja Any idea why im having issue when trying to start the game through launcher? It wont open the game it keeps showing a window “trying to get updates” or something, everytime i click start game button You can't start the game because of this statement: if ( !string.IsNullOrEmpty ( _gameVersion ) ) If game version is null or empty, then it will show the following message: Utils.ShowMessageA ( "Retrieving update information, please try again in a few seconds." ); To fix that, you either need to override this condition or add an API through which the latest game version can be retrieved (as per the tutorial above I believe). That is as can be seen in the method below: UpdateServerStatistics() Which connects to the API using the following URL: var json = wc.DownloadString ( Resources.StatisticsURL ); And retrieves the game version here: _gameVersion = data.version; Hope that was helpful and good luck! 1 1 Quote Share this post Link to post Share on other sites
Mario 12 Report post Posted July 12, 2022 i have copy ur last code and there is problem during the compil Quote Share this post Link to post Share on other sites
dragontechi 70 Report post Posted September 5, 2022 On 7/13/2022 at 12:06 AM, Mario said: i have copy ur last code and there is problem during the compil I am having the same problem to compile Quote Share this post Link to post Share on other sites
V3ct0r 2,145 Report post Posted September 5, 2022 Hello @Mario and @dragontechi, make sure that you are using the latest revision of the source code. Because the code in the screenshot is different from the one in the project repository on GitHub. 1 Quote Some useful links / Полезные ссылки Tips for making a topic in 'Questions & Help' / Рекомендации по созданию тем в разделе "Помощь" Server Advertising Section Rules / Правила раздела "Реклама серверов" Available e-mail domains for registration / Допустимые e-mail домены для регистрации User groups / Группы пользователей User ranks / Звания пользователей "Broken" pictures on the forum / "Битые" изображения на форуме Beware of scammers! / Осторожно, мошенники! My developments / Мои разработки Mods for client and server / Моды для клиента и сервера PKOdev.NET website for Tales of Pirates Server / PKOdev.NET веб-обвязка для сервера Пиратии I do not provide any help in private messages and outside the forum. Use 'Questions & Help' section please. Thank you for understanding! Я не оказываю какую-либо помощь в личных сообщениях и вне форума. Пожалуйста, используйте раздел "Пиратия: Помощь". Благодарю за понимание! Share this post Link to post Share on other sites
champ 169 Report post Posted September 5, 2022 As V3ct0r has already mentioned, it seems you are using an outdated version of the updater, so updating it might help. I also strongly encourage you to switch to this patcher instead, as it's more reliable: 1 Quote Share this post Link to post Share on other sites
Graf 219 Report post Posted January 5 (edited) @champ Hi. Can reupload pictures from post? Edited January 5 by Graf Quote Share this post Link to post Share on other sites
champ 169 Report post Posted January 6 What's wrong with pictures? I can see them. 1 Quote Share this post Link to post Share on other sites