mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-23 16:23:12 +09:00
Move IpcPlayerData out of inventory_sync/instance.ts
Remove circular dependency between inventory_sync/message.ts and inventory_sync/instance.ts by moving the IpcPlayerData type from message.ts to instance.ts. This solves a problem with the web build checking types in instance.ts that it dosen't use.
This commit is contained in:
1 parent
7bbb44d4e6
commit
96210373f3
4 files changed
+22
-24
No files matched your search
@@ -1,5 +1,5 @@
|
|||||||
import { BaseControllerPlugin, type InstanceInfo } from "@clusterio/controller";
|
import { BaseControllerPlugin, type InstanceInfo } from "@clusterio/controller";
|
||||||
import type { IpcPlayerData } from "./instance";
|
import type { IpcPlayerData } from "./messages";
|
||||||
|
|
||||||
import fs from "fs-extra";
|
import fs from "fs-extra";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
|
|||||||
@@ -1,32 +1,13 @@
|
|||||||
import * as lib from "@clusterio/lib";
|
import * as lib from "@clusterio/lib";
|
||||||
import { BaseInstancePlugin } from "@clusterio/host";
|
import { BaseInstancePlugin } from "@clusterio/host";
|
||||||
import {
|
import {
|
||||||
AcquireRequest, AcquireResponse, ReleaseRequest, UploadRequest, DownloadRequest, DownloadResponse,
|
AcquireRequest, AcquireResponse, ReleaseRequest, UploadRequest, DownloadRequest, DownloadResponse, IpcPlayerData,
|
||||||
} from "./messages";
|
} from "./messages";
|
||||||
|
|
||||||
type IpcPlayerName = {
|
type IpcPlayerName = {
|
||||||
player_name: string
|
player_name: string
|
||||||
}
|
}
|
||||||
|
|
||||||
// .\module\serialize.lua:serialize.serialize_player()
|
|
||||||
export type IpcPlayerData = {
|
|
||||||
generation: number,
|
|
||||||
controller: string,
|
|
||||||
name: string,
|
|
||||||
color: number[],
|
|
||||||
chat_color: number[],
|
|
||||||
tag: string,
|
|
||||||
force: string,
|
|
||||||
cheat_mode: boolean,
|
|
||||||
flashlight: boolean,
|
|
||||||
ticks_to_respawn?: number,
|
|
||||||
character?: any,
|
|
||||||
inventories?: any,
|
|
||||||
hotbar?: string[],
|
|
||||||
personal_logistic_slots?: {name:string, min:number, max:number}[],
|
|
||||||
crafting_queue?: any,
|
|
||||||
}
|
|
||||||
|
|
||||||
type IpcAcquireResponse = {
|
type IpcAcquireResponse = {
|
||||||
player_name: string,
|
player_name: string,
|
||||||
status: string,
|
status: string,
|
||||||
|
|||||||
@@ -1,8 +1,25 @@
|
|||||||
import type { IpcPlayerData } from "./instance";
|
|
||||||
|
|
||||||
import { Type, Static } from "@sinclair/typebox";
|
import { Type, Static } from "@sinclair/typebox";
|
||||||
import { StringEnum } from "@clusterio/lib";
|
import { StringEnum } from "@clusterio/lib";
|
||||||
|
|
||||||
|
// .\module\serialize.lua:serialize.serialize_player()
|
||||||
|
export type IpcPlayerData = {
|
||||||
|
generation: number,
|
||||||
|
controller: string,
|
||||||
|
name: string,
|
||||||
|
color: number[],
|
||||||
|
chat_color: number[],
|
||||||
|
tag: string,
|
||||||
|
force: string,
|
||||||
|
cheat_mode: boolean,
|
||||||
|
flashlight: boolean,
|
||||||
|
ticks_to_respawn?: number,
|
||||||
|
character?: any,
|
||||||
|
inventories?: any,
|
||||||
|
hotbar?: string[],
|
||||||
|
personal_logistic_slots?: {name:string, min:number, max:number}[],
|
||||||
|
crafting_queue?: any,
|
||||||
|
}
|
||||||
|
|
||||||
const jsonPlayerData = Type.Object({
|
const jsonPlayerData = Type.Object({
|
||||||
generation: Type.Number(),
|
generation: Type.Number(),
|
||||||
name: Type.String(),
|
name: Type.String(),
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
{ "path": "../../packages/lib" },
|
{ "path": "../../packages/lib" },
|
||||||
{ "path": "../../packages/web_ui/tsconfig.web.json" },
|
{ "path": "../../packages/web_ui/tsconfig.web.json" },
|
||||||
],
|
],
|
||||||
"include": [ "web/**/*.tsx", "web/**/*.ts", "messages.ts", "instance.ts", "package.json" ],
|
"include": [ "web/**/*.tsx", "web/**/*.ts", "messages.ts", "package.json" ],
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "dist/web/build",
|
"outDir": "dist/web/build",
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user