mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-19 04:07:10 -04:00
Fixed /follow not showing player name with 'stopped following' message, fixed /gen not showing completion message when used from map with level-only chat
This commit is contained in:
parent
f3e586875a
commit
1f0f163228
@ -63,9 +63,9 @@ namespace MCGalaxy {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected internal static bool CheckRank(Player p, CommandData data, Player who,
|
||||
protected internal static bool CheckRank(Player p, CommandData data, Player target,
|
||||
string action, bool canAffectOwnRank) {
|
||||
return p == who || CheckRank(p, data, who.Rank, action, canAffectOwnRank);
|
||||
return p == target || CheckRank(p, data, target.Rank, action, canAffectOwnRank);
|
||||
}
|
||||
|
||||
protected internal static bool CheckRank(Player p, CommandData data, LevelPermission rank,
|
||||
|
@ -47,10 +47,11 @@ namespace MCGalaxy.Commands.Moderation {
|
||||
}
|
||||
|
||||
static void Unfollow(Player p, CommandData data, bool stealth) {
|
||||
Player who = PlayerInfo.FindExact(p.following);
|
||||
p.Message("Stopped following ", who == null ? p.following : who.ColoredName);
|
||||
p.Message("Stopped following " + p.FormatNick(p.following));
|
||||
p.following = "";
|
||||
if (who != null) Entities.Spawn(p, who);
|
||||
|
||||
Player target = PlayerInfo.FindExact(p.following);
|
||||
if (target != null) Entities.Spawn(p, target);
|
||||
|
||||
if (!p.hidden) return;
|
||||
if (!stealth) {
|
||||
|
@ -33,20 +33,20 @@ namespace MCGalaxy.Commands.Misc {
|
||||
get { return new[] { new CommandPerm(LevelPermission.Operator, "can summon all players") }; }
|
||||
}
|
||||
|
||||
public override void Use(Player p, string target, CommandData data) {
|
||||
if (target.Length == 0) { Help(p); return; }
|
||||
public override void Use(Player p, string message, CommandData data) {
|
||||
if (message.Length == 0) { Help(p); return; }
|
||||
|
||||
if (!target.CaselessEq("all")) {
|
||||
SummonPlayer(p, target, data);
|
||||
if (!message.CaselessEq("all")) {
|
||||
SummonPlayer(p, message, data);
|
||||
} else {
|
||||
if (!CheckExtraPerm(p, data, 1)) return;
|
||||
Player[] players = PlayerInfo.Online.Items;
|
||||
|
||||
foreach (Player pl in players) {
|
||||
if (pl.level == p.level && pl != p && data.Rank > pl.Rank) {
|
||||
pl.AFKCooldown = DateTime.UtcNow.AddSeconds(2);
|
||||
pl.SendPos(Entities.SelfID, p.Pos, p.Rot);
|
||||
pl.Message("You were summoned by {0}%S.", pl.FormatNick(p));
|
||||
foreach (Player target in players) {
|
||||
if (target.level == p.level && target != p && data.Rank > target.Rank) {
|
||||
target.AFKCooldown = DateTime.UtcNow.AddSeconds(2);
|
||||
target.SendPos(Entities.SelfID, p.Pos, p.Rot);
|
||||
target.Message("You were summoned by {0}%S.", target.FormatNick(p));
|
||||
}
|
||||
}
|
||||
Chat.MessageFromLevel(p, "λNICK %Ssummoned everyone");
|
||||
|
@ -109,9 +109,8 @@ namespace MCGalaxy.Generator {
|
||||
lvl = new Level(name, x, y, z);
|
||||
if (!gen.Generate(p, lvl, seed)) { lvl.Dispose(); return null; }
|
||||
|
||||
string format = seed.Length > 0 ? "{0}%S created level {1}%S with seed \"{2}\"" : "{0}%S created level {1}";
|
||||
string msg = string.Format(format, p.ColoredName, lvl.ColoredName, seed);
|
||||
Chat.MessageGlobal(msg);
|
||||
string msg = seed.Length > 0 ? "λNICK%S created level {0}%S with seed \"{1}\"" : "λNICK%S created level {0}";
|
||||
Chat.MessageFrom(p, string.Format(msg, lvl.ColoredName, seed));
|
||||
} finally {
|
||||
Interlocked.Exchange(ref p.GeneratingMap, 0);
|
||||
Server.DoGC();
|
||||
|
Loading…
x
Reference in New Issue
Block a user