Enable nullability in Content.Server (#3685)

This commit is contained in:
DrSmugleaf
2021-03-16 15:50:20 +01:00
committed by GitHub
parent 90fec0ed24
commit a5ade526b7
306 changed files with 1616 additions and 1441 deletions

View File

@@ -18,7 +18,7 @@ namespace Content.Server.GameObjects.Components.Sound
public override string Name => "EmitSoundOnThrow";
[DataField("sound")]
public string _soundName;
public string? _soundName;
[DataField("variation")]
public float _pitchVariation;

View File

@@ -18,7 +18,7 @@ namespace Content.Server.GameObjects.Components.Sound
///
public override string Name => "EmitSoundOnUse";
[ViewVariables(VVAccess.ReadWrite)] [DataField("sound")] public string _soundName;
[ViewVariables(VVAccess.ReadWrite)] [DataField("sound")] public string? _soundName;
[ViewVariables(VVAccess.ReadWrite)] [DataField("variation")] public float _pitchVariation;
[ViewVariables(VVAccess.ReadWrite)] [DataField("semitoneVariation")] public int _semitoneVariation;

View File

@@ -5,7 +5,6 @@ using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.Manager.Attributes;
namespace Content.Server.GameObjects.Components.Sound
@@ -23,7 +22,7 @@ namespace Content.Server.GameObjects.Components.Sound
public override string Name => "FootstepModifier";
[DataField("footstepSoundCollection")]
public string _soundCollectionName;
public string? _soundCollectionName;
public void PlayFootstep()
{

View File

@@ -12,7 +12,7 @@ namespace Content.Server.GameObjects.Components.Sound
/// Stops all sounds.
/// </summary>
/// <param name="channel">User that will be affected.</param>
public void StopAllSounds(INetChannel channel)
public void StopAllSounds(INetChannel? channel)
{
SendNetworkMessage(new StopAllSoundsMessage(), channel);
}
@@ -21,16 +21,16 @@ namespace Content.Server.GameObjects.Components.Sound
/// Stops a certain scheduled sound from playing.
/// </summary>
/// <param name="channel">User that will be affected.</param>
public void StopScheduledSound(string filename, INetChannel channel)
public void StopScheduledSound(string filename, INetChannel? channel)
{
SendNetworkMessage(new StopSoundScheduleMessage(){Filename = filename}, channel);
SendNetworkMessage(new StopSoundScheduleMessage() {Filename = filename}, channel);
}
/// <summary>
/// Adds an scheduled sound to be played.
/// </summary>
/// <param name="channel">User that will be affected.</param>
public void AddScheduledSound(ScheduledSound schedule, INetChannel channel)
public void AddScheduledSound(ScheduledSound schedule, INetChannel? channel)
{
SendNetworkMessage(new ScheduledSoundMessage() {Schedule = schedule}, channel);
}
@@ -55,7 +55,7 @@ namespace Content.Server.GameObjects.Components.Sound
/// </summary>
/// <param name="filename">The resource path to the OGG Vorbis file to play.</param>
/// <param name="channel">User that will be affected.</param>
public void Play(string filename, AudioParams? audioParams = null, INetChannel channel = null)
public void Play(string filename, AudioParams? audioParams = null, INetChannel? channel = null)
{
AddScheduledSound(new ScheduledSound()
{