Migrate manager and wrapper to shared message types

This commit is contained in:
2026-07-20 19:10:39 +02:00
parent cdbed5e000
commit 5c56208c8b
4 changed files with 16 additions and 5 deletions
+1
View File
@@ -11,6 +11,7 @@
"license": "ISC",
"dependencies": {
"amqplib": "^2.0.1",
"server-manager-shared": "file:../shared",
"steam-server-query": "^1.1.3"
},
"devDependencies": {
+12 -3
View File
@@ -4,6 +4,12 @@ import { loadConfig, saveConfig } from "./config";
import { ProcessManager } from "./processManager";
import { StatusReporter } from "./statusReporter";
import { QueryManager } from "./queryManager";
import {
WrapperRegisterMessage,
WrapperHeartbeatMessage,
ServerStartCommand,
ServerStopCommand
} from "server-manager-shared";
class Wrapper {
@@ -211,7 +217,7 @@ class Wrapper {
const message = {
const message: WrapperRegisterMessage = {
@@ -298,7 +304,10 @@ class Wrapper {
const command =
JSON.parse(
msg.content.toString()
);
) as ServerStartCommand | ServerStopCommand | {
type: string;
[key: string]: unknown;
};
@@ -392,7 +401,7 @@ class Wrapper {
const heartbeat = {
const heartbeat: WrapperHeartbeatMessage = {
type:
+1 -1
View File
@@ -41,7 +41,7 @@ export class ProcessManager {
startServer(data:any){
startServer(data: ServerStartCommand){
+2 -1
View File
@@ -2,6 +2,7 @@ import * as amqp from "amqplib";
import { ProcessManager } from "./processManager";
import os from "os";
import { QueryManager } from "./queryManager";
import { WrapperStatusMessage } from "server-manager-shared";
@@ -93,7 +94,7 @@ export class StatusReporter {
const status = {
const status: WrapperStatusMessage = {
type: