Compare commits

..

2 commits

Author SHA1 Message Date
6f428d6a63 LARGE modus complete 2024-01-05 04:28:37 +01:00
ba5e40a603 wip large mode, slide pixlist into multiple fields 2024-01-05 03:56:53 +01:00
2 changed files with 56 additions and 15 deletions

View file

@ -48,7 +48,7 @@ available env vars to configure:
IPFLOOT(string), FLOOTPORT(int), USECACHE(bool), FLOOTFORKS(int) IPFLOOT(string), FLOOTPORT(int), USECACHE(bool), FLOOTFORKS(int)
SIZE(int), TEXT(string), FONTSIZE(int), BGCOLOR(hex), COLOR(hex) SIZE(int), TEXT(string), FONTSIZE(int), BGCOLOR(hex), COLOR(hex)
BORDERCOLOR(hex), X(int), Y(int), X_MAX(int), Y_MAX(int), H(int), W(int) BORDERCOLOR(hex), X(int), Y(int), X_MAX(int), Y_MAX(int), H(int), W(int)
RESIZE(int), ALPHACOLOR(hex), BOUNCESTEP(int) RESIZE(int), ALPHACOLOR(hex), BOUNCESTEP(int), LARGE(bool)
``` ```
Running on my Ryzen 4700G with [wellenbrecher](https://github.com/bits0rcerer/wellenbrecher) 1280x720 and three workers, Running on my Ryzen 4700G with [wellenbrecher](https://github.com/bits0rcerer/wellenbrecher) 1280x720 and three workers,

View file

@ -294,17 +294,19 @@ flootworker()
{ {
while true while true
do do
#FLOOTSRUNNING=$((FLOOTSRUNNING+1)) if [ $LARGE ]
#test $FLOOTSRUNNING -le $FLOOTFORKS && then
xymode
xymode echo "$OFFSET"
echo "$OFFSET for i in $(seq 0 $1 | shuf)
${LOL[$1]}" #> /dev/tcp/$IPFLOOT/$FLOOTPORT || message warn "transmission in worker ${YELLOW}$1${ENDCOLOR} ${RED}failed${ENDCOLOR} - maybe you need to decrease ${YELLOW}FLOOTFORKS${ENDCOLOR} or expand/tune your uplink" do
#FLOOTSRUNNING=$((FLOOTSRUNNING-1)) echo "${LOL[$i]}"
#echo "${LOL[$i]}" > /dev/tcp/127.0.0.1/1337 & done
else
#echo "worker $i PID ${LOLPID[$i]}" xymode
echo "$OFFSET
${LOL[$1]}"
fi
done > /dev/tcp/$IPFLOOT/$FLOOTPORT || message warn "transmission in worker ${YELLOW}$1${ENDCOLOR} ${RED}failed${ENDCOLOR} - maybe you need to decrease ${YELLOW}FLOOTFORKS${ENDCOLOR} or expand/tune your uplink" done > /dev/tcp/$IPFLOOT/$FLOOTPORT || message warn "transmission in worker ${YELLOW}$1${ENDCOLOR} ${RED}failed${ENDCOLOR} - maybe you need to decrease ${YELLOW}FLOOTFORKS${ENDCOLOR} or expand/tune your uplink"
} }
@ -320,6 +322,34 @@ checkfile() {
loadLOL() { loadLOL() {
# when LARGE true, then we slize the large pixlist into smaller pieces
# max 64k each one
if [ $LARGE ]
then
LOL_org="$(echo "$LOL_org" | shuf)"
LOLFIELDSIZE=64000
# line counter
L=1
LINES="$(echo "$LOL_org" | wc -l )"
LOLFIELDS="$(( ( $LINES / $LOLFIELDSIZE ) ))"
message "LARGE mode: slicing ${YELLOW}${IMGFILE}${ENDCOLOR} - ${YELLOW}${LINES}${ENDCOLOR} into ${YELLOW}${LOLFIELDS}${ENDCOLOR} fields"
i=0
while [ $i -le $LOLFIELDS ]
do
LN=$(($L+$LOLFIELDSIZE+1))
message "field ${YELLOW}${i}${ENDCOLOR}, lines ${YELLOW}${L}${ENDCOLOR} - ${YELLOW}${LN}${ENDCOLOR}"
LOL[$i]="$(echo "$LOL_org" | sed -n "${L},$(($LN-1))p;${LN}q" )"
L=$LN
i=$(($i+1))
done
#~ echo "${LOL[14]}"
#~ echo STOP
#~ read
else
for i in $(seq 1 $FLOOTFORKS) for i in $(seq 1 $FLOOTFORKS)
do do
if [ -z "$ALPHACOLOR" ] if [ -z "$ALPHACOLOR" ]
@ -331,6 +361,8 @@ loadLOL() {
LOL[$i]="$(echo "$LOL_org" | grep -v $ALPHACOLOR | shuf)" LOL[$i]="$(echo "$LOL_org" | grep -v $ALPHACOLOR | shuf)"
fi fi
done done
fi
} }
@ -410,6 +442,8 @@ floot() {
esac esac
message "starting $FLOOTFORKS workers" message "starting $FLOOTFORKS workers"
while true while true
do do
for i in $(seq $FLOOTFORKS) for i in $(seq $FLOOTFORKS)
@ -420,13 +454,20 @@ floot() {
message "worker ${YELLOW}$i${ENDCOLOR} is not running, starting it" message "worker ${YELLOW}$i${ENDCOLOR} is not running, starting it"
#if [ "$FLOOTSRUNNING" -le "$FLOOTFORKS" ] #if [ "$FLOOTSRUNNING" -le "$FLOOTFORKS" ]
#then #then
flootworker $i & if [ $LARGE ]
LOLPID[$i]=$! then
flootworker $LOLFIELDS &
LOLPID[$i]=$!
else
flootworker $i &
LOLPID[$i]=$!
fi
#fi #fi
fi fi
done done
done done
} }
case $1 in case $1 in
@ -511,7 +552,7 @@ case $1 in
echo "IPFLOOT(string), FLOOTPORT(int), USECACHE(bool), FLOOTFORKS(int)" echo "IPFLOOT(string), FLOOTPORT(int), USECACHE(bool), FLOOTFORKS(int)"
echo "SIZE(int), TEXT(string), FONTSIZE(int), BGCOLOR(hex), COLOR(hex)" echo "SIZE(int), TEXT(string), FONTSIZE(int), BGCOLOR(hex), COLOR(hex)"
echo "BORDERCOLOR(hex), X(int), Y(int), X_MAX(int), Y_MAX(int), H(int), W(int)" echo "BORDERCOLOR(hex), X(int), Y(int), X_MAX(int), Y_MAX(int), H(int), W(int)"
echo "RESIZE(int), ALPHACOLOR(hex), BOUNCESTEP(int)" echo "RESIZE(int), ALPHACOLOR(hex), BOUNCESTEP(int), LARGE(bool)"
exit 1 exit 1
;; ;;