-
Notifications
You must be signed in to change notification settings - Fork 16
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
d2r holds saves when open #6
Comments
Hey, good point The main menu displays character's gear and D2R I want to stay away from checking memory for open processes since Windows will give virus warnings for Gomule. I'll add a warning to the app to exit D2R when using Gomule and also to the Readme Doc) I'll think about how to add a code check to prevent accidental saving when D2R is open. Maybe have a pop-up confirmation window but that could be annoying to click through every time saving happens |
I do believe that a simple Maybe check this before performing actions on a save file? I agree in general that a modal window is annoying in general. However, since this is a potentially destructive action, it's justified in my view. |
File cannot be open if you can save over it? I think D2R caches chars and saves them at exit. m4ke |
@Pwntheon good idea Trying this example from stack overflow https://stackoverflow.com/questions/1390592/check-if-file-is-already-open
Like m4ke72 said D2R keeps the char data in memory and writes to the savefile once the game is closed I think your first suggestion is the way to go-- checking for a running process Game.exe / D2R.exe. String processName = "D2R.exe";
ProcessBuilder processBuilder = new ProcessBuilder("tasklist.exe");
try {
Process process = processBuilder.start();
Scanner scanner = new Scanner(process.getInputStream(), "UTF-8").useDelimiter("\\A");
String strr = scanner.hasNext() ? scanner.next() : "";
System.err.println("process scanner: " + strr);
scanner.close();
// check if game is running
System.err.println("strr.contains(processName);: " + strr.contains(processName));
}catch(Exception e) {
;
} this check from stack overflow is working, i'll see if Windows has any "potential unsafe software" warnings when opening the gomule.jar |
Please don't make this Win only software ! m4ke |
@m4ke72 |
@Pwntheon here's a build ready with a check for d2r.exe running before saving files I didn't get any annoying windows warning popups when launching gomule.jar |
Hi.
It appears you need to quit d2r completely to mule - you can't just leave the game. If you have the game open, this can lead to items disappearing (if you move from stash to char) or duping (char to stash).
In the long run it would be nice to add some checks to see if the file has actually been written to, but short term, maybe check if d2r is open and give a warning or something?
The text was updated successfully, but these errors were encountered: