Skip to content

Commit

Permalink
更新至稳定版2.6(英文版v4.3.24)
Browse files Browse the repository at this point in the history
  • Loading branch information
mistzzt committed May 14, 2017
2 parents 5854e19 + 62d2a53 commit aa2b4b8
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 22 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ https://tshock.readme.io/docs/getting-started-1

> 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).
提交PR时请先阅读[CONTRIBUTING.md](https://github.com/mistzzt/TShock/blob/adv-cn_dev/CONTRIBUTING.md)并按照指明规范编写代码。

Expand Down
2 changes: 1 addition & 1 deletion TShockAPI/Commands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5228,7 +5228,7 @@ private static void Butcher(CommandArgs args)
{
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++;
}
}
Expand Down
4 changes: 2 additions & 2 deletions TShockAPI/GetDataHandlers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2151,7 +2151,7 @@ private static bool HandleTile(GetDataHandlerArgs args)
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;
Expand Down Expand Up @@ -2611,7 +2611,7 @@ private static bool HandlePlayerUpdate(GetDataHandlerArgs args)
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("使用被封禁的物品 ({0})".SFormat(itemName), DisableFlags.WriteToLogAndConsole);
Expand Down
4 changes: 2 additions & 2 deletions TShockAPI/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@
// 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")]
29 changes: 19 additions & 10 deletions TShockAPI/TShock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ public class TShock : TerrariaPlugin
/// <summary>VersionCodename - The version codename is displayed when the server starts. Inspired by software codenames conventions.</summary>
public static readonly string VersionCodename = "Mintaka";
/// <summary>CNMode - 显示当前汉化版本信息.</summary>
public static readonly string CnMode = "开发版";
public static readonly string CnMode = "稳定版";
/// <summary>CNVersion - 显示当前汉化版本号.</summary>
public static readonly Version CnVersion = new Version(2, 5, 0, 0);
public static readonly Version CnVersion = new Version(2, 6, 0, 0);

/// <summary>SavePath - This is the path TShock saves its data in. This path is relative to the TerrariaServer.exe (not in ServerPlugins).</summary>
public static string SavePath = "tshock";
Expand Down Expand Up @@ -1083,7 +1083,7 @@ private void OnSecondUpdate()
{
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($"持有禁用物品: {player.TPlayer.inventory[player.TPlayer.selectedItem].Name}", flags);
player.SendErrorMessage($"你不能选中被禁用的物品: {player.TPlayer.inventory[player.TPlayer.selectedItem].Name}");
Expand Down Expand Up @@ -1163,7 +1163,7 @@ private void OnSecondUpdate()
{
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($"持有被禁用的物品: {player.TPlayer.inventory[player.TPlayer.selectedItem].Name}", flags);
player.SendErrorMessage($"你选中了被禁止的物品. 请取消选中: {player.TPlayer.inventory[player.TPlayer.selectedItem].Name}");
Expand Down Expand Up @@ -1501,22 +1501,31 @@ private void OnChat(ServerChatEventArgs args)
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);

//Give that poor player their name back :'c
ply.name = name;
Hooks.PlayerHooks.OnPlayerChat(tsplr, args.Text, ref text);
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(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);
string msg = String.Format("<{0}> {1}",
String.Format(Config.ChatAboveHeadsFormat, tsplr.Group.Name, tsplr.Group.Prefix, tsplr.Name, tsplr.Group.Suffix),
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("消息: {0}", msg);
args.Handled = true;
Expand Down
2 changes: 1 addition & 1 deletion TerrariaServerAPI
2 changes: 1 addition & 1 deletion scripts/StartServer.cmd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@echo off
cls
title Starting TShock...
TerrariaServer.exe -lang 7
TerrariaServer.exe -language zh-Hans
1 change: 1 addition & 0 deletions scripts/StartServer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mono TerrariaServer.exe -language zh-Hans
9 changes: 6 additions & 3 deletions scripts/create_release.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ $http_bin_name = "HttpServer.dll"
$tshock_bin_name = "TShockAPI.dll"
$bcrypt_bin_name = "BCrypt.Net.dll"
$geoip_db_name = "GeoIP.dat"
$start_script_name = "StartServer.cmd"
$start_cmd_script_name = "StartServer.cmd"
$start_sh_script_name = "StartServer.sh"

$tsapi_release_bin = JoinPath "TerrariaServerAPI" "TerrariaServerAPI" "bin" "Release" $tsapi_bin_name
$otapi_bin = JoinPath "TerrariaServerAPI" "TerrariaServerAPI" "bin" "Release" $otapi_bin_name
Expand All @@ -27,7 +28,8 @@ $json_bin = JoinPath "packages" "Newtonsoft.Json.9.0.1" "lib" "net45" $json_bin_
$bcrypt_bin = JoinPath "packages" "BCrypt.Net.0.1.0" "lib" "net35" $bcrypt_bin_name
$geoip_db = JoinPath "prebuilts" $geoip_db_name
$release_bin = JoinPath "TShockAPI" "bin" "Release" $tshock_bin_name
$start_script_bin = JoinPath "scripts" $start_script_name
$start_cmd_script_bin = JoinPath "scripts" $start_cmd_script_name
$start_sh_script_bin = JoinPath "scripts" $start_sh_script_name

function RunBootstrapper
{
Expand All @@ -49,7 +51,8 @@ function CopyDependencies
Copy-Item $sqlite_dep $release_dir
Copy-Item $geoip_db $release_dir

Copy-Item $start_script_bin $release_dir
Copy-Item $start_cmd_script_bin $release_dir
Copy-Item $start_sh_script_bin $release_dir

Copy-Item $bcrypt_bin $release_plugin_dir
Copy-Item $mysql_bin $release_plugin_dir
Expand Down

0 comments on commit aa2b4b8

Please sign in to comment.