Skip to content

Commit

Permalink
Fix ContainsKey / ContainsValue confusion
Browse files Browse the repository at this point in the history
  • Loading branch information
Popax21 committed Jul 24, 2024
1 parent 395470b commit 27ac4d7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CelesteNet.Server.FrontendModule/WSCMDs/WSCMDsExtra.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public class WSCMDBanExt : WSCMD {
if (plusCon == null)
continue;

if (!(plusCon.GetAssociatedData<ExtendedHandshake.ConnectionData>() is ExtendedHandshake.ConnectionData plConData && plConData.CheckEntries.ContainsKey(checkValueVal)))
if (!(plusCon.GetAssociatedData<ExtendedHandshake.ConnectionData>() is ExtendedHandshake.ConnectionData plConData && plConData.CheckEntries.ContainsValue(checkValueVal)))
continue;

if (ban.Name.IsNullOrEmpty())
Expand Down
4 changes: 2 additions & 2 deletions CelesteNet.Server/ConPlus/ExtendedHandshake.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ public class ExtendedHandshake : IConnectionFeature {

public record ConnectionData(string CheckEnv = "", string CheckMAC = "", string CheckDevice = "", string SelfReportBan = "") {

public IDictionary<string, string> CheckEntries => new Dictionary<string, string>() {
public Dictionary<string, string> CheckEntries => new Dictionary<string, string>() {
["CheckEnv"] = CheckEnv,
["CheckMAC"] = CheckMAC,
["CheckDevice"] = CheckDevice,
}.AsReadOnly();
};

public bool CheckEntriesValid => CheckEntries.All(e => !e.Value.IsNullOrEmpty());

Expand Down

0 comments on commit 27ac4d7

Please sign in to comment.