From b9210e596551187dd2efbddafc12bc4c24e2d7a8 Mon Sep 17 00:00:00 2001 From: magmaus3 Date: Wed, 12 Jul 2023 14:03:04 +0200 Subject: [PATCH] init --- index.css | 48 ++++++++++++++++++++++++++++++++++++++ index.php | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 118 insertions(+) create mode 100644 index.css create mode 100644 index.php diff --git a/index.css b/index.css new file mode 100644 index 0000000..13d1763 --- /dev/null +++ b/index.css @@ -0,0 +1,48 @@ +body { + display: flex; + flex-direction: column; + justify-content: center; + background-color: #20202a; + color: white; + font-family: sans-serif; +} + +table { + font-size: large; + border-collapse: collapse; + /* color: black */ +} + +thead { + border-collapse: separate; + background-color: rgba(255, 255, 255, 0.1); +} +th { + border: 1px solid black; +} +td { + padding: 0.2em; + text-align: center; +} +tr { + border: 1px solid black; + background-color: rgba(255, 255, 255, 0.05); +} + +tr:hover { + background-color: rgba(255, 255, 255, 0.1); +} + +td .nogames { + width: 100%; +} + +.status_code { + color: whitesmoke; + padding: 0.2em; +} + +.error { + font-size: larger; + font-weight: 900; +} diff --git a/index.php b/index.php new file mode 100644 index 0000000..0dd80d4 --- /dev/null +++ b/index.php @@ -0,0 +1,70 @@ + +array( + 'method'=>"GET", + 'header'=>"User-Agent: pgg-room-viewer_php +mailto:magmaus3@disroot.org \r\n" + ) +); + +$context = stream_context_create($opts); + +// Here you can change the URL of the server +$data = file_get_contents("http://pgg-server.glitch.me/scripts/getrooms.php", false, $context); +?> + + + + + + + + +

List of active games.

+

Note that if a person exits their flash player without exiting the room first, + the room will be visible on the list but it'll be impossible to join it.

+ Request failed. You may want to try to reload the page"; +} else { + echo " + + + "; + + parse_str($data, $arr); + if ($arr['cant'] != "0") { + foreach (range(0, $arr['cant']-1) as $i) { + $i = strval($i); + echo " + + + + + + + + + "; + }; + } else { + echo " + + + "; + } + echo " + +
Name + Players + Password + PvP + Edit + Country + Gamemode +
" . $arr["roomname$i"] . "" . $arr["players$i"] . "/" . $arr["maxplayers$i"] ."idk" . $arr["pvp$i"] . "" . $arr["edit$i"]. "" . $arr["country$i"] . "" . $arr["gamemode$i"] . "
No active games
+"; +} +?> + +