aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/squirrel
diff options
context:
space:
mode:
authorEladNLG <e1lad8955@gmail.com>2023-07-22 23:02:22 +0300
committerGitHub <noreply@github.com>2023-07-22 21:02:22 +0100
commitcf8b267d31dc168673e68e336fd5727aad4e7333 (patch)
tree6dc841f8612529030ae58dc0359aa018fcab9eb9 /NorthstarDLL/squirrel
parentd3fb76f889101f024f410c194a66f0f4a2f6c4a0 (diff)
downloadNorthstarLauncher-cf8b267d31dc168673e68e336fd5727aad4e7333.tar.gz
NorthstarLauncher-cf8b267d31dc168673e68e336fd5727aad4e7333.zip
Safe I/O 2 - Electric Boogaloo! (#404)
* Safe I/O initial commit * Formatting * Formatting 2 * God help us all. * fix diffs part 1 * fix diffs 2 * Fix invalid filter file * Update NorthstarLauncher.vcxproj * Remove newline at EOF * fix the damn thing * God help the diffs * diff hate * diff hate the 2nd * Add comments since this code is unreadable Now, this code may look readable, but I barely understand what I did here myself. * Remove char limit and file definitions * Fix build * organization stuff * Fix build * More funcs, more stuff * format fix * oops, this is wrong. * fix a thing * Add max folder size (250MB) and add getallfiles * Fix build also size cap * reduce max folder size to 50MB * he forgor * i give up * aync edition????? * Fix max size bypass * fix it * Remove logs * Add max folder size launch arg * boop * FUCK SHIT * FUCKKKKKKKKKKK * Fix build * Fix crash * Fix error FINAL!!! * fix scriptjson.h not being found * fix scriptjson.h not appearing correctly * shit diffself * format fix * Fix indentation (thank you vscode) * Fix indentation again * adadasa * shit diffself adadasa Fix indentation (thank you vscode) Fix indentation again * format fix * Revert "shit diffself" This reverts commit b49a62b5b36784df1c01663cdec2e4e403279618. * Revert "Merge branch 'safe-io-rewrite' of https://github.com/EladNLG/NorthstarLauncher into safe-io-rewrite" This reverts commit 761eb8a1cb11ccf1dadf55f5be9a08700fe1d560, reversing changes made to 65549b2f799660d7fe7b5a53e81425922b996ea9. * Fix the diff finally * more diff fixes * Fix more diffs * Allow non-ascii characters that aren't NUL * format fix :( * this is untested and I don't wanna update the safe i/o test thing * fix build :( * fix mayhaps? * fix build * Fix lotsa stuff :D * FIxed :D * Rewrite error messages, rename CheckFileName to IsPathSafe * Shout out to clang-format! * oops, wrong error message :3 * SHOUT OUT TO CLANG-FORMAT!!! * Revert "SHOUT OUT TO CLANG-FORMAT!!!" This reverts commit c536384073528b4eee7c330dfab320a5527ff240. * :( * oop * Add failure callback (launcher) * unnecessary comment * holy shit format fix boooooo. BOOOOOO! * restrict path to ASCII * Fix ascii check I hate you all * reformat * Clang-format my beloved :) * Move the thing * Apply suggestions from code review Co-authored-by: Rémy Raes <contact@remyraes.com> * clang-format no like code suggestions :( * name change * doc'd * - Replace the mutex map with a single mutex for all file actions - Fix Load calls sometimes failing and not calling NSHandleLoadResult - Add NSGetTotalSpaceRemaining which checks how much space a mod has, in KB - Add contstant MAX_FOLDER_SIZE which holds the maximum save folder size, in KB * add safe-io stuff to cmake * surrounds IsPathSafe with a try/catch --------- Co-authored-by: Rémy Raes <contact@remyraes.com> Co-authored-by: uniboi <kami.0.katze@gmail.com>
Diffstat (limited to 'NorthstarDLL/squirrel')
-rw-r--r--NorthstarDLL/squirrel/squirrel.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/NorthstarDLL/squirrel/squirrel.cpp b/NorthstarDLL/squirrel/squirrel.cpp
index 0dd23cd7..43dd0cad 100644
--- a/NorthstarDLL/squirrel/squirrel.cpp
+++ b/NorthstarDLL/squirrel/squirrel.cpp
@@ -1,4 +1,5 @@
#include "squirrel.h"
+#include "mods/modsavefiles.h"
#include "logging/logging.h"
#include "core/convar/concommand.h"
#include "mods/modmanager.h"
@@ -255,6 +256,7 @@ template <ScriptContext context> void SquirrelManager<context>::VMCreated(CSquir
defconst(m_pSQVM, pair.first.c_str(), bWasFound);
}
+ defconst(m_pSQVM, "MAX_FOLDER_SIZE", GetMaxSaveFolderSize() / 1024);
g_pSquirrel<context>->messageBuffer = new SquirrelMessageBuffer();
g_pPluginManager->InformSQVMCreated(context, newSqvm);
}