Welcome to mirror list, hosted at ThFree Co, Russian Federation.

rubytest.rb « ice « server « scripts - github.com/mumble-voip/mumble.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3aca8a97da49b6e03038a6720f69555c84e3d707 (plain)
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
#!/usr/bin/env ruby

# Copyright 2013-2022 The Mumble Developers. All rights reserved.
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file at the root of the
# Mumble source tree or at <https://www.mumble.info/LICENSE>.


# Download Murmur.ice from
# http://mumble.git.sourceforge.net/git/gitweb.cgi?p=mumble;a=blob_plain;f=src/murmur/Murmur.ice;hb=HEAD
# and run 'slice2rb Murmur.ice'. slice2rb is part of ICE.
# This will generate the necessary 'Murmur.rb' file which needs to be included:

require 'Murmur.rb'

status = 0
ic = nil
begin
  ic = Ice::initialize(ARGV)
  base = ic.stringToProxy("Meta:tcp -h 127.0.0.1 -p 6502")
  meta = Murmur::MetaPrx::checkedCast(base)

  unless meta
    rais "invalid proxy"
  end

  # All commands are documented here:
  # http://mumble.sourceforge.net/slice/?title=slice

  servers = meta.getBootedServers
  puts "Server version:", meta.getVersion[3]

  servers.each do |server|
    puts ""
    puts "Server name:"+server.getConf('registername')

    channels = server.getChannels
    players = server.getPlayers

    players.each do |id,player|
      channel = channels[player.channel]
      puts player.name+" in "+channel.name
    end

  end

rescue
  puts $!
  puts $!.backtrace.join("\n")
  status = 1
end

if ic
  # Clean up
  begin
    ic.destroy()
  rescue
    puts $!
    puts $!.backtrace.join("\n")
    status = 1
  end
end

exit(status)