From 4acd72d0ce97317484a9143bc2b34057ed768e5d Mon Sep 17 00:00:00 2001 From: Avril Date: Thu, 8 Sep 2022 20:45:12 +0100 Subject: [PATCH] Added/renamed outbounds, hash commands MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fortune for doushio's current commit: Blessing − 吉 --- common.js | 18 +++++++++--------- server/amusement.js | 4 ++-- server/server.js | 6 +++--- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/common.js b/common.js index 575b6ed..00aa7f9 100644 --- a/common.js +++ b/common.js @@ -202,7 +202,7 @@ var OS = OneeSama.prototype; var break_re = new RegExp("(\\S{" + DEFINES.WORD_LENGTH_LIMIT + "})"); /* internal refs, embeds */ -var ref_re = />>(\d+|>\/s\/.+|>\/music\/s\/.+|>\/watch\?v=[\w-]{11}(?:#t=[\dhms]{1,9})?|>\/soundcloud\/[\w-]{1,40}\/[\w-]{1,80}|>\/@\w{1,15}\/\d{4,20}(?:\?s=\d+)?|>\/(?:a|sysint|nap)\/\d{0,10}|>\/rurus\/)/; +var ref_re = />>(\d+|>\/s\/.+|>\/music\/s\/.+|>\/watch\?v=[\w-]{11}(?:#t=[\dhms]{1,9})?|>\/soundcloud\/[\w-]{1,40}\/[\w-]{1,80}|>\/@\w{1,15}\/\d{4,20}(?:\?s=\d+)?|>\/(?:a|sysint|nap)\/\d{0,10}|>\/manual\/)/; OS.hook = function (name, func) { var hs = this.hooks[name]; @@ -263,8 +263,8 @@ OS.red_string = function (ref) { var num = parseInt(ref.slice(4+2), 10); dest = '../outbound/nap/' + (num ? ''+num : ''); } - else if (prefix == '>/r') { - dest ="/faq.html"; + else if (prefix == '>/m') { + dest ="/info.html"; } else { this.tamashii(parseInt(ref, 10)); @@ -407,7 +407,7 @@ OS.karada = function (body) { return output; } -var dice_re = /(#tea|#dame|#tutturu|#muri|#flip|#when|#du|#fun|#fcount|#test|#sleep|#janken|#8ball|#imfey|#\?(?:\[(?:\w,*)+\])?|#\d{0,2}d\d{1,4}(?:[+-]\d{1,4})?)/i; +var dice_re = /(#tea|#dame|#tutturu|#muri|#flip|#when|#du|#tip|#tipped|#test|#sleep|#janken|#8ball|#imfey|#\?(?:\[(?:\w,*)+\])?|#\d{0,2}d\d{1,4}(?:[+-]\d{1,4})?)/i; exports.dice_re = dice_re; var WHEN = [ @@ -487,7 +487,7 @@ function parse_dice(frag) } return {n:1, faces: j}; } - if (frag == '#fun' || frag == '#fcount' || frag == '#du') + if (frag == '#tip' || frag == '#tipped' || frag == '#du') return {n: 1, faces: 2}; if (frag == '#tea') return {n: 1, faces: 2}; @@ -561,10 +561,10 @@ function readable_dice(bit, d) { else return '#du (Try asking again)'; } - if (bit == '#fun') - return '#fun (' + d[0]+ ')'; - if (bit == '#fcount') - return '#fcount (' + d[0] + ')'; + if (bit == '#tip') + return '#tip (' + d[0]+ ')'; + if (bit == '#tipped') + return '#tipped (' + d[0] + ')'; if (bit == '#tea') return '#tea (' + ((d[0] === true)?"now!":d[0]+" hours") + ')'; if (bit == '#flip') diff --git a/server/amusement.js b/server/amusement.js index a4be4d8..b10b78c 100644 --- a/server/amusement.js +++ b/server/amusement.js @@ -111,12 +111,12 @@ exports.roll_dice = function (frag, post, extra) { dice.push([Math.min(morning_session, evening_session)]); } } - else if(ms[i] == '#fun') { + else if(ms[i] == '#tip') { if( dice.length + (post.dice ? post.dice.length : 0) < rollLimit) pyu += 1; dice.push([pyu]); } - else if(ms[i] == '#fcount') { + else if(ms[i] == '#tipped') { dice.push([pyu]); } else { diff --git a/server/server.js b/server/server.js index 425b2af..47be018 100644 --- a/server/server.js +++ b/server/server.js @@ -602,12 +602,12 @@ web.resource(/^\/outbound\/a\/(\d{0,10})$/, function (req, params, cb) { web.resource(/^\/outbound\/sysint\/(\d{0,10})$/, function (req, params, cb) { var thread = parseInt(params[1], 10); - var url = '/sysint/'; + var url = 'https://flanchan.moe/sysint/'; if (thread) url += thread; cb(null, 303.1, url); }); - +/* TODO: this is never hit in master anyway web.resource(/^\/outbound\/rurus\/(\d{0,10})$/, function (req, params, cb) { var thread = parseInt(params[1], 10); var url = '/faq.html'; @@ -615,7 +615,7 @@ web.resource(/^\/outbound\/rurus\/(\d{0,10})$/, function (req, params, cb) { url += thread; cb(null, 303.1, url); }); - +*/ web.resource(/^\/outbound\/nap\/(\d{0,10})$/, function (req, params, cb) { var thread = parseInt(params[1], 10); var url = 'https://nineball.party/nap/';