Block registry api
This commit is contained in:
@@ -125,12 +125,3 @@ function script_of(mod: ServerModSource) {
|
||||
config: mod.data.config ?? {},
|
||||
};
|
||||
}
|
||||
|
||||
export function data_url(code: string) {
|
||||
const bytes = new TextEncoder().encode(code);
|
||||
let binary = "";
|
||||
for (let i = 0; i < bytes.length; i += 0x8000) {
|
||||
binary += String.fromCharCode(...bytes.subarray(i, i + 0x8000));
|
||||
}
|
||||
return `data:application/javascript;base64,${btoa(binary)}`;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
import type { GameServer } from "./game_server.ts";
|
||||
import { GameLoop } from "./game_loop.ts";
|
||||
import { GameToHost, HostToGame, READ_DONE, READ_HEADER, READ_TOO_SMALL, READ_WAITING } from "./host_protocol.ts";
|
||||
import { data_url, start_game } from "./load_mods.ts";
|
||||
import { start_game } from "./load_mods.ts";
|
||||
import { data_url } from "@/common/mod.ts";
|
||||
import { type WorkerPort, WorldgenPool } from "./worldgen_pool.ts";
|
||||
|
||||
const SAVE_INTERVAL_MS = 30_000;
|
||||
|
||||
Reference in New Issue
Block a user