Skip to content

Commit 63622d8

Browse files
committed
Use await on config file parse call.
1 parent ad4b08a commit 63622d8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Server~/build/unity/mcpUnity.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export class McpUnity {
2020
async start(clientName) {
2121
try {
2222
this.logger.info('Attempting to read startup parameters...');
23-
this.parseAndSetConfig();
23+
await this.parseAndSetConfig();
2424
this.logger.info('Attempting to connect to Unity WebSocket...');
2525
await this.connect(clientName); // Pass client name to connect
2626
this.logger.info('Successfully connected to Unity WebSocket');
@@ -233,7 +233,7 @@ export class McpUnity {
233233
* @returns a JSON object with the contents of the McpUnitySettings.json file.
234234
*/
235235
async readConfigFileAsJson() {
236-
const configPath = path.resolve(process.cwd(), 'build/McpUnitySettings.json');
236+
const configPath = path.resolve(process.cwd(), '../ProjectSettings/McpUnitySettings.json');
237237
this.logger.debug(`Reading McpUnitySettings.json from ${configPath}`);
238238
try {
239239
const content = await fs.readFile(configPath, 'utf-8');

Server~/src/unity/mcpUnity.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export class McpUnity {
4747
public async start(clientName?: string): Promise<void> {
4848
try {
4949
this.logger.info('Attempting to read startup parameters...');
50-
this.parseAndSetConfig();
50+
await this.parseAndSetConfig();
5151

5252
this.logger.info('Attempting to connect to Unity WebSocket...');
5353
await this.connect(clientName); // Pass client name to connect

0 commit comments

Comments
 (0)