Only add stuff from my own scores to nulls
authorCameron Ball <cameron@moodle.com>
Tue, 9 Apr 2019 08:54:12 +0000 (16:54 +0800)
committerCameron Ball <cameron@moodle.com>
Tue, 9 Apr 2019 08:54:12 +0000 (16:54 +0800)
ScoreSync.sh

index 7582e3d..95948c8 100755 (executable)
@@ -329,7 +329,9 @@ if [ "$1" = "apply" ]; then
 
                     # Then later on when we process the pranks, unset any hashes that turn out to have a score elsewhere
                     # before finally adding the null nodes
-                    null_files[$(echo $i | cut -sd : -f1)]+="$person"
+                    if [ "$person" = "$me_highscore_name" ]; then
+                        null_files[$(echo $i | cut -sd : -f1)]+="$person"
+                    fi
                 else
                     song_score=$(echo $i | rev | cut -sd : -f1 | rev)
                     song_steps_type=$(echo $i | rev | cut -sd : -f2 | rev)
@@ -389,6 +391,7 @@ if [ "$1" = "apply" ]; then
         # only try find files for which there is actually nothing in scores.txt
         if [ "$had_score" = false ] && [ -z "${null_files[${hash}]}" ]; then
             echo "$hash had no score and is not in nulls"
+            exit
             song="${hash_map[${hash}]}"
             song=$(echo $song | sed 's/`/\\\`/g')
             xmlstarlet_orphans_cmd="$xmlstarlet_orphans_cmd -i \"//SongScores//Song[@Dir=\\\"Songs/${song}/\\\"]//Steps//HighScore[1]//PercentDP\" \