[BDS-19922] server.net module not working as expected on Linux Created: 08/Dec/24 Updated: 08/Dec/24 |
|
| Status: | Open |
| Project: | Bedrock Dedicated Server |
| Affects Version/s: | 1.21.50 |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | Tyler | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Linux |
||
| Confirmation Status: | Unconfirmed |
| Description |
|
Not sure if this is an issue related to just the newest version, or if it effects older versions as well. I just encountered this issue when creating a new addon. Basically I created an addon that uses the server.net module for the scripting API, which sends a HTTP post request to a web server I have running locally when a player leaves or joins the server. I have tested the addon on the Windows version on BDS (Test Server) and it worked perfectly. Comes time to add it to the live server I have running on Linux, and I have issues.
The server console tells me that the addon has loaded sucessfully, and most functions of the addon work perfectly fine. The issues start when this line of code is run. const response = await http.request(req); Which is the line that sends the HTTP post request to the web server. Here is the whole function var URL = 'http://xxx.xxx.x.xxx:xxxx/LogPlayerActivity?player=' + player + '&totalOnline=' + totalOnline + '&connectOrDisconect=' + connectOrDisconect + '&key=' + key; , 3000); } world.afterEvents.playerJoin.subscribe(e => { var player = e.playerName var totalOnline = world.getAllPlayers().length + 1; var connectOrDisconect = true logPlayerJoinOrLeave(player, totalOnline, connectOrDisconect) }) When I uncomment the offending line, when a player joins the server their game hangs on "locating server". The console says the player has connected and spawned in, and if they click "cancel" or close the game the console shows them disconecting. If I try to stop the server using the "stop" command after a player attempted to connect, the server also hangs and I have to force close it. And no, the HTTP post request never goes through.
Not sure if this is a known bug or if there is a work around, but for now I am not logging player connects or disconnects. I am assuming this is some form of bug since the above code works flawlessly on the Windows version on BDS.
|