Inheritance: MonoBehaviour
Exemple #1
0
        public NamingHttpClientProxy(
            ILogger logger,
            string namespaceId,
            SecurityProxy securityProxy,
            ServerListManager serverListManager,
            NacosSdkOptions options,
            ServiceInfoHolder serviceInfoHolder,
            IHttpClientFactory clientFactory = null)
        {
            this._logger           = logger;
            this._clientFactory    = clientFactory;
            this.serverListManager = serverListManager;
            this._securityProxy    = securityProxy;
            this._options          = options;
            this.SetServerPort(DEFAULT_SERVER_PORT);
            this.namespaceId = namespaceId;
            this.beatReactor = new BeatReactor(_logger, this, _options);

            // Don't create PushReceiver when using rpc, it will create a udp server
            if (!options.NamingUseRpc)
            {
                this.pushReceiver = new PushReceiver(_logger, serviceInfoHolder, _options);
            }

            this.serviceInfoHolder = serviceInfoHolder;
        }
 public void Init()
 {
     _serverManager = new ServerListManager();
     _serverManager.Init();
     _server = new Server();
     _server.MaxMessageSize = 128 * 1024;
     Logger.Log($"Server Init. Max size msg: {_server.MaxMessageSize}", Logger.LOG_TYPE.INIT_OK);
 }
 public NamingClientProxyDelegate(ILogger logger, string @namespace, ServiceInfoHolder serviceInfoHolder, NacosSdkOptions options, InstancesChangeNotifier changeNotifier)
 {
     this._options          = options;
     this.serverListManager = new ServerListManager(logger, options);
     this.serviceInfoHolder = serviceInfoHolder;
     this.securityProxy     = new SecurityProxy(options, logger);
     InitSecurityProxy();
     this._serviceInfoUpdateService = new ServiceInfoUpdateService(options, serviceInfoHolder, this, changeNotifier);
     this.grpcClientProxy           = new NamingGrpcClientProxy(logger, @namespace, securityProxy, serverListManager, options, serviceInfoHolder);
     this.httpClientProxy           = new NamingHttpClientProxy(logger, @namespace, securityProxy, serverListManager, options, serviceInfoHolder);
 }
Exemple #4
0
        public MsConfigServerHttpAgent(NacosOptions options)
        {
            _options       = options;
            _serverListMgr = new ServerListManager(_options);
            _namespaceId   = _options.Namespace;

            _serverListMgr = new ServerListManager(_options);
            _securityProxy = new Security.SecurityProxy(_options);

            _securityProxy.LoginAsync(_serverListMgr.GetServerUrls()).ConfigureAwait(false).GetAwaiter().GetResult();

            _timer = new Timer(async x =>
            {
                await _securityProxy.LoginAsync(_serverListMgr.GetServerUrls());
            }, null, 0, _securityInfoRefreshIntervalMills);
        }
Exemple #5
0
        public ServerHttpAgent(
            ILoggerFactory loggerFactory,
            IOptions <NacosOptions> optionsAccs,
            IHttpClientFactory clientFactory)
        {
            _logger        = loggerFactory.CreateLogger <ServerHttpAgent>();
            _options       = optionsAccs.Value;
            _clientFactory = clientFactory;
            _namespaceId   = _options.Namespace;

            _serverListMgr = new ServerListManager(_options);
            _securityProxy = new Security.SecurityProxy(_options);

            _securityProxy.LoginAsync(_serverListMgr.GetServerUrls()).ConfigureAwait(false).GetAwaiter().GetResult();

            _timer = new Timer(async x =>
            {
                await _securityProxy.LoginAsync(_serverListMgr.GetServerUrls());
            }, null, 0, _securityInfoRefreshIntervalMills);
        }
        public static void PrintPlayers(ServerListManager m)
        {
            //int posY = Console.WindowHeight;
            int posX = Console.WindowWidth;
            int a    = Console.CursorTop;
            // clean
            //Console.SetCursorPosition(0, 10);
            //Console.Write(new string(' ', 20));
            // write
            int postFromRight = 30;
            int loopStart     = 3;

            Console.SetCursorPosition(posX - postFromRight, loopStart - 1);
            Console.Write("ID - SERVER NAME");
            Console.SetCursorPosition(posX - postFromRight, loopStart);
            Console.Write("---------------------");
            foreach (var item in m.ServerList)
            {
                loopStart += 1;
                Console.SetCursorPosition(posX - postFromRight, loopStart);
                Console.Write($"{item.Key} ID - {item.Value.serverName} - {item.Value.ServerCurrPlayers}/{item.Value.serverMaxPlayers}");
            }
            Console.SetCursorPosition(0, a);
        }
 public ServerHttpAgent(ILogger logger, NacosSdkOptions options)
 {
     this._logger        = logger;
     this._serverListMgr = new ServerListManager(logger, options);
 }
Exemple #8
0
 public void Awake()
 {
     Instance = this;
     PasswordField.contentType = InputField.ContentType.Password;
 }
	public void Awake()
	{
		Instance = this;
		PasswordField.contentType = InputField.ContentType.Password;
	}