Compare commits

..

1 Commits
master ... dbt

Author SHA1 Message Date
Avril 4acd72d0ce
Added/renamed outbounds, hash commands
2 years ago

@ -202,7 +202,7 @@ var OS = OneeSama.prototype;
var break_re = new RegExp("(\\S{" + DEFINES.WORD_LENGTH_LIMIT + "})"); var break_re = new RegExp("(\\S{" + DEFINES.WORD_LENGTH_LIMIT + "})");
/* internal refs, embeds */ /* 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) { OS.hook = function (name, func) {
var hs = this.hooks[name]; var hs = this.hooks[name];
@ -263,8 +263,8 @@ OS.red_string = function (ref) {
var num = parseInt(ref.slice(4+2), 10); var num = parseInt(ref.slice(4+2), 10);
dest = '../outbound/nap/' + (num ? ''+num : ''); dest = '../outbound/nap/' + (num ? ''+num : '');
} }
else if (prefix == '>/r') { else if (prefix == '>/m') {
dest ="/faq.html"; dest ="/info.html";
} }
else { else {
this.tamashii(parseInt(ref, 10)); this.tamashii(parseInt(ref, 10));
@ -407,7 +407,7 @@ OS.karada = function (body) {
return output; 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; exports.dice_re = dice_re;
var WHEN = [ var WHEN = [
@ -487,7 +487,7 @@ function parse_dice(frag)
} }
return {n:1, faces: j}; return {n:1, faces: j};
} }
if (frag == '#fun' || frag == '#fcount' || frag == '#du') if (frag == '#tip' || frag == '#tipped' || frag == '#du')
return {n: 1, faces: 2}; return {n: 1, faces: 2};
if (frag == '#tea') if (frag == '#tea')
return {n: 1, faces: 2}; return {n: 1, faces: 2};
@ -561,10 +561,10 @@ function readable_dice(bit, d) {
else else
return '#du (Try asking again)'; return '#du (Try asking again)';
} }
if (bit == '#fun') if (bit == '#tip')
return '#fun (' + d[0]+ ')'; return '#tip (' + d[0]+ ')';
if (bit == '#fcount') if (bit == '#tipped')
return '#fcount (' + d[0] + ')'; return '#tipped (' + d[0] + ')';
if (bit == '#tea') if (bit == '#tea')
return '#tea (' + ((d[0] === true)?"now!":d[0]+" hours") + ')'; return '#tea (' + ((d[0] === true)?"now!":d[0]+" hours") + ')';
if (bit == '#flip') if (bit == '#flip')

@ -22,8 +22,9 @@
"chart.js": "^2.7.2", "chart.js": "^2.7.2",
"diskspace": "^2.0.0", "diskspace": "^2.0.0",
"formidable": "1.0.17", "formidable": "1.0.17",
"hashloli": "git+ssh://git@git.flanchan.moe:flanchan/hashloli.git", "hashloli": "git+ssh://public@flanchan.moe:hashloli.git",
"jsoncompress": "^0.1.3", "jsoncompress": "^0.1.3",
"kana-hash": "file:../../home/avril/software/libkhash/node",
"minimist": "1.2.0", "minimist": "1.2.0",
"nan": "^2.14.0", "nan": "^2.14.0",
"recaptcha2": "^1.3.2", "recaptcha2": "^1.3.2",

@ -111,12 +111,12 @@ exports.roll_dice = function (frag, post, extra) {
dice.push([Math.min(morning_session, evening_session)]); 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) if( dice.length + (post.dice ? post.dice.length : 0) < rollLimit)
pyu += 1; pyu += 1;
dice.push([pyu]); dice.push([pyu]);
} }
else if(ms[i] == '#fcount') { else if(ms[i] == '#tipped') {
dice.push([pyu]); dice.push([pyu]);
} }
else { else {

@ -2,7 +2,7 @@ var opts = require('./opts');
if (require.main == module) opts.parse_args(); if (require.main == module) opts.parse_args();
opts.load_defaults(); opts.load_defaults();
//const khash = require("kana-hash"); const khash = require("kana-hash");
var _ = require('../lib/underscore'), var _ = require('../lib/underscore'),
amusement = require('./amusement'), amusement = require('./amusement'),
@ -23,7 +23,7 @@ var _ = require('../lib/underscore'),
render = require('./render'), render = require('./render'),
request = require('request'), request = require('request'),
STATE = require('./state'), STATE = require('./state'),
//tripcode = require('../tripcode').make(),//{hash:function(a,b){return new khash.Kana(0, this.salt).once(a);}, setSalt:function(a){if(a) this.salt = new khash.Salt(a); else this.salt = khash.Salt.Default; return this.salt;}}, //require('./../tripcode/tripcode'), tripcode = require('../tripcode').make(),//{hash:function(a,b){return new khash.Kana(0, this.salt).once(a);}, setSalt:function(a){if(a) this.salt = new khash.Salt(a); else this.salt = khash.Salt.Default; return this.salt;}}, //require('./../tripcode/tripcode'),
urlParse = require('url').parse, urlParse = require('url').parse,
web = require('./web'), web = require('./web'),
winston = require('winston'); winston = require('winston');
@ -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) { web.resource(/^\/outbound\/sysint\/(\d{0,10})$/, function (req, params, cb) {
var thread = parseInt(params[1], 10); var thread = parseInt(params[1], 10);
var url = '/sysint/'; var url = 'https://flanchan.moe/sysint/';
if (thread) if (thread)
url += thread; url += thread;
cb(null, 303.1, url); cb(null, 303.1, url);
}); });
/* TODO: this is never hit in master anyway
web.resource(/^\/outbound\/rurus\/(\d{0,10})$/, function (req, params, cb) { web.resource(/^\/outbound\/rurus\/(\d{0,10})$/, function (req, params, cb) {
var thread = parseInt(params[1], 10); var thread = parseInt(params[1], 10);
var url = '/faq.html'; var url = '/faq.html';
@ -615,7 +615,7 @@ web.resource(/^\/outbound\/rurus\/(\d{0,10})$/, function (req, params, cb) {
url += thread; url += thread;
cb(null, 303.1, url); cb(null, 303.1, url);
}); });
*/
web.resource(/^\/outbound\/nap\/(\d{0,10})$/, function (req, params, cb) { web.resource(/^\/outbound\/nap\/(\d{0,10})$/, function (req, params, cb) {
var thread = parseInt(params[1], 10); var thread = parseInt(params[1], 10);
var url = 'https://nineball.party/nap/'; var url = 'https://nineball.party/nap/';
@ -848,7 +848,7 @@ function allocate_post(msg, client, callback) {
post.trip = spec[parsed[1]]; post.trip = spec[parsed[1]];
} }
else if (parsed[1] || parsed[2]) { else if (parsed[1] || parsed[2]) {
var trip = "Can this just be a string?"; //tripcode.hash(parsed[1], parsed[2]); var trip = tripcode.hash(parsed[1], parsed[2]);
if (trip) if (trip)
post.trip = trip; post.trip = trip;
} }
@ -1245,8 +1245,8 @@ function non_daemon_pid_setup() {
if (require.main == module) { if (require.main == module) {
if (!process.getuid()) if (!process.getuid())
throw new Error("Refusing to run as root."); throw new Error("Refusing to run as root.");
// if (!tripcode.setSalt(config.SECURE_SALT)) if (!tripcode.setSalt(config.SECURE_SALT))
// throw "Bad SECURE_SALT"; throw "Bad SECURE_SALT";
async.series([ async.series([
imager.make_media_dirs, imager.make_media_dirs,
setup_imager_relay, setup_imager_relay,

Loading…
Cancel
Save