Ejemplo n.º 1
0
        private void OnResourceStart()
        {
            // Create a JustAnotherVoiceServer based GtmpVoice Server!
            var hostname = API.getResourceSetting <string>("justanothervoicechat", "voice_host");
            var port     = API.getResourceSetting <ushort>("justanothervoicechat", "voice_port");

            var teamspeakServerId        = API.getResourceSetting <string>("justanothervoicechat", "voice_teamspeak_serverid");
            var teamspeakChannelId       = API.getResourceSetting <ulong>("justanothervoicechat", "voice_teamspeak_channelid");
            var teamspeakChannelPassword = API.getResourceSetting <string>("justanothervoicechat", "voice_teamspeak_channelpassword");

            _voiceServer = GtmpVoice.CreateServer(API, new VoiceServerConfiguration(hostname, port, teamspeakServerId, teamspeakChannelId, teamspeakChannelPassword));

            // Enables 3D Voice
            _voiceServer.AddTask(new GtmpPositionalTask());

            // Attach to some IVoiceServer events to react to certain them with certain actions.
            AttachToVoiceServerEvents();

            // Attach to GTMP-Events, so the connection works and camera rotation updates.
            AttachToGtmpEvents(true);

            _radioHandler = new RadioHandler();
            _phoneHandler = new TelephoneHandler(_voiceServer);

            // Startup VoiceServer, so players are able to connect.
            _voiceServer.Start();
        }
Ejemplo 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();
        }
Ejemplo 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();
        }
 public TelephoneHandler(IGtmpVoiceServer server)
 {
     _server = server;
 }