2023-07-12 12:03:04 +00:00
|
|
|
<!DOCTYPE html>
|
2023-07-14 11:27:35 +00:00
|
|
|
<!--
|
|
|
|
Copyright 2023 magmaus3 <magmaus3@disroot.org>
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
-->
|
|
|
|
<?php
|
2023-07-12 12:03:04 +00:00
|
|
|
$opts = array(
|
|
|
|
'http'=>array(
|
|
|
|
'method'=>"GET",
|
2023-07-20 22:08:53 +00:00
|
|
|
'header'=>"User-Agent: pgg-room-viewer_php +https://git.magmaus3.eu.org/magmaus3/projectgungame-roomviewer-php \r\n"
|
2023-07-12 12:03:04 +00:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
$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);
|
2023-07-14 11:27:35 +00:00
|
|
|
parse_str($data, $arr);
|
2023-07-12 12:03:04 +00:00
|
|
|
?>
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<title></title>
|
|
|
|
<meta charset="UTF-8">
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
2023-07-12 12:18:10 +00:00
|
|
|
<link href="index.css" rel="stylesheet">
|
2023-07-12 12:03:04 +00:00
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<h1>List of active games.</h1>
|
|
|
|
<h2>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.</h2>
|
2023-07-14 11:27:35 +00:00
|
|
|
<table>
|
2023-07-12 12:03:04 +00:00
|
|
|
<thead>
|
|
|
|
<th>Name</td>
|
|
|
|
<th>Players</td>
|
|
|
|
<th>Password</td>
|
|
|
|
<th>PvP</td>
|
|
|
|
<th>Edit</td>
|
|
|
|
<th>Country</td>
|
|
|
|
<th>Gamemode</td>
|
|
|
|
</thead>
|
2023-07-14 11:27:35 +00:00
|
|
|
<tbody>
|
|
|
|
<?php
|
|
|
|
// php tags are indented in this way to
|
|
|
|
// prevent an issue with the whitespace on the
|
|
|
|
// resulting html
|
|
|
|
?>
|
|
|
|
<?php if ($arr['cant'] != "0") : ?>
|
|
|
|
<?php foreach (range(0, $arr['cant']-1) as $i): ?>
|
|
|
|
<tr>
|
|
|
|
<td class='roomname'><?= $arr["roomname$i"]?></td>
|
|
|
|
<td class='players'><?= $arr["players$i"] . "/" . $arr["maxplayers$i"] ?></td>
|
|
|
|
<td class='passwd'>idk</td>
|
|
|
|
<td class='pvp'><?= $arr["pvp$i"] ?></td>
|
|
|
|
<td class='edit'><?= $arr["edit$i"] ?></td>
|
|
|
|
<td class='country'><?= $arr["country$i"] ?></td>
|
|
|
|
<td class='gamemode'><?= $arr["gamemode$i"] ?></td>
|
|
|
|
</tr>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
<?php else : ?>
|
2023-07-12 12:03:04 +00:00
|
|
|
<tr>
|
|
|
|
<td colspan=7 class='nogames'>No active games</td>
|
2023-07-14 11:27:35 +00:00
|
|
|
</tr>
|
|
|
|
<?php endif; ?>
|
2023-07-12 12:03:04 +00:00
|
|
|
</tbody>
|
|
|
|
</table>
|
2023-07-14 11:27:35 +00:00
|
|
|
<footer>
|
|
|
|
<a href="https://git.magmaus3.eu.org/magmaus3/projectgungame-roomviewer-php">Source code</a>
|
|
|
|
</footer>
|
2023-07-12 12:03:04 +00:00
|
|
|
</body>
|
|
|
|
</html>
|