PeerCastStation.UI.HTTP.APIHost.APIContext.GetSettings C# (CSharp) Méthode

GetSettings() private méthode

private GetSettings ( ) : JToken
Résultat JToken
      private JToken GetSettings()
      {
        var res = new JObject();
        res["maxRelays"]                 = PeerCast.AccessController.MaxRelays;
        res["maxRelaysPerChannel"]       = PeerCast.AccessController.MaxRelaysPerChannel;
        res["maxDirects"]                = PeerCast.AccessController.MaxPlays;
        res["maxDirectsPerChannel"]      = PeerCast.AccessController.MaxPlaysPerChannel;
        res["maxUpstreamRate"]           = PeerCast.AccessController.MaxUpstreamRate;
        res["maxUpstreamRatePerChannel"] = PeerCast.AccessController.MaxUpstreamRatePerChannel;
        var channelCleaner = new JObject();
        channelCleaner["mode"]          = (int)ChannelCleaner.Mode;
        channelCleaner["inactiveLimit"] = ChannelCleaner.InactiveLimit;
        res["channelCleaner"] = channelCleaner;
        var port_mapper = PeerCastApplication.Current.Plugins.GetPlugin<PeerCastStation.UI.PortMapperPlugin>();
        if (port_mapper!=null) {
          var portMapper = new JObject();
          portMapper["enabled"] = port_mapper.Enabled;
          res["portMapper"] = portMapper;
        }
        return res;
      }