Merge branch 'general-devel' into feature/db-connectionstrings

This commit is contained in:
Sakura Isayeki 2025-05-25 17:37:08 +02:00 committed by GitHub
commit a6c00d10f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 57 additions and 28 deletions

View file

@ -82,7 +82,7 @@ namespace TShockAPI.DB
throw new Exception(GetString("Could not find a database library (probably Sqlite3.dll)"));
}
EnsureBansCollection();
UpdateBans();
TryConvertBans();
OnBanValidate += BanValidateCheck;
@ -90,14 +90,11 @@ namespace TShockAPI.DB
}
/// <summary>
/// Ensures the <see cref="_bans"/> collection is ready to use.
/// Updates the <see cref="_bans"/> collection from database.
/// </summary>
private void EnsureBansCollection()
public void UpdateBans()
{
if (_bans == null)
{
_bans = RetrieveAllBans().ToDictionary(b => b.TicketNumber);
}
_bans = RetrieveAllBans().ToDictionary(b => b.TicketNumber);
}
/// <summary>

View file

@ -93,6 +93,37 @@ namespace TShockAPI.DB
Permissions.whisper,
Permissions.wormhole));
AddDefaultGroup("insecure-guest", "",
string.Join(",",
Permissions.canbuild,
Permissions.canregister,
Permissions.canlogin,
Permissions.canpartychat,
Permissions.cantalkinthird,
Permissions.canchat,
Permissions.synclocalarea,
Permissions.sendemoji,
Permissions.warp,
Permissions.summonboss,
Permissions.spawnpets,
Permissions.worldupgrades,
Permissions.startinvasion,
Permissions.whisper,
Permissions.wormhole,
Permissions.canpaint,
Permissions.pylon,
Permissions.whisper,
Permissions.wormhole,
Permissions.tppotion,
Permissions.magicconch,
Permissions.demonconch,
Permissions.movenpc,
Permissions.worldupgrades,
Permissions.rod,
Permissions.hurttownnpc,
Permissions.startdd2,
Permissions.spawnpets));
AddDefaultGroup("newadmin", "vip",
string.Join(",",
Permissions.kick,