phpBB Forum

It is currently Mon 21. May 2012, 09:54

All times are UTC + 1 hour

Forum rules


Hello dearest user and welcome to our EQDKP-Plus support forum.

Please read the following rules and terms before posting anything! Failure in doing so will result in being ignored or being banned. Posting in our boards means you have read, understood and accepted those rules.

English Board Rules – Click here



Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
Offline
 Post subject: Alpha Test - Mumble Portal Module
PostPosted: Tue 20. Jul 2010, 19:52 

Joined: Sun 9. May 2010, 18:24
Posts: 30
I have written a Mumble Portal module which will take a qStat XML file and display your server info.

This is currently ALPHA status code, and is only recommended for use by developers for the purpose of adding functionality, cleaning up the code, or if you are so desperate for a mumble status that you are willing to live with your entire site blowing up unexpectedly.

Attachment:
File comment: Shot of the Mumble Portal Module.
mumble-portal.png
mumble-portal.png [ 76.55 KiB | Viewed 2808 times ]


It has tooltips which show additional information, for example this one shows the ping and host:port of the server.
Attachment:
File comment: Tooltip when hovering over the Online Icon.
mumble-online-tooltip.png
mumble-online-tooltip.png [ 140.82 KiB | Viewed 2808 times ]

This is different from all the other Mumble Web Status that currently exist since it does not rely on having the Murmur server as well as ICE on the same machine as your Website.

Specifically we use the third party host MultiPlay to host our Mumble Server, and they use the industry standard qStat program to provide the XML output.

Multiplay Mumble Servers

While there are other Mumble providers out there, we chose this one due to the fact that Multiplay has a long history of providing both game and voice servers, and have a presence in many US and International data centers.

Setup is very straight forward:
Attachment:
File comment: Mumble Settings Window.
mumble-settings.png
mumble-settings.png [ 135.99 KiB | Viewed 2808 times ]

Custom Title for Block Header: The top title for the block.

The server name for the Connect link: this is inserted into the URL and is used for the label of the server when you drag and drop it into the Mumble Server Connect window. Any spaces or special characters must use html notation.

The website name for the Connect link: this is inserted into the URL and is used for the website when you drag and drop it into the Mumble Server Connect window.

Link to the Mumble Setup help: you can link to the official Mumble documentation, or to your own custom Infopage with setup instructions.

Enter the Link to the Mumble XML: the most important setting, this must be the complete URL to the qStat XML file.

Multiplay provides instructions on how to create your own URL that points to your server's XML in this Multiplay Knowledgebase Article. Any Mumble provider that uses qStat should be able to provide a link to the XML.

See the post below for details and archive.



Top
 Profile  
 
Offline
 Post subject: Re: Alpha Test - Mumble Portal Module
PostPosted: Tue 20. Jul 2010, 19:56 

Joined: Sun 9. May 2010, 18:24
Posts: 30
Here is an example of the Input XML, with my personal information blocked out.
Code:
<qstat>
  <server type="TS3" address="xx.xx.xx.xx:nnnn" status="UP">
    <hostname>xx.xx.xx.xx:nnnn</hostname>
    <name>Obscure Reference Guild House</name>
    <gametype/>
    <map>N/A</map>
    <numplayers>4</numplayers>
    <maxplayers>35</maxplayers>
    <numspectators>0</numspectators>
    <maxspectators>0</maxspectators>
    <ping>74</ping>
    <retries>0</retries>
    <rules>
        <rule name="_queryport">nnnn</rule>
        <rule name="hostport">nnnn</rule>
        <rule name="virtualserver_port">nnnn</rule>
        <rule name="virtualserver_status">online</rule>
    </rules>
    <players></players>
  </server>
</qstat>


This is the main module.php, I don't know much PHP so I hacked it together as well as I could. Improvements from those more knowledgeable would be greatly appreciated!

Code:
<?php
/*
 * Project:     EQdkp-Plus
 * License:     Creative Commons - Attribution-Noncommercial-Share Alike 3.0 Unported
 * Link:      http://creativecommons.org/licenses/by-nc-sa/3.0/
 * -----------------------------------------------------------------------
 * Began:       2008
 * Date:        $Date$
 * -----------------------------------------------------------------------
 * @author      $Author$
 * @copyright   2006-2008 Corgan - Stefan Knaak | Wallenium & the EQdkp-Plus Developer Team
 * @link        http://eqdkp-plus.com
 * @package     eqdkp-plus
 * @version     $Rev$
 *
 * $Id$
 */

