fix mail count

This commit is contained in:
SilicaAndPina 2021-06-28 02:14:50 +12:00
parent e5fa0caccd
commit 6ff3d91135
2 changed files with 6 additions and 3 deletions

View file

@ -23,8 +23,12 @@ namespace HISP.Player
{ {
int i = 0; int i = 0;
foreach (Mail mail in MailMessages) foreach (Mail mail in MailMessages)
{
if (!mail.Read) if (!mail.Read)
{
i++; i++;
}
}
return i; return i;
} }
} }
@ -82,8 +86,7 @@ namespace HISP.Player
mails[i].Read = true; mails[i].Read = true;
} }
byte[] BaseStatsPacketData = PacketBuilder.CreatePlayerData(baseUser.Money, GameServer.GetNumberOfPlayers(), this.UnreadMailCount); GameServer.UpdatePlayer(baseUser.LoggedinClient);
baseUser.LoggedinClient.SendPacket(BaseStatsPacketData);
} }
public void AddMail(Mail mailMessage) public void AddMail(Mail mailMessage)
{ {

View file

@ -7535,7 +7535,7 @@ namespace HISP.Server
Logger.ErrorPrint(forClient.RemoteIp + "tried to update player information when not logged in."); Logger.ErrorPrint(forClient.RemoteIp + "tried to update player information when not logged in.");
return; return;
} }
byte[] PlayerData = PacketBuilder.CreatePlayerData(forClient.LoggedinUser.Money, GameServer.GetNumberOfPlayers(), forClient.LoggedinUser.MailBox.MailCount); byte[] PlayerData = PacketBuilder.CreatePlayerData(forClient.LoggedinUser.Money, GameServer.GetNumberOfPlayers(), forClient.LoggedinUser.MailBox.UnreadMailCount);
forClient.SendPacket(PlayerData); forClient.SendPacket(PlayerData);
} }
public static void UpdateUserFacingAndLocation(User user) public static void UpdateUserFacingAndLocation(User user)