Skip to content

Commit

Permalink
fix: buff timers
Browse files Browse the repository at this point in the history
DorielRivalet committed Feb 9, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 400fcfc commit 1289ddb
Showing 3 changed files with 29 additions and 9 deletions.
8 changes: 7 additions & 1 deletion MHFZ_Overlay/Models/Addresses/AddressModelHGE.cs
Original file line number Diff line number Diff line change
@@ -1837,7 +1837,13 @@ public AddressModelHGE(Mem m)
public override int ActiveFeature3() => this.M.Read2Byte("mhfo-hd.dll+E41A2A8");

/// <inheritdoc/>
public override int ServerHeartbeat() => this.M.ReadInt("mhfo-hd.dll+EABD4F0");
public override int ServerHeartbeatLandOdd() => this.M.ReadInt("mhfo-hd.dll+EABD4F0");

/// <inheritdoc/>
public override int ServerHeartbeatLandEven() => this.M.ReadInt("mhfo-hd.dll+E9D1EB0");

/// <inheritdoc/>
public override int LandSlot() => this.M.ReadInt("mhfo-hd.dll+EDFB940");

/// <inheritdoc/>
public override int GuildFoodStart() => this.M.ReadInt("mhfo-hd.dll+E7FED08");
8 changes: 7 additions & 1 deletion MHFZ_Overlay/Models/Addresses/AddressModelNotHGE.cs
Original file line number Diff line number Diff line change
@@ -1756,7 +1756,13 @@ public AddressModelNotHGE(Mem m)
public override int ActiveFeature3() => this.M.Read2Byte("mhfo.dll+57E26E8");

/// <inheritdoc/>
public override int ServerHeartbeat() => this.M.ReadInt("mhfo.dll+5E83A00");
public override int ServerHeartbeatLandOdd() => this.M.ReadInt("mhfo.dll+5E83A00");

/// <inheritdoc/>
public override int ServerHeartbeatLandEven() => this.M.ReadInt("mhfo.dll+5D983C0");

/// <inheritdoc/>
public override int LandSlot() => this.M.ReadInt("mhfo.dll+61C11A0");

/// <inheritdoc/>
public override int GuildFoodStart() => this.M.ReadInt("mhfo.dll+5BC70E0");
22 changes: 15 additions & 7 deletions MHFZ_Overlay/ViewModels/Windows/AddressModel.cs
Original file line number Diff line number Diff line change
@@ -1341,11 +1341,18 @@ 21747 or
/// <returns></returns>
public abstract int ActiveFeature3();

public abstract int ServerHeartbeatLandEven();

public abstract int ServerHeartbeatLandOdd();

public abstract int LandSlot();


/// <summary>
/// Updates every 11 seconds
/// </summary>
/// <returns></returns>
public abstract int ServerHeartbeat();
public int ServerHeartbeat => LandSlot() % 2 == 0 ? ServerHeartbeatLandEven() : ServerHeartbeatLandOdd();

public abstract int GuildFoodStart();

@@ -2615,7 +2622,7 @@ public bool DivaSongEnding
}

var expiry = divaSongStart + (60 * 90);
double secondsLeft = expiry - ServerHeartbeat();
double secondsLeft = expiry - ServerHeartbeat;

return secondsLeft <= 60*10;
}
@@ -2633,7 +2640,7 @@ public bool DivaSongEnded
}

var expiry = divaSongStart + (60 * 90);
double secondsLeft = expiry - ServerHeartbeat();
double secondsLeft = expiry - ServerHeartbeat;

return secondsLeft <= 0;
}
@@ -2659,7 +2666,7 @@ public bool GuildFoodEnding
}

var expiry = GuildFoodStart() + (60 * 90);
double secondsLeft = expiry - ServerHeartbeat();
double secondsLeft = expiry - ServerHeartbeat;

return secondsLeft <= 60 * 10;
}
@@ -2675,7 +2682,7 @@ public bool GuildFoodEnded
}

var expiry = GuildFoodStart() + (60 * 90);
double secondsLeft = expiry - ServerHeartbeat();
double secondsLeft = expiry - ServerHeartbeat;

return secondsLeft <= 0;
}
@@ -2766,6 +2773,7 @@ public string GetRunBuffsTag(RunBuff runBuff)
{
return runBuff switch
{
RunBuff.None => "None",
RunBuff.LeaderboardTimeAttack => "TA",
RunBuff.LeaderboardFreestyleDivaSkill => "FDS",
RunBuff.LeaderboardFreestyleDivaPrayerGem => "FDP",
@@ -13596,7 +13604,7 @@ public string GuildFoodTimeLeft
}

var expiry = GuildFoodStart() + (60 * 90);
double secondsLeft = expiry - ServerHeartbeat();
double secondsLeft = expiry - ServerHeartbeat;

if (secondsLeft <= 0)
{
@@ -13619,7 +13627,7 @@ public string DivaSongTimeLeft
}

var expiry = divaSongStart + (60 * 90);
double secondsLeft = expiry - ServerHeartbeat();
double secondsLeft = expiry - ServerHeartbeat;

if (secondsLeft <= 0)
{

0 comments on commit 1289ddb

Please sign in to comment.