Skip to content

Commit 632268e

Browse files
authored
enhancement: extend server statistics on startup (AscensionGameDev#2224)
1 parent 4938ec9 commit 632268e

File tree

2 files changed

+39
-5
lines changed

2 files changed

+39
-5
lines changed

Intersect.Server.Core/Core/Bootstrapper.cs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
using System.Runtime.InteropServices;
55
using CommandLine;
66
using Intersect.Factories;
7+
using Intersect.GameObjects;
8+
using Intersect.GameObjects.Events;
9+
using Intersect.GameObjects.Maps;
710
using Intersect.Logging;
811
using Intersect.Network;
912
using Intersect.Plugins;
@@ -266,12 +269,20 @@ private static bool PostContextSetup()
266269
return false;
267270
}
268271

269-
Console.WriteLine();
272+
Time.Update();
270273

271-
Console.WriteLine(Strings.Commandoutput.playercount.ToString(Player.Count()));
274+
Console.WriteLine();
275+
Console.WriteLine(Strings.Commandoutput.ServerInfo);
276+
Console.WriteLine(Strings.Commandoutput.AccountCount.ToString(Database.PlayerData.User.Count()));
277+
Console.WriteLine(Strings.Commandoutput.CharacterCount.ToString(Player.Count()));
278+
Console.WriteLine(Strings.Commandoutput.NpcCount.ToString(NpcBase.Lookup.Count));
279+
Console.WriteLine(Strings.Commandoutput.SpellCount.ToString(SpellBase.Lookup.Count));
280+
Console.WriteLine(Strings.Commandoutput.MapCount.ToString(MapBase.Lookup.Count));
281+
Console.WriteLine(Strings.Commandoutput.EventCount.ToString(EventBase.Lookup.Count));
282+
Console.WriteLine(Strings.Commandoutput.ItemCount.ToString(ItemBase.Lookup.Count));
283+
Console.WriteLine();
272284
Console.WriteLine(Strings.Commandoutput.gametime.ToString(Time.GetTime().ToString("F")));
273-
274-
Time.Update();
285+
Console.WriteLine();
275286

276287
PacketSender.CacheGameDataPacket();
277288

@@ -297,6 +308,7 @@ private static void PrintIntroduction()
297308
Console.WriteLine(@"Copyright (C) 2020 Ascension Game Dev");
298309
Console.WriteLine(Strings.Intro.version.ToString(Assembly.GetExecutingAssembly().GetName().Version));
299310
Console.WriteLine(Strings.Intro.support);
311+
Console.WriteLine();
300312
Console.WriteLine(Strings.Intro.loading);
301313
}
302314

Intersect.Server.Core/Localization/Strings.cs

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,29 @@ public readonly LocalizedString
508508
public readonly LocalizedString parseerror =
509509
@"Parse Error: Parameter could not be read. Type {00} {01} for usage information.";
510510

511-
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)] public readonly LocalizedString playercount = @"Server has {00} registered players.";
511+
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
512+
public readonly LocalizedString ServerInfo = @"Server has:";
513+
514+
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
515+
public readonly LocalizedString AccountCount = @" - {00} accounts.";
516+
517+
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
518+
public readonly LocalizedString CharacterCount = @" - {00} characters.";
519+
520+
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
521+
public readonly LocalizedString NpcCount = @" - {00} NPCs.";
522+
523+
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
524+
public readonly LocalizedString SpellCount = @" - {00} spells.";
525+
526+
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
527+
public readonly LocalizedString MapCount = @" - {00} maps.";
528+
529+
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
530+
public readonly LocalizedString EventCount = @" - {00} events.";
531+
532+
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
533+
public readonly LocalizedString ItemCount = @" - {00} items.";
512534

513535
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)] public readonly LocalizedString powerchanged = @"{00} has had their power updated!";
514536

0 commit comments

Comments
 (0)