Saving work to apply merge changes
Currently moving .name to .Name and things like that from Item
This commit is contained in:
parent
d50fa2fbc4
commit
2a5efa65ae
7 changed files with 54 additions and 45 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -1,6 +1,6 @@
|
|||
# Sublime Text #
|
||||
*.sublime-*
|
||||
|
||||
releases/
|
||||
# Compiled source #
|
||||
###################
|
||||
*.com
|
||||
|
|
@ -67,4 +67,4 @@ _ReSharper.*
|
|||
packages/*
|
||||
|
||||
# Private key files #
|
||||
scripts/ssh_private_key
|
||||
scripts/ssh_private_key
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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++;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<system.data>
|
||||
<DbProviderFactories>
|
||||
<remove invariant="MySql.Data.MySqlClient"/>
|
||||
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.9.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/>
|
||||
<remove invariant="MySql.Data.MySqlClient" />
|
||||
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.9.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
|
||||
</DbProviderFactories>
|
||||
</system.data>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup></configuration>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /></startup></configuration>
|
||||
|
|
|
|||
9
TShockAPI/web.config
Normal file
9
TShockAPI/web.config
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<system.data>
|
||||
<DbProviderFactories>
|
||||
<remove invariant="MySql.Data.MySqlClient" />
|
||||
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.9.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
|
||||
</DbProviderFactories>
|
||||
</system.data>
|
||||
</configuration>
|
||||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue