• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Compress in .exe all otclient

Thorn

Spriting since 2013
Joined
Sep 24, 2012
Messages
2,203
Solutions
1
Reaction score
921
Location
Chile
Hello guys, i'm trying to achieve this, but i don't know how, and i can't find any tutorials about it...
i want to put the whole client into the exe...and in molebox i don't know how to add folders..only one by one file, and maybe they won't work since they lost their original directory....
also if it's not possible, i would like to pack only the dat and spr into the exe
plz someone help :(
 
According to its help file the files don't loose their directory structure, the VFSROOT becomes the root directory of the application, it would be the same thing as extracting x files in any directory and launching it from there especially since the otclient doesn't bind itself to the host operating system meaning it doesn't need to be installed in order to function properly.

I haven't created anything out of the molebox because I just downloaded and installed it to see its interface & help file and also because I don't really have the time to play with it ( have work in a few hours :( )

-- Double Post Merged --

I just ran a simple test by dropping a few folders & files in a test folder and its sub-folders to test if the app would add the sub folders, then i started a new project clicked on add folders contents (recursive) button and navigated to the directory of the test folder and it loaded up all the files and its sub-folders without me having to add any additional.

Funny thing is the main folder is a 10.77 client and the sub-folders are an otclient, when i click on each folder in the left pane it shows me all the files in those directories on the right pane.

So I don't know why you need to add each folder individually, unless your using an outdated version of the software.. is this version your using cracked?
If so I don't blame you, $150 - $1500 usd is a hefty price to pay for a stand alone application.

-- Triple Post Merged --

I just found this site, maybe its useful maybe its not, you should read the developers notes tho
http://www.cameyo.com/

I went to their public apps section
https://online.cameyo.com/public
and was able to launch open office within a few seconds which is normally a 350 meg+ download and install but i was able to use this software right on the site without any install because it is hosted in their cloud.. something to consider :p
 
Last edited by a moderator:
Hello guys, i'm trying to achieve this, but i don't know how, and i can't find any tutorials about it...
i want to put the whole client into the exe...and in molebox i don't know how to add folders..only one by one file, and maybe they won't work since they lost their original directory....
also if it's not possible, i would like to pack only the dat and spr into the exe
plz someone help :(
OTClient code is ready to read .spr/.dat file from .exe (any file that is 'read only', you can't load config from .exe, because it must be writeable)
All you need to do is to put .spr file as string inside .exe and pass it to FileStream as buffer:
src/framework/core/filestream.cpp, line 38:
PHP:
FileStream::FileStream(const std::string& name, const std::string& buffer) :
    m_name(name),
    m_fileHandle(nullptr),
    m_pos(0),
    m_writeable(false),
    m_caching(true)
{
    m_data.resize(buffer.length());
    memcpy(&m_data[0], &buffer[0], buffer.length());
}
But where can I pass it load .spr from .exe?
in src/client/spritemanager.cpp, line 50:
PHP:
m_spritesFile = g_resources.openFile(file);
In place of it you must use something like [CODE NOT TESTED!]:
PHP:
std::string sprData = "HERE .SPR FILE CONTENT";
m_spritesFile = FileStreamPtr(new FileStream(file, sprData));
Of course you can't just paste .spr file as string (because it may contains ", ; and 'new line' characters that will end line in C++ before end of file - compiler error), but you can use simple 'base64' encoding which is available in OTClient and in PHP.
(use PHP to encode .spr file to safe C++ string format, copy encoded line to C++ string, compile and it should work!)

I used 'base 64' encoding in my OTClient encryption (because I had to paste files content as strings in C++):
https://otland.net/threads/how-to-encrypt-client-files-just-tips-not-full-working-code.235838/

Short example of base64:
PHP:
Crypt* x = new Crypt(); // load OTClient crypt library
std::string allData = ".spr content encoded to base64 by php"; // looong text with all file .spr content 'encoded' by PHP to base64, PHP function: base64_encode('text')
allData = x->base64Decode(allData); // change it's encoding back to normal .spr file [decode]
 
OTClient code is ready to read .spr/.dat file from .exe (any file that is 'read only', you can't load config from .exe, because it must be writeable)
All you need to do is to put .spr file as string inside .exe and pass it to FileStream as buffer:
src/framework/core/filestream.cpp, line 38:
PHP:
FileStream::FileStream(const std::string& name, const std::string& buffer) :
    m_name(name),
    m_fileHandle(nullptr),
    m_pos(0),
    m_writeable(false),
    m_caching(true)
{
    m_data.resize(buffer.length());
    memcpy(&m_data[0], &buffer[0], buffer.length());
}
But where can I pass it load .spr from .exe?
in src/client/spritemanager.cpp, line 50:
PHP:
m_spritesFile = g_resources.openFile(file);
In place of it you must use something like [CODE NOT TESTED!]:
PHP:
std::string sprData = "HERE .SPR FILE CONTENT";
m_spritesFile = FileStreamPtr(new FileStream(file, sprData));
Of course you can't just paste .spr file as string (because it may contains ", ; and 'new line' characters that will end line in C++ before end of file - compiler error), but you can use simple 'base64' encoding which is available in OTClient and in PHP.
(use PHP to encode .spr file to safe C++ string format, copy encoded line to C++ string, compile and it should work!)

I used 'base 64' encoding in my OTClient encryption (because I had to paste files content as strings in C++):
https://otland.net/threads/how-to-encrypt-client-files-just-tips-not-full-working-code.235838/

Short example of base64:
PHP:
Crypt* x = new Crypt(); // load OTClient crypt library
std::string allData = ".spr content encoded to base64 by php"; // looong text with all file .spr content 'encoded' by PHP to base64, PHP function: base64_encode('text')
allData = x->base64Decode(allData); // change it's encoding back to normal .spr file [decode]
thanks man! i have someone working on this, it was too much for me ahha
 
Back
Top