Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Avoid a couple cases where no NUIManager would cause trouble. #4919

Merged
merged 3 commits into from
Oct 3, 2021

Conversation

Cervator
Copy link
Member

@Cervator Cervator commented Oct 2, 2021

This seemingly fixes a case where you can't host the game headlessly if you have modules active with UISkinFormat assets ! Which is probably a bit quirky. Since there's no longer a NUIManager available in the Context when you're running headlessly we really shouldn't attempt to use it during initialization. There may still be other cases where this could factor in.

Additionally I caught an exception being swallowed and a weird game state being entered in the case where you fail to establish the game host due to for instance already having the port in use. Previously that would freak out and fail to create a NUI popup informing the user which isn't very helpful when trying to start a headless server. Now it logs an error and promptly terminates the game - if headed it'll still fall back to single player, although I'm not sure if that's actually sensible.

With that fixed you now get a good error in the logs. You still get the CrashReporter starting, which is kinda weird. Maybe we lack that flag when starting from Gradle, but what if you're running from a game binary on a server? CR should be disabled if headless, period. Haven't looked into fixing that, I had to juggle this tricky fix alongside toddler, baby feeding, and angry neighbors showing up to complain about our plants dripping water onto their balcony stairs below us. Yup.

Bonus: filters out typical virtual NICs from listening - this may be more controversial but I'd like to leave it as a GFI exercise to turn it configurable via config.cfg - I suspect it is hugely unlikely to cause trouble in the meantime. Even if somebody tries to host a game server inside VirtualBox I figure that would end up reachable via some bridged network like the host OS? Dunno. But this speeds up "listening to all the NICs!" from more than 30 seconds for me to just a few. Could ignore a couple more still. This is how my startup ends up looking:

17:22:21.464 [main] INFO  o.t.e.n.internal.NetworkSystemImpl - Skipping filtered interface name VirtualBox Host-Only Ethernet Adapter #4
17:22:21.464 [main] INFO  o.t.e.n.internal.NetworkSystemImpl - Skipping filtered interface name VirtualBox Host-Only Ethernet Adapter #4
17:22:21.471 [main] INFO  o.t.e.n.internal.NetworkSystemImpl - Skipping filtered interface name Microsoft ISATAP Adapter #7
17:22:21.474 [main] INFO  o.t.e.n.internal.NetworkSystemImpl - Skipping filtered interface name VirtualBox Host-Only Ethernet Adapter #2
17:22:21.474 [main] INFO  o.t.e.n.internal.NetworkSystemImpl - Skipping filtered interface name VirtualBox Host-Only Ethernet Adapter #2
17:22:22.298 [main] INFO  o.t.e.n.internal.NetworkSystemImpl - Listening on network interface "Intel(R) Dual Band Wireless-AC 8260 #2", hostname "fe80:0:0:0:1d39:3ebe:32df:2a55%wlan0" (fe80:0:0:0:1d39:3ebe:32df:2a55%wlan0)
17:22:23.124 [main] INFO  o.t.e.n.internal.NetworkSystemImpl - Listening on network interface "Microsoft Wi-Fi Direct Virtual Adapter #2", hostname "fe80:0:0:0:1910:f4c:9c83:8718%wlan1" (fe80:0:0:0:1910:f4c:9c83:8718%wlan1)
17:22:23.129 [main] INFO  o.t.e.n.internal.NetworkSystemImpl - Skipping filtered interface name Microsoft ISATAP Adapter #5
17:22:23.954 [main] INFO  o.t.e.n.internal.NetworkSystemImpl - Listening on network interface "Microsoft Teredo Tunneling Adapter", hostname "fe80:0:0:0:0:100:7f:fffe%net3" (fe80:0:0:0:0:100:7f:fffe%net3)
17:22:23.957 [main] INFO  o.t.e.n.internal.NetworkSystemImpl - Skipping filtered interface name Microsoft ISATAP Adapter #2
17:22:24.785 [main] INFO  o.t.e.n.internal.NetworkSystemImpl - Listening on network interface "TAP Adapter OAS NDIS 6.0", hostname "fe80:0:0:0:44bf:7d8c:94f3:b1d4%eth4" (fe80:0:0:0:44bf:7d8c:94f3:b1d4%eth4)
17:22:24.789 [main] INFO  o.t.e.n.internal.NetworkSystemImpl - Listening on network interface "Intel(R) Ethernet Connection (2) I218-V", hostname "192.168.86.36" (192.168.86.36)
17:22:24.789 [main] INFO  o.t.e.n.internal.NetworkSystemImpl - Listening on network interface "Intel(R) Ethernet Connection (2) I218-V", hostname "fe80:0:0:0:3552:69f2:d9ed:6a3b%eth5" (fe80:0:0:0:3552:69f2:d9ed:6a3b%eth5)
17:22:24.792 [main] INFO  o.t.e.n.internal.NetworkSystemImpl - Skipping filtered interface name VirtualBox Host-Only Ethernet Adapter
17:22:24.792 [main] INFO  o.t.e.n.internal.NetworkSystemImpl - Skipping filtered interface name VirtualBox Host-Only Ethernet Adapter
17:22:24.794 [main] INFO  o.t.e.n.internal.NetworkSystemImpl - Skipping filtered interface name Microsoft ISATAP Adapter #6
17:22:24.797 [main] INFO  o.t.e.n.internal.NetworkSystemImpl - Skipping filtered interface name VirtualBox Host-Only Ethernet Adapter #5
17:22:24.797 [main] INFO  o.t.e.n.internal.NetworkSystemImpl - Skipping filtered interface name VirtualBox Host-Only Ethernet Adapter #5
17:22:24.800 [main] INFO  o.t.e.n.internal.NetworkSystemImpl - Skipping filtered interface name VirtualBox Host-Only Ethernet Adapter #3
17:22:24.800 [main] INFO  o.t.e.n.internal.NetworkSystemImpl - Skipping filtered interface name VirtualBox Host-Only Ethernet Adapter #3
17:22:24.803 [main] INFO  o.t.e.n.internal.NetworkSystemImpl - Skipping filtered interface name Microsoft ISATAP Adapter
17:22:24.806 [main] INFO  o.t.e.n.internal.NetworkSystemImpl - Skipping filtered interface name Microsoft ISATAP Adapter #8
17:22:24.809 [main] INFO  o.t.e.n.internal.NetworkSystemImpl - Skipping filtered interface name VirtualBox Host-Only Ethernet Adapter #6
17:22:24.809 [main] INFO  o.t.e.n.internal.NetworkSystemImpl - Skipping filtered interface name VirtualBox Host-Only Ethernet Adapter #6
17:22:24.812 [main] INFO  o.t.e.n.internal.NetworkSystemImpl - Skipping filtered interface name Microsoft ISATAP Adapter #9
17:22:24.934 [main] INFO  o.t.e.n.internal.NetworkSystemImpl - Server started

Bonus: filters out typical virtual NICs from listening
@Cervator Cervator added Type: Bug Issues reporting and PRs fixing problems Multiplayer Affects aspects not visible in Singleplayer mode only Blocker Issue reporting or PR addressing a critical problem that blocks other efforts Category: Crash Requests, Issues and Changes targeting unexpected terminations, segfaults, etc. labels Oct 2, 2021
@Cervator
Copy link
Member Author

Cervator commented Oct 3, 2021

October Playtest

Copy link
Contributor

@DarkWeird DarkWeird left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

About NICs:
Seems calling ipconfig/ifconfig and parse them will faster T-T.
And also i think that this code useless.

@jdrueckert jdrueckert merged commit 221c2fe into MovingBlocks:develop Oct 3, 2021
@Cervator Cervator deleted the fixAssorted branch October 3, 2021 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blocker Issue reporting or PR addressing a critical problem that blocks other efforts Category: Crash Requests, Issues and Changes targeting unexpected terminations, segfaults, etc. Multiplayer Affects aspects not visible in Singleplayer mode only Type: Bug Issues reporting and PRs fixing problems
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants