예제 #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);
        }
예제 #2
0
 public static ServerConnectionHandler GetCurrentServerConnectionHandler()
 {
     return(new ServerConnectionHandler(TS3Interface.GetCurrentServerConnectionHandler()));
 }
예제 #3
0
        public static IEnumerable <ServerConnectionHandler> GetServerConnectionHandlerList()
        {
            var source = TS3Interface.GetServerConnectionHandlerList();

            return(source.Select((id) => new ServerConnectionHandler(id)));
        }