感谢大佬!我拿你的源码重新编译了,支持了1.4.0.5和1.4.2.3,提示文本改成了中文,然后去掉了语言配置支持。插件下载地址:最近没什么时间更新,大概只有元旦假期
估计是 language.json 文件编码格式不对,改成utf-8编码格式应该就好了。
(突然诈尸)没想到这小玩意会有那么多反响,感谢大佬对该插件的贡献和付出!感谢大佬!我拿你的源码重新编译了,支持了1.4.0.5和1.4.2.3,提示文本改成了中文,然后去掉了语言配置支持。插件下载地址:
你重复添加了吧!这个可能在下个版本修复 (这个作品好久之前的了,很多代码都不成熟)报错
[07/08/21 16:13:22] [Server API] Warning: Plugin "BetterWhitelist" has had an unhandled exception thrown by one of its ServerJoin handlers:
System.ArgumentException: 已添加了具有相同键的项。
在 System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
在 System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
在 System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
在 BetterWhitelist.Main.OnJoin(JoinEventArgs args)
在 TerrariaApi.Server.HandlerCollection`1.Invoke(ArgsType args)
好的,谢谢,坐等更新你重复添加了吧!这个可能在下个版本修复 (这个作品好久之前的了,很多代码都不成熟)
- 新增对Rest的支持,新增基本的Rest EndPoint
- 修复部分小bug
- 对最新版TShock进行支持
这玩意还有什么复杂的吗?json简化了?没传错文件吧?
是简化了,感觉之前那几个功能都不太需要
{
"status": "500",
"error": "Internal server error.",
"errormsg": "Index was out of range. Must be non-negative and less than the size of the collection.\nParameter name: index",
"stacktrace": " at System.Collections.Generic.List`1[T].get_Item (System.Int32 index) [0x0000c] in <12b418a7818c4ca0893feeaaf67f1e7f>:0 \n at BetterWhitelist.Main.DelPlayer (Rests.RestRequestArgs args) [0x0002a] in <cbd1a0d43ac2472cb5c768ead190cec9>:0 \n at Rests.SecureRestCommand.Execute (Rests.RestVerbs verbs, HttpServer.IParameterCollection parameters, Rests.SecureRest+TokenData tokenData, HttpServer.IRequest request, HttpServer.IHttpContext context) [0x00041] in <83f37e9b88a54d20b5a44206e189e9cf>:0 \n at Rests.SecureRest.ExecuteCommand (Rests.RestCommand cmd, Rests.RestVerbs verbs, HttpServer.IParameterCollection parms, HttpServer.IRequest request, HttpServer.IHttpContext context) [0x00115] in <83f37e9b88a54d20b5a44206e189e9cf>:0 \n at Rests.Rest.ProcessRequest (System.Object sender, HttpServer.RequestEventArgs e) [0x00125] in <83f37e9b88a54d20b5a44206e189e9cf>:0 "
}
{
"status": "200",
"players": "mix\n1\n"
}
好,有空进行改进改进使用api删除白名单时,配置文件里面删除成功但是api会报错
另外提个建议,获取白名单时采用数组显示应该会更好吧JSON:{ "status": "500", "error": "Internal server error.", "errormsg": "Index was out of range. Must be non-negative and less than the size of the collection.\nParameter name: index", "stacktrace": " at System.Collections.Generic.List`1[T].get_Item (System.Int32 index) [0x0000c] in <12b418a7818c4ca0893feeaaf67f1e7f>:0 \n at BetterWhitelist.Main.DelPlayer (Rests.RestRequestArgs args) [0x0002a] in <cbd1a0d43ac2472cb5c768ead190cec9>:0 \n at Rests.SecureRestCommand.Execute (Rests.RestVerbs verbs, HttpServer.IParameterCollection parameters, Rests.SecureRest+TokenData tokenData, HttpServer.IRequest request, HttpServer.IHttpContext context) [0x00041] in <83f37e9b88a54d20b5a44206e189e9cf>:0 \n at Rests.SecureRest.ExecuteCommand (Rests.RestCommand cmd, Rests.RestVerbs verbs, HttpServer.IParameterCollection parms, HttpServer.IRequest request, HttpServer.IHttpContext context) [0x00115] in <83f37e9b88a54d20b5a44206e189e9cf>:0 \n at Rests.Rest.ProcessRequest (System.Object sender, HttpServer.RequestEventArgs e) [0x00125] in <83f37e9b88a54d20b5a44206e189e9cf>:0 " }
JSON:{ "status": "200", "players": "mix\n1\n" }
尝试修复一个用户反馈的报错
将获取玩家列表返回的形式改成Json格式
* 这是一则由 Google AdSense 自动推荐的广告,与本站无关,不对其真实性与可靠性负责