Closed Ulibos closed 2 months ago
Additionally, the "Fix/" prefix is not appropriate in my opinion, and I would change it to "refactor!: " (see https://www.conventionalcommits.org/en/v1.0.0/)
Flags added as needed. Let me know when good to push.
Status update here: https://github.com/Team-Silver-Sphere/SquadJS/pull/354#discussion_r1566462582 Sorry for bad placement, my github kung-fu is still weak.
New changes look good overall. The error handling of the new getAdminsWithPermission
is very clear and easy to understand.
I have closed #352 because it is already integrated into this PR so no unsatisfied dependencies left. #347 can be merged in after this PR.
Summary
This PR completes migration to eosIDs for the tool (except for a couple plugins, more on that below).
Dependencies
This PR depends on #352 and lays foundation for #347
Changes
There are 5 commits:
oldPlayerInfo
on player list updates (was annoying me a bit during testing).* - caveats
Testing
All of this was tested several times with event capture to make sure data is consistent. In summary (but not in 1 last go) I have tested:
connecting, disconnecting, possess, unpossess, create squad, kill (self inflicted), warn, force swap, kick, ban.
Only thing I didn't test for sure is a teamkill. I also am not aware if I had at least 1 run where I didn't have a steamID, most likely not. But so far generalized parsers work correctly, I haven't seen any errors in logs or missing data. I have also tested:
getAdminPermsByAnyID()
,getAdminsWithPermission()
(both were tested forserver.admins
with steamID or eosID),getPlayerByAnyID()
for both types of IDs, rcon methods (warn()
,switchTeam()
,kick()
,ban()
).Caveats
Testing Plugins
I didn't test plugins. We don't use any default ones and we don't have the necessary setup, plus the ones I've edited have mostly trivial fixes. The one I've fixed only partially is discord-killfeed, I didn't touch it's CBL integration. The ones I didn't touch at all are: db-log, awn-api, cbl-info. Some of these are completely unknown to me, some are too dependent on steamID to fix them in this PR. For now they will work as they were before as long as players have steamIDs.
Admins IDs
For now, there is a potential issue with an admin having 2 sets of permissions, one for eosID and another for steamID. Current code won't be able to merge it (at the time of merging it doesn't have persistent mapping of player's IDs). Easily avoidable though by not intermixing two ID formats. Another side-effect is that
getAdminsWithPermission()
will always return only those admins that have the permission AND are online (for at least 10 seconds). This happens because this method matches all existing IDs against all existing admin entries to convert them all to eosIDs.