diff --git a/dist/index.js b/dist/index.js index 7a54aa5a..7a5c6643 100644 Binary files a/dist/index.js and b/dist/index.js differ diff --git a/dist/index.js.map b/dist/index.js.map index 81e15d8e..c7afea0a 100644 Binary files a/dist/index.js.map and b/dist/index.js.map differ diff --git a/dist/licenses.txt b/dist/licenses.txt index cc72ec66..489190c1 100644 Binary files a/dist/licenses.txt and b/dist/licenses.txt differ diff --git a/package.json b/package.json index 858bba9a..48d3bbaf 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,7 @@ "nanoid": "^3.3.1", "reflect-metadata": "^0.1.13", "semver": "^7.5.2", + "ts-md5": "^1.3.1", "unity-changeset": "^2.0.0", "uuid": "^9.0.0", "yaml": "^2.2.2" diff --git a/src/model/cloud-runner/remote-client/remote-client-logger.ts b/src/model/cloud-runner/remote-client/remote-client-logger.ts index 09eafc71..0aa2f5e9 100644 --- a/src/model/cloud-runner/remote-client/remote-client-logger.ts +++ b/src/model/cloud-runner/remote-client/remote-client-logger.ts @@ -3,7 +3,7 @@ import fs from 'node:fs'; import path from 'node:path'; import CloudRunner from '../cloud-runner'; import CloudRunnerOptions from '../options/cloud-runner-options'; -const md5 = require('md5'); +import * as md5 from 'ts-md5'; export class RemoteClientLogger { private static get LogFilePath() { @@ -51,22 +51,24 @@ export class RemoteClientLogger { return; } + CloudRunnerLogger.log(`Log file exist`); + await new Promise((resolve) => setTimeout(resolve, 1)); - let hashedLogs = fs.readFileSync(RemoteClientLogger.LogFilePath).toString(); - - hashedLogs = md5(hashedLogs); - - for (let index = 0; index < 3; index++) { - CloudRunnerLogger.log(`LOGHASH: ${hashedLogs}`); - const logs = fs.readFileSync(RemoteClientLogger.LogFilePath).toString(); - CloudRunnerLogger.log(`LOGS: ${Buffer.from(logs).toString('base64')}`); - CloudRunnerLogger.log( - `Game CI's "Cloud Runner System" will cancel the log when it has successfully received the log data to verify all logs have been received.`, - ); - - // wait for 15 seconds to allow the log to be sent - await new Promise((resolve) => setTimeout(resolve, 15000)); - } + // let hashedLogs = fs.readFileSync(RemoteClientLogger.LogFilePath).toString(); + // + // hashedLogs = md5(hashedLogs); + // + // for (let index = 0; index < 3; index++) { + // CloudRunnerLogger.log(`LOGHASH: ${hashedLogs}`); + // const logs = fs.readFileSync(RemoteClientLogger.LogFilePath).toString(); + // CloudRunnerLogger.log(`LOGS: ${Buffer.from(logs).toString('base64')}`); + // CloudRunnerLogger.log( + // `Game CI's "Cloud Runner System" will cancel the log when it has successfully received the log data to verify all logs have been received.`, + // ); + // + // // wait for 15 seconds to allow the log to be sent + // await new Promise((resolve) => setTimeout(resolve, 15000)); + // } } public static HandleLog(message: string): boolean { if (message.includes('LOGHASH: ')) { @@ -77,7 +79,7 @@ export class RemoteClientLogger { } RemoteClientLogger.value += message; - const hashedValue = md5(RemoteClientLogger.value); + const hashedValue = md5.Md5.hashStr(RemoteClientLogger.value); if (RemoteClientLogger.md5 === hashedValue) { CloudRunnerLogger.log(`LOG COMPLETE`); @@ -96,7 +98,7 @@ export class RemoteClientLogger { } } public static HandleLogFull(message: string): boolean { - const hashedValue = md5(message); + const hashedValue = md5.Md5.hashStr(message); if (RemoteClientLogger.md5 === hashedValue) { CloudRunnerLogger.log(`LOG COMPLETE`); diff --git a/yarn.lock b/yarn.lock index 7542ca0d..6755cec8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6031,6 +6031,11 @@ ts-jest@^27.1.3: semver "7.x" yargs-parser "20.x" +ts-md5@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/ts-md5/-/ts-md5-1.3.1.tgz#f5b860c0d5241dd9bb4e909dd73991166403f511" + integrity sha512-DiwiXfwvcTeZ5wCE0z+2A9EseZsztaiZtGrtSaY5JOD7ekPnR/GoIVD5gXZAlK9Na9Kvpo9Waz5rW64WKAWApg== + ts-node@10.8.1: version "10.8.1" resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.8.1.tgz#ea2bd3459011b52699d7e88daa55a45a1af4f066"