Skip to content

Commit

Permalink
Update minSecondsToWait
Browse files Browse the repository at this point in the history
  • Loading branch information
Lacyway committed Oct 16, 2024
1 parent e98a078 commit a0421bb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Fika.Core/UI/Custom/MainMenuUIScript.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ public static MainMenuUIScript Instance
private List<GameObject> players;
private DateTime lastRefresh;
private DateTime lastSet;
private int minSecondsToWait;

private void Start()
{
instance = this;
minSecondsToWait = 2;
players = [];
lastRefresh = DateTime.Now;
lastSet = DateTime.Now;
Expand Down Expand Up @@ -123,7 +125,7 @@ private void SetupPlayers(ref FikaPlayerPresence[] responses)
public void UpdatePresence(EFikaPlayerPresence presence)
{
// Prevent spamming going back and forth to the main menu causing server lag for no reason
if ((DateTime.Now - lastSet).TotalSeconds < 5)
if ((DateTime.Now - lastSet).TotalSeconds < minSecondsToWait)
{
return;
}
Expand Down

0 comments on commit a0421bb

Please sign in to comment.