Backups added

Pvp throttle added
This commit is contained in:
high 2011-06-17 21:12:37 -04:00
parent 4339650439
commit c901e8482d
7 changed files with 550 additions and 396 deletions

View file

@ -34,6 +34,7 @@ namespace TShockAPI
public Group Group { get; set; }
public bool ReceivedInfo { get; set; }
public int Index { get; protected set; }
public DateTime LastPvpChange { get; protected set; }
public bool RealPlayer
{
get { return Index >= 0 && Index < Main.maxNetPlayers; }
@ -171,10 +172,12 @@ namespace TShockAPI
{
if (TPlayer.hostile != pvp)
{
LastPvpChange = DateTime.UtcNow;
TPlayer.hostile = pvp;
NetMessage.SendData((int)PacketTypes.TogglePVP, -1, -1, "", Index);
All.SendMessage(string.Format("{0} has {1} PvP!", Name, pvp ? "enabled" : "disabled"), Main.teamColor[Team]);
}
//Broadcast anyways to keep players synced
NetMessage.SendData((int)PacketTypes.TogglePVP, -1, -1, "", Index);
}
}