Source Code Ragnarok Origin[Full] Source 

I understand that to convert a byte array to GSConf format you need to process each byte according to the GSConf format. If characters are available as single bytes, we can use their ASCII encoding.

Below is C++ code that converts a byte array to GSConf format using ASCII encoding:
t x,I'll try and hope it can work
 
I understand that to convert a byte array to GSConf format you need to process each byte according to the GSConf format. If characters are available as single bytes, we can use their ASCII encoding.

Below is C++ code that converts a byte array to GSConf format using ASCII encoding:
around this line
Code:
for (size_t i = 0; i < length; ++i) {
       gsconf << "\\x" << std::setw(2) << static_cast<int>(bytes);
}

shouldn't it be `bytes [ i ]` otherwise what's the point of the loop


PS.
it seems ragezone for whatever reason doesn't let me put `i` between `[` and `]` without a space.

Does anyone have any alternative forums like this? just wanna put those in my *checkout* list...
 
around this line
Code:
for (size_t i = 0; i < length; ++i) {
       gsconf << "\\x" << std::setw(2) << static_cast<int>(bytes);
}

shouldn't it be `bytes [ i ]` otherwise what's the point of the loop


PS.
it seems ragezone for whatever reason doesn't let me put `i` between `[` and `]` without a space.

Does anyone have any alternative forums like this? just wanna put those in my *checkout* list...
C++:
#include <iostream>
#include <iomanip>
#include <sstream>

// Function to convert a bytes array to GSConf format
std::string bytesToGSConf(const unsigned char* bytes, size_t length) {
    std::stringstream gsconf;
    gsconf << std::hex << std::setfill('0'); // Hexadecimal format, fill with leading zeros

    for (size_t i = 0; i < length; ++i) {
        gsconf << "\\x" << std::setw(2) << static_cast<int>(bytes[i]);
    }

    return gsconf.str();
}

int main() {
    // Example bytes array
    unsigned char bytes[] = {0x48, 0x65, 0x6c, 0x6c, 0x6f}; // Contains "Hello" characters
    size_t length = sizeof(bytes) / sizeof(bytes[0]);

    // Convert bytes array to GSConf format
    std::string gsconf = bytesToGSConf(bytes, length);

    // Print the GSConf formatted data
    std::cout << gsconf << std::endl;

    return 0;
}

Can you check it now?
 
C++:
#include <iostream>
#include <iomanip>
#include <sstream>

// Function to convert a bytes array to GSConf format
std::string bytesToGSConf(const unsigned char* bytes, size_t length) {
    std::stringstream gsconf;
    gsconf << std::hex << std::setfill('0'); // Hexadecimal format, fill with leading zeros

    for (size_t i = 0; i < length; ++i) {
        gsconf << "\\x" << std::setw(2) << static_cast<int>(bytes[i]);
    }

    return gsconf.str();
}

int main() {
    // Example bytes array
    unsigned char bytes[] = {0x48, 0x65, 0x6c, 0x6c, 0x6f}; // Contains "Hello" characters
    size_t length = sizeof(bytes) / sizeof(bytes[0]);

    // Convert bytes array to GSConf format
    std::string gsconf = bytesToGSConf(bytes, length);

    // Print the GSConf formatted data
    std::cout << gsconf << std::endl;

    return 0;
}

Can you check it now?
i mean it's converting an array of chars into a hex string, i was just trying to point out that `bytes [ i ]` was missing, but it seems ragezone has some sort of bug that it's not letting me put `i` between `[` and `]` without any spaces between them
 
i mean it's converting an array of chars into a hex string, i was just trying to point out that `bytes [ i ]` was missing, but it seems ragezone has some sort of bug that it's not letting me put `i` between `[` and `]` without any spaces between them
I wrote it for testing purposes [i ]

yeah i noticed now and it doesn't show up
 
C++:
#include <iostream>
#include <iomanip>
#include <sstream>

// Function to convert a bytes array to GSConf format
std::string bytesToGSConf(const unsigned char* bytes, size_t length) {
    std::stringstream gsconf;
    gsconf << std::hex << std::setfill('0'); // Hexadecimal format, fill with leading zeros

    for (size_t i = 0; i < length; ++i) {
        gsconf << "\\x" << std::setw(2) << static_cast<int>(bytes[i]);
    }

    return gsconf.str();
}

int main() {
    // Example bytes array
    unsigned char bytes[] = {0x48, 0x65, 0x6c, 0x6c, 0x6f}; // Contains "Hello" characters
    size_t length = sizeof(bytes) / sizeof(bytes[0]);

    // Convert bytes array to GSConf format
    std::string gsconf = bytesToGSConf(bytes, length);

    // Print the GSConf formatted data
    std::cout << gsconf << std::endl;

    return 0;
}

Can you check it now?
This won't work, the formatting is different. If you happen to encounter a string more than 127 in length this will already give you wrong data.
 
Can anyone help me with below errors? Tried to fix it whole day today, but still no luck. Is something wrong with the libconfiglib.a I built?

-----Translation-----

有没有大佬能帮忙看看下面的错误,搞了一整天也没搞出来。是不是和我编译的libconfiglib.a有关?

QQ20240414222038.webp
 
Can anyone help me with below errors? Tried to fix it whole day today, but still no luck. Is something wrong with the libconfiglib.a I built?

-----Translation-----

有没有大佬能帮忙看看下面的错误,搞了一整天也没搞出来。是不是和我编译的libconfiglib.a有关?

View attachment 259616
you have multiple undefined references to log4cxx

seems you may be missing the header file for log4cxx in said log_engine file.
 
1713113820929.png

no login to game, Try again tomorrow。 Good Luck everybody。
guess:no gvg mode, version it max date 2020.03.
 
Last edited:
you have multiple undefined references to log4cxx

seems you may be missing the header file for log4cxx in said log_engine file.
Thanks for your replying. Maybe it is because I changed some code related to log4cxx. What I have done now is, I get original code again, then changed the script for building libconfiglib, based on the one for librogamelibs (maybe this is not necessary). It looks OK now.
 
Have you fixed Gameserver or is it because of that that you cannot log in?
1713147042978.webp

datebase and game client port to same. client version and server version to same.
CSproject need rebuild.


you have multiple undefined references to log4cxx

seems you may be missing the header file for log4cxx in said log_engine file.
1713146893747.png

you need build log4cxx.lib to x86 or x64.
 
Last edited:
Back