Remove mana checks from server side inventory, it's not synced by redigit's client properly.
This commit is contained in:
parent
d0a9b47f2f
commit
7fe6cde2d9
4 changed files with 3 additions and 16 deletions
|
|
@ -54,7 +54,6 @@ namespace TShockAPI.DB
|
||||||
{
|
{
|
||||||
playerData.exists = true;
|
playerData.exists = true;
|
||||||
playerData.maxHealth = reader.Get<int>("MaxHealth");
|
playerData.maxHealth = reader.Get<int>("MaxHealth");
|
||||||
playerData.maxMana = reader.Get<int>("MaxMana");
|
|
||||||
playerData.inventory = NetItem.Parse(reader.Get<string>("Inventory"));
|
playerData.inventory = NetItem.Parse(reader.Get<string>("Inventory"));
|
||||||
return playerData;
|
return playerData;
|
||||||
}
|
}
|
||||||
|
|
@ -79,7 +78,7 @@ namespace TShockAPI.DB
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
database.Query("INSERT INTO Inventory (Account, MaxHealth, MaxMana, Inventory) VALUES (@0, @1, @2, @3);", player.UserID, playerData.maxHealth, playerData.maxMana, NetItem.ToString(playerData.inventory));
|
database.Query("INSERT INTO Inventory (Account, MaxHealth, Inventory) VALUES (@0, @1, @2);", player.UserID, playerData.maxHealth, NetItem.ToString(playerData.inventory));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|
@ -91,7 +90,7 @@ namespace TShockAPI.DB
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
database.Query("UPDATE Inventory SET MaxHealth = @0, MaxMana = @1, Inventory = @2 WHERE Account = @3;", playerData.maxHealth, playerData.maxMana, NetItem.ToString(playerData.inventory), player.UserID);
|
database.Query("UPDATE Inventory SET MaxHealth = @0, Inventory = @1 WHERE Account = @2;", playerData.maxHealth, NetItem.ToString(playerData.inventory), player.UserID);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|
|
||||||
|
|
@ -180,11 +180,6 @@ namespace TShockAPI
|
||||||
args.Player.IgnoreActionsForCheating = true;
|
args.Player.IgnoreActionsForCheating = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.Player.IsLoggedIn)
|
|
||||||
{
|
|
||||||
args.Player.PlayerData.maxMana = max;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -440,7 +440,7 @@ namespace TShockAPI
|
||||||
{
|
{
|
||||||
public NetItem[] inventory = new NetItem[NetItem.maxNetInventory];
|
public NetItem[] inventory = new NetItem[NetItem.maxNetInventory];
|
||||||
public int maxHealth = 100;
|
public int maxHealth = 100;
|
||||||
public int maxMana = 100;
|
//public int maxMana = 100;
|
||||||
public bool exists = false;
|
public bool exists = false;
|
||||||
|
|
||||||
public PlayerData(TSPlayer player)
|
public PlayerData(TSPlayer player)
|
||||||
|
|
@ -481,7 +481,6 @@ namespace TShockAPI
|
||||||
public void CopyInventory(TSPlayer player)
|
public void CopyInventory(TSPlayer player)
|
||||||
{
|
{
|
||||||
this.maxHealth = player.TPlayer.statLifeMax;
|
this.maxHealth = player.TPlayer.statLifeMax;
|
||||||
this.maxMana = player.TPlayer.statManaMax;
|
|
||||||
Item[] inventory = player.TPlayer.inventory;
|
Item[] inventory = player.TPlayer.inventory;
|
||||||
Item[] armor = player.TPlayer.armor;
|
Item[] armor = player.TPlayer.armor;
|
||||||
for (int i = 0; i < NetItem.maxNetInventory; i++)
|
for (int i = 0; i < NetItem.maxNetInventory; i++)
|
||||||
|
|
|
||||||
|
|
@ -1050,12 +1050,6 @@ namespace TShockAPI
|
||||||
check = false;
|
check = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player.TPlayer.statManaMax > playerData.maxMana)
|
|
||||||
{
|
|
||||||
player.SendMessage("Error: Your max mana exceeded (" + playerData.maxMana + ") which is stored on server", Color.Cyan);
|
|
||||||
check = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
Item[] inventory = player.TPlayer.inventory;
|
Item[] inventory = player.TPlayer.inventory;
|
||||||
Item[] armor = player.TPlayer.armor;
|
Item[] armor = player.TPlayer.armor;
|
||||||
for (int i = 0; i < NetItem.maxNetInventory; i++)
|
for (int i = 0; i < NetItem.maxNetInventory; i++)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue