-
-
Notifications
You must be signed in to change notification settings - Fork 219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: client auto updater #529
Conversation
modules/updater/updater.lua
Outdated
g_app.restart() | ||
g_logger.info("restart") | ||
--g_app.exit() | ||
-- TODO Restart |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have something like this
void Application::restart()
{
#if not(defined(ANDROID))
STARTUPINFO si;
PROCESS_INFORMATION pi;
ZeroMemory(&si, sizeof(si));
si.cb = sizeof(si);
ZeroMemory(&pi, sizeof(pi));
// Create the child process.
if (CreateProcess((LPCSTR)g_resources.getBinaryName().c_str(), // path to the executable
nullptr, // command line arguments
nullptr, // process handle not inheritable
nullptr, // thread handle not inheritable
FALSE, // handle inheritance flag
0, // creation flags
nullptr, // use parent's environment block
nullptr, // use parent's starting directory
&si, // pointer to STARTUPINFO structure
&pi) // pointer to PROCESS_INFORMATION structure
) {
// Close process and thread handles.
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
} else {
g_logger.fatal("Updater restart error. Please restart application");
}
quick_exit();
#else
exit();
#endif
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will try and let you know, I still need to figure out how to properly update the .exe file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@conde2 Does this work also for linux/mac executables?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The updater or this code from poxis?
The updater should work for mac/linux not sure the if the executable will update, I use windows so not able to test in other systems.
You can try removing the FREE_VERSION and test
void ResourceManager::updateExecutable(std::string fileName)
{
#if defined(ANDROID) || defined(FREE_VERSION)
g_logger.fatal("Executable cannot be updated on android or in free version");
This reverts commit 2a2cc50.
@conde2 try (client.lua) https://pastebin.com/9k69Kftp the problem is probably here (the client is already run so it won't get this feature) otclient/modules/client/client.lua Line 56 in 750077a
edit: edit2: modules/game_newfolder no exist in client my solution: https://pastebin.com/fAj6tShd |
Nice catch! |
…oaded modules, fix updater api for empty files
@poxis There was not problem with loading and saving the settings the problem was that I had a .otml file in 2 places and it loaded from the first and saved on the second one |
Note: condition has been bitwise removed for normal enum as it has maxed out allowed enums due to bit shift. Added conditions for absorbs and increases. Added "COMBAT_NEUTRALDAMAGE" New "Player::getEquippedItems" function that returns only equipped items. Added the systems: • Cleave • Magic shield capacity • Perfect shot range • Damage reflection Added for imbuement info to show up in cyclopedia combat stats and some other stats from cyclopedia.
TODO
I had to move the g_resources.init and g_platform.init maybe this caused some bugs?
@mehah i would appreciate some help fixing this bugs.