New config to disable dungeon guardian and instead send players to spawn (stops hack abuse)

Changed AlwaysPvp to support new features better.
Now checking ItemAnimation for stuff.
Initial data structures for Server Side Inventory handling support.
This commit is contained in:
Zidonuke 2011-12-20 13:12:27 -05:00
parent 7263ff3a9b
commit ad22a379d9
6 changed files with 228 additions and 16 deletions

View file

@ -64,6 +64,9 @@ namespace TShockAPI
public string Country = "??";
public int Difficulty;
private string CacheIP;
public bool IgnoreActionsForPvP = false;
public bool IgnoreActionsForInventory = false;
public PlayerData PlayerData;
public bool RealPlayer
{
@ -429,4 +432,52 @@ namespace TShockAPI
}
}
}
public class PlayerData
{
public NetItem[] inventory = new NetItem[NetItem.maxNetInventory];
public int maxHealth = 100;
public int maxMana = 100;
public string accountName;
public string characterName;
public bool exists = false;
public PlayerData(TSPlayer player)
{
this.accountName = player.UserAccountName;
this.characterName = player.Name;
this.inventory[0].netID = -15;
this.inventory[0].stack = 1;
if(player.TPlayer.inventory[0].netID == -15)
this.inventory[0].prefix = player.TPlayer.inventory[0].prefix;
this.inventory[1].netID = -13;
this.inventory[1].stack = 1;
if (player.TPlayer.inventory[1].netID == -13)
this.inventory[1].prefix = player.TPlayer.inventory[1].prefix;
this.inventory[2].netID = -16;
this.inventory[2].stack = 1;
if (player.TPlayer.inventory[2].netID == -16)
this.inventory[2].prefix = player.TPlayer.inventory[2].prefix;
}
}
public class NetItem
{
public static int maxNetInventory = 59;
public int netID = 0;
public int stack = 0;
public int prefix = 0;
public static string ToString(NetItem[] inventory)
{
string inventoryString = "";
return inventoryString;
}
public static NetItem[] Parse(string data)
{
NetItem[] inventory = new NetItem[NetItem.maxNetInventory];
return inventory;
}
}
}