EXILED
EXILED copied to clipboard
Feature quick player info access
[Potentially breaking change]
Instead of passing back IEnumerables after having to iterate every player again and again, instead use a dictionary that updates on player role change, and when a player leaves. That's the whole point - I am tired but from my testing it works fine. Feedback is appreciated. Thanks (Also for the dictionary add/remove, yes I could assign every possible role to a new dictionary but I was lazy and this at least allows dynamic updates in case someone messes up and does not update it)
Also it seems dev and 5.3 have some different changes, so you'll see some weird changes that were not my own, but rather the merge differences
Do not merge until consensus is agreed upon
can you try it ? now i thinks it's all done if all work perfectly
Way to prevent Player from being added (npcs) and option to reset & resync lists incase something happens / on round end?
Way to prevent Player from being added (npcs) and option to reset & resync lists incase something happens / on round end?
Npc should not being in Player.List
Way to prevent Player from being added (npcs) and option to reset & resync lists incase something happens / on round end?
So, I got 4 hours of sleep again, because I took a nap like an idiot, and like a bigger idiot I forgot to set an alarm so, forgive me for my stupidity (I promise I will sleep correctly today)
So you want an NPC to not be added to a list of players by role - I cannot think of a scenario where someone would want to do that, but my previous logic would have allowed you to modify it after a player changed role. If you can give me a good scenario I will add it (Not trying to be rude I just can't think very well right now) Update: Pets? Maybe? I guess?
For the second half of your question, on server restart, everything gets wiped, no? However, I am not opposed to adding that functionality - Would you prefer a static api call for a resync, and a EventHander extra field to reset on round end?
Yeah that would Work fine, also funny npcs API in exiled 6 (hopefully)
@moddedmcplayer I have added what you've asked - see ReSyncAllInstantiatedContainers, ResetAllInstantiatedContainers, and ReSyncContainersToDefault. @IRacle1 Can you confirm my understanding of new Dictionary(previous dictionary) - This process is a shallow copy right, it won't copy the underlying reference, correct? (I added internal default dictionaries for this system)
@moddedmcplayer I have added what you've asked - see ReSyncAllInstantiatedContainers, ResetAllInstantiatedContainers, and ReSyncContainersToDefault. @IRacle1 Can you confirm my understanding of new Dictionary(previous dictionary) - This process is a shallow copy right, it won't copy the underlying reference, correct? (I added internal default dictionaries for this system)
yea, truth
@moddedmcplayer I have added what you've asked - see ReSyncAllInstantiatedContainers, ResetAllInstantiatedContainers, and ReSyncContainersToDefault. @IRacle1 Can you confirm my understanding of new Dictionary(previous dictionary) - This process is a shallow copy right, it won't copy the underlying reference, correct? (I added internal default dictionaries for this system)
yea, truth
Ty ❤️
But I'm not sure that the refs to HashSet's will change (more precisely, I'm 90% sure that the HashSet's will be copied into the dictionaries by ref)
I dont like those internals, they can be broken with updates easily.
Just make them a methods to generate them dynamicly.
I dont like those internals, they can be broken with updates easily.
Just make them a methods to generate them dynamicly.
https://github.com/Exiled-Team/EXILED/pull/1300#discussion_r909194933
I made that point; however, if you believe I should revert back to dynamic, I can.
Closing due to inactivity from reviewers. If someone wants this, re-open or create new PR.