Save player data on backups
Server Side Inventory security improvements, blocking trashcan and "banks" items CovertCorruption is now more thorough. PvP Modes, normal, always, disabled now configurable Initial group prefix/suffix implementation Range checks reworked, Killing ice blocks now ignored for ice rod. Adding a NPC name to item banlist will block it from spawning Added configs to disable snowballs and clown bombs from npcs.
This commit is contained in:
parent
fc735ba829
commit
8cf298ad85
10 changed files with 133 additions and 30 deletions
|
|
@ -21,7 +21,9 @@ namespace TShockAPI.DB
|
|||
new SqlColumn("GroupName", MySqlDbType.VarChar, 32) { Primary = true },
|
||||
new SqlColumn("Parent", MySqlDbType.VarChar, 32),
|
||||
new SqlColumn("Commands", MySqlDbType.Text),
|
||||
new SqlColumn("ChatColor", MySqlDbType.Text)
|
||||
new SqlColumn("ChatColor", MySqlDbType.Text),
|
||||
new SqlColumn("Prefix", MySqlDbType.Text),
|
||||
new SqlColumn("Suffix", MySqlDbType.Text)
|
||||
);
|
||||
var creator = new SqlTableCreator(db, db.GetSqlType() == SqlType.Sqlite ? (IQueryBuilder)new SqliteQueryCreator() : new MysqlQueryCreator());
|
||||
creator.EnsureExists(table);
|
||||
|
|
@ -199,6 +201,9 @@ namespace TShockAPI.DB
|
|||
string groupname = reader.Get<String>("GroupName");
|
||||
var group = new Group(groupname);
|
||||
|
||||
group.Prefix = reader.Get<String>("Prefix");
|
||||
group.Suffix= reader.Get<String>("Suffix");
|
||||
|
||||
//Inherit Given commands
|
||||
String[] commands = reader.Get<String>("Commands").Split(',');
|
||||
foreach (var t in commands)
|
||||
|
|
|
|||
|
|
@ -68,15 +68,18 @@ namespace TShockAPI.DB
|
|||
return playerData;
|
||||
}
|
||||
|
||||
public bool InsertPlayerData(TSPlayer player, int acctid)
|
||||
public bool InsertPlayerData(TSPlayer player)
|
||||
{
|
||||
PlayerData playerData = player.PlayerData;
|
||||
|
||||
if (!GetPlayerData(player, acctid).exists)
|
||||
if (!player.IsLoggedIn)
|
||||
return false;
|
||||
|
||||
if (!GetPlayerData(player, player.UserID).exists)
|
||||
{
|
||||
try
|
||||
{
|
||||
database.Query("INSERT INTO Inventory (Account, MaxHealth, MaxMana, Inventory) VALUES (@0, @1, @2, @3);", acctid, playerData.maxHealth, playerData.maxMana, NetItem.ToString(playerData.inventory));
|
||||
database.Query("INSERT INTO Inventory (Account, MaxHealth, MaxMana, Inventory) VALUES (@0, @1, @2, @3);", player.UserID, playerData.maxHealth, playerData.maxMana, NetItem.ToString(playerData.inventory));
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
|
@ -88,7 +91,7 @@ namespace TShockAPI.DB
|
|||
{
|
||||
try
|
||||
{
|
||||
database.Query("UPDATE Inventory SET MaxHealth = @0, MaxMana = @1, Inventory = @2 WHERE Account = @3;", playerData.maxHealth, playerData.maxMana, NetItem.ToString(playerData.inventory), acctid);
|
||||
database.Query("UPDATE Inventory SET MaxHealth = @0, MaxMana = @1, Inventory = @2 WHERE Account = @3;", playerData.maxHealth, playerData.maxMana, NetItem.ToString(playerData.inventory), player.UserID);
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue