Skip to content

Commit

Permalink
更新v4.3.20 (汉化v1.5)
Browse files Browse the repository at this point in the history
  • Loading branch information
mistzzt committed Oct 22, 2016
2 parents fcab6a9 + 9b7ca64 commit a942269
Show file tree
Hide file tree
Showing 76 changed files with 555 additions and 172 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,6 @@ _ReSharper.*
# GTFO NuGet stuff #
####################
packages/*

# Private key files #
scripts/ssh_private_key
8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
language: csharp
solution: ./TShockAPI/TShockAPI.csproj
solution: "./TShockAPI/TShockAPI.csproj"
sudo: false
install:
- nuget restore
- nuget restore
script: python ./scripts/create_release.py
notifications:
slack:
secure: O4Nibe2fdaUa2ZxuETUg6WEoQKvNM2CotnfaIVgm3fjfe61dfE1P+EgTpbwDG8646jSmpTqMDw8Z6I/WJwGTlXV/ZQsbwu63Cps4MgOTvPHZ0Lsye5azySlJZs1iI4ItYSj2czXfcnJ+qAl1SOOkXJrjB5uyTMWtDpCrSCFB3MA=
secure: O4Nibe2fdaUa2ZxuETUg6WEoQKvNM2CotnfaIVgm3fjfe61dfE1P+EgTpbwDG8646jSmpTqMDw8Z6I/WJwGTlXV/ZQsbwu63Cps4MgOTvPHZ0Lsye5azySlJZs1iI4ItYSj2czXfcnJ+qAl1SOOkXJrjB5uyTMWtDpCrSCFB3MA=
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@

This is the rolling changelog for TShock for Terraria. Use past tense when adding new entries; sign your name off when you add or change something. This should primarily be things like user changes, not necessarily codebase changes unless it's really relevant or large.

## Upcoming Changes
## TShock 4.3.20
* Security improvement: The auth system is now automatically disabled if a superadmin exists in the database (@Enerdy).
* Removed the `auth-verify` command since `auth` now serves its purpose when necessary (@Enerdy).
* Security: `/"` exploit can no longer break chat mute filters (@Simon311).
* Fixed an issue where sometimes players could connect briefly during server shutdown, leading to errors (@Simon311).
* Fixed wyverns despawning & not behaving like normal (@WhiteXZ).
* Fixed major security issue where InvokeClientConnect could be exploited to do terrible, terrible things (@Simon311, @nicatronTg, @popstarfreas, @ProfessorXZ).

## TShock 4.3.19
* Compatibility with Terraria 1.3.3.3 (@Simon311)
Expand Down
21 changes: 18 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
_When in doubt, make an issue. If any of these instructions are unclear, make an issue to discuss your issue or suggestion._

### Issue Guidelines
Please follow these simple requirements before posting a bug report:

Expand All @@ -11,7 +13,7 @@ Please follow these simple requirements before posting a bug report:
Note: This includes the API by default. If you need only the API, you need to cd into that folder and do the following with the .sln file for the API. For those new to C#, the .sln and .csproj files contain the necessary definitions to do a complete source build using Microsoft or Mono build tools.

- Checkout the source.
- Initialize the submodules: ```git submodule init```
- Initialize the submodules: ```git submodule update --init```
- Open the source in your favorite text editor that supports .NET building and press the build button OR
- 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.
Expand All @@ -20,11 +22,24 @@ Need help? Drop by Slack and we'll be happy to explain it with more words, step

### TShock Additions

If something is better suited to be a plugin for TShock, rather than a TShock core feature, it should not be added!
If something is better suited to be a plugin for TShock, rather than a TShock core feature, it should not be added! Project scope is at times questionable, though, so create an issue on Github for discussion first. If an issue is completely outside of the scope of TShock, it will be made clear in that issue what it is.

_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._

### Pull Request Dev Guidelines

These guidelines are for all contributors. Please join our Slack instance and ask about your idea first, if you're implementing a new feature, system, or changing an existing implementation. Pull requests that change large feature sets or swathes of code will be dissected for quality and purpose prior to approval, and requests that conflict with a team developer's work may be declined if the project is already being worked on internally, but not released. In addition, issues assigned to Nyx developers that are recent and fresh should be considered a no-go zone, while that developer works on their solution outside the scope of Github.
These guidelines are for all contributors.

* Create an issue first to suggest an improvement or feature addition to TShock.
* Active developers will then give a go/no go for implementation. This is scope related: if an issue is within the scope of TShock, it will be tagged 'pr-wanted.'
* After 'pr-wanted' has been added, an issue should be considered workable in a pull request fashion.
* If you, as a developer, want to claim an issue for a PR, as soon as possible start work and note that in both the original issue and the new PR. The 'pr-wanted' tag will remain but the active PR will become the center for discussion for your implementation.
* If a TShock core developer takes an issue, they'll be assigned to the issue. If your issue was taken by a TShock developer and you were actively developing it in a PR, you should _make it clear as soon as possible that a process error has been made_ so that the your development resources and our development resources aren't wasted.
* Please send a pull request with at least a sentence description and something meaningful as the title, not just the issue number you're fixing.

_The pr-wanted tag indicates an issue should be implemented. If an issue has a developer assigned, it indicates that they're working on it. When in doubt, ask where an issue is before starting work (so you don't waste time)!_

Even if you have write access to the repository, follow [Github flow](https://guides.github.com/introduction/flow/) when sending commits. Don't send commits directly to either ```master``` or ```general-devel``` unless those commits modify either the deploy scripts or non-code components. If it compiles, follow Github Flow.

Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# TShock 中文版本 [![编译状态](https://travis-ci.org/mistzzt/TShock.png?branch=adv-cn_dev)](https://travis-ci.org/mistzzt/TShock)
<p align="center">
<img src="https://tshock.co/newlogo.png" alt="TShock for Terraria"><br />
<a href="https://travis-ci.org/NyxStudios/TShock"><img src="https://travis-ci.org/NyxStudios/TShock.png?branch=general-devel" alt="编译状态"></a><br />
<hr />
</p>

## 中文版本的说明

Expand Down
2 changes: 1 addition & 1 deletion TShockAPI/BackupManager.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
TShock, a server mod for Terraria
Copyright (C) 2011-2015 Nyx Studios (fka. The TShock Team)
Copyright (C) 2011-2016 Nyx Studios (fka. The TShock Team)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
124 changes: 67 additions & 57 deletions TShockAPI/Commands.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
TShock, a server mod for Terraria
Copyright (C) 2011-2015 Nyx Studios (fka. The TShock Team)
Copyright (C) 2011-2016 Nyx Studios (fka. The TShock Team)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -213,11 +213,7 @@ public static void InitCommands()
AllowServer = false,
HelpText = "首次登入游戏时验证超管."
});
add(new Command(Permissions.authverify, AuthVerify, "auth-verify", "完成验证")
{
HelpText = "关闭密钥验证超管."
});
add(new Command(Permissions.user, ManageUsers, "user", "用户")
add(new Command(Permissions.user, ManageUsers, "user")
{
DoLog = false,
HelpText = "管理用户账户."
Expand Down Expand Up @@ -632,12 +628,31 @@ public static bool HandleCommand(TSPlayer player, string text)
if (cmdPrefix == SilentSpecifier)
silent = true;

var args = ParseParameters(cmdText);
if (args.Count < 1)
return false;
int index = -1;
for (int i = 0; i < cmdText.Length; i++)
{
if (IsWhiteSpace(cmdText[i]))
{
index = i;
break;
}
}
string cmdName;
if (index == 0) // Space after the command specifier should not be supported
{
player.SendErrorMessage("指令无效. 键入 {0}help 以获取可用指令.", Specifier);
return true;
}
else if (index < 0)
cmdName = cmdText.ToLower();
else
cmdName = cmdText.Substring(0, index).ToLower();

string cmdName = args[0].ToLower();
args.RemoveAt(0);
List<string> args;
if (index < 0)
args = new List<string>();
else
args = ParseParameters(cmdText.Substring(index));

IEnumerable<Command> cmds = ChatCommands.FindAll(c => c.HasAlias(cmdName));

Expand Down Expand Up @@ -992,8 +1007,9 @@ private static void RegisterUser(CommandArgs args)
}
else
{
args.Player.SendErrorMessage("账户 " + user.Name + " 已经被注册了.");
TShock.Log.ConsoleInfo(args.Player.Name + " 尝试注册一个存在的账户: " + user.Name);
args.Player.SendErrorMessage("抱歉, 账号 " + user.Name + " 已经被其他人注册了.");
args.Player.SendErrorMessage("请用其他的名称注册.");
TShock.Log.ConsoleInfo(args.Player.Name + " 注册已有账户失败: " + user.Name);
}
}
catch (UserManagerException ex)
Expand Down Expand Up @@ -4631,62 +4647,56 @@ private static void AuthToken(CommandArgs args)
{
if (TShock.AuthToken == 0)
{
args.Player.SendWarningMessage("密钥获取权限已停止, 该次非法尝试讲被记录.");
TShock.Utils.ForceKick(args.Player, "验证系统已经停止.", true, true);
TShock.Log.Warn("玩家 {0} 尝试执行被禁用的 {1}auth 指令.", args.Player.IP, Specifier);
return;
}
int givenCode = Convert.ToInt32(args.Parameters[0]);
if (givenCode == TShock.AuthToken && args.Player.Group.Name != "superadmin")
{
try
{
args.Player.Group = TShock.Utils.GetGroup("superadmin");
args.Player.SendInfoMessage("你现在已经拥有临时超级管理权, 退出游戏后就会被系统收回.");
args.Player.SendInfoMessage("若想长期使用, 请按照下面步骤创建永久超级管理账户..");
args.Player.SendInfoMessage("执行 -- {0}user add <用户名> <密码> superadmin", Specifier);
args.Player.SendInfoMessage("结果 -- <用户名>(<密码>) 会被添加到超管组.");
args.Player.SendInfoMessage("完成上述操作后, 执行 -- {0}login <用户名(若和玩家名一致, 可省略)> <密码> --.", Specifier);
args.Player.SendInfoMessage("若明白, 请按照上述说的执行, 完成后, 执行 {0}auth-verify 来关闭验证功能.", Specifier);
}
catch (UserManagerException ex)
if (args.Player.Group.Name == new SuperAdminGroup().Name)
args.Player.SendInfoMessage("验证系统已经被关闭.");
else
{
TShock.Log.ConsoleError(ex.ToString());
args.Player.SendErrorMessage(ex.Message);
args.Player.SendWarningMessage("验证系统被禁用; 本次尝试验证将被记录.");
TShock.Utils.ForceKick(args.Player, "验证系统被禁用.", true, true);
TShock.Log.Warn("{0} 在验证系统被禁用的情况下尝试执行 {1}auth", args.Player.IP, Specifier);
return;
}
return;
}

if (args.Player.Group.Name == "superadmin")
// If the user account is already a superadmin (permanent), disable the system
if (args.Player.IsLoggedIn && args.Player.tempGroup == null && args.Player.Group.Name == new SuperAdminGroup().Name)
{
args.Player.SendInfoMessage("请禁用验证系统! 若需要帮助, 联系TShock论坛. https://tshock.co/");
args.Player.SendInfoMessage("该账户为超级管理, 请完成下面提示的步骤完成TShock配置:");
args.Player.SendInfoMessage("请使用该账户登录, 然后关闭超管验证功能.");
args.Player.SendInfoMessage("若明白, 请按照上述说的执行, 完成后, 执行 {0}auth-verify 来关闭验证功能.",Specifier);
return;
args.Player.SendSuccessMessage("你的新账户已经验证完毕, 同时 {0}auth 指令已被禁用.", Specifier);
args.Player.SendSuccessMessage("你可使用 {0}user 指令管理用户权限.", Specifier);
args.Player.SendSuccessMessage("验证系统会持续关闭. (删除 auth.lck 文件也不会开启).");
args.Player.SendSuccessMessage("你可以在官方论坛分享你的服务器, 跟其他管理交流经验等.-- https://tshock.co/");
args.Player.SendSuccessMessage("若需汉化方面的帮助, 请访问在Github的项目.-- https://github.com/mistzzt/TShock");
args.Player.SendSuccessMessage("感谢使用 TShock ! 感谢对该汉化版本的支持.");
FileTools.CreateFile(Path.Combine(TShock.SavePath, "auth.lck"));
File.Delete(Path.Combine(TShock.SavePath, "authcode.txt"));
TShock.AuthToken = 0;
return;
}

args.Player.SendErrorMessage("无效超管验证密钥. 该非法尝试将被记录.");
TShock.Log.Warn(args.Player.IP + " 尝试验证超管失败.");
}
if (args.Parameters.Count == 0)
{
args.Player.SendErrorMessage("你必须提供验证码!");
return;
}

private static void AuthVerify(CommandArgs args)
{
if (TShock.AuthToken == 0)
int givenCode;
if (!Int32.TryParse(args.Parameters[0], out givenCode) || givenCode != TShock.AuthToken)
{
args.Player.SendWarningMessage("看上去你已经关闭密钥验证功能了.");
args.Player.SendWarningMessage("若是不小心执行该指令, 删除 auth.lck 文件即可恢复功能.");
args.Player.SendErrorMessage("管理验证密码不正确; 该次尝试将被记录.");
TShock.Log.Warn(args.Player.IP + " 尝试使用一个不正确的超管验证码.");
return;
}

args.Player.SendSuccessMessage("你的新账户已经成功验证, 且密钥验证功能已经被关闭.");
args.Player.SendSuccessMessage("你以后可以使用 {0}user 管理用户. 记住不要删除 auth.lck 文件.", Specifier);
args.Player.SendSuccessMessage("你可以在官方论坛分享你的服务器, 跟其他管理交流经验等.-- https://tshock.co/");
args.Player.SendSuccessMessage("若需汉化方面的帮助, 请访问在Github的项目.-- https://github.com/mistzzt/TShock");
args.Player.SendSuccessMessage("感谢使用 TShock ! 感谢对该汉化版本的支持.");
FileTools.CreateFile(Path.Combine(TShock.SavePath, "auth.lck"));
File.Delete(Path.Combine(TShock.SavePath, "authcode.txt"));
TShock.AuthToken = 0;
if (args.Player.Group.Name != "superadmin")
args.Player.tempGroup = new SuperAdminGroup();

args.Player.SendInfoMessage("你现在已经拥有临时超级管理权, 退出游戏后就会被系统收回.");
args.Player.SendInfoMessage("若想长期使用, 请按照下面步骤创建永久超级管理账户.");
args.Player.SendInfoMessage("执行 -- {0}user add <用户名> <密码> superadmin", Specifier);
args.Player.SendInfoMessage("结果 -- <用户名>(<密码>) 会被添加到超管组.");
args.Player.SendInfoMessage("完成上述操作后, 执行 -- {0}login <用户名(若和玩家名一致, 可省略)> <密码> --.", Specifier);
args.Player.SendInfoMessage("若明白, 请按照上述说的执行; 完成后, 输入 {0}auth", Specifier);
return;
}

private static void ThirdPerson(CommandArgs args)
Expand Down
2 changes: 1 addition & 1 deletion TShockAPI/ConfigFile.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
TShock, a server mod for Terraria
Copyright (C) 2011-2015 Nyx Studios (fka. The TShock Team)
Copyright (C) 2011-2016 Nyx Studios (fka. The TShock Team)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion TShockAPI/DB/BanManager.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
TShock, a server mod for Terraria
Copyright (C) 2011-2015 Nyx Studios (fka. The TShock Team)
Copyright (C) 2011-2016 Nyx Studios (fka. The TShock Team)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion TShockAPI/DB/CharacterManager.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
TShock, a server mod for Terraria
Copyright (C) 2011-2015 Nyx Studios (fka. The TShock Team)
Copyright (C) 2011-2016 Nyx Studios (fka. The TShock Team)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
18 changes: 18 additions & 0 deletions TShockAPI/DB/DBTools.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
TShock, a server mod for Terraria
Copyright (C) 2011-2016 Nyx Studios (fka. The TShock Team)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

using System;
using System.Collections.Generic;
using System.Data;
Expand Down
2 changes: 1 addition & 1 deletion TShockAPI/DB/GroupManager.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
TShock, a server mod for Terraria
Copyright (C) 2011-2015 Nyx Studios (fka. The TShock Team)
Copyright (C) 2011-2016 Nyx Studios (fka. The TShock Team)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion TShockAPI/DB/IQueryBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
TShock, a server mod for Terraria
Copyright (C) 2011-2015 Nyx Studios (fka. The TShock Team)
Copyright (C) 2011-2016 Nyx Studios (fka. The TShock Team)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion TShockAPI/DB/ItemManager.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
TShock, a server mod for Terraria
Copyright (C) 2011-2015 Nyx Studios (fka. The TShock Team)
Copyright (C) 2011-2016 Nyx Studios (fka. The TShock Team)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion TShockAPI/DB/ProjectileManager.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
TShock, a server mod for Terraria
Copyright (C) 2011-2015 Nyx Studios (fka. The TShock Team)
Copyright (C) 2011-2016 Nyx Studios (fka. The TShock Team)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion TShockAPI/DB/RegionManager.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
TShock, a server mod for Terraria
Copyright (C) 2011-2015 Nyx Studios (fka. The TShock Team)
Copyright (C) 2011-2016 Nyx Studios (fka. The TShock Team)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion TShockAPI/DB/RememberedPosManager.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
TShock, a server mod for Terraria
Copyright (C) 2011-2015 Nyx Studios (fka. The TShock Team)
Copyright (C) 2011-2016 Nyx Studios (fka. The TShock Team)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion TShockAPI/DB/SqlColumn.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
TShock, a server mod for Terraria
Copyright (C) 2011-2015 Nyx Studios (fka. The TShock Team)
Copyright (C) 2011-2016 Nyx Studios (fka. The TShock Team)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion TShockAPI/DB/SqlTable.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
TShock, a server mod for Terraria
Copyright (C) 2011-2015 Nyx Studios (fka. The TShock Team)
Copyright (C) 2011-2016 Nyx Studios (fka. The TShock Team)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion TShockAPI/DB/SqlValue.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
TShock, a server mod for Terraria
Copyright (C) 2011-2015 Nyx Studios (fka. The TShock Team)
Copyright (C) 2011-2016 Nyx Studios (fka. The TShock Team)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
Loading

0 comments on commit a942269

Please sign in to comment.