gnirehtet icon indicating copy to clipboard operation
gnirehtet copied to clipboard

hey i have a issue that whenever i open a game called mobile legend it automatically disconnect help me please urgent

Open marpace1 opened this issue 2 years ago • 1 comments

marpace1 avatar Jan 07 '23 07:01 marpace1

I am using a script to make it re-execute as soon as the disconnect message shows up in log. It will not help in game that much tho, cuz, as you disconnect you will always have few sec on lag. Same thing happening with me in Mobile legend.


LOG_FILE="gnirehtet.log"
ERROR_LOGGED=false

while true; do
        ./gnirehtet run >$LOG_FILE 2>&1 &
        GNIREHTET_PID=$!
        echo "Rebooted"

        while ps -p $GNIREHTET_PID >/dev/null; do
                if grep -q "Client #0 disconnected" $LOG_FILE; then
                        if [ "$ERROR_LOGGED" = false ]; then
                                ERROR_LOGGED=true
                                echo "Error detected in log. Restarting the command..."
                                kill -9 $GNIREHTET_PID
                                break
                        fi
                else
                        ERROR_LOGGED=false
                fi
                sleep 1
        done
        sleep 2
done

rukh-debug avatar Nov 08 '23 21:11 rukh-debug