Jump to content

[1.11.2]Stopping dedicated server


Smyler

Recommended Posts

Hi, I need to stop the dedicated server, but I can't figure out how to do it. I thought about using MinecraftServer::initiateShutdown(), as it's the only thing I found to do it, but I can't figure out how to get the MinecraftServer instance.

 

Please help, thanks

Edited by Smyler
Link to comment
Share on other sites

Why would you want to shut the integrated server down? That doesn't sound like a good thing....

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Link to comment
Share on other sites

I have a world generator that needs internet access to fetch data through a web API which requires a token. I want to stop the integrated server if the token is invalid and display a message in the logs. I need to do something equivalent for the integrated server, I think through a GUI, but I can't so far because the spawn area is generated before the server starts, and because I can't get an instance of the dedicated server (not the integrated, I made a mistake in my last post).

Link to comment
Share on other sites

Sorry, I don't really understand what you mean, English is not my primary language.

I am using Mapbox's API to download the heightmap used by my IChunkGenerator, and so I need to be able to cancel the world creation if the token is invalid (If I get a 401 response from the web API), from IChunkGenerator::provideChunk(), as each chunk can be on a new tile to download and as the token can be invalidated if the player makes more requests than he is able to with his Mapobox account.

Ideally, a GUI prompting for a valid token should be displayed on the client and a message asking to edit the config file printed to stdout on the dedicated server.

I don't think this is possible but if you have any idea how to make something similar please tell because I want to do something user-friendly and at the moment, the token is stored in the config and having an invalid one will simply crash the game.

 

Here is the github: https://github.com/ZeSmiler/irlw/tree/0.2_dev

Link to comment
Share on other sites

Ok, thanks for your help, I think I will try the hard thing first for the client game as I don't want to completely crash the clientit, but maybe I will come back at it later with more experience if I can't find a way to work around it.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.