Jump to content
View in the app

A better way to browse. Learn more.

Shaiya.gg

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Episode 5.4 Vietnamese language support (game.exe)

First of all, I would like to thank [mention=78]darren.tran[/mention] and [mention=18]Lothbrok[/mention] for their help. They answered my questions and tested the solution to make sure it works. This was a team effort. We will be using this client from the archive:

 

https://archive.openshaiya.org/shaiya-us/clients/ps0183-22-12-2011-game.exe

 

There used to be a language setting in the configuration file. A number was assigned to a global variable, depending on the key value.

 

enum struct LoginVersion : UINT32
{
   Korea = 1,     //
   China,         //
   Vietnam,       // 65001 (UTF-8)
   Japan,         // 932
   Taiwan,        // 950
   English,       // CP_ACP
   Germany,       // CP_ACP
   SingaMala,     // 950
   HongKong,      // 950
   France,        // CP_ACP
   Russia,        // CP_ACP
   Turkey,        // 1254
   Brazil,        // CP_ACP
   LatinAmerica,  // CP_ACP
   Poland,        // 1250
   Italy,         // CP_ACP
   Philippines    // CP_ACP
};

 

// winnls.h.
#define CP_ACP 0 // default to ANSI code page

 

See the following documentation to learn more:

 

MultiByteToWideChar

WideCharToMultiByte

https://learn.microsoft.com/en-us/windows/win32/intl/code-page-identifiers

 

Depending on the language number, a switch returns a code page. The function can be found at address 0x40A550.

 

[ATTACH type=full" alt="Capture.PNG]79[/ATTACH]

 

Case 3 (Vietnam) returns 65001 (UTF-8). Since we are using a US client, the number will be 6 (English). We will change the number at address 00708598 from 6 to 3.

 

[ATTACH type=full" alt="Capture3.PNG]81[/ATTACH]

 

Changing the number will affect several things. It appears they wrote features for particular regions. What is relevant to this guide is the fonts. Each language has its own fonts, which vary in height, weight, etc. The language value is compared to determine which block to execute. Follow the jump instructions until you see 3 (Vietnam).

 

[ATTACH type=full" alt="Capture2.PNG]80[/ATTACH]

 

Below the call to CreateFontA it creates 3 more fonts. The values 0x190 and 0x2BC are weight macros.

 

// wingdi.h
/* Font Weights */
#define FW_DONTCARE         0
#define FW_THIN             100
#define FW_EXTRALIGHT       200
#define FW_LIGHT            300
#define FW_NORMAL           400 // 0x190
#define FW_MEDIUM           500
#define FW_SEMIBOLD         600
#define FW_BOLD             700 // 0x2BC
#define FW_EXTRABOLD        800
#define FW_HEAVY            900

 

Now, we need to embed the manifest. Please see the following documentation:

 

https://learn.microsoft.com/en-us/windows/apps/design/globalizing/use-utf8-code-page

https://devblogs.microsoft.com/oldnewthing/20220531-00/?p=106697

https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests#activecodepage

 

If you've added additional sections to the file, embedding the manifest may break the executable. Embed the manifest before doing anything else. I'm sure there is more than one way to do this, so find something that works for you.

 

Put the following manifest file in the same directory as game.exe:

 

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
 <assemblyIdentity type="win32" name="..." version="6.0.0.0"/>
 <application>
   <windowsSettings>
     <activeCodePage xmlns="http://schemas.microsoft.com/SMI/2019/WindowsSettings">UTF-8</activeCodePage>
   </windowsSettings>
 </application>
</assembly>

 

The Windows SDK includes a program named mt.exe, which can be used to embed the manifest. You will need to add the path to your system environment variables so the system can find the file. The path will look something like this:

 

C:\Program Files (x86)\Windows Kits\10\bin\10.0.20348.0\x86

 

Execute the following command to embed the manifest:

 

mt.exe -manifest utf-8.manifest -outputresource:game.exe;#1

 

You can use Resource Hacker to check the result. It should also be able to embed the manifest, but I didn't test it.

 

[ATTACH type=full" alt="Capture4.PNG]82[/ATTACH]

 

Notes

 

