From bfdcea5dd802bf72db07543cd338ae8fc564de46 Mon Sep 17 00:00:00 2001
From: Lucas Nicodemus
Date: Wed, 19 Apr 2017 16:02:56 -0600
Subject: [PATCH 01/78] Update submodule to t-1.3.5 branch
---
TerrariaServerAPI | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/TerrariaServerAPI b/TerrariaServerAPI
index 3b96d98a..5a5b0e9e 160000
--- a/TerrariaServerAPI
+++ b/TerrariaServerAPI
@@ -1 +1 @@
-Subproject commit 3b96d98a37c96c2a5969bfd4bf63a2fd4371ed46
+Subproject commit 5a5b0e9ee39af91e4d584eaa63e5af104803200f
From d50fa2fbc44b7ad8401e1ed5a29f337fead3348a Mon Sep 17 00:00:00 2001
From: Lucas Nicodemus
Date: Wed, 19 Apr 2017 16:03:25 -0600
Subject: [PATCH 02/78] Mark create release script executable
---
scripts/create_release.py | 0
1 file changed, 0 insertions(+), 0 deletions(-)
mode change 100644 => 100755 scripts/create_release.py
diff --git a/scripts/create_release.py b/scripts/create_release.py
old mode 100644
new mode 100755
From 2a5efa65aec65d9ac3c685675e4eb86de7558f0e Mon Sep 17 00:00:00 2001
From: Lucas Nicodemus
Date: Wed, 19 Apr 2017 17:12:38 -0600
Subject: [PATCH 03/78] Saving work to apply merge changes
Currently moving .name to .Name and things like that from Item
---
.gitignore | 4 ++--
TShockAPI/DB/ItemManager.cs | 4 ++--
TShockAPI/PlayerData.cs | 36 ++++++++++++++++++------------------
TShockAPI/TShock.cs | 36 ++++++++++++++++++------------------
TShockAPI/app.config | 8 ++++----
TShockAPI/web.config | 9 +++++++++
scripts/create_release.py | 2 +-
7 files changed, 54 insertions(+), 45 deletions(-)
create mode 100644 TShockAPI/web.config
diff --git a/.gitignore b/.gitignore
index 5a43ff85..c7755a6d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,6 @@
# Sublime Text #
*.sublime-*
-
+releases/
# Compiled source #
###################
*.com
@@ -67,4 +67,4 @@ _ReSharper.*
packages/*
# Private key files #
-scripts/ssh_private_key
\ No newline at end of file
+scripts/ssh_private_key
diff --git a/TShockAPI/DB/ItemManager.cs b/TShockAPI/DB/ItemManager.cs
index 75a6028f..541f8a8d 100644
--- a/TShockAPI/DB/ItemManager.cs
+++ b/TShockAPI/DB/ItemManager.cs
@@ -65,7 +65,7 @@ namespace TShockAPI.DB
try
{
database.Query("INSERT INTO ItemBans (ItemName, AllowedGroups) VALUES (@0, @1);",
- TShock.Utils.GetItemByName(itemname)[0].name, "");
+ TShock.Utils.GetItemByName(itemname)[0].Name, "");
if (!ItemIsBanned(itemname, null))
ItemBans.Add(new ItemBan(itemname));
}
@@ -81,7 +81,7 @@ namespace TShockAPI.DB
return;
try
{
- database.Query("DELETE FROM ItemBans WHERE ItemName=@0;", TShock.Utils.GetItemByName(itemname)[0].name);
+ database.Query("DELETE FROM ItemBans WHERE ItemName=@0;", TShock.Utils.GetItemByName(itemname)[0].Name);
ItemBans.Remove(new ItemBan(itemname));
}
catch (Exception ex)
diff --git a/TShockAPI/PlayerData.cs b/TShockAPI/PlayerData.cs
index 0b6c1ae0..de5f68ed 100644
--- a/TShockAPI/PlayerData.cs
+++ b/TShockAPI/PlayerData.cs
@@ -340,43 +340,43 @@ namespace TShockAPI
float slot = 0f;
for (int k = 0; k < NetItem.InventorySlots; k++)
{
- NetMessage.SendData(5, -1, -1, Main.player[player.Index].inventory[k].name, player.Index, slot, (float)Main.player[player.Index].inventory[k].prefix);
+ NetMessage.SendData(5, -1, -1, Main.player[player.Index].inventory[k].Name, player.Index, slot, (float)Main.player[player.Index].inventory[k].prefix);
slot++;
}
for (int k = 0; k < NetItem.ArmorSlots; k++)
{
- NetMessage.SendData(5, -1, -1, Main.player[player.Index].armor[k].name, player.Index, slot, (float)Main.player[player.Index].armor[k].prefix);
+ NetMessage.SendData(5, -1, -1, Main.player[player.Index].armor[k].Name, player.Index, slot, (float)Main.player[player.Index].armor[k].prefix);
slot++;
}
for (int k = 0; k < NetItem.DyeSlots; k++)
{
- NetMessage.SendData(5, -1, -1, Main.player[player.Index].dye[k].name, player.Index, slot, (float)Main.player[player.Index].dye[k].prefix);
+ NetMessage.SendData(5, -1, -1, Main.player[player.Index].dye[k].Name, player.Index, slot, (float)Main.player[player.Index].dye[k].prefix);
slot++;
}
for (int k = 0; k < NetItem.MiscEquipSlots; k++)
{
- NetMessage.SendData(5, -1, -1, Main.player[player.Index].miscEquips[k].name, player.Index, slot, (float)Main.player[player.Index].miscEquips[k].prefix);
+ NetMessage.SendData(5, -1, -1, Main.player[player.Index].miscEquips[k].Name, player.Index, slot, (float)Main.player[player.Index].miscEquips[k].prefix);
slot++;
}
for (int k = 0; k < NetItem.MiscDyeSlots; k++)
{
- NetMessage.SendData(5, -1, -1, Main.player[player.Index].miscDyes[k].name, player.Index, slot, (float)Main.player[player.Index].miscDyes[k].prefix);
+ NetMessage.SendData(5, -1, -1, Main.player[player.Index].miscDyes[k].Name, player.Index, slot, (float)Main.player[player.Index].miscDyes[k].prefix);
slot++;
}
for (int k = 0; k < NetItem.PiggySlots; k++)
{
- NetMessage.SendData(5, -1, -1, Main.player[player.Index].bank.item[k].name, player.Index, slot, (float)Main.player[player.Index].bank.item[k].prefix);
+ NetMessage.SendData(5, -1, -1, Main.player[player.Index].bank.item[k].Name, player.Index, slot, (float)Main.player[player.Index].bank.item[k].prefix);
slot++;
}
for (int k = 0; k < NetItem.SafeSlots; k++)
{
- NetMessage.SendData(5, -1, -1, Main.player[player.Index].bank2.item[k].name, player.Index, slot, (float)Main.player[player.Index].bank2.item[k].prefix);
+ NetMessage.SendData(5, -1, -1, Main.player[player.Index].bank2.item[k].Name, player.Index, slot, (float)Main.player[player.Index].bank2.item[k].prefix);
slot++;
}
- NetMessage.SendData(5, -1, -1, Main.player[player.Index].trashItem.name, player.Index, slot++, (float)Main.player[player.Index].trashItem.prefix);
+ NetMessage.SendData(5, -1, -1, Main.player[player.Index].trashItem.Name, player.Index, slot++, (float)Main.player[player.Index].trashItem.prefix);
for (int k = 0; k < NetItem.ForgeSlots; k++)
{
- NetMessage.SendData(5, -1, -1, Main.player[player.Index].bank3.item[k].name, player.Index, slot, (float)Main.player[player.Index].bank3.item[k].prefix);
+ NetMessage.SendData(5, -1, -1, Main.player[player.Index].bank3.item[k].Name, player.Index, slot, (float)Main.player[player.Index].bank3.item[k].prefix);
slot++;
}
@@ -388,43 +388,43 @@ namespace TShockAPI
slot = 0f;
for (int k = 0; k < NetItem.InventorySlots; k++)
{
- NetMessage.SendData(5, player.Index, -1, Main.player[player.Index].inventory[k].name, player.Index, slot, (float)Main.player[player.Index].inventory[k].prefix);
+ NetMessage.SendData(5, player.Index, -1, Main.player[player.Index].inventory[k].Name, player.Index, slot, (float)Main.player[player.Index].inventory[k].prefix);
slot++;
}
for (int k = 0; k < NetItem.ArmorSlots; k++)
{
- NetMessage.SendData(5, player.Index, -1, Main.player[player.Index].armor[k].name, player.Index, slot, (float)Main.player[player.Index].armor[k].prefix);
+ NetMessage.SendData(5, player.Index, -1, Main.player[player.Index].armor[k].Name, player.Index, slot, (float)Main.player[player.Index].armor[k].prefix);
slot++;
}
for (int k = 0; k < NetItem.DyeSlots; k++)
{
- NetMessage.SendData(5, player.Index, -1, Main.player[player.Index].dye[k].name, player.Index, slot, (float)Main.player[player.Index].dye[k].prefix);
+ NetMessage.SendData(5, player.Index, -1, Main.player[player.Index].dye[k].Name, player.Index, slot, (float)Main.player[player.Index].dye[k].prefix);
slot++;
}
for (int k = 0; k < NetItem.MiscEquipSlots; k++)
{
- NetMessage.SendData(5, player.Index, -1, Main.player[player.Index].miscEquips[k].name, player.Index, slot, (float)Main.player[player.Index].miscEquips[k].prefix);
+ NetMessage.SendData(5, player.Index, -1, Main.player[player.Index].miscEquips[k].Name, player.Index, slot, (float)Main.player[player.Index].miscEquips[k].prefix);
slot++;
}
for (int k = 0; k < NetItem.MiscDyeSlots; k++)
{
- NetMessage.SendData(5, player.Index, -1, Main.player[player.Index].miscDyes[k].name, player.Index, slot, (float)Main.player[player.Index].miscDyes[k].prefix);
+ NetMessage.SendData(5, player.Index, -1, Main.player[player.Index].miscDyes[k].Name, player.Index, slot, (float)Main.player[player.Index].miscDyes[k].prefix);
slot++;
}
for (int k = 0; k < NetItem.PiggySlots; k++)
{
- NetMessage.SendData(5, player.Index, -1, Main.player[player.Index].bank.item[k].name, player.Index, slot, (float)Main.player[player.Index].bank.item[k].prefix);
+ NetMessage.SendData(5, player.Index, -1, Main.player[player.Index].bank.item[k].Name, player.Index, slot, (float)Main.player[player.Index].bank.item[k].prefix);
slot++;
}
for (int k = 0; k < NetItem.SafeSlots; k++)
{
- NetMessage.SendData(5, player.Index, -1, Main.player[player.Index].bank2.item[k].name, player.Index, slot, (float)Main.player[player.Index].bank2.item[k].prefix);
+ NetMessage.SendData(5, player.Index, -1, Main.player[player.Index].bank2.item[k].Name, player.Index, slot, (float)Main.player[player.Index].bank2.item[k].prefix);
slot++;
}
- NetMessage.SendData(5, player.Index, -1, Main.player[player.Index].trashItem.name, player.Index, slot++, (float)Main.player[player.Index].trashItem.prefix);
+ NetMessage.SendData(5, player.Index, -1, Main.player[player.Index].trashItem.Name, player.Index, slot++, (float)Main.player[player.Index].trashItem.prefix);
for (int k = 0; k < NetItem.ForgeSlots; k++)
{
- NetMessage.SendData(5, player.Index, -1, Main.player[player.Index].bank3.item[k].name, player.Index, slot, (float)Main.player[player.Index].bank3.item[k].prefix);
+ NetMessage.SendData(5, player.Index, -1, Main.player[player.Index].bank3.item[k].Name, player.Index, slot, (float)Main.player[player.Index].bank3.item[k].prefix);
slot++;
}
diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs
index f4d051e1..2ebb7ef4 100644
--- a/TShockAPI/TShock.cs
+++ b/TShockAPI/TShock.cs
@@ -1108,7 +1108,7 @@ namespace TShockAPI
if (!player.HasPermission(Permissions.ignorestackhackdetection) && (item.stack > item.maxStack || item.stack < 0) &&
item.type != 0)
{
- check = "Remove item " + item.name + " (" + item.stack + ") exceeds max stack of " + item.maxStack;
+ check = "Remove item " + item.Name + " (" + item.stack + ") exceeds max stack of " + item.maxStack;
player.SendErrorMessage(check);
break;
}
@@ -1118,12 +1118,12 @@ namespace TShockAPI
// Please don't remove this for the time being; without it, players wearing banned equipment will only get debuffed once
foreach (Item item in player.TPlayer.armor)
{
- if (Itembans.ItemIsBanned(item.name, player))
+ if (Itembans.ItemIsBanned(item.Name, player))
{
player.SetBuff(BuffID.Frozen, 330, true);
player.SetBuff(BuffID.Stoned, 330, true);
player.SetBuff(BuffID.Webbed, 330, true);
- check = "Remove armor/accessory " + item.name;
+ check = "Remove armor/accessory " + item.Name;
player.SendErrorMessage("You are wearing banned equipment. {0}", check);
break;
@@ -1131,12 +1131,12 @@ namespace TShockAPI
}
foreach (Item item in player.TPlayer.dye)
{
- if (Itembans.ItemIsBanned(item.name, player))
+ if (Itembans.ItemIsBanned(item.Name, player))
{
player.SetBuff(BuffID.Frozen, 330, true);
player.SetBuff(BuffID.Stoned, 330, true);
player.SetBuff(BuffID.Webbed, 330, true);
- check = "Remove dye " + item.name;
+ check = "Remove dye " + item.Name;
player.SendErrorMessage("You are wearing banned equipment. {0}", check);
break;
@@ -1144,12 +1144,12 @@ namespace TShockAPI
}
foreach (Item item in player.TPlayer.miscEquips)
{
- if (Itembans.ItemIsBanned(item.name, player))
+ if (Itembans.ItemIsBanned(item.Name, player))
{
player.SetBuff(BuffID.Frozen, 330, true);
player.SetBuff(BuffID.Stoned, 330, true);
player.SetBuff(BuffID.Webbed, 330, true);
- check = "Remove misc equip " + item.name;
+ check = "Remove misc equip " + item.Name;
player.SendErrorMessage("You are wearing banned equipment. {0}", check);
break;
@@ -1157,12 +1157,12 @@ namespace TShockAPI
}
foreach (Item item in player.TPlayer.miscDyes)
{
- if (Itembans.ItemIsBanned(item.name, player))
+ if (Itembans.ItemIsBanned(item.Name, player))
{
player.SetBuff(BuffID.Frozen, 330, true);
player.SetBuff(BuffID.Stoned, 330, true);
player.SetBuff(BuffID.Webbed, 330, true);
- check = "Remove misc dye " + item.name;
+ check = "Remove misc dye " + item.Name;
player.SendErrorMessage("You are wearing banned equipment. {0}", check);
break;
@@ -1989,7 +1989,7 @@ namespace TShockAPI
{
check = true;
player.SendMessage(
- String.Format("Stack cheat detected. Remove item {0} ({1}) and then rejoin", item.name, inventory[i].stack),
+ String.Format("Stack cheat detected. Remove item {0} ({1}) and then rejoin", item.Name, inventory[i].stack),
Color.Cyan);
}
}
@@ -2008,7 +2008,7 @@ namespace TShockAPI
{
check = true;
player.SendMessage(
- String.Format("Stack cheat detected. Remove armor {0} ({1}) and then rejoin", item.name, armor[index].stack),
+ String.Format("Stack cheat detected. Remove armor {0} ({1}) and then rejoin", item.Name, armor[index].stack),
Color.Cyan);
}
}
@@ -2027,7 +2027,7 @@ namespace TShockAPI
{
check = true;
player.SendMessage(
- String.Format("Stack cheat detected. Remove dye {0} ({1}) and then rejoin", item.name, dye[index].stack),
+ String.Format("Stack cheat detected. Remove dye {0} ({1}) and then rejoin", item.Name, dye[index].stack),
Color.Cyan);
}
}
@@ -2046,7 +2046,7 @@ namespace TShockAPI
{
check = true;
player.SendMessage(
- String.Format("Stack cheat detected. Remove item {0} ({1}) and then rejoin", item.name, miscEquips[index].stack),
+ String.Format("Stack cheat detected. Remove item {0} ({1}) and then rejoin", item.Name, miscEquips[index].stack),
Color.Cyan);
}
}
@@ -2065,7 +2065,7 @@ namespace TShockAPI
{
check = true;
player.SendMessage(
- String.Format("Stack cheat detected. Remove item dye {0} ({1}) and then rejoin", item.name, miscDyes[index].stack),
+ String.Format("Stack cheat detected. Remove item dye {0} ({1}) and then rejoin", item.Name, miscDyes[index].stack),
Color.Cyan);
}
}
@@ -2085,7 +2085,7 @@ namespace TShockAPI
{
check = true;
player.SendMessage(
- String.Format("Stack cheat detected. Remove Piggy-bank item {0} ({1}) and then rejoin", item.name, piggy[index].stack),
+ String.Format("Stack cheat detected. Remove Piggy-bank item {0} ({1}) and then rejoin", item.Name, piggy[index].stack),
Color.Cyan);
}
}
@@ -2105,7 +2105,7 @@ namespace TShockAPI
{
check = true;
player.SendMessage(
- String.Format("Stack cheat detected. Remove Safe item {0} ({1}) and then rejoin", item.name, safe[index].stack),
+ String.Format("Stack cheat detected. Remove Safe item {0} ({1}) and then rejoin", item.Name, safe[index].stack),
Color.Cyan);
}
}
@@ -2124,7 +2124,7 @@ namespace TShockAPI
{
check = true;
player.SendMessage(
- String.Format("Stack cheat detected. Remove trash item {0} ({1}) and then rejoin", item.name, trash.stack),
+ String.Format("Stack cheat detected. Remove trash item {0} ({1}) and then rejoin", item.Name, trash.stack),
Color.Cyan);
}
}
@@ -2144,7 +2144,7 @@ namespace TShockAPI
{
check = true;
player.SendMessage(
- String.Format("Stack cheat detected. Remove Defender's Forge item {0} ({1}) and then rejoin", item.name, forge[index].stack),
+ String.Format("Stack cheat detected. Remove Defender's Forge item {0} ({1}) and then rejoin", item.Name, forge[index].stack),
Color.Cyan);
}
}
diff --git a/TShockAPI/app.config b/TShockAPI/app.config
index c5e7715e..1565cd9f 100644
--- a/TShockAPI/app.config
+++ b/TShockAPI/app.config
@@ -1,9 +1,9 @@
-
+
-
-
+
+
-
+
diff --git a/TShockAPI/web.config b/TShockAPI/web.config
new file mode 100644
index 00000000..74c0d886
--- /dev/null
+++ b/TShockAPI/web.config
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/scripts/create_release.py b/scripts/create_release.py
index 94c85cb0..e6af6559 100755
--- a/scripts/create_release.py
+++ b/scripts/create_release.py
@@ -47,7 +47,7 @@ mysql_bin = os.path.join(cur_wd, "packages", "MySql.Data.6.9.8", "lib", "net45",
sqlite_dep = os.path.join(cur_wd, "prebuilts", sqlite_dep_name)
sqlite_bin = os.path.join(cur_wd, "prebuilts", sqlite_bin_name)
http_bin = os.path.join(cur_wd, "prebuilts", http_bin_name)
-json_bin = os.path.join(cur_wd, "packages", "Newtonsoft.Json.9.0.1", "lib", "net45", json_bin_name)
+json_bin = os.path.join(cur_wd, "packages", "Newtonsoft.Json.10.0.2", "lib", "net45", json_bin_name)
bcrypt_bin = os.path.join(cur_wd, "packages", "BCrypt.Net.0.1.0", "lib", "net35", bcrypt_bin_name)
geoip_db = os.path.join(cur_wd, "prebuilts", geoip_db_name)
release_bin = os.path.join(cur_wd, "TShockAPI", "bin", "Release", tshock_bin_name)
From d2705d785b6fc21955a7370f2818ca80e72bb101 Mon Sep 17 00:00:00 2001
From: Lucas Nicodemus
Date: Wed, 19 Apr 2017 17:14:05 -0600
Subject: [PATCH 04/78] Update to OTAPI 2.0.0.19 / Terraria 1.3.5.1
---
TerrariaServerAPI | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/TerrariaServerAPI b/TerrariaServerAPI
index 5a5b0e9e..cc479f6b 160000
--- a/TerrariaServerAPI
+++ b/TerrariaServerAPI
@@ -1 +1 @@
-Subproject commit 5a5b0e9ee39af91e4d584eaa63e5af104803200f
+Subproject commit cc479f6b3e429f2ca5c9c2d1122385ca92a49276
From 46c42536c976416ffa63eb7f19227f4e8f6f6f23 Mon Sep 17 00:00:00 2001
From: Lucas Nicodemus
Date: Wed, 19 Apr 2017 17:22:46 -0600
Subject: [PATCH 05/78] Replace calls to Main.buffName to Lang.GetBuffName
---
TShockAPI/Commands.cs | 4 ++--
TShockAPI/Utils.cs | 12 ++++++------
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs
index 04d19f70..9c6ca1bf 100644
--- a/TShockAPI/Commands.cs
+++ b/TShockAPI/Commands.cs
@@ -5517,7 +5517,7 @@ namespace TShockAPI
}
else if (found.Count > 1)
{
- TShock.Utils.SendMultipleMatchError(args.Player, found.Select(f => Main.buffName[f]));
+ TShock.Utils.SendMultipleMatchError(args.Player, found.Select(f => Lang.GetBuffName(f)));
return;
}
id = found[0];
@@ -5568,7 +5568,7 @@ namespace TShockAPI
}
else if (found.Count > 1)
{
- TShock.Utils.SendMultipleMatchError(args.Player, found.Select(b => Main.buffName[b]));
+ TShock.Utils.SendMultipleMatchError(args.Player, found.Select(b => Lang.GetBuffName(b)));
return;
}
id = found[0];
diff --git a/TShockAPI/Utils.cs b/TShockAPI/Utils.cs
index df0c8a72..fd680370 100644
--- a/TShockAPI/Utils.cs
+++ b/TShockAPI/Utils.cs
@@ -435,7 +435,7 @@ namespace TShockAPI
/// name
public string GetBuffName(int id)
{
- return (id > 0 && id < Main.maxBuffTypes) ? Main.buffName[id] : "null";
+ return (id > 0 && id < Main.maxBuffTypes) ? Lang.GetBuffName(id) : "null";
}
///
@@ -445,7 +445,7 @@ namespace TShockAPI
/// description
public string GetBuffDescription(int id)
{
- return (id > 0 && id < Main.maxBuffTypes) ? Main.buffTip[id] : "null";
+ return (id > 0 && id < Main.maxBuffTypes) ? Lang.GetBuffName(id) : "null";
}
///
@@ -459,14 +459,14 @@ namespace TShockAPI
string buffname;
for (int i = 1; i < Main.maxBuffTypes; i++)
{
- buffname = Main.buffName[i];
+ buffname = Lang.GetBuffName(i);
if (!String.IsNullOrWhiteSpace(buffname) && buffname.ToLower() == nameLower)
return new List {i};
}
var found = new List();
for (int i = 1; i < Main.maxBuffTypes; i++)
{
- buffname = Main.buffName[i];
+ buffname = Lang.GetBuffName(i);
if (!String.IsNullOrWhiteSpace(buffname) && buffname.ToLower().StartsWith(nameLower))
found.Add(i);
}
@@ -1209,9 +1209,9 @@ namespace TShockAPI
List
From 94f1d5e9dd1dfe7ef932cade8ec55180b8f06302 Mon Sep 17 00:00:00 2001
From: Tyler Watson
Date: Sun, 30 Apr 2017 03:10:25 +1000
Subject: [PATCH 49/78] Updated submodule for OnNpcKilled hook
---
TerrariaServerAPI | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/TerrariaServerAPI b/TerrariaServerAPI
index d93b585f..e704076c 160000
--- a/TerrariaServerAPI
+++ b/TerrariaServerAPI
@@ -1 +1 @@
-Subproject commit d93b585fb9833f536c96b68bc6b5e9dc7d00416c
+Subproject commit e704076c2a9db4b2e9beb77249f6c4f8f5036a6e
From 1d2619d311012387768b4702ca9ea35de8f2544b Mon Sep 17 00:00:00 2001
From: Tyler Watson
Date: Sun, 30 Apr 2017 03:25:41 +1000
Subject: [PATCH 50/78] Update submodule
---
TerrariaServerAPI | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/TerrariaServerAPI b/TerrariaServerAPI
index e704076c..f54010dd 160000
--- a/TerrariaServerAPI
+++ b/TerrariaServerAPI
@@ -1 +1 @@
-Subproject commit e704076c2a9db4b2e9beb77249f6c4f8f5036a6e
+Subproject commit f54010ddb19b2f739324da73c9a05c6bbfd370a2
From 5b8ce7b88a77fc173cd9dae64e508f83c1194894 Mon Sep 17 00:00:00 2001
From: Tyler Watson
Date: Sun, 30 Apr 2017 03:43:35 +1000
Subject: [PATCH 51/78] update submodule
---
TerrariaServerAPI | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/TerrariaServerAPI b/TerrariaServerAPI
index f54010dd..999f252c 160000
--- a/TerrariaServerAPI
+++ b/TerrariaServerAPI
@@ -1 +1 @@
-Subproject commit f54010ddb19b2f739324da73c9a05c6bbfd370a2
+Subproject commit 999f252c85b1347e27d237fed9b9987f110e786b
From ea979abcdb562ec11bf5ffc6df7b67e7f664d843 Mon Sep 17 00:00:00 2001
From: Lucas Nicodemus
Date: Sat, 29 Apr 2017 12:28:24 -0600
Subject: [PATCH 52/78] Update changelog for OnNpcKilled
---
CHANGELOG.md | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1d13820d..15f32ab5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,10 +4,11 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin
## Upcoming Changes
-* Updated OpenTerraria API to 1.3.5.1 (@DeathCradle)
-* Updated Terraria Server API to 1.3.5.1 (@WhiteXZ, @hakusaro)
-* Updated TShock core components to 1.3.5.1 (@hakusaro)
-* Terraria Server API version tick: 2.1
+* Updated OpenTerraria API to 1.3.5.3 (@DeathCradle)
+* Updated Terraria Server API to 1.3.5.3 (@WhiteXZ, @hakusaro)
+* Updated TShock core components to 1.3.5.3 (@hakusaro)
+* Terraria Server API version tick: 2.2
+* Added OnNpcKilled hook to Server API: 2.2 (@tylerjwatson)
## TShock 4.3.23
* Added evil type option during world creation (@mistzzt)
From edad442ec8b6f0fad1480ec3715371c1bab529d8 Mon Sep 17 00:00:00 2001
From: Luke
Date: Mon, 1 May 2017 22:59:19 +1000
Subject: [PATCH 53/78] Update submodule for potential lever fix
---
TerrariaServerAPI | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/TerrariaServerAPI b/TerrariaServerAPI
index 999f252c..3545b44a 160000
--- a/TerrariaServerAPI
+++ b/TerrariaServerAPI
@@ -1 +1 @@
-Subproject commit 999f252c85b1347e27d237fed9b9987f110e786b
+Subproject commit 3545b44afe9edafd67a3798da5f047bd63705d53
From 6c082aae63b43850011116955cb4c4e2ee52efe8 Mon Sep 17 00:00:00 2001
From: Lucas Nicodemus
Date: Mon, 1 May 2017 18:06:19 -0600
Subject: [PATCH 54/78] Update create release script to build Platform not UTF8
---
scripts/create_release.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/scripts/create_release.py b/scripts/create_release.py
index be6efb41..a1890272 100755
--- a/scripts/create_release.py
+++ b/scripts/create_release.py
@@ -148,7 +148,7 @@ def run_bootstrapper():
mod_clientuuid_proc = subprocess.Popen(['xbuild', './TerrariaServerAPI/TShock.Modifications.ClientUUID/TShock.Modifications.ClientUUID.csproj', '/p:Configuration=' + build_config])
mod_explosives_proc = subprocess.Popen(['xbuild', './TerrariaServerAPI/TShock.Modifications.Explosives/TShock.Modifications.Explosives.csproj', '/p:Configuration=' + build_config])
mod_ssc_proc = subprocess.Popen(['xbuild', './TerrariaServerAPI/TShock.Modifications.SSC/TShock.Modifications.SSC.csproj', '/p:Configuration=' + build_config])
- mod_utf8_proc = subprocess.Popen(['xbuild', './TerrariaServerAPI/TShock.Modifications.UnicodeInput/TShock.Modifications.UnicodeInput.csproj', '/p:Configuration=' + build_config])
+ mod_utf8_proc = subprocess.Popen(['xbuild', './TerrariaServerAPI/TShock.Modifications.Platform/TShock.Modifications.Platform.csproj', '/p:Configuration=' + build_config])
mod_bootstrapper_proc.wait()
mod_clientuuid_proc.wait()
@@ -164,6 +164,8 @@ def run_bootstrapper():
raise CalledProcessError(mod_explosives_proc.returncode)
if (mod_ssc_proc.returncode != 0):
raise CalledProcessError(mod_ssc_proc.returncode)
+ if (mod_utf8_proc.returncode != 0):
+ raise CalledProcessError(mod_utf8_proc.returncode)
# run the bootstrapper to generate the new OTAPI.dll
os.chdir('./TerrariaServerAPI/TShock.Modifications.Bootstrapper/bin/' + build_config)
From ee5e3f7d9d07f84ea54ae74615d5e8603176226e Mon Sep 17 00:00:00 2001
From: Lucas Nicodemus
Date: Mon, 1 May 2017 18:08:47 -0600
Subject: [PATCH 55/78] Update create_release script to test just building
TShock.4.OTAPI.sln and not individual projects
---
scripts/create_release.py | 24 ++++--------------------
1 file changed, 4 insertions(+), 20 deletions(-)
diff --git a/scripts/create_release.py b/scripts/create_release.py
index a1890272..3d86912d 100755
--- a/scripts/create_release.py
+++ b/scripts/create_release.py
@@ -144,28 +144,12 @@ def update_terraria_source():
def run_bootstrapper():
for build_config in ['Debug','Release'] :
- mod_bootstrapper_proc = subprocess.Popen(['xbuild', './TerrariaServerAPI/TShock.Modifications.Bootstrapper/TShock.Modifications.Bootstrapper.csproj', '/p:Configuration=' + build_config])
- mod_clientuuid_proc = subprocess.Popen(['xbuild', './TerrariaServerAPI/TShock.Modifications.ClientUUID/TShock.Modifications.ClientUUID.csproj', '/p:Configuration=' + build_config])
- mod_explosives_proc = subprocess.Popen(['xbuild', './TerrariaServerAPI/TShock.Modifications.Explosives/TShock.Modifications.Explosives.csproj', '/p:Configuration=' + build_config])
- mod_ssc_proc = subprocess.Popen(['xbuild', './TerrariaServerAPI/TShock.Modifications.SSC/TShock.Modifications.SSC.csproj', '/p:Configuration=' + build_config])
- mod_utf8_proc = subprocess.Popen(['xbuild', './TerrariaServerAPI/TShock.Modifications.Platform/TShock.Modifications.Platform.csproj', '/p:Configuration=' + build_config])
+ mintaka = subprocess.Popen(['xbuild', './TerrariaServerAPI/TShock.4.OTAPI.sln', '/p:Configuration=' + build_config])
- mod_bootstrapper_proc.wait()
- mod_clientuuid_proc.wait()
- mod_explosives_proc.wait()
- mod_ssc_proc.wait()
- mod_utf8_proc.wait()
+ mintaka.wait()
- if (mod_bootstrapper_proc.returncode != 0):
- raise CalledProcessError(mod_bootstrapper_proc.returncode)
- if (mod_clientuuid_proc.returncode != 0):
- raise CalledProcessError(mod_clientuuid_proc.returncode)
- if (mod_explosives_proc.returncode != 0):
- raise CalledProcessError(mod_explosives_proc.returncode)
- if (mod_ssc_proc.returncode != 0):
- raise CalledProcessError(mod_ssc_proc.returncode)
- if (mod_utf8_proc.returncode != 0):
- raise CalledProcessError(mod_utf8_proc.returncode)
+ if (mintaka.returncode != 0):
+ raise CalledProcessError(mintaka.returncode)
# run the bootstrapper to generate the new OTAPI.dll
os.chdir('./TerrariaServerAPI/TShock.Modifications.Bootstrapper/bin/' + build_config)
From 72a547441b77e92fc56e284a2c7b0cfef649ba72 Mon Sep 17 00:00:00 2001
From: White
Date: Tue, 2 May 2017 16:53:59 +0930
Subject: [PATCH 56/78] Redirects /token/create to /v2/token/create. Adds
/v4/players/read. V4 contains piggy, safe, and forge data, and condenses all
item fields into one object with child objects.
---
TShockAPI/Rest/RestManager.cs | 44 ++++++++++++++++++++++++++++++++++-
1 file changed, 43 insertions(+), 1 deletion(-)
diff --git a/TShockAPI/Rest/RestManager.cs b/TShockAPI/Rest/RestManager.cs
index acc34661..eace08ee 100644
--- a/TShockAPI/Rest/RestManager.cs
+++ b/TShockAPI/Rest/RestManager.cs
@@ -28,6 +28,7 @@ using HttpServer;
using Rests;
using Terraria;
using TShockAPI.DB;
+using Newtonsoft.Json;
namespace TShockAPI
{
@@ -196,6 +197,7 @@ namespace TShockAPI
}
Rest.RegisterRedirect("/status", "/v2/server/status");
+ Rest.RegisterRedirect("/token/create", "/v2/token/create");
//server commands
Rest.RegisterRedirect("/server/motd", "/v3/server/motd");
@@ -227,7 +229,7 @@ namespace TShockAPI
//player commands
Rest.RegisterRedirect("/lists/players", "/lists/players", "/v2/players/list");
Rest.RegisterRedirect("/players/list", "/v2/players/list");
- Rest.RegisterRedirect("/players/read", "/v3/players/read");
+ Rest.RegisterRedirect("/players/read", "/v3/players/read", "v4/players/read");
Rest.RegisterRedirect("/players/kick", "/v2/players/kick");
Rest.RegisterRedirect("/players/ban", "/v2/players/ban");
Rest.RegisterRedirect("/players/kill", "/v2/players/kill");
@@ -277,6 +279,7 @@ namespace TShockAPI
Rest.Register(new SecureRestCommand("/lists/players", PlayerList));
Rest.Register(new SecureRestCommand("/v2/players/list", PlayerListV2));
Rest.Register(new SecureRestCommand("/v3/players/read", PlayerReadV3, RestPermissions.restuserinfo));
+ Rest.Register(new SecureRestCommand("/v4/players/read", PlayerReadV4, RestPermissions.restuserinfo));
Rest.Register(new SecureRestCommand("/v2/players/kick", PlayerKickV2, RestPermissions.restkick));
Rest.Register(new SecureRestCommand("/v2/players/ban", PlayerBanV2, RestPermissions.restban, RestPermissions.restmanagebans));
Rest.Register(new SecureRestCommand("/v2/players/kill", PlayerKill, RestPermissions.restkill));
@@ -947,6 +950,45 @@ namespace TShockAPI
};
}
+ [Description("Get information for a user.")]
+ [Route("/v4/players/read")]
+ [Permission(RestPermissions.restuserinfo)]
+ [Noun("player", true, "The player to lookup", typeof(String))]
+ [Token]
+ private object PlayerReadV4(RestRequestArgs args)
+ {
+ var ret = PlayerFind(args.Parameters);
+ if (ret is RestObject)
+ {
+ return ret;
+ }
+
+ TSPlayer player = (TSPlayer)ret;
+
+ object items = new
+ {
+ inventory = player.TPlayer.inventory.Where(i => i.active).Select(item => (NetItem)item),
+ equipment = player.TPlayer.armor.Where(i => i.active).Select(item => (NetItem)item),
+ dyes = player.TPlayer.dye.Where(i => i.active).Select(item => (NetItem)item),
+ piggy = player.TPlayer.bank.item.Where(i => i.active).Select(item => (NetItem)item),
+ safe = player.TPlayer.bank2.item.Where(i => i.active).Select(item => (NetItem)item),
+ forge = player.TPlayer.bank3.item.Where(i => i.active).Select(item => (NetItem)item)
+ };
+
+ return new RestObject
+ {
+ {"nickname", player.Name},
+ {"username", player.User?.Name},
+ {"ip", player.IP},
+ {"group", player.Group.Name},
+ {"registered", player.User?.Registered},
+ {"muted", player.mute },
+ {"position", player.TileX + "," + player.TileY},
+ {"items", items},
+ {"buffs", string.Join(", ", player.TPlayer.buffType)}
+ };
+ }
+
[Description("Kick a player off the server.")]
[Route("/v2/players/kick")]
[Permission(RestPermissions.restkick)]
From 961c857c4b9b84f7ce9a66296af53a3e4c398726 Mon Sep 17 00:00:00 2001
From: ZIT WANG
Date: Tue, 2 May 2017 19:43:30 +0800
Subject: [PATCH 57/78] Resolve duplicate negative ids items in
Utils.GetItemByName
---
TShockAPI/Utils.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/TShockAPI/Utils.cs b/TShockAPI/Utils.cs
index 7e690b84..520bed9c 100644
--- a/TShockAPI/Utils.cs
+++ b/TShockAPI/Utils.cs
@@ -346,7 +346,7 @@ namespace TShockAPI
string nameLower = name.ToLowerInvariant();
var checkEnglish = Language.ActiveCulture != GameCulture.English;
- for (int i = -48; i < Main.maxItemTypes; i++)
+ for (int i = 1; i < Main.maxItemTypes; i++)
{
item.netDefaults(i);
if (!String.IsNullOrWhiteSpace(item.Name))
From c161be102ddc58936af66b96c59d515ed1580db0 Mon Sep 17 00:00:00 2001
From: ZIT WANG
Date: Wed, 3 May 2017 08:25:50 +0800
Subject: [PATCH 58/78] Add displaying ids when sending error responses
---
TShockAPI/Commands.cs | 44 +++++++++++++++++++++----------------------
1 file changed, 22 insertions(+), 22 deletions(-)
diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs
index df98776e..cd90f8e6 100644
--- a/TShockAPI/Commands.cs
+++ b/TShockAPI/Commands.cs
@@ -2293,7 +2293,7 @@ namespace TShockAPI
}
else if (npcs.Count > 1)
{
- TShock.Utils.SendMultipleMatchError(args.Player, npcs.Select(n => n.FullName));
+ TShock.Utils.SendMultipleMatchError(args.Player, npcs.Select(n => $"{n.FullName}({n.type})"));
}
else
{
@@ -2550,7 +2550,7 @@ namespace TShockAPI
if (matches.Count > 1)
{
- TShock.Utils.SendMultipleMatchError(args.Player, matches.Select(n => n.FullName));
+ TShock.Utils.SendMultipleMatchError(args.Player, matches.Select(n => $"{n.FullName}({n.whoAmI})"));
return;
}
if (matches.Count == 0)
@@ -3208,7 +3208,7 @@ namespace TShockAPI
}
else if (items.Count > 1)
{
- TShock.Utils.SendMultipleMatchError(args.Player, items.Select(i => i.Name));
+ TShock.Utils.SendMultipleMatchError(args.Player, items.Select(i => $"{i.Name}({i.netID})"));
}
else
{
@@ -3234,7 +3234,7 @@ namespace TShockAPI
}
else if (items.Count > 1)
{
- TShock.Utils.SendMultipleMatchError(args.Player, items.Select(i => i.Name));
+ TShock.Utils.SendMultipleMatchError(args.Player, items.Select(i => $"{i.Name}({i.netID})"));
}
else
{
@@ -3279,7 +3279,7 @@ namespace TShockAPI
}
else if (items.Count > 1)
{
- TShock.Utils.SendMultipleMatchError(args.Player, items.Select(i => i.Name));
+ TShock.Utils.SendMultipleMatchError(args.Player, items.Select(i => $"{i.Name}({i.netID})"));
}
else
{
@@ -3305,7 +3305,7 @@ namespace TShockAPI
}
else if (items.Count > 1)
{
- TShock.Utils.SendMultipleMatchError(args.Player, items.Select(i => i.Name));
+ TShock.Utils.SendMultipleMatchError(args.Player, items.Select(i => $"{i.Name}({i.netID})"));
}
else
{
@@ -5193,7 +5193,7 @@ namespace TShockAPI
}
else if (npcs.Count > 1)
{
- TShock.Utils.SendMultipleMatchError(args.Player, npcs.Select(n => n.FullName));
+ TShock.Utils.SendMultipleMatchError(args.Player, npcs.Select(n => $"{n.FullName}({n.type})"));
return;
}
else
@@ -5248,7 +5248,7 @@ namespace TShockAPI
}
else if (matchedItems.Count > 1)
{
- TShock.Utils.SendMultipleMatchError(args.Player, matchedItems.Select(i => i.Name));
+ TShock.Utils.SendMultipleMatchError(args.Player, matchedItems.Select(i => $"{i.Name}({i.netID})"));
return;
}
else
@@ -5267,14 +5267,14 @@ namespace TShockAPI
string prefixidOrName = args.Parameters[amountParamIndex + 1];
var prefixIds = TShock.Utils.GetPrefixByIdOrName(prefixidOrName);
- if (item.accessory && prefixIds.Contains(42))
+ if (item.accessory && prefixIds.Contains(PrefixID.Quick))
{
- prefixIds.Remove(42);
- prefixIds.Remove(76);
- prefixIds.Add(76);
+ prefixIds.Remove(PrefixID.Quick);
+ prefixIds.Remove(PrefixID.Quick2);
+ prefixIds.Add(PrefixID.Quick2);
}
- else if (!item.accessory && prefixIds.Contains(42))
- prefixIds.Remove(76);
+ else if (!item.accessory && prefixIds.Contains(PrefixID.Quick))
+ prefixIds.Remove(PrefixID.Quick2);
if (prefixIds.Count > 1)
{
@@ -5331,7 +5331,7 @@ namespace TShockAPI
}
else if (npcs.Count > 1)
{
- TShock.Utils.SendMultipleMatchError(args.Player, npcs.Select(n => n.FullName));
+ TShock.Utils.SendMultipleMatchError(args.Player, npcs.Select(n => $"{n.FullName}({n.type})"));
return;
}
else if (args.Parameters[1].Length > 200)
@@ -5396,7 +5396,7 @@ namespace TShockAPI
}
else if (items.Count > 1)
{
- TShock.Utils.SendMultipleMatchError(args.Player, items.Select(i => i.Name));
+ TShock.Utils.SendMultipleMatchError(args.Player, items.Select(i => $"{i.Name}({i.netID})"));
}
else
{
@@ -5406,14 +5406,14 @@ namespace TShockAPI
{
int.TryParse(args.Parameters[0], out itemAmount);
var prefixIds = TShock.Utils.GetPrefixByIdOrName(args.Parameters[1]);
- if (item.accessory && prefixIds.Contains(42))
+ if (item.accessory && prefixIds.Contains(PrefixID.Quick))
{
- prefixIds.Remove(42);
- prefixIds.Remove(76);
- prefixIds.Add(76);
+ prefixIds.Remove(PrefixID.Quick);
+ prefixIds.Remove(PrefixID.Quick2);
+ prefixIds.Add(PrefixID.Quick2);
}
- else if (!item.accessory && prefixIds.Contains(42))
- prefixIds.Remove(76);
+ else if (!item.accessory && prefixIds.Contains(PrefixID.Quick))
+ prefixIds.Remove(PrefixID.Quick2);
if (prefixIds.Count == 1)
prefix = prefixIds[0];
}
From 7dcfa17ac2509b8e56b8a336964f1d48c998ccb7 Mon Sep 17 00:00:00 2001
From: White
Date: Wed, 3 May 2017 16:54:47 +0930
Subject: [PATCH 59/78] Submodule update
---
TerrariaServerAPI | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/TerrariaServerAPI b/TerrariaServerAPI
index 3545b44a..285b4ad6 160000
--- a/TerrariaServerAPI
+++ b/TerrariaServerAPI
@@ -1 +1 @@
-Subproject commit 3545b44afe9edafd67a3798da5f047bd63705d53
+Subproject commit 285b4ad65a39de545043ae5b2b9e742906b9a2b3
From 528d9c642b08584bbeec4d1e84e992e8d0d003f8 Mon Sep 17 00:00:00 2001
From: White
Date: Wed, 3 May 2017 21:49:19 +0930
Subject: [PATCH 60/78] Fixes a Non-SSC chat over heads bug. Should solve #1436
---
TShockAPI/TShock.cs | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs
index 45aa012e..958f067c 100644
--- a/TShockAPI/TShock.cs
+++ b/TShockAPI/TShock.cs
@@ -1502,23 +1502,31 @@ namespace TShockAPI
Player ply = Main.player[args.Who];
string name = ply.name;
ply.name = String.Format(Config.ChatAboveHeadsFormat, tsplr.Group.Name, tsplr.Group.Prefix, tsplr.Name, tsplr.Group.Suffix);
+ //Update the player's name to format text nicely. This needs to be done because Terraria automatically formats messages against our will
NetMessage.SendData((int)PacketTypes.PlayerInfo, -1, -1, NetworkText.FromLiteral(ply.name), args.Who, 0, 0, 0, 0);
- ply.name = name;
- Hooks.PlayerHooks.OnPlayerChat(tsplr, args.Text, ref text);
+ //Give that poor player their name back :'c
+ ply.name = name;
+ PlayerHooks.OnPlayerChat(tsplr, args.Text, ref text);
+
+ //This netpacket is used to send chat text from the server to clients, in this case on behalf of a client
Terraria.Net.NetPacket packet = Terraria.GameContent.NetModules.NetTextModule.SerializeServerMessage(
NetworkText.FromLiteral(text), new Color(tsplr.Group.R, tsplr.Group.G, tsplr.Group.B), (byte)args.Who
);
- Terraria.Net.NetManager.Instance.Broadcast(packet);
+ //Broadcast to everyone except the player who sent the message.
+ //This is so that we can send them the same nicely formatted message that everyone else gets
+ Terraria.Net.NetManager.Instance.Broadcast(packet, args.Who);
+ //Reset their name
NetMessage.SendData((int)PacketTypes.PlayerInfo, -1, -1, NetworkText.FromLiteral(name), args.Who, 0, 0, 0, 0);
string msg = String.Format("<{0}> {1}",
String.Format(Config.ChatAboveHeadsFormat, tsplr.Group.Name, tsplr.Group.Prefix, tsplr.Name, tsplr.Group.Suffix),
- text);
-
- //tsplr.SendMessage(msg, tsplr.Group.R, tsplr.Group.G, tsplr.Group.B);
+ text
+ );
+ //Send the original sender their nicely formatted message, and do all the loggy things
+ tsplr.SendMessage(msg, tsplr.Group.R, tsplr.Group.G, tsplr.Group.B);
TSPlayer.Server.SendMessage(msg, tsplr.Group.R, tsplr.Group.G, tsplr.Group.B);
Log.Info("Broadcast: {0}", msg);
args.Handled = true;
From ee7a1bb2be9b7ab09a8e66f6612e9e9580535037 Mon Sep 17 00:00:00 2001
From: Lucas Nicodemus
Date: Mon, 8 May 2017 18:20:06 -0600
Subject: [PATCH 61/78] Add a comma
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 4548076a..9fa0710d 100644
--- a/README.md
+++ b/README.md
@@ -34,7 +34,7 @@ Feeling like helping out? Want to find an awesome server? Some awesome plugins?
> By participating in the TShock for Terraria community, all members will adhere to maintaining decorum with respect to all humans, in and out of the community. Members will not engage in discussion that inappropriately disparages or marginalizes any group of people or any individual. Members will not attempt to further or advance an agenda to the point of being overbearing or close minded (such as through spreading FUD). Members will not abuse services provided to them and will follow the guidance of community leaders on a situational basis about what abuse consists of. Members will adhere to United States and international law. If members notice a violation of this code of conduct, they will not engage but will instead contact the leadership team on either the forums or Discord.
-> Do not attempt to circumvent or bypass the code of conduct by using clever logic or reasoning (e.g. insulting Facepunch members, because they weren't directly mentioned here).
+> Do not attempt to circumvent or bypass the code of conduct by using clever logic or reasoning (e.g., insulting Facepunch members, because they weren't directly mentioned here).
Please see the contributing file before sending pull requests.
From 02a8e037ba467bee9fd30e42089a675ca3b9f5bc Mon Sep 17 00:00:00 2001
From: White
Date: Thu, 11 May 2017 19:05:29 +0930
Subject: [PATCH 62/78] Submodule update to revert recursive resolver
---
TerrariaServerAPI | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/TerrariaServerAPI b/TerrariaServerAPI
index 285b4ad6..c22ec39f 160000
--- a/TerrariaServerAPI
+++ b/TerrariaServerAPI
@@ -1 +1 @@
-Subproject commit 285b4ad65a39de545043ae5b2b9e742906b9a2b3
+Subproject commit c22ec39f707f32e19fd59f685d59a79be8d12b5a
From 194522eaa04a013594acae5eaa57c575830ff5e9 Mon Sep 17 00:00:00 2001
From: MadMan2021
Date: Thu, 11 May 2017 23:27:56 +0100
Subject: [PATCH 63/78] Increased /butcher damage to defence fixes issue #1447
---
TShockAPI/Commands.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs
index cd90f8e6..ee9106fc 100644
--- a/TShockAPI/Commands.cs
+++ b/TShockAPI/Commands.cs
@@ -5207,7 +5207,7 @@ namespace TShockAPI
{
if (Main.npc[i].active && ((npcId == 0 && !Main.npc[i].townNPC && Main.npc[i].netID != NPCID.TargetDummy) || Main.npc[i].netID == npcId))
{
- TSPlayer.Server.StrikeNPC(i, (int)(Main.npc[i].life + (Main.npc[i].defense * 0.5)), 0, 0);
+ TSPlayer.Server.StrikeNPC(i, (int)(Main.npc[i].life + (Main.npc[i].defense * 0.6)), 0, 0);
kills++;
}
}
From 8116aebd2cfb7aa6e5010b4b9c685d0b38527fe2 Mon Sep 17 00:00:00 2001
From: ZIT WANG
Date: Fri, 12 May 2017 18:06:49 +0800
Subject: [PATCH 64/78] Fix itemban not working on non-English language
---
TShockAPI/GetDataHandlers.cs | 4 ++--
TShockAPI/TShock.cs | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs
index fb5bea27..0bb216e1 100644
--- a/TShockAPI/GetDataHandlers.cs
+++ b/TShockAPI/GetDataHandlers.cs
@@ -2151,7 +2151,7 @@ namespace TShockAPI
args.Player.SendErrorMessage("You do not have permission to place actuators.");
return true;
}
- if (TShock.Itembans.ItemIsBanned(selectedItem.Name, args.Player) || editData >= (action == EditAction.PlaceTile ? Main.maxTileSets : Main.maxWallTypes))
+ if (TShock.Itembans.ItemIsBanned(EnglishLanguage.GetItemNameById(selectedItem.netID), args.Player) || editData >= (action == EditAction.PlaceTile ? Main.maxTileSets : Main.maxWallTypes))
{
args.Player.SendTileSquare(tileX, tileY, 4);
return true;
@@ -2611,7 +2611,7 @@ namespace TShockAPI
if (control[5])
{
string itemName = args.TPlayer.inventory[item].Name;
- if (TShock.Itembans.ItemIsBanned(itemName, args.Player))
+ if (TShock.Itembans.ItemIsBanned(EnglishLanguage.GetItemNameById(args.TPlayer.inventory[item].netID), args.Player))
{
control[5] = false;
args.Player.Disable("using a banned item ({0})".SFormat(itemName), DisableFlags.WriteToLogAndConsole);
diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs
index 958f067c..0d1c2bc7 100644
--- a/TShockAPI/TShock.cs
+++ b/TShockAPI/TShock.cs
@@ -1084,7 +1084,7 @@ namespace TShockAPI
{
player.Disable(flags: flags);
}
- else if (Itembans.ItemIsBanned(player.TPlayer.inventory[player.TPlayer.selectedItem].Name, player))
+ else if (Itembans.ItemIsBanned(EnglishLanguage.GetItemNameById(player.TPlayer.inventory[player.TPlayer.selectedItem].netID), player))
{
player.Disable($"holding banned item: {player.TPlayer.inventory[player.TPlayer.selectedItem].Name}", flags);
player.SendErrorMessage($"You are holding a banned item: {player.TPlayer.inventory[player.TPlayer.selectedItem].Name}");
@@ -1164,7 +1164,7 @@ namespace TShockAPI
{
player.Disable(flags: flags);
}
- else if (Itembans.ItemIsBanned(player.TPlayer.inventory[player.TPlayer.selectedItem].Name, player))
+ else if (Itembans.ItemIsBanned(EnglishLanguage.GetItemNameById(player.TPlayer.inventory[player.TPlayer.selectedItem].netID), player))
{
player.Disable($"holding banned item: {player.TPlayer.inventory[player.TPlayer.selectedItem].Name}", flags);
player.SendErrorMessage($"You are holding a banned item: {player.TPlayer.inventory[player.TPlayer.selectedItem].Name}");
From 492bb3ec2d1f706a9e6546fe756e05e1efdfab93 Mon Sep 17 00:00:00 2001
From: Tyler Watson
Date: Sun, 14 May 2017 21:08:57 +1000
Subject: [PATCH 65/78] create_release script now compatible with mono 5
---
scripts/create_release.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/scripts/create_release.py b/scripts/create_release.py
index 3d86912d..3a25f76d 100755
--- a/scripts/create_release.py
+++ b/scripts/create_release.py
@@ -36,7 +36,7 @@ sqlite_bin_name = "Mono.Data.Sqlite.dll"
json_bin_name = "Newtonsoft.Json.dll"
http_bin_name = "HttpServer.dll"
tshock_bin_name = "TShockAPI.dll"
-tshock_symbols = "TShockAPI.dll.mdb"
+tshock_symbols = "TShockAPI.pdb"
bcrypt_bin_name = "BCrypt.Net.dll"
geoip_db_name = "GeoIP.dat"
@@ -140,6 +140,7 @@ def upload_artifacts():
def update_terraria_source():
subprocess.check_call(['/usr/bin/git', 'submodule', 'init'])
subprocess.check_call(['/usr/bin/git', 'submodule', 'update'])
+ subprocess.check_call(['nuget', 'restore'])
subprocess.check_call(['nuget', 'restore', 'TerrariaServerAPI/'])
def run_bootstrapper():
From 7e80a6dc4eda23a07a64bc99bf904320a44fdf89 Mon Sep 17 00:00:00 2001
From: Tyler Watson
Date: Sun, 14 May 2017 21:12:55 +1000
Subject: [PATCH 66/78] Submodule update for ILRepack.Lib 2.0.13
---
TerrariaServerAPI | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/TerrariaServerAPI b/TerrariaServerAPI
index c22ec39f..a9d1b0e4 160000
--- a/TerrariaServerAPI
+++ b/TerrariaServerAPI
@@ -1 +1 @@
-Subproject commit c22ec39f707f32e19fd59f685d59a79be8d12b5a
+Subproject commit a9d1b0e4e096ecbd0b2033ce4ff636759c9448c3
From 709328d61f1265f147ed0857866b56852131a9d1 Mon Sep 17 00:00:00 2001
From: White
Date: Sun, 14 May 2017 21:28:02 +0930
Subject: [PATCH 67/78] Update CHANGELOG.md
---
CHANGELOG.md | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 15f32ab5..aa42a2aa 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,8 +7,13 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin
* Updated OpenTerraria API to 1.3.5.3 (@DeathCradle)
* Updated Terraria Server API to 1.3.5.3 (@WhiteXZ, @hakusaro)
* Updated TShock core components to 1.3.5.3 (@hakusaro)
-* Terraria Server API version tick: 2.2
+* Terraria Server API version tick: 2.1
* Added OnNpcKilled hook to Server API: 2.2 (@tylerjwatson)
+* Added CreateCombatTextExtended to PacketTypes. This packet allows for the same functionality that packet 82 (CreateCombatText) used to have. (@WhiteXZ)
+* Updated ServerBroadcast hook to provide a NetworkText object. (@tylerjwatson)
+* Fixed levers and things not updating properly. (@deathcradle)
+* Deprecated PacketTypes.ChatText. Chat is now handled using the NetTextModule and packet 82. (@WhiteXZ, @Hakusaro)
+* Removed the -lang command-line flag from TShock. It is now a vanilla feature. (@Hakusaro)
## TShock 4.3.23
* Added evil type option during world creation (@mistzzt)
From 62d2a531417ee1649fb69aab31eaa1eb583cb5e9 Mon Sep 17 00:00:00 2001
From: White
Date: Sun, 14 May 2017 21:31:44 +0930
Subject: [PATCH 68/78] Version update
---
TShockAPI/Properties/AssemblyInfo.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/TShockAPI/Properties/AssemblyInfo.cs b/TShockAPI/Properties/AssemblyInfo.cs
index 91251a07..c5fc1426 100644
--- a/TShockAPI/Properties/AssemblyInfo.cs
+++ b/TShockAPI/Properties/AssemblyInfo.cs
@@ -53,5 +53,5 @@ using System.Runtime.InteropServices;
// Also, be sure to release on github with the exact assembly version tag as below
// so that the update manager works correctly (via the Github releases api and mimic)
-[assembly: AssemblyVersion("4.3.23")]
-[assembly: AssemblyFileVersion("4.3.23")]
+[assembly: AssemblyVersion("4.3.24")]
+[assembly: AssemblyFileVersion("4.3.24")]
From 0e051d1e80b8f6faf4652b7b1a5b0cae781c2abd Mon Sep 17 00:00:00 2001
From: Hussein Farran
Date: Mon, 15 May 2017 14:43:20 -0400
Subject: [PATCH 69/78] Changed Slack references to Discord
So Deathmax can sleep easy
---
CONTRIBUTING.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 6382cc88..01735e16 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -18,7 +18,7 @@ Note: This includes the API by default. If you need only the API, you need to cd
- Run ```msbuild TShock.sln``` in the root of the cloned folder on Windows in a 'Developer Command Prompt' OR
- Run ```xbuild TShock.sln``` in the root of the cloned folder on Unix.
-Need help? Drop by Slack and we'll be happy to explain it with more words, step by step.
+Need help? Drop by Discord and we'll be happy to explain it with more words, step by step.
### TShock Additions
@@ -26,7 +26,7 @@ If something is better suited to be a plugin for TShock, rather than a TShock co
_If you are confused, make a suggestion. We will determine scope and relevance for you._
-_If a person makes a suggestion in Slack, capture the suggestion as a Github issue. If a suggestion crops up on the forums, make a Github issue to capture it. If you want, direct the user to make a suggestion on Github, but set an alarm/timer/reminder so that if they don't know how to use Github or they don't have an account, an issue is still made and discussed. Make it clear that the issue is a surrogate issue for a suggestion from Slack/the forums too._
+_If a person makes a suggestion in Discord, capture the suggestion as a Github issue. If a suggestion crops up on the forums, make a Github issue to capture it. If you want, direct the user to make a suggestion on Github, but set an alarm/timer/reminder so that if they don't know how to use Github or they don't have an account, an issue is still made and discussed. Make it clear that the issue is a surrogate issue for a suggestion from Discord/the forums too._
### Pull Request Dev Guidelines
From 81e21f31dc9f68d4db77f15dbb207d2b3373cb63 Mon Sep 17 00:00:00 2001
From: death
Date: Tue, 16 May 2017 22:41:27 +1000
Subject: [PATCH 70/78] Submodule update and new grass creep checks
Pulls through the latest OTAPI to make use of the new WorldGrassSpread hook which should allow corruption/crimsion/hallow creep config options work.
---
TShockAPI/TShock.cs | 44 ++++++++++++++++++++++++++++++++++++--------
TerrariaServerAPI | 2 +-
2 files changed, 37 insertions(+), 9 deletions(-)
diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs
index 0d1c2bc7..42cd9ef1 100644
--- a/TShockAPI/TShock.cs
+++ b/TShockAPI/TShock.cs
@@ -349,6 +349,7 @@ namespace TShockAPI
ServerApi.Hooks.WorldHalloweenCheck.Register(this, OnHalloweenCheck);
ServerApi.Hooks.NetNameCollision.Register(this, NetHooks_NameCollision);
ServerApi.Hooks.ItemForceIntoChest.Register(this, OnItemForceIntoChest);
+ ServerApi.Hooks.WorldGrassSpread.Register(this, OnWorldGrassSpread);
Hooks.PlayerHooks.PlayerPreLogin += OnPlayerPreLogin;
Hooks.PlayerHooks.PlayerPostLogin += OnPlayerLogin;
Hooks.AccountHooks.AccountDelete += OnAccountDelete;
@@ -419,6 +420,7 @@ namespace TShockAPI
ServerApi.Hooks.WorldHalloweenCheck.Deregister(this, OnHalloweenCheck);
ServerApi.Hooks.NetNameCollision.Deregister(this, NetHooks_NameCollision);
ServerApi.Hooks.ItemForceIntoChest.Deregister(this, OnItemForceIntoChest);
+ ServerApi.Hooks.WorldGrassSpread.Deregister(this, OnWorldGrassSpread);
TShockAPI.Hooks.PlayerHooks.PlayerPostLogin -= OnPlayerLogin;
if (File.Exists(Path.Combine(SavePath, "tshock.pid")))
@@ -1208,24 +1210,50 @@ namespace TShockAPI
if (args.Handled)
return;
- if (!Config.AllowCrimsonCreep && (args.Type == TileID.Dirt || args.Type == TileID.FleshWeeds
- || TileID.Sets.Crimson[args.Type]))
+ if (!OnCreep(args.Type))
{
args.Handled = true;
+ }
+ }
+
+ /// OnWorldGrassSpread - Fired when grass is attempting to spread.
+ /// args - The GrassSpreadEventArgs object.
+ private void OnWorldGrassSpread(GrassSpreadEventArgs args)
+ {
+ if (args.Handled)
return;
+
+ if(!OnCreep(args.Grass))
+ {
+ args.Handled = true;
+ }
+ }
+
+ ///
+ /// Checks if the tile type is allowed to creep
+ ///
+ /// Tile id
+ /// True if allowed, otherwise false
+ private bool OnCreep(int tileType)
+ {
+ if (!Config.AllowCrimsonCreep && (tileType == TileID.Dirt || tileType == TileID.FleshWeeds
+ || TileID.Sets.Crimson[tileType]))
+ {
+ return false;
}
- if (!Config.AllowCorruptionCreep && (args.Type == TileID.Dirt || args.Type == TileID.CorruptThorns
- || TileID.Sets.Corrupt[args.Type]))
+ if (!Config.AllowCorruptionCreep && (tileType == TileID.Dirt || tileType == TileID.CorruptThorns
+ || TileID.Sets.Corrupt[tileType]))
{
- args.Handled = true;
- return;
+ return false;
}
- if (!Config.AllowHallowCreep && (TileID.Sets.Hallow[args.Type]))
+ if (!Config.AllowHallowCreep && (TileID.Sets.Hallow[tileType]))
{
- args.Handled = true;
+ return false;
}
+
+ return true;
}
/// OnStatueSpawn - Fired when a statue spawns.
diff --git a/TerrariaServerAPI b/TerrariaServerAPI
index a9d1b0e4..d3b7d9f4 160000
--- a/TerrariaServerAPI
+++ b/TerrariaServerAPI
@@ -1 +1 @@
-Subproject commit a9d1b0e4e096ecbd0b2033ce4ff636759c9448c3
+Subproject commit d3b7d9f4575602f468cf1e009ebc4bc5b79547c4
From c841a86cdf7987a079f5665aa7608ca02f12ef99 Mon Sep 17 00:00:00 2001
From: Ruby Rose
Date: Wed, 7 Jun 2017 10:46:46 +0300
Subject: [PATCH 71/78] hooks added
---
TShockAPI/Hooks/PlayerHooks.cs | 158 +++++++++++++++++++++++++++++++++
1 file changed, 158 insertions(+)
diff --git a/TShockAPI/Hooks/PlayerHooks.cs b/TShockAPI/Hooks/PlayerHooks.cs
index 43684387..062a78b8 100644
--- a/TShockAPI/Hooks/PlayerHooks.cs
+++ b/TShockAPI/Hooks/PlayerHooks.cs
@@ -18,6 +18,7 @@ along with this program. If not, see .
using System.Collections.Generic;
using System.ComponentModel;
+using TShockAPI.DB;
namespace TShockAPI.Hooks
{
@@ -166,6 +167,87 @@ namespace TShockAPI.Hooks
}
}
+ ///
+ /// EventArgs used for the event.
+ ///
+ public class PlayerItembanPermissionEventArgs : HandledEventArgs
+ {
+ ///
+ /// The player who fired the event.
+ ///
+ public TSPlayer Player { get; set; }
+
+ ///
+ /// The banned item being checked.
+ ///
+ public ItemBan BannedItem { get; set; }
+
+ ///
+ /// Initializes a new instance of the PlayerItembanPermissionEventArgs class.
+ ///
+ /// The player who fired the event.
+ /// The permission being checked.
+ public PlayerItembanPermissionEventArgs(TSPlayer player, ItemBan bannedItem)
+ {
+ Player = player;
+ BannedItem = bannedItem;
+ }
+ }
+
+ ///
+ /// EventArgs used for the event.
+ ///
+ public class PlayerProjbanPermissionEventArgs : HandledEventArgs
+ {
+ ///
+ /// The player who fired the event.
+ ///
+ public TSPlayer Player { get; set; }
+
+ ///
+ /// The banned projectile being checked.
+ ///
+ public ProjectileBan BannedProjectile { get; set; }
+
+ ///
+ /// Initializes a new instance of the PlayerProjbanPermissionEventArgs class.
+ ///
+ /// The player who fired the event.
+ /// The banned projectile being checked.
+ public PlayerProjbanPermissionEventArgs(TSPlayer player, ProjectileBan checkedProjectile)
+ {
+ Player = player;
+ BannedProjectile = checkedProjectile;
+ }
+ }
+
+ ///
+ /// EventArgs used for the event.
+ ///
+ public class PlayerTilebanPermissionEventArgs : HandledEventArgs
+ {
+ ///
+ /// The player who fired the event.
+ ///
+ public TSPlayer Player { get; set; }
+
+ ///
+ /// The banned tile being checked.
+ ///
+ public TileBan BannedTile { get; set; }
+
+ ///
+ /// Initializes a new instance of the PlayerTilebanPermissionEventArgs class.
+ ///
+ /// The player who fired the event.
+ /// The banned tile being checked.
+ public PlayerTilebanPermissionEventArgs(TSPlayer player, TileBan checkedTile)
+ {
+ Player = player;
+ BannedTile = checkedTile;
+ }
+ }
+
///
/// A collection of events fired by players that can be hooked to.
///
@@ -232,6 +314,37 @@ namespace TShockAPI.Hooks
///
public static event PlayerPermissionD PlayerPermission;
+ ///
+ /// The delegate of the event.
+ ///
+ /// The EventArgs for this event.
+ public delegate void PlayerItembanPermissionD(PlayerItembanPermissionEventArgs e);
+ ///
+ /// Fired by players every time a permission check on banned items involving them occurs.
+ ///
+ public static event PlayerItembanPermissionD PlayerItembanPermission;
+
+ ///
+ /// The delegate of the event.
+ ///
+ /// The EventArgs for this event.
+ public delegate void PlayerProjbanPermissionD(PlayerProjbanPermissionEventArgs e);
+ ///
+ /// Fired by players every time a permission check on banned projectiles involving them occurs.
+ ///
+ public static event PlayerProjbanPermissionD PlayerProjbanPermission;
+
+ ///
+ /// The delegate of the event.
+ ///
+ /// The EventArgs for this event.
+ public delegate void PlayerTilebanPermissionD(PlayerTilebanPermissionEventArgs e);
+ ///
+ /// Fired by players every time a permission check on banned tiles involving them occurs.
+ ///
+ public static event PlayerTilebanPermissionD PlayerTilebanPermission;
+
+
///
/// Fires the event.
///
@@ -336,5 +449,50 @@ namespace TShockAPI.Hooks
PlayerPermission(args);
return args.Handled;
}
+
+ ///
+ /// Fires the event.
+ ///
+ /// The player firing the event.
+ /// True if the event has been handled.
+ public static bool OnPlayerItembanPermission(TSPlayer player, ItemBan bannedItem)
+ {
+ if (PlayerItembanPermission == null)
+ return false;
+
+ var args = new PlayerItembanPermissionEventArgs(player, bannedItem);
+ PlayerItembanPermission(args);
+ return args.Handled;
+ }
+
+ ///
+ /// Fires the event.
+ ///
+ /// The player firing the event.
+ /// True if the event has been handled.
+ public static bool OnPlayerProjbanPermission(TSPlayer player, ProjectileBan bannedProj)
+ {
+ if (PlayerProjbanPermission == null)
+ return false;
+
+ var args = new PlayerProjbanPermissionEventArgs(player, bannedProj);
+ PlayerProjbanPermission(args);
+ return args.Handled;
+ }
+
+ ///
+ /// Fires the event.
+ ///
+ /// The player firing the event.
+ /// True if the event has been handled.
+ public static bool OnPlayerTilebanPermission(TSPlayer player, TileBan bannedTile)
+ {
+ if (PlayerTilebanPermission == null)
+ return false;
+
+ var args = new PlayerTilebanPermissionEventArgs(player, bannedTile);
+ PlayerTilebanPermission(args);
+ return args.Handled;
+ }
}
}
From 81cb1381b44fdc16882da43ddb2df1f294277ba7 Mon Sep 17 00:00:00 2001
From: Ruby Rose
Date: Wed, 7 Jun 2017 15:32:40 +0300
Subject: [PATCH 72/78] Add hooks for item/projectile/tile bans
---
TShockAPI/DB/ItemManager.cs | 4 ++++
TShockAPI/DB/ProjectileManager.cs | 4 ++++
TShockAPI/DB/TileManager.cs | 4 ++++
TShockAPI/TSPlayer.cs | 18 ++++++++++++++++++
4 files changed, 30 insertions(+)
diff --git a/TShockAPI/DB/ItemManager.cs b/TShockAPI/DB/ItemManager.cs
index 4ce43066..0ff89b40 100644
--- a/TShockAPI/DB/ItemManager.cs
+++ b/TShockAPI/DB/ItemManager.cs
@@ -21,6 +21,7 @@ using System.Collections.Generic;
using System.Data;
using System.Linq;
using MySql.Data.MySqlClient;
+using TShockAPI.Hooks;
namespace TShockAPI.DB
{
@@ -200,6 +201,9 @@ namespace TShockAPI.DB
if (ply.HasPermission(Permissions.usebanneditem))
return true;
+ if (PlayerHooks.OnPlayerItembanPermission(ply, this))
+ return true;
+
var cur = ply.Group;
var traversed = new List();
while (cur != null)
diff --git a/TShockAPI/DB/ProjectileManager.cs b/TShockAPI/DB/ProjectileManager.cs
index 3f736c9b..79bf9a37 100644
--- a/TShockAPI/DB/ProjectileManager.cs
+++ b/TShockAPI/DB/ProjectileManager.cs
@@ -21,6 +21,7 @@ using System.Collections.Generic;
using System.Data;
using System.Linq;
using MySql.Data.MySqlClient;
+using TShockAPI.Hooks;
namespace TShockAPI.DB
{
@@ -205,6 +206,9 @@ namespace TShockAPI.DB
if (ply.HasPermission(Permissions.canusebannedprojectiles))
return true;
+ if (PlayerHooks.OnPlayerProjbanPermission(ply, this))
+ return true;
+
var cur = ply.Group;
var traversed = new List();
while (cur != null)
diff --git a/TShockAPI/DB/TileManager.cs b/TShockAPI/DB/TileManager.cs
index 911bf27b..90a235f8 100644
--- a/TShockAPI/DB/TileManager.cs
+++ b/TShockAPI/DB/TileManager.cs
@@ -21,6 +21,7 @@ using System.Collections.Generic;
using System.Data;
using System.Linq;
using MySql.Data.MySqlClient;
+using TShockAPI.Hooks;
namespace TShockAPI.DB
{
@@ -205,6 +206,9 @@ namespace TShockAPI.DB
if (ply.HasPermission(Permissions.canusebannedtiles))
return true;
+ if (PlayerHooks.OnPlayerTilebanPermission(ply, this))
+ return true;
+
var cur = ply.Group;
var traversed = new List();
while (cur != null)
diff --git a/TShockAPI/TSPlayer.cs b/TShockAPI/TSPlayer.cs
index 43f7fe18..9b42d7b4 100644
--- a/TShockAPI/TSPlayer.cs
+++ b/TShockAPI/TSPlayer.cs
@@ -1253,6 +1253,24 @@ namespace TShockAPI
else
return Group.HasPermission(permission);
}
+
+ ///
+ public bool HasPermission(ItemBan bannedItem)
+ {
+ return TShock.Itembans.ItemIsBanned(bannedItem.Name, this);
+ }
+
+ ///
+ public bool HasPermission(ProjectileBan bannedProj)
+ {
+ return TShock.ProjectileBans.ProjectileIsBanned(bannedProj.ID, this);
+ }
+
+ ///
+ public bool HasPermission(TileBan bannedTile)
+ {
+ return TShock.TileBans.TileIsBanned(bannedTile.ID, this);
+ }
}
public class TSRestPlayer : TSPlayer
From 8ae0a3b5a6518a573f1287356f23d7a03398678a Mon Sep 17 00:00:00 2001
From: Ruby Rose
Date: Thu, 8 Jun 2017 17:18:38 +0300
Subject: [PATCH 73/78] Write proper docs
---
TShockAPI/TSPlayer.cs | 22 ++++++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)
diff --git a/TShockAPI/TSPlayer.cs b/TShockAPI/TSPlayer.cs
index 9b42d7b4..42d1b157 100644
--- a/TShockAPI/TSPlayer.cs
+++ b/TShockAPI/TSPlayer.cs
@@ -1254,19 +1254,33 @@ namespace TShockAPI
return Group.HasPermission(permission);
}
- ///
+ ///
+ /// Checks to see if a player has permission to use the specific banned item.
+ /// Fires the hook which may be handled to override item ban permission checks.
+ ///
+ /// The to check.
+ /// True if the player has permission to use the banned item.
public bool HasPermission(ItemBan bannedItem)
{
return TShock.Itembans.ItemIsBanned(bannedItem.Name, this);
}
- ///
+ ///
+ /// Checks to see if a player has permission to use the specific banned projectile.
+ /// Fires the hook which may be handled to override projectile ban permission checks.
+ ///
+ /// The to check.
+ /// True if the player has permission to use the banned projectile.
public bool HasPermission(ProjectileBan bannedProj)
{
return TShock.ProjectileBans.ProjectileIsBanned(bannedProj.ID, this);
}
-
- ///
+ ///
+ /// Checks to see if a player has permission to use the specific banned tile.
+ /// Fires the hook which may be handled to override tile ban permission checks.
+ ///
+ /// The to check.
+ /// True if the player has permission to use the banned tile.
public bool HasPermission(TileBan bannedTile)
{
return TShock.TileBans.TileIsBanned(bannedTile.ID, this);
From 331eeb8cec794a963c05980178327cc6ef866b10 Mon Sep 17 00:00:00 2001
From: MarioE
Date: Mon, 19 Jun 2017 01:15:45 -0400
Subject: [PATCH 74/78] Fix SaveManager saving when 1 player is on the server
and another joins
The real fix would be to fix ServerLeave to not fire incorrectly when a player joins, but this will do for now.
---
TShockAPI/TShock.cs | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs
index 42cd9ef1..776846fa 100644
--- a/TShockAPI/TShock.cs
+++ b/TShockAPI/TShock.cs
@@ -1405,9 +1405,14 @@ namespace TShockAPI
}
var tsplr = Players[args.Who];
+ if (tsplr == null)
+ {
+ return;
+ }
+
Players[args.Who] = null;
- if (tsplr != null && tsplr.ReceivedInfo)
+ if (tsplr.ReceivedInfo)
{
if (!tsplr.SilentKickInProgress && tsplr.State >= 3)
Utils.Broadcast(tsplr.Name + " has left.", Color.Yellow);
@@ -1431,7 +1436,7 @@ namespace TShockAPI
}
// Fire the OnPlayerLogout hook too, if the player was logged in and they have a TSPlayer object.
- if (tsplr != null && tsplr.IsLoggedIn)
+ if (tsplr.IsLoggedIn)
{
Hooks.PlayerHooks.OnPlayerLogout(tsplr);
}
From 9ad63c37a616e2b920fcdbc6d7fdc28cbcfae250 Mon Sep 17 00:00:00 2001
From: MarioE
Date: Wed, 21 Jun 2017 01:21:32 -0400
Subject: [PATCH 75/78] Fix /spawnmob not spawning negative IDs again.
---
TShockAPI/Commands.cs | 2 +-
TShockAPI/TSServerPlayer.cs | 7 +------
2 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs
index ee9106fc..3b07ca75 100644
--- a/TShockAPI/Commands.cs
+++ b/TShockAPI/Commands.cs
@@ -2300,7 +2300,7 @@ namespace TShockAPI
var npc = npcs[0];
if (npc.type >= 1 && npc.type < Main.maxNPCTypes && npc.type != 113)
{
- TSPlayer.Server.SpawnNPC(npc.type, npc.FullName, amount, args.Player.TileX, args.Player.TileY, 50, 20);
+ TSPlayer.Server.SpawnNPC(npc.netID, npc.FullName, amount, args.Player.TileX, args.Player.TileY, 50, 20);
if (args.Silent)
{
args.Player.SendSuccessMessage("Spawned {0} {1} time(s).", npc.FullName, amount);
diff --git a/TShockAPI/TSServerPlayer.cs b/TShockAPI/TSServerPlayer.cs
index a1084d61..b811e9a8 100644
--- a/TShockAPI/TSServerPlayer.cs
+++ b/TShockAPI/TSServerPlayer.cs
@@ -152,12 +152,7 @@ namespace TShockAPI
int spawnTileY;
TShock.Utils.GetRandomClearTileWithInRange(startTileX, startTileY, tileXRange, tileYRange, out spawnTileX,
out spawnTileY);
- int npcid = NPC.NewNPC(spawnTileX * 16, spawnTileY * 16, type, 0);
-
- // TODO: If special slimes break look at the git blame for this spot
- // It's probably because I removed something that didn't work
- Main.npc[npcid].SetDefaults(type);
-
+ NPC.NewNPC(spawnTileX * 16, spawnTileY * 16, type);
}
}
From 40e3a9d5b872ea005e72e6f25bdee351226030b3 Mon Sep 17 00:00:00 2001
From: Ryozuki
Date: Thu, 22 Jun 2017 21:05:14 +0200
Subject: [PATCH 76/78] fix comment typo
---
TShockAPI/DB/WarpsManager.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/TShockAPI/DB/WarpsManager.cs b/TShockAPI/DB/WarpsManager.cs
index d48ba40e..6ed72f4e 100644
--- a/TShockAPI/DB/WarpsManager.cs
+++ b/TShockAPI/DB/WarpsManager.cs
@@ -61,7 +61,7 @@ namespace TShockAPI.DB
/// The X position.
/// The Y position.
/// The name.
- /// Whether the opration succeeded.
+ /// Whether the operation succeeded.
public bool Add(int x, int y, string name)
{
try
From 241d4c566faedd740796822ed1f5cdb10c377dfd Mon Sep 17 00:00:00 2001
From: MarioE
Date: Fri, 23 Jun 2017 14:44:17 -0400
Subject: [PATCH 77/78] Fix incorrect slot calculation, and update submodule.
---
TShockAPI/TShock.cs | 6 +++---
TerrariaServerAPI | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs
index 776846fa..022e70e5 100644
--- a/TShockAPI/TShock.cs
+++ b/TShockAPI/TShock.cs
@@ -2237,9 +2237,9 @@ namespace TShockAPI
Netplay.ListenPort = file.ServerPort;
}
- if (file.MaxSlots > 235)
- file.MaxSlots = 235;
- Main.maxNetPlayers = file.MaxSlots + 20;
+ if (file.MaxSlots > Main.maxPlayers - file.ReservedSlots)
+ file.MaxSlots = Main.maxPlayers - file.ReservedSlots;
+ Main.maxNetPlayers = file.MaxSlots + file.ReservedSlots;
Netplay.ServerPassword = "";
if (!string.IsNullOrEmpty(_cliPassword))
diff --git a/TerrariaServerAPI b/TerrariaServerAPI
index d3b7d9f4..bc9f7c69 160000
--- a/TerrariaServerAPI
+++ b/TerrariaServerAPI
@@ -1 +1 @@
-Subproject commit d3b7d9f4575602f468cf1e009ebc4bc5b79547c4
+Subproject commit bc9f7c69becb60816fc1e4587bbca15991231317
From 50a4b07bc39ad58dcec4f5c16cf5ea31135bd6f7 Mon Sep 17 00:00:00 2001
From: MarioE
Date: Fri, 23 Jun 2017 14:47:38 -0400
Subject: [PATCH 78/78] Add "new" EditActions.
---
TShockAPI/GetDataHandlers.cs | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs
index 0bb216e1..2a7ddd00 100644
--- a/TShockAPI/GetDataHandlers.cs
+++ b/TShockAPI/GetDataHandlers.cs
@@ -1909,7 +1909,10 @@ namespace TShockAPI
KillWire2,
PlaceWire3,
KillWire3,
- SlopeTile
+ SlopeTile,
+ FrameTrack,
+ PlaceWire4,
+ KillWire4
}
public enum EditType
{