Jump to content

cachaFloja

Members
  • Content Count

    9
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by cachaFloja


  1. With Sql server Management you can edit directly the data from AccountServer and GameDB

     

    AccountServer > account_login (colum "gm" with value 99 are gm, 0 is normal user)

    GameDB > account

     

    In Accountserver.dbo.login you have a column called "ban", maybe you can use to block users, i am not sure.

     

    To create a new account you must insert new values in account_login(Accountserver) and account(GameDB)

    Or you can use a tool to create new accounts,

     

    Account Creator TOP/PKO

     

    Or You can install this Web and register.

     

    • Thanks 1

  2. 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:

     

    spacer.png

     

    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.

     

    spacer.png

     

    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:

    spacer.png

     

     

    3.-Configure PKO-Launcher

    Spoiler

     

    I.- Download PKO-Launcher, open Visual Studio (i use 2019 community)

    Open Properties>Resource.resx

     

    spacer.png

     

    You must add StatusUrl 

    4.png

     

    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!!

     

    spacer.png

     

    *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    Launcher
    Icruz           API

    Google Translate

     

    PD: StatHashSumDelimeter must finish thisyou can add a new column in the table of Launcher with this parameter. 

    • Thanks 3
×
×
  • Create New...