Charged / Miners

An Game Engine and Minecraft Classic Client
charged-miners.com
87 stars 14 forks source link

Add support for ClassiCube.net sign-in, server list parsing, and play page parsing. #56

Open mstefarov opened 11 years ago

mstefarov commented 11 years ago

Sign-in procedure:

Server list URL: http://www.classicube.net/server/list

Server list format (excerpt):

    <table id="servers">

        <tr class="server">
            <td>
                <strong><a href="/server/play/SERVER_HASH">SERVER_NAME</a></strong>

                <div style="display:none;">
                    <small><strong><a href="/server/play/SERVER_HASH">Play</a></strong> | <strong><a href="/server/play/SERVER_HASH?fullscreen=true">Fullscreen</a></strong> | <strong><a href="mc://SERVER_IP:SERVER_PORT/USERNAME/SERVER_MPPASS">Direct</a></strong></small>
                </div>
                <noscript>
                <div>
                    <small><strong><a href="/server/play/SERVER_HASH">Play</a></strong> | <strong><a href="/server/play/SERVER_HASH?fullscreen=true">Fullscreen</a></strong> | <strong><a href="mc://SERVER_IP:SERVER_PORT/USERNAME/SERVER_MPPASS">Direct</a></strong></small>
                </div>
                </noscript>

            </td>
            <td class="players">[SERVER_PLAYERS/SERVER_CAPACITY]</td>
        </tr>

    </table>

Play page URL: http://www.classicube.net/server/play/SERVER_HASH

Play page format (excerpt):

                    <param name="mppass" value="SERVER_MPPASS">
                    <param name="username" value="USERNAME">
                    <param name="server" value="SERVER_IP">
                    <param name="port" value="SERVER_PORT">
ghost commented 10 years ago

Out of curiosity, @fragmer, how come you guys don't have a JSON API for ClassiCube login? Parsing HTML with regexes is messy and prone to breaking. It'd make integration a lot easier too.

Sure, the Minecraft login might be HTML, but you guys are better than that! You're extending functionality, so why not make logging in just as easy? :shipit:

ecp4224 commented 10 years ago

I have to agree with this, this is a poor web API for ClassiCube. If you want more support for ClassiCube seen in more software, you're gonna have to do better.

The reason HTML scrapping was done in minecraft classic was simple, it _had_ to be done. Mojang did not and was not planning on giving us an easy API to work with. This is different with ClassiCube and should be. If you want software developers to support ClassiCube, you have to make it easy for them, otherwise they just won't bother.

andrewphorn commented 10 years ago

Good points! I have plans to add an API page for login, which is currently the only thing the client needs that isn't available via the API.

The serverlist (complete, with mppasses and uptimes and everything) is available via /api/serverlist.

If you fellas want to hang out on our irc - #classicube on irc.esper.net - you can suggest other things that ClassiCube should have.

mstefarov commented 10 years ago

Instead of attempting to make changes to Charged-Miners (which is effectively a dead project), I created a new launcher instead, that handles classicube support.

Project page: https://github.com/Charged/CCChargedMinersLauncher

Download (Win): http://cm-cdn.fcraft.net/launcher/ChargedMiners01.exe Download (Linux): http://cm-cdn.fcraft.net/launcher/ChargedMiners01.jar