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,64 +893,70 @@ namespace HISP.Game.Chat
if (args.Length <= 0)
{
formattedmessage += Messages.MuteHelp;
goto leave;
}
string muteType = args[0];
if (muteType.ToUpper() == "GLOBAL")
{
user.MuteGlobal = true;
} else if (muteType.ToUpper() == "ISLAND")
{
user.MuteIsland = true;
} else if (muteType.ToUpper() == "NEAR")
{
user.MuteNear = true;
} else if (muteType.ToUpper() == "HERE")
{
user.MuteHere = true;
} else if (muteType.ToUpper() == "BUDDY")
{
user.MuteBuddy = true;
} else if (muteType.ToUpper() == "SOCIALS")
{
user.MuteSocials = true;
else
{
string muteType = args[0];
if (muteType.ToUpper() == "GLOBAL")
{
user.MuteGlobal = true;
}
else if (muteType.ToUpper() == "ISLAND")
{
user.MuteIsland = true;
}
else if (muteType.ToUpper() == "NEAR")
{
user.MuteNear = true;
}
else if (muteType.ToUpper() == "HERE")
{
user.MuteHere = true;
}
else if (muteType.ToUpper() == "BUDDY")
{
user.MuteBuddy = true;
}
else if (muteType.ToUpper() == "SOCIALS")
{
user.MuteSocials = true;
}
else if (muteType.ToUpper() == "PM")
{
user.MutePrivateMessage = true;
}
else if (muteType.ToUpper() == "BR")
{
user.MuteBuddyRequests = true;
}
else if (muteType.ToUpper() == "LOGINS")
{
user.MuteLogins = true;
}
else if (muteType.ToUpper() == "ADS")
{
user.MuteAds = true;
}
else if (muteType.ToUpper() == "ALL")
{
user.MuteAll = true;
user.MuteGlobal = true;
user.MuteIsland = true;
user.MuteNear = true;
user.MuteHere = true;
user.MuteBuddy = true;
user.MuteSocials = true;
user.MutePrivateMessage = true;
user.MuteBuddyRequests = true;
user.MuteLogins = true;
}
else
{
formattedmessage += Messages.MuteHelp;
}
}
else if (muteType.ToUpper() == "PM")
{
user.MutePrivateMessage = true;
}
else if (muteType.ToUpper() == "BR")
{
user.MuteBuddyRequests = true;
}
else if (muteType.ToUpper() == "LOGINS")
{
user.MuteLogins = true;
}
else if (muteType.ToUpper() == "ADS")
{
user.MuteAds = true;
}
else if (muteType.ToUpper() == "ALL")
{
user.MuteAll = true;
user.MuteGlobal = true;
user.MuteIsland = true;
user.MuteNear = true;
user.MuteHere = true;
user.MuteBuddy = true;
user.MuteSocials = true;
user.MutePrivateMessage = true;
user.MuteBuddyRequests = true;
user.MuteLogins = true;
}
else
{
formattedmessage += Messages.MuteHelp;
}
byte[] chatPacket = PacketBuilder.CreateChat(formattedmessage, PacketBuilder.CHAT_BOTTOM_LEFT);
user.LoggedinClient.SendPacket(chatPacket);
@ -965,71 +971,70 @@ namespace HISP.Game.Chat
if (args.Length <= 0)
{
formattedmessage += Messages.UnMuteHelp;
goto leave;
}
else
{
string muteType = args[0];
if (muteType.ToUpper() == "GLOBAL")
{
user.MuteGlobal = false;
}
else if (muteType.ToUpper() == "ISLAND")
{
user.MuteIsland = false;
}
else if (muteType.ToUpper() == "ADS")
{
user.MuteAds = false;
}
else if (muteType.ToUpper() == "NEAR")
{
user.MuteNear = false;
}
else if (muteType.ToUpper() == "HERE")
{
user.MuteHere = false;
}
else if (muteType.ToUpper() == "BUDDY")
{
user.MuteBuddy = false;
}
else if (muteType.ToUpper() == "SOCIALS")
{
user.MuteSocials = false;
}
else if (muteType.ToUpper() == "PM")
{
user.MutePrivateMessage = false;
}
else if (muteType.ToUpper() == "BR")
{
user.MuteBuddyRequests = false;
}
else if (muteType.ToUpper() == "LOGINS")
{
user.MuteLogins = false;
}
else if (muteType.ToUpper() == "ALL")
{
user.MuteAll = false;
user.MuteGlobal = false;
user.MuteIsland = false;
user.MuteNear = false;
user.MuteHere = false;
user.MuteBuddy = false;
user.MuteSocials = false;
user.MutePrivateMessage = false;
user.MuteBuddyRequests = false;
user.MuteLogins = false;
}
else
{
formattedmessage += Messages.UnMuteHelp;
}
}
string muteType = args[0];
if (muteType.ToUpper() == "GLOBAL")
{
user.MuteGlobal = false;
}
else if (muteType.ToUpper() == "ISLAND")
{
user.MuteIsland = false;
}
else if (muteType.ToUpper() == "ADS")
{
user.MuteAds = false;
}
else if (muteType.ToUpper() == "NEAR")
{
user.MuteNear = false;
}
else if (muteType.ToUpper() == "HERE")
{
user.MuteHere = false;
}
else if (muteType.ToUpper() == "BUDDY")
{
user.MuteBuddy = false;
}
else if (muteType.ToUpper() == "SOCIALS")
{
user.MuteSocials = false;
}
else if (muteType.ToUpper() == "PM")
{
user.MutePrivateMessage = false;
}
else if (muteType.ToUpper() == "BR")
{
user.MuteBuddyRequests = false;
}
else if (muteType.ToUpper() == "LOGINS")
{
user.MuteLogins = false;
}
else if (muteType.ToUpper() == "ALL")
{
user.MuteAll = false;
user.MuteGlobal = false;
user.MuteIsland = false;
user.MuteNear = false;
user.MuteHere = false;
user.MuteBuddy = false;
user.MuteSocials = false;
user.MutePrivateMessage = false;
user.MuteBuddyRequests = false;
user.MuteLogins = false;
}
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;