Skip to content

Commit

Permalink
Inbox now includes message number and slightly offsets message (Thank…
Browse files Browse the repository at this point in the history
…s Venk)
  • Loading branch information
UnknownShadow200 committed Apr 20, 2022
1 parent 193393b commit e4eae8a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 8 additions & 5 deletions MCGalaxy/Commands/Chat/CmdInbox.cs
Expand Up @@ -40,7 +40,10 @@ public sealed class CmdInbox : Command2 {

string[] args = message.SplitSpaces(2);
if (message.Length == 0) {
foreach (string[] entry in entries) { Output(p, entry); }
for (int i = 0; i < entries.Count; i++)
{
Output(p, i + 1, entries[i]);
}
} else if (IsDeleteCommand(args[0])) {
if (args.Length == 1) {
p.Message("You need to provide either \"all\" or a number."); return;
Expand Down Expand Up @@ -76,17 +79,17 @@ public sealed class CmdInbox : Command2 {
if (num > entries.Count) {
p.Message("Message #{0} does not exist.", num);
} else {
Output(p, entries[num - 1]);
Output(p, num, entries[num - 1]);
}
}

static void Output(Player p, string[] entry) {
static void Output(Player p, int num, string[] entry) {
DateTime time = entry[i_sent].ParseDBDate();
TimeSpan delta = DateTime.Now - time;
string sender = p.FormatNick(entry[i_from]);

p.Message("From {0} &a{1} ago:", sender, delta.Shorten());
p.Message(entry[i_text]);
p.Message("{0}) From {1} &a{2} ago:", num, sender, delta.Shorten());
p.Message(" {0}", entry[i_text]);
}

public override void Help(Player p) {
Expand Down
2 changes: 1 addition & 1 deletion MCGalaxy/Server/Server.Fields.cs
Expand Up @@ -38,7 +38,7 @@ public sealed partial class Server {
public static PlayerMetaList Notes = new PlayerMetaList("text/notes.txt");

/// <summary> *** DO NOT USE THIS! *** Use VersionString, as this field is a constant and is inlined if used. </summary>
public const string InternalVersion = "1.9.3.9";
public const string InternalVersion = "1.9.4.0";
public static string Version { get { return InternalVersion; } }

public static string SoftwareName = "MCGalaxy";
Expand Down

0 comments on commit e4eae8a

Please sign in to comment.