Fix give command
|
@ -645,3 +645,21 @@
|
||||||
rarity: 0
|
rarity: 0
|
||||||
location: "river"
|
location: "river"
|
||||||
activeMonths: 0b000001111100
|
activeMonths: 0b000001111100
|
||||||
|
# - id: "abalone"
|
||||||
|
# name: "Abalone"
|
||||||
|
# size: 10
|
||||||
|
# rarity: 0
|
||||||
|
# location: "sea"
|
||||||
|
# activeMonths: 0b100001111111
|
||||||
|
# - id: "acorn_barnacle"
|
||||||
|
# name: "Acorn Barnacle"
|
||||||
|
# size: 3
|
||||||
|
# rarity: 0
|
||||||
|
# location: "sea"
|
||||||
|
# activeMonths: 0b000001110000
|
||||||
|
# - id: "chambered_nautilus"
|
||||||
|
# name: "Chambered nautilus"
|
||||||
|
# size: 35
|
||||||
|
# rarity: 0
|
||||||
|
# location: "sea"
|
||||||
|
# activeMonths: 0b000001110000
|
||||||
|
|
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 5.8 KiB |
After Width: | Height: | Size: 5.1 KiB |
After Width: | Height: | Size: 1020 B |
After Width: | Height: | Size: 5.7 KiB |
After Width: | Height: | Size: 4.8 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 4.2 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 4.5 KiB |
After Width: | Height: | Size: 5.1 KiB |
After Width: | Height: | Size: 4.8 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 5.5 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 4.4 KiB |
After Width: | Height: | Size: 4.6 KiB |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 6.3 KiB |
After Width: | Height: | Size: 4.4 KiB |
After Width: | Height: | Size: 4.7 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 4.8 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 5.3 KiB |
After Width: | Height: | Size: 4.4 KiB |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 4.7 KiB |
After Width: | Height: | Size: 4.8 KiB |
After Width: | Height: | Size: 5.7 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 4.6 KiB |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 5.2 KiB |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 4.6 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 6.1 KiB |
After Width: | Height: | Size: 5.6 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 4.2 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 6.7 KiB |
After Width: | Height: | Size: 5.2 KiB |
After Width: | Height: | Size: 4.9 KiB |
After Width: | Height: | Size: 6.3 KiB |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 7.5 KiB |
After Width: | Height: | Size: 6.5 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 5.4 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 5.5 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 3.9 KiB |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 5.7 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 4.7 KiB |
After Width: | Height: | Size: 5.6 KiB |
After Width: | Height: | Size: 5.5 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 4.4 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 6.2 KiB |
After Width: | Height: | Size: 5.7 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 545 B |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 4.8 KiB |
After Width: | Height: | Size: 4.4 KiB |
After Width: | Height: | Size: 5.4 KiB |
After Width: | Height: | Size: 4.7 KiB |
After Width: | Height: | Size: 3.9 KiB |
After Width: | Height: | Size: 4.1 KiB |
After Width: | Height: | Size: 4.6 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 5.6 KiB |
After Width: | Height: | Size: 5.7 KiB |
After Width: | Height: | Size: 4.7 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 5.3 KiB |
|
@ -0,0 +1,100 @@
|
||||||
|
import { $ } from "bun";
|
||||||
|
|
||||||
|
const urls = [
|
||||||
|
"https://dodo.ac/np/images/thumb/c/cd/Angelfish_NH_Icon.png/64px-Angelfish_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/6/67/Arowana_NH_Icon.png/64px-Arowana_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/e/e9/Barbel_Steed_NL_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/3/30/Bass_PG_Inv_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/4/4d/Bitterling_NH_Icon.png/64px-Bitterling_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/0/0c/Bluegill_NH_Icon.png/64px-Bluegill_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/5/5d/Carp_NH_Icon.png/64px-Carp_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/0/0d/Catfish_NH_Icon.png/64px-Catfish_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/8/80/Char_NH_Icon.png/64px-Char_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/d/db/Cherry_Salmon_NH_Icon.png/64px-Cherry_Salmon_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/4/45/Coelacanth_NH_Icon.png/64px-Coelacanth_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/f/f2/Crucian_Carp_NH_Icon.png/64px-Crucian_Carp_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/d/db/Dace_NH_Icon.png/64px-Dace_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/b/bf/Eel_NL_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/e/ec/Freshwater_Goby_NH_Icon.png/64px-Freshwater_Goby_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/7/78/Giant_Catfish_PG_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/5/50/Giant_Snakehead_NH_Icon.png/64px-Giant_Snakehead_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/7/71/Goldfish_NH_Icon.png/64px-Goldfish_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/3/38/Guppy_NH_Icon.png/64px-Guppy_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/8/87/Herabuna_DnM%2B_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/2/2d/Koi_NH_Icon.png/64px-Koi_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/0/0f/Large_Bass_PG_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/a/a5/Loach_NH_Icon.png/64px-Loach_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/e/e2/Pale_Chub_NH_Icon.png/64px-Pale_Chub_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/c/c6/Piranha_NH_Icon.png/64px-Piranha_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/0/0f/Pond_Smelt_NH_Icon.png/64px-Pond_Smelt_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/0/0d/Pop-Eyed_Goldfish_NH_Icon.png/64px-Pop-Eyed_Goldfish_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/8/87/Rainbow_Trout_NL_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/c/ca/Salmon_NH_Icon.png/64px-Salmon_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/a/ac/Small_Bass_PG_Field_Sprite.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/e/eb/Stringfish_NH_Icon.png/64px-Stringfish_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/6/6a/Sweetfish_NH_Icon.png/64px-Sweetfish_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/b/b1/Arapaima_NH_Icon.png/64px-Arapaima_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/d/d5/Barred_Knifejaw_NH_Icon.png/64px-Barred_Knifejaw_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/0/0b/Brook_Trout_PG_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/9/96/Crawfish_NH_Icon.png/64px-Crawfish_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/2/2f/Frog_NH_Icon.png/64px-Frog_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/f/fd/Jellyfish_CF_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/e/ea/Killifish_NH_Icon.png/64px-Killifish_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/c/c1/Red_Snapper_NH_Icon.png/64px-Red_Snapper_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/7/7f/Sea_Bass_NH_Icon.png/64px-Sea_Bass_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/2/2a/Blue_Marlin_NH_Icon.png/64px-Blue_Marlin_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/1/1f/Dab_NH_Icon.png/64px-Dab_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/a/a3/Horse_Mackerel_NH_Icon.png/64px-Horse_Mackerel_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/d/d8/Octopus_CF_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/b/b3/Olive_Flounder_NH_Icon.png/64px-Olive_Flounder_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/e/ee/Puffer_Fish_NH_Icon.png/64px-Puffer_Fish_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/d/dc/Sea_Horse_NH_Icon.png/64px-Sea_Horse_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/b/bf/Squid_NH_Icon.png/64px-Squid_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/0/00/Black_Bass_NH_Icon.png/64px-Black_Bass_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/4/4f/Clown_Fish_NH_Icon.png/64px-Clown_Fish_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/f/fe/Dorado_NH_Icon.png/64px-Dorado_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/3/34/Football_Fish_NH_Icon.png/64px-Football_Fish_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/a/a2/Gar_NH_Icon.png/64px-Gar_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/2/20/Great_White_Shark_NH_Icon.png/64px-Great_White_Shark_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/e/ec/Hammerhead_Shark_NH_Icon.png/64px-Hammerhead_Shark_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/e/e1/King_Salmon_NH_Icon.png/64px-King_Salmon_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/e/eb/Ocean_Sunfish_NH_Icon.png/64px-Ocean_Sunfish_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/f/f7/Sea_Butterfly_NH_Icon.png/64px-Sea_Butterfly_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/4/4b/Tuna_NH_Icon.png/64px-Tuna_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/6/67/Yellow_Perch_NH_Icon.png/64px-Yellow_Perch_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/8/85/Zebra_Turkeyfish_NH_Icon.png/64px-Zebra_Turkeyfish_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/4/47/Butterfly_Fish_NH_Icon.png/64px-Butterfly_Fish_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/a/aa/Lobster_CF_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/3/3e/Moray_Eel_NH_Icon.png/64px-Moray_Eel_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/3/30/Napoleonfish_NH_Icon.png/64px-Napoleonfish_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/4/42/Neon_Tetra_NH_Icon.png/64px-Neon_Tetra_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/9/9f/Pike_NH_Icon.png/64px-Pike_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/9/9b/Ray_NH_Icon.png/64px-Ray_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/c/cb/Surgeonfish_NH_Icon.png/64px-Surgeonfish_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/9/95/Blowfish_NH_Icon.png/64px-Blowfish_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/1/17/Giant_Trevally_NH_Icon.png/64px-Giant_Trevally_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/9/9d/Mitten_Crab_NH_Icon.png/64px-Mitten_Crab_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/0/0b/Nibble_Fish_NH_Icon.png/64px-Nibble_Fish_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/5/50/Oarfish_NH_Icon.png/64px-Oarfish_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/2/26/Ribbon_Eel_NH_Icon.png/64px-Ribbon_Eel_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/4/46/Saddled_Bichir_NH_Icon.png/64px-Saddled_Bichir_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/4/45/Saw_Shark_NH_Icon.png/64px-Saw_Shark_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/e/eb/Soft-Shelled_Turtle_NH_Icon.png/64px-Soft-Shelled_Turtle_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/b/bb/Tadpole_NH_Icon.png/64px-Tadpole_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/4/4f/Whale_Shark_NH_Icon.png/64px-Whale_Shark_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/7/7f/Anchovy_%28Fish%29_NH_Icon.png/64px-Anchovy_%28Fish%29_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/e/e0/Barreleye_NH_Icon.png/64px-Barreleye_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/0/0b/Betta_NH_Icon.png/64px-Betta_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/f/fc/Golden_Trout_NH_Icon.png/64px-Golden_Trout_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/d/d6/Mahi-Mahi_NH_Icon.png/64px-Mahi-Mahi_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/e/e7/Rainbowfish_NH_Icon.png/64px-Rainbowfish_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/3/35/Ranchu_Goldfish_NH_Icon.png/64px-Ranchu_Goldfish_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/b/b1/Snapping_Turtle_NH_Icon.png/64px-Snapping_Turtle_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/9/91/Sturgeon_NH_Icon.png/64px-Sturgeon_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/d/de/Suckerfish_NH_Icon.png/64px-Suckerfish_NH_Icon.png",
|
||||||
|
"https://dodo.ac/np/images/thumb/e/ef/Tilapia_NH_Icon.png/64px-Tilapia_NH_Icon.png"
|
||||||
|
];
|
||||||
|
|
||||||
|
for (const url of urls) {
|
||||||
|
await $`wget ${url} -P images/`;
|
||||||
|
}
|
|
@ -0,0 +1,60 @@
|
||||||
|
import { Logger } from "@util/Logger";
|
||||||
|
import { argv } from "bun";
|
||||||
|
import { existsSync, readFileSync, writeFileSync } from "fs";
|
||||||
|
import YAML from "yaml";
|
||||||
|
|
||||||
|
const logger = new Logger("Fishstat");
|
||||||
|
|
||||||
|
const inFile = argv[2];
|
||||||
|
|
||||||
|
if (typeof inFile !== "string") {
|
||||||
|
logger.error(`Usage: <infile>`);
|
||||||
|
process.exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!existsSync(inFile)) {
|
||||||
|
logger.error("Input file not found");
|
||||||
|
process.exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
logger.info("Reading YAML...");
|
||||||
|
|
||||||
|
let data: IFish[];
|
||||||
|
|
||||||
|
try {
|
||||||
|
const ydata = readFileSync(inFile).toString();
|
||||||
|
data = YAML.parse(ydata);
|
||||||
|
const numFish = data.length;
|
||||||
|
logger.info("Number of fish:", numFish);
|
||||||
|
|
||||||
|
let rarities = data.map(fish => fish.rarity);
|
||||||
|
let raritySum = rarities.reduce((b, a) => a + b);
|
||||||
|
|
||||||
|
let rarityCounts: Record<number, number> = {};
|
||||||
|
|
||||||
|
for (const fish of data) {
|
||||||
|
if (!rarityCounts[fish.rarity]) rarityCounts[fish.rarity] = 0;
|
||||||
|
rarityCounts[fish.rarity]++;
|
||||||
|
}
|
||||||
|
|
||||||
|
let mostCommonRarity = 0;
|
||||||
|
let mostCommonRaritySum = 0;
|
||||||
|
|
||||||
|
for (const rarity of rarities) {
|
||||||
|
if (rarityCounts[rarity] > mostCommonRaritySum) {
|
||||||
|
mostCommonRaritySum = rarityCounts[rarity];
|
||||||
|
mostCommonRarity = rarity;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
logger.info("Average rarity:", raritySum / numFish);
|
||||||
|
logger.info(
|
||||||
|
"Most common rarity:",
|
||||||
|
mostCommonRarity,
|
||||||
|
`(${mostCommonRaritySum} counted)`
|
||||||
|
);
|
||||||
|
} catch (err) {
|
||||||
|
logger.error(err);
|
||||||
|
logger.error("YAML read error");
|
||||||
|
process.exit();
|
||||||
|
}
|
|
@ -1,32 +0,0 @@
|
||||||
import { Logger } from "@util/Logger";
|
|
||||||
import { argv } from "bun";
|
|
||||||
import { existsSync, readFileSync, writeFileSync } from "fs";
|
|
||||||
import YAML from "yaml";
|
|
||||||
|
|
||||||
const logger = new Logger("Numfish");
|
|
||||||
|
|
||||||
const inFile = argv[2];
|
|
||||||
|
|
||||||
if (typeof inFile !== "string") {
|
|
||||||
logger.error(`Usage: <infile>`);
|
|
||||||
process.exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!existsSync(inFile)) {
|
|
||||||
logger.error("Input file not found");
|
|
||||||
process.exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
logger.info("Reading YAML...");
|
|
||||||
|
|
||||||
let data: IFish[];
|
|
||||||
|
|
||||||
try {
|
|
||||||
const ydata = readFileSync(inFile).toString();
|
|
||||||
data = YAML.parse(ydata);
|
|
||||||
logger.info("Number of fish:", data.length);
|
|
||||||
} catch (err) {
|
|
||||||
logger.error(err);
|
|
||||||
logger.error("YAML read error");
|
|
||||||
process.exit();
|
|
||||||
}
|
|
|
@ -1,16 +1,35 @@
|
||||||
import { createBunServeHandler } from "trpc-bun-adapter";
|
import { createBunServeHandler } from "trpc-bun-adapter";
|
||||||
import { appRouter, createContext } from "./trpc";
|
import { appRouter, createContext } from "./trpc";
|
||||||
import { Logger } from "@util/Logger";
|
import { Logger } from "@util/Logger";
|
||||||
|
import path from "path";
|
||||||
|
|
||||||
const logger = new Logger("Server");
|
const logger = new Logger("Server");
|
||||||
|
|
||||||
export const server = Bun.serve(
|
export const server = Bun.serve(
|
||||||
createBunServeHandler({
|
createBunServeHandler(
|
||||||
router: appRouter,
|
{
|
||||||
createContext: createContext,
|
router: appRouter,
|
||||||
req: new Request("https://github.com/Hri7566"),
|
createContext: createContext,
|
||||||
endpoint: "/"
|
req: new Request("https://github.com/Hri7566"),
|
||||||
})
|
endpoint: "/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
async fetch(req, server) {
|
||||||
|
console.log(req);
|
||||||
|
const url = new URL(req.url).pathname;
|
||||||
|
|
||||||
|
const pathargs = url.split("/");
|
||||||
|
|
||||||
|
if (pathargs[0] === "images") {
|
||||||
|
const file = path.join("./images/", url);
|
||||||
|
const data = Bun.file(file);
|
||||||
|
return new Response(data);
|
||||||
|
} else {
|
||||||
|
return new Response();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
logger.info("Started on port", (process.env.PORT as string) || 3000);
|
logger.info("Started on port", (process.env.PORT as string) || 3000);
|
||||||
|
|
|
@ -7,7 +7,7 @@ export const info = new Command(
|
||||||
"info",
|
"info",
|
||||||
"command.general.info",
|
"command.general.info",
|
||||||
async ({ id, command, args, prefix, part, user }) => {
|
async ({ id, command, args, prefix, part, user }) => {
|
||||||
return `🌊 Made by Hri7566 | Original created by Brandon Lockaby`;
|
return `🐟 Maintained by \`@hri7566\` (mppn @ead940199c7d9717e5149919) and developed with permission from Brandon`;
|
||||||
},
|
},
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
|
@ -53,14 +53,14 @@ export const give = new Command(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (updated) {
|
if (updated) {
|
||||||
await updateInventory(foundInventory);
|
|
||||||
|
|
||||||
if (foundObject.objtype == "fish") {
|
if (foundObject.objtype == "fish") {
|
||||||
removeItem(inventory.fishSack, foundObject, 1);
|
removeItem(inventory.fishSack, foundObject, 1);
|
||||||
} else if (foundObject.objtype == "item") {
|
} else if (foundObject.objtype == "item") {
|
||||||
removeItem(inventory.items, foundObject, 1);
|
removeItem(inventory.items, foundObject, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await updateInventory(foundInventory);
|
||||||
|
|
||||||
return `You ${
|
return `You ${
|
||||||
command.endsWith("e") ? `${command}d` : `${command}ed`
|
command.endsWith("e") ? `${command}d` : `${command}ed`
|
||||||
} your ${foundObject.name} to ${foundUser.name}.`;
|
} your ${foundObject.name} to ${foundUser.name}.`;
|
||||||
|
|