Add -unverified to /who, simplify checking for unverified

This commit is contained in:
UnknownShadow200 2020-04-09 11:42:43 +10:00
parent 5e36cd4446
commit 442db0f11b
5 changed files with 9 additions and 8 deletions

View File

@ -84,6 +84,7 @@ namespace MCGalaxy.Commands.Info {
if (pl.frozen) data.Append("-frozen");
if (pl.Game.Referee) data.Append("-ref");
if (pl.IsAfk) data.Append("-afk");
if (pl.Unverified) data.Append("-unverified");
string lvlName = Colors.Strip(pl.level.name); // for museums
data.Append(" (").Append(lvlName).Append("),");

View File

@ -53,7 +53,7 @@ namespace MCGalaxy.Commands.Moderation {
}
void VerifyPassword(Player p, string password) {
if (!p.adminpen) { p.Message("%WYou are already verified."); return; }
if (!p.Unverified) { p.Message("%WYou are already verified."); return; }
if (p.passtries >= 3) { p.Kick("Did you really think you could keep on guessing?"); return; }
if (password.IndexOf(' ') >= 0) { p.Message("Your password must be %Wone %Sword!"); return; }
@ -63,7 +63,7 @@ namespace MCGalaxy.Commands.Moderation {
if (CheckHash(p.name, password)) {
p.Message("You are now &averified %Sand have &aaccess to admin commands and features.");
p.adminpen = false;
p.Unverified = false;
} else {
p.passtries++;
p.Message("%WWrong Password. %SRemember your password is %Wcase sensitive.");
@ -73,7 +73,7 @@ namespace MCGalaxy.Commands.Moderation {
void SetPassword(Player p, string password) {
string path = HashPath(p.name);
if (p.adminpen && File.Exists(path)) {
if (p.Unverified && File.Exists(path)) {
p.Message("%WYou must first verify with %T/pass [Password] %Wbefore you can change your password.");
p.Message("Forgot your password? Contact %W{0} %Sto %Wreset it.", Server.Config.OwnerName);
return;
@ -90,7 +90,7 @@ namespace MCGalaxy.Commands.Moderation {
Player who = PlayerInfo.FindMatches(p, target);
if (who == null) return;
if (!p.IsConsole && p.adminpen) {
if (!p.IsConsole && p.Unverified) {
p.Message("%WYou must first verify with %T/Pass [Password]"); return;
}
if (!p.IsConsole && !Server.Config.OwnerName.CaselessEq(p.name)) {

View File

@ -129,7 +129,7 @@ namespace MCGalaxy {
public bool isFlying;
public bool joker;
public bool adminpen;
public bool Unverified;
public bool voice;
public CommandData DefaultCmdData {

View File

@ -61,7 +61,7 @@ namespace MCGalaxy {
if (level.IsMuseum && Blockchange == null) return;
bool deletingBlock = !painting && !placing;
if (Server.Config.verifyadmins && adminpen) {
if (Unverified) {
Message("%WYou must first verify with %T/Pass [Password]");
RevertBlock(x, y, z); return;
}
@ -612,7 +612,7 @@ namespace MCGalaxy {
if (jailed) {
Message("You cannot use any commands while jailed."); return false;
}
if (Server.Config.verifyadmins && adminpen && !(cmd == "pass" || cmd == "setpass")) {
if (Unverified && !(cmd == "pass" || cmd == "setpass")) {
Message("%WYou must verify first with %T/Pass [Password]"); return false;
}

View File

@ -107,7 +107,7 @@ namespace MCGalaxy {
SetPrefix();
LoadCpeData();
if (Server.Config.verifyadmins && Rank >= Server.Config.VerifyAdminsRank) adminpen = true;
if (Server.Config.verifyadmins && Rank >= Server.Config.VerifyAdminsRank) Unverified = true;
if (Server.noEmotes.Contains(name)) { parseEmotes = !Server.Config.ParseEmotes; }
hideRank = Rank;