Change curios to always show on inventory
This commit is contained in:
@@ -57,6 +57,8 @@ export function setup(ctx: ServerContext) {
|
||||
on_use(item, params: { power: number }, player) { log("use", [item.id, params.power, player.name]); },
|
||||
});
|
||||
|
||||
ctx.net.on("testmod:ping", () => log("ping"));
|
||||
|
||||
ctx.system.run_timeout(() => log("timeout", ctx.system.current_tick), 5);
|
||||
const interval = ctx.system.run_interval(() => {
|
||||
log("interval", ctx.system.current_tick);
|
||||
@@ -391,3 +393,13 @@ Deno.test("menus: filters, data, buttons, closing, saving, and dropping what's i
|
||||
assertEquals(loaded.game.containers.size, 0);
|
||||
Deno.removeSync(dir, { recursive: true });
|
||||
});
|
||||
|
||||
Deno.test("mod messages that are too big or too many are dropped", async () => {
|
||||
const { send, log, dir } = await setup();
|
||||
send(1, { type: "mod", channel: "testmod:ping", data: "x".repeat(20_000) });
|
||||
assertEquals(log().ping, undefined);
|
||||
for (let i = 0; i < 100; i++) send(1, { type: "mod", channel: "testmod:ping", data: {} });
|
||||
// 60 a second, counting the big one, and this could be split over two seconds
|
||||
assert(log().ping.length > 0 && log().ping.length < 100);
|
||||
Deno.removeSync(dir, { recursive: true });
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user