Skip to content
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

Reorganize Tools #323

Merged
merged 8 commits into from
Jun 19, 2018
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
@AresModAchillesExpansion/keys/private
@Release/*
Tools/AchillesTestServer.bat
Tools/AchillesConnectToServer.bat
Tools/AchillesAddonBuilder.bat
*.bikey
*.biprivatekey
*.pbo
*.bisign
*.lnk
.vscode/

.idea
/*.iml
*.ini
Tools/AddonBuilder/config.ini
*.log
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ python:
before_script:
- pip3 install sqflint
script:
- python3 Tools/sqf_validator.py
- python3 Tools/config_style_checker.py
- python3 Tools/travis/sqf_validator.py
- python3 Tools/travis/config_style_checker.py
- sqflint -d @AresModAchillesExpansion/addons
notifications:
email: false
Expand Down
106 changes: 106 additions & 0 deletions Tools/AchillesAddonBuilder.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
@echo off
set "startDir=%CD%"
REM switch to Achilles root folder
cd ..
set "AchillesRootFolderPath=%CD%"

REM /******************************************************************************/
REM Addon Builder script for windows (by Kex)
REM /******************************************************************************/
REM
REM Description:
REM ------------
REM Packs all folders in sourceDir and creates corresponding *.pbo in targetDir.
REM The script is parallelized and will create a window for each source folder.
REM
REM "Installation":
REM ---------------
REM 1) Copy AchillesAddonBuilder.bat.example and rename it to AchillesAddonBuilder.bat
REM 2) Adjust the USER CONFIGURATIONS below
REM 3) Make sure that the AchillesAddonBuilder from Arma 3 Tools is in the PATH env variable
REM
REM Usage
REM -----
REM Command Line Arguments:
REM 1) (optional) version for bikey e.g. "0.0.1" ("dev" by default)
REM
REM Examples:
REM ---------
REM 1) AchillesAddonBuilder.bat 0.0.1
REM 2) AchillesAddonBuilder.bat

REM /******************************************************************************/
REM START OF USER CONFIGURATIONS
REM /******************************************************************************/

REM optional argument: version of bikey: <prefix>_<version>.biprivatekey
set keyVersion=%1

REM Path for the folder where the source folders are located
set "sourceDir=%AchillesRootFolderPath%\@AresModAchillesExpansion\addons"
REM Path for the folder where the *.pbo's shall be moved
set "targetDir=%AchillesRootFolderPath%\@AresModAchillesExpansion\addons"
REM Prefix: you can access your addon files via \<prefix>\<pbo name>\<file>
REM Prefix: if projPrefix is "" then \<pbo name>\<file>
set projPrefix=achilles
REM Prefix for your bikey: <prefix>_<version>.biprivatekey
set privKeyPrefix=achilles
REM Default version (if you don't specify the version as an argument): <prefix>_dev.biprivatekey
REM if no argument is passed and keyVersionDefault="", then the addon doesn't get signed
set "keyVersionDefault="
REM Folder where the biprivatekey is located
set "privKeyDir=%AchillesRootFolderPath%\@AresModAchillesExpansion\keys\private"
REM Temporary folder
set "tmpDir=%TEMP%"

REM /******************************************************************************/
REM END OF USER CONFIGURATIONS
REM /******************************************************************************/

REM get biprivatekey file name
set "privKey="
if "%keyVersion%"=="" (
if not "%keyVersionDefault%"=="" (
set privKey=%privKeyPrefix%_%keyVersion%.biprivatekey
)
) else (
set privKey=%privKeyPrefix%_%keyVersion%.biprivatekey
)

REM Check if paths are valid
set "invalidpath="
if not exist "%sourceDir%" set "invalidpath=%sourceDir%"
if not exist "%targetDir%" set "invalidpath=%targetDir%"
if not "%privKey%"=="" (
if not exist "%privKeyDir%\%privKey%" set "invalidpath=%privKeyDir%\%privKey%"
)
if not exist "%tmpDir%" set "invalidpath=%tmpDir%"
if not "%invalidpath%"=="" (
call:PERROR "%invalidpath% not found!"
call:PERROR "Fix your USER CONFIGURATIONS!"
echo HINT: Opening %0
start notepad %0
echo.
pause
goto EOS
)

cd /d %sourceDir%
for /d %%D in (*) do (
if "%privKey%"=="" (
start "AddonBuilder: %%D" cmd /c "AddonBuilder "%sourceDir%\%%D" "%targetDir%" -packonly -temp="%tmpDir%" -prefix="%projPrefix%\%%D" -binarizeFullLogs"
) else (
start "AddonBuilder: %%D" cmd /c "AddonBuilder "%sourceDir%\%%D" "%targetDir%" -packonly -temp="%tmpDir%" -sign="%privKeyDir%\%privKey%" -prefix="%projPrefix%\%%D" -binarizeFullLogs"
)
)

goto EOS

:PERROR
%Windir%\System32\WindowsPowerShell\v1.0\Powershell.exe write-host -foregroundcolor Red "ERROR: %1"
GOTO:EOF

:EOS
cd /d %startDir%
echo.

96 changes: 96 additions & 0 deletions Tools/AchillesConnectToServer.bat.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
@echo off
set "startDir=%CD%"
REM switch to Achilles root folder
cd ..
set "AchillesRootFolderPath=%CD%"

REM /******************************************************************************/
REM AchillesConnectToServer.bat script for windows (by Kex)
REM /******************************************************************************/
REM
REM Description:
REM ------------
REM Packs all folders in sourceDir and creates corresponding *.pbo in targetDir.
REM The script is parallelized and will create a window for each source folder.
REM
REM "Installation":
REM ---------------
REM 1) Copy AchillesConnectToServer.bat.example and rename it to AchillesConnectToServer.bat
REM 2) Adjust the USER CONFIGURATIONS below
REM
REM Usage
REM -----
REM Command Line Arguments:
REM 1) (optional) mode e.g. ace, all, ... (if nothing is passed, the defaults are used)
REM
REM Examples:
REM ---------
REM 1) AchillesConnectToServer.bat
REM 2) AddonBuilder.bat ace

REM /******************************************************************************/
REM START OF USER CONFIGURATIONS
REM /******************************************************************************/

REM PATH settings
set "AchillesModFolderPath=%AchillesRootFolderPath%\@AresModAchillesExpansion"
set "Arma3RootFolderPath=E:\Program Files\games\Steam\steamapps\common\Arma 3"

REM Default settings
set ip=127.0.0.1:2302
set "password="
set "mods=!Workshop\@CBA_A3;%AchillesModFolderPath%"

REM /******************************************************************************/
REM START OF MODE CONFIGURATIONS (NON-DEFAULT SETTINGS)
REM /******************************************************************************/

set mode=%1
REM ACE: ACE3
if /I "%mode%"=="ace" (
set "mods=%mods%;!Workshop\@ace"
REM ALL: ACE3+RHS+CUP
) else if /I "%mode%"=="all" (
set "mods=%mods%;!Workshop\@ace;!Workshop\@CUP Units;!Workshop\@CUP Vehicles;!Workshop\@CUP Weapons;!Workshop\@CUP Terrains - Core;!Workshop\@CUP Terrains - CWA;!Workshop\@CUP Terrains - Maps;!Workshop\@RHSUSAF;!Workshop\@RHSSAF;!Workshop\@RHSGREF;!Workshop\@RHSAFRF;!Workshop\@ACE Compat - RHS Armed Forces of the Russian Federation;!Workshop\@ACE Compat - RHS- GREF;!Workshop\@ACE Compat - RHS United States Armed Forces"
) else if /I not "%mode%"=="" (
echo Error: %mode% is not available!
exit /b
) else (
REM DEFAULT SETTINGS
)

REM /******************************************************************************/
REM END OF CONFIGURATIONS
REM /******************************************************************************/

REM Check if paths are valid
set "invalidpath="
if not exist "%AchillesModFolderPath%" set "invalidpath=%AchillesModFolderPath%"
if not exist "%Arma3RootFolderPath%\arma3_x64.exe" set "invalidpath=%Arma3RootFolderPath%\arma3_x64.exe"
if not "%invalidpath%"=="" (
call:PERROR "%invalidpath% not found!"
call:PERROR "Fix your USER CONFIGURATIONS!"
echo HINT: Opening %0
start notepad %0
echo.
pause
goto EOS
)


REM Switch to ArmA 3 root directory
cd /D "%Arma3RootFolderPath%"

echo Connecting to %ip%
start "" "arma3_x64.exe" -connect=%ip% -password=%password% -world=empty -skipIntro -noSplash -noPause -showScriptErrors "-name=Kex" "-profiles=profiles" "-mod=%mods%"

goto EOS

:PERROR
%Windir%\System32\WindowsPowerShell\v1.0\Powershell.exe write-host -foregroundcolor Red "ERROR: %1"
GOTO:EOF

:EOS
cd /d %startDir%
echo.

84 changes: 0 additions & 84 deletions Tools/AddonBuilder.bat

This file was deleted.

File renamed without changes.
File renamed without changes.
18 changes: 0 additions & 18 deletions Tools/find_unsafe_rc.sh

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@
to_find = 'ares_zeusExtensions\\Ares'
substitute = 'achilles\modules_f_ares'
fnc_replace(file_path,to_find,substitute)
input('Done')
input('Done')
1 change: 1 addition & 0 deletions Tools/fixes/list_unsafe_remote_exec.log
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
./functions_f_ares/features/fn_TeleportPlayers.sqf
15 changes: 15 additions & 0 deletions Tools/fixes/list_unsafe_remote_exec.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

> list_unsafe_remote_exec.log
logFolder="$PWD"

cd "../../@AresModAchillesExpansion/addons"
script_list=$(find . -type f -name "*.sqf" -printf '%p;')
IFS=$';'
for script in $script_list; do
echo Searching in $script...
keywords=($(grep remoteExec "$script" | grep -o -P "(?i)remoteExec(\s*|Call\s*)\[\s*[\"\']?(bis_fnc_call|bis_fnc_spawn|call|spawn)[\"\']?\s*,"))
if [[ ${#keywords[@]} -gt 0 ]]; then
printf "$script\r\n" >> "$logFolder/list_unsafe_remote_exec.log"
fi
done
15 changes: 0 additions & 15 deletions Tools/git-bash.bat

This file was deleted.

Loading