if ( !defined('EQDKP_INC') ){
    header('HTTP/1.0 404 Not Found');exit;
}

// You have to define the Module Information
$portal_module['mumble'] = array(                      // the same name as the folder!
         'name'             => 'Mumble-Module',             // The name to show
         'path'             => 'mumble',                     // Folder name again
         'version'          => '1.0.2',                          // Version
         'author'        => 'HEX',                      // Author
         'contact'          => 'http://www.eqdkp-plus.com',      // email adress
         'description'   => 'Show Mumble Server Status',           // Detailed Description
         'positions'     => array('left1', 'left2', 'right', 'middle'), // Which blocks should be usable? left1 (over menu), left2 (under menu), right, middle                         
      'install'       => array(
                                     'autoenable'        => '0',    // 0 = disable on install , 1 = enable on install
                                     'defaultposition'   => 'left1',// see blocks above
                                     'defaultnumber'     => '0',    // default ordering number
                                     'visibility'        => '0',    // 0 = all users, 1 = guests only, 2 = signed in only
                                     'collapsable'       => '1',    // Module Collapsable or not? Default == 1
                                  ),
    );

/* Define the Settings if needed

name:       The name of the Database field & Input name
language:   The name of the language string in the language file
property:   What type of field? (text,checkbox,dropdown,textarea,multiselect)
size:       Size of the field if required (optional)
rows:       Rows for textarea, only needed there!
help:       Shows a "?" Icon after the Settings String wichs show on Mouseover a Help Tooltip with the "Help" String!
options:    If dropdown/multiselect: array('value'=>'Name')
codeinput:  If true, html code is not striped out of the textarea. only working in textareas until now

There could be unlimited amount of settings
Settings page is created dynamically
*/
$portal_settings['mumble'] = array(
  'pk_mumble_headtext'     => array(
        'name'      => 'pk_mumble_headtext',
        'language'  => 'pk_mumble_headtext',
        'property'  => 'text',
        'size'      => '30',
        'help'      => 'pk_mumble_headhelp',
      ),
  'pk_mumble_servername'     => array(
        'name'      => 'pk_mumble_servername',
        'language'  => 'pk_mumble_servername',
        'property'  => 'text',
        'size'      => '30',
        'help'      => 'pk_mumble_servernamehelp',
      ),
  'pk_mumble_website'     => array(
        'name'      => 'pk_mumble_website',
        'language'  => 'pk_mumble_website',
        'property'  => 'text',
        'size'      => '30',
        'help'      => 'pk_mumble_websitehelp',
      ),
  'pk_mumble_setup'     => array(
        'name'      => 'pk_mumble_setup',
        'language'  => 'pk_mumble_setup',
        'property'  => 'textarea',
        'size'      => '60',
        'cols'      => '1',
        'help'      => 'pk_mumble_setuphelp',
        'codeinput' => false,
      ),
  'pk_mumble_xmlinput'     => array(
        'name'      => 'pk_mumble_xmlinput',
        'language'  => 'pk_mumble_xmlinput',
        'property'  => 'textarea',
        'size'      => '60',
        'cols'      => '1',
        'help'      => 'pk_mumble_xmlinputhelp',
        'codeinput' => true,
      )
);

