- feat: alpha hamster critter variant - style: format client JS - feat: improved login validation - style: format & update footers - fix: mods array not being populated by JWT contents - style: restructure socket.io server into multiple files - style: remove unused socket.io types
22 lines
655 B
TypeScript
22 lines
655 B
TypeScript
import { Server } from "https://deno.land/x/socket_io@0.2.0/mod.ts";
|
|
|
|
import * as connection from "./handlers/connection.ts";
|
|
import * as player from "./handlers/player.ts";
|
|
import * as world from "./handlers/world.ts";
|
|
import * as social from "./handlers/social.ts";
|
|
import * as economy from "./handlers/economy.ts";
|
|
|
|
export const io = new Server();
|
|
|
|
io.on("connection", (socket) => {
|
|
const context = {
|
|
localPlayer: null,
|
|
localCrumb: null,
|
|
};
|
|
|
|
connection.listen(io, socket, context);
|
|
player.listen(io, socket, context);
|
|
world.listen(io, socket, context);
|
|
social.listen(io, socket, context);
|
|
economy.listen(io, socket, context);
|
|
});
|