Aperture-Development/MSync-2

Feature Request

ihatemagic opened this issue · 3 comments

Description:
Improve the Nickname feature for MBSync. Right now, Nicknames are only saved if players are banned while on the server or if they recently left. If I use ban on the ULX Ban tab, I can put in a nickname for the player, and it will show up on the list with a nickname. However, on MBSync, the nickname will only show "None Given." It would be great to have MBSync also use the nickname from the ULX ban function on the ban tab. Another great feature would be to be able to change the Nickname, as it is currently locked like SteamID.

Usage Cases:
Reading through a list of bans, it makes it easier to identify a player by name.

Optional: Alternatives
Create a feature that syncs bans already in place, including all bans before MSync2 was installed.

What you are describing is the intended fallback if the user has not been found in the MSync database. In case a user gets banned but hasn't been created yet ( meaning they haven't joined the server while MSync was installed ), a placeholder user gets created and then banned. The issue here is that I cannot know the nickname of the user you are banning before they have joined once, so instead of filling in a Nickname it simply sets the nickname to "None Given".

As for changing the nickname, I need to think about that.

As for the alternative request, MBSync 1.3.2 comes with a import and export ban command, allowing you to import bans from ULX as well as export them to ULX. You can find a description about that feature in the latest update message here: https://github.com/Aperture-Development/MSync-2/releases/tag/v1.3.0

I see -- I did not realize there is an export/import ban, thank you for bringing that to my attention! However, when I attempted use the import command, it created this error.


Please include this in a Bug report:

Column 'user_id' cannot be null

I think this happens if MBSync is trying to add a ban to a SteamID that doesn't exist on tbl_users. Here is the query:

transactions[k] = MSync.DBServer:prepare( [[
INSERT INTO tbl_mbsync (user_id, admin_id, reason, date_unix, length_unix, server_group)
VALUES (
(SELECT p_user_id FROM tbl_users WHERE steamid=?),
(SELECT p_user_id FROM tbl_users WHERE steamid=?),
?, ?, ?,
(SELECT p_group_id FROM tbl_server_grp WHERE group_name=?)
);
]] )

Oh, it seems that I have forgotten to add the transaction for creating the user in the first place. The function was intended to, create the user if it doesn't exist and then add the ban to the database. This needs to be fixed