diff --git a/Commands/Chat/CmdChatRoom.cs b/Commands/Chat/CmdChatRoom.cs index be74731d9..d0f5719cd 100644 --- a/Commands/Chat/CmdChatRoom.cs +++ b/Commands/Chat/CmdChatRoom.cs @@ -266,9 +266,9 @@ namespace MCGalaxy.Commands { return; } - if (p.lastchatroomglobal.AddSeconds(30) < DateTime.Now) { + if (p.lastchatroomglobal.AddSeconds(30) < DateTime.UtcNow) { Chat.GlobalChatRoom(p, message, true); - p.lastchatroomglobal = DateTime.Now; + p.lastchatroomglobal = DateTime.UtcNow; } else { Player.SendMessage(p, "Sorry, you must wait 30 seconds in between each global chatroom message!!"); } diff --git a/Commands/building/CmdCenter.cs b/Commands/building/CmdCenter.cs index db5bdba64..b915f3ab8 100644 --- a/Commands/building/CmdCenter.cs +++ b/Commands/building/CmdCenter.cs @@ -19,23 +19,15 @@ namespace MCGalaxy.Commands { void Blockchange1(Player p, ushort x, ushort y, ushort z, byte type, byte extType) { RevertAndClearState(p, x, y, z); - p.centerstart[0] = x; - p.centerstart[1] = y; - p.centerstart[2] = z; - + p.blockchangeObject = new Vec3U16(x, y, z); p.Blockchange += new Player.BlockchangeEventHandler(Blockchange2); } void Blockchange2(Player p, ushort x, ushort y, ushort z, byte type, byte extType) { RevertAndClearState(p, x, y, z); - p.centerend[0] = x; - p.centerend[1] = y; - p.centerend[2] = z; - - int xCen = (int)((p.centerstart[0] + p.centerend[0]) / 2); - int yCen = (int)((p.centerstart[1] + p.centerend[1]) / 2); - int zCen = (int)((p.centerstart[2] + p.centerend[2]) / 2); - p.level.UpdateBlock(p, (ushort)xCen, (ushort)yCen, (ushort)zCen, (byte)Block.goldsolid, 0); + Vec3U16 start = (Vec3U16)p.blockchangeObject; + int xCen = (start.X + x) / 2, yCen = (start.Y + y) / 2, zCen = (start.Z + z) / 2; + p.level.UpdateBlock(p, (ushort)xCen, (ushort)yCen, (ushort)zCen, Block.goldsolid, 0); Player.SendMessage(p, "A gold block was placed at (" + xCen + ", " + yCen + ", " + zCen + ")."); } diff --git a/Database/PlayerDB.cs b/Database/PlayerDB.cs index 119cb88b7..e538e73f2 100644 --- a/Database/PlayerDB.cs +++ b/Database/PlayerDB.cs @@ -10,9 +10,7 @@ namespace MCGalaxy { static char[] trimChars = {'='}; public static bool Load( Player p ) { - if (!File.Exists("players/" + p.name + "DB.txt")) { - Save(p); return false; - } + if (!File.Exists("players/" + p.name + "DB.txt")) return false; foreach (string line in File.ReadAllLines( "players/" + p.name + "DB.txt")) { if (string.IsNullOrEmpty(line) || line[0] == '#') continue; @@ -22,7 +20,6 @@ namespace MCGalaxy { if (key.CaselessEq("nick")) p.DisplayName = value; - p.timeLogged = DateTime.Now; } p.SetPrefix(); return true; diff --git a/Player/Player.Handlers.cs b/Player/Player.Handlers.cs index 6ff4988a5..29f62068b 100644 --- a/Player/Player.Handlers.cs +++ b/Player/Player.Handlers.cs @@ -466,6 +466,7 @@ namespace MCGalaxy { if (!Directory.Exists("players")) Directory.CreateDirectory("players"); + timeLogged = DateTime.Now; PlayerDB.Load(this); Game.Team = Team.FindTeam(this); SetPrefix(); diff --git a/Player/Player.cs b/Player/Player.cs index f46df5713..198d9198d 100644 --- a/Player/Player.cs +++ b/Player/Player.cs @@ -199,10 +199,6 @@ namespace MCGalaxy { public int[] copyoffset = new int[3] { 0, 0, 0 }; public ushort[] copystart = new ushort[3] { 0, 0, 0 }; - //Center - public int[] centerstart = new int[3] { 0, 0, 0 }; - public int[] centerend = new int[3] { 0, 0, 0 }; - // GlobalBlock internal int gbStep = 0, gbTargetId = 0; internal BlockDefinition gbBlock; @@ -287,10 +283,8 @@ namespace MCGalaxy { //Global Chat public bool ignoreGlobalChat; - public bool loggedIn; - public bool InGlobalChat { get; set; } - public Dictionary sounds = new Dictionary(); + public bool InGlobalChat; public bool isDev, isMod; public bool isStaff; @@ -436,7 +430,7 @@ namespace MCGalaxy { if (showname) { string referee = ""; if (from.Game.Referee) - referee = Colors.green + "[Referee] "; + referee = Colors.green + "[Ref] "; message = referee + from.color + from.voicestring + from.color + from.prefix + from.DisplayName + ": %r&f" + message; }