public ChannelManager(ServerPrx server, string channel)
        {
            m_server = server;

            // Update list of channels
            lock (chan_ids)
                foreach (var child in m_server.getTree().children)
                {
                    chan_ids[child.c.name] = child.c.id;
                }

            // Set channel if it was found, create it if it wasn't
            lock (chan_ids)
                if (chan_ids.ContainsKey(channel))
                {
                    parent_chan = chan_ids[channel];
                }
                else
                {
                    parent_chan = m_server.addChannel(channel, 0);
                }

            // Set permissions on channels
            Murmur.ACL[] acls = new Murmur.ACL[1];
            acls[0] = new Murmur.ACL(true, true, false, -1, "all",
                                     Murmur.PermissionSpeak.value, Murmur.PermissionEnter.value);

            m_log.DebugFormat("[MurmurVoice] Setting ACLs on channel");
            m_server.setACL(parent_chan, acls, null, true);
        }
示例#2
0
        public ChannelManager(ServerPrx server, string channel)
        {
            m_server = server;

            // Update list of channels
            lock (chan_ids)
                foreach (var child in m_server.getTree().children)
                {
                    chan_ids[child.c.name] = child.c.id;
                }

            // Set channel if it was found, create it if it wasn't
            lock (chan_ids)
                if (chan_ids.ContainsKey(channel))
                {
                    parent_chan = chan_ids[channel];
                }
                else
                {
                    parent_chan = m_server.addChannel(channel, 0);
                }

            // Set permissions on channels
            Murmur.ACL[] acls = new Murmur.ACL[1];
            acls[0]           = new Murmur.ACL();
            acls[0].group     = "all";
            acls[0].applyHere = true;
            acls[0].applySubs = true;
            acls[0].inherited = false;
            acls[0].userid    = -1;
            acls[0].allow     = Murmur.PermissionSpeak.value;
            acls[0].deny      = Murmur.PermissionEnter.value;

            m_log.DebugFormat("[MurmurVoice] Setting ACLs on channel");
            m_server.setACL(parent_chan, acls, (new List <Murmur.Group>()).ToArray(), true);
        }
        public int AddParent(string RegionName)
        {
            Murmur.Tree ServerTree;
            int chID = -1;

            // check list of current channels
            ServerTree = m_server.getTree();
            lock(chan_ids)
                {
                if(chan_ids.ContainsKey(RegionName))
                    chan_ids.Remove(RegionName);

                foreach(var child in ServerTree.children)
                    {
                    if(child.c.name == RegionName)
                        {
                        m_log.DebugFormat("[MurmurVoice]: Region parent channel already created:",
                            child.c.name,child.c.id);
                        chan_ids[RegionName] = child.c.id;
                        chID = child.c.id;
                        foreach(var ch in child.children)
                            {
                            m_log.DebugFormat("[MurmurVoice]: Found child {0} id {1}",
                                ch.c.name,ch.c.id);
                            chan_ids[ch.c.name] = ch.c.id;
                            }
                        break;
                        }
                    }
                }
            // create it if it wasn't found
            if(chID == -1)
                {
                chID = m_server.addChannel(RegionName, 0);
                chan_ids[RegionName] = chID;
                            // Set permissions on channels
                Murmur.ACL[] acls = new Murmur.ACL[1];
                acls[0] = new Murmur.ACL();
                acls[0].group = "all";
                acls[0].applyHere = true;
                acls[0].applySubs = true;
                acls[0].inherited = false;
                acls[0].userid = -1;
                acls[0].allow = Murmur.PermissionSpeak.value;
                acls[0].deny = Murmur.PermissionEnter.value;

                m_server.setACL(chID, acls, (new List<Murmur.Group>()).ToArray(), true);
                m_log.InfoFormat("[MurmurVoice]: Region Parent channel created {0} id {1}",RegionName,chID);

                }

            return chID;
        }
        public ChannelManager(ServerPrx server, string estatechan)
        {
            m_server = server;
            Murmur.Tree ServerTree;
            estate_chan = -1;
            // check list of channels
            ServerTree = m_server.getTree();
            lock(chan_ids)
                {
                foreach(var child in ServerTree.children)
                    {
                    if(child.c.name == estatechan)
                        {
                        chan_ids[child.c.name] = child.c.id;
                        estate_chan = child.c.id;
                        m_log.DebugFormat("[MurmurVoice]: Estate channel {0} already created id {1}",
                            child.c.name,child.c.id);
                        break;
                        }
                    }
                }
            // create it if it wasn't found
            if(estate_chan == -1)
                {
                estate_chan = m_server.addChannel(estatechan, 0);
                chan_ids[estatechan]=estate_chan;
                m_log.InfoFormat("[MurmurVoice]: Estate channel {0} created id {1}",estatechan,estate_chan);

            // Set permissions on channels
                Murmur.ACL[] acls = new Murmur.ACL[1];
                acls[0] = new Murmur.ACL();
                acls[0].group = "all";
                acls[0].applyHere = true;
                acls[0].applySubs = true;
                acls[0].inherited = false;
                acls[0].userid = -1;
                acls[0].allow = Murmur.PermissionSpeak.value;
                acls[0].deny = Murmur.PermissionEnter.value;

                m_server.setACL(estate_chan, acls, (new List<Murmur.Group>()).ToArray(), true);
                }
        }
示例#5
0
        public ChannelManager(ServerPrx server, string channel)
        {
            m_server = server;

            // Update list of channels
            lock (chan_ids)
                foreach (var child in m_server.getTree().children)
                    chan_ids[child.c.name] = child.c.id;

            // Set channel if it was found, create it if it wasn't
            lock (chan_ids)
                if (chan_ids.ContainsKey(channel))
                    parent_chan = chan_ids[channel];
                else
                    parent_chan = m_server.addChannel(channel, 0);

            // Set permissions on channels
            Murmur.ACL[] acls = new Murmur.ACL[1];
            acls[0] = new Murmur.ACL();
            acls[0].group = "all";
            acls[0].applyHere = true;
            acls[0].applySubs = true;
            acls[0].inherited = false;
            acls[0].userid = -1;
            acls[0].allow = Murmur.PermissionSpeak.value;
            acls[0].deny = Murmur.PermissionEnter.value;

            m_log.DebugFormat("[MurmurVoice] Setting ACLs on channel");
            m_server.setACL(parent_chan, acls, (new List<Murmur.Group>()).ToArray(), true);
        }
        public ChannelManager(ServerPrx server, string channel)
        {
            m_server = server;

            // Update list of channels
            lock (chan_ids)
                foreach (var child in m_server.getTree().children)
                    chan_ids[child.c.name] = child.c.id;

            // Set channel if it was found, create it if it wasn't
            lock (chan_ids)
                if (chan_ids.ContainsKey(channel))
                    parent_chan = chan_ids[channel];
                else
                    parent_chan = m_server.addChannel(channel, 0);

            // Set permissions on channels
            Murmur.ACL[] acls = new Murmur.ACL[1];
            acls[0] = new Murmur.ACL(true, true, false, -1, "all",
                Murmur.PermissionSpeak.value, Murmur.PermissionEnter.value);

            m_log.DebugFormat("[MurmurVoice] Setting ACLs on channel");
            m_server.setACL(parent_chan, acls, null, true);
        }