diff --git a/Commands/Moderation/CmdHighlight.cs b/Commands/Moderation/CmdHighlight.cs index b1a326959..3f572604d 100644 --- a/Commands/Moderation/CmdHighlight.cs +++ b/Commands/Moderation/CmdHighlight.cs @@ -81,15 +81,9 @@ namespace MCGalaxy.Commands { DateTime time = node.BaseTime.AddSeconds(item.TimeDelta + seconds); if (time < DateTime.UtcNow) return; - byte b = lvl.GetTile(x, y, z); byte newTile = 0, newExtTile = 0; item.GetNewExtBlock(out newTile, out newExtTile); - if (b == newTile || Block.Convert(b) == Block.water || Block.Convert(b) == Block.lava) { - if (b == Block.air || Block.Convert(b) == Block.water || Block.Convert(b) == Block.lava) - p.SendBlockchange(x, y, z, Block.red); - else - p.SendBlockchange(x, y, z, Block.green); - } + p.SendBlockchange(x, y, z, newTile == Block.air ? Block.red : Block.green); } node = node.Prev; } diff --git a/Economy/Economy.cs b/Economy/Economy.cs index ef3169da8..8de560b2d 100644 --- a/Economy/Economy.cs +++ b/Economy/Economy.cs @@ -85,30 +85,8 @@ namespace MCGalaxy { } public static void Load() { - /*if (loadDatabase) { - retry: - if (Server.useMySQL) MySQL.executeQuery(createTable); else SQLite.executeQuery(createTable); //create database on server loading - string queryP = "SELECT * FROM Players"; string queryE = "SELECT * FROM Economy"; - DataTable eco = Server.useMySQL ? MySQL.fillData(queryE) : SQLite.fillData(queryE); - try { - DataTable players = Server.useMySQL ? MySQL.fillData(queryP) : SQLite.fillData(queryP); - if (players.Rows.Count == eco.Rows.Count) { } //move along, nothing to do here - else if (eco.Rows.Count == 0) { //if first time, copy content from player to economy - string query = "INSERT INTO Economy (player, money) SELECT Players.Name, Players.Money FROM Players"; - if (Server.useMySQL) MySQL.executeQuery(query); else SQLite.executeQuery(query); - } else { - //this will only be needed when the server shuts down while it was copying content (or some other error) - if (Server.useMySQL) MySQL.executeQuery("DROP TABLE Economy"); else SQLite.executeQuery("DROP TABLE Economy"); - goto retry; - } - players.Dispose(); eco.Dispose(); - } catch { } - return; - }*/ - if (!File.Exists("properties/economy.properties")) { Server.s.Log("Economy properties don't exist, creating"); - File.Create("properties/economy.properties").Close(); Save(); } using (StreamReader r = File.OpenText("properties/economy.properties")) { @@ -159,11 +137,7 @@ namespace MCGalaxy { } public static void Save() { - if (!File.Exists("properties/economy.properties")) { Server.s.Log("Economy properties don't exist, creating"); } - //Thread.Sleep(2000); - File.Delete("properties/economy.properties"); - //Thread.Sleep(2000); - using (StreamWriter w = File.CreateText("properties/economy.properties")) { + using (StreamWriter w = new StreamWriter("properties/economy.properties", false)) { //enabled w.WriteLine("enabled:" + Enabled); foreach (Item item in Items) {