diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-05-24 22:24:30 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-05-24 22:24:30 -0400 |
commit | 47ab534bee74904e2ae84ef569f65b4e26623059 (patch) | |
tree | 95e5d2bb3b243f6f9e5a586f8c3de7906a6b4a27 /src/SMAPI/Framework/SGame.cs | |
parent | e40d099112f6bfd355dc0546b0df8229985deb24 (diff) | |
download | SMAPI-47ab534bee74904e2ae84ef569f65b4e26623059.tar.gz SMAPI-47ab534bee74904e2ae84ef569f65b4e26623059.tar.bz2 SMAPI-47ab534bee74904e2ae84ef569f65b4e26623059.zip |
tweak context trace messages to make multiplayer context more clear
Diffstat (limited to 'src/SMAPI/Framework/SGame.cs')
-rw-r--r-- | src/SMAPI/Framework/SGame.cs | 13 |
1 files changed, 12 insertions, 1 deletions
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(); } |