Skip to content

Commit 518a053

Browse files
committed
Renamed JoinSecret and SpectateSecret
1 parent 25dc4c2 commit 518a053

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

DiscordRPC/Entities/Secrets.cs

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ public class Secrets
3030
/// <para>Max Length of 128 characters</para>
3131
/// </summary>
3232
[JsonProperty("join", NullValueHandling = NullValueHandling.Ignore)]
33-
public string JoinSecret
33+
public string Join
3434
{
35-
get { return _joinSecret; }
35+
get => _joinSecret;
3636
set
3737
{
3838
if (!BaseRichPresence.ValidateString(value, out _joinSecret, false, 128))
@@ -41,6 +41,15 @@ public string JoinSecret
4141
}
4242
private string _joinSecret;
4343

44+
/// <summary>Alias of Join</summary>
45+
/// <remarks>This was made obsolete as the property name contains redundant information.</remarks>
46+
[System.Obsolete("Property name is redundant and replaced with Join.")]
47+
public string JoinSecret
48+
{
49+
get => Join;
50+
set => Join = value;
51+
}
52+
4453
/// <summary>
4554
/// The secret data that will tell the client how to connect to the game to spectate. This could be a unique identifier for a fancy match maker or player id, lobby id, etc.
4655
/// <para>It is recommended to encrypt this information so its hard for people to replicate it.
@@ -49,9 +58,9 @@ public string JoinSecret
4958
/// <para>Max Length of 128 characters</para>
5059
/// </summary>
5160
[JsonProperty("spectate", NullValueHandling = NullValueHandling.Ignore)]
52-
public string SpectateSecret
61+
public string Spectate
5362
{
54-
get { return _spectateSecret; }
63+
get => _spectateSecret;
5564
set
5665
{
5766
if (!BaseRichPresence.ValidateString(value, out _spectateSecret, false, 128))
@@ -61,17 +70,26 @@ public string SpectateSecret
6170
private string _spectateSecret;
6271

6372

73+
/// <summary>Alias of Spectate</summary>
74+
/// <remarks>This was made obsolete as the property name contains redundant information.</remarks>
75+
[System.Obsolete("Property name is redundant and replaced with Spectate.")]
76+
public string SpectateSecret
77+
{
78+
get => Spectate;
79+
set => Spectate = value;
80+
}
81+
6482
#region Statics
6583

6684
/// <summary>
6785
/// The encoding the secret generator is using
6886
/// </summary>
69-
public static Encoding Encoding { get { return Encoding.UTF8; } }
87+
public static Encoding Encoding => Encoding.UTF8;
7088

7189
/// <summary>
7290
/// The length of a secret in bytes.
7391
/// </summary>
74-
public static int SecretLength { get { return 128; } }
92+
public static int SecretLength => 128;
7593

7694
/// <summary>
7795
/// Creates a new secret. This is NOT a cryptographic function and should NOT be used for sensitive information. This is mainly provided as a way to generate quick IDs.

0 commit comments

Comments
 (0)