mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-23 13:15:53 +12:00
Add ranches.
This commit is contained in:
parent
2e713f4fd5
commit
9f592fb51b
14 changed files with 918 additions and 159 deletions
|
@ -3208,6 +3208,22 @@ namespace HISP.Server
|
|||
return subscribedUntil;
|
||||
}
|
||||
}
|
||||
public static bool IsUserAdmin(int playerId)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
|
||||
sqlCommand.CommandText = "SELECT Admin FROM Users WHERE Id=@playerId";
|
||||
sqlCommand.Parameters.AddWithValue("@playerId", playerId);
|
||||
sqlCommand.Prepare();
|
||||
bool admin = sqlCommand.ExecuteScalar().ToString() == "YES";
|
||||
sqlCommand.Dispose();
|
||||
|
||||
return admin;
|
||||
}
|
||||
}
|
||||
public static bool IsUserSubscribed(int playerId)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
|
@ -3365,6 +3381,21 @@ namespace HISP.Server
|
|||
}
|
||||
}
|
||||
|
||||
public static void RemoveAllItemTypesFromPlayerInventory(int playerId, int itemId)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
|
||||
sqlCommand.CommandText = "DELETE FROM Inventory WHERE (PlayerId=@playerId AND ItemID=@itemId)";
|
||||
sqlCommand.Parameters.AddWithValue("@playerId", playerId);
|
||||
sqlCommand.Parameters.AddWithValue("@itemId", itemId);
|
||||
sqlCommand.Prepare();
|
||||
sqlCommand.ExecuteNonQuery();
|
||||
sqlCommand.Dispose();
|
||||
}
|
||||
}
|
||||
public static void RemoveItemFromInventory(int playerId, ItemInstance instance)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue