Esempio n. 1
0
        public void CreatingAServerCreatesANativeServerWithPort()
        {
            var configuration = new VoiceServerConfiguration("voice.domaindummy.com", 33567, "Identit3y7rrV3RYNiC3EEEEEwgeA=", 987, "verySecurePassword");

            _voiceWrapper.Setup(e => e.CreateNativeServer(configuration));

            var tmpServer = new FakeVoiceServer(_voiceClientFactory, configuration, _voiceWrapper.Object);

            _voiceWrapper.Verify(e => e.CreateNativeServer(configuration), Times.Once);
        }
Esempio n. 2
0
        /// <summary>
        /// Инициализация голосового чата
        /// </summary>
        private void OnStart()
        {
            var teamSpeakConfig = new VoiceServerConfiguration("194.87.101.165", 23332, "8nwm0jHKWfrtSCTc1JYXsded55A=", 3, "GtaVGrimeVoice"); // prod

            //var teamSpeakConfig = new VoiceServerConfiguration("localhost", 23332, "Av0yWcX9rmJg6QWS1Hw1NG7HNK0=", 3, "qwe123"); // local
            VoiceServer = GtmpVoice.CreateServer(API, teamSpeakConfig);
            VoiceServer.AddTask(new PositionalTask());
            AttachToVoiceServerEvents();
            ClientEventHandler.Add(VOICE_ROTATION, (client, args) => client.SetVoiceRotation((float)args[0]));
            VoiceServer.Start();
        }
Esempio n. 3
0
        /// <summary>
        /// Инициализация голосового чата
        /// </summary>
        private void OnStart()
        {
            // more info: https://github.com/AlternateLife/JustAnotherVoiceChat-Server
            var teamSpeakConfig = new VoiceServerConfiguration("localhost", 23332, "virtualserver_unique_identifier", 2, "chanel pass");

            VoiceServer = GtmpVoice.CreateServer(API, teamSpeakConfig);
            VoiceServer.AddTask(new PositionalTask());
            AttachToVoiceServerEvents();
            ClientEventHandler.Add(VOICE_ROTATION, (client, args) => client.SetVoiceRotation((float)args[0]));
            VoiceServer.Start();
        }
        internal VoiceServer(IVoiceClientFactory <TClient, TIdentifier> factory, VoiceServerConfiguration configuration, IVoiceWrapper voiceWrapper)
        {
            _factory      = factory ?? throw new ArgumentNullException(nameof(factory));
            NativeWrapper = voiceWrapper ?? throw new ArgumentNullException(nameof(voiceWrapper));

            Configuration = configuration;

            NativeWrapper.CreateNativeServer(configuration);

            AttachToNativeEvents();
            AttachTasksToStartAndStopEvent();
        }
        public ServerHandler(IDummyClientFactory clientRepository, VoiceServerConfiguration configuration) : base(clientRepository, configuration)
        {
            OnServerStarted += () =>
            {
                _logger.Debug($"JustAnotherVoiceChat: Listening on {Configuration.Hostname}:{Configuration.Port}");
            };

            OnServerStopping += () =>
            {
                _logger.Debug("JustAnotherVoiceChat: Stopping...");
            };

            OnClientConnected += c =>
            {
                _logger.Debug("Client connected: " + c.Handle.Identifer);
            };
        }
        public void StartingVoiceServerWillSetStartedPropertyToTrueAndTriggerEvent()
        {
            var configuration = new VoiceServerConfiguration("localhost", 23332, "Identit3y7rrV3RYNiC3MnupTwgeA=", 130, "123");

            _voiceWrapper.Setup(e => e.StartNativeServer()).Returns(true);
            _voiceWrapper.Setup(e => e.CreateNativeServer(configuration));

            var server = new VoiceServer <IFakeVoiceClient, byte>(_voiceClientFactory.Object, configuration, _voiceWrapper.Object);

            var invokeAmount = 0;

            server.OnServerStarted += () => invokeAmount++;

            server.Start();

            _voiceWrapper.Verify(e => e.StartNativeServer(), Times.Once);
            _voiceWrapper.Verify(e => e.CreateNativeServer(configuration), Times.Once);

            Assert.AreEqual(1, invokeAmount);
            Assert.AreEqual(true, server.Started);
        }
Esempio n. 7
0
 public void CreateNativeServer(VoiceServerConfiguration configuration)
 {
     NativeLibary.JV_CreateServer(configuration.Port, configuration.TeamspeakServerId, configuration.TeamspeakChannelId, configuration.TeamspeakChannelPassword);
 }
Esempio n. 8
0
 public void CreateNativeServer(VoiceServerConfiguration configuration)
 {
     Mock.Object.CreateNativeServer(configuration);
 }
 protected VoiceServer(IVoiceClientFactory <TClient, TIdentifier> factory, VoiceServerConfiguration configuration) : this(factory, configuration, JustAnotherVoiceChat.GetVoiceWrapper())
 {
 }
Esempio n. 10
0
        protected internal GtmpVoiceServer(API api, IGtmpVoiceClientFactory clientRepository, VoiceServerConfiguration configuration) : base(clientRepository, configuration)
        {
            _api = api;

            AttachToEvents();
        }
Esempio n. 11
0
 public FakeVoiceServer(IVoiceClientFactory <IFakeVoiceClient, byte> factory, VoiceServerConfiguration configuration, IVoiceWrapper voiceWrapper = null) : base(factory, configuration, voiceWrapper)
 {
 }