Username:    Password:        Click Here To Signup     Forgotten Password
Main Menu
Online
Members: 0

Guests: 19

111.202.x.x news
202.51.x.x news
207.46.x.x forum
3.80.x.x forum
34.220.x.x news
46.229.x.x forum
46.229.x.x dilbertplus
46.229.x.x forum
46.229.x.x forum
46.229.x.x forum
46.229.x.x forum
46.229.x.x forum
46.229.x.x forum
46.229.x.x forum
46.229.x.x forum
46.229.x.x forum
46.4.x.x forum
74.208.x.x forum
78.46.x.x forum

Last Seen

mrstipfan Wed 19:48
Gagi2 Mon 16:30
EFiNST0RM Sun 15:39
85filip58 Sun 12:14
brlight Tue 04:18

Newest Members

Forums
Mumble support added
Wussie
Wed Dec 26 2012, 07:31PM

Posts: 437
Joined: Sun Mar 22 2009, 06:53AM
Registered Member #4938
This function is tested with Mumble / Murmur servers version 1.2.0 - 1.2.3 and it works ONLY with servers running the GTMurmur plugin installed.
The servers respond to a TCP query, using the Channel Viewer Protocol, in either JSON or XML format. We will use JSON.

Installation: start out with the original, unmodified lgsl_protocol.php; after
"mta" => "Multi Theft Auto",
insert
"mumble" => "Mumble",

then, after
"mta" => "08",
insert
"mumble" => "34",
(make sure you change "34" to something higher if "34" is already in use)
after
"mta" => "http://en.wikipedia.org/wiki/Multi_Theft_Auto",
insert
"mumble" => "mumble://{IP}/",

after
case "mta" : $c_to_q = 123; $c_def = 22003; $q_def = 22126; $c_to_s = 0; break;
insert
case "mumble" : $c_to_q = 0; $c_def = 64738; $q_def = 27800; $c_to_s = 0; break;

Then edit the line
elseif ($lgsl_function == "lgsl_query_30")
and replace with
elseif ($lgsl_function == "lgsl_query_30" || $lgsl_function == "lgsl_query_34")

Then, BEFORE
function lgsl_query_feed(&$server, $request, $lgsl_feed_method, $lgsl_feed_url)
insert
function lgsl_query_34(&$server, &$lgsl_need, &$lgsl_fp)
{
// Works only with servers running the GTMurmur plugin
fwrite($lgsl_fp, "json"); // JSON query
$buffer = '';
while ($part = fread($lgsl_fp, 4096)) { $buffer .= $part; }
if (strlen($buffer) < 300) { return FALSE; }

$data = json_decode($buffer, TRUE);
if (!isset($data['x_gtmurmur_server_version'])) { return FALSE; }
$server['s']['name'] = $data['name'];
$server['s']['map'] = 'Mumble';
$server['s']['playersmax'] = $data['x_gtmurmur_max_users'];
$server['e']['connectport'] = $data['x_gtmurmur_connectport'];
$server['e']['version'] = $data['x_gtmurmur_server_version'];

if (substr($buffer, -2) != "\n}") { return TRUE; } else { unset($buffer); }
$server['e']['motd'] = strlen($data['root']['description']) < 800 ? $data['root']['description'] : '';

$i = 0;
foreach ($data['root']['users'] as $user) {
$server['p'][$i]['name'] = $user['name'];
$server['p'][$i]['time'] = lgsl_time($user['onlinesecs']); $i++;
}
$data = $data['root']['channels'];
$j = 0;
while (isset($data[$j])) {
if (!empty($data[$j]['channels'])) {
foreach ($data[$j]['channels'] as $channel) { $data[] = $channel; }
}
unset($data[$j]['channels']); $j++;
}
$server['e']['channels'] = count($data);
foreach ($data as $channel) {
foreach ($channel['users'] as $user) {
$server['p'][$i]['name'] = $user['name'];
$server['p'][$i]['time'] = lgsl_time($user['onlinesecs']); $i++;
}
unset($channel);
}
$server['s']['players'] = $i;
return TRUE;
}
//------------------------------------------------------------------------------------------------------------+
//------------------------------------------------------------------------------------------------------------+

Let me point this out again: make sure you change "34" to something higher if "34" is already in use (if you already have custom functions added to lgsl_protocol.php) !

When adding servers to the db, it's essential you get the query port right: if c_port is around 64738, the default q_port seems to be 27800, but some admins set it from 30000 up.
If your c_port is around 10000, it's a good idea to try q_port=c_port+20000.
Once you got the query port right, LGSL will report the correct "connectport" for verification.

Let me know IP's and ports if you find any bugs. Enjoy!

Not working for you?
Don't forget to share the IP/ports of the offending server so that people can do tests and help you.
Oh, and if you're using a modified lgsl_protocol.php, make sure you disable the feed or it may NOT work!
Website
abc123456
Sat May 26 2018, 03:18AM
Posts: 102
Joined: Sat May 26 2018, 03:12AM
Registered Member #8888
[ REQUIRES ADMIN APPROVAL ]
 

Jump:     Back to top


You are not logged in - Click Here To Signup

Username:    Password:   

Mini Buttons

.... © GreyCube.com - Richard Perry - Powered by e107.org