Jump to content

Karbust

Management
  • Posts

    1161
  • Joined

  • Days Won

    10
  • Feedback

    100%

Posts posted by Karbust

  1. Every time you jump into a new code base it is always confusing, either you are proficient in the language or framework, or not. It takes time to adjust yourself to the new code, to know how it works and where is the most important parts are.

    Most of the most experienced devs in the metin2 scene have been around it for years, and the source only leaked in 2014.

    • Love 1
  2. 5 minutes ago, FNCX said:

    Sorry, but all of your statements are just excuses. You can even make a patcher via bat using curl, we're not talking about if patcher is working or not, because, as I told you before, you can code a patcher using bat files. That's not the case.

    Do you really care about the memory at this point? I mean would you take a shit if it's consuming 500MB ram? 

    You coded an app that streams files over internet and it's usage takes 95MB, is that fine? 

    We both know that it will increase whenever you add new stuff such as Discord app.

    Not even mentioning it's instance bullshit thanks to Chromium browser.

     

    Also, your code will always be visible and people will always manage to unpack your packer, steal everything.


    Default Hello World electron app takes 45-46MB file-size, how much yours take?


    The thing is that I'm saying these in Metin2 forum, a forum that developers have knowledge in Python and C++, while I'm JS developer, I say electron is the worst thing you could use for this project and you say no, it's not.

    Edited: Usually JS developers claim Electron is the best thing you can manage a web app etc, that's why I said this.


    I'm not saying Electron is useless, I'm saying Electron is not suits for this kind of project.

    I have no problem with all you are saying because those are all valid points, except about the unpack part, code wise it can be obfuscated, by that order of ideas then C# apps also have their code always visible, that is a useless point to make.

     

    The patcher compressed with electron-builder on the normal compression mode occupies around 94MB to 98MB.

    Also, when needed I can write a node C++ package, had to do it for something to access the Windows API in more than one occasion.

     

    I use electron because I can use whatever I want to do the frontend, and electron is also extremely popular, I could be using MAUI, Avalonia, Qt, Tauri, and many others, but from all of them, only Electron and Tauri are well supported and can use web frontend technologies to develop the UI, for me that is a great and a trade I'm willing to make in memory usage. There is also Electron.NET, that uses Electron behind the scenes with a C# backend instead of Node.js but isn't very popular. And, like I already said, I'm not willing to learn Rust to use Tauri.

    I'm a web developer and I'm not locked to JavaScript/TypeScript, in fact on the backend I use ASP.NET C#, with React frontends.

    (Another thing, I hate Python, so not even dead I would even think of using it for anything other than the metin2 GUI.)

     

    And, to finalize, please contribute something useful to the community, 3 out of your 6 posts are complaining about Electron, pick a tool and do a patcher for the community, or share something else.

    It's because of minds like that that the metin2 scene doesn't evolve, always using the same thing for everything.

  3. 15 minutes ago, FNCX said:

    i didn't say electron is useless, i said what is the point of making metin2 patcher with electron. 
     

    That explains

    And what is the problem of having a patcher made in electron? It is still good for a metin2 patcher, my services are even based on it.

     

    Also, is this a lot of memory?

    raw

    Could be lower using something like Tauri or even full C# or C++, but it is actually not that bad.

  4. 7 hours ago, FNCX said:

    what's the point of running a browser that consumes memory a lot compared to other drawing guis for patcher lmao

    I made it in electron for 2 reasons, I wanted to learn how to use for a long time, and because I could use React to do it, like a website.

    I agree electron uses a lot of memory and the bundle size is big, because it bundles the entire chromium browser.

     

    I have seen an alternative that uses the system browser API instead of bundling an entire browser, however, it is made in Rust, it is Tauri, I'm not interested in learning it.

    Quote

    WRY is a cross-platform WebView rendering library in Rust that supports all major desktop platforms like Windows, macOS, and Linux. Tauri uses WRY as the abstract layer responsible to determine which webview is used (and how interactions are made).

    You are more than welcome to explore it, if you already know Rust then it should be pretty straightforward.

     

    5 hours ago, b6d4a82c15 said:

    Nowadays computers are much more powerful and so electron/CEF apps have become the norm. It's also easier to develop and maintain.

    Slack, MS teams, discord, whats, spotify, battle.net client, Adobe Illustrator and many others are running inside embedded browsers.

    It is easy to maintain a electron application because you can have it use the same code base as the main website (if that is something the developer wants to do), just needs to add some abstraction layers to determine what API to use, if the electron, or the browser, other than that, it just works.

    And by the way, Adobe software is written in C++ (Qt), as far as I know.

    MS Teams used to use Electron but changed to WebView2: https://techcommunity.microsoft.com/t5/microsoft-teams-blog/microsoft-teams-advantages-of-the-new-architecture/ba-p/3775704

    But yeah, many companies use Electron for their applications because if makes deploying a product fast and easy.

    • Love 1
  5. Hello everyone,

    Napoleon Dynamite Hello GIF by 20th Century Fox Home Entertainment

    Most of you already know me, and for those who don't, I have been a member of metin2.dev since 2014, in the metin2 scene since 2012, so definitely not one of the oldest on the scene.

    Started playing metin2 on a Portuguese private server (#EliteMT2) and because I liked the game, I started trying to understand how it works, it was the best thing I could have done and paved the ground to where I am today as a programmer and a degree in Computer Engineering.

    Most of my experience has been in programming, mostly web development (JavaScript, TypeScript, Node.js, .NET C#), but I dable in multiple areas, including Network Administrator at my current job. Managing a community as big as this one will be a challenge that I'm willing to take so that it can keep running smoothly.

    In the beginning I will be getting familiar with how it is already working and then start comming up with ideas to improve the community.

    Hope you receive me well and, if you have any issues, questions, ideas (all ideas are welcome), get in contact with me through discord (preferably) or a DM on the forum.

     

    • Metin2 Dev 2
    • kekw 1
    • Eyes 1
    • Scream 1
    • Good 3
    • Love 2
    • Love 13
  6. 9 hours ago, Gantur said:

    Connection Error for me..
    eaa4c246212a93b98182cf60a0006a66.png
     

    5daa47ef10190a93dfa495103ea1a93d.png

    Do I have to do a CORS update?
    Or is there a chance without a Cors update?

    On debug you have to update CORS, that's not needed when you build it.

    Add a console.log above the following line: 

    This is the hidden content, please

    Also add the variable name on line (between the parentisis) 

    This is the hidden content, please
     to be able to see what the error is.

    After you do this, the error will be shown on the Chromium DevTools that the patcher opens on debug.

    • Metin2 Dev 6
    • Good 2
    • Love 1
    • Love 4
  7. 13 hours ago, Gantur said:

    Can you explain how to set it up for FTP?
    How to make connection to Domain server "FTP" and create the .exe file

    Those instructions are on the README and on the first post, edit the file config.ts with your variables and then run yarn run electron-pack to create the exe. The script to generate fhe files.json for the webserver is also on the first post and the README.

    • Good 1
  8. 6 minutes ago, WeedHex said:

    Hello guys I've a question.

    Does anybody is signing his own exe file before to send it in release? 

    Windows if you don't sign it will thrown the warning "Unknown author".

    Do you have any suggestion to buy or make for free a signature?

    The only way to disable Windows SmartScreen is with a EV Code Signing Certificate, and it’s only available for registered companies and has a strict verification process.

    Self-signed Code Signing Certificates are only recognized on the machine they were created.

    The other options is having an IV or OV Code Signing Certificate, but it doesn’t automatically remove the Windows SmartScreen, that only happens with EV, it needs to build reputation, only after that it will disappear. (Neither option is free, and there is a verification process and the certificate will have the name of the Individual or the Organization that was validated through the process. Depending on the country the verification can be lengthy, in Portugal I even had to get myself notarized and sign some documents for Sectigo on the notary.)

    On my patcher services I offer an addon for Code Signing, and I also sign my own client and other tools I may share with others on my services.

    • Love 1
  9. JFeOiL0.png

    Update

    Today I added ID, name and description to the skills.

    I've also added search and filters to the skills' tab (doesn't work on affects, only skills).

    Not all of them have ID/names/descriptions because the tab has Affects and Skills, and the name for the affects is set on the python side. I'll try to add them (manually) in the future.

    https://m2icondb.com/Skills

     

    • Metin2 Dev 2
    • Love 2
  10. 4 minutes ago, MachuP1chu said:

    Hello !
    Do we find somewhere the icons for each character skillsets and secondary icons like combo, horse level, polymorph points ?

    No, those icons are not available on M2IconDB, mainly because they aren't really icons, they are all on the same image, parsing those images would be a pain for me.

    G35iKW5.png

     

    But could be something to probably add in the future.

  11. Good luck finding one, unless someone already made one and doesn't mind sharing...

    The database by default uses MyISAM, so no foreign key support, so not possible to generate the diagram from the DB.

    Plus some tables can have foreign keys of different tables, like the table item, the owner_id can either be the player.id or the account.id, depends on where the item is, inventory of safebox/mall...

    • Smile Tear 1
  12. Hello guys

    So, now that Cloudflare R2 is in general availability, it's time to talk about it and how it can improve your metin2 servers, more specifically, the patcher.

    Tradicional CDNs and block storage are expensive and charge a lot for egress bandwidth, but Clouldflare, as always, doesn't charge for bandwidth, at all. Here is the pricing: https://developers.cloudflare.com/r2/platform/pricing/

    Storage: 10GB/month (free), then $0.015/GB-month
    Class A Operations: 1 million requests/month, then $4.50/million requests
    Class B Operations: 10 million requests/month, then $0.36/million requests

    On Class A, the more important operations for the patcher are: PutObject, and, if you use cloudflare's dashboard, ListBuckets and ListObjects (or the equivalent AWS S3 commands on the script at the bottom).
    On Class B, the more important operations for the patcher are: GetObject, and, again, if you use cloudflare's dashboard, UsageSummary (or the equivalent AWS S3 commands on the script at the bottom).

    I made a small PowerShell script to download a lot of files from the storage:

    For ($i = 0; $i -lt 1000; $i++) {
        $ProgressPreference = 'SilentlyContinue'
        $combinedVariable = "C:\Users\Karbust\Desktop\test\metin2_$i.exe"
        $Response = Invoke-Webrequest -Uri https://<my custom domain>/metin2.exe -OutFile $combinedVariable
    }

    This was the usage metrics:

    ouL2AGY.png

    They barely change, the 20 class B requests are basically all from UsageSummary (refreshing the page), and the Class A are ListBuckets and ListObjects.

    Why is that? Because by using a custom domain it will cache the requests. This is good to prevent GetObject flooding requests. Cloudflare, on free accounts (until Enterprise), can cache up to 512MB per file.

    Instead of relying on the default cache rules, you can change them, to something like this:

    7ekgRbH.png

    When you make an update, you need to purge the cache, either purge it all or just the files you want.

     

    Tutorial

    Go to your cloudflare dashboard and access the R2 tab:

    V9t2yPN.png

    There you will be asked to enable it. You will need to have a payment setup in the account.

    Then, after that's done, create a bucket, you can call it whatever you want:

    8H0b1kN.png

    Then go you Settings and scroll down to the Domain Access section and add one:

    The domain must be in the same cloudflare account as the bucket.

    KU4iZZc.png

    LVhGpZX.png

    Now you can use that domain to access the files in the bucket. If you change the cache settings, you must do it on the domain you added.

    When you upload a file (or a folder), it will be something like this:

    QmtSW4N.png

    To access that file, you do https://<domain>/metin2.exe, like this: https://r2-tests.karbust.com/metin2.exe

    If you have folders, just do https://<domain>/folder_name/file_name.

     

    If you use my patcher:

    You just need to edit this variables:

    export const patchlistUrl = 'https://<domain>/files.json'
    export const patchlistFolder = 'https://<domain>/files/'
    export const patchSliderUrl = 'https://<domain>/slider.json'
    export const patchSliderImages = 'https://<domain>/slider/'

     

    Since you can't upload more than 100 files at the same time with the dashboard, I made a script in typescript to help with that:

    This is the hidden content, please
     or 
    This is the hidden content, please

    The instructions are in the repository, but I will say this, add the files inside the uploads folder, then run the script. If try to upload a file which already exists and the MD5 hash matches, it will not be uploaded and will return a http error code 412.

     

    The end

     

    I decided to make this tutorial since many servers use either one or multiple VPS to have more bandwidth, and downloads can become slow if many players are downloading at the same time, and because Cloudflare doesn't charge for used bandwidth, and has a generous free tier can is more than enough for almost all server owners.

     

    Enjoy

    • Metin2 Dev 34
    • Good 5
    • Love 4
    • Love 19
  13. Sorry, my mistake, here's the correct query. Added a check to not select players in which the accounts that are don't have status OK.

    SELECT
    	p.id, 
    	p.`name`, 
    	p.job, 
    	p.playtime, 
    	p.`level`, 
    	p.exp, 
    	g.`name` AS g_name, 
    	pi.empire
    FROM player.player AS p
    LEFT JOIN player.guild_member AS gm ON gm.pid = p.id
    LEFT JOIN player.guild AS g ON g.id = gm.guild_id
    INNER JOIN account.account AS a ON p.account_id = a.id
    INNER JOIN player.player_index AS pi ON p.account_id = pi.id
    WHERE
    	p.`name` NOT LIKE '[%]%' AND
    	a.`status` = 'OK'
    ORDER BY
    	p.`level` DESC, 
    	p.exp DESC, 
    	playtime DESC
    LIMIT 100

     

    Just now, Karbust said:

    Sorry, my mistake, here's the correct query. Added a check to not select players in which the accounts don't have status OK.

    SELECT
    	p.id, 
    	p.`name`, 
    	p.job, 
    	p.playtime, 
    	p.`level`, 
    	p.exp, 
    	g.`name` AS g_name, 
    	pi.empire
    FROM player.player AS p
    LEFT JOIN player.guild_member AS gm ON gm.pid = p.id
    LEFT JOIN player.guild AS g ON g.id = gm.guild_id
    INNER JOIN account.account AS a ON p.account_id = a.id
    INNER JOIN player.player_index AS pi ON p.account_id = pi.id
    WHERE
    	p.`name` NOT LIKE '[%]%' AND
    	a.`status` = 'OK'
    ORDER BY
    	p.`level` DESC, 
    	p.exp DESC, 
    	playtime DESC
    LIMIT 100

     

     

    • Love 1
  14. Use this queries instead

    For player ranking:

    SELECT
    	p.id, 
    	p.`name`, 
    	p.job, 
    	p.playtime, 
    	p.`level`,
    	p.exp, 
    	g.`name` AS g_name
    FROM player AS p
    INNER JOIN guild_member AS gm ON gm.pid = p.id
    INNER JOIN guild AS g ON g.id = gm.guild_id
    WHERE p.`name` NOT LIKE '[%]%'
    ORDER BY
    	p.`level` DESC, 
    	p.exp DESC, 
    	playtime DESC
    LIMIT 100

    For guild ranking:

    SELECT
    	g.`name`, 
    	g.`level`, 
    	g.exp, 
    	g.win, 
    	g.draw, 
    	g.loss, 
    	g.ladder_point, 
    	p.`name`, 
    	p.id
    FROM player AS p
    INNER JOIN guild_member AS gm ON p.id = gm.pid
    INNER JOIN guild AS g ON g.id = gm.guild_id
    WHERE p.`name` NOT LIKE '[%]%'
    ORDER BY ladder_point DESC
    LIMIT 100

     

    • Love 1
  15. 6 minutes ago, Protheus said:

    But they can find my identity as long as I pay for the server, bank account and etc if I am not wrong.

    How do I find if a hosting company does not care about DMCA?

    Many hosts allow payments through cryptocurrency, mainly the ones that don't care about DMCA.

    For non-DMCA compliant hosts I'm not the best to answer, but I will leave this image here that I have found on some tor forum a while ago:

    r8qMQ1A.png

    • Metin2 Dev 2
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / 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.