0
Hello, I am opening a Minecraft server (java game) and I came across the following need:
For each Minecraft server it is necessary to build an informative website. When building the site, I created a simple page with just the server team list. The team consists of "Helpers", "Moderators" and "Administrators". To assign one of these roles to a player, you need to enter a command within the game, which will then be validated in the config.yml file of the server.
This is the config.yml file that defines player status:
users:
JamesMarch:
group:
- Admin
TheCountess_:
group:
- Admin
mumiant_:
group:
- Moderador
Pequena20:
group:
- Ajudante
nana34piu:
group:
- Ajudante
What I was thinking was to create a php "reader", who would read the yaml code and the player positions on my site as follows:
<html>
<head>
<title>Alderaan Minecraft Server</title>
</head>
<body>
<h1>Staff</h1>
<h2>Administradores</h2>
<p>JamesMarch</p>
<p>TheCountess_</p>
<h2>Moderador</h2>
<p>mumiant_</p>
<h2>Ajudantes</h2>
<p>Pequena20</p>
<p>nana34piu</p>
</body>
</html>
I would also like the name of each member to appear in each staff paragraph, in alphabetical order, for example:
Administrators
- Jamesmarch
- Thecountess_
and not
Administrators
- Thecountess_
- Jamesmarch
I would also like, for example, if there is only one Administrator, appear "Administrator" and not "Administrators", example:
House there is an administrator:
Administrator
- Jamesmarch
House there are two or more administrators:
Administratores
- Jamesmarch
- Thecountess_
I wish it was possible too appear only the three posts on the web site, since the site has more than three positions, I liked that only the positions of "Administrator", "Moderator" and "Helper" appear on the page.
Finally, I wanted the ranks to appear by the hierarchy, example:
Right:
Administrators
Jamesmarch
Thecountess_
Moderator
- mumiant_
Helpers
nana34piu
Small20
Wrong:
Helpers
nana34piu
Small20
Administrators
Jamesmarch
Thecountess_
Moderator
- mumiant_
yaml-parse-file is the structured form of Yaml::parse correct?
– Don't Panic
@Everson I believe that
Yaml::parse
is a symfony package independent ofLibYAML
and http://pecl.php.net/package/yaml, for a look at the source-code: https://github.com/symfony/yaml/blob/master/Parser.php#L88– Guilherme Nascimento