And now also for /temprankinfo

This commit is contained in:
UnknownShadow200 2017-02-09 13:54:35 +11:00
parent c1f13c4a5a
commit 2224bd7c07
2 changed files with 10 additions and 7 deletions

View File

@ -43,11 +43,12 @@ namespace MCGalaxy.Commands {
string[] args = line.Split(' ');
if (args.Length <= 3) continue;
if (args.Length == 4)
if (args.Length == 4) {
Player.Message(p, Action(args[1]) + " by " + args[2] + " on " + args[3]);
else
} else {
Player.Message(p, Action(args[1]) + " by " + args[2] + " on " + args[3]
+ " - " + args[4].Replace("%20", " "));
}
}
}

View File

@ -13,6 +13,7 @@ or implied. See the Licenses for the specific language governing
permissions and limitations under the Licenses.
*/
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
@ -115,11 +116,12 @@ namespace MCGalaxy.Commands.Moderation {
}
static void Info(Player p, string name) {
foreach (string line in File.ReadAllLines(Paths.TempRanksFile)) {
if (!line.CaselessStarts(name)) continue;
List<string> rankings = Server.TempRanks.FindMatches(p, name, "temp rank");
if (rankings == null) return;
foreach (string line in rankings) {
PrintTempRankInfo(p, line); return;
}
Player.Message(p, "&cPlayer &a{0}&chas not been assigned a temporary rank.", name);
}
static void List(Player p) {
@ -150,7 +152,7 @@ namespace MCGalaxy.Commands.Moderation {
TimeSpan delta = DateTime.Now - assigned;
TimeSpan expireDelta = expiry - DateTime.Now;
Player.Message(p, "Temp rank information for {0}:", args[0]);
Player.Message(p, "Temp rank information for {0}:", PlayerInfo.GetColoredName(p, args[0]));
Player.Message(p, " From {0} %Sto {1}%S, by {2} &a{3} %Sago, expires in &a{4}",
oldRank, tempRank, tempRanker,
delta.Shorten(), expireDelta.Shorten());