Login input limit:

Japan (4): 12

Russia (11): 31

Default: 19

 

Chat input limit:

Taiwan (5): 70

Hong Kong (9): 70

Default: 120

 

Note: the chat color format is 8 characters.

Edited by Bowie

Featured Replies

Great work, I'm sure this will be helpful to many people who are looking to create non-english servers. Perhaps it may be beneficial to also look into expanding the source array for chat messages as by default they are capped at 128 bytes, and as far as I'm aware, most Vietnamese characters (and non-english languages) use at least 2 bytes to encode the rune. UTF-8, despite what the name implies, uses up to 4-bytes per character in some cases.
  • Author
I found some input buffers when I was looking at the memory, but I didn't add them to the repo. I need some more time to wrap my head around this stuff. I wasn't even aware of the problem until Garret told me about it.

Edited by Bowie

Dear Bowie,

 

First and foremost, I want to express my deep appreciation for your heartfelt post on the Shaiya forum!

 

I would like to share some thoughts on the impact of your post. By publishing this content, it unintentionally affected the development efforts of other developers. I believe this was not your intention, but the competition in other countries is quite intense due to a limited player base, not as extensive as the EU community. This creates a more challenging competitive environment and requires mutual respect among developers.

 

This developers to have the space to develop and compete in a healthy manner and negatively affecting the Asian community.

 

Once again, I sincerely thank you for your unwavering contributions to the Shaiya community. Your efforts and passion are always recognized and appreciated.

 

Best regards !

Edited by StinKorea

Anyone saying that someone shouldn't share something because it disrupts developers in other regions is just childish. It is not the fault of our community that foreign developers don’t cooperate with each other, or with us. The goal of this community is to create a better environment for Shaiya players, and I'm all for anything that advances that goal. If you do not agree, you do not belong here.

Edited by Cups

  • Author
I added a link to a blog post that explains how to use the manifest for code pages other than UTF-8. The author explains default behavior too.
  • 2 weeks later...

Bowie thân mến,

 

Trước hết, tôi muốn bày tỏ lòng biết ơn sâu sắc của tôi đối với bài viết chân thành của bạn trên diễn đàn Shaiya!

 

Tôi muốn chia sẻ một số suy nghĩ về tác động của bài đăng của bạn. Bằng cách xuất bản nội dung này, nó vô tình ảnh hưởng đến nỗ lực phát triển của các nhà phát triển khác. Tôi tin rằng đây không phải là ý định của bạn, nhưng sự cạnh tranh ở các quốc gia khác khá gay gắt do lượng người chơi hạn chế, không rộng rãi như cộng đồng EU. Điều này tạo ra một môi trường cạnh tranh đầy thách thức hơn và đòi hỏi sự tôn trọng lẫn nhau giữa các nhà phát triển.

 

Những nhà phát triển này có không gian để phát triển và cạnh tranh một cách lành mạnh và không gây ảnh hưởng tiêu cực đến cộng đồng người Châu Á.

 

Một lần nữa, tôi chân thành cảm ơn bạn vì những đóng góp không ngừng nghỉ của bạn cho cộng đồng Shaiya. Những nỗ lực và đam mê của bạn luôn được ghi nhận và trân trọng.

 

Trân trọng

You are a bad person

Ôi trời! Tại sao bạn lại chia sẻ điều này? Tôi nghĩ nó không

nên xuất hiện

You are a bad person bro

First of all, I would like to thank [mention=78]darren.tran[/mention] and [mention=18]Lothbrok[/mention] for their help. They answered my questions and tested the solution to make sure it works. This was a team effort. We will be using this client from the archive:

 

https://archive.openshaiya.org/shaiya-us/clients/ps0183-22-12-2011-game.exe

 

There used to be a language setting in the configuration file. A number was assigned to a global variable, depending on the key value.

 

enum struct LoginVersion : UINT32
{
   Korea = 1,     //
   China,         //
   Vietnam,       // 65001 (UTF-8)
   Japan,         // 932
   Taiwan,        // 950
   English,       // CP_ACP
   Germany,       // CP_ACP
   SingaMala,     // 950
   HongKong,      //
   France,        // CP_ACP
   Russia,        // CP_ACP
   Turkey,        // 1254
   Brazil,        // CP_ACP
   LatinAmerica,  // CP_ACP
   Poland,        // 1250
   Italy,         // CP_ACP
   Philippines    // CP_ACP
};

 

