Jump to content

Metin2 Autopatcher Design For Sanchez's CRC Patcher


Recommended Posts

A small update:

  • Rewritten the news html because it had really old code.
  • Added the old purple (Korea & Canada used that) and chinese (yt2.catv.net) design.

Purple.png

Chinese.png

Hidden Content

    Give reaction to this post to see the hidden content.
 is the same.

--------------

Https solution:

Website with https may not work. To fix this in ListDownloader.cs, FileDownloader.cs, Networking.cs you can find "new WebClient();" Just add this before: "ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;" You can edit Tls12 to Tls11 or SSl3 but probably Tls12 is what will work. Also you need to right click to Sanchez.Patcher project and set Target Framework from .NET 4.0 to 4.5 or greater to use Tls12.

--------------

Patchlist.txt generator php:

You can use this php to generate the patchlist from the web so you don't need to do it on windows.

<?php
if (isset($_GET['pass']) && $_GET['pass'] === 'somepasswordhere') {
    $excluded_files = array('patchlist.txt', 'metin2.cfg', 'generate.php', 'syserr.txt', 'log.txt', 'ErrorLog.txt', '.htaccess');
    $excluded_folders = array('news');

    $folder_to_check = './';
    $list_file = 'patchlist.txt';

    $file_handle = fopen($list_file, 'w');

    if ($file_handle === false) {
        die("Can not open file '$list_file' for write.");
    }

    function readDirectory($folder, $excluded_files, $excluded_folders, $file_handle, $base_path) {
        $files = scandir($folder);
        foreach ($files as $file) {
            if ($file == '.' || $file == '..') {
                continue;
            }
            if (in_array($file, $excluded_files) || in_array($file, $excluded_folders)) {
                continue;
            }
            $full_path = $folder . '/' . $file;
            $relative_path = $base_path . '/' . $file;
            if (is_dir($full_path)) {
                readDirectory($full_path, $excluded_files, $excluded_folders, $file_handle, $relative_path);
            } elseif (is_file($full_path)) {
                $hash = hash_file('crc32b', $full_path);
                $size = filesize($full_path);
                $formatted_name = ltrim($relative_path, './');
                fwrite($file_handle, "$formatted_name $hash $size" . PHP_EOL);
            }
        }
    }

    readDirectory($folder_to_check, $excluded_files, $excluded_folders, $file_handle, $folder_to_check);

    fclose($file_handle);

    echo "patchlist.txt successfully generated!";
} else {
    http_response_code(404);
}

www.metin2.com/patch/generate.php?pass=somepasswordhere

  • Like 27
  • Thanks 6
  • Haha 2
Link to post
Share on other sites
  • 1 year later...
  • 4 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...