ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   GetSecondsUntilCampaignEnd (https://www.esoui.com/forums/showthread.php?t=10180)

tim99 05/18/22 11:23 AM

GetSecondsUntilCampaignEnd
 
Hi all,
is there a special handling of Cyro-related API calls that i am not aware of is it even kinda buggy?

This call always returns "0":

Lua Code:
  1. /script d(GetSecondsUntilCampaignEnd(GetAssignedCampaignId()))

...until you once manually opened the campaign fragment/window (L).


After pressing L once, it returns a real value, which doesnt even gets lost after reloadui.

However logoff to character selection and back in resets it to return 0 all the time, until you opened again the campaign overview. :confused:

Same is for several other related calls like GetPlayerCampaignRewardTierInfo and IsUnderpopBonusEnabled.

Masteroshi430 05/18/22 12:12 PM

Most of campaign data is updated only when you open the campaign menu
Edit: read there : https://www.esoui.com/forums/showthread.php?t=10153

tim99 05/18/22 01:09 PM

Ok, thx for that! I see where we are going to. :(

But the funny thing is.... i even used the meantioned function before, but no difference.

Lua Code:
  1. LowPop = LowPop or {}
  2. local lp = LowPop
  3. lp.name = "LowPop"
  4.  
  5. --/script d(GetSecondsUntilCampaignEnd(GetAssignedCampaignId()))
  6. ----------------------------------------------------------------------------------------------------
  7. function lp.addonLoaded(event, addonName)
  8.     if addonName ~= lp.name then return end
  9.     EVENT_MANAGER:UnregisterForEvent(lp.name, EVENT_ADD_ON_LOADED)
  10.    
  11.     QueryCampaignSelectionData()
  12.     --QueryCampaignLeaderboardData()
  13.    
  14.     EVENT_MANAGER:RegisterForUpdate("LowPop_Update", 10000, function()
  15.         --QueryCampaignSelectionData()
  16.         d("|c00FF00 ### TEST GetSecondsUntilCampaignEnd: |r"..tostring(GetSecondsUntilCampaignEnd(GetAssignedCampaignId())))
  17.     end)
  18.    
  19. end
  20. ----------------------------------------------------------------------------------------------------
  21. EVENT_MANAGER:RegisterForEvent(lp.name, EVENT_ADD_ON_LOADED, lp.addonLoaded)

Returns "0" until "campaigns" opened. Anyone an idea why? :) :confused:


BTW:
What i had in mind is an addon to show when the LowPop Bonus gets enabled in Cyro. The above code is just cutted down to figure out whats going on. I used the given EVENT and not a generell 10sec timer to update. Thats just for testing!

Also changed isLowPopEnabled to the campaignEnds thing to be able to test. Was annoying in the beginning to wait until a real LowPop was enabled while spamming that L button :D

Also on the PTS is doesnt seem to work at all.

!!! If that helps, i can not publish that addon after figuring out, but just use myself and also can delete this post or blank out. So it will not "sum up" but is really just one call

Sharlikran 05/18/22 01:11 PM

So as mentioned in the thread creating a mod that forces that information to load (because it is heavy on the server) has a chance of resulting in the server gurus going crazy and preventing mods from accessing it altogether.

So while I don't use those features Masteroshi430 mentioned that their mod would try not to cause that to load until after a user uses the menu and the information loads. Hopefully that's how it is working.

If the information you want to display with your new mod is already on the screen after someone opens the campaign menu then why make a mod to display it prior to opening the menu that could lead to not being able to access the information at all.

Just some thoughts. I am of the opinion that when something has the potential to cause the server gurus grief, don't do it.

If your new mod could display a message that the information will be available after they have used the campaign menu then set that expectation. That way anyone using it would know it won't show up on login and only after they are in a campaign.

Sharlikran 05/18/22 01:13 PM

Quote:

Originally Posted by tim99 (Post 45931)
Returns "0" until "campaigns" opened. Anyone an idea why? :) :confused:

Maybe they already restrict it because others do this and it creates stress on the server? That is the point everyone is making.

Masteroshi430 05/18/22 01:31 PM

Quote:

Originally Posted by Sharlikran (Post 45932)
So while I don't use those features Masteroshi430 mentioned that their mod would try not to cause that to load until after a user uses the menu and the information loads. Hopefully that's how it is working.

:) Exactly:
https://www.esoui.com/downloads/info...owdednESO.html

tim99 05/19/22 04:56 PM

ok ok, so no juicy LowPop Addon :(

I still struggle a bit with: "here you have an Api-Function and Event-Callbacks... but don't use them, the server gets too busy" ...but well. ^^
Maybe i create a wish on the wishlist at some point... since its a like a buff, it's active or not, no need for population data, if thats the problem in the end.

Maybe they can make the existing call "IsUnderpopBonusEnabled" always return a real value like yes or no without loading all cyro data. :rolleyes:


All times are GMT -6. The time now is 01:41 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI