mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-27 07:11:04 -04:00
Minor cleanup in /centre, also don't create a file for the player's nickname until they actually set it.
This commit is contained in:
parent
e827023e9d
commit
d96c282a03
@ -266,9 +266,9 @@ namespace MCGalaxy.Commands {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p.lastchatroomglobal.AddSeconds(30) < DateTime.Now) {
|
if (p.lastchatroomglobal.AddSeconds(30) < DateTime.UtcNow) {
|
||||||
Chat.GlobalChatRoom(p, message, true);
|
Chat.GlobalChatRoom(p, message, true);
|
||||||
p.lastchatroomglobal = DateTime.Now;
|
p.lastchatroomglobal = DateTime.UtcNow;
|
||||||
} else {
|
} else {
|
||||||
Player.SendMessage(p, "Sorry, you must wait 30 seconds in between each global chatroom message!!");
|
Player.SendMessage(p, "Sorry, you must wait 30 seconds in between each global chatroom message!!");
|
||||||
}
|
}
|
||||||
|
@ -19,23 +19,15 @@ namespace MCGalaxy.Commands {
|
|||||||
|
|
||||||
void Blockchange1(Player p, ushort x, ushort y, ushort z, byte type, byte extType) {
|
void Blockchange1(Player p, ushort x, ushort y, ushort z, byte type, byte extType) {
|
||||||
RevertAndClearState(p, x, y, z);
|
RevertAndClearState(p, x, y, z);
|
||||||
p.centerstart[0] = x;
|
p.blockchangeObject = new Vec3U16(x, y, z);
|
||||||
p.centerstart[1] = y;
|
|
||||||
p.centerstart[2] = z;
|
|
||||||
|
|
||||||
p.Blockchange += new Player.BlockchangeEventHandler(Blockchange2);
|
p.Blockchange += new Player.BlockchangeEventHandler(Blockchange2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Blockchange2(Player p, ushort x, ushort y, ushort z, byte type, byte extType) {
|
void Blockchange2(Player p, ushort x, ushort y, ushort z, byte type, byte extType) {
|
||||||
RevertAndClearState(p, x, y, z);
|
RevertAndClearState(p, x, y, z);
|
||||||
p.centerend[0] = x;
|
Vec3U16 start = (Vec3U16)p.blockchangeObject;
|
||||||
p.centerend[1] = y;
|
int xCen = (start.X + x) / 2, yCen = (start.Y + y) / 2, zCen = (start.Z + z) / 2;
|
||||||
p.centerend[2] = z;
|
p.level.UpdateBlock(p, (ushort)xCen, (ushort)yCen, (ushort)zCen, Block.goldsolid, 0);
|
||||||
|
|
||||||
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);
|
|
||||||
Player.SendMessage(p, "A gold block was placed at (" + xCen + ", " + yCen + ", " + zCen + ").");
|
Player.SendMessage(p, "A gold block was placed at (" + xCen + ", " + yCen + ", " + zCen + ").");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,9 +10,7 @@ namespace MCGalaxy {
|
|||||||
|
|
||||||
static char[] trimChars = {'='};
|
static char[] trimChars = {'='};
|
||||||
public static bool Load( Player p ) {
|
public static bool Load( Player p ) {
|
||||||
if (!File.Exists("players/" + p.name + "DB.txt")) {
|
if (!File.Exists("players/" + p.name + "DB.txt")) return false;
|
||||||
Save(p); return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (string line in File.ReadAllLines( "players/" + p.name + "DB.txt")) {
|
foreach (string line in File.ReadAllLines( "players/" + p.name + "DB.txt")) {
|
||||||
if (string.IsNullOrEmpty(line) || line[0] == '#') continue;
|
if (string.IsNullOrEmpty(line) || line[0] == '#') continue;
|
||||||
@ -22,7 +20,6 @@ namespace MCGalaxy {
|
|||||||
|
|
||||||
if (key.CaselessEq("nick"))
|
if (key.CaselessEq("nick"))
|
||||||
p.DisplayName = value;
|
p.DisplayName = value;
|
||||||
p.timeLogged = DateTime.Now;
|
|
||||||
}
|
}
|
||||||
p.SetPrefix();
|
p.SetPrefix();
|
||||||
return true;
|
return true;
|
||||||
|
@ -466,6 +466,7 @@ namespace MCGalaxy {
|
|||||||
|
|
||||||
if (!Directory.Exists("players"))
|
if (!Directory.Exists("players"))
|
||||||
Directory.CreateDirectory("players");
|
Directory.CreateDirectory("players");
|
||||||
|
timeLogged = DateTime.Now;
|
||||||
PlayerDB.Load(this);
|
PlayerDB.Load(this);
|
||||||
Game.Team = Team.FindTeam(this);
|
Game.Team = Team.FindTeam(this);
|
||||||
SetPrefix();
|
SetPrefix();
|
||||||
|
@ -199,10 +199,6 @@ namespace MCGalaxy {
|
|||||||
public int[] copyoffset = new int[3] { 0, 0, 0 };
|
public int[] copyoffset = new int[3] { 0, 0, 0 };
|
||||||
public ushort[] copystart = new ushort[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
|
// GlobalBlock
|
||||||
internal int gbStep = 0, gbTargetId = 0;
|
internal int gbStep = 0, gbTargetId = 0;
|
||||||
internal BlockDefinition gbBlock;
|
internal BlockDefinition gbBlock;
|
||||||
@ -287,10 +283,8 @@ namespace MCGalaxy {
|
|||||||
|
|
||||||
//Global Chat
|
//Global Chat
|
||||||
public bool ignoreGlobalChat;
|
public bool ignoreGlobalChat;
|
||||||
|
|
||||||
public bool loggedIn;
|
public bool loggedIn;
|
||||||
public bool InGlobalChat { get; set; }
|
public bool InGlobalChat;
|
||||||
public Dictionary<string, string> sounds = new Dictionary<string, string>();
|
|
||||||
|
|
||||||
public bool isDev, isMod;
|
public bool isDev, isMod;
|
||||||
public bool isStaff;
|
public bool isStaff;
|
||||||
@ -436,7 +430,7 @@ namespace MCGalaxy {
|
|||||||
if (showname) {
|
if (showname) {
|
||||||
string referee = "";
|
string referee = "";
|
||||||
if (from.Game.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;
|
message = referee + from.color + from.voicestring + from.color + from.prefix + from.DisplayName + ": %r&f" + message;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user