Exemplo n.º 1
0
        public static void SendPluginCommand(ServerConnectionHandler serverConnectionHandler, string command,
                                             PluginTargetMode targetMode, ICollection <AnyID> targetIDs = null)
        {
            if (command == null)
            {
                throw new ArgumentNullException(nameof(command));
            }

            UInt16[] unwrappedIDs = null;
            if (targetIDs != null)
            {
                unwrappedIDs = new UInt16[targetIDs.Count + 1];
                int i = 0;
                foreach (var targetID in targetIDs)
                {
                    unwrappedIDs[i] = targetID.ID;
                    ++i;
                }
                //Terminate array as TS3 requires it, so the managed array data can be used directly
                unwrappedIDs[i] = 0;
            }
            TS3Interface.SendPluginCommand(serverConnectionHandler.ID, command, (int)targetMode, unwrappedIDs);
        }
Exemplo n.º 2
0
 public CmdR SendPluginCommand(string name, string data, PluginTargetMode targetmode)
 => Send("plugincmd",
         new CommandParameter("name", name),
         new CommandParameter("data", data),
         new CommandParameter("targetmode", (int)targetmode)).OnlyError();