Remove some obsolete code

This commit is contained in:
UnknownShadow200 2017-06-15 13:50:57 +10:00
parent 54258aee95
commit 17abab5a93
8 changed files with 5 additions and 51 deletions

View File

@ -75,7 +75,7 @@ namespace MCGalaxy {
{ "$kicked", p => p.totalKicked.ToString() },
{ "$server", p => Server.name },
{ "$motd", p => Server.motd },
{ "$banned", p => Player.GetBannedCount().ToString() },
{ "$banned", p => Group.BannedRank.PlayerCount.ToString() },
{ "$irc", p => Server.ircServer + " > " + Server.ircChannel },
{ "$infected", p => p.Game.TotalInfected.ToString() },

View File

@ -39,7 +39,7 @@ namespace MCGalaxy.Commands.Info {
Player.Message(p, "Server's name: &b{0}%S", Server.name);
Player.Message(p, "&a{0} %Splayers total. (&a{1} %Sonline, &8{2} banned%S)",
GetPlayerCount(), Player.number, Player.GetBannedCount());
GetPlayerCount(), PlayerInfo.Online.Count, Group.BannedRank.PlayerCount);
Player.Message(p, "&a{0} %Slevels currently loaded. Currency is &3{1}%S.",
LevelInfo.Loaded.Count, Server.moneys);

View File

@ -604,7 +604,6 @@
<Compile Include="Plugins\Plugin.cs" />
<Compile Include="Plugins\Plugin.Events.cs" />
<Compile Include="Plugins\PluginManager.cs" />
<Compile Include="properties\GlobalSuppressions.cs" />
<Compile Include="Scripting\Scripting.cs" />
<Compile Include="Player\Ban.cs" />
<Compile Include="Games\CTF\Setup.cs" />

View File

@ -55,6 +55,7 @@ namespace MCGalaxy {
public PlayerList playerList;
public string MOTD = "";
public bool[] CanModify = new bool[256];
public int PlayerCount { get { return playerList.Count; } }
public static Group BannedRank { get { return findPerm(LevelPermission.Banned); } }
public static Group GuestRank { get { return findPerm(LevelPermission.Guest); } }

View File

@ -48,7 +48,6 @@ namespace MCGalaxy {
internal static object pendingLock = new object();
public static List<Player> connections = new List<Player>(Server.players);
public List<string> listignored = new List<string>();
public static byte number { get { return (byte)PlayerInfo.Online.Count; } }
public static string lastMSG = "";
//TpA

View File

@ -411,10 +411,6 @@ namespace MCGalaxy {
return true;
}
public static int GetBannedCount() {
Group group = Group.BannedRank;
return group == null ? 0 : group.playerList.Count;
}
#endregion
public void BlockUntilLoad(int sleep) {

View File

@ -268,8 +268,9 @@ namespace MCGalaxy {
}
static void RandomMessage(SchedulerTask task) {
if (Player.number != 0 && messages.Count > 0)
if (PlayerInfo.Online.Count > 0 && messages.Count > 0) {
Chat.MessageGlobal(messages[new Random().Next(0, messages.Count)]);
}
}
internal void SettingsUpdate() {

View File

@ -1,42 +0,0 @@
// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.
//
// To add a suppression to this file, right-click the message in the
// Error List, point to "Suppress Message(s)", and click
// "In Project Suppression File".
// You do not need to add suppressions to this file manually.
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2100:Review SQL queries for security vulnerabilities", Scope = "member", Target = "MCZall.CmdClones.#Use(MCZall.Player,System.String)")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2100:Review SQL queries for security vulnerabilities", Scope = "member", Target = "MCZall.CmdDeleteLvl.#Use(MCZall.Player,System.String)")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2100:Review SQL queries for security vulnerabilities", Scope = "member", Target = "MCZall.CmdInbox.#Use(MCZall.Player,System.String)")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2100:Review SQL queries for security vulnerabilities", Scope = "member", Target = "MCZall.CmdAbout.#AboutBlockchange2(MCZall.Player,System.UInt16,System.UInt16,System.UInt16,System.Byte)")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2100:Review SQL queries for security vulnerabilities", Scope = "member", Target = "MCZall.CmdMessageBlock.#Blockchange1(MCZall.Player,System.UInt16,System.UInt16,System.UInt16,System.Byte)")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2100:Review SQL queries for security vulnerabilities", Scope = "member", Target = "MCZall.CmdMessageBlock.#showMBs(MCZall.Player)")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2100:Review SQL queries for security vulnerabilities", Scope = "member", Target = "MCZall.CmdPortal.#ExitChange(MCZall.Player,System.UInt16,System.UInt16,System.UInt16,System.Byte)")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2100:Review SQL queries for security vulnerabilities", Scope = "member", Target = "MCZall.CmdPortal.#showPortals(MCZall.Player)")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2100:Review SQL queries for security vulnerabilities", Scope = "member", Target = "MCZall.CmdSend.#Use(MCZall.Player,System.String)")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "MCZall.CmdServerReport.#Use(MCZall.Player,System.String)")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2100:Review SQL queries for security vulnerabilities", Scope = "member", Target = "MCZall.CmdWhowas.#Use(MCZall.Player,System.String)")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2100:Review SQL queries for security vulnerabilities", Scope = "member", Target = "MCZall.CmdZone.#Blockchange2(MCZall.Player,System.UInt16,System.UInt16,System.UInt16,System.Byte)")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors", Scope = "member", Target = "MCZall.GrpAdvBuilder.#.ctor()")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors", Scope = "member", Target = "MCZall.GrpBanned.#.ctor()")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors", Scope = "member", Target = "MCZall.GrpBuilder.#.ctor()")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Scope = "member", Target = "MCZall.GrpCommands.#Save()")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors", Scope = "member", Target = "MCZall.GrpGuest.#.ctor()")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors", Scope = "member", Target = "MCZall.GrpOperator.#.ctor()")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors", Scope = "member", Target = "MCZall.GrpSuperOp.#.ctor()")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2100:Review SQL queries for security vulnerabilities", Scope = "member", Target = "MCZall.Level.#Blockchange(MCZall.Player,System.UInt16,System.UInt16,System.UInt16,System.Byte,System.Boolean)")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2100:Review SQL queries for security vulnerabilities", Scope = "member", Target = "MCZall.Level.#Load(System.String,System.Byte)")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2100:Review SQL queries for security vulnerabilities", Scope = "member", Target = "MCZall.Player.#.ctor(System.Net.Sockets.Socket)")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2100:Review SQL queries for security vulnerabilities", Scope = "member", Target = "MCZall.Player.#HandleLogin(System.Byte[])")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2100:Review SQL queries for security vulnerabilities", Scope = "member", Target = "MCZall.Player.#HandleMsgBlock(MCZall.Player,System.UInt16,System.UInt16,System.UInt16,System.Byte)")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2100:Review SQL queries for security vulnerabilities", Scope = "member", Target = "MCZall.Player.#HandlePortal(MCZall.Player,System.UInt16,System.UInt16,System.UInt16,System.Byte)")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2100:Review SQL queries for security vulnerabilities", Scope = "member", Target = "MCZall.Player.#save()")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "MCZall.Server.#Start()")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2100:Review SQL queries for security vulnerabilities", Scope = "member", Target = "MCZall.Server.#Start()")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "MCZall.Gui.Window.#WndProc(System.Windows.Forms.Message&)")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase", Scope = "member", Target = "MCZall.Gui.Window.#WndProc(System.Windows.Forms.Message&)")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2100:Review SQL queries for security vulnerabilities", Scope = "member", Target = "MCZall.CmdAbout.#AboutBlockchange(MCZall.Player,System.UInt16,System.UInt16,System.UInt16,System.Byte)")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2100:Review SQL queries for security vulnerabilities", Scope = "member", Target = "MCZall.Player.#HandleBlockchange(System.Byte[])")]