resolve some warnings

This commit is contained in:
xuyuwtu 2026-01-29 15:16:53 +08:00
parent 75c8a8ced4
commit 4671a6d7f7
23 changed files with 156 additions and 161 deletions

View file

@ -107,6 +107,7 @@ namespace TShockAPI.DB
SqlType.Mysql => database.QueryScalar<int>("SELECT COUNT(table_name) FROM information_schema.tables WHERE table_schema = @0 and table_name = 'Bans'", TShock.Config.Settings.MySqlDbName),
SqlType.Sqlite => database.QueryScalar<int>("SELECT COUNT(name) FROM sqlite_master WHERE type='table' AND name = 'Bans'"),
SqlType.Postgres => database.QueryScalar<int>("SELECT COUNT(table_name) FROM information_schema.tables WHERE table_name = 'Bans'"),
_ => 0,
};
if (res != 0)

View file

@ -186,6 +186,7 @@ namespace TShockAPI.DB
/// Inserts player data to the tsCharacter database table
/// </summary>
/// <param name="player">player to take data from</param>
/// <param name="fromCommand">If <see langword="false"/>, the <see cref="Permissions.bypassssc"/> permission will be checked</param>
/// <returns>true if inserted successfully</returns>
public bool InsertPlayerData(TSPlayer player, bool fromCommand = false)
{

View file

@ -35,7 +35,6 @@ public sealed class DbBuilder
/// <summary>
/// Builds a DB connection based on the provided configuration.
/// </summary>
/// <param name="config">The TShock configuration.</param>
/// <remarks>
/// Default settings will result in a local sqlite database file named "tshock.db" in the current directory to be used as server DB.
/// </remarks>

View file

@ -172,7 +172,6 @@ namespace TShockAPI.DB
Permissions.item,
Permissions.give,
Permissions.heal,
Permissions.immunetoban,
Permissions.usebanneditem,
Permissions.allowclientsideworldedit,
Permissions.buff,

View file

@ -347,10 +347,10 @@ namespace TShockAPI.DB
}
/// <summary>
/// Gets all user accounts from the database with a username that starts with or contains <see cref="username"/>
/// Gets all user accounts from the database with a username that starts with or contains <paramref name="username"/>
/// </summary>
/// <param name="username">Rough username search. "n" will match "n", "na", "nam", "name", etc</param>
/// <param name="notAtStart">If <see cref="username"/> is not the first part of the username. If true then "name" would match "name", "username", "wordsnamewords", etc</param>
/// <param name="notAtStart">If <see href="username"/> is not the first part of the username. If true then "name" would match "name", "username", "wordsnamewords", etc</param>
/// <returns>Matching users or null if exception is thrown</returns>
public List<UserAccount> GetUserAccountsByName(string username, bool notAtStart = false)
{