Informations
Jump to content

Lorem Ipsum...

Click to Dismiss this Notification
Ładowanie danych...

Recommended Posts

This is the hidden content, please

 

Introducing a streamlined Metin2 patching tool developed using Electron, with a combination of React and TypeScript. This application ensures file integrity through SHA256 verification.

Getting Started

  1. Install Node.js: Download from
    This is the hidden content, please
    .
  2. Install Yarn: You can find installation instructions on
    This is the hidden content, please
    .
  3. Clone the Repository:
  • This is the hidden content, please

     

  • Install Dependencies:
  1. This is the hidden content, please

     

  2. Edit Configuration: Customize the src/config.ts file with your specific values.
  3. Replace Logo: Update resources/icon.png with your logo (minimum size of 256x256 pixels).

Quick Setup Video

For a visual guide on how to set up the patcher, check out this video:

This is the hidden content, please

This is the hidden content, please

Available Commands

Command Description
yarn run start Launches the React app in development mode.
yarn run build Compiles a production-ready React bundle.
yarn run electron-start Starts the Electron application.
yarn run electron-pack Builds a production package of the application.
yarn run lint Checks for linting errors.
yarn run lint-fix Automatically fixes some linting errors.

About the Project

The development of this patcher stemmed from a desire to gain deeper insights into Electron. The tool will automatically create necessary folders and download missing files when required. It verifies local files and, if discrepancies in checksums are found, it initiates downloads for the affected files. The patcher operates downloads asynchronously, allowing multiple files to be processed simultaneously. It is built entirely with React, Electron, and TypeScript, utilizing TailwindCSS for styling.

Deployment Instructions

Once everything is configured, use the following command to package the application:

 
This is the hidden content, please

This will result in the creation of two files within the release folder:

  • Metin2 Patcher Electron-X.X.X-win.zip: This compressed file contains the complete bundle that can be extracted to the client folder (remove the two unnecessary LICENSE files). Avoid using this if you already have the CEF browser on the client.
  • metin2_patcher_electron.exe: This executable is zipped, and it will extract to a temporary directory during runtime (takes about 3 seconds to fully launch) and will clean up automatically upon closing. This is a suitable option if the first one cannot be performed.

Development Testing

If running a local web server (like Apache, XAMPP, or WAMP) is not viable, you may need to configure CORS on your remote server.

For NGINX:
In your configuration file for the patcher host, add:

 
This is the hidden content, please

For Apache:
In your configuration file, include:

 
This is the hidden content, please

You may also need to enable the headers module:

 
This is the hidden content, please

Running in Development Mode

First, launch the frontend (ensure port 3000 is free; otherwise, another port will be assigned, causing the patcher to display a blank screen):

 
This is the hidden content, please

Then, start the Electron application:

 
This is the hidden content, please

Web Server Setup

Using this Node.js script, place the client files in a directory named files and run the script. It generates a JSON file listing filenames, sizes, and checksums.

Multi-language Support

Currently, the application supports English (default) and Portuguese as examples for adding additional languages. To include new languages, modify both src/i18n.ts and src_electron/i18n.ts.

To add a language:

  1. Import the translation file (.json) into the localization/ folder.
  2. Add the new language to the resources and supportedLngs arrays.

Do not modify placeholders ({{ }}) when creating a new language, or issues may arise. To add language flags, adjust the src/components/Buttons.ts file, adding a button for each language that is officially supported.

Slider Configuration

To configure the slider, update the respective values in src/config.ts. The webserver file should resemble this structure:

 
This is the hidden content, please

Images should have dimensions of 780x300 pixels, and the image paths should be relative to the directory defined by the src/config.ts variable patchSliderImages. It’s recommended to use WebP images over PNG/JPG/JPEG for better quality at reduced file sizes.

Image Optimization Script

To convert images, the following script can be utilized:

 
This is the hidden content, please

You will need to install these packages:

This is the hidden content, please

This is the hidden content, please

Place images in a folder named img, and the output will be directed to the img_webp directory.

Reporting Issues

If you encounter any challenges, please open a New Issue for assistance.

 

This is the hidden content, please

This is the hidden content, please

This is the hidden content, please

This is the hidden content, please

This is the hidden content, please

Author

Karbust

 

Link to comment
Share on other sites


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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.

spacer.png

Disable AdBlock
The popup will be closed in 5 seconds...