Thread Tools Display Modes
02/11/20, 08:38 AM   #1
ArtOfShred
 
ArtOfShred's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2016
Posts: 103
[open] GetGroupElectionInfo() doesn't update on EVENT_GROUP_ELECTION_REQUESTED

Code:
GetGroupElectionInfo()
    Returns: number GroupElectionType electionType, number timeRemainingSeconds, string electionDescriptor, string targetUnitTag
While writing a function for LUIE I discovered some odd behavior with this function. I hooked into the alert handler for EVENT_GROUP_ELECTION_REQUESTED in hopes of enhancing the message this function displays for initiating a votekick. ("You have initiated a vote..." into something listing the character name of the player.)

The event only has "descriptor" as a value though which is either "[ZO_NONE]" or "[ZO_READY_CHECK]." So in order to get the relevant information I needed to use GetGroupElectionInfo() to get the unitTag for the name of the player being votekicked.

This is when I discovered that GetGroupElectionInfo() doesn't update when the local player makes an election request (we get an event for this through EVENT_GROUP_ELECTION_REQUESTED).

The info returned by GetGroupElectionInfo() will only update once the group election has a result. This means the values returned by GetGroupElectionInfo() will be incorrect at the time of initiating an election for the local player before the election has been resolved.

Other players in the group don't have the same issue as when the election request is submitted GetGroupElectionInfo() will immediately return proper values for the currently active election.

The expected behavior of the result for GetGroupElectionInfo() would be to update on the backend simultaneously with EVENT_GROUP_ELECTION_REQUESTED so that we can pull accurate values for the local player requesting the election as well.
  Reply With Quote
02/17/20, 02:06 PM   #2
ZOS_DanBatson
ZOS Staff!
 
ZOS_DanBatson's Avatar
Yes this person is from ZeniMax!
Join Date: Jul 2015
Posts: 171
Thank for pointing this out. It was built so that you only fill out that info when an election is successfully created on the backend, but it's also built to not notify the initiator because they don't need to actually vote. I can probably make it so I fill out the intended data so the initiator has access to it. Of note, just because that info is there doesn't mean a vote actually started. You still need to be prepared for a possible EVENT_GROUP_ELECTION_FAILED event immediately after EVENT_GROUP_ELECTION_REQUESTED.
  Reply With Quote
02/17/20, 02:30 PM   #3
ArtOfShred
 
ArtOfShred's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2016
Posts: 103
Question

Originally Posted by ZOS_DanBatson View Post
Thank for pointing this out. It was built so that you only fill out that info when an election is successfully created on the backend, but it's also built to not notify the initiator because they don't need to actually vote. I can probably make it so I fill out the intended data so the initiator has access to it. Of note, just because that info is there doesn't mean a vote actually started. You still need to be prepared for a possible EVENT_GROUP_ELECTION_FAILED event immediately after EVENT_GROUP_ELECTION_REQUESTED.
Awesome that would work perfectly for what I need it for (just notification purposes).

I think one of the election failure reasons already is NO_ELECTION probably so that would be fine.

EDIT: Or hmm the only one I see possible related is GROUP_ELECTION_RESULT_NOT_APPLICABLE, I imagine that probably handles when there is no current election.

Last edited by ArtOfShred : 02/17/20 at 02:35 PM.
  Reply With Quote

ESOUI » Developer Discussions » Bug Reports » [open] GetGroupElectionInfo() doesn't update on EVENT_GROUP_ELECTION_REQUESTED

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off