diff --git a/MCGalaxy/Commands/Fun/ZombieSurvival/CmdAka.cs b/MCGalaxy/Commands/Fun/ZombieSurvival/CmdAka.cs index f2ac865ad..a22b3f57b 100644 --- a/MCGalaxy/Commands/Fun/ZombieSurvival/CmdAka.cs +++ b/MCGalaxy/Commands/Fun/ZombieSurvival/CmdAka.cs @@ -25,7 +25,7 @@ namespace MCGalaxy.Commands.Fun { public override string type { get { return CommandTypes.Games; } } public override void Use(Player p, string message) { - ZSData data = Server.zombie.Get(p); + ZSData data = ZSGame.Get(p); data.AkaMode = !data.AkaMode; Player[] players = PlayerInfo.Online.Items; Player.Message(p, "AKA mode is now: " + (data.AkaMode ? "&aOn" : "&cOff")); diff --git a/MCGalaxy/Commands/Fun/ZombieSurvival/CmdDisinfect.cs b/MCGalaxy/Commands/Fun/ZombieSurvival/CmdDisinfect.cs index fe7a6b0f2..7b1266cd8 100644 --- a/MCGalaxy/Commands/Fun/ZombieSurvival/CmdDisinfect.cs +++ b/MCGalaxy/Commands/Fun/ZombieSurvival/CmdDisinfect.cs @@ -15,6 +15,8 @@ or implied. See the Licenses for the specific language governing permissions and limitations under the Licenses. */ +using MCGalaxy.Games; + namespace MCGalaxy.Commands.Fun { public sealed class CmdDisInfect : Command { public override string name { get { return "DisInfect"; } } @@ -27,7 +29,7 @@ namespace MCGalaxy.Commands.Fun { Player who = message.Length == 0 ? p : PlayerInfo.FindMatches(p, message); if (who == null) return; - if (!Server.zombie.RoundInProgress || !Server.zombie.Get(who).Infected) { + if (!Server.zombie.RoundInProgress || !ZSGame.Get(who).Infected) { Player.Message(p, "Cannot disinfect player"); } else if (!who.Game.Referee) { Server.zombie.DisinfectPlayer(who); diff --git a/MCGalaxy/Commands/Fun/ZombieSurvival/CmdHuman.cs b/MCGalaxy/Commands/Fun/ZombieSurvival/CmdHuman.cs index 36e1f7728..44cc97780 100644 --- a/MCGalaxy/Commands/Fun/ZombieSurvival/CmdHuman.cs +++ b/MCGalaxy/Commands/Fun/ZombieSurvival/CmdHuman.cs @@ -30,7 +30,7 @@ namespace MCGalaxy.Commands.Fun { if (p.Game.PledgeSurvive) { Player.Message(p, "You cannot un-pledge that you will be infected."); return; } - if (Server.zombie.Get(p).Infected) { + if (ZSGame.Get(p).Infected) { Player.Message(p, "You cannot use %T/human %Sas you are currently infected."); return; } diff --git a/MCGalaxy/Commands/Fun/ZombieSurvival/CmdInfect.cs b/MCGalaxy/Commands/Fun/ZombieSurvival/CmdInfect.cs index da6d4a44d..605282645 100644 --- a/MCGalaxy/Commands/Fun/ZombieSurvival/CmdInfect.cs +++ b/MCGalaxy/Commands/Fun/ZombieSurvival/CmdInfect.cs @@ -15,6 +15,8 @@ or implied. See the Licenses for the specific language governing permissions and limitations under the Licenses. */ +using MCGalaxy.Games; + namespace MCGalaxy.Commands.Fun { public sealed class CmdInfect : Command { public override string name { get { return "Infect"; } } @@ -26,7 +28,7 @@ namespace MCGalaxy.Commands.Fun { Player who = message.Length == 0 ? p : PlayerInfo.FindMatches(p, message); if (who == null) return; - if (!Server.zombie.RoundInProgress || Server.zombie.Get(who).Infected) { + if (!Server.zombie.RoundInProgress || ZSGame.Get(who).Infected) { Player.Message(p, "Cannot infect player"); } else if (!who.Game.Referee) { Server.zombie.InfectPlayer(who, p); diff --git a/MCGalaxy/Economy/ReviveItem.cs b/MCGalaxy/Economy/ReviveItem.cs index 52c3a99d8..bea5e3e8b 100644 --- a/MCGalaxy/Economy/ReviveItem.cs +++ b/MCGalaxy/Economy/ReviveItem.cs @@ -39,7 +39,7 @@ namespace MCGalaxy.Eco { "when a round of zombie survival is in progress."); return; } - ZSData data = Server.zombie.Get(p); + ZSData data = ZSGame.Get(p); if (!data.Infected) { Player.Message(p, "You are already a human."); return; } diff --git a/MCGalaxy/Economy/ZombieItems.cs b/MCGalaxy/Economy/ZombieItems.cs index c4e68ee16..b1976dfe3 100644 --- a/MCGalaxy/Economy/ZombieItems.cs +++ b/MCGalaxy/Economy/ZombieItems.cs @@ -43,7 +43,7 @@ namespace MCGalaxy.Eco { Name, count * 10, ServerConfig.Currency); return; } - ZSData data = Server.zombie.Get(p); + ZSData data = ZSGame.Get(p); data.BlocksLeft += 10 * count; Economy.MakePurchase(p, Price * count, "%310Blocks: " + (10 * count)); } @@ -105,7 +105,7 @@ namespace MCGalaxy.Eco { "and/or a \"{1}\" (placeholder for human player) in the infect message."); return; } - ZSData data = Server.zombie.Get(p); + ZSData data = ZSGame.Get(p); if (data.InfectMessages == null) data.InfectMessages = new List(); data.InfectMessages.Add(text); @@ -138,7 +138,7 @@ namespace MCGalaxy.Eco { "when a round of zombie survival is in progress."); return; } - ZSData data = Server.zombie.Get(p); + ZSData data = ZSGame.Get(p); if (data.Invisible) { Player.Message(p, "You are already invisible."); return; } if (data.InvisibilityPotions >= MaxPotions) { diff --git a/MCGalaxy/Entity/Entities.cs b/MCGalaxy/Entity/Entities.cs index 85b0c44f8..a03e025e9 100644 --- a/MCGalaxy/Entity/Entities.cs +++ b/MCGalaxy/Entity/Entities.cs @@ -331,7 +331,7 @@ namespace MCGalaxy { // flip head when infected, but doesn't support model if (!p.hasChangeModel) { - ZSData data = Server.zombie.TryGet(p); + ZSData data = ZSGame.TryGet(p); if (data != null && data.Infected) pitch = FlippedPitch(pitch); } diff --git a/MCGalaxy/Games/ZombieSurvival/ZSConfig.cs b/MCGalaxy/Games/ZombieSurvival/ZSConfig.cs index b3f386abf..7b86d9ec9 100644 --- a/MCGalaxy/Games/ZombieSurvival/ZSConfig.cs +++ b/MCGalaxy/Games/ZombieSurvival/ZSConfig.cs @@ -44,7 +44,7 @@ namespace MCGalaxy.Games { /// Whether the current level name should be shown in the heartbeats sent. [ConfigBool("zombie-map-inheartbeat", "Zombie", false)] - public static bool IncludeMapInHeartbeat = false; + public static bool IncludeMapInHeartbeat; [ConfigBool("no-pillaring-during-zombie", "Zombie", true)] public static bool NoPillaring = true; diff --git a/MCGalaxy/Games/ZombieSurvival/ZSGame.DB.cs b/MCGalaxy/Games/ZombieSurvival/ZSGame.DB.cs new file mode 100644 index 000000000..446ec45bf --- /dev/null +++ b/MCGalaxy/Games/ZombieSurvival/ZSGame.DB.cs @@ -0,0 +1,139 @@ +/* + Copyright 2010 MCLawl Team - + Created by Snowl (David D.) and Cazzar (Cayde D.) + + Dual-licensed under the Educational Community License, Version 2.0 and + the GNU General Public License, Version 3 (the "Licenses"); you may + not use this file except in compliance with the Licenses. You may + obtain a copy of the Licenses at + + http://www.osedu.org/licenses/ECL-2.0 + http://www.gnu.org/licenses/gpl-3.0.html + + Unless required by applicable law or agreed to in writing, + software distributed under the Licenses are distributed on an "AS IS" + BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + or implied. See the Licenses for the specific language governing + permissions and limitations under the Licenses. + */ +using System; +using System.Data; +using MCGalaxy.DB; +using MCGalaxy.SQL; + +namespace MCGalaxy.Games { + + public sealed partial class ZSGame : RoundsGame { + + TopStat statMostInfected, statMaxInfected, statMostSurvived, statMaxSurvived; + OfflineStatPrinter offlineZSStats; + OnlineStatPrinter onlineZSStats; + ChatToken infectedToken, survivedToken; + + void HookStats() { + if (TopStat.Stats.Contains(statMostInfected)) return; // don't duplicate + + statMostInfected = new TopStat("Infected", "ZombieStats", "TotalInfected", + () => "Most players infected", TopStat.FormatInteger); + statMaxInfected = new TopStat("Survived", "ZombieStats", "TotalRounds", + () => "Most rounds survived", TopStat.FormatInteger); + statMostSurvived = new TopStat("ConsecutiveInfected", "ZombieStats", "MaxInfected", + () => "Most consecutive infections", TopStat.FormatInteger); + statMaxSurvived = new TopStat("ConsecutiveSurvived", "ZombieStats", "MaxRounds", + () => "Most consecutive rounds survived", TopStat.FormatInteger); + + infectedToken = new ChatToken("$infected", "Total number of players infected", + p => Get(p).TotalInfected.ToString()); + survivedToken = new ChatToken("$survived", "Total number of rounds survived", + p => Get(p).TotalRoundsSurvived.ToString()); + + offlineZSStats = PrintOfflineZSStats; + onlineZSStats = PrintOnlineZSStats; + OfflineStat.Stats.Add(offlineZSStats); + OnlineStat.Stats.Add(onlineZSStats); + ChatTokens.Standard.Add(infectedToken); + ChatTokens.Standard.Add(survivedToken); + + TopStat.Stats.Add(statMostInfected); + TopStat.Stats.Add(statMostSurvived); + TopStat.Stats.Add(statMaxInfected); + TopStat.Stats.Add(statMaxSurvived); + } + + void UnhookStats() { + OfflineStat.Stats.Remove(offlineZSStats); + OnlineStat.Stats.Remove(onlineZSStats); + ChatTokens.Standard.Remove(infectedToken); + ChatTokens.Standard.Remove(survivedToken); + + TopStat.Stats.Remove(statMostInfected); + TopStat.Stats.Remove(statMostSurvived); + TopStat.Stats.Remove(statMaxInfected); + TopStat.Stats.Remove(statMaxSurvived); + } + + void PrintOnlineZSStats(Player p, Player who) { + ZSData data = Get(who); + PrintZSStats(p, data.TotalRoundsSurvived, data.TotalInfected, + data.MaxRoundsSurvived, data.MaxInfected); + } + + void PrintOfflineZSStats(Player p, PlayerData who) { + ZombieStats stats = LoadStats(who.Name); + PrintZSStats(p, stats.TotalRounds, stats.TotalInfected, + stats.MaxRounds, stats.MaxInfected); + } + + static void PrintZSStats(Player p, int rounds, int infected, int roundsMax, int infectedMax) { + Player.Message(p, " Survived &a{0} %Srounds (max &e{1}%S)", rounds, roundsMax); + Player.Message(p, " Infected &a{0} %Splayers (max &e{1}%S)", infected, infectedMax); + } + + + static ColumnDesc[] createSyntax = new ColumnDesc[] { + new ColumnDesc("ID", ColumnType.Integer, priKey: true, autoInc: true, notNull: true), + new ColumnDesc("Name", ColumnType.Char, 20), + new ColumnDesc("TotalRounds", ColumnType.Int32), + new ColumnDesc("MaxRounds", ColumnType.Int32), + new ColumnDesc("TotalInfected", ColumnType.Int32), + new ColumnDesc("MaxInfected", ColumnType.Int32), + // reserve space for possible future additions + new ColumnDesc("Additional1", ColumnType.Int32), + }; + + static ZombieStats LoadStats(string name) { + DataTable table = Database.Backend.GetRows("ZombieStats", "*", "WHERE Name=@0", name); + ZombieStats stats = default(ZombieStats); + + if (table.Rows.Count > 0) { + DataRow row = table.Rows[0]; + stats.TotalRounds = PlayerData.ParseInt(row["TotalRounds"].ToString()); + stats.MaxRounds = PlayerData.ParseInt(row["MaxRounds"].ToString()); + stats.TotalInfected = PlayerData.ParseInt(row["TotalInfected"].ToString()); + stats.MaxInfected = PlayerData.ParseInt(row["MaxInfected"].ToString()); + } + table.Dispose(); + return stats; + } + + static void SaveStats(Player p) { + ZSData data = TryGet(p); + if (data == null || data.TotalRoundsSurvived == 0 && data.TotalInfected == 0) return; + + int count = 0; + using (DataTable table = Database.Backend.GetRows("ZombieStats", "*", "WHERE Name=@0", p.name)) { + count = table.Rows.Count; + } + + if (count == 0) { + Database.Backend.AddRow("ZombieStats", "TotalRounds, MaxRounds, TotalInfected, MaxInfected, Name", + data.TotalRoundsSurvived, data.MaxRoundsSurvived, + data.TotalInfected, data.MaxInfected, p.name); + } else { + Database.Backend.UpdateRows("ZombieStats", "TotalRounds=@0, MaxRounds=@1, TotalInfected=@2, MaxInfected=@3", + "WHERE Name=@4", data.TotalRoundsSurvived, data.MaxRoundsSurvived, + data.TotalInfected, data.MaxInfected, p.name); + } + } + } +} diff --git a/MCGalaxy/Games/ZombieSurvival/ZSGame.Plugin.cs b/MCGalaxy/Games/ZombieSurvival/ZSGame.Plugin.cs index d59695746..6e8468d7a 100644 --- a/MCGalaxy/Games/ZombieSurvival/ZSGame.Plugin.cs +++ b/MCGalaxy/Games/ZombieSurvival/ZSGame.Plugin.cs @@ -49,7 +49,7 @@ namespace MCGalaxy.Games { OnJoinedLevelEvent.Register(HandleJoinedLevel, Priority.High); OnPlayerChatEvent.Register(HandlePlayerChat, Priority.High); - OnSQLSaveEvent.Register(SavePlayerStats, Priority.High); + OnSQLSaveEvent.Register(SaveStats, Priority.High); } void UnhookEventHandlers() { @@ -68,7 +68,7 @@ namespace MCGalaxy.Games { OnJoinedLevelEvent.Unregister(HandleJoinedLevel); OnPlayerChatEvent.Unregister(HandlePlayerChat); - OnSQLSaveEvent.Unregister(SavePlayerStats); + OnSQLSaveEvent.Unregister(SaveStats); } @@ -277,26 +277,5 @@ namespace MCGalaxy.Games { } return false; } - - - void SavePlayerStats(Player p) { - ZSData data = TryGet(p); - if (data == null || data.TotalRoundsSurvived == 0 && data.TotalInfected == 0) return; - - int count = 0; - using (DataTable table = Database.Backend.GetRows("ZombieStats", "*", "WHERE Name=@0", p.name)) { - count = table.Rows.Count; - } - - if (count == 0) { - Database.Backend.AddRow("ZombieStats", "TotalRounds, MaxRounds, TotalInfected, MaxInfected, Name", - data.TotalRoundsSurvived, data.MaxRoundsSurvived, - data.TotalInfected, data.MaxInfected, p.name); - } else { - Database.Backend.UpdateRows("ZombieStats", "TotalRounds=@0, MaxRounds=@1, TotalInfected=@2, MaxInfected=@3", - "WHERE Name=@4", data.TotalRoundsSurvived, data.MaxRoundsSurvived, - data.TotalInfected, data.MaxInfected, p.name); - } - } } } diff --git a/MCGalaxy/Games/ZombieSurvival/ZSGame.cs b/MCGalaxy/Games/ZombieSurvival/ZSGame.cs index 47a30a28f..511ffb3ca 100644 --- a/MCGalaxy/Games/ZombieSurvival/ZSGame.cs +++ b/MCGalaxy/Games/ZombieSurvival/ZSGame.cs @@ -16,15 +16,13 @@ or implied. See the Licenses for the specific language governing permissions and limitations under the Licenses. */ -using System; -using System.Collections.Generic; -using System.Data; -using System.IO; -using System.Threading; -using MCGalaxy.DB; -using MCGalaxy.Commands.World; -using MCGalaxy.Games.ZS; -using MCGalaxy.SQL; +using System; +using System.Collections.Generic; +using System.IO; +using System.Threading; +using MCGalaxy.DB; +using MCGalaxy.Games.ZS; +using MCGalaxy.SQL; namespace MCGalaxy.Games { @@ -82,26 +80,26 @@ namespace MCGalaxy.Games { List infectMessages = new List(); const string zsExtrasKey = "MCG_ZS_DATA"; - internal ZSData Get(Player p) { + internal static ZSData Get(Player p) { object data; - if (!p.Extras.TryGet("MCG_ZS_DATA", out data)) { + if (!p.Extras.TryGet(zsExtrasKey, out data)) { data = new ZSData(); // TODO: Is this even thread-safe InitData((ZSData)data, p); - p.Extras.Put("MCG_ZS_DATA", data); + p.Extras.Put(zsExtrasKey, data); } return (ZSData)data; } - internal ZSData TryGet(Player p) { + internal static ZSData TryGet(Player p) { object data; - bool success = p.Extras.TryGet("MCG_ZS_DATA", out data); + bool success = p.Extras.TryGet(zsExtrasKey, out data); return success ? (ZSData)data : null; } - void InitData(ZSData data, Player p) { + static void InitData(ZSData data, Player p) { data.InfectMessages = PlayerDB.GetInfectMessages(p); - ZombieStats stats = LoadZombieStats(p.name); + ZombieStats stats = LoadStats(p.name); data.MaxInfected = stats.MaxInfected; data.TotalInfected = stats.TotalInfected; data.MaxRoundsSurvived = stats.MaxRounds; data.TotalRoundsSurvived = stats.TotalRounds; } @@ -144,6 +142,7 @@ namespace MCGalaxy.Games { HookStats(); Running = true; + Database.Backend.CreateTable("ZombieStats", createSyntax); HookEventHandlers(); Thread t = new Thread(RunGame); @@ -332,105 +331,6 @@ namespace MCGalaxy.Games { return ZSConfig.LevelList.Count == 0 || ZSConfig.LevelList.CaselessContains(name); } - - #region Database - - static ColumnDesc[] createSyntax = new ColumnDesc[] { - new ColumnDesc("ID", ColumnType.Integer, priKey: true, autoInc: true, notNull: true), - new ColumnDesc("Name", ColumnType.Char, 20), - new ColumnDesc("TotalRounds", ColumnType.Int32), - new ColumnDesc("MaxRounds", ColumnType.Int32), - new ColumnDesc("TotalInfected", ColumnType.Int32), - new ColumnDesc("MaxInfected", ColumnType.Int32), - // reserve space for possible future additions - new ColumnDesc("Additional1", ColumnType.Int32), - new ColumnDesc("Additional2", ColumnType.Int32), - new ColumnDesc("Additional3", ColumnType.Int32), - new ColumnDesc("Additional4", ColumnType.Int32), - }; - - public void CheckTableExists() { - Database.Backend.CreateTable("ZombieStats", createSyntax); - } - - public ZombieStats LoadZombieStats(string name) { - DataTable table = Database.Backend.GetRows("ZombieStats", "*", "WHERE Name=@0", name); - ZombieStats stats = default(ZombieStats); - - if (table.Rows.Count > 0) { - DataRow row = table.Rows[0]; - stats.TotalRounds = PlayerData.ParseInt(row["TotalRounds"].ToString()); - stats.MaxRounds = PlayerData.ParseInt(row["MaxRounds"].ToString()); - stats.TotalInfected = PlayerData.ParseInt(row["TotalInfected"].ToString()); - stats.MaxInfected = PlayerData.ParseInt(row["MaxInfected"].ToString()); - } - table.Dispose(); - return stats; - } - - TopStat statMostInfected, statMaxInfected, statMostSurvived, statMaxSurvived; - OfflineStatPrinter offlineZSStats; - OnlineStatPrinter onlineZSStats; - ChatToken infectedToken, survivedToken; - void HookStats() { - if (TopStat.Stats.Contains(statMostInfected)) return; // don't duplicate - - statMostInfected = new TopStat("Infected", "ZombieStats", "TotalInfected", - () => "Most players infected", TopStat.FormatInteger); - statMaxInfected = new TopStat("Survived", "ZombieStats", "TotalRounds", - () => "Most rounds survived", TopStat.FormatInteger); - statMostSurvived = new TopStat("ConsecutiveInfected", "ZombieStats", "MaxInfected", - () => "Most consecutive infections", TopStat.FormatInteger); - statMaxSurvived = new TopStat("ConsecutiveSurvived", "ZombieStats", "MaxRounds", - () => "Most consecutive rounds survived", TopStat.FormatInteger); - - infectedToken = new ChatToken("$infected", "Total number of players infected", - p => Get(p).TotalInfected.ToString()); - survivedToken = new ChatToken("$survived", "Total number of rounds survived", - p => Get(p).TotalRoundsSurvived.ToString()); - - offlineZSStats = PrintOfflineZSStats; - onlineZSStats = PrintOnlineZSStats; - OfflineStat.Stats.Add(offlineZSStats); - OnlineStat.Stats.Add(onlineZSStats); - ChatTokens.Standard.Add(infectedToken); - ChatTokens.Standard.Add(survivedToken); - - TopStat.Stats.Add(statMostInfected); - TopStat.Stats.Add(statMostSurvived); - TopStat.Stats.Add(statMaxInfected); - TopStat.Stats.Add(statMaxSurvived); - } - - void UnhookStats() { - OfflineStat.Stats.Remove(offlineZSStats); - OnlineStat.Stats.Remove(onlineZSStats); - ChatTokens.Standard.Remove(infectedToken); - ChatTokens.Standard.Remove(survivedToken); - - TopStat.Stats.Remove(statMostInfected); - TopStat.Stats.Remove(statMostSurvived); - TopStat.Stats.Remove(statMaxInfected); - TopStat.Stats.Remove(statMaxSurvived); - } - - void PrintOnlineZSStats(Player p, Player who) { - ZSData data = Get(who); - PrintZSStats(p, data.TotalRoundsSurvived, data.TotalInfected, - data.MaxRoundsSurvived, data.MaxInfected); - } - - void PrintOfflineZSStats(Player p, PlayerData who) { - ZombieStats stats = LoadZombieStats(who.Name); - PrintZSStats(p, stats.TotalRounds, stats.TotalInfected, - stats.MaxRounds, stats.MaxInfected); - } - - static void PrintZSStats(Player p, int rounds, int infected, int roundsMax, int infectedMax) { - Player.Message(p, " Survived &a{0} %Srounds (max &e{1}%S)", rounds, roundsMax); - Player.Message(p, " Infected &a{0} %Splayers (max &e{1}%S)", infected, infectedMax); - } - #endregion } internal class ZSLevelPicker : LevelPicker { diff --git a/MCGalaxy/MCGalaxy_.csproj b/MCGalaxy/MCGalaxy_.csproj index cd9cb4980..a1a731bac 100644 --- a/MCGalaxy/MCGalaxy_.csproj +++ b/MCGalaxy/MCGalaxy_.csproj @@ -506,6 +506,7 @@ + diff --git a/MCGalaxy/Player/Player.Login.cs b/MCGalaxy/Player/Player.Login.cs index c2b2d8ada..ac7f6491b 100644 --- a/MCGalaxy/Player/Player.Login.cs +++ b/MCGalaxy/Player/Player.Login.cs @@ -251,13 +251,14 @@ namespace MCGalaxy { while (alts.CaselessRemove(p.name)) { } if (alts.Count == 0) return; - LevelPermission rank = Chat.OpchatPerm; + LevelPermission rank = Chat.OpchatPerm; string altsMsg = "λNICK %Sis lately known as: " + alts.Join(); Chat.MessageFrom(p, altsMsg, (pl, obj) => Entities.CanSee(pl, p) && pl.Rank >= rank); //IRCBot.Say(temp, true); //Tells people in op channel on IRC + altsMsg = altsMsg.Replace("λNICK", name); Logger.Log(LogType.UserActivity, altsMsg); } } diff --git a/MCGalaxy/Player/Player.cs b/MCGalaxy/Player/Player.cs index 74e29bc3c..cb10f1ab6 100644 --- a/MCGalaxy/Player/Player.cs +++ b/MCGalaxy/Player/Player.cs @@ -105,7 +105,7 @@ namespace MCGalaxy { } if (!Server.zombie.Running || Game.Referee) return true; - ZSData data = Server.zombie.TryGet(target); + ZSData data = ZSGame.TryGet(target); return data == null || !(target.Game.Referee || data.Invisible); } diff --git a/MCGalaxy/Server/Server.cs b/MCGalaxy/Server/Server.cs index 9a6dfc56a..c94644041 100644 --- a/MCGalaxy/Server/Server.cs +++ b/MCGalaxy/Server/Server.cs @@ -108,7 +108,6 @@ namespace MCGalaxy { InitDatabase(); Economy.LoadDatabase(); - Server.zombie.CheckTableExists(); Background.QueueOnce(UpgradeTasks.CombineEnvFiles); Background.QueueOnce(LoadMainLevel);