// The output function
// the name MUST be FOLDERNAME_module, if not an error will occur
if(!function_exists(mumble_module)){
  function mumble_module(){
     global $eqdkp , $user , $tpl, $db, $plang, $conf_plus, $eqdkp_root_path;

     // Set the output: If custom one is entered in the setting output this one
     // $conf_plus for config values, $plang for language values
     $mumble = ($conf_plus['pk_mumble_xmlinput']) ? html_entity_decode(htmlspecialchars_decode($conf_plus['pk_mumble_xmlinput'])) : $plang['portal_mumble_text'];

$xml = simplexml_load_file($mumble);

if ( $xml->server->rules->rule[3] == "online" ) {
   $mumble_status = "<img src='$eqdkp_root_path/portal/mumble/images/network-online.png' title='Server is Online with a ping of " . $xml->server->ping . "ms.    Host:Port    " . $xml->server->hostname . "'> Online";
}   else {
   $mumble_status = "<img src='$eqdkp_root_path/portal/mumble/images/network-offline.png' title='Server is Offline.'> Offline";
}


     // Start the Output
     // DO NOT USE ECHO()!
     // You can use HTML if you want.
      $DKPInfo = "<table width='100%'' border='0' cellspacing='1' cellpadding='2' class='noborder'>
    <tr><th colspan=2 align='center'>" . $xml->server->name . "</th></tr>
    <tr><td class=row1 align='center'><a href=mumble://" . $xml->server->hostname . "/?version=1.2.0&title=" . $conf_plus['pk_mumble_servername'] . "&url=" . $conf_plus['pk_mumble_website'] . "><img src='$eqdkp_root_path/portal/mumble/images/internet.png' title='If you have Mumble installed, Click here to Connect. You can Drag and Drop this into the Mumble Server Connect Box to make a Permanent Entry.'> Connect</a></td>
    <td class=row1 align='center'>" . $mumble_status . "</td></tr>
    <tr><td class=row2 align='center'><img src='$eqdkp_root_path/portal/mumble/images/icons_talking_on.png' title='Connected Users'> " . $xml->server->numplayers . "</td>
    <td class=row2 align='center'><img src='$eqdkp_root_path/portal/mumble/images/icons_talking_off.png' title='Maximum Users'> " . $xml->server->maxplayers . "</td></tr>
    <tr><td class=row1 align='center'><a href=http://mumble.sourceforge.net target=_blank><img src='$eqdkp_root_path/portal/mumble/images/mumble.png' title='Download and Install Mumble, see the Setup Instructions.'> Get Mumble</a></td>
    <td class=row1 align='center'><a href=" . $conf_plus['pk_mumble_setup'] . "><img src='$eqdkp_root_path/portal/mumble/images/setup.png' title='Mumble Voice Chat Setup walkthrough with screenshots.'> Setup Instructions</a></td></tr>
    </table>";
         
      
      // OPTIONAL
      // If you want to modify the header, use the following
      // JS Script Trick (txt+ID in this case: txtmumble
      if($conf_plus['pk_mumble_headtext']){
        $DKPInfo .= "<script>document.getElementById('txtmumble').innerHTML = '".addslashes($conf_plus['pk_mumble_headtext'])."'</script>";
      }

    // return the output for module manager
      return $DKPInfo;
  }
}
?>


And finally the language\english.php sorry no translations into other languages yet! This could use some cleanup and expansion on the help sections.

Code:
<?php
/*
 * Project:     EQdkp-Plus
 * License:     Creative Commons - Attribution-Noncommercial-Share Alike 3.0 Unported
 * Link:      http://creativecommons.org/licenses/by-nc-sa/3.0/
 * -----------------------------------------------------------------------
 * Began:       2008
 * Date:        $Date$
 * -----------------------------------------------------------------------
 * @author      $Author$
 * @copyright   2006-2008 Corgan - Stefan Knaak | Wallenium & the EQdkp-Plus Developer Team
 * @link        http://eqdkp-plus.com
 * @package     eqdkp-plus
 * @version     $Rev$
 *
 * $Id$
 */

if ( !defined('EQDKP_INC') ){
    header('HTTP/1.0 404 Not Found');exit;
}

$plang = array_merge($plang, array(
  'mumble'                 => 'Hello World',
  'portal_mumble_text'     => 'Error: You MUST enter a link to the Mumble XML',
  'pk_mumble_xmlinput'   => 'Enter the Link to the Mumble XML',
  'pk_mumble_xmlinputhelp'   => 'A link to the qStat Mumble XML file.',
  'pk_mumble_setup'   => 'Link to the Mumble Setup help.',
  'pk_mumble_setuphelp'   => 'A link to the Mumble setup help document. You can use http://mumble.sourceforge.net/Mumbleguide if you do not have your own.',
  'pk_mumble_headtext'     => 'Custom Title for Block Header.',
  'pk_mumble_headhelp'     => 'This text should not include any html.',
  'pk_mumble_servername'     => 'The server name for the Connect link.',
  'pk_mumble_servernamehelp'     => 'This text should not include any html.',
  'pk_mumble_website'     => 'The website name for the Connect link.',
  'pk_mumble_websitehelp'     => 'This text should not include any html.',
));
?>


