Skip to content

Latest commit

 

History

History
115 lines (106 loc) · 4.88 KB

README.md

File metadata and controls

115 lines (106 loc) · 4.88 KB

PaperUpdater

Simple papermc.io or purpurmc.org Minecraft Server file updater. Gets the latest version, downloads it and places the file in the root of where this program's executable file is. Detailed process below.

How it works (PaperMC)

Logic below is held and processed in PaperProjectApi.cs
  • Getting the latest paper project version
    • Gets JSON data from API URL:
      • API URL: https://api.papermc.io/v2/projects/paper
      • Outputs: JSON structured data with every version group and version offered to use
    • It finds the list of strings in versions (last is latest)
    • It verifies that the project_id is paper
    • Stores it in a string that should be 1.19.3

Logic below is held and processed in PaperBuildApi.cs

  • Loading Paper API JSON Data
    • Gets JSON data from API URL:
      • API URL: https://api.papermc.io/v2/projects/paper/versions/1.19.3/builds
      • Outputs: JSON structured data with every build of paper 1.19.3
    • It gets the last entry in the list of builds (last is latest)
    • It then verifies that the channel is default
    • Outputs a completed URL https://api.papermc.io/v2/projects/paper/versions/1.19.3/builds/{buildNumber}/downloads/{buildName}
  • Updating the file
    • If Data is not incorrect
    • It gets the file data as bytes from the completed URL constructed above
    • It will delete a file paper.jar if it exists
    • Then write a new file with the bytes gathered from the completed URL and saves it as paper.jar

How it works (PurpurMC)

Their API easily lets me only get the latest version of their server. It doesn't have to do any of the logic I did for PaperMC. I just get the latest version and download it. Simple as that.
Logic below is held and processed in PaperProjectApi.cs Line 53, which gets applied on line 79

How it works (Overall)

Logic below is held and processed in BatchFuncs.cs
  • Creating a batch file
    • Creates a simple batch file to easily run your server
  • Running the server
    • You have the ability to create a basic preset batch file
    • You can also have this application run that batch file directly

To Do

  • hmm, not sure what else to do

Linux

Recommended actions needed: Running it:
  • Install screen (above)
  • create and change into a new screen
  • cd into your desired folder (Preferably where your server is installed)
  • wget the latest version ( wget https://github.com/Minty-Labs/PaperUpdater/releases/latest/download/PaperConsoleUpdater )
  • make sure to sudo chmod +x PaperConsoleUpdater
  • Run the program (./PaperConsoleUpdater)

Credits and Ownerships

  • Program Icon (Logo) is directly from papermc's website header logo. All rights go to papermc for the logo. If someone from the papermc team has an issue with me using your logo, please do not hesitate to email Lily C.

Disclaimer

I, Lily, am in no way affiliated with PaperMC nor Microsoft/Mojang Studios. Any and all images' rights go their original owners.

Application Info

  • Type: Console Application (dotNET 6)
  • IDE: JetBrains Rider - 2022.3.1
  • Version: v1.5.0.0
  • Nuget Packages:
    • Newtonsoft.Json - 13.0.2
    • Pastel - 4.1.0
  • Checksum SHA-256
    • Windows: 1f77cfae88a39c75b1fa0e9e2c3b172fba48ac2521e4951b267f120a66b6e38d
    • Linux: 6da4bf58067a2a5b0627bc7479793447d7216d6fe49c0074f9da888c56818919