Ejemplo n.º 1
0
        public void OnPlayerConnected(GTANetworkAPI.Client client)
        {
            client.SetSharedData(SaltyShared.SharedData.Voice_TeamSpeakName, Guid.NewGuid().ToString());
            client.SetSharedData(SaltyShared.SharedData.Voice_VoiceRange, 10f);

            client.TriggerEvent(SaltyShared.Event.Voice_Initialize, Voice.MinimumPluginVersion, Voice.SoundPack, Voice.IngameChannel, Voice.IngameChannel);
        }
Ejemplo n.º 2
0
        public void OnPlayerConnected(GTANetworkAPI.Client client)
        {
            VoiceClient voiceClient = new VoiceClient(client, VoiceManager.GetTeamSpeakName(), SaltyShared.SharedData.VoiceRanges[1]);

            lock (VoiceManager._voiceClients)
            {
                VoiceManager._voiceClients.Add(client, voiceClient);
            }

            client.TriggerEvent(SaltyShared.Event.SaltyChat_Initialize, VoiceManager.ServerUniqueIdentifier, VoiceManager.RequiredUpdateBranch, VoiceManager.MinimumPluginVersion, VoiceManager.SoundPack, VoiceManager.IngameChannel, VoiceManager.IngameChannelPassword, voiceClient.TeamSpeakName);
        }
Ejemplo n.º 3
0
        public void OnSetRadioChannel(GTANetworkAPI.Client client, string radioChannel)
        {
            if (String.IsNullOrWhiteSpace(radioChannel))
            {
                return;
            }

            Voice.RemovePlayerRadioChannel(client);
            Voice.AddPlayerRadioChannel(client, radioChannel);

            client.TriggerEvent(SaltyShared.Event.Voice_SetRadioChannel, radioChannel);
        }
Ejemplo n.º 4
0
        private void OnCheckVersion(GTANetworkAPI.Client player, string branch, string version)
        {
            if (!VoiceManager.TryGetVoiceClient(player, out VoiceClient voiceClient))
            {
                return;
            }

            if (!VoiceManager.IsVersionAccepted(branch, version))
            {
                player.Kick($"[Salty Chat] Required Branch: {VoiceManager.RequiredUpdateBranch} | Required Version: {VoiceManager.MinimumPluginVersion}");
                return;
            }

            foreach (VoiceClient cl in VoiceManager.VoiceClients)
            {
                player.TriggerEvent(SaltyShared.Event.SaltyChat_UpdateClient, cl.Player.Handle.Value, cl.TeamSpeakName, cl.VoiceRange);

                cl.Player.TriggerEvent(SaltyShared.Event.SaltyChat_UpdateClient, voiceClient.Player.Handle.Value, voiceClient.TeamSpeakName, voiceClient.VoiceRange);
            }

            player.TriggerEvent(SaltyShared.Event.SaltyChat_UpdateRadioTowers, Newtonsoft.Json.JsonConvert.SerializeObject(VoiceManager.RadioTowers));
        }