Files
Aurora.3/tools/bapi/mapmanip.ps1
DreamySkrell 13082e71ad BAPI - mapmanip submap perf improv + mapmanip script (#19634)
changes:
  - rscadd: "BAPI - mapmanip submap performance improvements."
  - rscadd: "BAPI - mapmanip script."

perf improv in the form of changing the map container from hashmap to a
flat grid
hashmap was only bad for big maps with lots of submaps - did not affect
horizon with its one small submap

the script:


![image](https://github.com/user-attachments/assets/136365c3-5cbc-4189-90a0-f163ea836735)

---------

Co-authored-by: DreamySkrell <>
Co-authored-by: AuroraBuildBot <action@github.com>
2024-07-22 14:40:13 +00:00

39 lines
1.5 KiB
PowerShell

# if you want to run this script but it opens in notepad
# you may want to right click it and "run with powershell"
# script explanation
echo "*****"
echo "This script will run map manipulations on every `.dmm` map that has a `.jsonc` config file,"
echo "and write it to a `.mapmanipout.dmm` file in the same location."
echo "Make sure to not commit these files to the repo."
echo "This script will not show any error messages if map manipulations have failed."
echo "Should launch the actual server to get stacktraces and the like."
echo "*****"
# find path to bapi.dll
if (Test-Path "./../../rust/bapi/target/i686-pc-windows-msvc/release/bapi.dll") {
$BapiPath = "./../../rust/bapi/target/i686-pc-windows-msvc/release/bapi.dll"
} elseif (Test-Path "./../../rust/bapi/target/i686-pc-windows-msvc/debug/bapi.dll") {
$BapiPath = "./../../rust/bapi/target/i686-pc-windows-msvc/debug/bapi.dll"
} elseif (Test-Path "./../../bapi.dll") {
$BapiPath = "./../../bapi.dll"
} else {
echo "Cannot find bapi."
}
# run ffi function from bapi.dll
echo "Executing..."
$BapiDllFunction = "all_mapmanip_configs_execute_ffi"
$BapiExecutionTime = Measure-Command {
# `rundll` runs a function from a dll
# the very sad limitation is that it does not give any output from that function
rundll32.exe $BapiPath,$BapiDllFunction
}
# done
echo "Done!"
echo ("Took {0} seconds, or {1} milliseconds in total." -f $BapiExecutionTime.Seconds,$BapiExecutionTime.Milliseconds)
echo "*****"
Read-Host -Prompt "Press Enter to exit..."