Hi Everyone,
Having a very slow start this year. But have gotten to the point where its Entelect time for me.
I can already see my bot and its implementation.
But I have an issue.
I am unable to access the Engine Environmental Variables with the Javascript starter bot.
To Explain my setup:
I have the engine built, and when i run it it gives the following:
Determining projects to restore…
All projects are up-to-date for restore.
2023-07-19T17:11:31.2599399+02:00 Information - Starting System.Private.CoreLib
SignalR Confighttp://127.0.0.1:5000/runnerhub
COLLECTIBLE AMOUNT: 540
HAZARD AMOUNT: 134
Start position {X=23,Y=20}
COLLECTIBLE AMOUNT: 459
HAZARD AMOUNT: 219
Start position {X=29,Y=14}
COLLECTIBLE AMOUNT: 351
HAZARD AMOUNT: 314
Start position {X=464,Y=54}
COLLECTIBLE AMOUNT: 270
HAZARD AMOUNT: 155
Start position {X=245,Y=101}
2023-07-19T17:11:32.0852886+02:00 Information Runner.Services.CloudIntegrationService - Cloud Callback Initiated, Status: initializing, Callback player Count: 0
2023-07-19T17:11:32.1806268+02:00 Warning Runner.Services.CloudIntegrationService - Failed to make cloud callback with error: An invalid request URI was provided. Either the request URI must be an absolute URI or BaseAddress must be set.
2023-07-19T17:11:32.3209908+02:00 Information Microsoft.Hosting.Lifetime - Now listening on: “http://[::]:5000”
2023-07-19T17:11:32.3237590+02:00 Information Microsoft.Hosting.Lifetime - Application started. Press Ctrl+C to shut down.
2023-07-19T17:11:32.3240376+02:00 Information Microsoft.Hosting.Lifetime - Hosting environment: “Production”
2023-07-19T17:11:32.3240763+02:00 Information Microsoft.Hosting.Lifetime - Content root path: “D:\Entelect Challenge 2023\2023-Cy-Fi-2023.2.5\2023-Cy-Fi-2023.2.5\2023-CyFi\CyFi”
2023-07-19T17:11:32.4385686+02:00 Information Microsoft.AspNetCore.Hosting.Diagnostics - Request starting HTTP/1.1 POST http://127.0.0.1:5000/runnerhub/negotiate?negotiateVersion=1 - 0
2023-07-19T17:11:32.4496061+02:00 Information Microsoft.AspNetCore.Routing.EndpointMiddleware - Executing endpoint ‘“/runnerhub/negotiate”’
2023-07-19T17:11:32.4822819+02:00 Information Microsoft.AspNetCore.Routing.EndpointMiddleware - Executed endpoint ‘“/runnerhub/negotiate”’
2023-07-19T17:11:32.4830764+02:00 Information Microsoft.AspNetCore.Hosting.Diagnostics - Request finished HTTP/1.1 POST http://127.0.0.1:5000/runnerhub/negotiate?negotiateVersion=1 - 0 - 200 316 application/json 45.9932ms
2023-07-19T17:11:32.5047721+02:00 Information Microsoft.AspNetCore.Hosting.Diagnostics - Request starting HTTP/1.1 GET http://127.0.0.1:5000/runnerhub?id=CXw6UUyAV--Lq6B2VDOtnQ - -
2023-07-19T17:11:32.5049040+02:00 Information Microsoft.AspNetCore.Routing.EndpointMiddleware - Executing endpoint ‘“/runnerhub”’
I’m posting these in case my issue is with the runner itself, I did recompile a few times.
[2023-07-19T15:13:24.451Z] Debug: HubConnection connected successfully.
Error connecting: Error: Failed to invoke ‘Register’ due to an error on the server. InvalidDataException: Error binding arguments. Make sure that the types of the provided values match the types of the hub method being invoked.
at _callbacks. (D:\Entelect Challenge 2023\2023-Cy-Fi-2023.2.5\2023-Cy-Fi-2023.2.5\2023-CyFi\CyFi\Chaos2\node_modules@microsoft\signalr\dist\cjs\HubConnection.js:315:36)
So I have an issue with those variables passed.
I echod them out and it shows:
BotName: JSBOT
Token: Undefined.
I can access the Process.Env, those vars are just not in it (or anything similar).
I declared my register calls as:
import { HubConnectionBuilder, LogLevel } from “@microsoft/signalr”;
const runnerIP = process.env.RUNNER_IPV4 ?? “localhost”;
const runnerURL = runnerIP.startsWith(“http://”)
? ${runnerIP}:5000/runnerhub
: http://${runnerIP}:5000/runnerhub
;
const botNickname = process.env.BOT_NICKNAME ?? “JSBot”;
const token = process.env.Token ?? process.env.REGISTRATION_TOKEN;
And then also:
(async () => {
try {
await connection.start();
await connection.invoke(“Register”, token, botNickname);
} catch (ex) {
console.error("Error connecting: ", ex);
}
})();
But seem to just not get there, I am running these with .sh files.