first commit

This commit is contained in:
cclecle
2022-12-04 21:01:36 +00:00
commit e9d65d5c03
5 changed files with 161 additions and 0 deletions

34
Help/PingCompensation.txt Normal file
View File

@@ -0,0 +1,34 @@
Ping Compensation
=================
by Wormbo (wormbo@onlinehome.de)
Homepage: http://www.koehler-homepage.de/Wormbo/
Description
-----------
The Ping Compensation mutator predicts the locations of other players on the
client's side and adjusts the visual location of the other players. With this
mutator enabled on the server it will mostly be possible to aim directly at the
player to be able to him or her with instant-hit weapons. (as opposed to having
to lead the target even with instant-hit weapons)
Of course there may be some inaccuracies in the prediction, but it will be
possible to play with higher pings than usual, if the ping is steady.
Note to people concerned about cheating:
This is a serverside add-on and can't be used for cheating. The cheaters have
their own ping compensation code so they won't need this anyway.
Installation
------------
Simply extract all the files in the ZIP file to your UT2004\System directory
and add the following line to the [Engine.GameEngine] section of UT2004.ini:
(This step might not be neccessary in later patches of UT2004, but in the
initial version it is required.)
ServerPackages=PingCompensation
You can either also add the line
ServerActors=PingCompensation.MutPingCompensation
to that same section or load the mutator through the server's command line via
the ?mutator=PingCompensation.MutPingCompensation parameter.

3
Readme.md Normal file
View File

@@ -0,0 +1,3 @@
# Anti TCC 2009 Release GIT repository
checkout official page : http://www.koehler-homepage.de/Wormbo/AntiTCC2009.html

123
Run.sh Normal file
View File

@@ -0,0 +1,123 @@
#!/bin/bash
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
OUTPUT_DIR="$2"
CFG_FILE="$3"
DEFAULT_CFG_FILE=UT2004.ini
function add_iniKeyEx() {
crudini --set $OUTPUT_DIR/System/$1 $2 __$3 $4
# Warning: ugly hack with sed to allow multiple key instances + to remove space around '='
sed -i "s/[[:space:]]*__$(echo $3 | sed -e 's/\([[\/.*]\|\]\)/\\&/g')[[:space:]]*=[[:space:]]*/$(echo $3 | sed -e 's/\([[\/.*]\|\]\)/\\&/g')=/g" $OUTPUT_DIR/System/$1
}
# !!Warning!! section is not considered
function del_iniKeyEx() {
sed -i "/[[:space:]]*$(echo $3 | sed -e 's/\([[\/.*]\|\]\)/\\&/g')[[:space:]]*=[[:space:]]*$(echo $4 | sed -e 's/\([[\/.*]\|\]\)/\\&/g')/d" $OUTPUT_DIR/System/$1
}
function add_iniKey() {
add_iniKeyEx $CFG_FILE $1 $2 $3
}
# !!Warning!! section is not considered
function del_iniKey() {
del_iniKeyEx $CFG_FILE $1 $2 $3
}
function add_ServerPackage() {
add_iniKey 'Engine.GameEngine' ServerPackages $1
}
function del_ServerPackage() {
del_iniKey 'Engine.GameEngine' ServerPackages $1
}
function add_ServerActors() {
add_iniKey 'Engine.GameEngine' ServerActors $1
}
function del_ServerActors() {
del_iniKey 'Engine.GameEngine' ServerActors $1
}
function getmodprefix() {
_File=$(find $OUTPUT_DIR/System -type f -iname "PingCompensation*\.u" -exec basename {} \; | sort -nr | head -n 1)
BaseName="${_File%.*}"
echo "$BaseName"
}
function install() {
rsync -a $SCRIPT_DIR/Help/ $OUTPUT_DIR/Help/ --exclude '.git'
rsync -a $SCRIPT_DIR/System/ $OUTPUT_DIR/System/ --exclude '.git'
echo install ok
}
function enable() {
BaseName="$(getmodprefix)"
add_ServerPackage $BaseName
add_ServerActors $BaseName.MutPingCompensation
echo enable ok
}
function disable() {
BaseName="$(getmodprefix)"
del_ServerPackage $BaseName
del_ServerActors $BaseName.MutPingCompensation
echo disable ok
}
function show_help() {
echo
echo "Usage: $0 { getmodprefix | install | enable | disable } <UT2k4_INSTALL_DIR> [<UT2k4_CONFIG_FILE>]"
echo
}
function check_cfg_file() {
if [ -z ${CFG_FILE} ]
then
echo "CFG_FILE is unset, setting it to $DEFAULT_CFG_FILE"
CFG_FILE=$DEFAULT_CFG_FILE
else
echo "CFG_FILE is set to '$CFG_FILE'"
fi
if [ ! -f $OUTPUT_DIR/System/$CFG_FILE ]
then
echo "$OUTPUT_DIR/System/$CFG_FILE does not exist"
show_help
exit 9999 # die with error code 9999
fi
}
function check_game_dir() {
### Check if a directory does not exist ###
if [ ! -d $OUTPUT_DIR ]
then
echo "incorrect <UT2k4_INSTALL_DIR>"
show_help
exit 9999 # die with error code 9999
fi
}
case "$1" in
'getmodprefix')
check_game_dir
getmodprefix
;;
'install')
check_game_dir
install
;;
'enable')
check_game_dir
check_cfg_file
disable
enable
;;
'disable')
check_game_dir
check_cfg_file
disable
;;
*)
show_help
exit 1
;;
esac
exit 0

BIN
System/PingCompensation.u Normal file

Binary file not shown.

View File

@@ -0,0 +1 @@
Mutator=(ClassName=PingCompensation.MutPingCompensation,GroupName=PingCompensation,IconMaterialName=MutatorArt.nosym,FriendlyName=PingCompensation.MutPingCompensation.FriendlyName,Description=PingCompensation.MutPingCompensation.Description,FriendlyName=PingCompensation.MutPingCompensation.FriendlyName,FallbackName="Ping Compensation",FallbackDesc="Tries to compensate ping for network clients.")