chore: Cleans up pattern checks. (#892)
This commit is contained in:
parent
171df32257
commit
63e1b02d93
283 changed files with 587 additions and 702 deletions
|
|
@ -40,7 +40,7 @@ namespace Server.Guilds
|
|||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
if (!(sender.Mobile is PlayerMobile pm))
|
||||
if (sender.Mobile is not PlayerMobile pm)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -71,11 +71,11 @@ namespace Server.Guilds
|
|||
}
|
||||
|
||||
public static bool IsLeader(Mobile m, Guild g) =>
|
||||
!(m.Deleted || g.Disbanded || !(m is PlayerMobile) ||
|
||||
!(m.Deleted || g.Disbanded || m is not PlayerMobile ||
|
||||
m.AccessLevel < AccessLevel.GameMaster && g.Leader != m);
|
||||
|
||||
public static bool IsMember(Mobile m, Guild g) =>
|
||||
!(m.Deleted || g.Disbanded || !(m is PlayerMobile) ||
|
||||
!(m.Deleted || g.Disbanded || m is not PlayerMobile ||
|
||||
m.AccessLevel < AccessLevel.GameMaster && !g.IsMember(m));
|
||||
|
||||
public static bool CheckProfanity(string s, int maxLength = 50)
|
||||
|
|
@ -96,7 +96,7 @@ namespace Server.Guilds
|
|||
{
|
||||
var c = s[i];
|
||||
|
||||
if ((c < 'a' || c > 'z') && (c < '0' || c > '9'))
|
||||
if (c is < 'a' or > 'z' && c is < '0' or > '9')
|
||||
{
|
||||
var except = false;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue