2 using Microsoft.Xna.Framework;
4 using System.Collections.Generic;
9 partial class Client : IDisposable
20 private float voiceVolume = 1f;
29 private float radioNoise;
33 get {
return radioNoise; }
34 set { radioNoise = MathHelper.Clamp(value, 0.0f, 1.0f); }
37 private bool mutedLocally;
40 get {
return mutedLocally; }
43 if (mutedLocally == value) {
return; }
70 radioNoiseChannel =
null;
73 DebugConsole.Log(
"Destroying voipsound");
86 float noiseGain = 0.0f;
87 Vector3? position =
null;
88 if (character !=
null && !character.
IsDead)
90 if (GameSettings.CurrentConfig.Audio.UseDirectionalVoiceChat)
108 gain *= 1.0f - garbleAmount;
118 if (noiseGain > 0.0f)
120 if (radioNoiseChannel ==
null || !radioNoiseChannel.
IsPlaying)
122 radioNoiseChannel = SoundPlayer.PlaySound(
"radiostatic");
123 radioNoiseChannel.
Category =
"voip";
124 radioNoiseChannel.
Looping =
true;
128 radioNoiseChannel.
Position = position;
129 radioNoiseChannel.
Gain = noiseGain;
131 else if (radioNoiseChannel !=
null)
133 radioNoiseChannel.
Gain = 0.0f;
137 partial
void InitProjSpecific()
148 List<DebugConsole.Command> permittedCommands =
new List<DebugConsole.Command>();
149 foreach (Identifier commandName
in permittedConsoleCommands)
151 var consoleCommand = DebugConsole.Commands.Find(c => c.Names.Contains(commandName));
152 if (consoleCommand !=
null)
154 permittedCommands.Add(consoleCommand);
168 foreach (var command
in permittedConsoleCommands)
204 for (
int i = 0; i < votes.Length; i++)
210 partial
void DisposeProjSpecific()
221 if (radioNoiseChannel !=
null)
224 radioNoiseChannel =
null;
static Character? Controlled
void SetPlayerVoiceIconState(Client client, bool muted, bool mutedLocally)
virtual Vector2 WorldPosition
static GameSession?? GameSession
static NetLobbyScreen NetLobbyScreen
static Sounds.SoundManager SoundManager
void SetPlayerVoiceIconState(Client client, bool muted, bool mutedLocally)
const float SpeakRangeVOIP
This is shorter than the text chat speak range, because the voice chat is still intelligible (just qu...
static float GetGarbleAmount(Entity listener, Entity sender, float range, float obstructionMultiplier=2.0f)
How much messages sent by sender should get garbled. Takes the distance between the entities and opt...
const float MaxVoiceChatBoost
readonly HashSet< DebugConsole.Command > PermittedConsoleCommands
bool HasPermission(ClientPermissions permission)
void SetPermissions(ClientPermissions permissions, IEnumerable< DebugConsole.Command > permittedConsoleCommands)
void SetPermissions(ClientPermissions permissions, IEnumerable< Identifier > permittedConsoleCommands)
void GivePermission(ClientPermissions permission)
void RemovePermission(ClientPermissions permission)
readonly byte SessionId
An ID for this client for the current session. THIS IS NOT A PERSISTENT VALUE. DO NOT STORE THIS LONG...
ClientPermissions Permissions
bool HasPermission(ClientPermissions permission)
void RegisterQueue(VoipQueue queue)
void UnregisterQueue(VoipQueue queue)
void SetPosition(Vector3? pos)