From d4962e48b54d813840765dde4929e70a9b84f164 Mon Sep 17 00:00:00 2001 From: flashwave Date: Thu, 8 Sep 2022 20:51:49 +0000 Subject: [PATCH] Added new json files and sound events. --- private/sound-packs.ini | 33 ++++++++++++++++++++++++++++ private/text-triggers.ini | 2 +- public/index.php | 45 +++++++++++++++++++++++++++++++++++++-- 3 files changed, 77 insertions(+), 3 deletions(-) diff --git a/private/sound-packs.ini b/private/sound-packs.ini index 4c47cb3..31e04e0 100644 --- a/private/sound-packs.ini +++ b/private/sound-packs.ini @@ -7,6 +7,9 @@ events[error] = rogueamp:fuckbitch events[server] = ajaxchat:server events[incoming] = ajaxchat:incoming events[outgoing] = ajaxchat:outgoing +events[kick] = touhou:pichuun +events[timeout] = misc:explode +events[unban] = dokuro:pipiru ; AIM [aim] @@ -17,6 +20,9 @@ events[error] = kf4:fuckyou events[server] = aim:server events[incoming] = aim:incoming events[outgoing] = aim:outgoing +events[kick] = touhou:pichuun +events[timeout] = misc:explode +events[unban] = dokuro:pipiru ; Inkling Girl [woomy] @@ -27,6 +33,9 @@ events[error] = woomy:error events[server] = woomy:server events[incoming] = woomy:incoming events[outgoing] = woomy:outgoing +events[kick] = touhou:pichuun +events[timeout] = misc:explode +events[unban] = dokuro:pipiru ; Pictochat [nds] @@ -37,6 +46,9 @@ events[error] = nds:error events[server] = nds:server events[incoming] = nds:incoming events[outgoing] = nds:outgoing +events[kick] = touhou:pichuun +events[timeout] = misc:explode +events[unban] = dokuro:pipiru ; osu! [osu] @@ -47,6 +59,9 @@ events[error] = osu:error events[server] = osu:server events[incoming] = osu:incoming events[outgoing] = osu:outgoing +events[kick] = touhou:pichuun +events[timeout] = misc:explode +events[unban] = dokuro:pipiru ; Windows 2000/ME [win2k] @@ -57,6 +72,9 @@ events[error] = win2k:error events[server] = win2k:server events[incoming] = win2k:incoming events[outgoing] = win2k:outgoing +events[kick] = touhou:pichuun +events[timeout] = misc:explode +events[unban] = dokuro:pipiru ; Windows XP [winxp] @@ -67,6 +85,9 @@ events[error] = winxp:error events[server] = winxp:server events[incoming] = winxp:incoming events[outgoing] = winxp:outgoing +events[kick] = touhou:pichuun +events[timeout] = misc:explode +events[unban] = dokuro:pipiru ; Windows Vista/7 [win7] @@ -77,6 +98,9 @@ events[error] = win7:error events[server] = win7:server events[incoming] = win7:incoming events[outgoing] = win7:outgoing +events[kick] = touhou:pichuun +events[timeout] = misc:explode +events[unban] = dokuro:pipiru ; Windows 8 [win8] @@ -87,6 +111,9 @@ events[error] = win8:error events[server] = win8:server events[incoming] = win8:incoming events[outgoing] = win8:outgoing +events[kick] = touhou:pichuun +events[timeout] = misc:explode +events[unban] = dokuro:pipiru ; Aizawa Inori [inori] @@ -97,6 +124,9 @@ events[error] = inori:error events[server] = inori:server events[incoming] = inori:incoming events[outgoing] = inori:outgoing +events[kick] = touhou:pichuun +events[timeout] = misc:explode +events[unban] = dokuro:pipiru ; Madobe Nanami [nanami] @@ -107,6 +137,9 @@ events[error] = nanami:error events[server] = nanami:server events[incoming] = nanami:incoming events[outgoing] = nanami:outgoing +events[kick] = touhou:pichuun +events[timeout] = misc:explode +events[unban] = dokuro:pipiru ; Tada [tada] diff --git a/private/text-triggers.ini b/private/text-triggers.ini index ddb238f..aaabea2 100644 --- a/private/text-triggers.ini +++ b/private/text-triggers.ini @@ -87,7 +87,7 @@ match[] = "lc; is:i am with the science team" match[] = "lc; is:i'm with the science team!" match[] = "lc; is:i am with the science team!" -[snd-booyah] +[ali-booyah] type = alias for[] = woomy for[] = ngyes diff --git a/public/index.php b/public/index.php index 71e3ffc..6712b36 100644 --- a/public/index.php +++ b/public/index.php @@ -73,6 +73,34 @@ if($reqPath === '/common.json') { json_out($common); } +if($reqPath === '/sounds2.json') { + $sndLibData = file_get_contents(FTM_PATH_PRV . '/sound-library.ini'); + $sndPackData = file_get_contents(FTM_PATH_PRV . '/sound-packs.ini'); + + etag_data('sounds2', $sndLibData . $sndPackData); + + $sndLib = parse_ini_string($sndLibData, true, INI_SCANNER_TYPED); + $sndPacks = parse_ini_string($sndPackData, true, INI_SCANNER_TYPED); + + $library = []; + foreach($sndLib as $name => $info) + $library[] = [ + 'name' => $name, + 'title' => $info['title'], + 'sources' => $info['sources'], + ]; + + $packs = []; + foreach($sndPacks as $name => $info) + $packs[] = [ + 'name' => $name, + 'title' => $info['title'], + 'events' => $info['events'], + ]; + + json_out(compact('library', 'packs')); +} + if($reqPath === '/sounds.json') { $sndLibData = file_get_contents(FTM_PATH_PRV . '/sound-library.ini'); $sndPackData = file_get_contents(FTM_PATH_PRV . '/sound-packs.ini'); @@ -100,17 +128,30 @@ if($reqPath === '/sounds.json') { } $packs = []; - foreach($sndPacks as $name => $info) { + foreach($sndPacks as $name => $info) $packs[] = [ 'id' => $name, 'name' => $info['title'], 'events' => $info['events'], ]; - } json_out(compact('library', 'packs')); } +if($reqPath === '/texttriggers.json') { + $textTriggersPath = FTM_PATH_PRV . '/text-triggers.ini'; + etag_file('texttriggers', $textTriggersPath); + + $triggers = parse_ini_file($textTriggersPath, true, INI_SCANNER_TYPED); + + if($triggers === false) + $triggers = []; + else + $triggers = array_values($triggers); + + json_out($triggers); +} + if($reqPath === '/soundtriggers.json') { $textTriggersPath = FTM_PATH_PRV . '/text-triggers.ini'; etag_file('soundtriggers', $textTriggersPath);