diff --git a/src/info/data/minecraft/introduction.yml b/src/info/data/minecraft/introduction.yml index de8b9e2..8112b01 100644 --- a/src/info/data/minecraft/introduction.yml +++ b/src/info/data/minecraft/introduction.yml @@ -1,4 +1,5 @@ --- # Introduction YAML intro: | - Here's some information on the Queercule's Minecraft server. + Here's some information on the Queercule's Minecraft server. + If you're here looking for how to play on our server, you'll need to be on our apartment's internet (or on VPN) and either add a server connection or do a direct connection to this site's URL. diff --git a/src/info/pages/minecraft/index.js b/src/info/pages/minecraft/index.js index d86511b..a5e143d 100644 --- a/src/info/pages/minecraft/index.js +++ b/src/info/pages/minecraft/index.js @@ -4,23 +4,48 @@ import WCard from "../../components/werefox-card"; import axios from "axios"; export const getPlugins = async () => - await axios.get("http://192.168.0.202:8111/api/plugins/list").then( - (result) => { - return result.data; - }, - (error) => { - console.log(error); - return null; - } - ); + await axios + .get("http://192.168.0.202:8111/api/plugins/list", { + headers: { + authorization: + "rawCvRhEhSJR9TDo9Snw25ZyNYzTKERMsZSVbseqMTyh957JhpbhspderiUAzb7d", + }, + }) + .then( + (result) => { + return result.data; + }, + (error) => { + console.log(error); + return null; + } + ); + +export const getInfo = async () => + await axios + .get("http://192.168.0.202:8111/api/server", { + headers: { + authorization: + "rawCvRhEhSJR9TDo9Snw25ZyNYzTKERMsZSVbseqMTyh957JhpbhspderiUAzb7d", + }, + }) + .then( + (result) => { + return result.data; + }, + (error) => { + console.log(error); + return null; + } + ); // Grab data from a static YAML file export async function getStaticProps() { const fs = require("fs"); const yaml = require("js-yaml"); let INTRODUCTION = {}; - const promise = getPlugins(); - const plugins = await Promise.resolve(promise); + const info = await Promise.resolve(getInfo()); + const plugins = await Promise.resolve(getPlugins()); const plugins_sorted = plugins.plugins .map((p) => { return p[0].toUpperCase() + p.substr(1); @@ -40,11 +65,16 @@ export async function getStaticProps() { props: { INTRODUCTION, plugins_list: plugins_sorted, + server_info: info, }, }; } -export default function Minecraft({ plugins_list, INTRODUCTION }) { +export default function Minecraft({ plugins_list, server_info, INTRODUCTION }) { + const server_info_keys = { + serverVersion: "Server Version", + serverBukkitVersion: "Bukkit Version", + }; return ( + + {Object.keys(server_info_keys).map((key) => ( +
+ {server_info_keys[key]}: {server_info[key]} +
+ ))} +
{Object.keys(plugins_list).map((plugin) => (