A Typescript server emulator for Box Critters, a defunct virtual world.
at main 655 B view raw
1import { Server } from "https://deno.land/x/socket_io@0.2.0/mod.ts"; 2 3import * as connection from "./handlers/connection.ts"; 4import * as player from "./handlers/player.ts"; 5import * as world from "./handlers/world.ts"; 6import * as social from "./handlers/social.ts"; 7import * as economy from "./handlers/economy.ts"; 8 9export const io = new Server(); 10 11io.on("connection", (socket) => { 12 const context = { 13 localPlayer: null, 14 localCrumb: null, 15 }; 16 17 connection.listen(io, socket, context); 18 player.listen(io, socket, context); 19 world.listen(io, socket, context); 20 social.listen(io, socket, context); 21 economy.listen(io, socket, context); 22});