Page 1 of 9 123 ... LastLast
Results 1 to 10 of 84
  1. #1
    Kafes's Avatar
    Join Date
    Dec 2010
    Posts
    43
    Thumbs Up
    Received: 0
    Given: 0

    Players online

    Hi, i was able to put my server status on my forum.If the server is online it shows an image if its offline it shows another image.

    Anyways, i was wondering if i could do the same thing, but in another matter.I would like it to show how many players are online.Not with an image but numbers anyways.Just like in the server clanforge panel.It says "players 8/15 on world"
    How could i place this on my forum? So that we can get an auto updated player status of the server.

    Thanks!

    0 Not allowed!

  2. #2
    Sven Co-op CL Community Admin! AdamR's Avatar
    Join Date
    Feb 2007
    Location
    Cardiff, South Wales
    Posts
    2,647
    Thumbs Up
    Received: 42
    Given: 15
    You can get an XML feed of your active servers at this URL:
    Code:
    http://clanforge.multiplay.co.uk/public/servers.pl?event=Online;opt=ServersXmlList;accountserviceid=YOUR_MH_NUMBER_HERE;fake=servers.xml
    Replace YOUR_MH_NUMBER_HERE with your ClanForge MH number. You can find this at the top left of the ClanForge web page, in the list box next to Account. Do not include the MH letters. Do not tell anyone else what your MH number is, only Multiplay support staff will ever need that from you to fix something.

    I wrote some PHP to parse it, output is here. I'll share if needed, but you'll need to edit/fix it yourself for your site.

    0 Not allowed!
    Last edited by AdamR; 26th December 2010 at 22:56.
    Thanks,

    Adam Reece
    | Multiplay Online Sven Co-op community liaison

    WWW: sc.multiplay.co.uk
    Email: adam @t multiplay d0t org
    IRC: #mpuksc at QuakeNet
    FB: adam.reece


    The views expressed above are those of the poster and not those of Multiplay UK.

  3. #3
    Kafes's Avatar
    Join Date
    Dec 2010
    Posts
    43
    Thumbs Up
    Received: 0
    Given: 0
    Doesn't seem to work.It only gives me
    <qstat>
    </qstat>


    Anyways, i'm not a professional at these things.Isn't there a simple way to show online player amount or even online player names?

    Please? Thanks for replies.

    0 Not allowed!

  4. #4
    Sven Co-op CL Community Admin! AdamR's Avatar
    Join Date
    Feb 2007
    Location
    Cardiff, South Wales
    Posts
    2,647
    Thumbs Up
    Received: 42
    Given: 15
    Your server is running right now?

    0 Not allowed!
    Thanks,

    Adam Reece
    | Multiplay Online Sven Co-op community liaison

    WWW: sc.multiplay.co.uk
    Email: adam @t multiplay d0t org
    IRC: #mpuksc at QuakeNet
    FB: adam.reece


    The views expressed above are those of the poster and not those of Multiplay UK.

  5. #5
    Kafes's Avatar
    Join Date
    Dec 2010
    Posts
    43
    Thumbs Up
    Received: 0
    Given: 0
    It was shut down , sorry.I turned it on and it worked.Anyways, i do not know what to do with these infos.Might be my stupidity.

    <qstat>

    <server type="A2S" address="188.138.40.99:26575" status="UP">
    <hostname>188.138.40.99</hostname>
    <name>Multiplay :: raftt</name>
    <gametype>minecraft</gametype>
    <map>world</map>
    <numplayers>0</numplayers>
    <maxplayers>15</maxplayers>
    <numspectators>0</numspectators>
    <maxspectators>0</maxspectators>
    <ping>19</ping>
    <retries>0</retries>
    </server>
    </qstat>

    0 Not allowed!

  6. #6
    Administrator liv3d's Avatar
    Join Date
    Jan 1970
    Location
    Southampton
    Posts
    2,316
    Thumbs Up
    Received: 158
    Given: 126
    You need to use something like PHP to read the info & create pretty information about your server. I don't believe player lists currently work using the query protocol (A2S). You could use Half-Life (2) based rcon tool and run a playerlist command on the serve,r to get players connected (same way live control does)

    0 Not allowed!

    If you're asking a Multiplay question and want the official answer, always raise a ticket or call the office
    The views expressed in the above post are mine alone and not necessarily those of Multiplay UK or anyone else.

    @liv3d

  7. #7
    Kafes's Avatar
    Join Date
    Dec 2010
    Posts
    43
    Thumbs Up
    Received: 0
    Given: 0
    Thank you everybody

    0 Not allowed!

  8. #8
    Sven Co-op CL Community Admin! AdamR's Avatar
    Join Date
    Feb 2007
    Location
    Cardiff, South Wales
    Posts
    2,647
    Thumbs Up
    Received: 42
    Given: 15
    Here is some very simple PHP code that will parse the XML file into a table.

    • Paste it into any PHP file you like
    • I expect you have your own style sheet already done
    • The link to join the game probably doesn't work, I don't actually know how they are built (guessed)

    PHP Code:
    <?php
        $accountNumber 
    YOUR_MH_NUMBER_HERE_WITHOUT_THE_MH_LETTERS;
        
    $gameServers = array();
        
    $currentServer null;

        
    $XMLReader = new XMLReader();
        
    $XMLReader->open("http://clanforge.multiplay.co.uk/public/servers.pl?event=Online;opt=ServersXmlList;accountserviceid=${accountNumber};fake=servers.xml");

        while (
    $XMLReader->read())
        {
            
    $name $XMLReader->name;
            
    $value $XMLReader->readString();

            switch (
    $name)
            {
                case 
    "#text":
                case 
    "qstat":
                    break;

                case 
    "server":
                    if (
    $currentServer != $XMLReader->getAttribute('address'))
                        
    $currentServer $XMLReader->getAttribute('address');

                    if (!
    array_key_exists($currentServer$gameServers))
                    {
                        
    $gameServers [$currentServer]= array(
                            
    'name' => '',
                            
    'address' => $XMLReader->getAttribute('address'),
                            
    'gametype' => '',
                            
    'status' => $XMLReader->getAttribute('status'),
                            
    'ping' => 0,
                            
    'retries' => 0,
                            
    'map' => '_none',
                            
    'numplayers' => 0,
                            
    'maxplayers' => 0,
                            
    'numspectators' => 0,
                            
    'maxspectators' => 0,
                        );
                    }
                    break;

                default:
                    if (empty(
    $value))
                        break;

                    
    $gameServers[$currentServer][$name] = $value;
                    break;
            }
        }

        
    $XMLReader->close();

        if (
    count($gameServers) > 0)
        {
            foreach (
    $gameServers as &$server)
            {
                
    // Determine status
                
    if ($server['status'] == "DOWN" || $server['status'] == "TIMEOUT")
                {
                    
    $server['name'] = "Server is down";
                    
    $server['map'] = "N/A";
                }

                
    // Build server URL
                
    $serverURL "http://www.minecraft.net/play.jsp?server=" hash("md5"$server['address']);
    ?>
    <table>
        <tr>
            <th colspan="2"><?php echo $server['name']; ?></th>
        </tr>
        <tr>
            <td>Address</td>
            <td><b><a href="<?php echo $serverURL?>"><?php echo $server['address']; ?></a></b></td>
        </tr>
        <tr>
            <td>Status</td>
            <td><b><?php echo $server['status']; ?></b> (last pinged at <b><?php echo $server['ping']; ?></b> ms)</td>
        </tr>
        <tr>
            <td>Players</td>
            <td><b><?php echo $server['numplayers']; ?></b> player(s), <b><?php echo $server['maxplayers']; ?></b> maximum</td>
        </tr>
        <tr>
            <td>World name</td>
            <td><b><?php echo $server['map']; ?></b></td>
        </tr>
    </table>
    <?php
            
    }
        }
        else
            echo 
    "<p>\n\tUnable to receive server listing or no active/registered servers found.\n</p>";
    ?>

    0 Not allowed!
    Thanks,

    Adam Reece
    | Multiplay Online Sven Co-op community liaison

    WWW: sc.multiplay.co.uk
    Email: adam @t multiplay d0t org
    IRC: #mpuksc at QuakeNet
    FB: adam.reece


    The views expressed above are those of the poster and not those of Multiplay UK.

  9. #9
    Ninja Hair's Avatar
    Join Date
    Dec 2010
    Posts
    149
    Thumbs Up
    Received: 0
    Given: 0
    Much appreciated AdamR

    0 Not allowed!
    People ignore design that ignores people.

  10. #10
    Sven Co-op CL Community Admin! AdamR's Avatar
    Join Date
    Feb 2007
    Location
    Cardiff, South Wales
    Posts
    2,647
    Thumbs Up
    Received: 42
    Given: 15
    I forgot to mention -- would you mind showing examples of this code in action?

    0 Not allowed!
    Thanks,

    Adam Reece
    | Multiplay Online Sven Co-op community liaison

    WWW: sc.multiplay.co.uk
    Email: adam @t multiplay d0t org
    IRC: #mpuksc at QuakeNet
    FB: adam.reece


    The views expressed above are those of the poster and not those of Multiplay UK.

Page 1 of 9 123 ... LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. SERVER ISSUE
    By dzeekins in forum Minecraft
    Replies: 32
    Last Post: 10th November 2010, 19:37
  2. Server Crashes
    By Laire in forum BF:Bad Company 2
    Replies: 3
    Last Post: 12th March 2010, 03:27
  3. Replies: 62
    Last Post: 6th September 2007, 17:54
  4. UT Caught Cheaters
    By Neophyte in forum Anti-Cheat
    Replies: 3
    Last Post: 6th August 2006, 21:12
  5. Seting up FTP, Website and IRC Server...?
    By Leviathan in forum LAN Advice
    Replies: 17
    Last Post: 14th April 2002, 18:09

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Multiplay
© 2014 Multiplay
Terms & Conditions | Privacy Policy | Support
Contact Us | All rights reserved