Implement main game as a mod
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { BlockChange, ClientMessage, PlayerInfo, ServerMessage } from "$/common/protocol.ts";
|
||||
import type { ModListing } from "$/common/mod_loader.ts";
|
||||
|
||||
const CONNECT_TIMEOUT_MS = 3000;
|
||||
|
||||
@@ -13,7 +14,9 @@ export interface RemotePlayer extends PlayerInfo {
|
||||
export class Connection {
|
||||
socket: WebSocket;
|
||||
id: string;
|
||||
name: string;
|
||||
seed: string;
|
||||
mods: ModListing[];
|
||||
initial_changes: BlockChange[];
|
||||
spawn: { x: number; y: number; z: number; yaw: number; pitch: number };
|
||||
selected_slot: number;
|
||||
@@ -26,7 +29,9 @@ export class Connection {
|
||||
constructor(socket: WebSocket, welcome: Extract<ServerMessage, { type: "welcome" }>) {
|
||||
this.socket = socket;
|
||||
this.id = welcome.id;
|
||||
this.name = welcome.name;
|
||||
this.seed = welcome.seed;
|
||||
this.mods = welcome.mods;
|
||||
this.initial_changes = welcome.changes;
|
||||
this.spawn = welcome.spawn;
|
||||
this.selected_slot = welcome.selected_slot;
|
||||
|
||||
Reference in New Issue
Block a user