// winnls.h.
#define CP_ACP 0 // default to ANSI code page

 

See the following documentation to learn more:

 

MultiByteToWideChar

WideCharToMultiByte

https://learn.microsoft.com/en-us/windows/win32/intl/code-page-identifiers

 

Depending on the language number, a switch returns a code page. The function can be found at address 0x40A550.

 

[ATTACH=full]79[/ATTACH]

 

Case 3 (Vietnam) returns 65001 (UTF-8). Since we are using a US client, the number will be 6 (English). We will change the number at address 00708598 from 6 to 3.

 

[ATTACH=full]81[/ATTACH]

 

Changing the number will affect several things. It appears they wrote features for particular regions. What is relevant to this guide is the fonts. Each language has its own fonts, which vary in height, weight, etc. The language value is compared to determine which block to execute. Follow the jump instructions until you see 3 (Vietnam).

 

[ATTACH=full]80[/ATTACH]

 

Below the call to CreateFontA it creates 3 more fonts. The values 0x190 and 0x2BC are weight macros.

 

// wingdi.h
/* Font Weights */
#define FW_DONTCARE         0
#define FW_THIN             100
#define FW_EXTRALIGHT       200
#define FW_LIGHT            300
#define FW_NORMAL           400 // 0x190
#define FW_MEDIUM           500
#define FW_SEMIBOLD         600
#define FW_BOLD             700 // 0x2BC
#define FW_EXTRABOLD        800
#define FW_HEAVY            900

 

Now, we need to embed the manifest. Please see the following documentation:

 

https://learn.microsoft.com/en-us/windows/apps/design/globalizing/use-utf8-code-page

https://devblogs.microsoft.com/oldnewthing/20220531-00/?p=106697

https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests#activecodepage

 

If you've added additional sections to the file, embedding the manifest may break the executable. Embed the manifest before doing anything else. I'm sure there is more than one way to do this, so find something that works for you.

 

Put the following manifest file in the same directory as game.exe:

 

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
 <assemblyIdentity loại="win32" tên="..." phiên bản="6.0.0.0"/>
 <ứng dụng>
   <Cài đặt windows>
     <activeCodePage xmlns="http://schemas.microsoft.com/SMI/2019/WindowsSettings">UTF-8</activeCodePage>
   </windowsCài đặt>
 </ứng dụng>
</lắp ráp><//CODE]

Windows SDK bao gồm một chương trình có tên mt.exe, có thể được sử dụng để nhúng manifest. Bạn sẽ cần thêm đường dẫn vào biến môi trường hệ thống của mình để hệ thống có thể tìm thấy tệp. Đường dẫn sẽ trông giống như thế này:

[MÃ]C:\Program Files (x86)\Windows Kits\10\bin\10.0.20348.0\x86[/MÃ]

Thực hiện lệnh sau để nhúng tệp kê khai:

[MÃ]mt.exe -manifest utf-8.manifest -outputresource:game.exe;#1[/MÃ]

Bạn có thể sử dụng Resource Hacker để kiểm tra kết quả. Nó cũng có thể nhúng manifest, nhưng tôi chưa kiểm tra.

[ATTACH type="full" alt="Capture4.PNG"]82[/ATTACH]

[b]Ghi chú[/b]

Giới hạn đầu vào đăng nhập:
Nhật Bản (4): 12
Nga (11): 31
Mặc định: 19

Giới hạn nhập nội dung trò chuyện:
Đài Loan (5): 70
Hồng Kông (9): 70
Mặc định: 120

Lưu ý: định dạng màu trò chuyện là 8 ký
[/quote]

How to add manifest into game.exe bro ?

  • 4 months later...
In a game with Simplified Chinese, skill descriptions and equipment descriptions may cause garbled text if the displayed text length is too long.
  • 1 month later...
  • 4 weeks later...

Create an account or sign in to comment

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.