What he say

This commit is contained in:
unexp 2023-01-20 10:27:48 -03:00
parent 1d306bf777
commit 24b2e3ae69
No known key found for this signature in database
GPG Key ID: BF66F09641C584C8
4 changed files with 13 additions and 7 deletions

View File

@ -18,12 +18,12 @@ class RCCService extends EventEmitter {
this.proc = child_process.spawn("wine", ["RCCService.exe", "-Console", "-PlaceId:-1", `-Port`, this.port], options)
}
this.proc.once("spawn", () => {
logger.info(`Spawning RCCService instance on port ${this.port}`);
logger.info(`Spawned RCCService instance on port ${this.port}`);
resolve(this.proc)
})
this.proc.once("exit", () => {
this.proc = null;
logger.info(`Job has ended, closing RCCService on port ${this.port}`)
logger.info(`An RCCService instance has closed on port ${this.port}`)
})
} catch (_) {
logger.error(_);

View File

@ -1,17 +1,20 @@
const waitPort = require("wait-port")
const logger = require(`${__dirname}\\..\\lib\\logger.js`)
const { readFileSync, read } = require("fs")
const express = require("express")
const Job = require("../lib/classes/Job.js")
const { randomUUID } = require("crypto")
const app = express.Router()
let tempPort = 64990
app.all("*", async (request, response) => {
const job = new Job("KILL JACKD", tempPort)
const job = new Job(randomUUID(), tempPort)
await job.Start()
const { open } = await waitPort({ host: "127.0.0.1", port: tempPort, timeout: 5000, output: "silent" })
if (!open) {
logger.warn("Job could not be started because port is already taken. Closing job..");
job.Close()
return response.json(false)
}
@ -19,14 +22,17 @@ app.all("*", async (request, response) => {
await job.CreateClient()
const result = await job.Open({
name: job.id,
script: readFileSync(__dirname + "/../lua/user_headshot.lua", { encoding: "utf-8" }),
script: readFileSync(__dirname + "/../lua/headshot.lua", { encoding: "utf-8" }),
arguments: {
LuaValue: [
{ type: "LUA_TSTRING", value: job.id },
{ type: "LUA_TSTRING", value: "RenderUserHeadshot" },
{ type: "LUA_TSTRING", value: "Headshot" },
{ type: "LUA_TSTRING", value: "PNG" },
{ type: "LUA_TNUMBER", value: "1920" },
{ type: "LUA_TNUMBER", value: "1920" },
// change this to 1920x when we finish the arbiter
{ type: "LUA_TNUMBER", value: "420" },
{ type: "LUA_TNUMBER", value: "420" },
{ type: "LUA_TSTRING", value: "https://sitetest.unexp.xyz" },
{ type: "LUA_TNUMBER", value: "1" },
],