From 47ab534bee74904e2ae84ef569f65b4e26623059 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Thu, 24 May 2018 22:24:30 -0400 Subject: tweak context trace messages to make multiplayer context more clear --- src/SMAPI/Framework/SGame.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/SMAPI/Framework/SGame.cs') diff --git a/src/SMAPI/Framework/SGame.cs b/src/SMAPI/Framework/SGame.cs index 91612fb0..585b3270 100644 --- a/src/SMAPI/Framework/SGame.cs +++ b/src/SMAPI/Framework/SGame.cs @@ -386,8 +386,19 @@ namespace StardewModdingAPI.Framework *********/ if (!this.RaisedAfterLoadEvent && Context.IsWorldReady) { + // print context + string context = $"Context: loaded saved game '{Constants.SaveFolderName}', starting {Game1.currentSeason} {Game1.dayOfMonth} Y{Game1.year}."; + if (Context.IsMultiplayer) + { + int onlineCount = Game1.getOnlineFarmers().Count(); + context += $" {(Context.IsMainPlayer ? "Main player" : "Farmhand")} with {onlineCount} {(onlineCount == 1 ? "player" : "players")} online."; + } + else + context += " Single-player."; + this.Monitor.Log(context, LogLevel.Trace); + + // raise events this.RaisedAfterLoadEvent = true; - this.Monitor.Log($"Context: loaded saved game '{Constants.SaveFolderName}', starting {Game1.currentSeason} {Game1.dayOfMonth} Y{Game1.year}.", LogLevel.Trace); this.Events.Save_AfterLoad.Raise(); this.Events.Time_AfterDayStarted.Raise(); } -- cgit