]> Pileus Git - ~andy/rhawk/commitdiff
Remove special characters from the logs
authorAndy Spencer <andy753421@gmail.com>
Thu, 28 Jan 2016 05:51:59 +0000 (05:51 +0000)
committerAndy Spencer <andy753421@gmail.com>
Fri, 29 Jan 2016 04:41:37 +0000 (04:41 +0000)
spades.awk

index 46278eb245f7e0248af723919ec25d5a0cd7d41b..9f404d8cea4665fa43d0e5490610504e34aa25a7 100644 (file)
@@ -164,7 +164,7 @@ function sp_say(msg)
 {
        say(sp_channel, msg)
        print msg |& sp_sock
-       print strftime("%Y-%m-%d %H:%M:%S | ") msg >> "logs/" sp_log
+       print strftime("%Y-%m-%d %H:%M:%S | ") sp_ugly(msg) >> "logs/" sp_log
        fflush("logs/" sp_log)
 }
 
@@ -183,6 +183,16 @@ function sp_pretty(cards, who)
        return cards
 }
 
+function sp_ugly(cards, who)
+{
+       gsub(/[\2\17]|\3[14],00|/, "", cards)
+       gsub(/♠/, "s", cards)
+       gsub(/♥/, "h", cards)
+       gsub(/♦/, "d", cards)
+       gsub(/♣/, "c", cards)
+       return cards
+}
+
 function sp_next(who, prev)
 {
        prev      = sp_turn