Skip to content

Commit

Permalink
Merge pull request #742 from THEXN/master
Browse files Browse the repository at this point in the history
fix:修复玩家每次进服务器之前都会提示去注册
  • Loading branch information
Controllerdestiny authored Jan 23, 2025
2 parents fd4be20 + b96245a commit 6ac7945
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 13 deletions.
17 changes: 9 additions & 8 deletions src/Chameleon/Chameleon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class Chameleon : LazyPlugin

public override string Description => GetString("账户系统交互替换方案");

public override Version Version => new Version(1, 0, 9);
public override Version Version => new Version(1, 1, 0);


public Chameleon(Main game) : base(game)
Expand Down Expand Up @@ -106,16 +106,17 @@ private static void OnGetData(GetDataEventArgs args)

private static bool HandleConnecting(TSPlayer player)
{
if (Configuration.Instance.EnableForcedHint && !PrepareList.Contains(player.Name))
{
AddToList(player.Name);
Kick(player, string.Join("\n", Configuration.Instance.Hints), Configuration.Instance.Greeting);
return true;
}

var account = TShock.UserAccounts.GetUserAccountByName(player.Name);
if (account is null)
{
// 只有未注册的玩家才会看到强制提示
if (Configuration.Instance.EnableForcedHint && !PrepareList.Contains(player.Name))
{
AddToList(player.Name);
Kick(player, string.Join("\n", Configuration.Instance.Hints), Configuration.Instance.Greeting);
return true;
}

// 未注册 part.1
player.SetData(WaitPwd4Reg, true);
NetMessage.SendData((int) PacketTypes.PasswordRequired, player.Index);
Expand Down
2 changes: 1 addition & 1 deletion src/Chameleon/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ internal class Configuration : JsonConfigBase<Configuration>
{
" ↓↓ 请看下面的提示以进服 ↓↓",
" \r\n 看完下面的再点哦→",
" 1. 在\"服务器密码\"中输入自己的密码, 以后加服时输入这个密码即可,相当于为你自己的账号设置密码",
" 1. 在\"服务器密码\"中输入自己的密码, 以后加服时输入这个密码即可\n相当于为你自己的账号设置密码",
" 2. 阅读完毕后请重新加入"
};

Expand Down
2 changes: 2 additions & 0 deletions src/Chameleon/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
## 更新日志

```
v1.1.0
修复玩家每次进服务器之前都会提示去注册
v1.0.8
修正英文翻译
v1.0.5
Expand Down
4 changes: 2 additions & 2 deletions src/PermaBuff/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class Plugin : TerrariaPlugin
public override string Description => Assembly.GetExecutingAssembly().GetName().Name!;

public override string Name => System.Reflection.Assembly.GetExecutingAssembly().GetName().Name!;
public override Version Version => new Version(1, 0, 3);
public override Version Version => new Version(1, 0, 4);

private readonly string PATH = Path.Combine(TShock.SavePath, "permbuff.json");

Expand Down Expand Up @@ -149,7 +149,7 @@ private void GPbuff(CommandArgs args)
}
else
{
args.Player.SendErrorMessage("语法错误! 请输入/gpermabuff <玩家名> <buffid>");
args.Player.SendErrorMessage("语法错误! 请输入/gpermabuff <buffid> <玩家名>");
}
}

Expand Down
7 changes: 5 additions & 2 deletions src/PermaBuff/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
| 语法 | 别名 | 权限 | 说明 |
| -------------------------------- | :---: | :--------------: | :--------------------------------------: |
| /permabuff [buffID] | /pbuff | permabuff.use | 给予自身永久 buff(再次使用移除) |
| /gpermabuff [玩家名称] [buffid] | /gpbuff | gpermabuff.use | 给予玩家一个永久 buff(再次使用移除) |
| /gpermabuff [buffid] [玩家名称] | /gpbuff | gpermabuff.use | 给予玩家一个永久 buff(再次使用移除) |
| /clearbuffs | /cbuff | clearbuffs.use | 清空自身所有 buff |
| /clearbuffs all | /cbuff all | clearbuffs.admin | 清空所有玩家 buff |
| /reload || tshock.cfg.reload | 重载配置文件 |
Expand All @@ -24,7 +24,10 @@
## 更新日志

```
v 1.0.2
v1.0.4
修正指令提示
v1.0.2
加入清理所有BUFF子命令:/cbuff all
v.1.0.1
Expand Down

0 comments on commit 6ac7945

Please sign in to comment.