Pvp with no team (#2851)
* Update TShockConfig.cs * Update TShock.cs * Update GetDataHandlers.cs * Update changelog.md * Update GetDataHandlers.cs * Update changelog.md * Update changelog.md * Update changelog.md
This commit is contained in:
parent
95d157fd5d
commit
e46bbe99c0
4 changed files with 8 additions and 5 deletions
|
|
@ -113,8 +113,8 @@ namespace TShockAPI.Configuration
|
|||
[Description("Enables never ending invasion events. You still need to start the event, such as with the /invade command.")]
|
||||
public bool InfiniteInvasion;
|
||||
|
||||
/// <summary>Sets the PvP mode. Valid types are: "normal", "always", "disabled".</summary>
|
||||
[Description("Sets the PvP mode. Valid types are: \"normal\", \"always\" and \"disabled\".")]
|
||||
/// <summary>Sets the PvP mode. Valid types are: "normal", "always", "pvpwithnoteam", "disabled".</summary>
|
||||
[Description("Sets the PvP mode. Valid types are: \"normal\", \"always\", \"pvpwithnoteam\" and \"disabled\".")]
|
||||
public string PvPMode = "normal";
|
||||
|
||||
/// <summary>Prevents tiles from being placed within SpawnProtectionRadius of the default spawn.</summary>
|
||||
|
|
|
|||
|
|
@ -3092,7 +3092,7 @@ namespace TShockAPI
|
|||
}
|
||||
|
||||
string pvpMode = TShock.Config.Settings.PvPMode.ToLowerInvariant();
|
||||
if (pvpMode == "disabled" || pvpMode == "always" || (DateTime.UtcNow - args.Player.LastPvPTeamChange).TotalSeconds < 5)
|
||||
if (pvpMode == "disabled" || pvpMode == "always" || pvpMode == "pvpwithnoteam" || (DateTime.UtcNow - args.Player.LastPvPTeamChange).TotalSeconds < 5)
|
||||
{
|
||||
TShock.Log.ConsoleDebug(GetString("GetDataHandlers / HandleTogglePvp rejected fastswitch {0}", args.Player.Name));
|
||||
args.Player.SendData(PacketTypes.TogglePvp, "", id);
|
||||
|
|
@ -3349,7 +3349,8 @@ namespace TShockAPI
|
|||
if (id != args.Player.Index)
|
||||
return true;
|
||||
|
||||
if ((DateTime.UtcNow - args.Player.LastPvPTeamChange).TotalSeconds < 5)
|
||||
string pvpMode = TShock.Config.Settings.PvPMode.ToLowerInvariant();
|
||||
if (pvpMode == "pvpwithnoteam" || (DateTime.UtcNow - args.Player.LastPvPTeamChange).TotalSeconds < 5)
|
||||
{
|
||||
args.Player.SendData(PacketTypes.PlayerTeam, "", id);
|
||||
TShock.Log.ConsoleDebug(GetString("GetDataHandlers / HandlePlayerTeam rejected team fastswitch {0}", args.Player.Name));
|
||||
|
|
|
|||
|
|
@ -1676,7 +1676,7 @@ namespace TShockAPI
|
|||
player.SendFileTextAsMessage(FileTools.MotdPath);
|
||||
|
||||
string pvpMode = Config.Settings.PvPMode.ToLowerInvariant();
|
||||
if (pvpMode == "always")
|
||||
if (pvpMode == "always" || pvpMode == "pvpwithnoteam")
|
||||
{
|
||||
player.TPlayer.hostile = true;
|
||||
player.SendData(PacketTypes.TogglePvp, "", player.Index);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue