Ejemplo n.º 1
0
        public ServerInfo GetServerInfoSpecific(int serverParams, int sourceParams)
        {
            AppLogger.Message("ServerConfigService.GetServerInfoSpecific");
            ServerInfo output = new ServerInfo();

            if ((serverParams & RequestedServerInfoParams.RevisionNumber) == RequestedServerInfoParams.RevisionNumber)
            {
                output.RevisionNumber = ServerConfigService.RevisionNumber;
            }
            if (serverParams == RequestedServerInfoParams.RevisionNumber)   //quick optimization to avoid wasting time on "pings"
            {
                return(output);
            }

            if ((serverParams & RequestedServerInfoParams.ServerName) == RequestedServerInfoParams.ServerName)
            {
                output.ServerName = Dns.GetHostName();
            }

            if ((serverParams & RequestedServerInfoParams.ServerAddress) == RequestedServerInfoParams.ServerAddress)
            {
                output.ServerAddress = OperationContext.Current.IncomingMessageHeaders.To.Host;
            }

            if ((serverParams & RequestedServerInfoParams.VersionInfo) == RequestedServerInfoParams.VersionInfo)
            {
                output.VersionInfo = Assembly.GetAssembly(typeof(MediaServer)).ToString();
            }

            if ((serverParams & RequestedServerInfoParams.StreamSources) == RequestedServerInfoParams.StreamSources)
            {
                StreamSources temp;
                CopyStreamSourceInfo(StreamSources.LoadFromFile(), sourceParams, out temp);
                output.StreamSources = temp;
            }

            if ((serverParams & RequestedServerInfoParams.ProfileGroups) == RequestedServerInfoParams.ProfileGroups)
            {
                output.ProfileGroups = ProfileGroups.LoadFromFile();
            }

//            if ((serverParams & RequestedServerInfoParams.OriginServers) == RequestedServerInfoParams.OriginServers)
//            {
//                output.OriginServers = new List<ServerInfo>();
//                if (QueryOriginServers.OriginServers != null)
//                {
//                    foreach (ServerInfo cur in QueryOriginServers.OriginServers)
//                    {
//                        ServerInfo copy;
//                        CopyServerInfo(cur, serverParams, sourceParams, out copy);
//                        output.OriginServers.Add(copy);
//                    }
//                }
//            }

            return(output);
        }
Ejemplo n.º 2
0
        public ServerInfo GetServerInfo()
        {
            AppLogger.Message("ServerConfigService.GetServerInfo");

            ServerInfo serverInfo = new ServerInfo();

            serverInfo.ServerName    = Dns.GetHostName();
            serverInfo.ServerAddress = OperationContext.Current.IncomingMessageHeaders.To.Host;
            serverInfo.VersionInfo   = Assembly.GetAssembly(typeof(MediaServer)).ToString();
            serverInfo.StreamSources = StreamSources.LoadFromFile();
            serverInfo.ProfileGroups = ProfileGroups.LoadFromFile();
//            serverInfo.OriginServers = QueryOriginServers.OriginServers;
            serverInfo.OriginServers  = null;
            serverInfo.RevisionNumber = ServerConfigService.RevisionNumber;

            return(serverInfo);
        }