What he say
This commit is contained in:
parent
1d306bf777
commit
24b2e3ae69
|
|
@ -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 = child_process.spawn("wine", ["RCCService.exe", "-Console", "-PlaceId:-1", `-Port`, this.port], options)
|
||||||
}
|
}
|
||||||
this.proc.once("spawn", () => {
|
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)
|
resolve(this.proc)
|
||||||
})
|
})
|
||||||
this.proc.once("exit", () => {
|
this.proc.once("exit", () => {
|
||||||
this.proc = null;
|
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 (_) {
|
} catch (_) {
|
||||||
logger.error(_);
|
logger.error(_);
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,20 @@
|
||||||
const waitPort = require("wait-port")
|
const waitPort = require("wait-port")
|
||||||
|
const logger = require(`${__dirname}\\..\\lib\\logger.js`)
|
||||||
const { readFileSync, read } = require("fs")
|
const { readFileSync, read } = require("fs")
|
||||||
const express = require("express")
|
const express = require("express")
|
||||||
const Job = require("../lib/classes/Job.js")
|
const Job = require("../lib/classes/Job.js")
|
||||||
|
const { randomUUID } = require("crypto")
|
||||||
const app = express.Router()
|
const app = express.Router()
|
||||||
|
|
||||||
let tempPort = 64990
|
let tempPort = 64990
|
||||||
|
|
||||||
app.all("*", async (request, response) => {
|
app.all("*", async (request, response) => {
|
||||||
const job = new Job("KILL JACKD", tempPort)
|
const job = new Job(randomUUID(), tempPort)
|
||||||
await job.Start()
|
await job.Start()
|
||||||
|
|
||||||
const { open } = await waitPort({ host: "127.0.0.1", port: tempPort, timeout: 5000, output: "silent" })
|
const { open } = await waitPort({ host: "127.0.0.1", port: tempPort, timeout: 5000, output: "silent" })
|
||||||
if (!open) {
|
if (!open) {
|
||||||
|
logger.warn("Job could not be started because port is already taken. Closing job..");
|
||||||
job.Close()
|
job.Close()
|
||||||
return response.json(false)
|
return response.json(false)
|
||||||
}
|
}
|
||||||
|
|
@ -19,14 +22,17 @@ app.all("*", async (request, response) => {
|
||||||
await job.CreateClient()
|
await job.CreateClient()
|
||||||
const result = await job.Open({
|
const result = await job.Open({
|
||||||
name: job.id,
|
name: job.id,
|
||||||
script: readFileSync(__dirname + "/../lua/user_headshot.lua", { encoding: "utf-8" }),
|
script: readFileSync(__dirname + "/../lua/headshot.lua", { encoding: "utf-8" }),
|
||||||
arguments: {
|
arguments: {
|
||||||
LuaValue: [
|
LuaValue: [
|
||||||
{ type: "LUA_TSTRING", value: job.id },
|
{ type: "LUA_TSTRING", value: job.id },
|
||||||
{ type: "LUA_TSTRING", value: "RenderUserHeadshot" },
|
{ type: "LUA_TSTRING", value: "Headshot" },
|
||||||
{ type: "LUA_TSTRING", value: "PNG" },
|
{ 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_TSTRING", value: "https://sitetest.unexp.xyz" },
|
||||||
{ type: "LUA_TNUMBER", value: "1" },
|
{ type: "LUA_TNUMBER", value: "1" },
|
||||||
],
|
],
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue