Remove goto

This commit is contained in:
Li 2022-05-08 17:02:48 +12:00
parent 02d32f46a8
commit 158429d306
2 changed files with 124 additions and 120 deletions

View file

@ -893,27 +893,33 @@ namespace HISP.Game.Chat
if (args.Length <= 0)
{
formattedmessage += Messages.MuteHelp;
goto leave;
}
else
{
string muteType = args[0];
if (muteType.ToUpper() == "GLOBAL")
{
user.MuteGlobal = true;
} else if (muteType.ToUpper() == "ISLAND")
}
else if (muteType.ToUpper() == "ISLAND")
{
user.MuteIsland = true;
} else if (muteType.ToUpper() == "NEAR")
}
else if (muteType.ToUpper() == "NEAR")
{
user.MuteNear = true;
} else if (muteType.ToUpper() == "HERE")
}
else if (muteType.ToUpper() == "HERE")
{
user.MuteHere = true;
} else if (muteType.ToUpper() == "BUDDY")
}
else if (muteType.ToUpper() == "BUDDY")
{
user.MuteBuddy = true;
} else if (muteType.ToUpper() == "SOCIALS")
}
else if (muteType.ToUpper() == "SOCIALS")
{
user.MuteSocials = true;
}
@ -950,7 +956,7 @@ namespace HISP.Game.Chat
{
formattedmessage += Messages.MuteHelp;
}
}
byte[] chatPacket = PacketBuilder.CreateChat(formattedmessage, PacketBuilder.CHAT_BOTTOM_LEFT);
user.LoggedinClient.SendPacket(chatPacket);
@ -965,9 +971,9 @@ namespace HISP.Game.Chat
if (args.Length <= 0)
{
formattedmessage += Messages.UnMuteHelp;
goto leave;
}
else
{
string muteType = args[0];
if (muteType.ToUpper() == "GLOBAL")
@ -1026,10 +1032,9 @@ namespace HISP.Game.Chat
else
{
formattedmessage += Messages.UnMuteHelp;
goto leave;
}
}
leave:;
byte[] chatPacket = PacketBuilder.CreateChat(formattedmessage, PacketBuilder.CHAT_BOTTOM_LEFT);
user.LoggedinClient.SendPacket(chatPacket);

View file

@ -17,7 +17,6 @@ namespace HISP.Player
private List<Auction.AuctionBid> bids = new List<Auction.AuctionBid>();
private List<User> beingSocializedBy = new List<User>();
private int chatViolations;
private int charId;
private int subscribedUntil;