mtasa-blue icon indicating copy to clipboard operation
mtasa-blue copied to clipboard

Add new account events: onAccountCreate/onAccountRemove

Open TracerDS opened this issue 2 years ago • 5 comments

New events:

  • onAccountCreate (takes 1 parameter: account)
  • onAccountRemove (takes 1 parameter: account)

TracerDS avatar May 20 '23 20:05 TracerDS

looks okey for me

CrosRoad95 avatar May 21 '23 05:05 CrosRoad95

What kind of use case do you have for these two events? Also, assuming you've tested these events, can you even process the events for "console accounts" and does it even make sense to trigger that event for guest accounts?

botder avatar Jul 24 '23 22:07 botder

What kind of use case do you have for these two events?

Well, we have some events for creation of elements (onClientProjectileCreation, onClientBrowserCreated), why not have one for creation of accounts?

can you even process the events for "console accounts"

Yes, sir.

For guest accounts, its a debatable thing in my opinion. It may or may not be necessary to fire an event when someone joins but its better to have more than less. or maybe other event (onGuestAccountCreated) might be fired specifically for guest accounts?

TracerDS avatar Jul 25 '23 08:07 TracerDS

As you decided to refactor the existing code I would suggest to take a look at CRegistryResultCell. It stores nVal, fVal and pVal all the time but only one can be in use at one time. So its better to use union to save memory and promote true sharing while looping.

tederis avatar Jul 25 '23 09:07 tederis

For guest accounts, its a debatable thing in my opinion. It may or may not be necessary to fire an event when someone joins but its better to have more than less. or maybe other event (onGuestAccountCreated) might be fired specifically for guest accounts?

I can understand having the even trigger for player accounts, but I don't see any value for console or guest accounts - that's just noise.

botder avatar Jul 25 '23 10:07 botder

This has had enough feedback and eyes, thanks!

@TracerDS please add the 2 events and function to the wiki

Dutchman101 avatar May 25 '24 23:05 Dutchman101