Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

更新: 为HouseRegion插件添加重读配置 #117

Merged
merged 1 commit into from
May 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion HouseRegion/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using TerrariaApi.Server;
using TShockAPI;
using TShockAPI.DB;
using TShockAPI.Hooks;


namespace HouseRegion
Expand Down Expand Up @@ -89,12 +90,15 @@ private void RH()//读取房屋
#region 插件的各种初始化
public override void Initialize()// 插件启动时,用于初始化各种狗子
{
RC(); RD(); GetDataHandlers.InitGetDataHandler();//初始化配置值,RH要放在服务器开成后再读不然世界ID读不出
RC();
RD();
GetDataHandlers.InitGetDataHandler();//初始化配置值,RH要放在服务器开成后再读不然世界ID读不出
ServerApi.Hooks.GameInitialize.Register(this, OnInitialize);//钩住游戏初始化时
ServerApi.Hooks.NetGetData.Register(this, GetData);//收到数据
ServerApi.Hooks.NetGreetPlayer.Register(this, OnGreetPlayer);//玩家进入服务器
ServerApi.Hooks.ServerLeave.Register(this, OnLeave);//玩家退出服务器
ServerApi.Hooks.GamePostInitialize.Register(this, PostInitialize);//地图读入后
GeneralHooks.ReloadEvent += (_) => RC();
}
protected override void Dispose(bool disposing)// 插件关闭时
{
Expand Down
Loading