Civcraft / JukeAlert

Do not open issues here; open them on the maintained fork @ DevotedMC
https://github.com/DevotedMC/JukeAlert
BSD 3-Clause "New" or "Revised" License
5 stars 15 forks source link

Change namelayer listeners to GroupInvalidationEvent #46

Closed Maxopoly closed 8 years ago

Maxopoly commented 8 years ago

Currently here: https://github.com/Civcraft/JukeAlert/blob/master/src/com/untamedears/JukeAlert/listener/JukeAlertListener.java#L254

So we need to fix up the listener for a GroupMergeEvent and a GroupDeletionEvent and make them in line with the event added here: https://github.com/Civcraft/NameLayer/pull/142/files

When a group gets merged or deleted, it gets completly deleted on all shards and then pulled from the db again, the problem with that here is that we dont have a group object to give to the snitch as a new owner after a merge. For deletions we can just directly use the groupname thats given as parameter with the event, but for merging we need an actual group and we cant pull that from Namelayers groupmanager either, because it doesnt exist in there when our JA listener would be called, it's only in the db. We could just schedule the snitch group merging and do it one tick later, but thats kinda ugly, better ideas would be appreciated.

rourke750 commented 8 years ago

Mercury passes the groups that are being merged as well as the previous group https://github.com/Civcraft/NameLayer/blob/master/src/vg/civcraft/mc/namelayer/GroupManager.java#L115 same with delete.

Maxopoly commented 8 years ago

Yeah, but we dont have that event on all the other shards that the command isnt run on.

rourke750 commented 8 years ago

Just have jukealert listen for the new one and do what it needs to. It can still have the info it needs.

Maxopoly commented 8 years ago

No idea what you mean, sorry

Maxopoly commented 8 years ago

https://github.com/Civcraft/JukeAlert/commit/d89ca816c35259401778e35bf0f7c1f97a3a81a3