Add %UNBAN

This commit is contained in:
SilicaPi 2021-02-02 18:35:50 +13:00
parent 49522e9fef
commit 3be40efc5e
4 changed files with 53 additions and 5 deletions

View file

@ -53,7 +53,6 @@ namespace HISP.Server
}
catch (Exception e)
{
Logger.DebugPrint(e.GetType().ToString());
Logger.WarnPrint(e.Message);
};
@ -667,6 +666,19 @@ namespace HISP.Server
}
}
public static void UnBanUser(int userId)
{
using (MySqlConnection db = new MySqlConnection(ConnectionString))
{
db.Open();
MySqlCommand sqlCommand = db.CreateCommand();
sqlCommand.CommandText = "DELETE FROM BannedPlayers WHERE playerId=@playerId";
sqlCommand.Parameters.AddWithValue("@playerId", userId);
sqlCommand.ExecuteNonQuery();
sqlCommand.Dispose();
}
}
public static bool IsIpBanned(string ip)
{