Coding Help Mail Loading

SatriaCahaya

Farmhand
I wanted to send rewards to player through the mail. My method is OnSaveLoaded, i load a json file containing the mail i need and then insert the mail to the game's file using :

Game1.content.Load<Dictionary<string, string>>("Data\\Mail")[mailEntry.MailID] = mailContent;

after that i use :

Game1.mailbox.add(mailEntry.MailID);

To send the mail to the player.

It worked but it have an issue. The mail is sent on OnDayEnding event and the next day, the mail will be there. But when the player is not saving the game the next day, the mail is not there (probably because its nor loaded). On day 28, mail sent. On day 1, the mail there but if the player not saving the game on day 1. The mail is not there. Is there a way to fix this? My goal is the even if the player not saving, the mail is still there.

The reason i did this is because i need the player's data in the mail and the mail rewards are tied with the game's current year.
 

Nhibe

Greenhorn
I am not very good with programming, but can't you make the mail arrive in the same moment the player wake up so that the game is saved cause it save automatically between days.
The issue is that the mail is linked to the day it has been sent to cause the player moved on another day and if he doesn't save the day and leave and reenter the game the mail see that it isn't the day that should be sent. I tried my best to be to your help.
 
Top