Add 'add buddy'?

This commit is contained in:
SilicaAndPina 2021-03-05 15:29:31 +13:00
parent 362f8a1490
commit b686afed61
10 changed files with 88 additions and 48 deletions

View file

@ -13,6 +13,11 @@ namespace HISP.Game
// Mod isle
public static string ModIsleMessage;
// Add Buddy
public static string AddBuddyPending;
public static string AddBuddyOtherPendingFormat;
public static string AddBuddyYourNowBuddiesFormat;
// Socials
public static string SocialButton;
public static string SocialMessageFormat;
@ -1020,7 +1025,14 @@ namespace HISP.Game
// Click
public static string NothingInterestingHere;
public static string FormatAddBuddyConfirmed(string playername)
{
return AddBuddyYourNowBuddiesFormat.Replace("%PLAYERNAME%", playername);
}
public static string FormatAddBuddyPendingOther(string playername)
{
return AddBuddyOtherPendingFormat.Replace("%PLAYERNAME%", playername);
}
public static string FormatOtherNoCompetitionGear(string pronoun)
{
return NoCompetitionGearOther.Replace("%PRONOUN%", pronoun);

View file

@ -1217,7 +1217,7 @@ namespace HISP.Game
message += Messages.BuddyListOfflineBuddys;
string username = Database.GetUsername(id);
int minutes = (DateTime.UtcNow - Converters.UnixTimeStampToDateTime(Database.GetPlayerLastLogin(id))).Minutes;
int minutes = Convert.ToInt32(Math.Round((Converters.UnixTimeStampToDateTime(Database.GetPlayerLastLogin(id)) - DateTime.UtcNow).TotalMinutes));
message += Messages.FormatOfflineBuddyEntry(username, id, minutes);
}
@ -1994,9 +1994,17 @@ namespace HISP.Game
public static string BuildPlayerList(User user)
{
string message = "";
int friendsOnline = 0;
foreach(int friendId in user.Friends.List)
{
if (GameServer.IsUserOnline(friendId))
friendsOnline++;
}
message += Messages.PlayerListHeader;
message += Messages.PlayerListSelectFromFollowing;
message += Messages.FormatPlayerBuddyList(user.Friends.Count);
message += Messages.FormatPlayerBuddyList(friendsOnline);
message += Messages.PlayerListOfNearby;
message += Messages.FormatPlayerList(GameServer.GetNumberOfPlayers() - 1);
message += Messages.PlayerListOfPlayersAlphabetically;