NodeJs-Unreal icon indicating copy to clipboard operation
NodeJs-Unreal copied to clipboard

packaged exe main script crashing without internet access

Open JackGit3 opened this issue 3 years ago • 3 comments

If I run it in the editor with or without internet everything still works just fine. However in the packaged version if I turn off my internet connection then the mainscript crashes every time. Where would be a good starting point for me to dig into this issue or would anyone perhaps know why this might be happening?

JackGit3 avatar Feb 11 '21 06:02 JackGit3

What does the log say? this is where the wrapper script starts, you may want to trace it from there to see where it could be crashing: https://github.com/getnamo/nodejs-ue4/blob/master/Content/Scripts/nodeWrapper.js#L101

getnamo avatar Feb 12 '21 17:02 getnamo

I have exactly the same issue. If I shut down my network card the node process doesn't start.

[2021.05.12-15.41.30:574][  0]LogWorld: Bringing up level for play took: 0.001941
[2021.05.12-15.41.30:577][  0]LogTemp: RunScriptStart
[2021.05.12-15.41.30:579][  0]LogTemp: node thread start
[2021.05.12-15.41.30:579][  0]LogTemp: Starting node.exe at C:/Users/{OBFUSCATED}/Plugins/nodejs-ue4/Source/ThirdParty/node with ../../../Content/Scripts/nodeWrapper.js
[2021.05.12-15.41.30:579][  0]LogUMG: Display: Widget Class LiveTime_W_C - Loaded Fast Template.
[2021.05.12-15.41.30:579][  0]LogUMG: Display: Widget Class LiveScore_W_C - Loaded Fast Template.
[2021.05.12-15.41.30:580][  0]LogUMG: Display: Widget Class MainScreen_W_C - Loaded Fast Template.
[2021.05.12-15.41.30:582][  0]SocketIOLog: SocketIO Invalid appears to have lost connection, reconnecting attempt 0 with delay 5000

xiaodoudou avatar May 12 '21 15:05 xiaodoudou

I need a bit of a test and end up binding HTTP to 127.0.0.1 instead. of localhost.

Inside: Plugins/nodejs-ue4/Source/CommandLine/Private/NodeCmd.cpp

-	Socket->Connect(FString::Printf(TEXT("http://localhost:%d"), Port));
+	Socket->Connect(FString::Printf(TEXT("http://127.0.0.1:%d"), Port));

Inside: Plugins/nodejs-ue4/Content/Scripts/nodeWrapper.js

 
-http.listen(k.port, ()=>{
+http.listen({
+	host: '127.0.0.1',
+	port: k.port,
+	exclusive: false,
+	readableAll: true,
+	writableAll: true
+}, ()=>{

Exclusive is default to false, so should be useless, and believe the readable/writable should be too, but we launch our game as admin (Kiosked PC)

xiaodoudou avatar May 12 '21 16:05 xiaodoudou