1. Is thier any way at all a mod can be made to let admin broadcast voice SERVERWIDE so everyone hears admin
     
  2. No, Rust voice chat is P2P.
     
  3. Okay, so I tried doing some research.
    In my decompiled Assembly-CSharp.dll, I found in BaseNetworkable the following:
    Code:
    private void LinkToNeighbours ()
        {
            if (this.links.Count == 0) {
                return;
            }
            this.linkedToNeighbours = true;
            using (TimeWarning.New ("LinkToNeighbours", 0.1)) {
                List<BaseEntity> list = Pool.GetList<BaseEntity> ();
                OBB oBB = this.WorldSpaceBounds ();
                Vis.Entities<BaseEntity> (oBB.position, oBB.extents.get_magnitude () + 1, list, -1, 2);
                for (int i = 0; i < list.Count; i++) {
                    this.LinkToEntity (list [i]);
                }
                Pool.FreeList<BaseEntity> (ref list);
            }
        }
    As you may notice, "linking to neighbors" is done by proximity.
    I have a slight suspicion that linked neighbors are the ones that receive your voice signal.
    However, there is also this method:
    Code:
    public void RefreshEntityLinks ()
        {
            for (int i = 0; i < this.links.Count; i++) {
                this.links [i].Clear ();
            }
            this.LinkToNeighbours ();
        }
    Which seems like it is called regularly in order to update which players are close to each player.
    The good news is that it is public, and that it is a superclass of BasePlayer, so you can override the method.
    The bad news is that it is not virtual, and so before overriding the method, you should find out what other functionality depends on this method, since it was not meant to be overridden.
    Disclaimer: I am not even sure if "linked entities" even is what defines who can hear who in the game, but it is a place to start.

    Good luck :)
     
  4. Overriding won't help here (or in fact almost anywhere) because you usually do not have access to the code that adds polymorphic types to any kind of handler either.
    Going down that chain you'd probably end up at some static method where overriding won't help you anymore.
    Oxide would have to inject code to make this happen, although I don't think this is necessarily a good idea.
     
  5. Makes sense, I'm annoyed I didn't realize that lol.
    However, do you think the following could work? (albeit very hacky)
    Code:
    //BasePlayer garry;
    foreach (BasePlayer bp in theServer) {
        if (garry != bp) {
            garry.LinkToEntity (bp);
        }
    }
    
     
  6. Depends on whether LinkToEntity affects anything other than voice chat (or voice chat at all) and when Rust updates the entity link.
    I cannot check right now because I don't have a server installed, though.
     
  7. The code fragments mentioned have nothing to do with the voice chat, the EntityLink code mentioned is used to link buildingblocks and such to eachother by using their male/female sockets.
    All the voice chat related code is only available in the client and is P2P, and is part of the PlayerVoiceRecorder class.

    Code:
        public void P2PBroadcast(float radius, P2PMessages.Type type, byte[] data, bool includeSelf = true)
        {
            if (data == null)
            {
                return;
            }
            if ((int)data.Length <= 0)
            {
                return;
            }
            Vector3 vector3 = base.transform.position;
            using (MemoryStream memoryStream = new MemoryStream((int)data.Length + 1))
            {
                using (BinaryWriter binaryWriter = new BinaryWriter(memoryStream))
                {
                    binaryWriter.Write((byte)type);
                    binaryWriter.Write(data);
                    foreach (BasePlayer basePlayer in BasePlayer.visiblePlayerList)
                    {
                        if (basePlayer != this)
                        {
                            if (basePlayer != null)
                            {
                                if (Vector3.Distance(vector3, basePlayer.transform.position) <= radius)
                                {
                                    if (basePlayer.userID != 0)
                                    {
                                        if (basePlayer.IsConnected)
                                        {
                                            Client.Steam.Networking.SendP2PPacket(basePlayer.userID, memoryStream.GetBuffer(), (int)memoryStream.Length, Networking.SendType.UnreliableNoDelay, 0);
                                        }
                                    }
                                }
                            }
                        }
                    }
                    if (includeSelf)
                    {
                        Client.Steam.Networking.SendP2PPacket(Client.Steam.SteamId, memoryStream.GetBuffer(), (int)memoryStream.Length, Networking.SendType.UnreliableNoDelay, 0);
                    }
                }
            }
        }    public void P2PMessage(P2PMessages.Type type, BinaryReader data)
        {
            P2PMessages.Type type1 = type;
            if (type1 == P2PMessages.Type.VOICE)
            {
                this.voiceSpeaker.Receive(data);
            }
            else if (type1 == P2PMessages.Type.TICK)
            {
            }
        }