This repository was archived by the owner on Feb 1, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmumble.inc.php
More file actions
92 lines (82 loc) · 1.76 KB
/
mumble.inc.php
File metadata and controls
92 lines (82 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<?php
require_once('server.inc.php');
require_once('class_base.inc.php');
class CMumble extends CClassBase
{
var $Base=null;
var $Meta=null;
var $Servers=null;
function &GetBaseRef()
{ return $this->Base; }
function &GetMetaRef()
{ return $this->Meta; }
function &GetServersRef()
{ return $this->Servers; }
function Init($Host='127.0.0.1',$Port=6502,$ProxyParams='')
{
global $ICE;
$this->Base = $ICE->stringToProxy('Meta:tcp -h '.$Host.' -p '.$Port.' '.$ProxyParams);
$this->Meta = $this->Base->ice_checkedCast('::Murmur::Meta');
}
function LoadServers($OnlyBooted=true)
{
$this->Servers=array();
$RawServers=null;
if($OnlyBooted)
{
$RawServers=$this->Meta->getBootedServers();
}
else
{
$RawServers=$this->Meta->getAllServers();
}
$i=0;
foreach($RawServers AS $CurServer)
{
$this->Servers[$i]=new CServer();
$this->Servers[$i]->Init($CurServer,$this);
$i++;
}
}
function &GetServByID($ID)
{
settype($ID,'int');
foreach($this->Servers AS $Serv)
{
if($Serv->GetID()==$ID)
{ return $Serv; }
}
return $this->GetNullRef();
}
function &GetServByArrayPos($Pos)
{
settype($Pos,'int');
if(isset($this->Servers[$Pos]))
{
return $this->Servers[$Pos];
}
return $this->GetNullRef();
}
function NewServer($AddToArray=true)
{
$MumbleServer=$this->Meta->newServer();
if(!$MumbleServer)
{ return null; }
$Server=new CServer();
$Server->Init($MumbleServer,$this);
if($AddToArray)
{ $this->Servers[]=$Server; }
return $Server;
}
function GetDefaultConf()
{
return $this->Meta->getDefaultConf();
}
function GetVersion()
{
$Ret=array('major'=>0,'minor'=>0,'patch'=>0,'text'=>'');
$this->Meta->getVersion($Ret['major'],$Ret['minor'],$Ret['patch'],$Ret['text']);
return $Ret;
}
};
?>