What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal
RebornBuddy Forums

Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

recompiling and reloading post-launch?

Zimble

Member
Joined
Oct 26, 2012
Messages
66
I've written a plugin to handle updating botbases/plugins/routines from a repo and have reached a state where it's functional. https://github.com/Zimgineering/repoBuddy

Does anyone know how to recompile and reload a single botbase/plugin/routine while rebornbuddy is running? I've messed with the reloadonfilechange flags in the globalsettings but those don't seem to be what I need. (nor do they work in all cases, eg exbuddy because of threading)

At the moment I'm handling the restarts like this:
Code:
private void RestartRebornBuddy()
{           
    AppDomain.CurrentDomain.ProcessExit += new EventHandler(RebornBuddy_Exit);
   
    void RebornBuddy_Exit (object sender, EventArgs e)
    {
        Process.Start("rebornbuddy", "-a"); //autologin using stored key
    }
   
    Process process = Process.GetCurrentProcess();
    process.CloseMainWindow();
}

But that has the obvious caveat of taking more time and writes to the drive as well as essentially making log messages invisible.

Is there a more elegant solution I'm missing, or would I be better off using a preloader?
 
reloadonfilechange is really the only "supported" way, and it's a giant hack.

private void RestartRebornBuddy() { AppDomain.CurrentDomain.ProcessExit += new EventHandler(RebornBuddy_Exit); void RebornBuddy_Exit (object sender, EventArgs e) { Process.Start("rebornbuddy", "-a"); //autologin using stored key } Process process = Process.GetCurrentProcess(); process.CloseMainWindow(); }

You could store log messages in setting, replay them after the restart, also increment a counter or state (inside the setting class) indicating that it was a restart to prevent chain restarting incase something goes wrong.

But that has the obvious caveat of taking more time and writes to the drive as well as essentially making log messages invisible.

Don't worry about writes to drives, the impact is immeasurable.

As for a preloader im not sure what you mean.
 
Good solution for the log messages, is there a way to detect when all components are loaded without specifically targeting a routine or the generic routinesloaded event? Is there any way to get a plugins directory after compile? I have the svn dll hardcoded and that could cause issues for some people.

I have bool restartNeeded initialized as false that gets set to true after a non profile update so I don't loop but I can see why storing it in the settings file could be better. By preloader I just meant something that you run in lieu of rb to update the components and then launch rb, potentially cutting total load time by near half. I've written a bat file to handle this using visualsvn but I really wanted a handsfree solution.
comma delimited batrepos.txt:
Plugins,ExBuddy,https://github.com/Entrax643/ExBuddy.git/trunk/ExBuddy
Code:
@echo off
setlocal enabledelayedexpansion
set RB_Dir=.
set SVN=.\bin\svn.exe

echo RebornBuddy directory set to %RB_Dir%
echo SVN directory set to %SVN%
echo Updating Repos
for /f "usebackq tokens=1-3 delims=," %%A in ("batrepos.txt") do ( if exist ./%%A/%%B/.svn (start /b %SVN% update ./%%A/%%B --accept tf) else (start /b %SVN% checkout %%C ./%%A/%%B))

:whileSVN
TASKLIST | FINDSTR /I "svn.exe" >nul && goto :whileSVN

start %RB_Dir%\rebornbuddy.exe -a
exit
 
Last edited:
You could do something hacky like doing some reflection on the hotkeymanager class and checking the private bool if its been set to true, thats one of the final things done during initialization.

No way to map plugin to directory either
 
Back
Top