Attachments:
File comment: The Portal Module
mumble.zip [21.99 KiB]
Downloaded 260 times

Top
 Profile  
 
Offline
 Post subject: Re: Alpha Test - Mumble Portal Module
PostPosted: Thu 22. Jul 2010, 12:21 

Joined: Wed 21. Jul 2010, 10:27
Posts: 21
Hello,

I tried to put this in plugind dir. But when i try to go managa plugins in admin console, it says "Initialization: Plugin "mumble" could not be initialized."

Is there something to be done to install this ?



Top
 Profile  
 
Offline
 Post subject: Re: Alpha Test - Mumble Portal Module
PostPosted: Thu 22. Jul 2010, 12:22 
Core-Developer
User avatar

Joined: Fri 15. May 2009, 19:32
Posts: 3458
mumble is not a plugin, but a portal-module. Put it into the portal-folder!


Greetings, GodMod
---
Schreibt mir nie unaufgefordert PNs! - Never write me unrequested PMs!

Support my work:Image



Top
 Profile  
 
Offline
 Post subject: Re: Alpha Test - Mumble Portal Module
PostPosted: Thu 22. Jul 2010, 12:34 

Joined: Wed 21. Jul 2010, 10:27
Posts: 21
cheers, thank you



Top
 Profile  
 
Offline
 Post subject: Re: Alpha Test - Mumble Portal Module
PostPosted: Thu 22. Jul 2010, 15:01 

Joined: Sun 9. May 2010, 18:24
Posts: 30
alfa: Please let me know how it works for you. Who provides your Mumble server?

GodMod: Thanks for taking the time to answer.



Top
 Profile  
 
Offline
 Post subject: Re: Alpha Test - Mumble Portal Module
PostPosted: Thu 22. Jul 2010, 16:32 
Core-Developer
User avatar

Joined: Wed 10. Dec 2008, 12:52
Posts: 4536
Location: Hannover - Germany
cool
thanxs hex

if im back in business, i test the modul. if it works fine, we can think about to implement it into the next release.

greetz Stefan


EQdkp-Plus Project Lead
- Schreibt mir nie unaufgefordert PNs oder Emails! - Dont write me emails/pm!
- Schickt mir keine Zugangsdaten! Dont send me login infomations!
- Gebt immer eure EQdkp Version und einen Link zu eurer Seite an! We need your EQdkp Version and a link to your Site!
- Lest die Forenregeln!! - Read the Board Rules!



Top
 Profile  
 
Offline
 Post subject: Re: Alpha Test - Mumble Portal Module
PostPosted: Thu 22. Jul 2010, 18:06 

Joined: Sun 9. May 2010, 18:24
Posts: 30
Thanks Corgan, I will be glad to provide via PM the link to my personal Multiplay hosted XML to you or the other developers for testing purposes.



Top
 Profile  
 
Offline
 Post subject: Re: Alpha Test - Mumble Portal Module
PostPosted: Tue 3. Aug 2010, 06:04 

Joined: Sun 9. May 2010, 18:24
Posts: 30
I have used this for several weeks without any code changes, and I see it has been downloaded 3 times, any feed back from alpha testers?



Top
 Profile  
 
Offline
 Post subject: Re: Alpha Test - Mumble Portal Module
PostPosted: Tue 5. Oct 2010, 23:06 

Joined: Wed 16. Sep 2009, 23:26
Posts: 37
Really like the design and idea. There's really one issue, that you are using simplexml_load_file to snag the XML.

This unfortunally requires allow_url_fopen, which many many host have disabled due to security reasons.

Working wonderful on my test server as it is though, 10/10 for that :)


As for the code using Curl instead, here's what I use right now, maybe you want to implement it as an option. And yeah, it works ;)
Code:
if (init_get('allow_url_fopen')) {
$xml = simplexml_load_file($mumble);
}
ELSE {
$ch = curl_init($mumble);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$xml_raw = curl_exec($ch);
$xml = simplexml_load_string($xml_raw);
}



Edit: Changed it a bit. Basicly, now it will use simplexml_load_file if it is allowed, else use Curl.


EQDKP+ site: http://www.heroesofthealliance.org
EQDKP+ Version: 0.6.4.3
PHPinfo: http://www.heroesofthealliance.org/phpinfo.php



Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

(C) The EQdkp-Plus Developer Team
EQdkp Plus Template by Ramon Kaes