]> Pileus Git - ~andy/rhawk/blobdiff - spades.awk
Remove special characters from the logs
[~andy/rhawk] / spades.awk
index 89c5a7ae1475fa9b4b10c63ebde467dd49621444..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
@@ -529,7 +539,7 @@ AUTH == OWNER &&
 }
 
 /^\.help game$/ {
-       say(".newgame [score] -- start a game to <score> points, default 500")
+       say(".newgame [score] -- start a game to <score> points, default 300")
        say(".endgame -- abort the current game")
        say(".savegame -- save the current game to disk")
        say(".loadgame -- load the previously saved game")
@@ -600,7 +610,7 @@ match($0, /^\.newgame ?([1-9][0-9]*) *- *([1-9][0-9]*)$/, _arr) {
        } else {
                $1         = ".join"
                sp_owner   = FROM
-               sp_playto  = $2 ? $2 : 200
+               sp_playto  = $2 ? $2 : 300
                sp_limit   = sp_playto > 200 ? 10 : 5;
                sp_state   = "join"
                sp_channel = DST