private void OnPlayerDisconnect(IPlayer player, string reason) { MainNormalVoiceChannel.RemovePlayer(player); MainWhisperVoiceChannel.RemovePlayer(player); MainShoutVoiceChannel.RemovePlayer(player); PoliceMegaphoneVoiceChannel.RemovePlayer(player); }
private void OnPlayerConnect(ServerPlayer player, string reason) { MainNormalVoiceChannel.AddPlayer(player); MainWhisperVoiceChannel.AddPlayer(player); MainWhisperVoiceChannel.MutePlayer(player); MainShoutVoiceChannel.AddPlayer(player); MainShoutVoiceChannel.MutePlayer(player); PoliceMegaphoneVoiceChannel.AddPlayer(player); PoliceMegaphoneVoiceChannel.MutePlayer(player); player.VoiceLevel = PlayerVoiceLevel.Normal; }
public void ChangeVoiceLevel(ServerPlayer player, PlayerVoiceLevel newLevel) { switch (newLevel) { case PlayerVoiceLevel.Mute: MainWhisperVoiceChannel.MutePlayer(player); MainNormalVoiceChannel.MutePlayer(player); MainShoutVoiceChannel.MutePlayer(player); PoliceMegaphoneVoiceChannel.MutePlayer(player); break; case PlayerVoiceLevel.Whisper: MainWhisperVoiceChannel.UnmutePlayer(player); MainNormalVoiceChannel.MutePlayer(player); MainShoutVoiceChannel.MutePlayer(player); PoliceMegaphoneVoiceChannel.MutePlayer(player); break; case PlayerVoiceLevel.Normal: MainWhisperVoiceChannel.MutePlayer(player); MainNormalVoiceChannel.UnmutePlayer(player); MainShoutVoiceChannel.MutePlayer(player); PoliceMegaphoneVoiceChannel.MutePlayer(player); break; case PlayerVoiceLevel.Shout: MainWhisperVoiceChannel.MutePlayer(player); MainNormalVoiceChannel.MutePlayer(player); MainShoutVoiceChannel.UnmutePlayer(player); PoliceMegaphoneVoiceChannel.MutePlayer(player); break; case PlayerVoiceLevel.PoliceMegaphone: MainWhisperVoiceChannel.MutePlayer(player); MainNormalVoiceChannel.MutePlayer(player); MainShoutVoiceChannel.MutePlayer(player); PoliceMegaphoneVoiceChannel.UnmutePlayer(player); break; } player.VoiceLevel = newLevel; }